@elliemae/ds-pills 2.2.0-alpha.3 → 2.2.0-next.2

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 (124) hide show
  1. package/cjs/components/Pill.js +49 -56
  2. package/cjs/components/PillButton.js +52 -54
  3. package/cjs/components/PillGroup.js +53 -61
  4. package/cjs/components/index.js +17 -30
  5. package/cjs/components/styled.js +78 -228
  6. package/cjs/components/types/DropdownPill.js +77 -79
  7. package/cjs/components/types/InputPill.js +48 -58
  8. package/cjs/components/types/LabelPill.js +38 -44
  9. package/cjs/components/types/ReadOnlyPill.js +43 -48
  10. package/cjs/components/types/RemovablePill.js +53 -60
  11. package/cjs/components/types/ValuePill.js +43 -48
  12. package/cjs/components/types/index.js +19 -33
  13. package/cjs/deprecated/DropdownPill.js +101 -80
  14. package/cjs/deprecated/InputPill.js +69 -67
  15. package/cjs/deprecated/LabeledDropdownPills.js +96 -92
  16. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +94 -91
  17. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +114 -106
  18. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +127 -119
  19. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +15 -39
  20. package/cjs/deprecated/LabeledPills.js +52 -65
  21. package/cjs/deprecated/OverflowPill.js +53 -59
  22. package/cjs/deprecated/Pill.js +82 -67
  23. package/cjs/deprecated/PillGroup.js +68 -68
  24. package/cjs/deprecated/ReadOnlyPill.js +94 -93
  25. package/cjs/deprecated/RemovablePill.js +57 -61
  26. package/cjs/deprecated/index.js +33 -43
  27. package/cjs/index.d.js +2 -27
  28. package/cjs/index.js +43 -37
  29. package/cjs/props.js +46 -72
  30. package/cjs/utils.js +25 -43
  31. package/esm/components/Pill.js +31 -18
  32. package/esm/components/PillButton.js +39 -22
  33. package/esm/components/PillGroup.js +38 -28
  34. package/esm/components/index.js +3 -5
  35. package/esm/components/styled.js +66 -205
  36. package/esm/components/types/DropdownPill.js +67 -50
  37. package/esm/components/types/InputPill.js +35 -25
  38. package/esm/components/types/LabelPill.js +29 -15
  39. package/esm/components/types/ReadOnlyPill.js +34 -19
  40. package/esm/components/types/RemovablePill.js +44 -31
  41. package/esm/components/types/ValuePill.js +34 -19
  42. package/esm/components/types/index.js +6 -8
  43. package/esm/deprecated/DropdownPill.js +86 -49
  44. package/esm/deprecated/InputPill.js +59 -38
  45. package/esm/deprecated/LabeledDropdownPills.js +81 -59
  46. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +84 -60
  47. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +94 -65
  48. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +108 -79
  49. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +10 -9
  50. package/esm/deprecated/LabeledPills.js +41 -34
  51. package/esm/deprecated/OverflowPill.js +37 -25
  52. package/esm/deprecated/Pill.js +71 -39
  53. package/esm/deprecated/PillGroup.js +56 -39
  54. package/esm/deprecated/ReadOnlyPill.js +79 -60
  55. package/esm/deprecated/RemovablePill.js +45 -30
  56. package/esm/deprecated/index.js +8 -14
  57. package/esm/index.d.js +1 -2
  58. package/esm/index.js +11 -8
  59. package/esm/props.js +36 -42
  60. package/esm/utils.js +23 -16
  61. package/package.json +15 -15
  62. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +1 -3
  63. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +1 -3
  64. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -1
  65. package/cjs/components/Pill.js.map +0 -7
  66. package/cjs/components/PillButton.js.map +0 -7
  67. package/cjs/components/PillGroup.js.map +0 -7
  68. package/cjs/components/index.js.map +0 -7
  69. package/cjs/components/styled.js.map +0 -7
  70. package/cjs/components/types/DropdownPill.js.map +0 -7
  71. package/cjs/components/types/InputPill.js.map +0 -7
  72. package/cjs/components/types/LabelPill.js.map +0 -7
  73. package/cjs/components/types/ReadOnlyPill.js.map +0 -7
  74. package/cjs/components/types/RemovablePill.js.map +0 -7
  75. package/cjs/components/types/ValuePill.js.map +0 -7
  76. package/cjs/components/types/index.js.map +0 -7
  77. package/cjs/deprecated/DropdownPill.js.map +0 -7
  78. package/cjs/deprecated/InputPill.js.map +0 -7
  79. package/cjs/deprecated/LabeledDropdownPills.js.map +0 -7
  80. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
  81. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
  82. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
  83. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
  84. package/cjs/deprecated/LabeledPills.js.map +0 -7
  85. package/cjs/deprecated/OverflowPill.js.map +0 -7
  86. package/cjs/deprecated/Pill.js.map +0 -7
  87. package/cjs/deprecated/PillGroup.js.map +0 -7
  88. package/cjs/deprecated/ReadOnlyPill.js.map +0 -7
  89. package/cjs/deprecated/RemovablePill.js.map +0 -7
  90. package/cjs/deprecated/index.js.map +0 -7
  91. package/cjs/index.d.js.map +0 -7
  92. package/cjs/index.js.map +0 -7
  93. package/cjs/props.js.map +0 -7
  94. package/cjs/utils.js.map +0 -7
  95. package/esm/components/Pill.js.map +0 -7
  96. package/esm/components/PillButton.js.map +0 -7
  97. package/esm/components/PillGroup.js.map +0 -7
  98. package/esm/components/index.js.map +0 -7
  99. package/esm/components/styled.js.map +0 -7
  100. package/esm/components/types/DropdownPill.js.map +0 -7
  101. package/esm/components/types/InputPill.js.map +0 -7
  102. package/esm/components/types/LabelPill.js.map +0 -7
  103. package/esm/components/types/ReadOnlyPill.js.map +0 -7
  104. package/esm/components/types/RemovablePill.js.map +0 -7
  105. package/esm/components/types/ValuePill.js.map +0 -7
  106. package/esm/components/types/index.js.map +0 -7
  107. package/esm/deprecated/DropdownPill.js.map +0 -7
  108. package/esm/deprecated/InputPill.js.map +0 -7
  109. package/esm/deprecated/LabeledDropdownPills.js.map +0 -7
  110. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
  111. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
  112. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
  113. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
  114. package/esm/deprecated/LabeledPills.js.map +0 -7
  115. package/esm/deprecated/OverflowPill.js.map +0 -7
  116. package/esm/deprecated/Pill.js.map +0 -7
  117. package/esm/deprecated/PillGroup.js.map +0 -7
  118. package/esm/deprecated/ReadOnlyPill.js.map +0 -7
  119. package/esm/deprecated/RemovablePill.js.map +0 -7
  120. package/esm/deprecated/index.js.map +0 -7
  121. package/esm/index.d.js.map +0 -7
  122. package/esm/index.js.map +0 -7
  123. package/esm/props.js.map +0 -7
  124. package/esm/utils.js.map +0 -7
@@ -1,46 +1,53 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { PillGroup } from "./PillGroup";
5
- import { RemovablePill } from "./RemovablePill";
6
- import { Pill } from "./Pill";
7
- function LabeledPills({
8
- children,
9
- label = "",
10
- leftAddon,
11
- onFocusGroupSet,
12
- onFocusNextGroup,
13
- onFocusPreviousGroup
14
- }) {
15
- return /* @__PURE__ */ React2.createElement(PillGroup, {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { PropTypes, describe } from 'react-desc';
4
+ import { PillGroup } from './PillGroup.js';
5
+ import { RemovablePill } from './RemovablePill.js';
6
+ import { Pill } from './Pill.js';
7
+
8
+ function LabeledPills(_ref) {
9
+ let {
10
+ children,
11
+ label = '',
12
+ leftAddon,
16
13
  onFocusGroupSet,
17
14
  onFocusNextGroup,
18
15
  onFocusPreviousGroup
19
- }, /* @__PURE__ */ React2.createElement(Pill, {
20
- label,
21
- leftAddon,
16
+ } = _ref;
17
+ return /*#__PURE__*/_jsx(PillGroup, {
18
+ onFocusGroupSet: onFocusGroupSet,
19
+ onFocusNextGroup: onFocusNextGroup,
20
+ onFocusPreviousGroup: onFocusPreviousGroup
21
+ }, void 0, /*#__PURE__*/_jsx(Pill, {
22
+ label: label,
23
+ leftAddon: leftAddon,
22
24
  variant: "title",
23
25
  "data-testid": "pill-title"
24
26
  }), children);
25
27
  }
28
+
26
29
  const props = {
27
- label: PropTypes.string.isRequired.description("pill text label"),
30
+ /** labeled pill text label */
31
+ label: PropTypes.string.isRequired.description('pill text label'),
32
+
33
+ /** pill to add the label to */
28
34
  children: PropTypes.arrayOf(PropTypes.shape({
29
- type: PropTypes.oneOf([
30
- PropTypes.instanceOf(Pill),
31
- PropTypes.instanceOf(RemovablePill)
32
- ])
33
- })).isRequired.description("pill to add the label to"),
34
- leftAddon: PropTypes.node.description("addon component to left"),
35
- onFocusNextGroup: PropTypes.func.description("focus next group callback"),
36
- onFocusPreviousGroup: PropTypes.func.description("focus prev group callback"),
37
- onFocusGroupSet: PropTypes.func.description("focus group set callback")
35
+ type: PropTypes.oneOf([PropTypes.instanceOf(Pill), PropTypes.instanceOf(RemovablePill)])
36
+ })).isRequired.description('pill to add the label to'),
37
+
38
+ /** addon component to left */
39
+ leftAddon: PropTypes.node.description('addon component to left'),
40
+
41
+ /** focus next group callback */
42
+ onFocusNextGroup: PropTypes.func.description('focus next group callback'),
43
+
44
+ /** focus prev group callback */
45
+ onFocusPreviousGroup: PropTypes.func.description('focus prev group callback'),
46
+
47
+ /** focus group set callback */
48
+ onFocusGroupSet: PropTypes.func.description('focus group set callback')
38
49
  };
39
- LabeledPills.propTypes = props;
40
50
  const DSLabeledPillsWithSchema = describe(LabeledPills);
41
51
  DSLabeledPillsWithSchema.propTypes = props;
42
- export {
43
- DSLabeledPillsWithSchema,
44
- LabeledPills
45
- };
46
- //# sourceMappingURL=LabeledPills.js.map
52
+
53
+ export { DSLabeledPillsWithSchema, LabeledPills };
@@ -1,50 +1,62 @@
1
- import * as React from "react";
2
- import React2, { useRef, useState, useEffect } from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { useFocusGroupItem } from "@elliemae/ds-shared/FocusGroup/useFocusGroupItem";
5
- import { DSTooltip } from "@elliemae/ds-tooltip";
6
- import { Pill } from "./Pill";
7
- function OverflowPill({ containerProps = {}, label = "", options = [] }) {
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';
7
+ import { PropTypes, describe } from 'react-desc';
8
+ import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
9
+ import DSTooltip from '@elliemae/ds-tooltip';
10
+ import { Pill } from './Pill.js';
11
+
12
+ function OverflowPill(_ref) {
13
+ let {
14
+ containerProps = {},
15
+ label = '',
16
+ options = []
17
+ } = _ref;
8
18
  const ref = useRef(null);
9
19
  const [tooltipIsOpen, setTooltipIsOpen] = useState(false);
10
- const [tooltipText, setTooltipText] = useState("");
20
+ const [tooltipText, setTooltipText] = useState('');
11
21
  useEffect(() => {
12
- let text = "";
13
- options.forEach((option) => {
22
+ let text = '';
23
+ options.forEach(option => {
14
24
  if (!tooltipText || option === options[0]) {
15
- text = `${option.label}`;
25
+ text = "".concat(option.label);
16
26
  } else {
17
- text = text.concat(`, ${option.label}`);
27
+ text = text.concat(", ".concat(option.label));
18
28
  }
19
29
  });
20
30
  setTooltipText(text);
21
31
  }, [options]);
22
32
  useFocusGroupItem(ref);
23
- return /* @__PURE__ */ React2.createElement(DSTooltip, {
33
+ return /*#__PURE__*/_jsx(DSTooltip, {
24
34
  isOpen: tooltipIsOpen,
25
35
  title: tooltipText,
26
36
  zIndex: 11,
27
- triggerComponent: /* @__PURE__ */ React2.createElement(Pill, {
37
+ triggerComponent: /*#__PURE__*/_jsx(Pill, {
28
38
  className: "overflow-pill",
29
- containerProps,
39
+ containerProps: containerProps,
30
40
  innerRef: ref,
31
- label,
41
+ label: label,
32
42
  tabIndex: -1,
33
43
  onMouseEnter: () => setTooltipIsOpen(true),
34
44
  onMouseLeave: () => setTooltipIsOpen(false)
35
45
  })
36
46
  });
37
47
  }
48
+
38
49
  const props = {
39
- containerProps: PropTypes.object.description("props to inject to pill wrapper"),
40
- label: PropTypes.string.isRequired.description("pill text label"),
41
- options: PropTypes.array.description("overflow pills options")
50
+ /** props to inject to pill wrapper */
51
+ containerProps: PropTypes.object.description('props to inject to pill wrapper'),
52
+
53
+ /** pill text label */
54
+ label: PropTypes.string.isRequired.description('pill text label'),
55
+
56
+ /** overflow pills options */
57
+ options: PropTypes.array.description('overflow pills options')
42
58
  };
43
- OverflowPill.propTypes = props;
44
59
  const DSOverflowPillWithSchema = describe(OverflowPill);
45
60
  DSOverflowPillWithSchema.propTypes = props;
46
- export {
47
- DSOverflowPillWithSchema,
48
- OverflowPill
49
- };
50
- //# sourceMappingURL=OverflowPill.js.map
61
+
62
+ export { DSOverflowPillWithSchema, OverflowPill };
@@ -1,44 +1,76 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { aggregatedClasses } from "@elliemae/ds-classnames";
5
- const pillBlockName = "pill";
6
- const PillWrapper = aggregatedClasses("div")(pillBlockName, null, ({ size, variant }) => ({
7
- [variant]: !!variant,
8
- [size]: !!size
9
- }));
10
- const PillLabel = aggregatedClasses("span")(pillBlockName, "label");
11
- const PillAddon = aggregatedClasses("div")(pillBlockName, "addon");
12
- function Pill({
13
- containerProps = {},
14
- label = "",
15
- leftAddon,
16
- rightAddon,
17
- variant = "value",
18
- size = "m",
19
- ...otherProps
20
- }) {
21
- return /* @__PURE__ */ React2.createElement(PillWrapper, {
22
- ...containerProps,
23
- classProps: { variant, size },
24
- ...otherProps
25
- }, leftAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, leftAddon), /* @__PURE__ */ React2.createElement(PillLabel, null, label), rightAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, rightAddon));
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
9
+ import 'react';
10
+ import { PropTypes, describe } from 'react-desc';
11
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
12
+ import { jsxs } from 'react/jsx-runtime';
13
+
14
+ const _excluded = ["containerProps", "label", "leftAddon", "rightAddon", "variant", "size"];
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : 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
+ };
29
+ });
30
+ const PillLabel = aggregatedClasses('span')(pillBlockName, 'label');
31
+ const PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');
32
+
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);
43
+
44
+ return /*#__PURE__*/jsxs(PillWrapper, _objectSpread(_objectSpread(_objectSpread({}, containerProps), {}, {
45
+ classProps: {
46
+ variant,
47
+ size
48
+ }
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
+ }));
26
52
  }
53
+
27
54
  const props = {
28
- containerProps: PropTypes.object.description("props to inject to pill wrapper"),
29
- label: PropTypes.string.isRequired.description("pill text label"),
30
- size: PropTypes.oneOf(["m", "l"]).description("pill size"),
31
- variant: PropTypes.oneOf(["value", "title"]).description("pill variant"),
32
- leftAddon: PropTypes.node.description("addon component to left"),
33
- rightAddon: PropTypes.node.description("addon component to right")
55
+ /** props to inject to pill wrapper */
56
+ containerProps: PropTypes.object.description('props to inject to pill wrapper'),
57
+
58
+ /** pill text label */
59
+ label: PropTypes.string.isRequired.description('pill text label'),
60
+
61
+ /** pill size */
62
+ size: PropTypes.oneOf(['m', 'l']).description('pill size'),
63
+
64
+ /** pill variant */
65
+ variant: PropTypes.oneOf(['value', 'title']).description('pill variant'),
66
+
67
+ /** addon component to left */
68
+ leftAddon: PropTypes.node.description('addon component to left'),
69
+
70
+ /** addon component to right */
71
+ rightAddon: PropTypes.node.description('addon component to right')
34
72
  };
35
- Pill.propTypes = props;
36
73
  const DSPillWithSchema = describe(Pill);
37
74
  DSPillWithSchema.propTypes = props;
38
- var Pill_default = Pill;
39
- export {
40
- DSPillWithSchema,
41
- Pill,
42
- Pill_default as default
43
- };
44
- //# sourceMappingURL=Pill.js.map
75
+
76
+ export { DSPillWithSchema, Pill, Pill as default };
@@ -1,43 +1,60 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { describe, PropTypes } from "react-desc";
4
- import { aggregatedClasses } from "@elliemae/ds-classnames";
5
- import { FocusGroupProvider } from "@elliemae/ds-shared/FocusGroup/FocusGroupManager";
6
- const pillGroupBlockName = "pill-group";
7
- const Container = aggregatedClasses("div")(pillGroupBlockName);
8
- const PillGroup = ({
9
- containerProps = {},
10
- onFocusNextGroup,
11
- onFocusPreviousGroup,
12
- onFocusGroupSet,
13
- children
14
- }) => /* @__PURE__ */ React2.createElement(FocusGroupProvider, {
15
- keyBindings: {
16
- Tab: "next"
17
- },
18
- onFocusGroupSet,
19
- onFocusNextGroup,
20
- onFocusPreviousGroup,
21
- orientation: "horizontal"
22
- }, /* @__PURE__ */ React2.createElement(Container, {
23
- ...containerProps
24
- }, children));
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';
9
+ import { PropTypes, describe } from 'react-desc';
10
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
11
+ import FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';
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); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : 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, {
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
+ };
40
+
25
41
  const props = {
26
- containerProps: PropTypes.object.description("props injected to component wrapper"),
27
- onFocusNextGroup: PropTypes.func.description("focus next group callback"),
28
- onFocusPreviousGroup: PropTypes.func.description("focus prev group callback"),
29
- onFocusGroupSet: PropTypes.func.description("focus group set callback"),
30
- children: PropTypes.oneOfType([
31
- PropTypes.arrayOf(PropTypes.node),
32
- PropTypes.node
33
- ]).isRequired.description("pill components")
42
+ /** props injected to component wrapper */
43
+ containerProps: PropTypes.object.description('props injected to component wrapper'),
44
+
45
+ /** focus next group callback */
46
+ onFocusNextGroup: PropTypes.func.description('focus next group callback'),
47
+
48
+ /** focus prev group callback */
49
+ onFocusPreviousGroup: PropTypes.func.description('focus prev group callback'),
50
+
51
+ /** focus group set callback */
52
+ onFocusGroupSet: PropTypes.func.description('focus group set callback'),
53
+
54
+ /** pill components */
55
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired.description('pill components')
34
56
  };
35
- PillGroup.propTypes = props;
36
57
  const DSPillGroupWithSchema = describe(PillGroup);
37
58
  DSPillGroupWithSchema.propTypes = props;
38
- export {
39
- Container,
40
- DSPillGroupWithSchema,
41
- PillGroup
42
- };
43
- //# sourceMappingURL=PillGroup.js.map
59
+
60
+ export { Container, DSPillGroupWithSchema, PillGroup };
@@ -1,71 +1,90 @@
1
- import * as React from "react";
2
- import React2, { useRef, useState } from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { InfoCircleSmall } from "@elliemae/ds-icons";
5
- import { DSModal, MODAL_TYPE_V2 } from "@elliemae/ds-modal";
6
- import { DSPopover } from "@elliemae/ds-popover";
7
- import { Pill } from "./Pill";
8
- const ReadOnlyPill = ({
9
- containerProps = {},
10
- modalContent = "",
11
- label = "",
12
- leftAddon,
13
- modalTitle = "",
14
- tooltipText = ""
15
- }) => {
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';
4
+ import { PropTypes, describe } from 'react-desc';
5
+ import { InfoCircleSmall } from '@elliemae/ds-icons';
6
+ import DSModal, { MODAL_TYPE_V2 } from '@elliemae/ds-modal';
7
+ import Popover from '@elliemae/ds-popover';
8
+ import { Pill } from './Pill.js';
9
+ import { jsxs, Fragment } from 'react/jsx-runtime';
10
+
11
+ const ReadOnlyPill = _ref => {
12
+ let {
13
+ containerProps = {},
14
+ modalContent = '',
15
+ label = '',
16
+ leftAddon,
17
+ modalTitle = '',
18
+ tooltipText = ''
19
+ } = _ref;
16
20
  const ref = useRef(null);
17
21
  const [isModalOpen, setIsModalOpen] = useState(false);
18
22
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
23
+
19
24
  const toggle = () => {
20
25
  setIsModalOpen(!isModalOpen);
21
26
  };
22
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Pill, {
23
- "data-testid": "read-only-pill",
24
- className: "removable-pill",
25
- containerProps,
26
- innerRef: ref,
27
- label,
28
- leftAddon,
29
- rightAddon: /* @__PURE__ */ React2.createElement(DSPopover, {
30
- isOpen: tooltipText && isTooltipOpen,
31
- content: tooltipText,
32
- placement: "top",
33
- showArrow: true,
34
- renderTrigger: ({ ref: ref2 }) => /* @__PURE__ */ React2.createElement(InfoCircleSmall, {
35
- role: "button",
36
- "data-testid": "read-only-info-btn",
37
- className: "remove-pill-button",
38
- onClick: toggle,
39
- onMouseEnter: () => setIsTooltipOpen(true),
40
- onMouseLeave: () => setIsTooltipOpen(false),
41
- color: ["brand-primary", "600"],
42
- innerRef: ref2
43
- })
44
- }),
45
- tabIndex: -1
46
- }), /* @__PURE__ */ React2.createElement(DSModal, {
47
- isOpen: isModalOpen,
48
- showClose: true,
49
- shouldCloseOnOverlayClick: true,
50
- modalTitle,
51
- modalType: MODAL_TYPE_V2.INFORMATION,
52
- onClose: toggle,
53
- version: 2
54
- }, modalContent));
27
+
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
+ });
55
68
  };
69
+
56
70
  const props = {
57
- containerProps: PropTypes.object.description("props injected to component wrapper"),
58
- label: PropTypes.string.isRequired.description("pill text label"),
59
- leftAddon: PropTypes.node.description("addon component to left"),
60
- modalContent: PropTypes.string.description("read only pill modal content"),
61
- modalTitle: PropTypes.string.description("read only pill modal title"),
62
- tooltipText: PropTypes.string.description("text to display in tooltip")
71
+ /** props injected to component wrapper */
72
+ containerProps: PropTypes.object.description('props injected to component wrapper'),
73
+
74
+ /** labeled pill text label */
75
+ label: PropTypes.string.isRequired.description('pill text label'),
76
+
77
+ /** addon component to left */
78
+ leftAddon: PropTypes.node.description('addon component to left'),
79
+
80
+ /** read only pill modal content */
81
+ modalContent: PropTypes.string.description('read only pill modal content'),
82
+
83
+ /** read only pill modal title */
84
+ modalTitle: PropTypes.string.description('read only pill modal title'),
85
+ tooltipText: PropTypes.string.description('text to display in tooltip')
63
86
  };
64
- ReadOnlyPill.propTypes = props;
65
87
  const DSReadOnlyPillWithSchema = describe(ReadOnlyPill);
66
88
  DSReadOnlyPillWithSchema.propTypes = props;
67
- export {
68
- DSReadOnlyPillWithSchema,
69
- ReadOnlyPill
70
- };
71
- //# sourceMappingURL=ReadOnlyPill.js.map
89
+
90
+ export { DSReadOnlyPillWithSchema, ReadOnlyPill };
@@ -1,29 +1,38 @@
1
- import * as React from "react";
2
- import React2, { useRef } from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { isFunction } from "@elliemae/ds-utilities";
5
- import { CloseXsmall } from "@elliemae/ds-icons";
6
- import { useFocusGroupItem } from "@elliemae/ds-shared/FocusGroup/useFocusGroupItem";
7
- import { Pill } from "./Pill";
8
- function RemovablePill({ containerProps = {}, label = "", onRemove, size = "m", leftAddon }) {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import { useRef } from 'react';
3
+ import { PropTypes, describe } from 'react-desc';
4
+ import { isFunction } from '@elliemae/ds-utilities';
5
+ import { CloseXsmall } from '@elliemae/ds-icons';
6
+ import useFocusGroupItem from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';
7
+ import { Pill } from './Pill.js';
8
+
9
+ function RemovablePill(_ref) {
10
+ let {
11
+ containerProps = {},
12
+ label = '',
13
+ onRemove,
14
+ size = 'm',
15
+ leftAddon
16
+ } = _ref;
9
17
  const ref = useRef(null);
10
- const { focusPrevious } = useFocusGroupItem(ref);
11
- return /* @__PURE__ */ React2.createElement(Pill, {
18
+ const {
19
+ focusPrevious
20
+ } = useFocusGroupItem(ref);
21
+ return /*#__PURE__*/_jsx(Pill, {
12
22
  className: "removable-pill",
13
23
  "data-testid": "removable-pill",
14
- containerProps,
24
+ containerProps: containerProps,
15
25
  innerRef: ref,
16
- size,
17
- label,
18
- leftAddon,
19
- onKeyDown: (e) => {
20
- if (e.key === "Backspace" && isFunction(onRemove)) {
26
+ size: size,
27
+ label: label,
28
+ leftAddon: leftAddon,
29
+ onKeyDown: e => {
30
+ if (e.key === 'Backspace' && isFunction(onRemove)) {
21
31
  onRemove();
22
- if (isFunction(focusPrevious))
23
- focusPrevious();
32
+ if (isFunction(focusPrevious)) focusPrevious();
24
33
  }
25
34
  },
26
- rightAddon: /* @__PURE__ */ React2.createElement(CloseXsmall, {
35
+ rightAddon: /*#__PURE__*/_jsx(CloseXsmall, {
27
36
  role: "button",
28
37
  "data-testid": "remove-pill-button",
29
38
  className: "remove-pill-button",
@@ -32,18 +41,24 @@ function RemovablePill({ containerProps = {}, label = "", onRemove, size = "m",
32
41
  tabIndex: -1
33
42
  });
34
43
  }
44
+
35
45
  const props = {
36
- containerProps: PropTypes.object.description("props injected to component wrapper"),
37
- label: PropTypes.string.isRequired.description("pill text label"),
38
- onRemove: PropTypes.func.description("remove click callback"),
39
- size: PropTypes.oneOf(["m", "l"]).description("pill size"),
40
- leftAddon: PropTypes.node.description("addon component to left")
46
+ /** props injected to component wrapper */
47
+ containerProps: PropTypes.object.description('props injected to component wrapper'),
48
+
49
+ /** labeled pill text label */
50
+ label: PropTypes.string.isRequired.description('pill text label'),
51
+
52
+ /** remove click callback */
53
+ onRemove: PropTypes.func.description('remove click callback'),
54
+
55
+ /** pill size */
56
+ size: PropTypes.oneOf(['m', 'l']).description('pill size'),
57
+
58
+ /** addon component to left */
59
+ leftAddon: PropTypes.node.description('addon component to left')
41
60
  };
42
- RemovablePill.propTypes = props;
43
61
  const DSRemovablePillWithSchema = describe(RemovablePill);
44
62
  DSRemovablePillWithSchema.propTypes = props;
45
- export {
46
- DSRemovablePillWithSchema,
47
- RemovablePill
48
- };
49
- //# sourceMappingURL=RemovablePill.js.map
63
+
64
+ export { DSRemovablePillWithSchema, RemovablePill };