@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.
- package/cjs/components/Pill.js +56 -49
- package/cjs/components/Pill.js.map +7 -0
- package/cjs/components/PillButton.js +54 -52
- package/cjs/components/PillButton.js.map +7 -0
- package/cjs/components/PillGroup.js +61 -53
- package/cjs/components/PillGroup.js.map +7 -0
- package/cjs/components/index.js +30 -17
- package/cjs/components/index.js.map +7 -0
- package/cjs/components/styled.js +228 -78
- package/cjs/components/styled.js.map +7 -0
- package/cjs/components/types/DropdownPill.js +79 -77
- package/cjs/components/types/DropdownPill.js.map +7 -0
- package/cjs/components/types/InputPill.js +58 -48
- package/cjs/components/types/InputPill.js.map +7 -0
- package/cjs/components/types/LabelPill.js +44 -38
- package/cjs/components/types/LabelPill.js.map +7 -0
- package/cjs/components/types/ReadOnlyPill.js +48 -43
- package/cjs/components/types/ReadOnlyPill.js.map +7 -0
- package/cjs/components/types/RemovablePill.js +60 -53
- package/cjs/components/types/RemovablePill.js.map +7 -0
- package/cjs/components/types/ValuePill.js +48 -43
- package/cjs/components/types/ValuePill.js.map +7 -0
- package/cjs/components/types/index.js +33 -19
- package/cjs/components/types/index.js.map +7 -0
- package/cjs/deprecated/DropdownPill.js +80 -101
- package/cjs/deprecated/DropdownPill.js.map +7 -0
- package/cjs/deprecated/InputPill.js +67 -69
- package/cjs/deprecated/InputPill.js.map +7 -0
- package/cjs/deprecated/LabeledDropdownPills.js +92 -96
- package/cjs/deprecated/LabeledDropdownPills.js.map +7 -0
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +91 -94
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +106 -114
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +119 -127
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +39 -15
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
- package/cjs/deprecated/LabeledPills.js +65 -52
- package/cjs/deprecated/LabeledPills.js.map +7 -0
- package/cjs/deprecated/OverflowPill.js +59 -53
- package/cjs/deprecated/OverflowPill.js.map +7 -0
- package/cjs/deprecated/Pill.js +67 -82
- package/cjs/deprecated/Pill.js.map +7 -0
- package/cjs/deprecated/PillGroup.js +68 -68
- package/cjs/deprecated/PillGroup.js.map +7 -0
- package/cjs/deprecated/ReadOnlyPill.js +93 -94
- package/cjs/deprecated/ReadOnlyPill.js.map +7 -0
- package/cjs/deprecated/RemovablePill.js +61 -57
- package/cjs/deprecated/RemovablePill.js.map +7 -0
- package/cjs/deprecated/index.js +43 -33
- package/cjs/deprecated/index.js.map +7 -0
- package/cjs/index.d.js +27 -2
- package/cjs/index.d.js.map +7 -0
- package/cjs/index.js +37 -43
- package/cjs/index.js.map +7 -0
- package/cjs/props.js +72 -46
- package/cjs/props.js.map +7 -0
- package/cjs/utils.js +43 -25
- package/cjs/utils.js.map +7 -0
- package/esm/components/Pill.js +18 -31
- package/esm/components/Pill.js.map +7 -0
- package/esm/components/PillButton.js +22 -39
- package/esm/components/PillButton.js.map +7 -0
- package/esm/components/PillGroup.js +28 -38
- package/esm/components/PillGroup.js.map +7 -0
- package/esm/components/index.js +5 -3
- package/esm/components/index.js.map +7 -0
- package/esm/components/styled.js +205 -66
- package/esm/components/styled.js.map +7 -0
- package/esm/components/types/DropdownPill.js +50 -67
- package/esm/components/types/DropdownPill.js.map +7 -0
- package/esm/components/types/InputPill.js +25 -35
- package/esm/components/types/InputPill.js.map +7 -0
- package/esm/components/types/LabelPill.js +15 -29
- package/esm/components/types/LabelPill.js.map +7 -0
- package/esm/components/types/ReadOnlyPill.js +19 -34
- package/esm/components/types/ReadOnlyPill.js.map +7 -0
- package/esm/components/types/RemovablePill.js +31 -44
- package/esm/components/types/RemovablePill.js.map +7 -0
- package/esm/components/types/ValuePill.js +19 -34
- package/esm/components/types/ValuePill.js.map +7 -0
- package/esm/components/types/index.js +8 -6
- package/esm/components/types/index.js.map +7 -0
- package/esm/deprecated/DropdownPill.js +49 -86
- package/esm/deprecated/DropdownPill.js.map +7 -0
- package/esm/deprecated/InputPill.js +38 -59
- package/esm/deprecated/InputPill.js.map +7 -0
- package/esm/deprecated/LabeledDropdownPills.js +59 -81
- package/esm/deprecated/LabeledDropdownPills.js.map +7 -0
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +60 -84
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +65 -94
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +79 -108
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +9 -10
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
- package/esm/deprecated/LabeledPills.js +34 -41
- package/esm/deprecated/LabeledPills.js.map +7 -0
- package/esm/deprecated/OverflowPill.js +25 -37
- package/esm/deprecated/OverflowPill.js.map +7 -0
- package/esm/deprecated/Pill.js +39 -71
- package/esm/deprecated/Pill.js.map +7 -0
- package/esm/deprecated/PillGroup.js +39 -56
- package/esm/deprecated/PillGroup.js.map +7 -0
- package/esm/deprecated/ReadOnlyPill.js +60 -79
- package/esm/deprecated/ReadOnlyPill.js.map +7 -0
- package/esm/deprecated/RemovablePill.js +30 -45
- package/esm/deprecated/RemovablePill.js.map +7 -0
- package/esm/deprecated/index.js +14 -8
- package/esm/deprecated/index.js.map +7 -0
- package/esm/index.d.js +2 -1
- package/esm/index.d.js.map +7 -0
- package/esm/index.js +8 -11
- package/esm/index.js.map +7 -0
- package/esm/props.js +42 -36
- package/esm/props.js.map +7 -0
- package/esm/utils.js +16 -23
- package/esm/utils.js.map +7 -0
- package/package.json +15 -15
- package/types/deprecated/LabeledDropdownPills.d.ts +1 -1
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +3 -1
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +3 -1
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +1 -0
package/cjs/index.d.js
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports
|
|
37
|
-
|
|
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
|
package/cjs/index.js.map
ADDED
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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:
|
|
12
|
-
type: pillTypes.description(
|
|
13
|
-
innerRef:
|
|
14
|
-
size:
|
|
15
|
-
ariaLabel:
|
|
16
|
-
labelTruncated:
|
|
17
|
-
tooltipValue:
|
|
18
|
-
iconLeft:
|
|
19
|
-
iconRight:
|
|
20
|
-
onRemove:
|
|
21
|
-
inputPlaceholder:
|
|
22
|
-
onInputChange:
|
|
23
|
-
onInputClear:
|
|
24
|
-
inputWidth:
|
|
25
|
-
dropdownProps:
|
|
26
|
-
onDropdownClick:
|
|
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:
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
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:
|
|
35
|
-
innerRef:
|
|
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:
|
|
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:
|
|
81
|
+
inputRender: import_ds_form.DSInput,
|
|
51
82
|
dropdownProps: {},
|
|
52
83
|
onDropdownClick: () => null
|
|
53
84
|
};
|
|
54
85
|
const DSPillButtonDefaultProps = {
|
|
55
|
-
type:
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
86
|
+
type: "right",
|
|
87
|
+
width: "100%",
|
|
88
|
+
height: "100%"
|
|
58
89
|
};
|
|
59
90
|
const DSPillGroupDefaultProps = {
|
|
60
|
-
width:
|
|
91
|
+
width: "fit-content",
|
|
61
92
|
innerRef: () => null
|
|
62
93
|
};
|
|
63
|
-
|
|
64
|
-
|
|
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
|
package/cjs/props.js.map
ADDED
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
45
|
+
module.exports = __toCommonJS(utils_exports);
|
|
46
|
+
//# sourceMappingURL=utils.js.map
|
package/cjs/utils.js.map
ADDED
|
@@ -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
|
+
}
|
package/esm/components/Pill.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
20
|
+
return /* @__PURE__ */ React2.createElement(PillComponent, {
|
|
21
|
+
...propsWithDefaults
|
|
22
|
+
});
|
|
39
23
|
};
|
|
40
|
-
|
|
41
|
-
const DSPillV2WithSchema = describe(DSPillV2).description(
|
|
24
|
+
DSPillV2.propTypes = DSPillV2PropTypes;
|
|
25
|
+
const DSPillV2WithSchema = describe(DSPillV2).description("Pill");
|
|
42
26
|
DSPillV2WithSchema.propTypes = DSPillV2PropTypes;
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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:
|
|
22
|
-
left:
|
|
23
|
-
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
|
-
|
|
31
|
-
|
|
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:
|
|
39
|
-
|
|
40
|
-
}));
|
|
19
|
+
className: `${typeToClassName[type]} ${rest.className}`
|
|
20
|
+
}, children);
|
|
41
21
|
};
|
|
42
|
-
|
|
43
|
-
const DSPillButtonWithSchema = describe(DSPillButton).description(
|
|
22
|
+
DSPillButton.propTypes = DSPillButtonPropTypes;
|
|
23
|
+
const DSPillButtonWithSchema = describe(DSPillButton).description("Pill button");
|
|
44
24
|
DSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
}
|