@elliemae/ds-pills 3.15.0 → 3.16.0-next.10
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 +7 -7
- package/dist/cjs/components/Pill.js.map +2 -2
- package/dist/cjs/components/PillButton.js +7 -7
- package/dist/cjs/components/PillButton.js.map +2 -2
- package/dist/cjs/components/PillGroup.js +8 -8
- package/dist/cjs/components/PillGroup.js.map +2 -2
- package/dist/cjs/components/index.js +3 -3
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/types/DropdownPill.js +3 -3
- package/dist/cjs/components/types/DropdownPill.js.map +1 -1
- package/dist/cjs/components/types/InputPill.js +3 -3
- package/dist/cjs/components/types/InputPill.js.map +1 -1
- package/dist/cjs/components/types/LabelPill.js +1 -1
- package/dist/cjs/components/types/LabelPill.js.map +1 -1
- package/dist/cjs/components/types/ReadOnlyPill.js +1 -1
- package/dist/cjs/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/cjs/components/types/RemovablePill.js +3 -3
- package/dist/cjs/components/types/RemovablePill.js.map +1 -1
- package/dist/cjs/components/types/ValuePill.js +1 -1
- package/dist/cjs/components/types/ValuePill.js.map +1 -1
- package/dist/cjs/components/types/index.js +6 -6
- package/dist/cjs/components/types/index.js.map +2 -2
- package/dist/cjs/deprecated/DropdownPill.js +10 -10
- package/dist/cjs/deprecated/DropdownPill.js.map +2 -2
- package/dist/cjs/deprecated/InputPill.js +3 -1
- package/dist/cjs/deprecated/InputPill.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPills.js +23 -21
- package/dist/cjs/deprecated/LabeledDropdownPills.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +3 -3
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +4 -4
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +5 -5
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +2 -2
- package/dist/cjs/deprecated/LabeledPills.js +13 -13
- package/dist/cjs/deprecated/LabeledPills.js.map +2 -2
- package/dist/cjs/deprecated/OverflowPill.js +6 -6
- package/dist/cjs/deprecated/OverflowPill.js.map +2 -2
- package/dist/cjs/deprecated/Pill.js +16 -12
- package/dist/cjs/deprecated/Pill.js.map +2 -2
- package/dist/cjs/deprecated/PillGroup.js +7 -7
- package/dist/cjs/deprecated/PillGroup.js.map +2 -2
- package/dist/cjs/deprecated/ReadOnlyPill.js +9 -9
- package/dist/cjs/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/cjs/deprecated/RemovablePill.js +8 -7
- package/dist/cjs/deprecated/RemovablePill.js.map +2 -2
- package/dist/cjs/deprecated/index.js +9 -9
- package/dist/cjs/deprecated/index.js.map +2 -2
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/props.js +25 -25
- package/dist/cjs/props.js.map +2 -2
- package/dist/esm/components/Pill.js +4 -4
- package/dist/esm/components/Pill.js.map +1 -1
- package/dist/esm/components/PillButton.js +4 -4
- package/dist/esm/components/PillButton.js.map +1 -1
- package/dist/esm/components/PillGroup.js +4 -4
- package/dist/esm/components/PillGroup.js.map +2 -2
- package/dist/esm/components/index.js +3 -3
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/types/DropdownPill.js +3 -3
- package/dist/esm/components/types/DropdownPill.js.map +1 -1
- package/dist/esm/components/types/InputPill.js +3 -3
- package/dist/esm/components/types/InputPill.js.map +1 -1
- package/dist/esm/components/types/LabelPill.js +1 -1
- package/dist/esm/components/types/LabelPill.js.map +1 -1
- package/dist/esm/components/types/ReadOnlyPill.js +1 -1
- package/dist/esm/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/esm/components/types/RemovablePill.js +3 -3
- package/dist/esm/components/types/RemovablePill.js.map +1 -1
- package/dist/esm/components/types/ValuePill.js +1 -1
- package/dist/esm/components/types/ValuePill.js.map +1 -1
- package/dist/esm/components/types/index.js +6 -6
- package/dist/esm/components/types/index.js.map +1 -1
- package/dist/esm/deprecated/DropdownPill.js +2 -2
- package/dist/esm/deprecated/DropdownPill.js.map +2 -2
- package/dist/esm/deprecated/InputPill.js +3 -1
- package/dist/esm/deprecated/InputPill.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPills.js +7 -5
- package/dist/esm/deprecated/LabeledDropdownPills.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +3 -3
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +4 -4
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +5 -5
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +2 -2
- package/dist/esm/deprecated/LabeledPills.js +4 -4
- package/dist/esm/deprecated/LabeledPills.js.map +2 -2
- package/dist/esm/deprecated/OverflowPill.js +2 -2
- package/dist/esm/deprecated/OverflowPill.js.map +2 -2
- package/dist/esm/deprecated/Pill.js +10 -6
- package/dist/esm/deprecated/Pill.js.map +2 -2
- package/dist/esm/deprecated/PillGroup.js +1 -1
- package/dist/esm/deprecated/PillGroup.js.map +2 -2
- package/dist/esm/deprecated/ReadOnlyPill.js +2 -2
- package/dist/esm/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/esm/deprecated/RemovablePill.js +3 -2
- package/dist/esm/deprecated/RemovablePill.js.map +2 -2
- package/dist/esm/deprecated/index.js +9 -9
- package/dist/esm/deprecated/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/props.js +1 -1
- package/dist/esm/props.js.map +2 -2
- package/dist/types/components/Pill.d.ts +1 -1
- package/dist/types/components/PillButton.d.ts +1 -1
- package/dist/types/components/PillGroup.d.ts +1 -1
- package/dist/types/components/index.d.ts +3 -3
- package/dist/types/components/types/index.d.ts +6 -6
- package/dist/types/deprecated/DropdownPill.d.ts +8 -8
- package/dist/types/deprecated/LabeledDropdownPills.d.ts +10 -10
- package/dist/types/deprecated/LabeledPills.d.ts +7 -7
- package/dist/types/deprecated/OverflowPill.d.ts +4 -4
- package/dist/types/deprecated/Pill.d.ts +7 -7
- package/dist/types/deprecated/PillGroup.d.ts +6 -6
- package/dist/types/deprecated/ReadOnlyPill.d.ts +7 -7
- package/dist/types/deprecated/RemovablePill.d.ts +6 -6
- package/dist/types/deprecated/index.d.ts +9 -9
- package/dist/types/index.d.ts +3 -3
- package/dist/types/props.d.ts +24 -24
- package/package.json +16 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/ReadOnlyPill.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useRef, useState } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { InfoCircleSmall } from '@elliemae/ds-icons';\nimport { DSModal, MODAL_TYPE_V2 } from '@elliemae/ds-modal';\nimport { DSPopover } from '@elliemae/ds-popover';\nimport { Pill } from './Pill.js';\n\nconst ReadOnlyPill = ({\n containerProps = {},\n modalContent = '',\n label = '',\n leftAddon,\n modalTitle = '',\n tooltipText = '',\n}) => {\n const ref = useRef(null);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n\n const toggle = () => {\n setIsModalOpen(!isModalOpen);\n };\n\n return (\n <>\n <Pill\n data-testid=\"read-only-pill\"\n className=\"removable-pill\"\n containerProps={containerProps}\n innerRef={ref}\n label={label}\n leftAddon={leftAddon}\n rightAddon={\n <DSPopover\n isOpen={tooltipText && isTooltipOpen}\n content={tooltipText}\n placement=\"top\"\n showArrow\n renderTrigger={({ ref }) => (\n <InfoCircleSmall\n role=\"button\"\n data-testid=\"read-only-info-btn\"\n className=\"remove-pill-button\"\n onClick={toggle}\n onMouseEnter={() => setIsTooltipOpen(true)}\n onMouseLeave={() => setIsTooltipOpen(false)}\n color={['brand-primary', '600']}\n innerRef={ref}\n />\n )}\n />\n }\n tabIndex={-1}\n />\n <DSModal\n isOpen={isModalOpen}\n showClose\n shouldCloseOnOverlayClick\n modalTitle={modalTitle}\n modalType={MODAL_TYPE_V2.INFORMATION}\n onClose={toggle}\n version={2}\n >\n {modalContent}\n </DSModal>\n </>\n );\n};\n\nconst props = {\n /** props injected to component wrapper */\n containerProps: PropTypes.object.description('props injected to component wrapper'),\n /** labeled pill text label */\n label: PropTypes.string.isRequired.description('pill text label'),\n /** addon component to left */\n leftAddon: PropTypes.node.description('addon component to left'),\n /** read only pill modal content */\n modalContent: PropTypes.string.description('read only pill modal content'),\n /** read only pill modal title */\n modalTitle: PropTypes.string.description('read only pill modal title'),\n tooltipText: PropTypes.string.description('text to display in tooltip'),\n};\n\nReadOnlyPill.propTypes = props;\nReadOnlyPill.displayName = 'ReadOnlyPill';\nconst DSReadOnlyPillWithSchema = describe(ReadOnlyPill);\nDSReadOnlyPillWithSchema.propTypes = props;\n\nexport { ReadOnlyPill, DSReadOnlyPillWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4BnB;AAxBJ,mBAAwC;AACxC,8BAAoC;AACpC,sBAAgC;AAChC,sBAAuC;AACvC,wBAA0B;AAC1B,kBAAqB;AAErB,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB,CAAC;AAAA,EAClB,eAAe;AAAA,EACf,QAAQ;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,cAAc;AAChB,MAAM;AACJ,QAAM,UAAM,qBAAO,IAAI;AACvB,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AAExD,QAAM,SAAS,MAAM;AACnB,mBAAe,CAAC,WAAW;AAAA,EAC7B;AAEA,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,WAAU;AAAA,QACV;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA,YACE;AAAA,UAAC;AAAA;AAAA,YACC,QAAQ,eAAe;AAAA,YACvB,SAAS;AAAA,YACT,WAAU;AAAA,YACV,WAAS;AAAA,YACT,eAAe,CAAC,EAAE,KAAAA,KAAI,MACpB;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,eAAY;AAAA,gBACZ,WAAU;AAAA,gBACV,SAAS;AAAA,gBACT,cAAc,MAAM,iBAAiB,IAAI;AAAA,gBACzC,cAAc,MAAM,iBAAiB,KAAK;AAAA,gBAC1C,OAAO,CAAC,iBAAiB,KAAK;AAAA,gBAC9B,UAAUA;AAAA;AAAA,YACZ;AAAA;AAAA,QAEJ;AAAA,QAEF,UAAU;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ;AAAA,QACR,WAAS;AAAA,QACT,2BAAyB;AAAA,QACzB;AAAA,QACA,WAAW,8BAAc;AAAA,QACzB,SAAS;AAAA,QACT,SAAS;AAAA,QAER;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,kCAAU,OAAO,YAAY,qCAAqC;AAAA,EAElF,OAAO,kCAAU,OAAO,WAAW,YAAY,iBAAiB;AAAA,EAEhE,WAAW,kCAAU,KAAK,YAAY,yBAAyB;AAAA,EAE/D,cAAc,kCAAU,OAAO,YAAY,8BAA8B;AAAA,EAEzE,YAAY,kCAAU,OAAO,YAAY,4BAA4B;AAAA,EACrE,aAAa,kCAAU,OAAO,YAAY,4BAA4B;AACxE;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,+BAA2B,kCAAS,YAAY;AACtD,yBAAyB,YAAY;",
|
|
6
6
|
"names": ["ref"]
|
|
7
7
|
}
|
|
@@ -32,9 +32,10 @@ var React = __toESM(require("react"));
|
|
|
32
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
35
36
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
36
37
|
var import_ds_shared = require("@elliemae/ds-shared");
|
|
37
|
-
var import_Pill = require("./Pill");
|
|
38
|
+
var import_Pill = require("./Pill.js");
|
|
38
39
|
const RemovablePill = ({ containerProps = {}, label = "", onRemove, size = "m", leftAddon }) => {
|
|
39
40
|
const ref = (0, import_react.useRef)(null);
|
|
40
41
|
const { focusPrevious } = (0, import_ds_shared.useFocusGroupItem)(ref);
|
|
@@ -61,14 +62,14 @@ const RemovablePill = ({ containerProps = {}, label = "", onRemove, size = "m",
|
|
|
61
62
|
);
|
|
62
63
|
};
|
|
63
64
|
const props = {
|
|
64
|
-
containerProps:
|
|
65
|
-
label:
|
|
66
|
-
onRemove:
|
|
67
|
-
size:
|
|
68
|
-
leftAddon:
|
|
65
|
+
containerProps: import_ds_props_helpers.PropTypes.object.description("props injected to component wrapper"),
|
|
66
|
+
label: import_ds_props_helpers.PropTypes.string.isRequired.description("pill text label"),
|
|
67
|
+
onRemove: import_ds_props_helpers.PropTypes.func.description("remove click callback"),
|
|
68
|
+
size: import_ds_props_helpers.PropTypes.oneOf(["m", "l"]).description("pill size"),
|
|
69
|
+
leftAddon: import_ds_props_helpers.PropTypes.node.description("addon component to left")
|
|
69
70
|
};
|
|
70
71
|
RemovablePill.propTypes = props;
|
|
71
72
|
RemovablePill.displayName = "RemovablePill";
|
|
72
|
-
const DSRemovablePillWithSchema = (0,
|
|
73
|
+
const DSRemovablePillWithSchema = (0, import_ds_props_helpers.describe)(RemovablePill);
|
|
73
74
|
DSRemovablePillWithSchema.propTypes = props;
|
|
74
75
|
//# sourceMappingURL=RemovablePill.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/RemovablePill.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport React, { useRef } from 'react';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { useFocusGroupItem } from '@elliemae/ds-shared';\nimport { Pill } from './Pill.js';\n\nconst RemovablePill = ({ containerProps = {}, label = '', onRemove, size = 'm', leftAddon }) => {\n const ref = useRef(null);\n const { focusPrevious } = useFocusGroupItem(ref);\n return (\n <Pill\n className=\"removable-pill\"\n data-testid=\"removable-pill\"\n containerProps={containerProps}\n innerRef={ref}\n size={size}\n label={label}\n leftAddon={leftAddon}\n onKeyDown={(e) => {\n if (e.key === 'Backspace' && isFunction(onRemove)) {\n onRemove();\n if (isFunction(focusPrevious)) focusPrevious();\n }\n }}\n rightAddon={\n <CloseXsmall role=\"button\" data-testid=\"remove-pill-button\" className=\"remove-pill-button\" onClick={onRemove} />\n }\n tabIndex={-1}\n />\n );\n};\n\nconst props = {\n /** props injected to component wrapper */\n containerProps: PropTypes.object.description('props injected to component wrapper'),\n /** labeled pill text label */\n label: PropTypes.string.isRequired.description('pill text label'),\n /** remove click callback */\n onRemove: PropTypes.func.description('remove click callback'),\n /** pill size */\n size: PropTypes.oneOf(['m', 'l']).description('pill size'),\n /** addon component to left */\n leftAddon: PropTypes.node.description('addon component to left'),\n};\n\nRemovablePill.propTypes = props;\nRemovablePill.displayName = 'RemovablePill';\nconst DSRemovablePillWithSchema = describe(RemovablePill);\nDSRemovablePillWithSchema.propTypes = props;\n\nexport { RemovablePill, DSRemovablePillWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8Bf;AA1BR,mBAA8B;AAC9B,0BAA2B;AAC3B,8BAAoC;AACpC,sBAA4B;AAC5B,uBAAkC;AAClC,kBAAqB;AAErB,MAAM,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,GAAG,QAAQ,IAAI,UAAU,OAAO,KAAK,UAAU,MAAM;AAC9F,QAAM,UAAM,qBAAO,IAAI;AACvB,QAAM,EAAE,cAAc,QAAI,oCAAkB,GAAG;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MACZ;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,CAAC,MAAM;AAChB,YAAI,EAAE,QAAQ,mBAAe,gCAAW,QAAQ,GAAG;AACjD,mBAAS;AACT,kBAAI,gCAAW,aAAa;AAAG,0BAAc;AAAA,QAC/C;AAAA,MACF;AAAA,MACA,YACE,4CAAC,+BAAY,MAAK,UAAS,eAAY,sBAAqB,WAAU,sBAAqB,SAAS,UAAU;AAAA,MAEhH,UAAU;AAAA;AAAA,EACZ;AAEJ;AAEA,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,kCAAU,OAAO,YAAY,qCAAqC;AAAA,EAElF,OAAO,kCAAU,OAAO,WAAW,YAAY,iBAAiB;AAAA,EAEhE,UAAU,kCAAU,KAAK,YAAY,uBAAuB;AAAA,EAE5D,MAAM,kCAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,WAAW;AAAA,EAEzD,WAAW,kCAAU,KAAK,YAAY,yBAAyB;AACjE;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,gCAA4B,kCAAS,aAAa;AACxD,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -29,13 +29,13 @@ __export(deprecated_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(deprecated_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
__reExport(deprecated_exports, require("./Pill"), module.exports);
|
|
33
|
-
__reExport(deprecated_exports, require("./PillGroup"), module.exports);
|
|
34
|
-
__reExport(deprecated_exports, require("./LabeledDropdownPills"), module.exports);
|
|
35
|
-
__reExport(deprecated_exports, require("./LabeledPills"), module.exports);
|
|
36
|
-
__reExport(deprecated_exports, require("./DropdownPill"), module.exports);
|
|
37
|
-
__reExport(deprecated_exports, require("./RemovablePill"), module.exports);
|
|
38
|
-
__reExport(deprecated_exports, require("./ReadOnlyPill"), module.exports);
|
|
39
|
-
__reExport(deprecated_exports, require("./OverflowPill"), module.exports);
|
|
40
|
-
var import_Pill = __toESM(require("./Pill"));
|
|
32
|
+
__reExport(deprecated_exports, require("./Pill.js"), module.exports);
|
|
33
|
+
__reExport(deprecated_exports, require("./PillGroup.js"), module.exports);
|
|
34
|
+
__reExport(deprecated_exports, require("./LabeledDropdownPills.js"), module.exports);
|
|
35
|
+
__reExport(deprecated_exports, require("./LabeledPills.js"), module.exports);
|
|
36
|
+
__reExport(deprecated_exports, require("./DropdownPill.js"), module.exports);
|
|
37
|
+
__reExport(deprecated_exports, require("./RemovablePill.js"), module.exports);
|
|
38
|
+
__reExport(deprecated_exports, require("./ReadOnlyPill.js"), module.exports);
|
|
39
|
+
__reExport(deprecated_exports, require("./OverflowPill.js"), module.exports);
|
|
40
|
+
var import_Pill = __toESM(require("./Pill.js"));
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/deprecated/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './Pill';\nexport * from './PillGroup';\nexport * from './LabeledDropdownPills';\nexport * from './LabeledPills';\nexport * from './DropdownPill';\nexport * from './RemovablePill';\nexport * from './ReadOnlyPill';\nexport * from './OverflowPill';\n\nexport { default } from './Pill';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,
|
|
4
|
+
"sourcesContent": ["export * from './Pill.js';\nexport * from './PillGroup.js';\nexport * from './LabeledDropdownPills.js';\nexport * from './LabeledPills.js';\nexport * from './DropdownPill.js';\nexport * from './RemovablePill.js';\nexport * from './ReadOnlyPill.js';\nexport * from './OverflowPill.js';\n\nexport { default } from './Pill.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,sBAAd;AACA,+BAAc,2BADd;AAEA,+BAAc,sCAFd;AAGA,+BAAc,8BAHd;AAIA,+BAAc,8BAJd;AAKA,+BAAc,+BALd;AAMA,+BAAc,8BANd;AAOA,+BAAc,8BAPd;AASA,kBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(src_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(src_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
__reExport(src_exports, require("./deprecated"), module.exports);
|
|
33
|
-
__reExport(src_exports, require("./components"), module.exports);
|
|
34
|
-
var import_deprecated = __toESM(require("./deprecated"));
|
|
32
|
+
__reExport(src_exports, require("./deprecated/index.js"), module.exports);
|
|
33
|
+
__reExport(src_exports, require("./components/index.js"), module.exports);
|
|
34
|
+
var import_deprecated = __toESM(require("./deprecated/index.js"));
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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;AAAA;ACAA,YAAuB;ADAvB,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from './deprecated/index.js';\nexport * from './components/index.js';\nexport { default } from './deprecated/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,kCAAd;AACA,wBAAc,kCADd;AAEA,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/props.js
CHANGED
|
@@ -33,38 +33,38 @@ __export(props_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(props_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
37
|
var import_ds_form = require("@elliemae/ds-form");
|
|
38
|
-
const pillTypes =
|
|
38
|
+
const pillTypes = import_ds_props_helpers.PropTypes.oneOf(["label", "value", "input", "dropdown", "removable", "readonly"]);
|
|
39
39
|
const DSPillV2PropTypes = {
|
|
40
|
-
label:
|
|
40
|
+
label: import_ds_props_helpers.PropTypes.string.description("Label to show in the pill").isRequired,
|
|
41
41
|
type: pillTypes.description("The type of pill that you want to render").isRequired,
|
|
42
|
-
innerRef:
|
|
43
|
-
size:
|
|
44
|
-
ariaLabel:
|
|
45
|
-
labelTruncated:
|
|
46
|
-
tooltipValue:
|
|
47
|
-
iconLeft:
|
|
48
|
-
iconRight:
|
|
49
|
-
onRemove:
|
|
50
|
-
inputPlaceholder:
|
|
51
|
-
onInputChange:
|
|
52
|
-
onInputClear:
|
|
53
|
-
inputWidth:
|
|
54
|
-
inputId:
|
|
55
|
-
dropdownProps:
|
|
56
|
-
onDropdownClick:
|
|
57
|
-
disabled:
|
|
58
|
-
hasError:
|
|
42
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.func]).description("Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)").defaultValue(() => null),
|
|
43
|
+
size: import_ds_props_helpers.PropTypes.oneOf(["s", "m"]).description("Vertical pill size").defaultValue("m"),
|
|
44
|
+
ariaLabel: import_ds_props_helpers.PropTypes.string.description("Aria label for the pill. If not provided we will use the label").defaultValue(""),
|
|
45
|
+
labelTruncated: import_ds_props_helpers.PropTypes.bool.description("Whether to truncate the pills label").defaultValue(true),
|
|
46
|
+
tooltipValue: import_ds_props_helpers.PropTypes.string.description("String to show as a tooltip in the value pill").defaultValue(""),
|
|
47
|
+
iconLeft: import_ds_props_helpers.PropTypes.node.description("A component to show int the left of a readonly pill").defaultValue(null),
|
|
48
|
+
iconRight: import_ds_props_helpers.PropTypes.node.description("A component to show in the right of a readonly pill").defaultValue(null),
|
|
49
|
+
onRemove: import_ds_props_helpers.PropTypes.func.description("Callback triggered when removing a pill with the close icon").defaultValue(() => null),
|
|
50
|
+
inputPlaceholder: import_ds_props_helpers.PropTypes.string.description("Placeholder for the input pill").defaultValue(""),
|
|
51
|
+
onInputChange: import_ds_props_helpers.PropTypes.func.description("Callback triggered when user provides input to the input pill").defaultValue(() => null),
|
|
52
|
+
onInputClear: import_ds_props_helpers.PropTypes.func.description("Callback triggered when the user clears an input pill").defaultValue(() => null),
|
|
53
|
+
inputWidth: import_ds_props_helpers.PropTypes.number.description("Width in pixels for the input tag in the input pill").defaultValue(150),
|
|
54
|
+
inputId: import_ds_props_helpers.PropTypes.string.description("ID for the input pill").defaultValue(void 0),
|
|
55
|
+
dropdownProps: import_ds_props_helpers.PropTypes.object.description("Properties that will be used for the dropdown-menu").defaultValue({}),
|
|
56
|
+
onDropdownClick: import_ds_props_helpers.PropTypes.func.description("Callback when dropdown button is clicked or pressed").defaultValue(() => null),
|
|
57
|
+
disabled: import_ds_props_helpers.PropTypes.bool.description("Whether the pill should be disabled. Only for value and removable pill").defaultValue(false),
|
|
58
|
+
hasError: import_ds_props_helpers.PropTypes.bool.description("Whether the pill should be in an error state. Only for input pill").defaultValue(false)
|
|
59
59
|
};
|
|
60
60
|
const DSPillButtonPropTypes = {
|
|
61
|
-
type:
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
61
|
+
type: import_ds_props_helpers.PropTypes.oneOf(["only", "left", "right"]).description("The position in which this button will be placed. Only used for css styling internally").defaultValue("right"),
|
|
62
|
+
width: import_ds_props_helpers.PropTypes.string.description("Width of the button").defaultValue("100%"),
|
|
63
|
+
height: import_ds_props_helpers.PropTypes.string.description("Height of the button").defaultValue("100%")
|
|
64
64
|
};
|
|
65
65
|
const DSPillGroupPropTypes = {
|
|
66
|
-
width:
|
|
67
|
-
innerRef:
|
|
66
|
+
width: import_ds_props_helpers.PropTypes.string.description("Width of the group").defaultValue("fit-content"),
|
|
67
|
+
innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.func]).description("Reference to the pill group wrapper").defaultValue(() => null)
|
|
68
68
|
};
|
|
69
69
|
const DSPillV2DefaultProps = {
|
|
70
70
|
innerRef: () => null,
|
package/dist/cjs/props.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { PropTypes } from '@elliemae/ds-props-helpers';\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 inputId: PropTypes.string.description('ID for the input pill').defaultValue(undefined),\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 disabled: PropTypes.bool\n .description('Whether the pill should be disabled. Only for value and removable pill')\n .defaultValue(false),\n hasError: PropTypes.bool\n .description('Whether the pill should be in an error state. Only for input pill')\n .defaultValue(false),\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 disabled: false,\n hasError: false,\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 tabIndex: 0,\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;AAAA;ACAA,YAAuB;ADEvB,8BAA0B;AAC1B,qBAAwB;AAExB,MAAM,YAAY,kCAAU,MAAM,CAAC,SAAS,SAAS,SAAS,YAAY,aAAa,UAAU,CAAC;AAE3F,MAAM,oBAAoB;AAAA,EAC/B,OAAO,kCAAU,OAAO,YAAY,2BAA2B,EAAE;AAAA,EACjE,MAAM,UAAU,YAAY,0CAA0C,EAAE;AAAA,EACxE,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAC7D,YAAY,kGAAkG,EAC9G,aAAa,MAAM,IAAI;AAAA,EAC1B,MAAM,kCAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,oBAAoB,EAAE,aAAa,GAAG;AAAA,EACpF,WAAW,kCAAU,OAClB,YAAY,gEAAgE,EAC5E,aAAa,EAAE;AAAA,EAClB,gBAAgB,kCAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,IAAI;AAAA,EACnG,cAAc,kCAAU,OAAO,YAAY,+CAA+C,EAAE,aAAa,EAAE;AAAA,EAC3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Y,qCAAqC,EACjD,aAAa,MAAM,IAAI;AAC5B;AAEO,MAAM,uBAAuB;AAAA,EAClC,UAAU,MAAM;AAAA,EAChB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,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,CAAC;AAAA,EAChB,iBAAiB,MAAM;AAAA,EACvB,UAAU;AACZ;AAEO,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;AAEO,MAAM,0BAA0B;AAAA,EACrC,OAAO;AAAA,EACP,UAAU,MAAM;AAClB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-
|
|
4
|
-
import { DSPillV2DefaultProps, DSPillV2PropTypes } from "../props";
|
|
5
|
-
import { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from "./types";
|
|
6
|
-
import { DSPillName } from "../DSPillDefinitions";
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { DSPillV2DefaultProps, DSPillV2PropTypes } from "../props.js";
|
|
5
|
+
import { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from "./types/index.js";
|
|
6
|
+
import { DSPillName } from "../DSPillDefinitions.js";
|
|
7
7
|
const pillComponentGetter = {
|
|
8
8
|
dropdown: DropdownPill,
|
|
9
9
|
input: InputPill,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSPillProps } from '../index.d';\nimport { DSPillV2DefaultProps, DSPillV2PropTypes } from '../props.js';\nimport { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from './types/index.js';\nimport { DSPillName } from '../DSPillDefinitions.js';\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, DSPillName);\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.propTypes = DSPillV2PropTypes;\nDSPillV2.displayName = DSPillName;\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACuBd;AArBT,SAAS,UAAU,8BAA8B,sCAAsC;AAEvF,SAAS,sBAAsB,yBAAyB;AACxD,SAAS,cAAc,WAAW,WAAW,WAAW,cAAc,qBAAqB;AAC3F,SAAS,kBAAkB;AAE3B,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,6BAA6B,OAAO,oBAAoB;AAClF,iCAA+B,mBAAmB,mBAAmB,UAAU;AAC/E,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,gBAAgB,oBAAoB;AAE1C,SAAO,oBAAC,iBAAe,GAAG,mBAAmB;AAC/C;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ,EAAE,YAAY,MAAM;AAChE,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-
|
|
4
|
-
import { StyledPillButton } from "./styled";
|
|
5
|
-
import { DSPillButtonDefaultProps, DSPillButtonPropTypes } from "../props";
|
|
6
|
-
import { DSPillButtonName } from "../DSPillDefinitions";
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { StyledPillButton } from "./styled.js";
|
|
5
|
+
import { DSPillButtonDefaultProps, DSPillButtonPropTypes } from "../props.js";
|
|
6
|
+
import { DSPillButtonName } from "../DSPillDefinitions.js";
|
|
7
7
|
const typeToClassName = {
|
|
8
8
|
only: "ds-pill-button-only",
|
|
9
9
|
left: "ds-pill-button-left",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 type { DSButtonPropsT } from '@elliemae/ds-button';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport type { DSButtonPropsT } from '@elliemae/ds-button';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { StyledPillButton } from './styled.js';\nimport { DSPillButtonDefaultProps, DSPillButtonPropTypes } from '../props.js';\nimport { DSPillButtonName } from '../DSPillDefinitions.js';\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, DSPillButtonName);\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 = DSPillButtonName;\nconst DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');\nDSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;\n\nexport { DSPillButton, DSPillButtonWithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACqBnB;AAlBJ,SAAS,UAAU,8BAA8B,sCAAsC;AACvF,SAAS,wBAAwB;AACjC,SAAS,0BAA0B,6BAA6B;AAChE,SAAS,wBAAwB;AAEjC,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,eAAoD,CAAC,UAAU;AACnE,QAAM,oBAAoB,6BAA6B,OAAO,wBAAwB;AACtF,iCAA+B,mBAAmB,uBAAuB,gBAAgB;AAEzF,QAAM,EAAE,MAAM,aAAa,KAAK,IAAI;AAEpC,SACE,oBAAC,oBAAkB,GAAG,MAAM,YAAW,OAAM,WAAW,GAAG,gBAAgB,SAAS,KAAK,aACtF,UACH;AAEJ;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY,EAAE,YAAY,aAAa;AAC/E,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
useMemoMergePropsWithDefault,
|
|
8
8
|
useValidateTypescriptPropTypes,
|
|
9
9
|
useGetGlobalAttributes
|
|
10
|
-
} from "@elliemae/ds-
|
|
11
|
-
import { DSPillGroupDefaultProps, DSPillGroupPropTypes } from "../props";
|
|
12
|
-
import { StyledPillGroup } from "./styled";
|
|
13
|
-
import { DSPillGroupName } from "../DSPillDefinitions";
|
|
10
|
+
} from "@elliemae/ds-props-helpers";
|
|
11
|
+
import { DSPillGroupDefaultProps, DSPillGroupPropTypes } from "../props.js";
|
|
12
|
+
import { StyledPillGroup } from "./styled.js";
|
|
13
|
+
import { DSPillGroupName } from "../DSPillDefinitions.js";
|
|
14
14
|
const DSPillGroupV2Context = createContext({
|
|
15
15
|
onKeyboardRemove: () => null,
|
|
16
16
|
onKeyboardNavigation: () => null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/PillGroup.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport type { WeakValidationMap } from 'react';\nimport React, { createContext, useCallback, useMemo } from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable react/prop-types */\nimport type { WeakValidationMap } from 'react';\nimport React, { createContext, useCallback, useMemo } from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport type { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props.js';\nimport { StyledPillGroup } from './styled.js';\nimport { DSPillGroupName } from '../DSPillDefinitions.js';\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, DSPillGroupName);\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 = DSPillGroupName;\nconst DSPillGroupV2WithSchema = describe(DSPillGroupV2);\nDSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\n\nexport { DSPillGroupV2, DSPillGroupV2WithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+DjB;AA5DN,OAAOA,UAAS,eAAe,aAAa,eAAe;AAC3D,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,yBAAyB,4BAA4B;AAC9D,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAEzB,MAAM,uBAAuB,cAGjC;AAAA,EACD,kBAAkB,MAAM;AAAA,EACxB,sBAAsB,MAAM;AAC9B,CAAC;AAED,MAAM,gBAAuD,CAAC,UAAU;AACtE,QAAM,oBAAoB,6BAA6B,OAAO,uBAAuB;AACrF,iCAA+B,mBAAmB,sBAAsB,eAAe;AAEvF,QAAM,cAAc,uBAAuB,iBAAiB;AAC5D,QAAM,eAAe,QAAQ,MAAM,iBAAiB,IAAI,KAAK,CAAC,CAAC;AAC/D,QAAM,EAAE,UAAU,OAAO,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/transpile/react-shim.js", "../../../src/components/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Pill';\nexport * from './PillGroup';\nexport * from './PillButton';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Pill.js';\nexport * from './PillGroup.js';\nexport * from './PillButton.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,9 +5,9 @@ import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu";
|
|
|
5
5
|
import { uid } from "uid";
|
|
6
6
|
import { ChevronSmallDown } from "@elliemae/ds-icons";
|
|
7
7
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
8
|
-
import { StyledDropdownPillWrapper } from "../styled";
|
|
9
|
-
import { setMultipleRefs } from "../../utils";
|
|
10
|
-
import { DSPillButton } from "../PillButton";
|
|
8
|
+
import { StyledDropdownPillWrapper } from "../styled.js";
|
|
9
|
+
import { setMultipleRefs } from "../../utils.js";
|
|
10
|
+
import { DSPillButton } from "../PillButton.js";
|
|
11
11
|
const DropdownPill = React2.memo(
|
|
12
12
|
({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
|
|
13
13
|
const chevronRef = useRef(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/DropdownPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef, useCallback } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';\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"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef, useCallback } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';\nimport { uid } from 'uid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledDropdownPillWrapper } from '../styled.js';\nimport type { DSPillProps } from '../../index.d';\nimport { setMultipleRefs } from '../../utils.js';\nimport { DSPillButton } from '../PillButton.js';\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"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACkBG,cAIpB,YAJoB;AAjB1B,OAAOA,UAAS,SAAS,cAA2B;AACpD,SAAS,wBAAwB;AACjC,SAAS,WAAW;AACpB,SA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AC5E;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -3,9 +3,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React2, { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { uid } from "uid";
|
|
5
5
|
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
6
|
-
import { StyledInputPillWrapper } from "../styled";
|
|
7
|
-
import { setMultipleRefs } from "../../utils";
|
|
8
|
-
import { DSPillButton } from "../PillButton";
|
|
6
|
+
import { StyledInputPillWrapper } from "../styled.js";
|
|
7
|
+
import { setMultipleRefs } from "../../utils.js";
|
|
8
|
+
import { DSPillButton } from "../PillButton.js";
|
|
9
9
|
const InputPill = React2.memo(
|
|
10
10
|
({
|
|
11
11
|
label,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/InputPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledInputPillWrapper } from '../styled';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const InputPill = React.memo<DSPillProps>(\n ({\n label,\n size,\n inputPlaceholder,\n inputWidth,\n inputRender,\n onInputChange,\n onInputClear,\n innerRef,\n hasError,\n inputId,\n }) => {\n const ref = useRef<HTMLElement>(null);\n\n const InputComponent = useMemo(() => inputRender, [inputRender]);\n\n const pillUid = useMemo(() => inputId ?? `ds-pill-${uid()}`, []);\n\n const onCloseIconClick: React.MouseEventHandler & React.KeyboardEventHandler = useCallback(\n (e) => {\n if ([undefined, 'Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n onInputClear(e);\n ref.current.focus();\n }\n },\n [onInputClear],\n );\n\n const [inputHasFocus, setInputHasFocus] = useState(false);\n\n return (\n <StyledInputPillWrapper\n size={size}\n className=\"ds-pill-wrapper\"\n data-testid=\"ds-pill-wrapper\"\n cols={label === '' ? ['auto'] : ['auto', '24px']}\n inputWidth={inputWidth}\n value={label}\n inputHasFocus={inputHasFocus}\n hasError={hasError}\n >\n <InputComponent\n id={pillUid}\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-input\"\n innerRef={setMultipleRefs(ref, innerRef)}\n value={label}\n onChange={onInputChange}\n placeholder={inputPlaceholder}\n onFocus={() => setInputHasFocus(true)}\n onBlur={() => setInputHasFocus(false)}\n disableTooltip={false}\n />\n {label !== '' && (\n <DSPillButton\n id={pillUid}\n data-testid=\"ds-pill-clear-icon\"\n innerRef={innerRef}\n onClick={onCloseIconClick}\n // onKeyDown={onCloseIconClick} // button v2 now triggers click on key down already\n aria-label=\"Clear input\"\n type=\"right\"\n >\n <CloseXsmall size=\"s\" color={['brand-primary', '700']} />\n </DSPillButton>\n )}\n </StyledInputPillWrapper>\n );\n },\n);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledInputPillWrapper } from '../styled.js';\nimport { setMultipleRefs } from '../../utils.js';\nimport { DSPillButton } from '../PillButton.js';\n\nexport const InputPill = React.memo<DSPillProps>(\n ({\n label,\n size,\n inputPlaceholder,\n inputWidth,\n inputRender,\n onInputChange,\n onInputClear,\n innerRef,\n hasError,\n inputId,\n }) => {\n const ref = useRef<HTMLElement>(null);\n\n const InputComponent = useMemo(() => inputRender, [inputRender]);\n\n const pillUid = useMemo(() => inputId ?? `ds-pill-${uid()}`, []);\n\n const onCloseIconClick: React.MouseEventHandler & React.KeyboardEventHandler = useCallback(\n (e) => {\n if ([undefined, 'Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n onInputClear(e);\n ref.current.focus();\n }\n },\n [onInputClear],\n );\n\n const [inputHasFocus, setInputHasFocus] = useState(false);\n\n return (\n <StyledInputPillWrapper\n size={size}\n className=\"ds-pill-wrapper\"\n data-testid=\"ds-pill-wrapper\"\n cols={label === '' ? ['auto'] : ['auto', '24px']}\n inputWidth={inputWidth}\n value={label}\n inputHasFocus={inputHasFocus}\n hasError={hasError}\n >\n <InputComponent\n id={pillUid}\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-input\"\n innerRef={setMultipleRefs(ref, innerRef)}\n value={label}\n onChange={onInputChange}\n placeholder={inputPlaceholder}\n onFocus={() => setInputHasFocus(true)}\n onBlur={() => setInputHasFocus(false)}\n disableTooltip={false}\n />\n {label !== '' && (\n <DSPillButton\n id={pillUid}\n data-testid=\"ds-pill-clear-icon\"\n innerRef={innerRef}\n onClick={onCloseIconClick}\n // onKeyDown={onCloseIconClick} // button v2 now triggers click on key down already\n aria-label=\"Clear input\"\n type=\"right\"\n >\n <CloseXsmall size=\"s\" color={['brand-primary', '700']} />\n </DSPillButton>\n )}\n </StyledInputPillWrapper>\n );\n },\n);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;AC0CjB,SAUE,KAVF;AAzCN,OAAOA,UAAS,aAAa,SAAS,QAAQ,gBAAgB;AAC9D,SAAS,WAAW;AACpB,SAAS,mBAAmB;AAE5B,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAEtB,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAM;AACJ,UAAM,MAAM,OAA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 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
-
import { StyledLabelPillWrapper } from "../styled";
|
|
5
|
+
import { StyledLabelPillWrapper } from "../styled.js";
|
|
6
6
|
const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {
|
|
7
7
|
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
8
8
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/LabelPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledLabelPillWrapper } from '../styled';\n\nexport const LabelPill = React.memo<DSPillProps>(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n return (\n <StyledLabelPillWrapper\n size={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-label\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n cols={[iconLeft && 'min-content', 'auto'].filter((notFalse) => notFalse)}\n gutter=\"xxxs\"\n hasIcon={iconLeft !== null}\n >\n {iconLeft}\n <TextComponent>{label}</TextComponent>\n </StyledLabelPillWrapper>\n );\n});\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledLabelPillWrapper } from '../styled.js';\n\nexport const LabelPill = React.memo<DSPillProps>(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n return (\n <StyledLabelPillWrapper\n size={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-label\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n cols={[iconLeft && 'min-content', 'auto'].filter((notFalse) => notFalse)}\n gutter=\"xxxs\"\n hasIcon={iconLeft !== null}\n >\n {iconLeft}\n <TextComponent>{label}</TextComponent>\n </StyledLabelPillWrapper>\n );\n});\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACQC,cAGpB,YAHoB;AAPxB,OAAOA,YAAW;AAClB,SAAS,kCAAkC;AAE3C,SAAS,8BAA8B;AAEhC,MAAM,YAAYA,OAAM,KAAkB,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,UAAU,MAAM;AACzG,QAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC,8BAA2B,OAAO,UAAU,IAC/DA,OAAM;AACV,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,YAAW;AAAA,MACX,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,cAAY,aAAa;AAAA,MACzB,MAAM,CAAC,YAAY,eAAe,MAAM,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,MACvE,QAAO;AAAA,MACP,SAAS,aAAa;AAAA,MAErB;AAAA;AAAA,QACD,oBAAC,iBAAe,iBAAM;AAAA;AAAA;AAAA,EACxB;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
-
import { StyledReadonlyPillWrapper } from "../styled";
|
|
5
|
+
import { StyledReadonlyPillWrapper } from "../styled.js";
|
|
6
6
|
const ReadOnlyPill = React2.memo(
|
|
7
7
|
({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {
|
|
8
8
|
const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/ReadOnlyPill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledReadonlyPillWrapper } from '../styled';\n\nexport const ReadOnlyPill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {\n const hasIconLeft = iconLeft !== null || (iconRight !== null && label === '');\n const hasIconRight = iconRight !== null || (iconLeft !== null && label === '');\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledReadonlyPillWrapper\n size={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-readonly\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n cols={[iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter((notFalse) => notFalse)}\n gutter=\"xxxs\"\n hasIconRight={hasIconRight}\n hasIconLeft={hasIconLeft}\n >\n {iconLeft}\n {label ? <TextComponent>{label}</TextComponent> : null}\n {iconRight}\n </StyledReadonlyPillWrapper>\n );\n },\n);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledReadonlyPillWrapper } from '../styled.js';\n\nexport const ReadOnlyPill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {\n const hasIconLeft = iconLeft !== null || (iconRight !== null && label === '');\n const hasIconRight = iconRight !== null || (iconLeft !== null && label === '');\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledReadonlyPillWrapper\n size={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-readonly\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n cols={[iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter((notFalse) => notFalse)}\n gutter=\"xxxs\"\n hasIconRight={hasIconRight}\n hasIconLeft={hasIconLeft}\n >\n {iconLeft}\n {label ? <TextComponent>{label}</TextComponent> : null}\n {iconRight}\n </StyledReadonlyPillWrapper>\n );\n },\n);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACaG,cAIpB,YAJoB;AAX1B,OAAOA,YAAW;AAClB,SAAS,kCAAkC;AAE3C,SAAS,iCAAiC;AAEnC,MAAM,eAAeA,OAAM;AAAA,EAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,WAAW,UAAU,MAAM;AACnE,UAAM,cAAc,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC1E,UAAM,eAAe,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE3E,UAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC,8BAA2B,OAAO,UAAU,IAC/DA,OAAM;AAEV,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,YAAW;AAAA,QACX,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,cAAY,aAAa;AAAA,QACzB,MAAM,CAAC,YAAY,eAAe,SAAS,QAAQ,aAAa,aAAa,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,QAC5G,QAAO;AAAA,QACP;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,UACA,QAAQ,oBAAC,iBAAe,iBAAM,IAAmB;AAAA,UACjD;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -4,9 +4,9 @@ import React2, { useCallback, useContext, useMemo } from "react";
|
|
|
4
4
|
import { uid } from "uid";
|
|
5
5
|
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
6
6
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
7
|
-
import { StyledRemovablePillWrapper } from "../styled";
|
|
8
|
-
import { DSPillGroupV2Context } from "../PillGroup";
|
|
9
|
-
import { DSPillButton } from "../PillButton";
|
|
7
|
+
import { StyledRemovablePillWrapper } from "../styled.js";
|
|
8
|
+
import { DSPillGroupV2Context } from "../PillGroup.js";
|
|
9
|
+
import { DSPillButton } from "../PillButton.js";
|
|
10
10
|
const RemovablePill = React2.memo(
|
|
11
11
|
({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex }) => {
|
|
12
12
|
const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/RemovablePill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledRemovablePillWrapper } from '../styled';\nimport { DSPillGroupV2Context } from '../PillGroup';\nimport { DSPillButton } from '../PillButton';\n\nexport const RemovablePill = React.memo<DSPillProps>(\n ({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex }) => {\n const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n if (onKeyboardRemove) onKeyboardRemove(pillUid);\n }\n if (e.code === 'ArrowLeft') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);\n }\n if (e.code === 'ArrowRight') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);\n }\n },\n [onKeyboardRemove, onRemove, onKeyboardNavigation, pillUid],\n );\n\n return (\n <StyledRemovablePillWrapper\n size={size}\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-removable\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n >\n <TextComponent>{label}</TextComponent>\n <>\n {!disabled ? (\n <DSPillButton\n className=\"ds-pill-focus-point\"\n id={pillUid}\n data-testid=\"ds-pill-close-icon\"\n innerRef={innerRef}\n onClick={onRemove}\n onKeyDown={onKeyDown}\n aria-label={`Remove ${label}`}\n type=\"right\"\n tabIndex={tabIndex}\n >\n <CloseXsmall\n width={size === 's' ? 18 : 22.65}\n height={size === 's' ? 18 : 22.65}\n color={['brand-primary', '700']}\n />\n </DSPillButton>\n ) : null}\n </>\n </StyledRemovablePillWrapper>\n );\n },\n);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { uid } from 'uid';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledRemovablePillWrapper } from '../styled.js';\nimport { DSPillGroupV2Context } from '../PillGroup.js';\nimport { DSPillButton } from '../PillButton.js';\n\nexport const RemovablePill = React.memo<DSPillProps>(\n ({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex }) => {\n const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n if (onKeyboardRemove) onKeyboardRemove(pillUid);\n }\n if (e.code === 'ArrowLeft') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, -1, e);\n }\n if (e.code === 'ArrowRight') {\n e.preventDefault();\n if (onKeyboardNavigation) onKeyboardNavigation(pillUid, 1, e);\n }\n },\n [onKeyboardRemove, onRemove, onKeyboardNavigation, pillUid],\n );\n\n return (\n <StyledRemovablePillWrapper\n size={size}\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-removable\"\n data-testid=\"ds-pill-wrapper\"\n aria-label={ariaLabel || label}\n >\n <TextComponent>{label}</TextComponent>\n <>\n {!disabled ? (\n <DSPillButton\n className=\"ds-pill-focus-point\"\n id={pillUid}\n data-testid=\"ds-pill-close-icon\"\n innerRef={innerRef}\n onClick={onRemove}\n onKeyDown={onKeyDown}\n aria-label={`Remove ${label}`}\n type=\"right\"\n tabIndex={tabIndex}\n >\n <CloseXsmall\n width={size === 's' ? 18 : 22.65}\n height={size === 's' ? 18 : 22.65}\n color={['brand-primary', '700']}\n />\n </DSPillButton>\n ) : null}\n </>\n </StyledRemovablePillWrapper>\n );\n },\n);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACgBG,SAiClB,UAjCkB,KAsBpB,YAtBoB;AAf1B,OAAOA,UAAS,aAAa,YAAY,eAAe;AACxD,SAAS,WAAW;AACpB,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAE3C,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAEtB,MAAM,gBAAgBA,OAAM;AAAA,EACjC,CAAC,EAAE,OAAO,MAAM,UAAU,gBAAgB,UAAU,UAAU,WAAW,SAAS,MAAM;AACtF,UAAM,EAAE,kBAAkB,qBAAqB,IAAI,WAAW,oBAAoB;AAClF,UAAM,UAAU,QAAQ,MAAM,WAAW,IAAI,KAAK,CAAC,CAAC;AAEpD,UAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC,8BAA2B,OAAO,UAAU,IAC/DA,OAAM;AAEV,UAAM,YAAY;AAAA,MAChB,CAAC,MAAqB;AACpB,YAAI,CAAC,SAAS,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG;AACvC,YAAE,eAAe;AACjB,cAAI;AAAkB,6BAAiB,OAAO;AAAA,QAChD;AACA,YAAI,EAAE,SAAS,aAAa;AAC1B,YAAE,eAAe;AACjB,cAAI;AAAsB,iCAAqB,SAAS,IAAI,CAAC;AAAA,QAC/D;AACA,YAAI,EAAE,SAAS,cAAc;AAC3B,YAAE,eAAe;AACjB,cAAI;AAAsB,iCAAqB,SAAS,GAAG,CAAC;AAAA,QAC9D;AAAA,MACF;AAAA,MACA,CAAC,kBAAkB,UAAU,sBAAsB,OAAO;AAAA,IAC5D;AAE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