@elliemae/ds-pills 1.60.0 → 2.0.0-alpha.12

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 (184) hide show
  1. package/cjs/components/Pill.js +34 -42
  2. package/cjs/components/PillButton.js +29 -23
  3. package/cjs/components/PillGroup.js +29 -37
  4. package/cjs/components/index.js +10 -36
  5. package/cjs/components/styled.js +36 -70
  6. package/cjs/components/types/DropdownPill.js +53 -43
  7. package/cjs/components/types/InputPill.js +28 -46
  8. package/cjs/components/types/LabelPill.js +24 -20
  9. package/cjs/components/types/ReadOnlyPill.js +27 -23
  10. package/cjs/components/types/RemovablePill.js +31 -37
  11. package/cjs/components/types/ValuePill.js +28 -24
  12. package/cjs/components/types/index.js +12 -34
  13. package/cjs/deprecated/DropdownPill.js +41 -44
  14. package/cjs/deprecated/InputPill.js +36 -27
  15. package/cjs/deprecated/LabeledDropdownPills.js +43 -54
  16. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +74 -79
  17. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +81 -116
  18. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +95 -110
  19. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +5 -8
  20. package/cjs/deprecated/LabeledPills.js +19 -27
  21. package/cjs/deprecated/OverflowPill.js +25 -42
  22. package/cjs/deprecated/Pill.js +48 -38
  23. package/cjs/deprecated/PillGroup.js +31 -18
  24. package/cjs/deprecated/ReadOnlyPill.js +60 -76
  25. package/cjs/deprecated/RemovablePill.js +19 -26
  26. package/cjs/deprecated/index.js +26 -51
  27. package/cjs/index.d.js +0 -1
  28. package/cjs/index.js +36 -76
  29. package/cjs/props.js +21 -44
  30. package/cjs/utils.js +7 -4
  31. package/esm/components/Pill.js +21 -29
  32. package/esm/components/PillButton.js +27 -20
  33. package/esm/components/PillGroup.js +27 -35
  34. package/esm/components/index.js +0 -26
  35. package/esm/components/styled.js +36 -71
  36. package/esm/components/types/DropdownPill.js +48 -39
  37. package/esm/components/types/InputPill.js +25 -43
  38. package/esm/components/types/LabelPill.js +21 -18
  39. package/esm/components/types/ReadOnlyPill.js +24 -21
  40. package/esm/components/types/RemovablePill.js +26 -33
  41. package/esm/components/types/ValuePill.js +25 -22
  42. package/esm/components/types/index.js +0 -22
  43. package/esm/deprecated/DropdownPill.js +37 -38
  44. package/esm/deprecated/InputPill.js +32 -23
  45. package/esm/deprecated/LabeledDropdownPills.js +33 -44
  46. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +67 -70
  47. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +72 -105
  48. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +84 -96
  49. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +5 -8
  50. package/esm/deprecated/LabeledPills.js +14 -22
  51. package/esm/deprecated/OverflowPill.js +23 -39
  52. package/esm/deprecated/Pill.js +43 -32
  53. package/esm/deprecated/PillGroup.js +30 -18
  54. package/esm/deprecated/ReadOnlyPill.js +59 -74
  55. package/esm/deprecated/RemovablePill.js +18 -25
  56. package/esm/deprecated/index.js +0 -25
  57. package/esm/index.d.js +0 -1
  58. package/esm/index.js +0 -40
  59. package/esm/props.js +21 -44
  60. package/esm/utils.js +7 -4
  61. package/package.json +157 -23
  62. package/types/components/Pill.d.ts +5 -0
  63. package/types/components/PillButton.d.ts +5 -0
  64. package/types/components/PillGroup.d.ts +13 -0
  65. package/types/components/index.d.ts +3 -0
  66. package/types/components/styled.d.ts +24 -0
  67. package/types/components/types/DropdownPill.d.ts +3 -0
  68. package/types/components/types/InputPill.d.ts +3 -0
  69. package/types/components/types/LabelPill.d.ts +3 -0
  70. package/types/components/types/ReadOnlyPill.d.ts +3 -0
  71. package/types/components/types/RemovablePill.d.ts +3 -0
  72. package/types/components/types/ValuePill.d.ts +3 -0
  73. package/types/components/types/index.d.ts +6 -0
  74. package/types/deprecated/DropdownPill.d.ts +75 -0
  75. package/types/deprecated/InputPill.d.ts +10 -0
  76. package/types/deprecated/LabeledDropdownPills.d.ts +93 -0
  77. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +15 -0
  78. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +13 -0
  79. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +28 -0
  80. package/types/deprecated/LabeledDropdownPillsTypes/utils.d.ts +1 -0
  81. package/types/deprecated/LabeledPills.d.ts +59 -0
  82. package/types/deprecated/OverflowPill.d.ts +37 -0
  83. package/types/deprecated/Pill.d.ts +67 -0
  84. package/types/deprecated/PillGroup.d.ts +56 -0
  85. package/types/deprecated/ReadOnlyPill.d.ts +63 -0
  86. package/types/deprecated/RemovablePill.d.ts +55 -0
  87. package/types/deprecated/index.d.ts +9 -0
  88. package/types/index.d.ts +3 -0
  89. package/types/props.d.ts +92 -0
  90. package/types/tests/DSPill.test.d.ts +1 -0
  91. package/types/tests/DSPillGroup.test.d.ts +1 -0
  92. package/types/tests/events/DSPill.events.keyboard.test.d.ts +1 -0
  93. package/types/tests/events/DSPill.events.test.d.ts +1 -0
  94. package/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +1 -0
  95. package/types/tests/events/DSPillGroup.events.test.d.ts +1 -0
  96. package/types/utils.d.ts +4 -0
  97. package/cjs/components/Pill.js.map +0 -1
  98. package/cjs/components/PillButton.js.map +0 -1
  99. package/cjs/components/PillGroup.js.map +0 -1
  100. package/cjs/components/index.js.map +0 -1
  101. package/cjs/components/styled.js.map +0 -1
  102. package/cjs/components/types/DropdownPill.js.map +0 -1
  103. package/cjs/components/types/InputPill.js.map +0 -1
  104. package/cjs/components/types/LabelPill.js.map +0 -1
  105. package/cjs/components/types/ReadOnlyPill.js.map +0 -1
  106. package/cjs/components/types/RemovablePill.js.map +0 -1
  107. package/cjs/components/types/ValuePill.js.map +0 -1
  108. package/cjs/components/types/index.js.map +0 -1
  109. package/cjs/deprecated/DropdownPill.js.map +0 -1
  110. package/cjs/deprecated/InputPill.js.map +0 -1
  111. package/cjs/deprecated/LabeledDropdownPills.js.map +0 -1
  112. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -1
  113. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -1
  114. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -1
  115. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -1
  116. package/cjs/deprecated/LabeledPills.js.map +0 -1
  117. package/cjs/deprecated/OverflowPill.js.map +0 -1
  118. package/cjs/deprecated/Pill.js.map +0 -1
  119. package/cjs/deprecated/PillGroup.js.map +0 -1
  120. package/cjs/deprecated/ReadOnlyPill.js.map +0 -1
  121. package/cjs/deprecated/RemovablePill.js.map +0 -1
  122. package/cjs/deprecated/index.js.map +0 -1
  123. package/cjs/index.d.js.map +0 -1
  124. package/cjs/index.js.map +0 -1
  125. package/cjs/props.js.map +0 -1
  126. package/cjs/utils.js.map +0 -1
  127. package/components/Pill/package.json +0 -10
  128. package/components/PillButton/package.json +0 -10
  129. package/components/PillGroup/package.json +0 -10
  130. package/components/package.json +0 -10
  131. package/components/styled/package.json +0 -10
  132. package/components/types/DropdownPill/package.json +0 -10
  133. package/components/types/InputPill/package.json +0 -10
  134. package/components/types/LabelPill/package.json +0 -10
  135. package/components/types/ReadOnlyPill/package.json +0 -10
  136. package/components/types/RemovablePill/package.json +0 -10
  137. package/components/types/ValuePill/package.json +0 -10
  138. package/components/types/package.json +0 -10
  139. package/deprecated/DropdownPill/package.json +0 -10
  140. package/deprecated/InputPill/package.json +0 -10
  141. package/deprecated/LabeledDropdownPills/package.json +0 -10
  142. package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill/package.json +0 -10
  143. package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill/package.json +0 -10
  144. package/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill/package.json +0 -10
  145. package/deprecated/LabeledDropdownPillsTypes/utils/package.json +0 -10
  146. package/deprecated/LabeledPills/package.json +0 -10
  147. package/deprecated/OverflowPill/package.json +0 -10
  148. package/deprecated/Pill/package.json +0 -10
  149. package/deprecated/PillGroup/package.json +0 -10
  150. package/deprecated/ReadOnlyPill/package.json +0 -10
  151. package/deprecated/RemovablePill/package.json +0 -10
  152. package/deprecated/package.json +0 -10
  153. package/esm/components/Pill.js.map +0 -1
  154. package/esm/components/PillButton.js.map +0 -1
  155. package/esm/components/PillGroup.js.map +0 -1
  156. package/esm/components/index.js.map +0 -1
  157. package/esm/components/styled.js.map +0 -1
  158. package/esm/components/types/DropdownPill.js.map +0 -1
  159. package/esm/components/types/InputPill.js.map +0 -1
  160. package/esm/components/types/LabelPill.js.map +0 -1
  161. package/esm/components/types/ReadOnlyPill.js.map +0 -1
  162. package/esm/components/types/RemovablePill.js.map +0 -1
  163. package/esm/components/types/ValuePill.js.map +0 -1
  164. package/esm/components/types/index.js.map +0 -1
  165. package/esm/deprecated/DropdownPill.js.map +0 -1
  166. package/esm/deprecated/InputPill.js.map +0 -1
  167. package/esm/deprecated/LabeledDropdownPills.js.map +0 -1
  168. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -1
  169. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -1
  170. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -1
  171. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -1
  172. package/esm/deprecated/LabeledPills.js.map +0 -1
  173. package/esm/deprecated/OverflowPill.js.map +0 -1
  174. package/esm/deprecated/Pill.js.map +0 -1
  175. package/esm/deprecated/PillGroup.js.map +0 -1
  176. package/esm/deprecated/ReadOnlyPill.js.map +0 -1
  177. package/esm/deprecated/RemovablePill.js.map +0 -1
  178. package/esm/deprecated/index.js.map +0 -1
  179. package/esm/index.d.js.map +0 -1
  180. package/esm/index.js.map +0 -1
  181. package/esm/props.js.map +0 -1
  182. package/esm/utils.js.map +0 -1
  183. package/props/package.json +0 -10
  184. package/utils/package.json +0 -10
@@ -1,36 +1,26 @@
1
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
2
- import React, { useRef, useState, useEffect } from 'react';
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';
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
- import '@babel/runtime/helpers/esm/extends';
8
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
9
- import '@babel/runtime/helpers/esm/defineProperty';
10
- import '@elliemae/ds-classnames';
11
11
 
12
12
  function OverflowPill(_ref) {
13
- var _ref$containerProps = _ref.containerProps,
14
- containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
15
- _ref$label = _ref.label,
16
- label = _ref$label === void 0 ? '' : _ref$label,
17
- _ref$options = _ref.options,
18
- options = _ref$options === void 0 ? [] : _ref$options;
19
- var ref = useRef(null);
20
-
21
- var _useState = useState(false),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- tooltipIsOpen = _useState2[0],
24
- setTooltipIsOpen = _useState2[1];
25
-
26
- var _useState3 = useState(''),
27
- _useState4 = _slicedToArray(_useState3, 2),
28
- tooltipText = _useState4[0],
29
- setTooltipText = _useState4[1];
30
-
31
- useEffect(function () {
32
- var text = '';
33
- options.forEach(function (option) {
13
+ let {
14
+ containerProps = {},
15
+ label = '',
16
+ options = []
17
+ } = _ref;
18
+ const ref = useRef(null);
19
+ const [tooltipIsOpen, setTooltipIsOpen] = useState(false);
20
+ const [tooltipText, setTooltipText] = useState('');
21
+ useEffect(() => {
22
+ let text = '';
23
+ options.forEach(option => {
34
24
  if (!tooltipText || option === options[0]) {
35
25
  text = "".concat(option.label);
36
26
  } else {
@@ -40,27 +30,23 @@ function OverflowPill(_ref) {
40
30
  setTooltipText(text);
41
31
  }, [options]);
42
32
  useFocusGroupItem(ref);
43
- return /*#__PURE__*/React.createElement(DSTooltip, {
33
+ return /*#__PURE__*/_jsx(DSTooltip, {
44
34
  isOpen: tooltipIsOpen,
45
35
  title: tooltipText,
46
36
  zIndex: 11,
47
- triggerComponent: /*#__PURE__*/React.createElement(Pill, {
37
+ triggerComponent: /*#__PURE__*/_jsx(Pill, {
48
38
  className: "overflow-pill",
49
39
  containerProps: containerProps,
50
40
  innerRef: ref,
51
41
  label: label,
52
42
  tabIndex: -1,
53
- onMouseEnter: function onMouseEnter() {
54
- return setTooltipIsOpen(true);
55
- },
56
- onMouseLeave: function onMouseLeave() {
57
- return setTooltipIsOpen(false);
58
- }
43
+ onMouseEnter: () => setTooltipIsOpen(true),
44
+ onMouseLeave: () => setTooltipIsOpen(false)
59
45
  })
60
46
  });
61
47
  }
62
48
 
63
- var props = {
49
+ const props = {
64
50
  /** props to inject to pill wrapper */
65
51
  containerProps: PropTypes.object.description('props to inject to pill wrapper'),
66
52
 
@@ -70,9 +56,7 @@ var props = {
70
56
  /** overflow pills options */
71
57
  options: PropTypes.array.description('overflow pills options')
72
58
  };
73
- OverflowPill.propTypes = props;
74
- var DSOverflowPillWithSchema = describe(OverflowPill);
59
+ const DSOverflowPillWithSchema = describe(OverflowPill);
75
60
  DSOverflowPillWithSchema.propTypes = props;
76
61
 
77
62
  export { DSOverflowPillWithSchema, OverflowPill };
78
- //# sourceMappingURL=OverflowPill.js.map
@@ -1,44 +1,57 @@
1
- import _extends from '@babel/runtime/helpers/esm/extends';
2
- import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
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';
3
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
- import React from 'react';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
9
+ import 'react';
5
10
  import { PropTypes, describe } from 'react-desc';
6
11
  import { aggregatedClasses } from '@elliemae/ds-classnames';
12
+ import { jsxs } from 'react/jsx-runtime';
13
+
14
+ const _excluded = ["containerProps", "label", "leftAddon", "rightAddon", "variant", "size"];
7
15
 
8
- var _excluded = ["containerProps", "label", "leftAddon", "rightAddon", "variant", "size"];
9
- var pillBlockName = 'pill';
10
- var PillWrapper = aggregatedClasses('div')(pillBlockName, null, function (_ref) {
11
- var _ref2;
16
+ 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; }
12
17
 
13
- var size = _ref.size,
14
- variant = _ref.variant;
15
- return _ref2 = {}, _defineProperty(_ref2, variant, !!variant), _defineProperty(_ref2, size, !!size), _ref2;
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; }
19
+ const pillBlockName = 'pill';
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
+ };
16
29
  });
17
- var PillLabel = aggregatedClasses('span')(pillBlockName, 'label');
18
- var PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');
30
+ const PillLabel = aggregatedClasses('span')(pillBlockName, 'label');
31
+ const PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');
19
32
 
20
- function Pill(_ref3) {
21
- var _ref3$containerProps = _ref3.containerProps,
22
- containerProps = _ref3$containerProps === void 0 ? {} : _ref3$containerProps,
23
- _ref3$label = _ref3.label,
24
- label = _ref3$label === void 0 ? '' : _ref3$label,
25
- leftAddon = _ref3.leftAddon,
26
- rightAddon = _ref3.rightAddon,
27
- _ref3$variant = _ref3.variant,
28
- variant = _ref3$variant === void 0 ? 'value' : _ref3$variant,
29
- _ref3$size = _ref3.size,
30
- size = _ref3$size === void 0 ? 'm' : _ref3$size,
31
- otherProps = _objectWithoutProperties(_ref3, _excluded);
33
+ function Pill(_ref2) {
34
+ let {
35
+ containerProps = {},
36
+ label = '',
37
+ leftAddon,
38
+ rightAddon,
39
+ variant = 'value',
40
+ size = 'm'
41
+ } = _ref2,
42
+ otherProps = _objectWithoutProperties(_ref2, _excluded);
32
43
 
33
- return /*#__PURE__*/React.createElement(PillWrapper, _extends({}, containerProps, {
44
+ return /*#__PURE__*/jsxs(PillWrapper, _objectSpread(_objectSpread(_objectSpread({}, containerProps), {}, {
34
45
  classProps: {
35
- variant: variant,
36
- size: size
46
+ variant,
47
+ size
37
48
  }
38
- }, otherProps), leftAddon && /*#__PURE__*/React.createElement(PillAddon, null, leftAddon), /*#__PURE__*/React.createElement(PillLabel, null, label), rightAddon && /*#__PURE__*/React.createElement(PillAddon, null, rightAddon));
49
+ }, otherProps), {}, {
50
+ children: [leftAddon && /*#__PURE__*/_jsx(PillAddon, {}, void 0, leftAddon), /*#__PURE__*/_jsx(PillLabel, {}, void 0, label), rightAddon && /*#__PURE__*/_jsx(PillAddon, {}, void 0, rightAddon)]
51
+ }));
39
52
  }
40
53
 
41
- var props = {
54
+ const props = {
42
55
  /** props to inject to pill wrapper */
43
56
  containerProps: PropTypes.object.description('props to inject to pill wrapper'),
44
57
 
@@ -57,9 +70,7 @@ var props = {
57
70
  /** addon component to right */
58
71
  rightAddon: PropTypes.node.description('addon component to right')
59
72
  };
60
- Pill.propTypes = props;
61
- var DSPillWithSchema = describe(Pill);
73
+ const DSPillWithSchema = describe(Pill);
62
74
  DSPillWithSchema.propTypes = props;
63
75
 
64
76
  export { DSPillWithSchema, Pill, Pill as default };
65
- //# sourceMappingURL=Pill.js.map
@@ -1,19 +1,31 @@
1
- import React from 'react';
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';
6
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'react';
2
9
  import { PropTypes, describe } from 'react-desc';
3
10
  import { aggregatedClasses } from '@elliemae/ds-classnames';
4
11
  import FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
5
-
6
- var pillGroupBlockName = 'pill-group';
7
- var Container = aggregatedClasses('div')(pillGroupBlockName);
8
-
9
- var PillGroup = function PillGroup(_ref) {
10
- var _ref$containerProps = _ref.containerProps,
11
- containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
12
- onFocusNextGroup = _ref.onFocusNextGroup,
13
- onFocusPreviousGroup = _ref.onFocusPreviousGroup,
14
- onFocusGroupSet = _ref.onFocusGroupSet,
15
- children = _ref.children;
16
- return /*#__PURE__*/React.createElement(FocusGroupProvider, {
12
+ import { jsx } from 'react/jsx-runtime';
13
+
14
+ 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
+
16
+ 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 pillGroupBlockName = 'pill-group';
18
+ const Container = aggregatedClasses('div')(pillGroupBlockName);
19
+
20
+ const PillGroup = _ref => {
21
+ let {
22
+ containerProps = {},
23
+ onFocusNextGroup,
24
+ onFocusPreviousGroup,
25
+ onFocusGroupSet,
26
+ children
27
+ } = _ref;
28
+ return /*#__PURE__*/_jsx(FocusGroupProvider, {
17
29
  keyBindings: {
18
30
  Tab: 'next'
19
31
  },
@@ -21,10 +33,12 @@ var PillGroup = function PillGroup(_ref) {
21
33
  onFocusNextGroup: onFocusNextGroup,
22
34
  onFocusPreviousGroup: onFocusPreviousGroup,
23
35
  orientation: "horizontal"
24
- }, /*#__PURE__*/React.createElement(Container, containerProps, children));
36
+ }, void 0, /*#__PURE__*/jsx(Container, _objectSpread(_objectSpread({}, containerProps), {}, {
37
+ children: children
38
+ })));
25
39
  };
26
40
 
27
- var props = {
41
+ const props = {
28
42
  /** props injected to component wrapper */
29
43
  containerProps: PropTypes.object.description('props injected to component wrapper'),
30
44
 
@@ -40,9 +54,7 @@ var props = {
40
54
  /** pill components */
41
55
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired.description('pill components')
42
56
  };
43
- PillGroup.propTypes = props;
44
- var DSPillGroupWithSchema = describe(PillGroup);
57
+ const DSPillGroupWithSchema = describe(PillGroup);
45
58
  DSPillGroupWithSchema.propTypes = props;
46
59
 
47
60
  export { Container, DSPillGroupWithSchema, PillGroup };
48
- //# sourceMappingURL=PillGroup.js.map
@@ -1,86 +1,73 @@
1
- import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
2
- import React, { useRef, useState } from 'react';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import { useRef, useState } from 'react';
3
4
  import { PropTypes, describe } from 'react-desc';
4
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
- import '@babel/runtime/helpers/esm/extends';
9
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
10
- import '@babel/runtime/helpers/esm/defineProperty';
11
- import '@elliemae/ds-classnames';
9
+ import { jsxs, Fragment } from 'react/jsx-runtime';
12
10
 
13
- var ReadOnlyPill = function ReadOnlyPill(_ref) {
14
- var _ref$containerProps = _ref.containerProps,
15
- containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
16
- _ref$modalContent = _ref.modalContent,
17
- modalContent = _ref$modalContent === void 0 ? '' : _ref$modalContent,
18
- _ref$label = _ref.label,
19
- label = _ref$label === void 0 ? '' : _ref$label,
20
- leftAddon = _ref.leftAddon,
21
- _ref$modalTitle = _ref.modalTitle,
22
- modalTitle = _ref$modalTitle === void 0 ? '' : _ref$modalTitle,
23
- _ref$tooltipText = _ref.tooltipText,
24
- tooltipText = _ref$tooltipText === void 0 ? '' : _ref$tooltipText;
25
- var ref = useRef(null);
11
+ const ReadOnlyPill = _ref => {
12
+ let {
13
+ containerProps = {},
14
+ modalContent = '',
15
+ label = '',
16
+ leftAddon,
17
+ modalTitle = '',
18
+ tooltipText = ''
19
+ } = _ref;
20
+ const ref = useRef(null);
21
+ const [isModalOpen, setIsModalOpen] = useState(false);
22
+ const [isTooltipOpen, setIsTooltipOpen] = useState(false);
26
23
 
27
- var _useState = useState(false),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- isModalOpen = _useState2[0],
30
- setIsModalOpen = _useState2[1];
31
-
32
- var _useState3 = useState(false),
33
- _useState4 = _slicedToArray(_useState3, 2),
34
- isTooltipOpen = _useState4[0],
35
- setIsTooltipOpen = _useState4[1];
36
-
37
- var toggle = function toggle() {
24
+ const toggle = () => {
38
25
  setIsModalOpen(!isModalOpen);
39
26
  };
40
27
 
41
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pill, {
42
- "data-testid": "read-only-pill",
43
- className: "removable-pill",
44
- containerProps: containerProps,
45
- innerRef: ref,
46
- label: label,
47
- leftAddon: leftAddon,
48
- rightAddon: /*#__PURE__*/React.createElement(Popover, {
49
- isOpen: tooltipText && isTooltipOpen,
50
- content: tooltipText,
51
- placement: "top",
52
- showArrow: true,
53
- renderTrigger: function renderTrigger(_ref2) {
54
- var ref = _ref2.ref;
55
- return /*#__PURE__*/React.createElement(InfoCircleSmall, {
56
- role: "button",
57
- "data-testid": "read-only-info-btn",
58
- className: "remove-pill-button",
59
- onClick: toggle,
60
- onMouseEnter: function onMouseEnter() {
61
- return setIsTooltipOpen(true);
62
- },
63
- onMouseLeave: function onMouseLeave() {
64
- return setIsTooltipOpen(false);
65
- },
66
- color: ['brand-primary', '600'],
67
- innerRef: ref
68
- });
69
- }
70
- }),
71
- tabIndex: -1
72
- }), /*#__PURE__*/React.createElement(DSModal, {
73
- isOpen: isModalOpen,
74
- showClose: true,
75
- shouldCloseOnOverlayClick: true,
76
- modalTitle: modalTitle,
77
- modalType: MODAL_TYPE_V2.INFORMATION,
78
- onClose: toggle,
79
- version: 2
80
- }, modalContent));
28
+ return /*#__PURE__*/jsxs(Fragment, {
29
+ children: [/*#__PURE__*/_jsx(Pill, {
30
+ "data-testid": "read-only-pill",
31
+ className: "removable-pill",
32
+ containerProps: containerProps,
33
+ innerRef: ref,
34
+ label: label,
35
+ leftAddon: leftAddon,
36
+ rightAddon: /*#__PURE__*/_jsx(Popover, {
37
+ isOpen: tooltipText && isTooltipOpen,
38
+ content: tooltipText,
39
+ placement: "top",
40
+ showArrow: true,
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
+ }
56
+ }),
57
+ tabIndex: -1
58
+ }), /*#__PURE__*/_jsx(DSModal, {
59
+ isOpen: isModalOpen,
60
+ showClose: true,
61
+ shouldCloseOnOverlayClick: true,
62
+ modalTitle: modalTitle,
63
+ modalType: MODAL_TYPE_V2.INFORMATION,
64
+ onClose: toggle,
65
+ version: 2
66
+ }, void 0, modalContent)]
67
+ });
81
68
  };
82
69
 
83
- var props = {
70
+ const props = {
84
71
  /** props injected to component wrapper */
85
72
  containerProps: PropTypes.object.description('props injected to component wrapper'),
86
73
 
@@ -97,9 +84,7 @@ var props = {
97
84
  modalTitle: PropTypes.string.description('read only pill modal title'),
98
85
  tooltipText: PropTypes.string.description('text to display in tooltip')
99
86
  };
100
- ReadOnlyPill.propTypes = props;
101
- var DSReadOnlyPillWithSchema = describe(ReadOnlyPill);
87
+ const DSReadOnlyPillWithSchema = describe(ReadOnlyPill);
102
88
  DSReadOnlyPillWithSchema.propTypes = props;
103
89
 
104
90
  export { DSReadOnlyPillWithSchema, ReadOnlyPill };
105
- //# sourceMappingURL=ReadOnlyPill.js.map
@@ -1,29 +1,24 @@
1
- import React, { useRef } from 'react';
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import { useRef } from 'react';
2
3
  import { PropTypes, describe } from 'react-desc';
3
4
  import { isFunction } from '@elliemae/ds-utilities';
4
5
  import { CloseXsmall } from '@elliemae/ds-icons';
5
6
  import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
6
7
  import { Pill } from './Pill.js';
7
- import '@babel/runtime/helpers/esm/extends';
8
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
9
- import '@babel/runtime/helpers/esm/defineProperty';
10
- import '@elliemae/ds-classnames';
11
8
 
12
9
  function RemovablePill(_ref) {
13
- var _ref$containerProps = _ref.containerProps,
14
- containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
15
- _ref$label = _ref.label,
16
- label = _ref$label === void 0 ? '' : _ref$label,
17
- onRemove = _ref.onRemove,
18
- _ref$size = _ref.size,
19
- size = _ref$size === void 0 ? 'm' : _ref$size,
20
- leftAddon = _ref.leftAddon;
21
- var ref = useRef(null);
22
-
23
- var _useFocusGroupItem = useFocusGroupItem(ref),
24
- focusPrevious = _useFocusGroupItem.focusPrevious;
25
-
26
- return /*#__PURE__*/React.createElement(Pill, {
10
+ let {
11
+ containerProps = {},
12
+ label = '',
13
+ onRemove,
14
+ size = 'm',
15
+ leftAddon
16
+ } = _ref;
17
+ const ref = useRef(null);
18
+ const {
19
+ focusPrevious
20
+ } = useFocusGroupItem(ref);
21
+ return /*#__PURE__*/_jsx(Pill, {
27
22
  className: "removable-pill",
28
23
  "data-testid": "removable-pill",
29
24
  containerProps: containerProps,
@@ -31,13 +26,13 @@ function RemovablePill(_ref) {
31
26
  size: size,
32
27
  label: label,
33
28
  leftAddon: leftAddon,
34
- onKeyDown: function onKeyDown(e) {
29
+ onKeyDown: e => {
35
30
  if (e.key === 'Backspace' && isFunction(onRemove)) {
36
31
  onRemove();
37
32
  if (isFunction(focusPrevious)) focusPrevious();
38
33
  }
39
34
  },
40
- rightAddon: /*#__PURE__*/React.createElement(CloseXsmall, {
35
+ rightAddon: /*#__PURE__*/_jsx(CloseXsmall, {
41
36
  role: "button",
42
37
  "data-testid": "remove-pill-button",
43
38
  className: "remove-pill-button",
@@ -47,7 +42,7 @@ function RemovablePill(_ref) {
47
42
  });
48
43
  }
49
44
 
50
- var props = {
45
+ const props = {
51
46
  /** props injected to component wrapper */
52
47
  containerProps: PropTypes.object.description('props injected to component wrapper'),
53
48
 
@@ -63,9 +58,7 @@ var props = {
63
58
  /** addon component to left */
64
59
  leftAddon: PropTypes.node.description('addon component to left')
65
60
  };
66
- RemovablePill.propTypes = props;
67
- var DSRemovablePillWithSchema = describe(RemovablePill);
61
+ const DSRemovablePillWithSchema = describe(RemovablePill);
68
62
  DSRemovablePillWithSchema.propTypes = props;
69
63
 
70
64
  export { DSRemovablePillWithSchema, RemovablePill };
71
- //# sourceMappingURL=RemovablePill.js.map
@@ -6,28 +6,3 @@ export { DSDropdownPillWithSchema, DropdownPill } from './DropdownPill.js';
6
6
  export { DSRemovablePillWithSchema, RemovablePill } from './RemovablePill.js';
7
7
  export { DSReadOnlyPillWithSchema, ReadOnlyPill } from './ReadOnlyPill.js';
8
8
  export { DSOverflowPillWithSchema, OverflowPill } from './OverflowPill.js';
9
- import '@babel/runtime/helpers/esm/extends';
10
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
11
- import '@babel/runtime/helpers/esm/defineProperty';
12
- import 'react';
13
- import 'react-desc';
14
- import '@elliemae/ds-classnames';
15
- import '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
16
- import './LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js';
17
- import '@babel/runtime/helpers/esm/slicedToArray';
18
- import 'prop-types';
19
- import '@elliemae/ds-utilities';
20
- import './InputPill.js';
21
- import '@elliemae/ds-icons';
22
- import '@elliemae/ds-form';
23
- import './LabeledDropdownPillsTypes/utils.js';
24
- import 'lodash';
25
- import '@elliemae/ds-dropdownmenu';
26
- import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
27
- import './LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js';
28
- import '@elliemae/ds-tooltip';
29
- import './LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js';
30
- import '@babel/runtime/helpers/esm/toConsumableArray';
31
- import '@elliemae/ds-modal';
32
- import '@elliemae/ds-popover';
33
- //# sourceMappingURL=index.js.map
package/esm/index.d.js CHANGED
@@ -1,2 +1 @@
1
1
 
2
- //# sourceMappingURL=index.d.js.map
package/esm/index.js CHANGED
@@ -9,43 +9,3 @@ export { DSOverflowPillWithSchema, OverflowPill } from './deprecated/OverflowPil
9
9
  export { DSPillV2, DSPillV2WithSchema } from './components/Pill.js';
10
10
  export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema } from './components/PillGroup.js';
11
11
  export { DSPillButton, DSPillButtonWithSchema } from './components/PillButton.js';
12
- import '@babel/runtime/helpers/esm/extends';
13
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
14
- import '@babel/runtime/helpers/esm/defineProperty';
15
- import 'react';
16
- import 'react-desc';
17
- import '@elliemae/ds-classnames';
18
- import '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
19
- import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js';
20
- import '@babel/runtime/helpers/esm/slicedToArray';
21
- import 'prop-types';
22
- import '@elliemae/ds-utilities';
23
- import './deprecated/InputPill.js';
24
- import '@elliemae/ds-icons';
25
- import '@elliemae/ds-form';
26
- import './deprecated/LabeledDropdownPillsTypes/utils.js';
27
- import 'lodash';
28
- import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js';
29
- import './deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js';
30
- import '@babel/runtime/helpers/esm/toConsumableArray';
31
- import '@elliemae/ds-dropdownmenu';
32
- import '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
33
- import '@elliemae/ds-modal';
34
- import '@elliemae/ds-popover';
35
- import '@elliemae/ds-tooltip';
36
- import '@elliemae/ds-props-helpers';
37
- import './props.js';
38
- import './components/types/DropdownPill.js';
39
- import 'uid';
40
- import '@elliemae/ds-truncated-tooltip-text';
41
- import './components/styled.js';
42
- import 'styled-components';
43
- import '@elliemae/ds-grid';
44
- import '@elliemae/ds-button';
45
- import './utils.js';
46
- import './components/types/InputPill.js';
47
- import './components/types/LabelPill.js';
48
- import './components/types/ReadOnlyPill.js';
49
- import './components/types/RemovablePill.js';
50
- import './components/types/ValuePill.js';
51
- //# sourceMappingURL=index.js.map