@elliemae/ds-pills 2.2.0 → 2.3.0-alpha.3

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 (125) hide show
  1. package/cjs/components/Pill.js +56 -49
  2. package/cjs/components/Pill.js.map +7 -0
  3. package/cjs/components/PillButton.js +54 -52
  4. package/cjs/components/PillButton.js.map +7 -0
  5. package/cjs/components/PillGroup.js +61 -53
  6. package/cjs/components/PillGroup.js.map +7 -0
  7. package/cjs/components/index.js +30 -17
  8. package/cjs/components/index.js.map +7 -0
  9. package/cjs/components/styled.js +228 -78
  10. package/cjs/components/styled.js.map +7 -0
  11. package/cjs/components/types/DropdownPill.js +79 -77
  12. package/cjs/components/types/DropdownPill.js.map +7 -0
  13. package/cjs/components/types/InputPill.js +58 -48
  14. package/cjs/components/types/InputPill.js.map +7 -0
  15. package/cjs/components/types/LabelPill.js +44 -38
  16. package/cjs/components/types/LabelPill.js.map +7 -0
  17. package/cjs/components/types/ReadOnlyPill.js +48 -43
  18. package/cjs/components/types/ReadOnlyPill.js.map +7 -0
  19. package/cjs/components/types/RemovablePill.js +60 -53
  20. package/cjs/components/types/RemovablePill.js.map +7 -0
  21. package/cjs/components/types/ValuePill.js +48 -43
  22. package/cjs/components/types/ValuePill.js.map +7 -0
  23. package/cjs/components/types/index.js +33 -19
  24. package/cjs/components/types/index.js.map +7 -0
  25. package/cjs/deprecated/DropdownPill.js +80 -101
  26. package/cjs/deprecated/DropdownPill.js.map +7 -0
  27. package/cjs/deprecated/InputPill.js +67 -69
  28. package/cjs/deprecated/InputPill.js.map +7 -0
  29. package/cjs/deprecated/LabeledDropdownPills.js +92 -96
  30. package/cjs/deprecated/LabeledDropdownPills.js.map +7 -0
  31. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +91 -94
  32. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
  33. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +106 -114
  34. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
  35. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +119 -127
  36. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
  37. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +39 -15
  38. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
  39. package/cjs/deprecated/LabeledPills.js +65 -52
  40. package/cjs/deprecated/LabeledPills.js.map +7 -0
  41. package/cjs/deprecated/OverflowPill.js +59 -53
  42. package/cjs/deprecated/OverflowPill.js.map +7 -0
  43. package/cjs/deprecated/Pill.js +67 -82
  44. package/cjs/deprecated/Pill.js.map +7 -0
  45. package/cjs/deprecated/PillGroup.js +68 -68
  46. package/cjs/deprecated/PillGroup.js.map +7 -0
  47. package/cjs/deprecated/ReadOnlyPill.js +93 -94
  48. package/cjs/deprecated/ReadOnlyPill.js.map +7 -0
  49. package/cjs/deprecated/RemovablePill.js +61 -57
  50. package/cjs/deprecated/RemovablePill.js.map +7 -0
  51. package/cjs/deprecated/index.js +43 -33
  52. package/cjs/deprecated/index.js.map +7 -0
  53. package/cjs/index.d.js +27 -2
  54. package/cjs/index.d.js.map +7 -0
  55. package/cjs/index.js +37 -43
  56. package/cjs/index.js.map +7 -0
  57. package/cjs/props.js +72 -46
  58. package/cjs/props.js.map +7 -0
  59. package/cjs/utils.js +43 -25
  60. package/cjs/utils.js.map +7 -0
  61. package/esm/components/Pill.js +18 -31
  62. package/esm/components/Pill.js.map +7 -0
  63. package/esm/components/PillButton.js +22 -39
  64. package/esm/components/PillButton.js.map +7 -0
  65. package/esm/components/PillGroup.js +28 -38
  66. package/esm/components/PillGroup.js.map +7 -0
  67. package/esm/components/index.js +5 -3
  68. package/esm/components/index.js.map +7 -0
  69. package/esm/components/styled.js +205 -66
  70. package/esm/components/styled.js.map +7 -0
  71. package/esm/components/types/DropdownPill.js +50 -67
  72. package/esm/components/types/DropdownPill.js.map +7 -0
  73. package/esm/components/types/InputPill.js +25 -35
  74. package/esm/components/types/InputPill.js.map +7 -0
  75. package/esm/components/types/LabelPill.js +15 -29
  76. package/esm/components/types/LabelPill.js.map +7 -0
  77. package/esm/components/types/ReadOnlyPill.js +19 -34
  78. package/esm/components/types/ReadOnlyPill.js.map +7 -0
  79. package/esm/components/types/RemovablePill.js +31 -44
  80. package/esm/components/types/RemovablePill.js.map +7 -0
  81. package/esm/components/types/ValuePill.js +19 -34
  82. package/esm/components/types/ValuePill.js.map +7 -0
  83. package/esm/components/types/index.js +8 -6
  84. package/esm/components/types/index.js.map +7 -0
  85. package/esm/deprecated/DropdownPill.js +49 -86
  86. package/esm/deprecated/DropdownPill.js.map +7 -0
  87. package/esm/deprecated/InputPill.js +38 -59
  88. package/esm/deprecated/InputPill.js.map +7 -0
  89. package/esm/deprecated/LabeledDropdownPills.js +59 -81
  90. package/esm/deprecated/LabeledDropdownPills.js.map +7 -0
  91. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +60 -84
  92. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
  93. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +65 -94
  94. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
  95. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +79 -108
  96. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
  97. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +9 -10
  98. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
  99. package/esm/deprecated/LabeledPills.js +34 -41
  100. package/esm/deprecated/LabeledPills.js.map +7 -0
  101. package/esm/deprecated/OverflowPill.js +25 -37
  102. package/esm/deprecated/OverflowPill.js.map +7 -0
  103. package/esm/deprecated/Pill.js +39 -71
  104. package/esm/deprecated/Pill.js.map +7 -0
  105. package/esm/deprecated/PillGroup.js +39 -56
  106. package/esm/deprecated/PillGroup.js.map +7 -0
  107. package/esm/deprecated/ReadOnlyPill.js +60 -79
  108. package/esm/deprecated/ReadOnlyPill.js.map +7 -0
  109. package/esm/deprecated/RemovablePill.js +30 -45
  110. package/esm/deprecated/RemovablePill.js.map +7 -0
  111. package/esm/deprecated/index.js +14 -8
  112. package/esm/deprecated/index.js.map +7 -0
  113. package/esm/index.d.js +2 -1
  114. package/esm/index.d.js.map +7 -0
  115. package/esm/index.js +8 -11
  116. package/esm/index.js.map +7 -0
  117. package/esm/props.js +42 -36
  118. package/esm/props.js.map +7 -0
  119. package/esm/utils.js +16 -23
  120. package/esm/utils.js.map +7 -0
  121. package/package.json +15 -15
  122. package/types/deprecated/LabeledDropdownPills.d.ts +1 -1
  123. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +3 -1
  124. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +3 -1
  125. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +1 -0
package/cjs/index.d.js CHANGED
@@ -1,2 +1,27 @@
1
- 'use strict';
2
-
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __reExport = (target, module2, copyDefault, desc) => {
9
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
+ for (let key of __getOwnPropNames(module2))
11
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
+ }
14
+ return target;
15
+ };
16
+ var __toESM = (module2, isNodeMode) => {
17
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
+ };
19
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
+ return (module2, temp) => {
21
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
+ };
23
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
+ var index_d_exports = {};
25
+ var React = __toESM(require("react"));
26
+ module.exports = __toCommonJS(index_d_exports);
27
+ //# sourceMappingURL=index.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.d.ts", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport type { DSDropdownMenuProps } from '@elliemae/ds-dropdownmenu';\n\nexport interface DSPillProps {\n label: string;\n type: 'label' | 'value' | 'input' | 'dropdown' | 'removable' | 'readonly';\n innerRef?: React.MutableRefObject<HTMLElement> | ((_ref: HTMLElement) => void);\n ariaLabel?: string;\n labelTruncated?: boolean;\n size: 'm' | 's';\n // ---------------------------------------------------------------------------\n // Value props\n // ---------------------------------------------------------------------------\n tooltipValue?: string;\n // ---------------------------------------------------------------------------\n // Readonly props\n // ---------------------------------------------------------------------------\n iconLeft?: JSX.Element;\n iconRight?: JSX.Element;\n // ---------------------------------------------------------------------------\n // Removable props\n // ---------------------------------------------------------------------------\n onRemove?: (e: React.KeyboardEvent & React.MouseEvent) => void;\n // ---------------------------------------------------------------------------\n // Input props\n // ---------------------------------------------------------------------------\n inputPlaceholder?: string;\n onInputChange?: (e: React.ChangeEvent, newValue: string) => void;\n onInputClear?: (e: React.KeyboardEvent & React.MouseEvent) => void;\n inputWidth?: number;\n inputRender?: React.ComponentType<any>;\n // ---------------------------------------------------------------------------\n // Dropdown props\n // ---------------------------------------------------------------------------\n dropdownProps?: DSDropdownMenuProps;\n onDropdownClick?: (e: React.KeyboardEvent & React.MouseEvent) => void;\n}\n\nexport interface DSLabeledDropdownPillProps {\n label: string;\n value?: { id: string; label: string }[];\n onValuesChange?: (values: DSLabeledDropdownPillProps['values']) => void;\n type: 'label-is-value' | 'single-value' | 'multi-value' | 'input-value' | 'required-value';\n dropdownOptions?: any[];\n}\n\nexport interface DSPillGroupProps {\n width?: string;\n innerRef?: React.MutableRefObject<HTMLElement> | ((_ref: HTMLElement) => void);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
+ "names": []
7
+ }
package/cjs/index.js CHANGED
@@ -1,43 +1,37 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Pill = require('./deprecated/Pill.js');
6
- var PillGroup = require('./deprecated/PillGroup.js');
7
- var LabeledDropdownPills = require('./deprecated/LabeledDropdownPills.js');
8
- var LabeledPills = require('./deprecated/LabeledPills.js');
9
- var DropdownPill = require('./deprecated/DropdownPill.js');
10
- var RemovablePill = require('./deprecated/RemovablePill.js');
11
- var ReadOnlyPill = require('./deprecated/ReadOnlyPill.js');
12
- var OverflowPill = require('./deprecated/OverflowPill.js');
13
- var Pill$1 = require('./components/Pill.js');
14
- var PillGroup$1 = require('./components/PillGroup.js');
15
- var PillButton = require('./components/PillButton.js');
16
-
17
-
18
-
19
- exports.DSPillWithSchema = Pill.DSPillWithSchema;
20
- exports.Pill = Pill.Pill;
21
- exports["default"] = Pill.Pill;
22
- exports.Container = PillGroup.Container;
23
- exports.DSPillGroupWithSchema = PillGroup.DSPillGroupWithSchema;
24
- exports.PillGroup = PillGroup.PillGroup;
25
- exports.DSLabeledDropdownPillsWithSchema = LabeledDropdownPills.DSLabeledDropdownPillsWithSchema;
26
- exports.LabeledDropdownPills = LabeledDropdownPills.LabeledDropdownPills;
27
- exports.DSLabeledPillsWithSchema = LabeledPills.DSLabeledPillsWithSchema;
28
- exports.LabeledPills = LabeledPills.LabeledPills;
29
- exports.DSDropdownPillWithSchema = DropdownPill.DSDropdownPillWithSchema;
30
- exports.DropdownPill = DropdownPill.DropdownPill;
31
- exports.DSRemovablePillWithSchema = RemovablePill.DSRemovablePillWithSchema;
32
- exports.RemovablePill = RemovablePill.RemovablePill;
33
- exports.DSReadOnlyPillWithSchema = ReadOnlyPill.DSReadOnlyPillWithSchema;
34
- exports.ReadOnlyPill = ReadOnlyPill.ReadOnlyPill;
35
- exports.DSOverflowPillWithSchema = OverflowPill.DSOverflowPillWithSchema;
36
- exports.OverflowPill = OverflowPill.OverflowPill;
37
- exports.DSPillV2 = Pill$1.DSPillV2;
38
- exports.DSPillV2WithSchema = Pill$1.DSPillV2WithSchema;
39
- exports.DSPillGroupV2 = PillGroup$1.DSPillGroupV2;
40
- exports.DSPillGroupV2Context = PillGroup$1.DSPillGroupV2Context;
41
- exports.DSPillGroupV2WithSchema = PillGroup$1.DSPillGroupV2WithSchema;
42
- exports.DSPillButton = PillButton.DSPillButton;
43
- exports.DSPillButtonWithSchema = PillButton.DSPillButtonWithSchema;
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var src_exports = {};
29
+ __export(src_exports, {
30
+ default: () => import_deprecated.default
31
+ });
32
+ var React = __toESM(require("react"));
33
+ __reExport(src_exports, require("./deprecated"));
34
+ __reExport(src_exports, require("./components"));
35
+ var import_deprecated = __toESM(require("./deprecated"));
36
+ module.exports = __toCommonJS(src_exports);
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export * from './deprecated';\nexport * from './components';\nexport { default } from './deprecated';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,wBAAwB;",
6
+ "names": []
7
+ }
package/cjs/props.js CHANGED
@@ -1,69 +1,95 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
- var dsForm = require('@elliemae/ds-form');
7
-
8
- /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
9
- const pillTypes = reactDesc.PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var props_exports = {};
29
+ __export(props_exports, {
30
+ DSPillButtonDefaultProps: () => DSPillButtonDefaultProps,
31
+ DSPillButtonPropTypes: () => DSPillButtonPropTypes,
32
+ DSPillGroupDefaultProps: () => DSPillGroupDefaultProps,
33
+ DSPillGroupPropTypes: () => DSPillGroupPropTypes,
34
+ DSPillV2DefaultProps: () => DSPillV2DefaultProps,
35
+ DSPillV2PropTypes: () => DSPillV2PropTypes
36
+ });
37
+ var React = __toESM(require("react"));
38
+ var import_react_desc = require("react-desc");
39
+ var import_ds_form = require("@elliemae/ds-form");
40
+ const pillTypes = import_react_desc.PropTypes.oneOf(["label", "value", "input", "dropdown", "removable", "readonly"]);
10
41
  const DSPillV2PropTypes = {
11
- label: reactDesc.PropTypes.string.description('Label to show in the pill').isRequired,
12
- type: pillTypes.description('The type of pill that you want to render').isRequired,
13
- innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)').defaultValue(() => null),
14
- size: reactDesc.PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),
15
- ariaLabel: reactDesc.PropTypes.string.description('Aria label for the pill. If not provided we will use the label').defaultValue(''),
16
- labelTruncated: reactDesc.PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),
17
- tooltipValue: reactDesc.PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),
18
- iconLeft: reactDesc.PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),
19
- iconRight: reactDesc.PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),
20
- onRemove: reactDesc.PropTypes.func.description('Callback triggered when removing a pill with the close icon').defaultValue(() => null),
21
- inputPlaceholder: reactDesc.PropTypes.string.description('Placeholder for the input pill').defaultValue(''),
22
- onInputChange: reactDesc.PropTypes.func.description('Callback triggered when user provides input to the input pill').defaultValue(() => null),
23
- onInputClear: reactDesc.PropTypes.func.description('Callback triggered when the user clears an input pill').defaultValue(() => null),
24
- inputWidth: reactDesc.PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),
25
- dropdownProps: reactDesc.PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),
26
- onDropdownClick: reactDesc.PropTypes.func.description('Callback when dropdown button is clicked or pressed').defaultValue(() => null)
42
+ label: import_react_desc.PropTypes.string.description("Label to show in the pill").isRequired,
43
+ type: pillTypes.description("The type of pill that you want to render").isRequired,
44
+ innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.object, import_react_desc.PropTypes.func]).description("Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)").defaultValue(() => null),
45
+ size: import_react_desc.PropTypes.oneOf(["s", "m"]).description("Vertical pill size").defaultValue("m"),
46
+ ariaLabel: import_react_desc.PropTypes.string.description("Aria label for the pill. If not provided we will use the label").defaultValue(""),
47
+ labelTruncated: import_react_desc.PropTypes.bool.description("Whether to truncate the pills label").defaultValue(true),
48
+ tooltipValue: import_react_desc.PropTypes.string.description("String to show as a tooltip in the value pill").defaultValue(""),
49
+ iconLeft: import_react_desc.PropTypes.node.description("A component to show int the left of a readonly pill").defaultValue(null),
50
+ iconRight: import_react_desc.PropTypes.node.description("A component to show in the right of a readonly pill").defaultValue(null),
51
+ onRemove: import_react_desc.PropTypes.func.description("Callback triggered when removing a pill with the close icon").defaultValue(() => null),
52
+ inputPlaceholder: import_react_desc.PropTypes.string.description("Placeholder for the input pill").defaultValue(""),
53
+ onInputChange: import_react_desc.PropTypes.func.description("Callback triggered when user provides input to the input pill").defaultValue(() => null),
54
+ onInputClear: import_react_desc.PropTypes.func.description("Callback triggered when the user clears an input pill").defaultValue(() => null),
55
+ inputWidth: import_react_desc.PropTypes.number.description("Width in pixels for the input tag in the input pill").defaultValue(150),
56
+ dropdownProps: import_react_desc.PropTypes.object.description("Properties that will be used for the dropdown-menu").defaultValue({}),
57
+ onDropdownClick: import_react_desc.PropTypes.func.description("Callback when dropdown button is clicked or pressed").defaultValue(() => null)
27
58
  };
28
59
  const DSPillButtonPropTypes = {
29
- type: reactDesc.PropTypes.oneOf(['only', 'left', 'right']).description('The position in which this button will be placed. Only used for css styling internally').defaultValue('right'),
30
- width: reactDesc.PropTypes.string.description('Width of the button').defaultValue('100%'),
31
- height: reactDesc.PropTypes.string.description('Height of the button').defaultValue('100%')
60
+ type: import_react_desc.PropTypes.oneOf(["only", "left", "right"]).description("The position in which this button will be placed. Only used for css styling internally").defaultValue("right"),
61
+ width: import_react_desc.PropTypes.string.description("Width of the button").defaultValue("100%"),
62
+ height: import_react_desc.PropTypes.string.description("Height of the button").defaultValue("100%")
32
63
  };
33
64
  const DSPillGroupPropTypes = {
34
- width: reactDesc.PropTypes.string.description('Width of the group').defaultValue('fit-content'),
35
- innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Reference to the pill group wrapper').defaultValue(() => null)
65
+ width: import_react_desc.PropTypes.string.description("Width of the group").defaultValue("fit-content"),
66
+ innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.object, import_react_desc.PropTypes.func]).description("Reference to the pill group wrapper").defaultValue(() => null)
36
67
  };
37
68
  const DSPillV2DefaultProps = {
38
69
  innerRef: () => null,
39
- ariaLabel: '',
40
- size: 'm',
70
+ ariaLabel: "",
71
+ size: "m",
41
72
  labelTruncated: true,
42
- tooltipValue: '',
73
+ tooltipValue: "",
43
74
  iconLeft: null,
44
75
  iconRight: null,
45
76
  onRemove: () => null,
46
- inputPlaceholder: '',
77
+ inputPlaceholder: "",
47
78
  onInputChange: () => null,
48
79
  onInputClear: () => null,
49
80
  inputWidth: 72,
50
- inputRender: dsForm.DSInput,
81
+ inputRender: import_ds_form.DSInput,
51
82
  dropdownProps: {},
52
83
  onDropdownClick: () => null
53
84
  };
54
85
  const DSPillButtonDefaultProps = {
55
- type: 'right',
56
- width: '100%',
57
- height: '100%'
86
+ type: "right",
87
+ width: "100%",
88
+ height: "100%"
58
89
  };
59
90
  const DSPillGroupDefaultProps = {
60
- width: 'fit-content',
91
+ width: "fit-content",
61
92
  innerRef: () => null
62
93
  };
63
-
64
- exports.DSPillButtonDefaultProps = DSPillButtonDefaultProps;
65
- exports.DSPillButtonPropTypes = DSPillButtonPropTypes;
66
- exports.DSPillGroupDefaultProps = DSPillGroupDefaultProps;
67
- exports.DSPillGroupPropTypes = DSPillGroupPropTypes;
68
- exports.DSPillV2DefaultProps = DSPillV2DefaultProps;
69
- exports.DSPillV2PropTypes = DSPillV2PropTypes;
94
+ module.exports = __toCommonJS(props_exports);
95
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/props.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { PropTypes } from 'react-desc';\nimport { DSInput } from '@elliemae/ds-form';\n\nconst pillTypes = PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);\n\nexport const DSPillV2PropTypes = {\n label: PropTypes.string.description('Label to show in the pill').isRequired,\n type: pillTypes.description('The type of pill that you want to render').isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)')\n .defaultValue(() => null),\n size: PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),\n ariaLabel: PropTypes.string\n .description('Aria label for the pill. If not provided we will use the label')\n .defaultValue(''),\n labelTruncated: PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),\n tooltipValue: PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),\n iconLeft: PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),\n iconRight: PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),\n onRemove: PropTypes.func\n .description('Callback triggered when removing a pill with the close icon')\n .defaultValue(() => null),\n inputPlaceholder: PropTypes.string.description('Placeholder for the input pill').defaultValue(''),\n onInputChange: PropTypes.func\n .description('Callback triggered when user provides input to the input pill')\n .defaultValue(() => null),\n onInputClear: PropTypes.func\n .description('Callback triggered when the user clears an input pill')\n .defaultValue(() => null),\n inputWidth: PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),\n dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),\n onDropdownClick: PropTypes.func\n .description('Callback when dropdown button is clicked or pressed')\n .defaultValue(() => null),\n};\n\nexport const DSPillButtonPropTypes = {\n type: PropTypes.oneOf(['only', 'left', 'right'])\n .description('The position in which this button will be placed. Only used for css styling internally')\n .defaultValue('right'),\n width: PropTypes.string.description('Width of the button').defaultValue('100%'),\n height: PropTypes.string.description('Height of the button').defaultValue('100%'),\n};\n\nexport const DSPillGroupPropTypes = {\n width: PropTypes.string.description('Width of the group').defaultValue('fit-content'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the pill group wrapper')\n .defaultValue(() => null),\n};\n\nexport const DSPillV2DefaultProps = {\n innerRef: () => null,\n ariaLabel: '',\n size: 'm',\n labelTruncated: true,\n tooltipValue: '',\n iconLeft: null,\n iconRight: null,\n onRemove: () => null,\n inputPlaceholder: '',\n onInputChange: () => null,\n onInputClear: () => null,\n inputWidth: 72,\n inputRender: DSInput,\n dropdownProps: {},\n onDropdownClick: () => null,\n};\n\nexport const DSPillButtonDefaultProps = {\n type: 'right',\n width: '100%',\n height: '100%',\n};\n\nexport const DSPillGroupDefaultProps = {\n width: 'fit-content',\n innerRef: () => null,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAA0B;AAC1B,qBAAwB;AAExB,MAAM,YAAY,4BAAU,MAAM,CAAC,SAAS,SAAS,SAAS,YAAY,aAAa;AAEhF,MAAM,oBAAoB;AAAA,EAC/B,OAAO,4BAAU,OAAO,YAAY,6BAA6B;AAAA,EACjE,MAAM,UAAU,YAAY,4CAA4C;AAAA,EACxE,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OACxD,YAAY,oGACZ,aAAa,MAAM;AAAA,EACtB,MAAM,4BAAU,MAAM,CAAC,KAAK,MAAM,YAAY,sBAAsB,aAAa;AAAA,EACjF,WAAW,4BAAU,OAClB,YAAY,kEACZ,aAAa;AAAA,EAChB,gBAAgB,4BAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA,EAC/F,cAAc,4BAAU,OAAO,YAAY,iDAAiD,aAAa;AAAA,EACzG,UAAU,4BAAU,KAAK,YAAY,uDAAuD,aAAa;AAAA,EACzG,WAAW,4BAAU,KAAK,YAAY,uDAAuD,aAAa;AAAA,EAC1G,UAAU,4BAAU,KACjB,YAAY,+DACZ,aAAa,MAAM;AAAA,EACtB,kBAAkB,4BAAU,OAAO,YAAY,kCAAkC,aAAa;AAAA,EAC9F,eAAe,4BAAU,KACtB,YAAY,iEACZ,aAAa,MAAM;AAAA,EACtB,cAAc,4BAAU,KACrB,YAAY,yDACZ,aAAa,MAAM;AAAA,EACtB,YAAY,4BAAU,OAAO,YAAY,uDAAuD,aAAa;AAAA,EAC7G,eAAe,4BAAU,OAAO,YAAY,sDAAsD,aAAa;AAAA,EAC/G,iBAAiB,4BAAU,KACxB,YAAY,uDACZ,aAAa,MAAM;AAAA;AAGjB,MAAM,wBAAwB;AAAA,EACnC,MAAM,4BAAU,MAAM,CAAC,QAAQ,QAAQ,UACpC,YAAY,0FACZ,aAAa;AAAA,EAChB,OAAO,4BAAU,OAAO,YAAY,uBAAuB,aAAa;AAAA,EACxE,QAAQ,4BAAU,OAAO,YAAY,wBAAwB,aAAa;AAAA;AAGrE,MAAM,uBAAuB;AAAA,EAClC,OAAO,4BAAU,OAAO,YAAY,sBAAsB,aAAa;AAAA,EACvE,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OACxD,YAAY,uCACZ,aAAa,MAAM;AAAA;AAGjB,MAAM,uBAAuB;AAAA,EAClC,UAAU,MAAM;AAAA,EAChB,WAAW;AAAA,EACX,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU,MAAM;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe,MAAM;AAAA,EACrB,cAAc,MAAM;AAAA,EACpB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB,MAAM;AAAA;AAGlB,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA;AAGH,MAAM,0BAA0B;AAAA,EACrC,OAAO;AAAA,EACP,UAAU,MAAM;AAAA;",
6
+ "names": []
7
+ }
package/cjs/utils.js CHANGED
@@ -1,28 +1,46 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- require('core-js/modules/esnext.async-iterator.for-each.js');
6
- require('core-js/modules/esnext.iterator.constructor.js');
7
- require('core-js/modules/esnext.iterator.for-each.js');
8
-
9
- const setMultipleRefs = function () {
10
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
11
- refs[_key] = arguments[_key];
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
12
17
  }
13
-
14
- return _ref => {
15
- refs.forEach(ref => {
16
- if (!ref || !_ref) return;
17
-
18
- if (typeof ref === 'function') {
19
- ref(_ref);
20
- return;
21
- }
22
-
23
- if (ref) ref.current = _ref;
24
- });
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
25
26
  };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var utils_exports = {};
29
+ __export(utils_exports, {
30
+ setMultipleRefs: () => setMultipleRefs
31
+ });
32
+ var React = __toESM(require("react"));
33
+ const setMultipleRefs = (...refs) => (_ref) => {
34
+ refs.forEach((ref) => {
35
+ if (!ref || !_ref)
36
+ return;
37
+ if (typeof ref === "function") {
38
+ ref(_ref);
39
+ return;
40
+ }
41
+ if (ref)
42
+ ref.current = _ref;
43
+ });
26
44
  };
27
-
28
- exports.setMultipleRefs = setMultipleRefs;
45
+ module.exports = __toCommonJS(utils_exports);
46
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["type refInterfaceType = React.MutableRefObject<HTMLElement> | ((_ref: HTMLElement) => void);\n\nexport const setMultipleRefs =\n (...refs: refInterfaceType[]) =>\n (_ref: HTMLElement): void => {\n refs.forEach((ref) => {\n if (!ref || !_ref) return;\n if (typeof ref === 'function') {\n ref(_ref);\n return;\n }\n if (ref) ref.current = _ref;\n });\n };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBACX,IAAI,SACJ,CAAC,SAA4B;AAC3B,OAAK,QAAQ,CAAC,QAAQ;AACpB,QAAI,CAAC,OAAO,CAAC;AAAM;AACnB,QAAI,OAAO,QAAQ,YAAY;AAC7B,UAAI;AACJ;AAAA;AAEF,QAAI;AAAK,UAAI,UAAU;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,24 +1,9 @@
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 'react';
8
- import { describe } from 'react-desc';
9
- import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
10
- import { DSPillV2PropTypes, DSPillV2DefaultProps } from '../props.js';
11
- import { DropdownPill } from './types/DropdownPill.js';
12
- import { InputPill } from './types/InputPill.js';
13
- import { LabelPill } from './types/LabelPill.js';
14
- import { ReadOnlyPill } from './types/ReadOnlyPill.js';
15
- import { RemovablePill } from './types/RemovablePill.js';
16
- import { ValuePill } from './types/ValuePill.js';
17
- import { jsx } from 'react/jsx-runtime';
18
-
19
- 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; }
20
-
21
- 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; }
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe } from "react-desc";
4
+ import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
5
+ import { DSPillV2DefaultProps, DSPillV2PropTypes } from "../props";
6
+ import { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from "./types";
22
7
  const pillComponentGetter = {
23
8
  dropdown: DropdownPill,
24
9
  input: InputPill,
@@ -27,18 +12,20 @@ const pillComponentGetter = {
27
12
  removable: RemovablePill,
28
13
  value: ValuePill
29
14
  };
30
-
31
- const DSPillV2 = props => {
15
+ const DSPillV2 = (props) => {
32
16
  const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);
33
17
  useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2PropTypes);
34
- const {
35
- type
36
- } = propsWithDefaults;
18
+ const { type } = propsWithDefaults;
37
19
  const PillComponent = pillComponentGetter[type];
38
- return /*#__PURE__*/jsx(PillComponent, _objectSpread({}, propsWithDefaults));
20
+ return /* @__PURE__ */ React2.createElement(PillComponent, {
21
+ ...propsWithDefaults
22
+ });
39
23
  };
40
-
41
- const DSPillV2WithSchema = describe(DSPillV2).description('Pill');
24
+ DSPillV2.propTypes = DSPillV2PropTypes;
25
+ const DSPillV2WithSchema = describe(DSPillV2).description("Pill");
42
26
  DSPillV2WithSchema.propTypes = DSPillV2PropTypes;
43
-
44
- export { DSPillV2, DSPillV2WithSchema };
27
+ export {
28
+ DSPillV2,
29
+ DSPillV2WithSchema
30
+ };
31
+ //# sourceMappingURL=Pill.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Pill.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSPillProps } from '../index.d';\nimport { DSPillV2DefaultProps, DSPillV2PropTypes } from '../props';\nimport { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from './types';\n\nconst pillComponentGetter: Record<string, React.ComponentType<DSPillProps>> = {\n dropdown: DropdownPill,\n input: InputPill,\n label: LabelPill,\n readonly: ReadOnlyPill,\n removable: RemovablePill,\n value: ValuePill,\n};\n\nconst DSPillV2: React.ComponentType<DSPillProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2PropTypes);\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.propTypes = DSPillV2PropTypes;\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AAEA;AACA;AAEA,MAAM,sBAAwE;AAAA,EAC5E,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AAAA;AAGT,MAAM,WAA6C,CAAC,UAAU;AAC5D,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA+B,mBAAmB;AAClD,QAAM,EAAE,SAAS;AACjB,QAAM,gBAAgB,oBAAoB;AAE1C,SAAO,qCAAC,eAAD;AAAA,OAAmB;AAAA;AAAA;AAG5B,SAAS,YAAY;AACrB,MAAM,qBAAqB,SAAS,UAAU,YAAY;AAC1D,mBAAmB,YAAY;",
6
+ "names": []
7
+ }
@@ -1,46 +1,29 @@
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 _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
8
- import 'react';
9
- import { describe } from 'react-desc';
10
- import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
11
- import { StyledPillButton } from './styled.js';
12
- import { DSPillButtonPropTypes, DSPillButtonDefaultProps } from '../props.js';
13
- import { jsx } from 'react/jsx-runtime';
14
-
15
- const _excluded = ["type", "children"];
16
-
17
- 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; }
18
-
19
- 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; }
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe } from "react-desc";
4
+ import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
5
+ import { StyledPillButton } from "./styled";
6
+ import { DSPillButtonDefaultProps, DSPillButtonPropTypes } from "../props";
20
7
  const typeToClassName = {
21
- only: 'ds-pill-button-only',
22
- left: 'ds-pill-button-left',
23
- right: 'ds-pill-button-right'
8
+ only: "ds-pill-button-only",
9
+ left: "ds-pill-button-left",
10
+ right: "ds-pill-button-right"
24
11
  };
25
-
26
- const DSPillButton = props => {
12
+ const DSPillButton = (props) => {
27
13
  const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);
28
14
  useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);
29
-
30
- const {
31
- type,
32
- children
33
- } = propsWithDefaults,
34
- rest = _objectWithoutProperties(propsWithDefaults, _excluded);
35
-
36
- return /*#__PURE__*/jsx(StyledPillButton, _objectSpread(_objectSpread({}, rest), {}, {
15
+ const { type, children, ...rest } = propsWithDefaults;
16
+ return /* @__PURE__ */ React2.createElement(StyledPillButton, {
17
+ ...rest,
37
18
  buttonType: "raw",
38
- className: "".concat(typeToClassName[type], " ").concat(rest.className),
39
- children: children
40
- }));
19
+ className: `${typeToClassName[type]} ${rest.className}`
20
+ }, children);
41
21
  };
42
-
43
- const DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');
22
+ DSPillButton.propTypes = DSPillButtonPropTypes;
23
+ const DSPillButtonWithSchema = describe(DSPillButton).description("Pill button");
44
24
  DSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;
45
-
46
- export { DSPillButton, DSPillButtonWithSchema };
25
+ export {
26
+ DSPillButton,
27
+ DSPillButtonWithSchema
28
+ };
29
+ //# sourceMappingURL=PillButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/PillButton.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { DSButtonPropsT } from '@elliemae/ds-button';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { StyledPillButton } from './styled';\nimport { DSPillButtonDefaultProps, DSPillButtonPropTypes } from '../props';\n\nconst typeToClassName = {\n only: 'ds-pill-button-only',\n left: 'ds-pill-button-left',\n right: 'ds-pill-button-right',\n};\n\nconst DSPillButton: React.ComponentType<DSButtonPropsT> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);\n\n const { type, children, ...rest } = propsWithDefaults;\n\n return (\n <StyledPillButton {...rest} buttonType=\"raw\" className={`${typeToClassName[type]} ${rest.className}`}>\n {children}\n </StyledPillButton>\n );\n};\n\nDSPillButton.propTypes = DSPillButtonPropTypes;\nconst DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');\nDSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;\n\nexport { DSPillButton, DSPillButtonWithSchema };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AAEA;AACA;AACA;AAEA,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA;AAGT,MAAM,eAAoD,CAAC,UAAU;AACnE,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA+B,mBAAmB;AAElD,QAAM,EAAE,MAAM,aAAa,SAAS;AAEpC,SACE,qCAAC,kBAAD;AAAA,OAAsB;AAAA,IAAM,YAAW;AAAA,IAAM,WAAW,GAAG,gBAAgB,SAAS,KAAK;AAAA,KACtF;AAAA;AAKP,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS,cAAc,YAAY;AAClE,uBAAuB,YAAY;",
6
+ "names": []
7
+ }