@elliemae/ds-pills 3.12.0-rc.2 → 3.12.0-rc.21
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/DSPillDefinitions.js +36 -0
- package/dist/cjs/DSPillDefinitions.js.map +7 -0
- package/dist/cjs/components/Pill.js +4 -5
- package/dist/cjs/components/Pill.js.map +2 -2
- package/dist/cjs/components/PillButton.js +4 -8
- package/dist/cjs/components/PillButton.js.map +2 -2
- package/dist/cjs/components/PillGroup.js +8 -7
- package/dist/cjs/components/PillGroup.js.map +2 -2
- package/dist/cjs/components/types/DropdownPill.js +51 -50
- package/dist/cjs/components/types/DropdownPill.js.map +1 -1
- package/dist/cjs/components/types/InputPill.js +42 -36
- package/dist/cjs/components/types/InputPill.js.map +1 -1
- package/dist/cjs/components/types/LabelPill.js +18 -19
- package/dist/cjs/components/types/LabelPill.js.map +1 -1
- package/dist/cjs/components/types/ReadOnlyPill.js +20 -21
- package/dist/cjs/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/cjs/components/types/RemovablePill.js +39 -36
- package/dist/cjs/components/types/RemovablePill.js.map +1 -1
- package/dist/cjs/components/types/ValuePill.js +19 -27
- package/dist/cjs/components/types/ValuePill.js.map +1 -1
- package/dist/cjs/deprecated/DropdownPill.js +26 -26
- package/dist/cjs/deprecated/DropdownPill.js.map +1 -1
- package/dist/cjs/deprecated/InputPill.js +20 -18
- package/dist/cjs/deprecated/InputPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPills.js +9 -13
- package/dist/cjs/deprecated/LabeledDropdownPills.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +40 -42
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +15 -20
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +20 -17
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledPills.js +12 -14
- package/dist/cjs/deprecated/LabeledPills.js.map +1 -1
- package/dist/cjs/deprecated/OverflowPill.js +20 -14
- package/dist/cjs/deprecated/OverflowPill.js.map +1 -1
- package/dist/cjs/deprecated/Pill.js +5 -16
- package/dist/cjs/deprecated/Pill.js.map +1 -1
- package/dist/cjs/deprecated/PillGroup.js +13 -13
- package/dist/cjs/deprecated/PillGroup.js.map +1 -1
- package/dist/cjs/deprecated/ReadOnlyPill.js +34 -24
- package/dist/cjs/deprecated/ReadOnlyPill.js.map +1 -1
- package/dist/cjs/deprecated/RemovablePill.js +21 -23
- package/dist/cjs/deprecated/RemovablePill.js.map +1 -1
- package/dist/esm/DSPillDefinitions.js +10 -0
- package/dist/esm/DSPillDefinitions.js.map +7 -0
- package/dist/esm/components/Pill.js +4 -5
- package/dist/esm/components/Pill.js.map +2 -2
- package/dist/esm/components/PillButton.js +4 -8
- package/dist/esm/components/PillButton.js.map +2 -2
- package/dist/esm/components/PillGroup.js +8 -7
- package/dist/esm/components/PillGroup.js.map +2 -2
- package/dist/esm/components/types/DropdownPill.js +51 -50
- package/dist/esm/components/types/DropdownPill.js.map +1 -1
- package/dist/esm/components/types/InputPill.js +42 -36
- package/dist/esm/components/types/InputPill.js.map +1 -1
- package/dist/esm/components/types/LabelPill.js +18 -19
- package/dist/esm/components/types/LabelPill.js.map +1 -1
- package/dist/esm/components/types/ReadOnlyPill.js +20 -21
- package/dist/esm/components/types/ReadOnlyPill.js.map +1 -1
- package/dist/esm/components/types/RemovablePill.js +39 -36
- package/dist/esm/components/types/RemovablePill.js.map +1 -1
- package/dist/esm/components/types/ValuePill.js +19 -27
- package/dist/esm/components/types/ValuePill.js.map +1 -1
- package/dist/esm/deprecated/DropdownPill.js +26 -26
- package/dist/esm/deprecated/DropdownPill.js.map +1 -1
- package/dist/esm/deprecated/InputPill.js +20 -18
- package/dist/esm/deprecated/InputPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPills.js +9 -13
- package/dist/esm/deprecated/LabeledDropdownPills.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +40 -42
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +15 -20
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +20 -17
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
- package/dist/esm/deprecated/LabeledPills.js +12 -14
- package/dist/esm/deprecated/LabeledPills.js.map +1 -1
- package/dist/esm/deprecated/OverflowPill.js +20 -14
- package/dist/esm/deprecated/OverflowPill.js.map +1 -1
- package/dist/esm/deprecated/Pill.js +5 -16
- package/dist/esm/deprecated/Pill.js.map +1 -1
- package/dist/esm/deprecated/PillGroup.js +13 -13
- package/dist/esm/deprecated/PillGroup.js.map +1 -1
- package/dist/esm/deprecated/ReadOnlyPill.js +34 -24
- package/dist/esm/deprecated/ReadOnlyPill.js.map +1 -1
- package/dist/esm/deprecated/RemovablePill.js +21 -23
- package/dist/esm/deprecated/RemovablePill.js.map +1 -1
- package/package.json +15 -15
|
@@ -10,13 +10,14 @@ import {
|
|
|
10
10
|
} from "@elliemae/ds-utilities";
|
|
11
11
|
import { DSPillGroupDefaultProps, DSPillGroupPropTypes } from "../props";
|
|
12
12
|
import { StyledPillGroup } from "./styled";
|
|
13
|
+
import { DSPillGroupName } from "../DSPillDefinitions";
|
|
13
14
|
const DSPillGroupV2Context = createContext({
|
|
14
15
|
onKeyboardRemove: () => null,
|
|
15
16
|
onKeyboardNavigation: () => null
|
|
16
17
|
});
|
|
17
18
|
const DSPillGroupV2 = (props) => {
|
|
18
19
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);
|
|
19
|
-
useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);
|
|
20
|
+
useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes, DSPillGroupName);
|
|
20
21
|
const globalAttrs = useGetGlobalAttributes(propsWithDefaults);
|
|
21
22
|
const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);
|
|
22
23
|
const { children, width, innerRef } = propsWithDefaults;
|
|
@@ -45,9 +46,9 @@ const DSPillGroupV2 = (props) => {
|
|
|
45
46
|
},
|
|
46
47
|
[pillGroupUid]
|
|
47
48
|
);
|
|
48
|
-
return /* @__PURE__ */ jsx(DSPillGroupV2Context.Provider, {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
return /* @__PURE__ */ jsx(DSPillGroupV2Context.Provider, { value: { onKeyboardRemove, onKeyboardNavigation }, children: /* @__PURE__ */ jsx(
|
|
50
|
+
StyledPillGroup,
|
|
51
|
+
{
|
|
51
52
|
...globalAttrs,
|
|
52
53
|
width,
|
|
53
54
|
id: pillGroupUid,
|
|
@@ -55,11 +56,11 @@ const DSPillGroupV2 = (props) => {
|
|
|
55
56
|
gutter: "2px",
|
|
56
57
|
ref: innerRef,
|
|
57
58
|
children
|
|
58
|
-
}
|
|
59
|
-
});
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
60
61
|
};
|
|
61
62
|
DSPillGroupV2.propTypes = DSPillGroupPropTypes;
|
|
62
|
-
DSPillGroupV2.displayName =
|
|
63
|
+
DSPillGroupV2.displayName = DSPillGroupName;
|
|
63
64
|
const DSPillGroupV2WithSchema = describe(DSPillGroupV2);
|
|
64
65
|
DSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes;
|
|
65
66
|
export {
|
|
@@ -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-utilities';\nimport type { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props';\nimport { StyledPillGroup } from './styled';\n\nexport const DSPillGroupV2Context = createContext<{\n onKeyboardRemove: (pillUid: string) => void;\n onKeyboardNavigation: (pillUid: string, step: number, e: KeyboardEvent) => void;\n}>({\n onKeyboardRemove: () => null,\n onKeyboardNavigation: () => null,\n});\n\nconst DSPillGroupV2: React.ComponentType<DSPillGroupProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults);\n const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);\n const { children, width, innerRef } = propsWithDefaults;\n const onKeyboardRemove = useCallback(\n (pillUid: string) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex > 0) {\n elems[pillIndex - 1].focus();\n } else if (pillIndex + 1 < elems.length) {\n elems[pillIndex + 1].focus();\n }\n },\n [pillGroupUid],\n );\n const onKeyboardNavigation = useCallback(\n (pillUid: string, step: number, e: KeyboardEvent) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex >= 0) {\n if (elems[pillIndex + step]) {\n e.stopPropagation();\n elems[pillIndex + step].focus();\n }\n }\n },\n [pillGroupUid],\n );\n\n return (\n <DSPillGroupV2Context.Provider value={{ onKeyboardRemove, onKeyboardNavigation }}>\n <StyledPillGroup\n {...globalAttrs}\n width={width}\n id={pillGroupUid}\n cols={React.Children.map(children, () => 'auto')}\n gutter=\"2px\"\n ref={innerRef}\n >\n {children}\n </StyledPillGroup>\n </DSPillGroupV2Context.Provider>\n );\n};\n\nDSPillGroupV2.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\nDSPillGroupV2.displayName =
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
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-utilities';\nimport type { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props';\nimport { StyledPillGroup } from './styled';\nimport { DSPillGroupName } from '../DSPillDefinitions';\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;AC8DjB;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;AA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AM,SAAS,IAAI,UAAU,MAAM,MAAM;AAAA,MAC/C,QAAO;AAAA,MACP,KAAK;AAAA,MAEJ;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -12,56 +12,57 @@ const DropdownPill = React2.memo(
|
|
|
12
12
|
({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
|
|
13
13
|
const chevronRef = useRef(null);
|
|
14
14
|
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
15
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
15
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
StyledDropdownPillWrapper,
|
|
18
|
+
{
|
|
19
|
+
size,
|
|
20
|
+
id: pillUid,
|
|
21
|
+
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
22
|
+
"data-testid": "ds-pill-wrapper",
|
|
23
|
+
cols: ["auto", "24px"],
|
|
24
|
+
gutter: "2px",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
justifyItems: "center",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx(TextComponent, { children: label }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
DSDropdownMenuV2,
|
|
31
|
+
{
|
|
32
|
+
placementOrderPreference: [
|
|
33
|
+
"bottom-start",
|
|
34
|
+
"bottom",
|
|
35
|
+
"bottom-end",
|
|
36
|
+
"right-end",
|
|
37
|
+
"top-start",
|
|
38
|
+
"top",
|
|
39
|
+
"top-end"
|
|
40
|
+
],
|
|
41
|
+
...dropdownProps,
|
|
42
|
+
onClickOutside: (e) => {
|
|
43
|
+
if (e.code === "Escape")
|
|
44
|
+
chevronRef.current.focus();
|
|
45
|
+
if (dropdownProps.onClickOutside)
|
|
46
|
+
dropdownProps.onClickOutside(e);
|
|
47
|
+
},
|
|
48
|
+
wrapperStyles: { w: "100%", h: "100%" },
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
50
|
+
DSPillButton,
|
|
51
|
+
{
|
|
52
|
+
className: "ds-pill-focus-point",
|
|
53
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
54
|
+
innerRef: setMultipleRefs(chevronRef, innerRef),
|
|
55
|
+
"aria-label": ariaLabel || label,
|
|
56
|
+
type: "right",
|
|
57
|
+
onClick: onDropdownClick,
|
|
58
|
+
children: /* @__PURE__ */ jsx(ChevronSmallDown, { color: ["brand-primary", "800"], width: 20, height: 20 })
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/DropdownPill.tsx"],
|
|
4
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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACkBG,cAIpB,YAJoB;AAjB1B,OAAOA,UAAS,SAAS,cAA2B;AACpD,SAAS,wBAAwB;AACjC,SAAS,WAAW;AACpB,SAAS,wBAAwB;AACjC,SAAS,kCAAkC;AAC3C,SAAS,iCAAiC;AAE1C,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAEtB,MAAM,eAAeA,OAAM;AAAA,EAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,eAAe,UAAU,WAAW,gBAAgB,MAAM;AACxF,UAAM,aAAa,OAAO,IAAI;AAE9B,UAAM,UAAU,QAAQ,MAAM,WAAW,IAAI,KAAK,CAAC,CAAC;AAEpD,UAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBG,cAIpB,YAJoB;AAjB1B,OAAOA,UAAS,SAAS,cAA2B;AACpD,SAAS,wBAAwB;AACjC,SAAS,WAAW;AACpB,SAAS,wBAAwB;AACjC,SAAS,kCAAkC;AAC3C,SAAS,iCAAiC;AAE1C,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAEtB,MAAM,eAAeA,OAAM;AAAA,EAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,eAAe,UAAU,WAAW,gBAAgB,MAAM;AACxF,UAAM,aAAa,OAAO,IAAI;AAE9B,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,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,MAAM,CAAC,QAAQ,MAAM;AAAA,QACrB,QAAO;AAAA,QACP,YAAW;AAAA,QACX,cAAa;AAAA,QAEb;AAAA,8BAAC,iBAAe,iBAAM;AAAA,UACtB;AAAA,YAAC;AAAA;AAAA,cACC,0BAA0B;AAAA,gBACxB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,cACC,GAAG;AAAA,cACJ,gBAAgB,CAAC,MAAM;AACrB,oBAAI,EAAE,SAAS;AAAU,6BAAW,QAAQ,MAAM;AAClD,oBAAI,cAAc;AAAgB,gCAAc,eAAe,CAAC;AAAA,cAClE;AAAA,cACA,eAAe,EAAE,GAAG,QAAQ,GAAG,OAAO;AAAA,cAEtC;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAU;AAAA,kBACV,eAAY;AAAA,kBACZ,UAAU,gBAAgB,YAAY,QAAQ;AAAA,kBAC9C,cAAY,aAAa;AAAA,kBACzB,MAAK;AAAA,kBACL,SAAS;AAAA,kBAET,8BAAC,oBAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG,OAAO,IAAI,QAAQ,IAAI;AAAA;AAAA,cAC5E;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,42 +33,48 @@ const InputPill = React2.memo(
|
|
|
33
33
|
[onInputClear]
|
|
34
34
|
);
|
|
35
35
|
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
36
|
-
return /* @__PURE__ */ jsxs(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
StyledInputPillWrapper,
|
|
38
|
+
{
|
|
39
|
+
size,
|
|
40
|
+
className: "ds-pill-wrapper",
|
|
41
|
+
"data-testid": "ds-pill-wrapper",
|
|
42
|
+
cols: label === "" ? ["auto"] : ["auto", "24px"],
|
|
43
|
+
inputWidth,
|
|
44
|
+
value: label,
|
|
45
|
+
inputHasFocus,
|
|
46
|
+
hasError,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
InputComponent,
|
|
50
|
+
{
|
|
51
|
+
id: pillUid,
|
|
52
|
+
className: "ds-pill-focus-point",
|
|
53
|
+
"data-testid": "ds-pill-input",
|
|
54
|
+
innerRef: setMultipleRefs(ref, innerRef),
|
|
55
|
+
value: label,
|
|
56
|
+
onChange: onInputChange,
|
|
57
|
+
placeholder: inputPlaceholder,
|
|
58
|
+
onFocus: () => setInputHasFocus(true),
|
|
59
|
+
onBlur: () => setInputHasFocus(false),
|
|
60
|
+
disableTooltip: false
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
label !== "" && /* @__PURE__ */ jsx(
|
|
64
|
+
DSPillButton,
|
|
65
|
+
{
|
|
66
|
+
id: pillUid,
|
|
67
|
+
"data-testid": "ds-pill-clear-icon",
|
|
68
|
+
innerRef,
|
|
69
|
+
onClick: onCloseIconClick,
|
|
70
|
+
"aria-label": "Clear input",
|
|
71
|
+
type: "right",
|
|
72
|
+
children: /* @__PURE__ */ jsx(CloseXsmall, { size: "s", color: ["brand-primary", "700"] })
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
72
78
|
}
|
|
73
79
|
);
|
|
74
80
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/InputPill.tsx"],
|
|
4
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"],
|
|
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,OAAoB,IAAI;AAEpC,UAAM,iBAAiB,QAAQ,MAAM,aAAa,CAAC,WAAW,CAAC;AAE/D,UAAM,UAAU,QAAQ,MAAM,WAAW,WAAW,IAAI,KAAK,CAAC,CAAC;AAE/D,UAAM,mBAAyE;AAAA,MAC7E,CAAC,MAAM;AACL,YAAI,CAAC,QAAW,SAAS,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG;AAClD,YAAE,eAAe;AACjB,uBAAa,CAAC;AACd,cAAI,QAAQ,MAAM;AAAA,QACpB;AAAA,MACF;AAAA,MACA,CAAC,YAAY;AAAA,IACf;AAEA,UAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AAExD,WACE,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0CjB,SAUE,KAVF;AAzCN,OAAO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ClB;AAAA,UACC,UAAU,MACT;AAAA,YAAC;AAAA;AAAA,cACC,IAAI;AAAA,cACJ,eAAY;AAAA,cACZ;AAAA,cACA,SAAS;AAAA,cAET,cAAW;AAAA,cACX,MAAK;AAAA,cAEL,8BAAC,eAAY,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,UACzD;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -4,25 +4,24 @@ import React2 from "react";
|
|
|
4
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
5
|
import { StyledLabelPillWrapper } from "../styled";
|
|
6
6
|
const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {
|
|
7
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
7
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
StyledLabelPillWrapper,
|
|
10
|
+
{
|
|
11
|
+
size,
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
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
|
+
children: [
|
|
20
|
+
iconLeft,
|
|
21
|
+
/* @__PURE__ */ jsx(TextComponent, { children: label })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
26
25
|
});
|
|
27
26
|
export {
|
|
28
27
|
LabelPill
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/LabelPill.tsx"],
|
|
4
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,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
|
|
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
|
}
|
|
@@ -7,27 +7,26 @@ const ReadOnlyPill = React2.memo(
|
|
|
7
7
|
({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {
|
|
8
8
|
const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
|
|
9
9
|
const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
|
|
10
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
10
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
StyledReadonlyPillWrapper,
|
|
13
|
+
{
|
|
14
|
+
size,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
className: "ds-pill-wrapper ds-pill-wrapper-readonly",
|
|
17
|
+
"data-testid": "ds-pill-wrapper",
|
|
18
|
+
"aria-label": ariaLabel || label,
|
|
19
|
+
cols: [iconLeft && "min-content", label && "auto", iconRight && "min-content"].filter((notFalse) => notFalse),
|
|
20
|
+
gutter: "xxxs",
|
|
21
|
+
hasIconRight,
|
|
22
|
+
hasIconLeft,
|
|
23
|
+
children: [
|
|
24
|
+
iconLeft,
|
|
25
|
+
label ? /* @__PURE__ */ jsx(TextComponent, { children: label }) : null,
|
|
26
|
+
iconRight
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
31
30
|
}
|
|
32
31
|
);
|
|
33
32
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/ReadOnlyPill.tsx"],
|
|
4
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,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
|
|
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
|
}
|
|
@@ -11,9 +11,7 @@ const RemovablePill = React2.memo(
|
|
|
11
11
|
({ label, size, disabled, labelTruncated, onRemove, innerRef, ariaLabel, tabIndex }) => {
|
|
12
12
|
const { onKeyboardRemove, onKeyboardNavigation } = useContext(DSPillGroupV2Context);
|
|
13
13
|
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
14
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
15
|
-
value: children
|
|
16
|
-
}) : React2.Fragment;
|
|
14
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
17
15
|
const onKeyDown = useCallback(
|
|
18
16
|
(e) => {
|
|
19
17
|
if (["Enter", "Space"].includes(e.code)) {
|
|
@@ -34,39 +32,44 @@ const RemovablePill = React2.memo(
|
|
|
34
32
|
},
|
|
35
33
|
[onKeyboardRemove, onRemove, onKeyboardNavigation, pillUid]
|
|
36
34
|
);
|
|
37
|
-
return /* @__PURE__ */ jsxs(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
StyledRemovablePillWrapper,
|
|
37
|
+
{
|
|
38
|
+
size,
|
|
39
|
+
cols: ["auto", "24px"],
|
|
40
|
+
gutter: "2px",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
justifyItems: "center",
|
|
43
|
+
className: "ds-pill-wrapper ds-pill-wrapper-removable",
|
|
44
|
+
"data-testid": "ds-pill-wrapper",
|
|
45
|
+
"aria-label": ariaLabel || label,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(TextComponent, { children: label }),
|
|
48
|
+
/* @__PURE__ */ jsx(Fragment, { children: !disabled ? /* @__PURE__ */ jsx(
|
|
49
|
+
DSPillButton,
|
|
50
|
+
{
|
|
51
|
+
className: "ds-pill-focus-point",
|
|
52
|
+
id: pillUid,
|
|
53
|
+
"data-testid": "ds-pill-close-icon",
|
|
54
|
+
innerRef,
|
|
55
|
+
onClick: onRemove,
|
|
56
|
+
onKeyDown,
|
|
57
|
+
"aria-label": `Remove ${label}`,
|
|
58
|
+
type: "right",
|
|
59
|
+
tabIndex,
|
|
60
|
+
children: /* @__PURE__ */ jsx(
|
|
61
|
+
CloseXsmall,
|
|
62
|
+
{
|
|
63
|
+
width: size === "s" ? 18 : 22.65,
|
|
64
|
+
height: size === "s" ? 18 : 22.65,
|
|
65
|
+
color: ["brand-primary", "700"]
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
) : null })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
70
73
|
}
|
|
71
74
|
);
|
|
72
75
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/RemovablePill.tsx"],
|
|
4
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={['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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;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,CAAC,QAAQ,MAAM;AAAA,QACrB,QAAO;AAAA,QACP,YAAW;AAAA,QACX,cAAa;AAAA,QACb,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,cAAY,aAAa;AAAA,QAEzB;AAAA,8BAAC,iBAAe,iBAAM;AAAA,UACtB,gCACG,WAAC,WACA;AAAA,YAAC;AAAA;AAAA,cACC,WAAU;AAAA,cACV,IAAI;AAAA,cACJ,eAAY;AAAA,cACZ;AAAA,cACA,SAAS;AAAA,cACT;AAAA,cACA,cAAY,UAAU;AAAA,cACtB,MAAK;AAAA,cACL;AAAA,cAEA;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAO,SAAS,MAAM,KAAK;AAAA,kBAC3B,QAAQ,SAAS,MAAM,KAAK;AAAA,kBAC5B,OAAO,CAAC,iBAAiB,KAAK;AAAA;AAAA,cAChC;AAAA;AAAA,UACF,IACE,MACN;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -6,33 +6,25 @@ import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text"
|
|
|
6
6
|
import { StyledSpanWithTooltip, StyledValuePillWrapper } from "../styled";
|
|
7
7
|
const ValuePill = React2.memo(
|
|
8
8
|
({ label, size, labelTruncated, disabled, tooltipValue, iconLeft, ariaLabel }) => {
|
|
9
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tabIndex: 0,
|
|
29
|
-
children: label
|
|
30
|
-
})
|
|
31
|
-
}) : /* @__PURE__ */ jsx(TextComponent, {
|
|
32
|
-
children: label
|
|
33
|
-
})
|
|
34
|
-
]
|
|
35
|
-
});
|
|
9
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: children }) : React2.Fragment;
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
11
|
+
StyledValuePillWrapper,
|
|
12
|
+
{
|
|
13
|
+
disabled,
|
|
14
|
+
size,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
className: "ds-pill-wrapper ds-pill-wrapper-value",
|
|
17
|
+
"data-testid": "ds-pill-wrapper",
|
|
18
|
+
"aria-label": ariaLabel || label,
|
|
19
|
+
cols: [iconLeft && "min-content", "auto"].filter((notFalse) => notFalse),
|
|
20
|
+
gutter: "xxxs",
|
|
21
|
+
hasIcon: iconLeft !== null,
|
|
22
|
+
children: [
|
|
23
|
+
iconLeft,
|
|
24
|
+
tooltipValue !== "" ? /* @__PURE__ */ jsx(DSTooltipV3, { text: tooltipValue, children: /* @__PURE__ */ jsx(StyledSpanWithTooltip, { className: "ds-pill-tooltip-value", tabIndex: 0, children: label }) }) : /* @__PURE__ */ jsx(TextComponent, { children: label })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
36
28
|
}
|
|
37
29
|
);
|
|
38
30
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/ValuePill.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { DSTooltipV3 } 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, disabled, tooltipValue, iconLeft, ariaLabel }) => {\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledValuePillWrapper\n disabled={disabled}\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 <DSTooltipV3 text={tooltipValue}>\n <StyledSpanWithTooltip className=\"ds-pill-tooltip-value\" tabIndex={0}>\n {label}\n </StyledSpanWithTooltip>\n </DSTooltipV3>\n ) : (\n <TextComponent>{label}</TextComponent>\n )}\n </StyledValuePillWrapper>\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACUG,cAIpB,YAJoB;AAT1B,OAAOA,YAAW;AAClB,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAE3C,SAAS,uBAAuB,8BAA8B;AAEvD,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,cAAc,UAAU,UAAU,MAAM;AAChF,UAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACUG,cAIpB,YAJoB;AAT1B,OAAOA,YAAW;AAClB,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAE3C,SAAS,uBAAuB,8BAA8B;AAEvD,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC,EAAE,OAAO,MAAM,gBAAgB,UAAU,cAAc,UAAU,UAAU,MAAM;AAChF,UAAM,gBAAgB,iBAClB,CAAC,EAAE,SAAS,MAAM,oBAAC,8BAA2B,OAAO,UAAU,IAC/DA,OAAM;AAEV,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAW;AAAA,QACX,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,cAAY,aAAa;AAAA,QACzB,MAAM,CAAC,YAAY,eAAe,MAAM,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,QACvE,QAAO;AAAA,QACP,SAAS,aAAa;AAAA,QAErB;AAAA;AAAA,UACA,iBAAiB,KAChB,oBAAC,eAAY,MAAM,cACjB,8BAAC,yBAAsB,WAAU,yBAAwB,UAAU,GAChE,iBACH,GACF,IAEA,oBAAC,iBAAe,iBAAM;AAAA;AAAA;AAAA,IAE1B;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|