@elliemae/ds-pills 3.0.0-next.9 → 3.0.1
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/dist/cjs/components/Pill.js +13 -19
- package/dist/cjs/components/Pill.js.map +2 -2
- package/dist/cjs/components/PillButton.js +13 -19
- package/dist/cjs/components/PillButton.js.map +2 -2
- package/dist/cjs/components/PillGroup.js +15 -21
- package/dist/cjs/components/PillGroup.js.map +2 -2
- package/dist/cjs/components/index.js +13 -19
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/styled.js +15 -19
- package/dist/cjs/components/styled.js.map +2 -2
- package/dist/cjs/components/types/DropdownPill.js +11 -18
- package/dist/cjs/components/types/DropdownPill.js.map +2 -2
- package/dist/cjs/components/types/InputPill.js +24 -19
- package/dist/cjs/components/types/InputPill.js.map +2 -2
- package/dist/cjs/components/types/LabelPill.js +9 -16
- package/dist/cjs/components/types/LabelPill.js.map +1 -1
- package/dist/cjs/components/types/ReadOnlyPill.js +9 -16
- package/dist/cjs/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/cjs/components/types/RemovablePill.js +9 -16
- package/dist/cjs/components/types/RemovablePill.js.map +1 -1
- package/dist/cjs/components/types/ValuePill.js +15 -23
- package/dist/cjs/components/types/ValuePill.js.map +2 -2
- package/dist/cjs/components/types/index.js +16 -22
- package/dist/cjs/components/types/index.js.map +1 -1
- package/dist/cjs/deprecated/DropdownPill.js +12 -18
- package/dist/cjs/deprecated/DropdownPill.js.map +2 -2
- package/dist/cjs/deprecated/InputPill.js +9 -16
- package/dist/cjs/deprecated/InputPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPills.js +10 -16
- package/dist/cjs/deprecated/LabeledDropdownPills.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +9 -16
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +9 -16
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +9 -16
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +9 -16
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/dist/cjs/deprecated/LabeledPills.js +10 -16
- package/dist/cjs/deprecated/LabeledPills.js.map +2 -2
- package/dist/cjs/deprecated/OverflowPill.js +12 -18
- package/dist/cjs/deprecated/OverflowPill.js.map +2 -2
- package/dist/cjs/deprecated/Pill.js +10 -16
- package/dist/cjs/deprecated/Pill.js.map +2 -2
- package/dist/cjs/deprecated/PillGroup.js +13 -28
- package/dist/cjs/deprecated/PillGroup.js.map +2 -2
- package/dist/cjs/deprecated/ReadOnlyPill.js +10 -16
- package/dist/cjs/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/cjs/deprecated/RemovablePill.js +12 -18
- package/dist/cjs/deprecated/RemovablePill.js.map +2 -2
- package/dist/cjs/deprecated/index.js +18 -24
- package/dist/cjs/deprecated/index.js.map +1 -1
- package/dist/cjs/index.d.js +9 -16
- package/dist/cjs/index.d.js.map +2 -2
- package/dist/cjs/index.js +12 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/props.js +14 -17
- package/dist/cjs/props.js.map +2 -2
- package/dist/cjs/utils.js +9 -16
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/components/Pill.js +2 -1
- package/dist/esm/components/Pill.js.map +2 -2
- package/dist/esm/components/PillButton.js +2 -1
- package/dist/esm/components/PillButton.js.map +2 -2
- package/dist/esm/components/PillGroup.js +2 -1
- package/dist/esm/components/PillGroup.js.map +2 -2
- package/dist/esm/components/styled.js +6 -3
- package/dist/esm/components/styled.js.map +2 -2
- package/dist/esm/components/types/DropdownPill.js +1 -1
- package/dist/esm/components/types/DropdownPill.js.map +2 -2
- package/dist/esm/components/types/InputPill.js +15 -3
- package/dist/esm/components/types/InputPill.js.map +2 -2
- package/dist/esm/components/types/LabelPill.js.map +1 -1
- package/dist/esm/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/esm/components/types/RemovablePill.js.map +1 -1
- package/dist/esm/components/types/ValuePill.js +7 -8
- package/dist/esm/components/types/ValuePill.js.map +2 -2
- package/dist/esm/deprecated/DropdownPill.js +2 -1
- package/dist/esm/deprecated/DropdownPill.js.map +2 -2
- package/dist/esm/deprecated/InputPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPills.js +1 -0
- package/dist/esm/deprecated/LabeledDropdownPills.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/dist/esm/deprecated/LabeledPills.js +1 -0
- package/dist/esm/deprecated/LabeledPills.js.map +2 -2
- package/dist/esm/deprecated/OverflowPill.js +2 -1
- package/dist/esm/deprecated/OverflowPill.js.map +2 -2
- package/dist/esm/deprecated/Pill.js +1 -0
- package/dist/esm/deprecated/Pill.js.map +2 -2
- package/dist/esm/deprecated/PillGroup.js +4 -12
- package/dist/esm/deprecated/PillGroup.js.map +2 -2
- package/dist/esm/deprecated/ReadOnlyPill.js +1 -0
- package/dist/esm/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/esm/deprecated/RemovablePill.js +2 -1
- package/dist/esm/deprecated/RemovablePill.js.map +2 -2
- package/dist/esm/props.js +5 -1
- package/dist/esm/props.js.map +2 -2
- package/dist/esm/utils.js.map +1 -1
- package/package.json +23 -23
|
@@ -18,36 +18,30 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var Pill_exports = {};
|
|
43
36
|
__export(Pill_exports, {
|
|
44
37
|
DSPillV2: () => DSPillV2,
|
|
45
38
|
DSPillV2WithSchema: () => DSPillV2WithSchema
|
|
46
39
|
});
|
|
40
|
+
module.exports = __toCommonJS(Pill_exports);
|
|
47
41
|
var React = __toESM(require("react"));
|
|
48
42
|
var import_react = __toESM(require("react"));
|
|
49
43
|
var import_react_desc = require("react-desc");
|
|
50
|
-
var
|
|
44
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
51
45
|
var import_props = require("../props");
|
|
52
46
|
var import_types = require("./types");
|
|
53
47
|
const pillComponentGetter = {
|
|
@@ -59,14 +53,14 @@ const pillComponentGetter = {
|
|
|
59
53
|
value: import_types.ValuePill
|
|
60
54
|
};
|
|
61
55
|
const DSPillV2 = (props) => {
|
|
62
|
-
const propsWithDefaults = (0,
|
|
63
|
-
(0,
|
|
56
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.DSPillV2DefaultProps);
|
|
57
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.DSPillV2PropTypes);
|
|
64
58
|
const { type } = propsWithDefaults;
|
|
65
59
|
const PillComponent = pillComponentGetter[type];
|
|
66
60
|
return /* @__PURE__ */ import_react.default.createElement(PillComponent, __spreadValues({}, propsWithDefaults));
|
|
67
61
|
};
|
|
68
62
|
DSPillV2.propTypes = import_props.DSPillV2PropTypes;
|
|
63
|
+
DSPillV2.displayName = "DSPillV2";
|
|
69
64
|
const DSPillV2WithSchema = (0, import_react_desc.describe)(DSPillV2).description("Pill");
|
|
70
65
|
DSPillV2WithSchema.propTypes = import_props.DSPillV2PropTypes;
|
|
71
|
-
module.exports = __toCommonJS(Pill_exports);
|
|
72
66
|
//# sourceMappingURL=Pill.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Pill.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\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;\nDSPillV2.displayName = 'DSPillV2';\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAyB;AACzB,0BAA6E;AAE7E,mBAAwD;AACxD,mBAA2F;AAE3F,MAAM,sBAAwE;AAAA,EAC5E,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AACT;AAEA,MAAM,WAA6C,CAAC,UAAU;AAC5D,QAAM,oBAAoB,sDAA6B,OAAO,iCAAoB;AAClF,0DAA+B,mBAAmB,8BAAiB;AACnE,QAAM,EAAE,SAAS;AACjB,QAAM,gBAAgB,oBAAoB;AAE1C,SAAO,mDAAC,kCAAkB,kBAAmB;AAC/C;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,gCAAS,QAAQ,EAAE,YAAY,MAAM;AAChE,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __objRest = (source, exclude) => {
|
|
26
25
|
var target = {};
|
|
27
26
|
for (var prop in source)
|
|
@@ -38,31 +37,26 @@ var __export = (target, all) => {
|
|
|
38
37
|
for (var name in all)
|
|
39
38
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
39
|
};
|
|
41
|
-
var
|
|
42
|
-
if (
|
|
43
|
-
for (let key of __getOwnPropNames(
|
|
44
|
-
if (!__hasOwnProp.call(
|
|
45
|
-
__defProp(
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
45
|
}
|
|
47
|
-
return
|
|
48
|
-
};
|
|
49
|
-
var __toESM = (module2, isNodeMode) => {
|
|
50
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
46
|
+
return to;
|
|
51
47
|
};
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
55
|
-
};
|
|
56
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
57
50
|
var PillButton_exports = {};
|
|
58
51
|
__export(PillButton_exports, {
|
|
59
52
|
DSPillButton: () => DSPillButton,
|
|
60
53
|
DSPillButtonWithSchema: () => DSPillButtonWithSchema
|
|
61
54
|
});
|
|
55
|
+
module.exports = __toCommonJS(PillButton_exports);
|
|
62
56
|
var React = __toESM(require("react"));
|
|
63
57
|
var import_react = __toESM(require("react"));
|
|
64
58
|
var import_react_desc = require("react-desc");
|
|
65
|
-
var
|
|
59
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
66
60
|
var import_styled = require("./styled");
|
|
67
61
|
var import_props = require("../props");
|
|
68
62
|
const typeToClassName = {
|
|
@@ -71,8 +65,8 @@ const typeToClassName = {
|
|
|
71
65
|
right: "ds-pill-button-right"
|
|
72
66
|
};
|
|
73
67
|
const DSPillButton = (props) => {
|
|
74
|
-
const propsWithDefaults = (0,
|
|
75
|
-
(0,
|
|
68
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.DSPillButtonDefaultProps);
|
|
69
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.DSPillButtonPropTypes);
|
|
76
70
|
const _a = propsWithDefaults, { type, children } = _a, rest = __objRest(_a, ["type", "children"]);
|
|
77
71
|
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledPillButton, __spreadProps(__spreadValues({}, rest), {
|
|
78
72
|
buttonType: "raw",
|
|
@@ -80,7 +74,7 @@ const DSPillButton = (props) => {
|
|
|
80
74
|
}), children);
|
|
81
75
|
};
|
|
82
76
|
DSPillButton.propTypes = import_props.DSPillButtonPropTypes;
|
|
77
|
+
DSPillButton.displayName = "DSPillButton";
|
|
83
78
|
const DSPillButtonWithSchema = (0, import_react_desc.describe)(DSPillButton).description("Pill button");
|
|
84
79
|
DSPillButtonWithSchema.propTypes = import_props.DSPillButtonPropTypes;
|
|
85
|
-
module.exports = __toCommonJS(PillButton_exports);
|
|
86
80
|
//# sourceMappingURL=PillButton.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/PillButton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* 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-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* 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-utilities';\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;\nDSPillButton.displayName = 'DSPillButton';\nconst DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');\nDSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;\n\nexport { DSPillButton, DSPillButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAyB;AAEzB,0BAA6E;AAC7E,oBAAiC;AACjC,mBAAgE;AAEhE,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,eAAoD,CAAC,UAAU;AACnE,QAAM,oBAAoB,sDAA6B,OAAO,qCAAwB;AACtF,0DAA+B,mBAAmB,kCAAqB;AAEvE,QAAoC,wBAA5B,QAAM,aAAsB,IAAT,iBAAS,IAAT,CAAnB,QAAM;AAEd,SACE,mDAAC,iEAAqB,OAArB;AAAA,IAA2B,YAAW;AAAA,IAAM,WAAW,GAAG,gBAAgB,SAAS,KAAK;AAAA,MACtF,QACH;AAEJ;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,gCAAS,YAAY,EAAE,YAAY,aAAa;AAC/E,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,37 +21,31 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var PillGroup_exports = {};
|
|
46
39
|
__export(PillGroup_exports, {
|
|
47
40
|
DSPillGroupV2: () => DSPillGroupV2,
|
|
48
41
|
DSPillGroupV2Context: () => DSPillGroupV2Context,
|
|
49
42
|
DSPillGroupV2WithSchema: () => DSPillGroupV2WithSchema
|
|
50
43
|
});
|
|
44
|
+
module.exports = __toCommonJS(PillGroup_exports);
|
|
51
45
|
var React = __toESM(require("react"));
|
|
52
46
|
var import_react = __toESM(require("react"));
|
|
53
47
|
var import_uid = require("uid");
|
|
54
|
-
var
|
|
48
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
55
49
|
var import_props = require("../props");
|
|
56
50
|
var import_styled = require("./styled");
|
|
57
51
|
const DSPillGroupV2Context = (0, import_react.createContext)({
|
|
@@ -59,9 +53,9 @@ const DSPillGroupV2Context = (0, import_react.createContext)({
|
|
|
59
53
|
onKeyboardNavigation: () => null
|
|
60
54
|
});
|
|
61
55
|
const DSPillGroupV2 = (props) => {
|
|
62
|
-
const propsWithDefaults = (0,
|
|
63
|
-
(0,
|
|
64
|
-
const globalAttrs = (0,
|
|
56
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.DSPillGroupDefaultProps);
|
|
57
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.DSPillGroupPropTypes);
|
|
58
|
+
const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults);
|
|
65
59
|
const pillGroupUid = (0, import_react.useMemo)(() => `ds-pill-group-${(0, import_uid.uid)()}`, []);
|
|
66
60
|
const { children, width, innerRef } = propsWithDefaults;
|
|
67
61
|
const onKeyboardRemove = (0, import_react.useCallback)((pillUid) => {
|
|
@@ -94,7 +88,7 @@ const DSPillGroupV2 = (props) => {
|
|
|
94
88
|
}), children));
|
|
95
89
|
};
|
|
96
90
|
DSPillGroupV2.propTypes = import_props.DSPillGroupPropTypes;
|
|
97
|
-
|
|
91
|
+
DSPillGroupV2.displayName = "DSPillGroupV2";
|
|
92
|
+
const DSPillGroupV2WithSchema = (0, import_ds_utilities.describe)(DSPillGroupV2);
|
|
98
93
|
DSPillGroupV2WithSchema.propTypes = import_props.DSPillGroupPropTypes;
|
|
99
|
-
module.exports = __toCommonJS(PillGroup_exports);
|
|
100
94
|
//# sourceMappingURL=PillGroup.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/PillGroup.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { createContext, useCallback, useMemo, WeakValidationMap } from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { createContext, useCallback, useMemo, WeakValidationMap } from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props';\nimport { StyledPillGroup } from './styled';\n\nexport const DSPillGroupV2Context = createContext<{\n onKeyboardRemove: (pillUid: string) => void;\n onKeyboardNavigation: (pillUid: string, step: number, e: KeyboardEvent) => void;\n}>({\n onKeyboardRemove: () => null,\n onKeyboardNavigation: () => null,\n});\n\nconst DSPillGroupV2: React.ComponentType<DSPillGroupProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults);\n const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);\n const { children, width, innerRef } = propsWithDefaults;\n const onKeyboardRemove = useCallback(\n (pillUid: string) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex > 0) {\n elems[pillIndex - 1].focus();\n } else if (pillIndex + 1 < elems.length) {\n elems[pillIndex + 1].focus();\n }\n },\n [pillGroupUid],\n );\n const onKeyboardNavigation = useCallback(\n (pillUid: string, step: number, e: KeyboardEvent) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex >= 0) {\n if (elems[pillIndex + step]) {\n e.stopPropagation();\n elems[pillIndex + step].focus();\n }\n }\n },\n [pillGroupUid],\n );\n\n return (\n <DSPillGroupV2Context.Provider value={{ onKeyboardRemove, onKeyboardNavigation }}>\n <StyledPillGroup\n {...globalAttrs}\n width={width}\n id={pillGroupUid}\n cols={React.Children.map(children, () => 'auto')}\n gutter=\"2px\"\n ref={innerRef}\n >\n {children}\n </StyledPillGroup>\n </DSPillGroupV2Context.Provider>\n );\n};\n\nDSPillGroupV2.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\nDSPillGroupV2.displayName = 'DSPillGroupV2';\nconst DSPillGroupV2WithSchema = describe(DSPillGroupV2);\nDSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\n\nexport { DSPillGroupV2, DSPillGroupV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA8E;AAC9E,iBAAoB;AACpB,0BAKO;AAEP,mBAA8D;AAC9D,oBAAgC;AAEzB,MAAM,uBAAuB,gCAGjC;AAAA,EACD,kBAAkB,MAAM;AAAA,EACxB,sBAAsB,MAAM;AAC9B,CAAC;AAED,MAAM,gBAAuD,CAAC,UAAU;AACtE,QAAM,oBAAoB,sDAA6B,OAAO,oCAAuB;AACrF,0DAA+B,mBAAmB,iCAAoB;AAEtE,QAAM,cAAc,gDAAuB,iBAAiB;AAC5D,QAAM,eAAe,0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__getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
|
|
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);
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var components_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(components_exports, require("./Pill"));
|
|
27
|
-
__reExport(components_exports, require("./PillGroup"));
|
|
28
|
-
__reExport(components_exports, require("./PillButton"));
|
|
29
19
|
module.exports = __toCommonJS(components_exports);
|
|
20
|
+
var React = __toESM(require("react"));
|
|
21
|
+
__reExport(components_exports, require("./Pill"), module.exports);
|
|
22
|
+
__reExport(components_exports, require("./PillGroup"), module.exports);
|
|
23
|
+
__reExport(components_exports, require("./PillButton"), module.exports);
|
|
30
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './Pill';\nexport * from './PillGroup';\nexport * from './PillButton';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,mBAAd;AACA,+BAAc,wBADd;AAEA,+BAAc,yBAFd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var styled_exports = {};
|
|
29
22
|
__export(styled_exports, {
|
|
30
23
|
StyledDropdownPillWrapper: () => StyledDropdownPillWrapper,
|
|
@@ -37,12 +30,13 @@ __export(styled_exports, {
|
|
|
37
30
|
StyledSpanWithTooltip: () => StyledSpanWithTooltip,
|
|
38
31
|
StyledValuePillWrapper: () => StyledValuePillWrapper
|
|
39
32
|
});
|
|
33
|
+
module.exports = __toCommonJS(styled_exports);
|
|
40
34
|
var React = __toESM(require("react"));
|
|
41
35
|
var import_styled_components = __toESM(require("styled-components"));
|
|
42
36
|
var import_ds_system = require("@elliemae/ds-system");
|
|
43
37
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
44
38
|
var import_ds_button = require("@elliemae/ds-button");
|
|
45
|
-
const borderOutside = (color, size = 1,
|
|
39
|
+
const borderOutside = (color, size = 1, borderRadius = "12px") => import_ds_system.css`
|
|
46
40
|
:after {
|
|
47
41
|
content: ' ';
|
|
48
42
|
position: absolute;
|
|
@@ -56,7 +50,6 @@ const borderOutside = (color, size = 1, zIndex = 2, borderRadius = "12px") => im
|
|
|
56
50
|
border-bottom-left-radius: ${borderRadius};
|
|
57
51
|
border-bottom-right-radius: ${borderRadius};
|
|
58
52
|
pointer-events: none;
|
|
59
|
-
z-index: ${zIndex};
|
|
60
53
|
}
|
|
61
54
|
`;
|
|
62
55
|
const commonPillWrapperCss = import_ds_system.css`
|
|
@@ -100,7 +93,11 @@ const StyledInputPillWrapper = (0, import_styled_components.default)(import_ds_g
|
|
|
100
93
|
background: ${(props) => props.theme.colors.neutral["000"]};
|
|
101
94
|
padding: 0;
|
|
102
95
|
|
|
103
|
-
${({
|
|
96
|
+
${({ theme, hasError }) => {
|
|
97
|
+
if (hasError)
|
|
98
|
+
return borderOutside(theme.colors.danger[900]);
|
|
99
|
+
return borderOutside(theme.colors.brand[500]);
|
|
100
|
+
}}
|
|
104
101
|
|
|
105
102
|
:focus-within {
|
|
106
103
|
${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : ""}
|
|
@@ -233,5 +230,4 @@ const StyledPillButton = (0, import_styled_components.default)(import_ds_button.
|
|
|
233
230
|
|
|
234
231
|
cursor: pointer;
|
|
235
232
|
`;
|
|
236
|
-
module.exports = __toCommonJS(styled_exports);
|
|
237
233
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nconst borderOutside = (color: string, size = 1,
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\n\ninterface InputPillWrapperProps {\n value: string;\n inputWidth: number;\n inputHasFocus: boolean;\n hasError: boolean;\n}\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nconst borderOutside = (color: string, size = 1, borderRadius = '12px') => css`\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ${size}px solid ${({ disabled, theme }) => (disabled ? theme.colors.neutral[400] : color)};\n border-top-left-radius: ${borderRadius};\n border-top-right-radius: ${borderRadius};\n border-bottom-left-radius: ${borderRadius};\n border-bottom-right-radius: ${borderRadius};\n pointer-events: none;\n }\n`;\n\nconst commonPillWrapperCss = css<{ size: 'm' | 's' }>`\n height: ${(props) => (props?.size === 'm' ? '24px' : '18px')};\n\n position: relative;\n\n width: fit-content;\n\n background-color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['080'] : theme.colors.brand[200])};\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n user-select: ${({ disabled }) => (disabled ? 'none' : 'auto')};\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['800'])};\n ${(props) => borderOutside(props.theme.colors.brand[300])};\n`;\n\n// =============================================================================\n// Pills wrappers\n// =============================================================================\n\nexport const StyledLabelPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledValuePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledInputPillWrapper = styled(Grid)<InputPillWrapperProps>`\n ${commonPillWrapperCss}\n\n background: ${(props) => props.theme.colors.neutral['000']};\n padding: 0;\n\n ${({ theme, hasError }) => {\n if (hasError) return borderOutside(theme.colors.danger[900]);\n return borderOutside(theme.colors.brand[500]);\n }}\n\n :focus-within {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '')}\n }\n\n :active {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '')}\n }\n\n & .em-ds-input {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n height: 100%;\n background: transparent;\n width: ${(props) => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`};\n padding: 0;\n margin: 0 0 0 8px;\n }\n\n & .em-ds-input__tooltip-ref {\n height: 100%;\n }\n`;\n\nexport const StyledDropdownPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n\n padding: 0 0 0 12px;\n`;\n\nexport const StyledReadonlyPillWrapper = styled(Grid)<{ hasIconRight: boolean; hasIconLeft: boolean }>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-right: ${(props) => (props.hasIconRight ? '0 !important' : '12px')};\n padding-left: ${(props) => (props.hasIconLeft ? '0 !important' : '12px')};\n`;\n\nexport const StyledRemovablePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding: 0 0 0 12px;\n`;\n\n// =============================================================================\n// Pill group\n// =============================================================================\n\nexport const StyledPillGroup = styled(Grid)`\n width: ${({ width }) => width};\n\n // Pill edges\n & .ds-pill-wrapper {\n &:not(:first-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n &:not(:last-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n\n // Pill paddings to the left / right\n & .ds-pill-wrapper-label,\n & .ds-pill-wrapper-value,\n & .ds-pill-wrapper-readonly {\n &:not(:first-of-type) {\n padding-left: 8px;\n }\n &:not(:last-of-type) {\n padding-right: 8px;\n }\n }\n\n & .ds-pill-wrapper-removable:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper-dropdown:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper {\n :not(:first-of-type) {\n .ds-pill-button-left {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n :not(:last-of-type) {\n .ds-pill-button-right {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n`;\n\n// =============================================================================\n// Extra stuff\n// =============================================================================\n\nexport const StyledSpanWithTooltip = styled.span`\n outline: none;\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}\n }\n`;\n\nexport const StyledPillButton = styled(DSButtonV2)<{ width: string; height: string }>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n width: ${(props) => props.width};\n height: ${(props) => props.height};\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3, 'inherit')}\n }\n\n cursor: pointer;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAoB;AACpB,qBAAqB;AACrB,uBAA2B;AAa3B,MAAM,gBAAgB,CAAC,OAAe,OAAO,GAAG,eAAe,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAQ5D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,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,GAAG,CAAC;AAAA;AAAA;AAI3D,MAAM,mBAAmB,sCAAO,2BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAOtC,CAAC,UAAU,MAAM;AAAA,YAChB,CAAC,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,MAKvB,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,GAAG,GAAG,SAAS;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,34 +21,28 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var DropdownPill_exports = {};
|
|
46
39
|
__export(DropdownPill_exports, {
|
|
47
40
|
DropdownPill: () => DropdownPill
|
|
48
41
|
});
|
|
42
|
+
module.exports = __toCommonJS(DropdownPill_exports);
|
|
49
43
|
var React = __toESM(require("react"));
|
|
50
44
|
var import_react = __toESM(require("react"));
|
|
51
|
-
var
|
|
45
|
+
var import_ds_common = require("@elliemae/ds-common");
|
|
52
46
|
var import_uid = require("uid");
|
|
53
47
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
54
48
|
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
@@ -70,7 +64,7 @@ const DropdownPill = import_react.default.memo(({ label, size, labelTruncated, d
|
|
|
70
64
|
gutter: "2px",
|
|
71
65
|
alignItems: "center",
|
|
72
66
|
justifyItems: "center"
|
|
73
|
-
}, /* @__PURE__ */ import_react.default.createElement(TextComponent, null, label), /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
}, /* @__PURE__ */ import_react.default.createElement(TextComponent, null, label), /* @__PURE__ */ import_react.default.createElement(import_ds_common.DSDropdownMenuV2, __spreadProps(__spreadValues({
|
|
74
68
|
placementOrderPreference: [
|
|
75
69
|
"bottom-start",
|
|
76
70
|
"bottom",
|
|
@@ -101,5 +95,4 @@ const DropdownPill = import_react.default.memo(({ label, size, labelTruncated, d
|
|
|
101
95
|
height: 20
|
|
102
96
|
}))));
|
|
103
97
|
});
|
|
104
|
-
module.exports = __toCommonJS(DropdownPill_exports);
|
|
105
98
|
//# sourceMappingURL=DropdownPill.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/types/DropdownPill.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-common';\nimport { uid } from 'uid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledDropdownPillWrapper } from '../styled';\nimport type { DSPillProps } from '../../index.d';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const DropdownPill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {\n const chevronRef = useRef(null);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledDropdownPillWrapper\n size={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <TextComponent>{label}</TextComponent>\n <DSDropdownMenuV2\n placementOrderPreference={[\n 'bottom-start',\n 'bottom',\n 'bottom-end',\n 'right-end',\n 'top-start',\n 'top',\n 'top-end',\n ]}\n {...dropdownProps}\n onClickOutside={(e) => {\n if (e.code === 'Escape') chevronRef.current.focus();\n if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);\n }}\n wrapperStyles={{ w: '100%', h: '100%' }}\n >\n <DSPillButton\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-dropdown-chevron\"\n innerRef={setMultipleRefs(chevronRef, innerRef)}\n aria-label={ariaLabel || label}\n type=\"right\"\n onClick={onDropdownClick}\n >\n <ChevronSmallDown color={['brand-primary', '800']} width={20} height={20} />\n </DSPillButton>\n </DSDropdownMenuV2>\n </StyledDropdownPillWrapper>\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAuC;AACvC,uBAAiC;AACjC,iBAAoB;AACpB,sBAAiC;AACjC,uCAA2C;AAC3C,oBAA0C;AAE1C,mBAAgC;AAChC,wBAA6B;AAEtB,MAAM,eAAe,qBAAM,KAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,eAAe,UAAU,WAAW,sBAAsB;AACxF,QAAM,aAAa,yBAAO,IAAI;AAE9B,QAAM,UAAU,0BAAQ,MAAM,WAAW,oBAAI,KAAK,CAAC,CAAC;AAEpD,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,mDAAC;AAAA,IAA2B,OAAO;AAAA,GAAU,IAC/D,qBAAM;AAEV,SACE,mDAAC;AAAA,IACC;AAAA,IACA,IAAI;AAAA,IACJ,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,MAAM,CAAC,QAAQ,MAAM;AAAA,IACrB,QAAO;AAAA,IACP,YAAW;AAAA,IACX,cAAa;AAAA,KAEb,mDAAC,qBAAe,KAAM,GACtB,mDAAC;AAAA,IACC,0BAA0B;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,KACI,gBAVL;AAAA,IAWC,gBAAgB,CAAC,MAAM;AACrB,UAAI,EAAE,SAA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