@elliemae/ds-chip 3.5.0-rc.9 → 3.6.0-next.0
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/DSChip.js +35 -22
- package/dist/cjs/DSChip.js.map +2 -2
- package/dist/esm/DSChip.js +35 -22
- package/dist/esm/DSChip.js.map +2 -2
- package/package.json +5 -5
package/dist/cjs/DSChip.js
CHANGED
|
@@ -29,14 +29,17 @@ __export(DSChip_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(DSChip_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
var import_react = require("react");
|
|
33
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
35
|
var import_ds_tooltip = require("@elliemae/ds-tooltip");
|
|
35
36
|
var import_useConfig = require("./config/useConfig");
|
|
36
37
|
var import_styles = require("./styles");
|
|
37
38
|
var import_constants = require("./constants");
|
|
38
39
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
39
|
-
const EmptyComp = (props) => /* @__PURE__ */
|
|
40
|
+
const EmptyComp = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledChildrenWrapper, {
|
|
41
|
+
children: props.children
|
|
42
|
+
});
|
|
40
43
|
const DSChip = (props) => {
|
|
41
44
|
const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = (0, import_useConfig.useConfig)(props);
|
|
42
45
|
const { shape: shapeGlobal, type, disabled, ...restGlobals } = globalAttrs;
|
|
@@ -45,27 +48,37 @@ const DSChip = (props) => {
|
|
|
45
48
|
const stopPropagation = (e) => {
|
|
46
49
|
e.stopPropagation();
|
|
47
50
|
};
|
|
48
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledWrapper, {
|
|
49
52
|
buttonShape: shape,
|
|
50
|
-
buttonSize: size
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
buttonSize: size,
|
|
54
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConditionalTooltip, {
|
|
55
|
+
text: label,
|
|
56
|
+
onMouseDown: stopPropagation,
|
|
57
|
+
onTouchStart: stopPropagation,
|
|
58
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledChip, {
|
|
59
|
+
"aria-disabled": disabled,
|
|
60
|
+
disabled,
|
|
61
|
+
ref: innerRef,
|
|
62
|
+
selected,
|
|
63
|
+
role: "button",
|
|
64
|
+
...restGlobals,
|
|
65
|
+
...xStyledAttrs,
|
|
66
|
+
children: [
|
|
67
|
+
shape === import_constants.CHIP_SHAPES.ROUND ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledRoundShape, {
|
|
68
|
+
disabled,
|
|
69
|
+
size,
|
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {})
|
|
71
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {}),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledChipLabel, {
|
|
73
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledSpanWithEllipsis, {
|
|
74
|
+
ref: setElement,
|
|
75
|
+
children: label
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
69
82
|
};
|
|
70
83
|
DSChip.propTypes = import_react_desc_prop_types.DSChipPropTypes;
|
|
71
84
|
DSChip.displayName = "DSChip";
|
package/dist/cjs/DSChip.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSChip.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { describe, useIsShowingEllipsis } from '@elliemae/ds-utilities';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useConfig } from './config/useConfig';\nimport {\n StyledChip,\n StyledChipLabel,\n StyledChildrenWrapper,\n StyledWrapper,\n StyledRoundShape,\n StyledSpanWithEllipsis,\n} from './styles';\nimport { CHIP_SHAPES } from './constants';\nimport { DSChipT, DSChipPropTypes } from './react-desc-prop-types';\n\nconst EmptyComp: typeof DSTooltipV3 = (props) => <StyledChildrenWrapper>{props.children}</StyledChildrenWrapper>;\n\nconst DSChip: React.ComponentType<DSChipT.Props> = (props) => {\n const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);\n\n const { shape: shapeGlobal, type, disabled, ...restGlobals } = globalAttrs;\n\n const { setElement, isShowingEllipsis } = useIsShowingEllipsis();\n\n const ConditionalTooltip = useMemo(() => (isShowingEllipsis ? DSTooltipV3 : EmptyComp), [isShowingEllipsis]);\n\n const stopPropagation = (e: React.MouseEvent | React.TouchEvent) => {\n e.stopPropagation();\n };\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size}>\n <ConditionalTooltip text={label} onMouseDown={stopPropagation} onTouchStart={stopPropagation}>\n <StyledChip\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n {...xStyledAttrs}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel>\n <StyledSpanWithEllipsis ref={setElement}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </ConditionalTooltip>\n </StyledWrapper>\n );\n};\n\nDSChip.propTypes = DSChipPropTypes;\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypes;\n\nexport { DSChip, DSChipWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,0BAA+C;AAC/C,wBAA4B;AAC5B,uBAA0B;AAC1B,oBAOO;AACP,uBAA4B;AAC5B,mCAAyC;AAEzC,MAAM,YAAgC,CAAC,UAAU,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAA+B;AAC/B,0BAA+C;AAC/C,wBAA4B;AAC5B,uBAA0B;AAC1B,oBAOO;AACP,uBAA4B;AAC5B,mCAAyC;AAEzC,MAAM,YAAgC,CAAC,UAAU,4CAAC;AAAA,EAAuB,gBAAM;AAAA,CAAS;AAExF,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM,EAAE,MAAM,OAAO,UAAU,UAAU,MAAM,MAAM,OAAO,aAAa,aAAa,QAAI,4BAAU,KAAK;AAEzG,QAAM,EAAE,OAAO,aAAa,MAAM,aAAa,YAAY,IAAI;AAE/D,QAAM,EAAE,YAAY,kBAAkB,QAAI,0CAAqB;AAE/D,QAAM,yBAAqB,sBAAQ,MAAO,oBAAoB,gCAAc,WAAY,CAAC,iBAAiB,CAAC;AAE3G,QAAM,kBAAkB,CAAC,MAA2C;AAClE,MAAE,gBAAgB;AAAA,EACpB;AAEA,SACE,4CAAC;AAAA,IAAc,aAAa;AAAA,IAAO,YAAY;AAAA,IAC7C,sDAAC;AAAA,MAAmB,MAAM;AAAA,MAAO,aAAa;AAAA,MAAiB,cAAc;AAAA,MAC3E,uDAAC;AAAA,QACC,iBAAe;AAAA,QACf;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,oBAAU,6BAAY,QACrB,4CAAC;AAAA,YAAiB;AAAA,YAAoB;AAAA,YACpC,sDAAC,QAAK;AAAA,WACR,IAEA,4CAAC,QAAK;AAAA,UAER,4CAAC;AAAA,YACC,sDAAC;AAAA,cAAuB,KAAK;AAAA,cAAa;AAAA,aAAM;AAAA,WAClD;AAAA;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAEJ;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,uBAAmB,8BAAS,MAAM;AACxC,iBAAiB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSChip.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
3
4
|
import { describe, useIsShowingEllipsis } from "@elliemae/ds-utilities";
|
|
4
5
|
import { DSTooltipV3 } from "@elliemae/ds-tooltip";
|
|
5
6
|
import { useConfig } from "./config/useConfig";
|
|
@@ -13,7 +14,9 @@ import {
|
|
|
13
14
|
} from "./styles";
|
|
14
15
|
import { CHIP_SHAPES } from "./constants";
|
|
15
16
|
import { DSChipPropTypes } from "./react-desc-prop-types";
|
|
16
|
-
const EmptyComp = (props) => /* @__PURE__ */
|
|
17
|
+
const EmptyComp = (props) => /* @__PURE__ */ jsx(StyledChildrenWrapper, {
|
|
18
|
+
children: props.children
|
|
19
|
+
});
|
|
17
20
|
const DSChip = (props) => {
|
|
18
21
|
const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);
|
|
19
22
|
const { shape: shapeGlobal, type, disabled, ...restGlobals } = globalAttrs;
|
|
@@ -22,27 +25,37 @@ const DSChip = (props) => {
|
|
|
22
25
|
const stopPropagation = (e) => {
|
|
23
26
|
e.stopPropagation();
|
|
24
27
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsx(StyledWrapper, {
|
|
26
29
|
buttonShape: shape,
|
|
27
|
-
buttonSize: size
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
buttonSize: size,
|
|
31
|
+
children: /* @__PURE__ */ jsx(ConditionalTooltip, {
|
|
32
|
+
text: label,
|
|
33
|
+
onMouseDown: stopPropagation,
|
|
34
|
+
onTouchStart: stopPropagation,
|
|
35
|
+
children: /* @__PURE__ */ jsxs(StyledChip, {
|
|
36
|
+
"aria-disabled": disabled,
|
|
37
|
+
disabled,
|
|
38
|
+
ref: innerRef,
|
|
39
|
+
selected,
|
|
40
|
+
role: "button",
|
|
41
|
+
...restGlobals,
|
|
42
|
+
...xStyledAttrs,
|
|
43
|
+
children: [
|
|
44
|
+
shape === CHIP_SHAPES.ROUND ? /* @__PURE__ */ jsx(StyledRoundShape, {
|
|
45
|
+
disabled,
|
|
46
|
+
size,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
48
|
+
}) : /* @__PURE__ */ jsx(Icon, {}),
|
|
49
|
+
/* @__PURE__ */ jsx(StyledChipLabel, {
|
|
50
|
+
children: /* @__PURE__ */ jsx(StyledSpanWithEllipsis, {
|
|
51
|
+
ref: setElement,
|
|
52
|
+
children: label
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
46
59
|
};
|
|
47
60
|
DSChip.propTypes = DSChipPropTypes;
|
|
48
61
|
DSChip.displayName = "DSChip";
|
package/dist/esm/DSChip.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSChip.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { describe, useIsShowingEllipsis } from '@elliemae/ds-utilities';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { useConfig } from './config/useConfig';\nimport {\n StyledChip,\n StyledChipLabel,\n StyledChildrenWrapper,\n StyledWrapper,\n StyledRoundShape,\n StyledSpanWithEllipsis,\n} from './styles';\nimport { CHIP_SHAPES } from './constants';\nimport { DSChipT, DSChipPropTypes } from './react-desc-prop-types';\n\nconst EmptyComp: typeof DSTooltipV3 = (props) => <StyledChildrenWrapper>{props.children}</StyledChildrenWrapper>;\n\nconst DSChip: React.ComponentType<DSChipT.Props> = (props) => {\n const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);\n\n const { shape: shapeGlobal, type, disabled, ...restGlobals } = globalAttrs;\n\n const { setElement, isShowingEllipsis } = useIsShowingEllipsis();\n\n const ConditionalTooltip = useMemo(() => (isShowingEllipsis ? DSTooltipV3 : EmptyComp), [isShowingEllipsis]);\n\n const stopPropagation = (e: React.MouseEvent | React.TouchEvent) => {\n e.stopPropagation();\n };\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size}>\n <ConditionalTooltip text={label} onMouseDown={stopPropagation} onTouchStart={stopPropagation}>\n <StyledChip\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n {...xStyledAttrs}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel>\n <StyledSpanWithEllipsis ref={setElement}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </ConditionalTooltip>\n </StyledWrapper>\n );\n};\n\nDSChip.propTypes = DSChipPropTypes;\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypes;\n\nexport { DSChip, DSChipWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,eAAe;AAC/B,SAAS,UAAU,4BAA4B;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAkB,uBAAuB;AAEzC,MAAM,YAAgC,CAAC,UAAU,oBAAC;AAAA,EAAuB,gBAAM;AAAA,CAAS;AAExF,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM,EAAE,MAAM,OAAO,UAAU,UAAU,MAAM,MAAM,OAAO,aAAa,aAAa,IAAI,UAAU,KAAK;AAEzG,QAAM,EAAE,OAAO,aAAa,MAAM,aAAa,YAAY,IAAI;AAE/D,QAAM,EAAE,YAAY,kBAAkB,IAAI,qBAAqB;AAE/D,QAAM,qBAAqB,QAAQ,MAAO,oBAAoB,cAAc,WAAY,CAAC,iBAAiB,CAAC;AAE3G,QAAM,kBAAkB,CAAC,MAA2C;AAClE,MAAE,gBAAgB;AAAA,EACpB;AAEA,SACE,oBAAC;AAAA,IAAc,aAAa;AAAA,IAAO,YAAY;AAAA,IAC7C,8BAAC;AAAA,MAAmB,MAAM;AAAA,MAAO,aAAa;AAAA,MAAiB,cAAc;AAAA,MAC3E,+BAAC;AAAA,QACC,iBAAe;AAAA,QACf;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QACH,GAAG;AAAA,QAEH;AAAA,oBAAU,YAAY,QACrB,oBAAC;AAAA,YAAiB;AAAA,YAAoB;AAAA,YACpC,8BAAC,QAAK;AAAA,WACR,IAEA,oBAAC,QAAK;AAAA,UAER,oBAAC;AAAA,YACC,8BAAC;AAAA,cAAuB,KAAK;AAAA,cAAa;AAAA,aAAM;AAAA,WAClD;AAAA;AAAA,OACF;AAAA,KACF;AAAA,GACF;AAEJ;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chip",
|
|
6
6
|
"files": [
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"indent": 4
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-system": "3.
|
|
67
|
-
"@elliemae/ds-tooltip": "3.
|
|
68
|
-
"@elliemae/ds-utilities": "3.
|
|
66
|
+
"@elliemae/ds-system": "3.6.0-next.0",
|
|
67
|
+
"@elliemae/ds-tooltip": "3.6.0-next.0",
|
|
68
|
+
"@elliemae/ds-utilities": "3.6.0-next.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@elliemae/ds-icons": "3.
|
|
71
|
+
"@elliemae/ds-icons": "3.6.0-next.0",
|
|
72
72
|
"@testing-library/jest-dom": "~5.16.4",
|
|
73
73
|
"@testing-library/react": "~12.1.3",
|
|
74
74
|
"styled-components": "~5.3.5"
|