@elliemae/ds-pills 2.3.1 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Pill.js +72 -0
- package/dist/cjs/components/Pill.js.map +7 -0
- package/dist/cjs/components/PillButton.js +86 -0
- package/dist/cjs/components/PillButton.js.map +7 -0
- package/dist/cjs/components/PillGroup.js +100 -0
- package/dist/cjs/components/PillGroup.js.map +7 -0
- package/dist/cjs/components/index.js +30 -0
- package/dist/cjs/components/index.js.map +7 -0
- package/dist/cjs/components/styled.js +235 -0
- package/dist/cjs/components/styled.js.map +7 -0
- package/dist/cjs/components/types/DropdownPill.js +105 -0
- package/dist/cjs/components/types/DropdownPill.js.map +7 -0
- package/dist/cjs/components/types/InputPill.js +84 -0
- package/dist/cjs/components/types/InputPill.js.map +7 -0
- package/dist/cjs/components/types/LabelPill.js +52 -0
- package/dist/cjs/components/types/LabelPill.js.map +7 -0
- package/dist/cjs/components/types/ReadOnlyPill.js +55 -0
- package/dist/cjs/components/types/ReadOnlyPill.js.map +7 -0
- package/dist/cjs/components/types/RemovablePill.js +90 -0
- package/dist/cjs/components/types/RemovablePill.js.map +7 -0
- package/dist/cjs/components/types/ValuePill.js +59 -0
- package/dist/cjs/components/types/ValuePill.js.map +7 -0
- package/dist/cjs/components/types/index.js +33 -0
- package/dist/cjs/components/types/index.js.map +7 -0
- package/dist/cjs/deprecated/DropdownPill.js +128 -0
- package/dist/cjs/deprecated/DropdownPill.js.map +7 -0
- package/dist/cjs/deprecated/InputPill.js +114 -0
- package/dist/cjs/deprecated/InputPill.js.map +7 -0
- package/dist/cjs/deprecated/LabeledDropdownPills.js +140 -0
- package/dist/cjs/deprecated/LabeledDropdownPills.js.map +7 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +169 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +181 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +190 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +44 -0
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
- package/dist/cjs/deprecated/LabeledPills.js +75 -0
- package/dist/cjs/deprecated/LabeledPills.js.map +7 -0
- package/dist/cjs/deprecated/OverflowPill.js +79 -0
- package/dist/cjs/deprecated/OverflowPill.js.map +7 -0
- package/dist/cjs/deprecated/Pill.js +107 -0
- package/dist/cjs/deprecated/Pill.js.map +7 -0
- package/dist/cjs/deprecated/PillGroup.js +84 -0
- package/dist/cjs/deprecated/PillGroup.js.map +7 -0
- package/dist/cjs/deprecated/ReadOnlyPill.js +100 -0
- package/dist/cjs/deprecated/ReadOnlyPill.js.map +7 -0
- package/dist/cjs/deprecated/RemovablePill.js +78 -0
- package/dist/cjs/deprecated/RemovablePill.js.map +7 -0
- package/dist/cjs/deprecated/index.js +43 -0
- package/dist/cjs/deprecated/index.js.map +7 -0
- package/dist/cjs/index.d.js +27 -0
- package/dist/cjs/index.d.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/props.js +96 -0
- package/dist/cjs/props.js.map +7 -0
- package/dist/cjs/utils.js +46 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/esm/components/Pill.js +45 -0
- package/dist/esm/components/Pill.js.map +7 -0
- package/dist/esm/components/PillButton.js +59 -0
- package/dist/esm/components/PillButton.js.map +7 -0
- package/dist/esm/components/PillGroup.js +78 -0
- package/dist/esm/components/PillGroup.js.map +7 -0
- package/dist/esm/components/index.js +5 -0
- package/dist/esm/components/index.js.map +7 -0
- package/dist/esm/components/styled.js +206 -0
- package/dist/esm/components/styled.js.map +7 -0
- package/dist/esm/components/types/DropdownPill.js +78 -0
- package/dist/esm/components/types/DropdownPill.js.map +7 -0
- package/dist/esm/components/types/InputPill.js +55 -0
- package/dist/esm/components/types/InputPill.js.map +7 -0
- package/dist/esm/components/types/LabelPill.js +23 -0
- package/dist/esm/components/types/LabelPill.js.map +7 -0
- package/dist/esm/components/types/ReadOnlyPill.js +26 -0
- package/dist/esm/components/types/ReadOnlyPill.js.map +7 -0
- package/dist/esm/components/types/RemovablePill.js +61 -0
- package/dist/esm/components/types/RemovablePill.js.map +7 -0
- package/dist/esm/components/types/ValuePill.js +30 -0
- package/dist/esm/components/types/ValuePill.js.map +7 -0
- package/dist/esm/components/types/index.js +8 -0
- package/dist/esm/components/types/index.js.map +7 -0
- package/dist/esm/deprecated/DropdownPill.js +101 -0
- package/dist/esm/deprecated/DropdownPill.js.map +7 -0
- package/dist/esm/deprecated/InputPill.js +87 -0
- package/dist/esm/deprecated/InputPill.js.map +7 -0
- package/dist/esm/deprecated/LabeledDropdownPills.js +113 -0
- package/dist/esm/deprecated/LabeledDropdownPills.js.map +7 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +142 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +154 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +163 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/utils.js +15 -0
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
- package/dist/esm/deprecated/LabeledPills.js +46 -0
- package/dist/esm/deprecated/LabeledPills.js.map +7 -0
- package/dist/esm/deprecated/OverflowPill.js +50 -0
- package/dist/esm/deprecated/OverflowPill.js.map +7 -0
- package/dist/esm/deprecated/Pill.js +80 -0
- package/dist/esm/deprecated/Pill.js.map +7 -0
- package/dist/esm/deprecated/PillGroup.js +57 -0
- package/dist/esm/deprecated/PillGroup.js.map +7 -0
- package/dist/esm/deprecated/ReadOnlyPill.js +71 -0
- package/dist/esm/deprecated/ReadOnlyPill.js.map +7 -0
- package/dist/esm/deprecated/RemovablePill.js +49 -0
- package/dist/esm/deprecated/RemovablePill.js.map +7 -0
- package/dist/esm/deprecated/index.js +14 -0
- package/dist/esm/deprecated/index.js.map +7 -0
- package/dist/esm/index.d.js +2 -0
- package/dist/esm/index.d.js.map +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/props.js +67 -0
- package/dist/esm/props.js.map +7 -0
- package/dist/esm/utils.js +17 -0
- package/dist/esm/utils.js.map +7 -0
- package/package.json +94 -85
- package/cjs/components/Pill.js +0 -53
- package/cjs/components/PillButton.js +0 -56
- package/cjs/components/PillGroup.js +0 -87
- package/cjs/components/index.js +0 -17
- package/cjs/components/styled.js +0 -85
- package/cjs/components/types/DropdownPill.js +0 -86
- package/cjs/components/types/InputPill.js +0 -74
- package/cjs/components/types/LabelPill.js +0 -46
- package/cjs/components/types/ReadOnlyPill.js +0 -50
- package/cjs/components/types/RemovablePill.js +0 -85
- package/cjs/components/types/ValuePill.js +0 -54
- package/cjs/components/types/index.js +0 -19
- package/cjs/deprecated/DropdownPill.js +0 -113
- package/cjs/deprecated/InputPill.js +0 -84
- package/cjs/deprecated/LabeledDropdownPills.js +0 -106
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +0 -134
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +0 -153
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +0 -162
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +0 -20
- package/cjs/deprecated/LabeledPills.js +0 -62
- package/cjs/deprecated/OverflowPill.js +0 -73
- package/cjs/deprecated/Pill.js +0 -88
- package/cjs/deprecated/PillGroup.js +0 -72
- package/cjs/deprecated/ReadOnlyPill.js +0 -101
- package/cjs/deprecated/RemovablePill.js +0 -74
- package/cjs/deprecated/index.js +0 -33
- package/cjs/index.d.js +0 -2
- package/cjs/index.js +0 -43
- package/cjs/props.js +0 -70
- package/cjs/utils.js +0 -28
- package/esm/components/Pill.js +0 -44
- package/esm/components/PillButton.js +0 -46
- package/esm/components/PillGroup.js +0 -75
- package/esm/components/index.js +0 -3
- package/esm/components/styled.js +0 -67
- package/esm/components/types/DropdownPill.js +0 -76
- package/esm/components/types/InputPill.js +0 -65
- package/esm/components/types/LabelPill.js +0 -37
- package/esm/components/types/ReadOnlyPill.js +0 -41
- package/esm/components/types/RemovablePill.js +0 -76
- package/esm/components/types/ValuePill.js +0 -45
- package/esm/components/types/index.js +0 -6
- package/esm/deprecated/DropdownPill.js +0 -100
- package/esm/deprecated/InputPill.js +0 -74
- package/esm/deprecated/LabeledDropdownPills.js +0 -95
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +0 -126
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +0 -145
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +0 -154
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +0 -16
- package/esm/deprecated/LabeledPills.js +0 -53
- package/esm/deprecated/OverflowPill.js +0 -62
- package/esm/deprecated/Pill.js +0 -76
- package/esm/deprecated/PillGroup.js +0 -60
- package/esm/deprecated/ReadOnlyPill.js +0 -90
- package/esm/deprecated/RemovablePill.js +0 -64
- package/esm/deprecated/index.js +0 -8
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -11
- package/esm/props.js +0 -61
- package/esm/utils.js +0 -24
- package/types/components/Pill.d.ts +0 -5
- package/types/components/PillButton.d.ts +0 -5
- package/types/components/PillGroup.d.ts +0 -9
- package/types/components/index.d.ts +0 -3
- package/types/components/styled.d.ts +0 -20
- package/types/components/types/DropdownPill.d.ts +0 -3
- package/types/components/types/InputPill.d.ts +0 -3
- package/types/components/types/LabelPill.d.ts +0 -3
- package/types/components/types/ReadOnlyPill.d.ts +0 -3
- package/types/components/types/RemovablePill.d.ts +0 -3
- package/types/components/types/ValuePill.d.ts +0 -3
- package/types/components/types/index.d.ts +0 -6
- package/types/deprecated/DropdownPill.d.ts +0 -66
- package/types/deprecated/InputPill.d.ts +0 -10
- package/types/deprecated/LabeledDropdownPills.d.ts +0 -82
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +0 -15
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +0 -13
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -28
- package/types/deprecated/LabeledDropdownPillsTypes/utils.d.ts +0 -1
- package/types/deprecated/LabeledPills.d.ts +0 -52
- package/types/deprecated/OverflowPill.d.ts +0 -33
- package/types/deprecated/Pill.d.ts +0 -59
- package/types/deprecated/PillGroup.d.ts +0 -50
- package/types/deprecated/ReadOnlyPill.d.ts +0 -56
- package/types/deprecated/RemovablePill.d.ts +0 -49
- package/types/deprecated/index.d.ts +0 -9
- package/types/index.d.ts +0 -3
- package/types/props.d.ts +0 -93
- package/types/tests/DSPill.test.d.ts +0 -1
- package/types/tests/DSPillGroup.test.d.ts +0 -1
- package/types/tests/events/DSPill.events.keyboard.test.d.ts +0 -1
- package/types/tests/events/DSPill.events.test.d.ts +0 -1
- package/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +0 -1
- package/types/tests/events/DSPillGroup.events.test.d.ts +0 -1
- package/types/utils.d.ts +0 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import React2, { useMemo, useRef } from "react";
|
|
22
|
+
import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu";
|
|
23
|
+
import { uid } from "uid";
|
|
24
|
+
import { ChevronSmallDown } from "@elliemae/ds-icons";
|
|
25
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
26
|
+
import { StyledDropdownPillWrapper } from "../styled";
|
|
27
|
+
import { setMultipleRefs } from "../../utils";
|
|
28
|
+
import { DSPillButton } from "../PillButton";
|
|
29
|
+
const DropdownPill = React2.memo(({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
|
|
30
|
+
const chevronRef = useRef(null);
|
|
31
|
+
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
32
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
33
|
+
value: children
|
|
34
|
+
}) : React2.Fragment;
|
|
35
|
+
return /* @__PURE__ */ React2.createElement(StyledDropdownPillWrapper, {
|
|
36
|
+
size,
|
|
37
|
+
id: pillUid,
|
|
38
|
+
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
39
|
+
"data-testid": "ds-pill-wrapper",
|
|
40
|
+
cols: ["auto", "24px"],
|
|
41
|
+
gutter: "2px",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyItems: "center"
|
|
44
|
+
}, /* @__PURE__ */ React2.createElement(TextComponent, null, label), /* @__PURE__ */ React2.createElement(DSDropdownMenuV2, __spreadProps(__spreadValues({
|
|
45
|
+
placementOrderPreference: [
|
|
46
|
+
"bottom-start",
|
|
47
|
+
"bottom",
|
|
48
|
+
"bottom-end",
|
|
49
|
+
"right-end",
|
|
50
|
+
"top-start",
|
|
51
|
+
"top",
|
|
52
|
+
"top-end"
|
|
53
|
+
]
|
|
54
|
+
}, dropdownProps), {
|
|
55
|
+
onClickOutside: (e) => {
|
|
56
|
+
if (e.code === "Escape")
|
|
57
|
+
chevronRef.current.focus();
|
|
58
|
+
if (dropdownProps.onClickOutside)
|
|
59
|
+
dropdownProps.onClickOutside(e);
|
|
60
|
+
},
|
|
61
|
+
wrapperStyles: { w: "100%", h: "100%" }
|
|
62
|
+
}), /* @__PURE__ */ React2.createElement(DSPillButton, {
|
|
63
|
+
className: "ds-pill-focus-point",
|
|
64
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
65
|
+
innerRef: setMultipleRefs(chevronRef, innerRef),
|
|
66
|
+
"aria-label": ariaLabel || label,
|
|
67
|
+
type: "right",
|
|
68
|
+
onClick: onDropdownClick
|
|
69
|
+
}, /* @__PURE__ */ React2.createElement(ChevronSmallDown, {
|
|
70
|
+
color: ["brand-primary", "800"],
|
|
71
|
+
width: 20,
|
|
72
|
+
height: 20
|
|
73
|
+
}))));
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
DropdownPill
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=DropdownPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 } 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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEO,MAAM,eAAe,OAAM,KAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,eAAe,UAAU,WAAW,sBAAsB;AACxF,QAAM,aAAa,OAAO;AAE1B,QAAM,UAAU,QAAQ,MAAM,WAAW,SAAS;AAElD,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AAEV,SACE,qCAAC,2BAAD;AAAA,IACE;AAAA,IACA,IAAI;AAAA,IACJ,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,MAAM,CAAC,QAAQ;AAAA,IACf,QAAO;AAAA,IACP,YAAW;AAAA,IACX,cAAa;AAAA,KAEb,qCAAC,eAAD,MAAgB,QAChB,qCAAC,kBAAD;AAAA,IACE,0BAA0B;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,KAEE,gBAVN;AAAA,IAWE,gBAAgB,CAAC,MAAM;AACrB,UAAI,EAAE,SAAS;AAAU,mBAAW,QAAQ;AAC5C,UAAI,cAAc;AAAgB,sBAAc,eAAe;AAAA;AAAA,IAEjE,eAAe,EAAE,GAAG,QAAQ,GAAG;AAAA,MAE/B,qCAAC,cAAD;AAAA,IACE,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,UAAU,gBAAgB,YAAY;AAAA,IACtC,cAAY,aAAa;AAAA,IACzB,MAAK;AAAA,IACL,SAAS;AAAA,KAET,qCAAC,kBAAD;AAAA,IAAkB,OAAO,CAAC,iBAAiB;AAAA,IAAQ,OAAO;AAAA,IAAI,QAAQ;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
5
|
+
import { StyledInputPillWrapper } from "../styled";
|
|
6
|
+
import { setMultipleRefs } from "../../utils";
|
|
7
|
+
import { DSPillButton } from "../PillButton";
|
|
8
|
+
const InputPill = React2.memo(({ label, size, inputPlaceholder, inputWidth, inputRender, onInputChange, onInputClear, innerRef }) => {
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
const InputComponent = useMemo(() => inputRender, [inputRender]);
|
|
11
|
+
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
12
|
+
const onCloseIconClick = useCallback((e) => {
|
|
13
|
+
if ([void 0, "Enter", "Space"].includes(e.code)) {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
onInputClear(e);
|
|
16
|
+
ref.current.focus();
|
|
17
|
+
}
|
|
18
|
+
}, [onInputClear]);
|
|
19
|
+
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
20
|
+
return /* @__PURE__ */ React2.createElement(StyledInputPillWrapper, {
|
|
21
|
+
size,
|
|
22
|
+
className: "ds-pill-wrapper",
|
|
23
|
+
"data-testid": "ds-pill-wrapper",
|
|
24
|
+
cols: label === "" ? ["auto"] : ["auto", "24px"],
|
|
25
|
+
inputWidth,
|
|
26
|
+
value: label,
|
|
27
|
+
inputHasFocus
|
|
28
|
+
}, /* @__PURE__ */ React2.createElement(InputComponent, {
|
|
29
|
+
id: pillUid,
|
|
30
|
+
className: "ds-pill-focus-point",
|
|
31
|
+
"data-testid": "ds-pill-input",
|
|
32
|
+
innerRef: setMultipleRefs(ref, innerRef),
|
|
33
|
+
value: label,
|
|
34
|
+
onChange: onInputChange,
|
|
35
|
+
placeholder: inputPlaceholder,
|
|
36
|
+
onFocus: () => setInputHasFocus(true),
|
|
37
|
+
onBlur: () => setInputHasFocus(false),
|
|
38
|
+
disableTooltip: false
|
|
39
|
+
}), label !== "" && /* @__PURE__ */ React2.createElement(DSPillButton, {
|
|
40
|
+
id: pillUid,
|
|
41
|
+
"data-testid": "ds-pill-clear-icon",
|
|
42
|
+
innerRef,
|
|
43
|
+
onClick: onCloseIconClick,
|
|
44
|
+
onKeyDown: onCloseIconClick,
|
|
45
|
+
"aria-label": "Clear input",
|
|
46
|
+
type: "right"
|
|
47
|
+
}, /* @__PURE__ */ React2.createElement(CloseXsmall, {
|
|
48
|
+
size: "s",
|
|
49
|
+
color: ["brand-primary", "700"]
|
|
50
|
+
})));
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
InputPill
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=InputPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 ({ label, size, inputPlaceholder, inputWidth, inputRender, onInputChange, onInputClear, innerRef }) => {\n const ref = useRef<HTMLElement>(null);\n\n const InputComponent = useMemo(() => inputRender, [inputRender]);\n\n const pillUid = useMemo(() => `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 >\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}\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
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA;AACA;AACA;AAEO,MAAM,YAAY,OAAM,KAC7B,CAAC,EAAE,OAAO,MAAM,kBAAkB,YAAY,aAAa,eAAe,cAAc,eAAe;AACrG,QAAM,MAAM,OAAoB;AAEhC,QAAM,iBAAiB,QAAQ,MAAM,aAAa,CAAC;AAEnD,QAAM,UAAU,QAAQ,MAAM,WAAW,SAAS;AAElD,QAAM,mBAAyE,YAC7E,CAAC,MAAM;AACL,QAAI,CAAC,QAAW,SAAS,SAAS,SAAS,EAAE,OAAO;AAClD,QAAE;AACF,mBAAa;AACb,UAAI,QAAQ;AAAA;AAAA,KAGhB,CAAC;AAGH,QAAM,CAAC,eAAe,oBAAoB,SAAS;AAEnD,SACE,qCAAC,wBAAD;AAAA,IACE;AAAA,IACA,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,MAAM,UAAU,KAAK,CAAC,UAAU,CAAC,QAAQ;AAAA,IACzC;AAAA,IACA,OAAO;AAAA,IACP;AAAA,KAEA,qCAAC,gBAAD;AAAA,IACE,IAAI;AAAA,IACJ,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,UAAU,gBAAgB,KAAK;AAAA,IAC/B,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS,MAAM,iBAAiB;AAAA,IAChC,QAAQ,MAAM,iBAAiB;AAAA,IAC/B,gBAAgB;AAAA,MAEjB,UAAU,MACT,qCAAC,cAAD;AAAA,IACE,IAAI;AAAA,IACJ,eAAY;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX,cAAW;AAAA,IACX,MAAK;AAAA,KAEL,qCAAC,aAAD;AAAA,IAAa,MAAK;AAAA,IAAI,OAAO,CAAC,iBAAiB;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
4
|
+
import { StyledLabelPillWrapper } from "../styled";
|
|
5
|
+
const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {
|
|
6
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
7
|
+
value: children
|
|
8
|
+
}) : React2.Fragment;
|
|
9
|
+
return /* @__PURE__ */ React2.createElement(StyledLabelPillWrapper, {
|
|
10
|
+
size,
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
13
|
+
"data-testid": "ds-pill-wrapper",
|
|
14
|
+
"aria-label": ariaLabel || label,
|
|
15
|
+
cols: [iconLeft && "min-content", "auto"].filter((notFalse) => notFalse),
|
|
16
|
+
gutter: "xxxs",
|
|
17
|
+
hasIcon: iconLeft !== null
|
|
18
|
+
}, iconLeft, /* @__PURE__ */ React2.createElement(TextComponent, null, label));
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
LabelPill
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=LabelPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAEA;AAEO,MAAM,YAAY,OAAM,KAAkB,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,gBAAgB;AACzG,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AACV,SACE,qCAAC,wBAAD;AAAA,IACE;AAAA,IACA,YAAW;AAAA,IACX,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,cAAY,aAAa;AAAA,IACzB,MAAM,CAAC,YAAY,eAAe,QAAQ,OAAO,CAAC,aAAa;AAAA,IAC/D,QAAO;AAAA,IACP,SAAS,aAAa;AAAA,KAErB,UACD,qCAAC,eAAD,MAAgB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
4
|
+
import { StyledReadonlyPillWrapper } from "../styled";
|
|
5
|
+
const ReadOnlyPill = React2.memo(({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {
|
|
6
|
+
const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
|
|
7
|
+
const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
|
|
8
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
9
|
+
value: children
|
|
10
|
+
}) : React2.Fragment;
|
|
11
|
+
return /* @__PURE__ */ React2.createElement(StyledReadonlyPillWrapper, {
|
|
12
|
+
size,
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
className: "ds-pill-wrapper ds-pill-wrapper-readonly",
|
|
15
|
+
"data-testid": "ds-pill-wrapper",
|
|
16
|
+
"aria-label": ariaLabel || label,
|
|
17
|
+
cols: [iconLeft && "min-content", label && "auto", iconRight && "min-content"].filter((notFalse) => notFalse),
|
|
18
|
+
gutter: "xxxs",
|
|
19
|
+
hasIconRight,
|
|
20
|
+
hasIconLeft
|
|
21
|
+
}, iconLeft, label ? /* @__PURE__ */ React2.createElement(TextComponent, null, label) : null, iconRight);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
ReadOnlyPill
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=ReadOnlyPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AAEA;AAEO,MAAM,eAAe,OAAM,KAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,WAAW,gBAAgB;AACnE,QAAM,cAAc,aAAa,QAAS,cAAc,QAAQ,UAAU;AAC1E,QAAM,eAAe,cAAc,QAAS,aAAa,QAAQ,UAAU;AAE3E,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AAEV,SACE,qCAAC,2BAAD;AAAA,IACE;AAAA,IACA,YAAW;AAAA,IACX,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,cAAY,aAAa;AAAA,IACzB,MAAM,CAAC,YAAY,eAAe,SAAS,QAAQ,aAAa,eAAe,OAAO,CAAC,aAAa;AAAA,IACpG,QAAO;AAAA,IACP;AAAA,IACA;AAAA,KAEC,UACA,QAAQ,qCAAC,eAAD,MAAgB,SAAyB,MACjD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useCallback, useContext, useMemo } from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
5
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
6
|
+
import { StyledRemovablePillWrapper } from "../styled";
|
|
7
|
+
import { DSPillGroupV2Context } from "../PillGroup";
|
|
8
|
+
import { DSPillButton } from "../PillButton";
|
|
9
|
+
const RemovablePill = React2.memo(({ label, size, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex }) => {
|
|
10
|
+
const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);
|
|
11
|
+
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
12
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
13
|
+
value: children
|
|
14
|
+
}) : React2.Fragment;
|
|
15
|
+
const onKeyDown = useCallback((e) => {
|
|
16
|
+
if (["Enter", "Space"].includes(e.code)) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
if (onKeyboardRemove)
|
|
19
|
+
onKeyboardRemove(pillUid);
|
|
20
|
+
onRemove(e);
|
|
21
|
+
}
|
|
22
|
+
if (e.code === "ArrowLeft") {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
if (onKeyboardNavigation)
|
|
25
|
+
onKeyboardNavigation(pillUid, -1, e);
|
|
26
|
+
}
|
|
27
|
+
if (e.code === "ArrowRight") {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
if (onKeyboardNavigation)
|
|
30
|
+
onKeyboardNavigation(pillUid, 1, e);
|
|
31
|
+
}
|
|
32
|
+
}, [onKeyboardRemove, onRemove, onKeyboardNavigation, pillUid]);
|
|
33
|
+
return /* @__PURE__ */ React2.createElement(StyledRemovablePillWrapper, {
|
|
34
|
+
size,
|
|
35
|
+
cols: ["auto", "24px"],
|
|
36
|
+
gutter: "2px",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyItems: "center",
|
|
39
|
+
className: "ds-pill-wrapper ds-pill-wrapper-removable",
|
|
40
|
+
"data-testid": "ds-pill-wrapper",
|
|
41
|
+
"aria-label": ariaLabel || label
|
|
42
|
+
}, /* @__PURE__ */ React2.createElement(TextComponent, null, label), /* @__PURE__ */ React2.createElement(DSPillButton, {
|
|
43
|
+
className: "ds-pill-focus-point",
|
|
44
|
+
id: pillUid,
|
|
45
|
+
"data-testid": "ds-pill-close-icon",
|
|
46
|
+
innerRef,
|
|
47
|
+
onClick: onRemove,
|
|
48
|
+
onKeyDown,
|
|
49
|
+
"aria-label": `Remove ${label}`,
|
|
50
|
+
type: "right",
|
|
51
|
+
tabIndex
|
|
52
|
+
}, /* @__PURE__ */ React2.createElement(CloseXsmall, {
|
|
53
|
+
width: size === "s" ? 18 : 22.65,
|
|
54
|
+
height: size === "s" ? 18 : 22.65,
|
|
55
|
+
color: ["brand-primary", "700"]
|
|
56
|
+
})));
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
RemovablePill
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=RemovablePill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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, 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 onRemove(e);\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 <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 </StyledRemovablePillWrapper>\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEO,MAAM,gBAAgB,OAAM,KACjC,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,UAAU,WAAW,eAAe;AAC5E,QAAM,EAAE,kBAAkB,yBAAyB,WAAW;AAC9D,QAAM,UAAU,QAAQ,MAAM,WAAW,SAAS;AAElD,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AAEV,QAAM,YAAY,YAChB,CAAC,MAAqB;AACpB,QAAI,CAAC,SAAS,SAAS,SAAS,EAAE,OAAO;AACvC,QAAE;AACF,UAAI;AAAkB,yBAAiB;AACvC,eAAS;AAAA;AAEX,QAAI,EAAE,SAAS,aAAa;AAC1B,QAAE;AACF,UAAI;AAAsB,6BAAqB,SAAS,IAAI;AAAA;AAE9D,QAAI,EAAE,SAAS,cAAc;AAC3B,QAAE;AACF,UAAI;AAAsB,6BAAqB,SAAS,GAAG;AAAA;AAAA,KAG/D,CAAC,kBAAkB,UAAU,sBAAsB;AAGrD,SACE,qCAAC,4BAAD;AAAA,IACE;AAAA,IACA,MAAM,CAAC,QAAQ;AAAA,IACf,QAAO;AAAA,IACP,YAAW;AAAA,IACX,cAAa;AAAA,IACb,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,cAAY,aAAa;AAAA,KAEzB,qCAAC,eAAD,MAAgB,QAChB,qCAAC,cAAD;AAAA,IACE,WAAU;AAAA,IACV,IAAI;AAAA,IACJ,eAAY;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,cAAY,UAAU;AAAA,IACtB,MAAK;AAAA,IACL;AAAA,KAEA,qCAAC,aAAD;AAAA,IACE,OAAO,SAAS,MAAM,KAAK;AAAA,IAC3B,QAAQ,SAAS,MAAM,KAAK;AAAA,IAC5B,OAAO,CAAC,iBAAiB;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSTooltipV2 } from "@elliemae/ds-tooltip";
|
|
4
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
+
import { StyledSpanWithTooltip, StyledValuePillWrapper } from "../styled";
|
|
6
|
+
const ValuePill = React2.memo(({ label, size, labelTruncated, tooltipValue, iconLeft, ariaLabel }) => {
|
|
7
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
8
|
+
value: children
|
|
9
|
+
}) : React2.Fragment;
|
|
10
|
+
return /* @__PURE__ */ React2.createElement(StyledValuePillWrapper, {
|
|
11
|
+
size,
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
className: "ds-pill-wrapper ds-pill-wrapper-value",
|
|
14
|
+
"data-testid": "ds-pill-wrapper",
|
|
15
|
+
"aria-label": ariaLabel || label,
|
|
16
|
+
cols: [iconLeft && "min-content", "auto"].filter((notFalse) => notFalse),
|
|
17
|
+
gutter: "xxxs",
|
|
18
|
+
hasIcon: iconLeft !== null
|
|
19
|
+
}, iconLeft, tooltipValue !== "" ? /* @__PURE__ */ React2.createElement(DSTooltipV2, {
|
|
20
|
+
title: tooltipValue,
|
|
21
|
+
triggerComponent: /* @__PURE__ */ React2.createElement(StyledSpanWithTooltip, {
|
|
22
|
+
className: "ds-pill-tooltip-value",
|
|
23
|
+
tabIndex: 0
|
|
24
|
+
}, label)
|
|
25
|
+
}) : /* @__PURE__ */ React2.createElement(TextComponent, null, label));
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
ValuePill
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ValuePill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/ValuePill.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { DSTooltipV2 } from '@elliemae/ds-tooltip';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport type { DSPillProps } from '../../index.d';\nimport { StyledSpanWithTooltip, StyledValuePillWrapper } from '../styled';\n\nexport const ValuePill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, tooltipValue, iconLeft, ariaLabel }) => {\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledValuePillWrapper\n size={size}\n alignItems=\"center\"\n className=\"ds-pill-wrapper ds-pill-wrapper-value\"\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 {tooltipValue !== '' ? (\n <DSTooltipV2\n title={tooltipValue}\n triggerComponent={\n <StyledSpanWithTooltip className=\"ds-pill-tooltip-value\" tabIndex={0}>\n {label}\n </StyledSpanWithTooltip>\n }\n />\n ) : (\n <TextComponent>{label}</TextComponent>\n )}\n </StyledValuePillWrapper>\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA;AAEO,MAAM,YAAY,OAAM,KAC7B,CAAC,EAAE,OAAO,MAAM,gBAAgB,cAAc,UAAU,gBAAgB;AACtE,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AAEV,SACE,qCAAC,wBAAD;AAAA,IACE;AAAA,IACA,YAAW;AAAA,IACX,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,cAAY,aAAa;AAAA,IACzB,MAAM,CAAC,YAAY,eAAe,QAAQ,OAAO,CAAC,aAAa;AAAA,IAC/D,QAAO;AAAA,IACP,SAAS,aAAa;AAAA,KAErB,UACA,iBAAiB,KAChB,qCAAC,aAAD;AAAA,IACE,OAAO;AAAA,IACP,kBACE,qCAAC,uBAAD;AAAA,MAAuB,WAAU;AAAA,MAAwB,UAAU;AAAA,OAChE;AAAA,OAKP,qCAAC,eAAD,MAAgB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DropdownPill';\nexport * from './InputPill';\nexport * from './LabelPill';\nexport * from './ReadOnlyPill';\nexport * from './RemovablePill';\nexport * from './ValuePill';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import React2, { useRef, useState } from "react";
|
|
34
|
+
import { PropTypes, describe } from "react-desc";
|
|
35
|
+
import { DSDropdownMenu } from "@elliemae/ds-dropdownmenu";
|
|
36
|
+
import { ChevronDown } from "@elliemae/ds-icons";
|
|
37
|
+
import { useFocusGroupItem } from "@elliemae/ds-shared/FocusGroup/useFocusGroupItem";
|
|
38
|
+
import { Pill } from "./Pill";
|
|
39
|
+
function DropdownPill(_a) {
|
|
40
|
+
var _b = _a, {
|
|
41
|
+
containerProps = {},
|
|
42
|
+
label = "",
|
|
43
|
+
variant,
|
|
44
|
+
tabIndex = -1,
|
|
45
|
+
closeMenuOnItemSelection = false,
|
|
46
|
+
maxWidth,
|
|
47
|
+
minWidth
|
|
48
|
+
} = _b, dropdownProps = __objRest(_b, [
|
|
49
|
+
"containerProps",
|
|
50
|
+
"label",
|
|
51
|
+
"variant",
|
|
52
|
+
"tabIndex",
|
|
53
|
+
"closeMenuOnItemSelection",
|
|
54
|
+
"maxWidth",
|
|
55
|
+
"minWidth"
|
|
56
|
+
]);
|
|
57
|
+
const ref = useRef(null);
|
|
58
|
+
const [chevronEl, chevronRef] = useState();
|
|
59
|
+
const { focusFirst } = useFocusGroupItem(ref);
|
|
60
|
+
return /* @__PURE__ */ React2.createElement(DSDropdownMenu, __spreadProps(__spreadValues({}, dropdownProps), {
|
|
61
|
+
closeMenuOnItemSelection,
|
|
62
|
+
maxWidth,
|
|
63
|
+
hideIfNotVisible: true,
|
|
64
|
+
menuProps: { className: "dropdown-pill-menu", zIndex: 100 },
|
|
65
|
+
minWidth,
|
|
66
|
+
onClose: focusFirst,
|
|
67
|
+
referenceNode: chevronEl,
|
|
68
|
+
triggerComponent: /* @__PURE__ */ React2.createElement(Pill, {
|
|
69
|
+
"data-testid": "dropdown-pill",
|
|
70
|
+
className: "dropdown-pill",
|
|
71
|
+
containerProps: __spreadValues({ role: "listbox" }, containerProps),
|
|
72
|
+
innerRef: ref,
|
|
73
|
+
label,
|
|
74
|
+
rightAddon: /* @__PURE__ */ React2.createElement("div", {
|
|
75
|
+
ref: chevronRef
|
|
76
|
+
}, /* @__PURE__ */ React2.createElement(ChevronDown, {
|
|
77
|
+
className: "dropdown-pill-chevron-down",
|
|
78
|
+
"data-testid": "dropdown-pill-button"
|
|
79
|
+
})),
|
|
80
|
+
tabIndex,
|
|
81
|
+
variant
|
|
82
|
+
})
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
const props = {
|
|
86
|
+
containerProps: PropTypes.object.description("props injected to component wrapper"),
|
|
87
|
+
label: PropTypes.string.isRequired.description("pill text label"),
|
|
88
|
+
variant: PropTypes.oneOf(["value", "title"]).description("pill variant"),
|
|
89
|
+
tabIndex: PropTypes.number.description("html focus order"),
|
|
90
|
+
closeMenuOnItemSelection: PropTypes.bool.description("close menu on item selection"),
|
|
91
|
+
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("pill max width"),
|
|
92
|
+
minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("pill min width")
|
|
93
|
+
};
|
|
94
|
+
DropdownPill.propTypes = props;
|
|
95
|
+
const DSDropdownPillWithSchema = describe(DropdownPill);
|
|
96
|
+
DSDropdownPillWithSchema.propTypes = props;
|
|
97
|
+
export {
|
|
98
|
+
DSDropdownPillWithSchema,
|
|
99
|
+
DropdownPill
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=DropdownPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/DropdownPill.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useState } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport { useFocusGroupItem } from '@elliemae/ds-shared/FocusGroup/useFocusGroupItem';\nimport { Pill } from './Pill';\n\nfunction DropdownPill({\n containerProps = {},\n label = '',\n variant,\n tabIndex = -1,\n closeMenuOnItemSelection = false,\n maxWidth,\n minWidth,\n ...dropdownProps\n}) {\n const ref = useRef(null);\n const [chevronEl, chevronRef] = useState();\n const { focusFirst } = useFocusGroupItem(ref);\n return (\n <DSDropdownMenu\n {...dropdownProps}\n closeMenuOnItemSelection={closeMenuOnItemSelection}\n maxWidth={maxWidth}\n hideIfNotVisible\n menuProps={{ className: 'dropdown-pill-menu', zIndex: 100 }}\n minWidth={minWidth}\n onClose={focusFirst}\n referenceNode={chevronEl}\n triggerComponent={\n <Pill\n data-testid=\"dropdown-pill\"\n className=\"dropdown-pill\"\n containerProps={{ role: 'listbox', ...containerProps }}\n innerRef={ref}\n label={label}\n rightAddon={\n <div ref={chevronRef}>\n <ChevronDown className=\"dropdown-pill-chevron-down\" data-testid=\"dropdown-pill-button\" />\n </div>\n }\n tabIndex={tabIndex}\n variant={variant}\n />\n }\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 /** pill variant */\n variant: PropTypes.oneOf(['value', 'title']).description('pill variant'),\n /** html focus border */\n tabIndex: PropTypes.number.description('html focus order'),\n /** close menu on item selection */\n closeMenuOnItemSelection: PropTypes.bool.description('close menu on item selection'),\n /** pill max width */\n maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('pill max width'),\n /** pill min width */\n minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('pill min width'),\n};\n\nDropdownPill.propTypes = props;\nconst DSDropdownPillWithSchema = describe(DropdownPill);\nDSDropdownPillWithSchema.propTypes = props;\n\nexport { DropdownPill, DSDropdownPillWithSchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA,sBAAsB,IASnB;AATmB,eACpB;AAAA,qBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR;AAAA,IACA,WAAW;AAAA,IACX,2BAA2B;AAAA,IAC3B;AAAA,IACA;AAAA,MAPoB,IAQjB,0BARiB,IAQjB;AAAA,IAPH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,MAAM,OAAO;AACnB,QAAM,CAAC,WAAW,cAAc;AAChC,QAAM,EAAE,eAAe,kBAAkB;AACzC,SACE,qCAAC,gBAAD,iCACM,gBADN;AAAA,IAEE;AAAA,IACA;AAAA,IACA,kBAAgB;AAAA,IAChB,WAAW,EAAE,WAAW,sBAAsB,QAAQ;AAAA,IACtD;AAAA,IACA,SAAS;AAAA,IACT,eAAe;AAAA,IACf,kBACE,qCAAC,MAAD;AAAA,MACE,eAAY;AAAA,MACZ,WAAU;AAAA,MACV,gBAAgB,iBAAE,MAAM,aAAc;AAAA,MACtC,UAAU;AAAA,MACV;AAAA,MACA,YACE,qCAAC,OAAD;AAAA,QAAK,KAAK;AAAA,SACR,qCAAC,aAAD;AAAA,QAAa,WAAU;AAAA,QAA6B,eAAY;AAAA;AAAA,MAGpE;AAAA,MACA;AAAA;AAAA;AAAA;AAOV,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAAY;AAAA,EAE7C,OAAO,UAAU,OAAO,WAAW,YAAY;AAAA,EAE/C,SAAS,UAAU,MAAM,CAAC,SAAS,UAAU,YAAY;AAAA,EAEzD,UAAU,UAAU,OAAO,YAAY;AAAA,EAEvC,0BAA0B,UAAU,KAAK,YAAY;AAAA,EAErD,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,YAAY;AAAA,EAEhF,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,YAAY;AAAA;AAGlF,aAAa,YAAY;AACzB,MAAM,2BAA2B,SAAS;AAC1C,yBAAyB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
import React2 from "react";
|
|
31
|
+
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
32
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
33
|
+
import { DSInput, DSInputMask } from "@elliemae/ds-form";
|
|
34
|
+
import { Pill } from "./Pill";
|
|
35
|
+
const StyledInputPill = aggregatedClasses(Pill)("input-pill", null, ({ value }) => ({
|
|
36
|
+
value
|
|
37
|
+
}));
|
|
38
|
+
function InputPill(_a) {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
containerProps = {},
|
|
41
|
+
placeholder = "Enter Value",
|
|
42
|
+
onChange = () => {
|
|
43
|
+
},
|
|
44
|
+
onRemove,
|
|
45
|
+
value,
|
|
46
|
+
type
|
|
47
|
+
} = _b, otherProps = __objRest(_b, [
|
|
48
|
+
"containerProps",
|
|
49
|
+
"placeholder",
|
|
50
|
+
"onChange",
|
|
51
|
+
"onRemove",
|
|
52
|
+
"value",
|
|
53
|
+
"type"
|
|
54
|
+
]);
|
|
55
|
+
let TypeOfInput = DSInput;
|
|
56
|
+
switch (type) {
|
|
57
|
+
case "inputText":
|
|
58
|
+
TypeOfInput = DSInput;
|
|
59
|
+
break;
|
|
60
|
+
case "inputMask":
|
|
61
|
+
TypeOfInput = DSInputMask;
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ React2.createElement(StyledInputPill, {
|
|
67
|
+
className: "input-pill",
|
|
68
|
+
classProps: { value },
|
|
69
|
+
containerProps,
|
|
70
|
+
label: /* @__PURE__ */ React2.createElement(TypeOfInput, __spreadValues({
|
|
71
|
+
"data-testid": "input-pill",
|
|
72
|
+
onChange,
|
|
73
|
+
placeholder,
|
|
74
|
+
value
|
|
75
|
+
}, otherProps)),
|
|
76
|
+
rightAddon: value && /* @__PURE__ */ React2.createElement(CloseXsmall, {
|
|
77
|
+
className: "remove-pill-button",
|
|
78
|
+
"data-testid": "remove-pill-button",
|
|
79
|
+
onClick: onRemove
|
|
80
|
+
}),
|
|
81
|
+
tabIndex: -1
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
InputPill
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=InputPill.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/InputPill.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { CloseXsmall } from '@elliemae/ds-icons';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSInput, DSInputMask } from '@elliemae/ds-form';\nimport { Pill } from './Pill';\n\nconst StyledInputPill = aggregatedClasses(Pill)('input-pill', null, ({ value }) => ({\n value,\n}));\n\nexport function InputPill({\n containerProps = {},\n placeholder = 'Enter Value',\n onChange = () => {},\n onRemove,\n value,\n type,\n ...otherProps\n}) {\n let TypeOfInput = DSInput;\n // TODO: implement the DSTimeInput, see how because it returns a moment()\n // TODO: implement the DSDateInput\n switch (type) {\n case 'inputText':\n TypeOfInput = DSInput;\n break;\n case 'inputMask':\n TypeOfInput = DSInputMask;\n break;\n default:\n break;\n }\n\n return (\n <StyledInputPill\n className=\"input-pill\"\n classProps={{ value }}\n containerProps={containerProps}\n label={\n <TypeOfInput\n data-testid=\"input-pill\"\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n {...otherProps}\n />\n }\n rightAddon={\n value && <CloseXsmall className=\"remove-pill-button\" data-testid=\"remove-pill-button\" onClick={onRemove} />\n }\n tabIndex={-1}\n />\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,kBAAkB,MAAM,cAAc,MAAM,CAAC,EAAE,YAAa;AAAA,EAClF;AAAA;AAGK,mBAAmB,IAQvB;AARuB,eACxB;AAAA,qBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,WAAW,MAAM;AAAA;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,MANwB,IAOrB,uBAPqB,IAOrB;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,MAAI,cAAc;AAGlB,UAAQ;AAAA,SACD;AACH,oBAAc;AACd;AAAA,SACG;AACH,oBAAc;AACd;AAAA;AAEA;AAAA;AAGJ,SACE,qCAAC,iBAAD;AAAA,IACE,WAAU;AAAA,IACV,YAAY,EAAE;AAAA,IACd;AAAA,IACA,OACE,qCAAC,aAAD;AAAA,MACE,eAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,OACI;AAAA,IAGR,YACE,SAAS,qCAAC,aAAD;AAAA,MAAa,WAAU;AAAA,MAAqB,eAAY;AAAA,MAAqB,SAAS;AAAA;AAAA,IAEjG,UAAU;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|