@elliemae/ds-pills 3.4.2 → 3.4.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 +6 -3
- package/dist/cjs/components/Pill.js.map +1 -1
- package/dist/cjs/components/PillButton.js +9 -5
- package/dist/cjs/components/PillButton.js.map +1 -1
- package/dist/cjs/components/PillGroup.js +41 -29
- package/dist/cjs/components/PillGroup.js.map +2 -2
- package/dist/cjs/components/index.js +4 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/styled.js +4 -1
- package/dist/cjs/components/styled.js.map +2 -2
- package/dist/cjs/components/types/DropdownPill.js +61 -47
- package/dist/cjs/components/types/DropdownPill.js.map +2 -2
- package/dist/cjs/components/types/InputPill.js +68 -54
- package/dist/cjs/components/types/InputPill.js.map +2 -2
- package/dist/cjs/components/types/LabelPill.js +15 -5
- package/dist/cjs/components/types/LabelPill.js.map +2 -2
- package/dist/cjs/components/types/ReadOnlyPill.js +32 -19
- package/dist/cjs/components/types/ReadOnlyPill.js.map +2 -2
- package/dist/cjs/components/types/RemovablePill.js +68 -50
- package/dist/cjs/components/types/RemovablePill.js.map +2 -2
- package/dist/cjs/components/types/ValuePill.js +36 -22
- package/dist/cjs/components/types/ValuePill.js.map +2 -2
- package/dist/cjs/components/types/index.js +4 -1
- package/dist/cjs/components/types/index.js.map +1 -1
- package/dist/cjs/deprecated/DropdownPill.js +15 -10
- package/dist/cjs/deprecated/DropdownPill.js.map +1 -1
- package/dist/cjs/deprecated/InputPill.js +8 -5
- package/dist/cjs/deprecated/InputPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPills.js +25 -17
- package/dist/cjs/deprecated/LabeledDropdownPills.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +32 -25
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +68 -53
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +51 -37
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +2 -2
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +4 -1
- package/dist/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/dist/cjs/deprecated/LabeledPills.js +25 -16
- package/dist/cjs/deprecated/LabeledPills.js.map +1 -1
- package/dist/cjs/deprecated/OverflowPill.js +8 -4
- package/dist/cjs/deprecated/OverflowPill.js.map +1 -1
- package/dist/cjs/deprecated/Pill.js +30 -10
- package/dist/cjs/deprecated/Pill.js.map +1 -1
- package/dist/cjs/deprecated/PillGroup.js +15 -8
- package/dist/cjs/deprecated/PillGroup.js.map +1 -1
- package/dist/cjs/deprecated/ReadOnlyPill.js +44 -34
- package/dist/cjs/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/cjs/deprecated/RemovablePill.js +8 -4
- package/dist/cjs/deprecated/RemovablePill.js.map +1 -1
- package/dist/cjs/deprecated/index.js +4 -1
- package/dist/cjs/deprecated/index.js.map +1 -1
- package/dist/cjs/index.d.js +4 -1
- package/dist/cjs/index.d.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/props.js +4 -1
- package/dist/cjs/props.js.map +1 -1
- package/dist/cjs/utils.js +4 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/components/Pill.js +2 -2
- package/dist/esm/components/Pill.js.map +1 -1
- package/dist/esm/components/PillButton.js +5 -4
- package/dist/esm/components/PillButton.js.map +1 -1
- package/dist/esm/components/PillGroup.js +37 -28
- package/dist/esm/components/PillGroup.js.map +2 -2
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/styled.js.map +1 -1
- package/dist/esm/components/types/DropdownPill.js +57 -46
- package/dist/esm/components/types/DropdownPill.js.map +2 -2
- package/dist/esm/components/types/InputPill.js +64 -53
- package/dist/esm/components/types/InputPill.js.map +2 -2
- package/dist/esm/components/types/LabelPill.js +11 -4
- package/dist/esm/components/types/LabelPill.js.map +2 -2
- package/dist/esm/components/types/ReadOnlyPill.js +28 -18
- package/dist/esm/components/types/ReadOnlyPill.js.map +2 -2
- package/dist/esm/components/types/RemovablePill.js +64 -49
- package/dist/esm/components/types/RemovablePill.js.map +2 -2
- package/dist/esm/components/types/ValuePill.js +32 -21
- package/dist/esm/components/types/ValuePill.js.map +2 -2
- package/dist/esm/components/types/index.js.map +1 -1
- package/dist/esm/deprecated/DropdownPill.js +11 -9
- package/dist/esm/deprecated/DropdownPill.js.map +1 -1
- package/dist/esm/deprecated/InputPill.js +4 -4
- package/dist/esm/deprecated/InputPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPills.js +21 -16
- package/dist/esm/deprecated/LabeledDropdownPills.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +28 -24
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +64 -52
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +47 -36
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +2 -2
- package/dist/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +1 -1
- package/dist/esm/deprecated/LabeledPills.js +21 -15
- package/dist/esm/deprecated/LabeledPills.js.map +1 -1
- package/dist/esm/deprecated/OverflowPill.js +4 -3
- package/dist/esm/deprecated/OverflowPill.js.map +1 -1
- package/dist/esm/deprecated/Pill.js +26 -9
- package/dist/esm/deprecated/Pill.js.map +1 -1
- package/dist/esm/deprecated/PillGroup.js +11 -7
- package/dist/esm/deprecated/PillGroup.js.map +1 -1
- package/dist/esm/deprecated/ReadOnlyPill.js +40 -33
- package/dist/esm/deprecated/ReadOnlyPill.js.map +2 -2
- package/dist/esm/deprecated/RemovablePill.js +4 -3
- package/dist/esm/deprecated/RemovablePill.js.map +1 -1
- package/dist/esm/deprecated/index.js.map +2 -2
- package/dist/esm/index.d.js.map +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/props.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/package.json +15 -15
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["type refInterfaceType = React.MutableRefObject<HTMLElement> | ((_ref: HTMLElement) => void);\n\nexport const setMultipleRefs =\n (...refs: refInterfaceType[]) =>\n (_ref: HTMLElement): void => {\n refs.forEach((ref) => {\n if (!ref || !_ref) return;\n if (typeof ref === 'function') {\n ref(_ref);\n return;\n }\n if (ref) ref.current = _ref;\n });\n };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,kBACX,IAAI,SACJ,CAAC,SAA4B;AAC3B,OAAK,QAAQ,CAAC,QAAQ;AACpB,QAAI,CAAC,OAAO,CAAC;AAAM;AACnB,QAAI,OAAO,QAAQ,YAAY;AAC7B,UAAI,IAAI;AACR;AAAA,IACF;AACA,QAAI;AAAK,UAAI,UAAU;AAAA,EACzB,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-utilities";
|
|
4
4
|
import { DSPillV2DefaultProps, DSPillV2PropTypes } from "../props";
|
|
5
5
|
import { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from "./types";
|
|
@@ -16,7 +16,7 @@ const DSPillV2 = (props) => {
|
|
|
16
16
|
useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2PropTypes);
|
|
17
17
|
const { type } = propsWithDefaults;
|
|
18
18
|
const PillComponent = pillComponentGetter[type];
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(PillComponent, {
|
|
20
20
|
...propsWithDefaults
|
|
21
21
|
});
|
|
22
22
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Pill.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport type { DSPillProps } from '../index.d';\nimport { DSPillV2DefaultProps, DSPillV2PropTypes } from '../props';\nimport { DropdownPill, LabelPill, ValuePill, InputPill, ReadOnlyPill, RemovablePill } from './types';\n\nconst pillComponentGetter: Record<string, React.ComponentType<DSPillProps>> = {\n dropdown: DropdownPill,\n input: InputPill,\n label: LabelPill,\n readonly: ReadOnlyPill,\n removable: RemovablePill,\n value: ValuePill,\n};\n\nconst DSPillV2: React.ComponentType<DSPillProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillV2DefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2PropTypes);\n const { type } = propsWithDefaults;\n const PillComponent = pillComponentGetter[type];\n\n return <PillComponent {...propsWithDefaults} />;\n};\n\nDSPillV2.propTypes = DSPillV2PropTypes;\nDSPillV2.displayName = 'DSPillV2';\nconst DSPillV2WithSchema = describe(DSPillV2).description('Pill');\nDSPillV2WithSchema.propTypes = DSPillV2PropTypes;\n\nexport { DSPillV2, DSPillV2WithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAS,UAAU,8BAA8B,sCAAsC;AAEvF,SAAS,sBAAsB,yBAAyB;AACxD,SAAS,cAAc,WAAW,WAAW,WAAW,cAAc,qBAAqB;AAE3F,MAAM,sBAAwE;AAAA,EAC5E,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO;AACT;AAEA,MAAM,WAA6C,CAAC,UAAU;AAC5D,QAAM,oBAAoB,6BAA6B,OAAO,oBAAoB;AAClF,iCAA+B,mBAAmB,iBAAiB;AACnE,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,gBAAgB,oBAAoB;AAE1C,SAAO,oBAAC;AAAA,IAAe,GAAG;AAAA,GAAmB;AAC/C;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ,EAAE,YAAY,MAAM;AAChE,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-utilities";
|
|
4
4
|
import { StyledPillButton } from "./styled";
|
|
5
5
|
import { DSPillButtonDefaultProps, DSPillButtonPropTypes } from "../props";
|
|
@@ -12,11 +12,12 @@ const DSPillButton = (props) => {
|
|
|
12
12
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);
|
|
13
13
|
useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);
|
|
14
14
|
const { type, children, ...rest } = propsWithDefaults;
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(StyledPillButton, {
|
|
16
16
|
...rest,
|
|
17
17
|
buttonType: "raw",
|
|
18
|
-
className: `${typeToClassName[type]} ${rest.className}
|
|
19
|
-
|
|
18
|
+
className: `${typeToClassName[type]} ${rest.className}`,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
20
21
|
};
|
|
21
22
|
DSPillButton.propTypes = DSPillButtonPropTypes;
|
|
22
23
|
DSPillButton.displayName = "DSPillButton";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/PillButton.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { DSButtonPropsT } from '@elliemae/ds-button';\nimport { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { StyledPillButton } from './styled';\nimport { DSPillButtonDefaultProps, DSPillButtonPropTypes } from '../props';\n\nconst typeToClassName = {\n only: 'ds-pill-button-only',\n left: 'ds-pill-button-left',\n right: 'ds-pill-button-right',\n};\n\nconst DSPillButton: React.ComponentType<DSButtonPropsT> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillButtonDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonPropTypes);\n\n const { type, children, ...rest } = propsWithDefaults;\n\n return (\n <StyledPillButton {...rest} buttonType=\"raw\" className={`${typeToClassName[type]} ${rest.className}`}>\n {children}\n </StyledPillButton>\n );\n};\n\nDSPillButton.propTypes = DSPillButtonPropTypes;\nDSPillButton.displayName = 'DSPillButton';\nconst DSPillButtonWithSchema = describe(DSPillButton).description('Pill button');\nDSPillButtonWithSchema.propTypes = DSPillButtonPropTypes;\n\nexport { DSPillButton, DSPillButtonWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAGA,SAAS,UAAU,8BAA8B,sCAAsC;AACvF,SAAS,wBAAwB;AACjC,SAAS,0BAA0B,6BAA6B;AAEhE,MAAM,kBAAkB;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,eAAoD,CAAC,UAAU;AACnE,QAAM,oBAAoB,6BAA6B,OAAO,wBAAwB;AACtF,iCAA+B,mBAAmB,qBAAqB;AAEvE,QAAM,EAAE,MAAM,aAAa,KAAK,IAAI;AAEpC,SACE,oBAAC;AAAA,IAAkB,GAAG;AAAA,IAAM,YAAW;AAAA,IAAM,WAAW,GAAG,gBAAgB,SAAS,KAAK;AAAA,IACtF;AAAA,GACH;AAEJ;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY,EAAE,YAAY,aAAa;AAC/E,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import React2, { createContext, useCallback, useMemo } from "react";
|
|
3
4
|
import { uid } from "uid";
|
|
4
5
|
import {
|
|
@@ -19,35 +20,43 @@ const DSPillGroupV2 = (props) => {
|
|
|
19
20
|
const globalAttrs = useGetGlobalAttributes(propsWithDefaults);
|
|
20
21
|
const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);
|
|
21
22
|
const { children, width, innerRef } = propsWithDefaults;
|
|
22
|
-
const onKeyboardRemove = useCallback(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, [pillGroupUid]);
|
|
31
|
-
const onKeyboardNavigation = useCallback((pillUid, step, e) => {
|
|
32
|
-
const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)];
|
|
33
|
-
const pillIndex = elems.findIndex((elem) => elem.id === pillUid);
|
|
34
|
-
if (pillIndex >= 0) {
|
|
35
|
-
if (elems[pillIndex + step]) {
|
|
36
|
-
e.stopPropagation();
|
|
37
|
-
elems[pillIndex + step].focus();
|
|
23
|
+
const onKeyboardRemove = useCallback(
|
|
24
|
+
(pillUid) => {
|
|
25
|
+
const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)];
|
|
26
|
+
const pillIndex = elems.findIndex((elem) => elem.id === pillUid);
|
|
27
|
+
if (pillIndex > 0) {
|
|
28
|
+
elems[pillIndex - 1].focus();
|
|
29
|
+
} else if (pillIndex + 1 < elems.length) {
|
|
30
|
+
elems[pillIndex + 1].focus();
|
|
38
31
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
},
|
|
33
|
+
[pillGroupUid]
|
|
34
|
+
);
|
|
35
|
+
const onKeyboardNavigation = useCallback(
|
|
36
|
+
(pillUid, step, e) => {
|
|
37
|
+
const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)];
|
|
38
|
+
const pillIndex = elems.findIndex((elem) => elem.id === pillUid);
|
|
39
|
+
if (pillIndex >= 0) {
|
|
40
|
+
if (elems[pillIndex + step]) {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
elems[pillIndex + step].focus();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[pillGroupUid]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ jsx(DSPillGroupV2Context.Provider, {
|
|
49
|
+
value: { onKeyboardRemove, onKeyboardNavigation },
|
|
50
|
+
children: /* @__PURE__ */ jsx(StyledPillGroup, {
|
|
51
|
+
...globalAttrs,
|
|
52
|
+
width,
|
|
53
|
+
id: pillGroupUid,
|
|
54
|
+
cols: React2.Children.map(children, () => "auto"),
|
|
55
|
+
gutter: "2px",
|
|
56
|
+
ref: innerRef,
|
|
57
|
+
children
|
|
58
|
+
})
|
|
59
|
+
});
|
|
51
60
|
};
|
|
52
61
|
DSPillGroupV2.propTypes = DSPillGroupPropTypes;
|
|
53
62
|
DSPillGroupV2.displayName = "DSPillGroupV2";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/PillGroup.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { createContext, useCallback, useMemo, WeakValidationMap } from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\nimport { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props';\nimport { StyledPillGroup } from './styled';\n\nexport const DSPillGroupV2Context = createContext<{\n onKeyboardRemove: (pillUid: string) => void;\n onKeyboardNavigation: (pillUid: string, step: number, e: KeyboardEvent) => void;\n}>({\n onKeyboardRemove: () => null,\n onKeyboardNavigation: () => null,\n});\n\nconst DSPillGroupV2: React.ComponentType<DSPillGroupProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults);\n const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);\n const { children, width, innerRef } = propsWithDefaults;\n const onKeyboardRemove = useCallback(\n (pillUid: string) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex > 0) {\n elems[pillIndex - 1].focus();\n } else if (pillIndex + 1 < elems.length) {\n elems[pillIndex + 1].focus();\n }\n },\n [pillGroupUid],\n );\n const onKeyboardNavigation = useCallback(\n (pillUid: string, step: number, e: KeyboardEvent) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex >= 0) {\n if (elems[pillIndex + step]) {\n e.stopPropagation();\n elems[pillIndex + step].focus();\n }\n }\n },\n [pillGroupUid],\n );\n\n return (\n <DSPillGroupV2Context.Provider value={{ onKeyboardRemove, onKeyboardNavigation }}>\n <StyledPillGroup\n {...globalAttrs}\n width={width}\n id={pillGroupUid}\n cols={React.Children.map(children, () => 'auto')}\n gutter=\"2px\"\n ref={innerRef}\n >\n {children}\n </StyledPillGroup>\n </DSPillGroupV2Context.Provider>\n );\n};\n\nDSPillGroupV2.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\nDSPillGroupV2.displayName = 'DSPillGroupV2';\nconst DSPillGroupV2WithSchema = describe(DSPillGroupV2);\nDSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes as WeakValidationMap<unknown>;\n\nexport { DSPillGroupV2, DSPillGroupV2WithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,OAAOA,UAAS,eAAe,aAAa,eAAkC;AAC9E,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,yBAAyB,4BAA4B;AAC9D,SAAS,uBAAuB;AAEzB,MAAM,uBAAuB,cAGjC;AAAA,EACD,kBAAkB,MAAM;AAAA,EACxB,sBAAsB,MAAM;AAC9B,CAAC;AAED,MAAM,gBAAuD,CAAC,UAAU;AACtE,QAAM,oBAAoB,6BAA6B,OAAO,uBAAuB;AACrF,iCAA+B,mBAAmB,oBAAoB;AAEtE,QAAM,cAAc,uBAAuB,iBAAiB;AAC5D,QAAM,eAAe,QAAQ,MAAM,iBAAiB,IAAI,KAAK,CAAC,CAAC;AAC/D,QAAM,EAAE,UAAU,OAAO,SAAS,IAAI;AACtC,QAAM,mBAAmB;AAAA,IACvB,CAAC,YAAoB;AACnB,YAAM,QAAQ,CAAC,GAAG,SAAS,iBAAiB,IAAI,mCAAmC,CAAC;AAEpF,YAAM,YAAY,MAAM,UAAU,CAAC,SAAS,KAAK,OAAO,OAAO;AAE/D,UAAI,YAAY,GAAG;AACjB,cAAM,YAAY,GAAG,MAAM;AAAA,MAC7B,WAAW,YAAY,IAAI,MAAM,QAAQ;AACvC,cAAM,YAAY,GAAG,MAAM;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AACA,QAAM,uBAAuB;AAAA,IAC3B,CAAC,SAAiB,MAAc,MAAqB;AACnD,YAAM,QAAQ,CAAC,GAAG,SAAS,iBAAiB,IAAI,mCAAmC,CAAC;AAEpF,YAAM,YAAY,MAAM,UAAU,CAAC,SAAS,KAAK,OAAO,OAAO;AAE/D,UAAI,aAAa,GAAG;AAClB,YAAI,MAAM,YAAY,OAAO;AAC3B,YAAE,gBAAgB;AAClB,gBAAM,YAAY,MAAM,MAAM;AAAA,QAChC;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAEA,SACE,oBAAC,qBAAqB,UAArB;AAAA,IAA8B,OAAO,EAAE,kBAAkB,qBAAqB;AAAA,IAC7E,8BAAC;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,IAAI;AAAA,MACJ,MAAMA,OAAM,SAAS,IAAI,UAAU,MAAM,MAAM;AAAA,MAC/C,QAAO;AAAA,MACP,KAAK;AAAA,MAEJ;AAAA,KACH;AAAA,GACF;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Pill';\nexport * from './PillGroup';\nexport * from './PillButton';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/styled.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\n\ninterface InputPillWrapperProps {\n value: string;\n inputWidth: number;\n inputHasFocus: boolean;\n hasError: boolean;\n}\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nconst borderOutside = (color: string, size = 1, zIndex, borderRadius = '12px') => css`\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ${size}px solid ${({ disabled, theme }) => (disabled ? theme.colors.neutral[400] : color)};\n border-top-left-radius: ${borderRadius};\n border-top-right-radius: ${borderRadius};\n border-bottom-left-radius: ${borderRadius};\n border-bottom-right-radius: ${borderRadius};\n pointer-events: none;\n z-index: ${zIndex ? zIndex : ''};\n }\n`;\n\nconst commonPillWrapperCss = css<{ size: 'm' | 's' }>`\n height: ${(props) => (props?.size === 'm' ? '24px' : '18px')};\n\n position: relative;\n\n width: fit-content;\n\n background-color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['080'] : theme.colors.brand[200])};\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n user-select: ${({ disabled }) => (disabled ? 'none' : 'auto')};\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'default')};\n color: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['800'])};\n ${(props) => borderOutside(props.theme.colors.brand[300])};\n`;\n\n// =============================================================================\n// Pills wrappers\n// =============================================================================\n\nexport const StyledLabelPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledValuePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledInputPillWrapper = styled(Grid)<InputPillWrapperProps>`\n ${commonPillWrapperCss}\n\n background: ${(props) => props.theme.colors.neutral['000']};\n padding: 0;\n\n ${({ theme, hasError }) => {\n if (hasError) return borderOutside(theme.colors.danger[900]);\n return borderOutside(theme.colors.brand[500]);\n }}\n\n :focus-within {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '')}\n }\n\n :active {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '')}\n }\n\n & .em-ds-input {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n height: 100%;\n background: transparent;\n width: ${(props) => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`};\n padding: 0;\n margin: 0 0 0 8px;\n }\n\n & .em-ds-input__tooltip-ref {\n height: 100%;\n }\n`;\n\nexport const StyledDropdownPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n\n padding: 0 0 0 12px;\n`;\n\nexport const StyledReadonlyPillWrapper = styled(Grid)<{ hasIconRight: boolean; hasIconLeft: boolean }>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-right: ${(props) => (props.hasIconRight ? '0 !important' : '12px')};\n padding-left: ${(props) => (props.hasIconLeft ? '0 !important' : '12px')};\n`;\n\nexport const StyledRemovablePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding: 0 0 0 12px;\n`;\n\n// =============================================================================\n// Pill group\n// =============================================================================\n\nexport const StyledPillGroup = styled(Grid)`\n width: ${({ width }) => width};\n\n // Pill edges\n & .ds-pill-wrapper {\n &:not(:first-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n &:not(:last-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n\n // Pill paddings to the left / right\n & .ds-pill-wrapper-label,\n & .ds-pill-wrapper-value,\n & .ds-pill-wrapper-readonly {\n &:not(:first-of-type) {\n padding-left: 8px;\n }\n &:not(:last-of-type) {\n padding-right: 8px;\n }\n }\n\n & .ds-pill-wrapper-removable:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper-dropdown:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper {\n :not(:first-of-type) {\n .ds-pill-button-left {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n :not(:last-of-type) {\n .ds-pill-button-right {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n`;\n\n// =============================================================================\n// Extra stuff\n// =============================================================================\n\nexport const StyledSpanWithTooltip = styled.span`\n outline: none;\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}\n }\n`;\n\nexport const StyledPillButton = styled(DSButtonV2)<{ width: string; height: string }>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n width: ${(props) => props.width};\n height: ${(props) => props.height};\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 1, 'inherit')}\n }\n\n cursor: pointer;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React2, { useMemo, useRef } from "react";
|
|
3
4
|
import { DSDropdownMenuV2 } from "@elliemae/ds-common";
|
|
4
5
|
import { uid } from "uid";
|
|
@@ -7,52 +8,62 @@ import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text"
|
|
|
7
8
|
import { StyledDropdownPillWrapper } from "../styled";
|
|
8
9
|
import { setMultipleRefs } from "../../utils";
|
|
9
10
|
import { DSPillButton } from "../PillButton";
|
|
10
|
-
const DropdownPill = React2.memo(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
11
|
+
const DropdownPill = React2.memo(
|
|
12
|
+
({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
|
|
13
|
+
const chevronRef = useRef(null);
|
|
14
|
+
const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
|
|
15
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
16
|
+
value: children
|
|
17
|
+
}) : React2.Fragment;
|
|
18
|
+
return /* @__PURE__ */ jsxs(StyledDropdownPillWrapper, {
|
|
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, {
|
|
29
|
+
children: label
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ jsx(DSDropdownMenuV2, {
|
|
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(DSPillButton, {
|
|
50
|
+
className: "ds-pill-focus-point",
|
|
51
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
52
|
+
innerRef: setMultipleRefs(chevronRef, innerRef),
|
|
53
|
+
"aria-label": ariaLabel || label,
|
|
54
|
+
type: "right",
|
|
55
|
+
onClick: onDropdownClick,
|
|
56
|
+
children: /* @__PURE__ */ jsx(ChevronSmallDown, {
|
|
57
|
+
color: ["brand-primary", "800"],
|
|
58
|
+
width: 20,
|
|
59
|
+
height: 20
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
);
|
|
56
67
|
export {
|
|
57
68
|
DropdownPill
|
|
58
69
|
};
|
|
@@ -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 } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-common';\nimport { uid } from 'uid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledDropdownPillWrapper } from '../styled';\nimport type { DSPillProps } from '../../index.d';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const DropdownPill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {\n const chevronRef = useRef(null);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledDropdownPillWrapper\n size={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <TextComponent>{label}</TextComponent>\n <DSDropdownMenuV2\n placementOrderPreference={[\n 'bottom-start',\n 'bottom',\n 'bottom-end',\n 'right-end',\n 'top-start',\n 'top',\n 'top-end',\n ]}\n {...dropdownProps}\n onClickOutside={(e) => {\n if (e.code === 'Escape') chevronRef.current.focus();\n if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);\n }}\n wrapperStyles={{ w: '100%', h: '100%' }}\n >\n <DSPillButton\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-dropdown-chevron\"\n innerRef={setMultipleRefs(chevronRef, innerRef)}\n aria-label={ariaLabel || label}\n type=\"right\"\n onClick={onDropdownClick}\n >\n <ChevronSmallDown color={['brand-primary', '800']} width={20} height={20} />\n </DSPillButton>\n </DSDropdownMenuV2>\n </StyledDropdownPillWrapper>\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,OAAOA,UAAS,SAAS,cAAc;AACvC,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;AAAA,MAA2B,OAAO;AAAA,KAAU,IAC/DA,OAAM;AAEV,WACE,qBAAC;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,QAAO;AAAA,MACP,YAAW;AAAA,MACX,cAAa;AAAA,MAEb;AAAA,4BAAC;AAAA,UAAe;AAAA,SAAM;AAAA,QACtB,oBAAC;AAAA,UACC,0BAA0B;AAAA,YACxB;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACC,GAAG;AAAA,UACJ,gBAAgB,CAAC,MAAM;AACrB,gBAAI,EAAE,SAAS;AAAU,yBAAW,QAAQ,MAAM;AAClD,gBAAI,cAAc;AAAgB,4BAAc,eAAe,CAAC;AAAA,UAClE;AAAA,UACA,eAAe,EAAE,GAAG,QAAQ,GAAG,OAAO;AAAA,UAEtC,8BAAC;AAAA,YACC,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,UAAU,gBAAgB,YAAY,QAAQ;AAAA,YAC9C,cAAY,aAAa;AAAA,YACzB,MAAK;AAAA,YACL,SAAS;AAAA,YAET,8BAAC;AAAA,cAAiB,OAAO,CAAC,iBAAiB,KAAK;AAAA,cAAG,OAAO;AAAA,cAAI,QAAQ;AAAA,aAAI;AAAA,WAC5E;AAAA,SACF;AAAA;AAAA,KACF;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,66 +1,77 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React2, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { uid } from "uid";
|
|
4
5
|
import { CloseXsmall } from "@elliemae/ds-icons";
|
|
5
6
|
import { StyledInputPillWrapper } from "../styled";
|
|
6
7
|
import { setMultipleRefs } from "../../utils";
|
|
7
8
|
import { DSPillButton } from "../PillButton";
|
|
8
|
-
const InputPill = React2.memo(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
inputPlaceholder,
|
|
12
|
-
inputWidth,
|
|
13
|
-
inputRender,
|
|
14
|
-
onInputChange,
|
|
15
|
-
onInputClear,
|
|
16
|
-
innerRef,
|
|
17
|
-
hasError,
|
|
18
|
-
inputId
|
|
19
|
-
}) => {
|
|
20
|
-
const ref = useRef(null);
|
|
21
|
-
const InputComponent = useMemo(() => inputRender, [inputRender]);
|
|
22
|
-
const pillUid = useMemo(() => inputId ?? `ds-pill-${uid()}`, []);
|
|
23
|
-
const onCloseIconClick = useCallback((e) => {
|
|
24
|
-
if ([void 0, "Enter", "Space"].includes(e.code)) {
|
|
25
|
-
e.preventDefault();
|
|
26
|
-
onInputClear(e);
|
|
27
|
-
ref.current.focus();
|
|
28
|
-
}
|
|
29
|
-
}, [onInputClear]);
|
|
30
|
-
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
31
|
-
return /* @__PURE__ */ React2.createElement(StyledInputPillWrapper, {
|
|
9
|
+
const InputPill = React2.memo(
|
|
10
|
+
({
|
|
11
|
+
label,
|
|
32
12
|
size,
|
|
33
|
-
|
|
34
|
-
"data-testid": "ds-pill-wrapper",
|
|
35
|
-
cols: label === "" ? ["auto"] : ["auto", "24px"],
|
|
13
|
+
inputPlaceholder,
|
|
36
14
|
inputWidth,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, /* @__PURE__ */ React2.createElement(InputComponent, {
|
|
41
|
-
id: pillUid,
|
|
42
|
-
className: "ds-pill-focus-point",
|
|
43
|
-
"data-testid": "ds-pill-input",
|
|
44
|
-
innerRef: setMultipleRefs(ref, innerRef),
|
|
45
|
-
value: label,
|
|
46
|
-
onChange: onInputChange,
|
|
47
|
-
placeholder: inputPlaceholder,
|
|
48
|
-
onFocus: () => setInputHasFocus(true),
|
|
49
|
-
onBlur: () => setInputHasFocus(false),
|
|
50
|
-
disableTooltip: false
|
|
51
|
-
}), label !== "" && /* @__PURE__ */ React2.createElement(DSPillButton, {
|
|
52
|
-
id: pillUid,
|
|
53
|
-
"data-testid": "ds-pill-clear-icon",
|
|
15
|
+
inputRender,
|
|
16
|
+
onInputChange,
|
|
17
|
+
onInputClear,
|
|
54
18
|
innerRef,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
19
|
+
hasError,
|
|
20
|
+
inputId
|
|
21
|
+
}) => {
|
|
22
|
+
const ref = useRef(null);
|
|
23
|
+
const InputComponent = useMemo(() => inputRender, [inputRender]);
|
|
24
|
+
const pillUid = useMemo(() => inputId ?? `ds-pill-${uid()}`, []);
|
|
25
|
+
const onCloseIconClick = useCallback(
|
|
26
|
+
(e) => {
|
|
27
|
+
if ([void 0, "Enter", "Space"].includes(e.code)) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
onInputClear(e);
|
|
30
|
+
ref.current.focus();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[onInputClear]
|
|
34
|
+
);
|
|
35
|
+
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
36
|
+
return /* @__PURE__ */ jsxs(StyledInputPillWrapper, {
|
|
37
|
+
size,
|
|
38
|
+
className: "ds-pill-wrapper",
|
|
39
|
+
"data-testid": "ds-pill-wrapper",
|
|
40
|
+
cols: label === "" ? ["auto"] : ["auto", "24px"],
|
|
41
|
+
inputWidth,
|
|
42
|
+
value: label,
|
|
43
|
+
inputHasFocus,
|
|
44
|
+
hasError,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(InputComponent, {
|
|
47
|
+
id: pillUid,
|
|
48
|
+
className: "ds-pill-focus-point",
|
|
49
|
+
"data-testid": "ds-pill-input",
|
|
50
|
+
innerRef: setMultipleRefs(ref, innerRef),
|
|
51
|
+
value: label,
|
|
52
|
+
onChange: onInputChange,
|
|
53
|
+
placeholder: inputPlaceholder,
|
|
54
|
+
onFocus: () => setInputHasFocus(true),
|
|
55
|
+
onBlur: () => setInputHasFocus(false),
|
|
56
|
+
disableTooltip: false
|
|
57
|
+
}),
|
|
58
|
+
label !== "" && /* @__PURE__ */ jsx(DSPillButton, {
|
|
59
|
+
id: pillUid,
|
|
60
|
+
"data-testid": "ds-pill-clear-icon",
|
|
61
|
+
innerRef,
|
|
62
|
+
onClick: onCloseIconClick,
|
|
63
|
+
onKeyDown: onCloseIconClick,
|
|
64
|
+
"aria-label": "Clear input",
|
|
65
|
+
type: "right",
|
|
66
|
+
children: /* @__PURE__ */ jsx(CloseXsmall, {
|
|
67
|
+
size: "s",
|
|
68
|
+
color: ["brand-primary", "700"]
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
);
|
|
64
75
|
export {
|
|
65
76
|
InputPill
|
|
66
77
|
};
|
|
@@ -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}\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;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,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,qBAAC;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,MAAM,UAAU,KAAK,CAAC,MAAM,IAAI,CAAC,QAAQ,MAAM;AAAA,MAC/C;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC;AAAA,UACC,IAAI;AAAA,UACJ,WAAU;AAAA,UACV,eAAY;AAAA,UACZ,UAAU,gBAAgB,KAAK,QAAQ;AAAA,UACvC,OAAO;AAAA,UACP,UAAU;AAAA,UACV,aAAa;AAAA,UACb,SAAS,MAAM,iBAAiB,IAAI;AAAA,UACpC,QAAQ,MAAM,iBAAiB,KAAK;AAAA,UACpC,gBAAgB;AAAA,SAClB;AAAA,QACC,UAAU,MACT,oBAAC;AAAA,UACC,IAAI;AAAA,UACJ,eAAY;AAAA,UACZ;AAAA,UACA,SAAS;AAAA,UACT,WAAW;AAAA,UACX,cAAW;AAAA,UACX,MAAK;AAAA,UAEL,8BAAC;AAAA,YAAY,MAAK;AAAA,YAAI,OAAO,CAAC,iBAAiB,KAAK;AAAA,WAAG;AAAA,SACzD;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React2 from "react";
|
|
3
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
4
5
|
import { StyledLabelPillWrapper } from "../styled";
|
|
5
6
|
const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {
|
|
6
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */
|
|
7
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
7
8
|
value: children
|
|
8
9
|
}) : React2.Fragment;
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsxs(StyledLabelPillWrapper, {
|
|
10
11
|
size,
|
|
11
12
|
alignItems: "center",
|
|
12
13
|
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
@@ -14,8 +15,14 @@ const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabe
|
|
|
14
15
|
"aria-label": ariaLabel || label,
|
|
15
16
|
cols: [iconLeft && "min-content", "auto"].filter((notFalse) => notFalse),
|
|
16
17
|
gutter: "xxxs",
|
|
17
|
-
hasIcon: iconLeft !== null
|
|
18
|
-
|
|
18
|
+
hasIcon: iconLeft !== null,
|
|
19
|
+
children: [
|
|
20
|
+
iconLeft,
|
|
21
|
+
/* @__PURE__ */ jsx(TextComponent, {
|
|
22
|
+
children: label
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
});
|
|
19
26
|
});
|
|
20
27
|
export {
|
|
21
28
|
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;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,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;AAAA,IAA2B,OAAO;AAAA,GAAU,IAC/DA,OAAM;AACV,SACE,qBAAC;AAAA,IACC;AAAA,IACA,YAAW;AAAA,IACX,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,cAAY,aAAa;AAAA,IACzB,MAAM,CAAC,YAAY,eAAe,MAAM,EAAE,OAAO,CAAC,aAAa,QAAQ;AAAA,IACvE,QAAO;AAAA,IACP,SAAS,aAAa;AAAA,IAErB;AAAA;AAAA,MACD,oBAAC;AAAA,QAAe;AAAA,OAAM;AAAA;AAAA,GACxB;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React2 from "react";
|
|
3
4
|
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
4
5
|
import { StyledReadonlyPillWrapper } from "../styled";
|
|
5
|
-
const ReadOnlyPill = React2.memo(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
const ReadOnlyPill = React2.memo(
|
|
7
|
+
({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {
|
|
8
|
+
const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
|
|
9
|
+
const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
|
|
10
|
+
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, {
|
|
11
|
+
value: children
|
|
12
|
+
}) : React2.Fragment;
|
|
13
|
+
return /* @__PURE__ */ jsxs(StyledReadonlyPillWrapper, {
|
|
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, {
|
|
26
|
+
children: label
|
|
27
|
+
}) : null,
|
|
28
|
+
iconRight
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
);
|
|
23
33
|
export {
|
|
24
34
|
ReadOnlyPill
|
|
25
35
|
};
|