@elliemae/ds-chip 3.16.0 → 3.16.1
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 +8 -4
- package/dist/cjs/DSChip.js.map +2 -2
- package/dist/cjs/config/useConfig.js +6 -2
- package/dist/cjs/config/useConfig.js.map +2 -2
- package/dist/cjs/constants.js +4 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/exported_related/data-test-ids.js +4 -0
- package/dist/cjs/exported_related/data-test-ids.js.map +1 -1
- package/dist/cjs/exported_related/index.js +6 -2
- package/dist/cjs/exported_related/index.js.map +2 -2
- package/dist/cjs/exported_related/theming.js +4 -0
- package/dist/cjs/exported_related/theming.js.map +1 -1
- package/dist/cjs/index.js +7 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +5 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js +4 -0
- package/dist/cjs/sharedTypes.js.map +2 -2
- package/dist/cjs/styles.js +61 -57
- package/dist/cjs/styles.js.map +2 -2
- package/dist/esm/DSChip.js +4 -4
- package/dist/esm/DSChip.js.map +2 -2
- package/dist/esm/config/useConfig.js +2 -2
- package/dist/esm/config/useConfig.js.map +1 -1
- package/dist/esm/exported_related/index.js +2 -2
- package/dist/esm/exported_related/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +1 -1
- package/dist/esm/styles.js +57 -57
- package/dist/esm/styles.js.map +2 -2
- package/dist/types/DSChip.d.ts +2 -2
- package/dist/types/config/useConfig.d.ts +3 -3
- package/dist/types/exported_related/index.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/sharedTypes.d.ts +1 -1
- package/dist/types/styles.d.ts +2 -2
- package/package.json +7 -7
package/dist/cjs/DSChip.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -31,10 +35,10 @@ module.exports = __toCommonJS(DSChip_exports);
|
|
|
31
35
|
var React = __toESM(require("react"));
|
|
32
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
|
-
var import_useConfig = require("./config/useConfig");
|
|
35
|
-
var import_styles = require("./styles");
|
|
36
|
-
var import_constants = require("./constants");
|
|
37
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
38
|
+
var import_useConfig = require("./config/useConfig.js");
|
|
39
|
+
var import_styles = require("./styles.js");
|
|
40
|
+
var import_constants = require("./constants.js");
|
|
41
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
38
42
|
const DSChip = (props) => {
|
|
39
43
|
const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = (0, import_useConfig.useConfig)(props);
|
|
40
44
|
const { shape: shapeGlobal, type, disabled, className, ...restGlobals } = globalAttrs;
|
package/dist/cjs/DSChip.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSChip.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useConfig } from './config/useConfig';\nimport { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from './styles';\nimport { CHIP_SHAPES } from './constants';\nimport type { DSChipT } from './react-desc-prop-types';\nimport { DSChipPropTypes } from './react-desc-prop-types';\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, className, ...restGlobals } = globalAttrs;\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size}>\n <StyledSpanWithEllipsis>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\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": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useConfig } from './config/useConfig.js';\nimport { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from './styles.js';\nimport { CHIP_SHAPES } from './constants.js';\nimport type { DSChipT } from './react-desc-prop-types.js';\nimport { DSChipPropTypes } from './react-desc-prop-types.js';\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, className, ...restGlobals } = globalAttrs;\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size}>\n <StyledSpanWithEllipsis>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\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;ADejB;AAdN,8BAAyB;AACzB,uBAA0B;AAC1B,oBAAqG;AACrG,uBAA4B;AAE5B,mCAAgC;AAEhC,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,UAAU,WAAW,GAAG,YAAY,IAAI;AAE1E,SACE,4CAAC,+BAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAC7E;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe;AAAA,MACf;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA,MAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,kBAAU,6BAAY,QACrB,4CAAC,kCAAiB,UAAoB,MACpC,sDAAC,QAAK,GACR,IAEA,4CAAC,QAAK;AAAA,QAER,4CAAC,iCAAgB,MACf,sDAAC,wCAAwB,iBAAM,GACjC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,uBAAmB,kCAAS,MAAM;AACxC,iBAAiB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -29,8 +33,8 @@ __export(useConfig_exports, {
|
|
|
29
33
|
module.exports = __toCommonJS(useConfig_exports);
|
|
30
34
|
var React = __toESM(require("react"));
|
|
31
35
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
32
|
-
var import_exported_related = require("../exported_related");
|
|
33
|
-
var import_react_desc_prop_types = require("../react-desc-prop-types");
|
|
36
|
+
var import_exported_related = require("../exported_related/index.js");
|
|
37
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
34
38
|
const useConfig = (props) => {
|
|
35
39
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
36
40
|
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.DSChipPropTypes, import_exported_related.DSChipName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useConfig.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../exported_related';\nimport type { DSChipT } from '../react-desc-prop-types';\nimport { defaultProps, DSChipPropTypes } from '../react-desc-prop-types';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSChipT.InternalProps>>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../exported_related/index.js';\nimport type { DSChipT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSChipPropTypes } from '../react-desc-prop-types.js';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSChipT.InternalProps>>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAKO;AACP,8BAA2B;AAE3B,mCAA8C;AAEvC,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,uBAAmB,sDAA8D,OAAO,yCAAY;AAE1G,8DAA+B,kBAAkB,8CAAiB,kCAAU;AAC5E,QAAM,kBAAc,gDAAuB,gBAAgB;AAC3D,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,EAAE,GAAG,kBAAkB,aAAa,aAAa;AAC1D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const CHIP_SHAPES = {\n DEFAULT: 'default' as const,\n ROUND: 'round' as const,\n};\n\nexport const CHIP_SIZES = {\n S: 's' as const,\n L: 'l' as const,\n};\n\nexport const roundShapeLarge = '56px';\nexport const roundShapeSmall = '40px';\n\nexport const basicSizes = {\n s: {\n width: '72px',\n height: '67px',\n } as const,\n l: {\n width: '92px',\n height: '67px',\n } as const,\n};\n\nexport const shapeSizes = {\n s: {\n width: '72px',\n height: '77px',\n } as const,\n l: {\n width: '92px',\n height: '85px',\n } as const,\n};\n\nexport const ChipSizesValuesArray = Object.values(CHIP_SIZES);\nexport const ChipShapesValuesArray = Object.values(CHIP_SHAPES);\nexport const ChipInteractionStates = ['hover', 'focus', 'active'];\n\nexport const ChipSizesValuesString = JSON.stringify(ChipSizesValuesArray);\nexport const ChipShapesValuesString = JSON.stringify(ChipShapesValuesArray);\nexport const ChipInteractionStatesValuesString = JSON.stringify(ChipInteractionStates);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,OAAO;AACT;AAEO,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,kBAAkB;AACxB,MAAM,kBAAkB;AAExB,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,uBAAuB,OAAO,OAAO,UAAU;AACrD,MAAM,wBAAwB,OAAO,OAAO,WAAW;AACvD,MAAM,wBAAwB,CAAC,SAAS,SAAS,QAAQ;AAEzD,MAAM,wBAAwB,KAAK,UAAU,oBAAoB;AACjE,MAAM,yBAAyB,KAAK,UAAU,qBAAqB;AACnE,MAAM,oCAAoC,KAAK,UAAU,qBAAqB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported_related/data-test-ids.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const DSChipDataTestIds = {\n BUTTON: 'ds-chip-button',\n LABEL: 'ds-chip-label',\n ROUND_SHAPE: 'ds-chip-round-shape',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oBAAoB;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AACf;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,6 +15,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
17
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
18
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
23
|
mod
|
|
20
24
|
));
|
|
@@ -22,6 +26,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
26
|
var exported_related_exports = {};
|
|
23
27
|
module.exports = __toCommonJS(exported_related_exports);
|
|
24
28
|
var React = __toESM(require("react"));
|
|
25
|
-
__reExport(exported_related_exports, require("./data-test-ids"), module.exports);
|
|
26
|
-
__reExport(exported_related_exports, require("./theming"), module.exports);
|
|
29
|
+
__reExport(exported_related_exports, require("./data-test-ids.js"), module.exports);
|
|
30
|
+
__reExport(exported_related_exports, require("./theming.js"), module.exports);
|
|
27
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported_related/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './data-test-ids';\nexport * from './theming';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './data-test-ids.js';\nexport * from './theming.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,qCAAc,+BAAd;AACA,qCAAc,yBADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported_related/theming.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const DSChipName = 'DSChip';\n\nexport const DSChipSlots = {\n BUTTON: 'root',\n LABEL: 'label',\n ROUND_SHAPE: 'round-shape',\n CHILDREN_WRAPPER: 'children-wrapper',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa;AAEnB,MAAM,cAAc;AAAA,EACzB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,kBAAkB;AACpB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,6 +15,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
17
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
18
22
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
19
23
|
mod
|
|
20
24
|
));
|
|
@@ -22,7 +26,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
26
|
var src_exports = {};
|
|
23
27
|
module.exports = __toCommonJS(src_exports);
|
|
24
28
|
var React = __toESM(require("react"));
|
|
25
|
-
__reExport(src_exports, require("./DSChip"), module.exports);
|
|
26
|
-
__reExport(src_exports, require("./constants"), module.exports);
|
|
27
|
-
__reExport(src_exports, require("./exported_related"), module.exports);
|
|
29
|
+
__reExport(src_exports, require("./DSChip.js"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./constants.js"), module.exports);
|
|
31
|
+
__reExport(src_exports, require("./exported_related/index.js"), module.exports);
|
|
28
32
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './DSChip';\nexport * from './constants';\nexport * from './exported_related';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './DSChip.js';\nexport * from './constants.js';\nexport * from './exported_related/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,wBAAd;AACA,wBAAc,2BADd;AAEA,wBAAc,wCAFd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -30,7 +34,7 @@ __export(react_desc_prop_types_exports, {
|
|
|
30
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
31
35
|
var React = __toESM(require("react"));
|
|
32
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
|
-
var import_constants = require("./constants");
|
|
37
|
+
var import_constants = require("./constants.js");
|
|
34
38
|
const defaultProps = {
|
|
35
39
|
size: import_constants.CHIP_SIZES.L,
|
|
36
40
|
shape: import_constants.CHIP_SHAPES.DEFAULT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n} from './constants';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n }\n interface OptionalProps {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n interface RequiredProps {\n label: string;\n icon: () => JSX.Element;\n }\n export interface InternalProps extends OptionalProps, Partial<DefaultProps>, RequiredProps {}\n export interface Props\n extends Omit<GlobalAttributesT<HTMLButtonElement>, keyof InternalProps>,\n InternalProps,\n XstyledProps {}\n}\n\nexport const DSChipPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n icon: PropTypes.func.isRequired.description('Chip Icon').defaultValue(() => {}),\n label: PropTypes.string.isRequired.description('Chip Label').defaultValue(''),\n selected: PropTypes.bool.description('Whether chip is selected').defaultValue(''),\n shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),\n size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n} from './constants.js';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes.js';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n }\n interface OptionalProps {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n interface RequiredProps {\n label: string;\n icon: () => JSX.Element;\n }\n export interface InternalProps extends OptionalProps, Partial<DefaultProps>, RequiredProps {}\n export interface Props\n extends Omit<GlobalAttributesT<HTMLButtonElement>, keyof InternalProps>,\n InternalProps,\n XstyledProps {}\n}\n\nexport const DSChipPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n icon: PropTypes.func.isRequired.description('Chip Icon').defaultValue(() => {}),\n label: PropTypes.string.isRequired.description('Chip Label').defaultValue(''),\n selected: PropTypes.bool.description('Whether chip is selected').defaultValue(''),\n shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),\n size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,8BAAuE;AACvE,uBAOO;AAGA,MAAM,eAAqC;AAAA,EAChD,MAAM,4BAAW;AAAA,EACjB,OAAO,6BAAY;AACrB;AAuBO,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,kCAAU,KAAK,WAAW,YAAY,WAAW,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC9E,OAAO,kCAAU,OAAO,WAAW,YAAY,YAAY,EAAE,aAAa,EAAE;AAAA,EAC5E,UAAU,kCAAU,KAAK,YAAY,0BAA0B,EAAE,aAAa,EAAE;AAAA,EAChF,OAAO,kCAAU,MAAM,sCAAqB,EAAE,YAAY,uCAAsB,EAAE,aAAa,6BAAY,OAAO;AAAA,EAClH,MAAM,kCAAU,MAAM,qCAAoB,EAAE,YAAY,sCAAqB,EAAE,aAAa,4BAAW,CAAC;AAAA,EACxG,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAChH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/sharedTypes.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sharedTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { CHIP_SIZES, CHIP_SHAPES, ChipInteractionStates } from './constants';\n\nexport type ChipSizesT = (typeof CHIP_SIZES)[keyof typeof CHIP_SIZES];\n\nexport type ChipShapesT = (typeof CHIP_SHAPES)[keyof typeof CHIP_SHAPES];\n\nexport type ChipInteractionStatesT = (typeof ChipInteractionStates)[number];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { CHIP_SIZES, CHIP_SHAPES, ChipInteractionStates } from './constants.js';\n\nexport type ChipSizesT = (typeof CHIP_SIZES)[keyof typeof CHIP_SIZES];\n\nexport type ChipShapesT = (typeof CHIP_SHAPES)[keyof typeof CHIP_SHAPES];\n\nexport type ChipInteractionStatesT = (typeof ChipInteractionStates)[number];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -34,30 +38,9 @@ __export(styles_exports, {
|
|
|
34
38
|
module.exports = __toCommonJS(styles_exports);
|
|
35
39
|
var React = __toESM(require("react"));
|
|
36
40
|
var import_ds_system = require("@elliemae/ds-system");
|
|
37
|
-
var import_constants = require("./constants");
|
|
38
|
-
var import_exported_related = require("./exported_related");
|
|
41
|
+
var import_constants = require("./constants.js");
|
|
42
|
+
var import_exported_related = require("./exported_related/index.js");
|
|
39
43
|
const getChipSize = (shape) => shape === import_constants.CHIP_SHAPES.ROUND ? import_constants.shapeSizes : import_constants.basicSizes;
|
|
40
|
-
const styledChipSelectedCss = import_ds_system.css`
|
|
41
|
-
& > div:first-child {
|
|
42
|
-
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
43
|
-
}
|
|
44
|
-
color: ${({ theme }) => theme.colors.brand[800]};
|
|
45
|
-
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
46
|
-
|
|
47
|
-
.DSIcon-svg {
|
|
48
|
-
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:before {
|
|
52
|
-
border: 1px solid ${({ theme }) => theme.colors.brand[600]};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&:focus {
|
|
56
|
-
&:before {
|
|
57
|
-
border: 2px solid ${({ theme }) => theme.colors.brand[800]};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
44
|
const StyledChipLabel = (0, import_ds_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.LABEL })`
|
|
62
45
|
font-size: ${({ theme }) => theme.fontSizes.label[200]};
|
|
63
46
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
@@ -83,6 +66,51 @@ const StyledWrapper = (0, import_ds_system.styled)("div")`
|
|
|
83
66
|
width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};
|
|
84
67
|
${import_ds_system.xStyledCommonProps}
|
|
85
68
|
`;
|
|
69
|
+
const disabledRoundShape = import_ds_system.css`
|
|
70
|
+
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
71
|
+
|
|
72
|
+
& .DSIcon-root .DSIcon-svg {
|
|
73
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const StyledRoundShape = (0, import_ds_system.styled)("div", {
|
|
77
|
+
name: import_exported_related.DSChipName,
|
|
78
|
+
slot: import_exported_related.DSChipSlots.ROUND_SHAPE
|
|
79
|
+
})`
|
|
80
|
+
background-color: ${({ theme }) => theme.colors.brand[600]};
|
|
81
|
+
width: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
82
|
+
height: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
83
|
+
border-radius: 50px;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
margin-top: ${({ size }) => size === import_constants.CHIP_SIZES.L ? "5px" : "10px"};
|
|
88
|
+
`;
|
|
89
|
+
const StyledChildrenWrapper = (0, import_ds_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.CHILDREN_WRAPPER })`
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
`;
|
|
93
|
+
const styledChipSelectedCss = import_ds_system.css`
|
|
94
|
+
${StyledRoundShape} {
|
|
95
|
+
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
96
|
+
}
|
|
97
|
+
color: ${({ theme }) => theme.colors.brand[800]};
|
|
98
|
+
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
99
|
+
|
|
100
|
+
.DSIcon-svg {
|
|
101
|
+
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:before {
|
|
105
|
+
border: 1px solid ${({ theme }) => theme.colors.brand[600]};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:focus {
|
|
109
|
+
&:before {
|
|
110
|
+
border: 2px solid ${({ theme }) => theme.colors.brand[800]};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
86
114
|
const StyledChip = (0, import_ds_system.styled)("button", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.BUTTON })`
|
|
87
115
|
position: relative;
|
|
88
116
|
display: flex;
|
|
@@ -100,6 +128,14 @@ const StyledChip = (0, import_ds_system.styled)("button", { name: import_exporte
|
|
|
100
128
|
cursor: pointer;
|
|
101
129
|
outline: none;
|
|
102
130
|
|
|
131
|
+
${StyledRoundShape} {
|
|
132
|
+
& .DSIcon-root .DSIcon-svg {
|
|
133
|
+
fill: #fff;
|
|
134
|
+
height: 24px;
|
|
135
|
+
width: 24px;
|
|
136
|
+
}
|
|
137
|
+
${({ disabled }) => disabled && disabledRoundShape}
|
|
138
|
+
}
|
|
103
139
|
&:before {
|
|
104
140
|
content: '';
|
|
105
141
|
position: absolute;
|
|
@@ -140,7 +176,7 @@ const StyledChip = (0, import_ds_system.styled)("button", { name: import_exporte
|
|
|
140
176
|
}
|
|
141
177
|
|
|
142
178
|
&:hover {
|
|
143
|
-
|
|
179
|
+
${StyledRoundShape} {
|
|
144
180
|
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
145
181
|
}
|
|
146
182
|
color: ${({ theme }) => theme.colors.brand[800]};
|
|
@@ -166,7 +202,7 @@ const StyledChip = (0, import_ds_system.styled)("button", { name: import_exporte
|
|
|
166
202
|
|
|
167
203
|
&:focus,
|
|
168
204
|
&:hover {
|
|
169
|
-
|
|
205
|
+
${StyledRoundShape} {
|
|
170
206
|
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
171
207
|
}
|
|
172
208
|
background-color: #fff;
|
|
@@ -187,36 +223,4 @@ const StyledChip = (0, import_ds_system.styled)("button", { name: import_exporte
|
|
|
187
223
|
|
|
188
224
|
${({ selected }) => !selected ? "" : styledChipSelectedCss}
|
|
189
225
|
`;
|
|
190
|
-
const disabledRoundShape = import_ds_system.css`
|
|
191
|
-
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
192
|
-
|
|
193
|
-
& .DSIcon-root .DSIcon-svg {
|
|
194
|
-
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
195
|
-
}
|
|
196
|
-
`;
|
|
197
|
-
const StyledRoundShape = (0, import_ds_system.styled)("div", {
|
|
198
|
-
name: import_exported_related.DSChipName,
|
|
199
|
-
slot: import_exported_related.DSChipSlots.ROUND_SHAPE
|
|
200
|
-
})`
|
|
201
|
-
background-color: ${({ theme }) => theme.colors.brand[600]};
|
|
202
|
-
width: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
203
|
-
height: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
204
|
-
border-radius: 50px;
|
|
205
|
-
display: flex;
|
|
206
|
-
align-items: center;
|
|
207
|
-
justify-content: center;
|
|
208
|
-
margin-top: ${({ size }) => size === import_constants.CHIP_SIZES.L ? "5px" : "10px"};
|
|
209
|
-
|
|
210
|
-
& .DSIcon-root .DSIcon-svg {
|
|
211
|
-
fill: #fff;
|
|
212
|
-
height: 24px;
|
|
213
|
-
width: 24px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
${({ disabled }) => disabled && disabledRoundShape}
|
|
217
|
-
`;
|
|
218
|
-
const StyledChildrenWrapper = (0, import_ds_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.CHILDREN_WRAPPER })`
|
|
219
|
-
width: 100%;
|
|
220
|
-
height: 100%;
|
|
221
|
-
`;
|
|
222
226
|
//# sourceMappingURL=styles.js.map
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes';\nimport { DSChipName, DSChipSlots } from './exported_related';\n\nexport interface StyledChipPropsT {\n buttonSize: ChipSizesT;\n buttonShape: ChipShapesT;\n selected?: boolean;\n}\n\nexport interface StyledRoundShapePropsT {\n size: ChipSizesT;\n disabled?: boolean;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants.js';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes.js';\nimport { DSChipName, DSChipSlots } from './exported_related/index.js';\n\nexport interface StyledChipPropsT {\n buttonSize: ChipSizesT;\n buttonShape: ChipShapesT;\n selected?: boolean;\n}\n\nexport interface StyledRoundShapePropsT {\n size: ChipSizesT;\n disabled?: boolean;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\nexport const StyledChipLabel = styled('div', { name: DSChipName, slot: DSChipSlots.LABEL })<{ size: ChipSizesT }>`\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n word-wrap: break-word;\n text-align: center;\n padding: ${({ size }) => (size === CHIP_SIZES.L ? '2px' : '4px')} 6px 6px 6px;\n z-index: 0;\n line-height: 1.27;\n width: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledSpanWithEllipsis = styled.span`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledWrapper = styled('div')<StyledChipPropsT>`\n display: flex;\n height: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].height};\n width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};\n ${xStyledCommonProps}\n`;\n\nconst disabledRoundShape = css`\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledRoundShape = styled('div', {\n name: DSChipName,\n slot: DSChipSlots.ROUND_SHAPE,\n})<StyledRoundShapePropsT>`\n background-color: ${({ theme }) => theme.colors.brand[600]};\n width: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n height: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n border-radius: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: ${({ size }) => (size === CHIP_SIZES.L ? '5px' : '10px')};\n`;\n\nexport const StyledChildrenWrapper = styled('div', { name: DSChipName, slot: DSChipSlots.CHILDREN_WRAPPER })`\n width: 100%;\n height: 100%;\n`;\n\nconst styledChipSelectedCss = css`\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n\n &:before {\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n }\n\n &:focus {\n &:before {\n border: 2px solid ${({ theme }) => theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledChip = styled('button', { name: DSChipName, slot: DSChipSlots.BUTTON })<\n Pick<StyledChipPropsT, 'selected' | 'buttonShape'>\n>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0;\n padding-top: ${(props) => (props.buttonShape === CHIP_SHAPES.ROUND ? '0' : '10px')};\n border: none;\n min-height: 100%;\n height: fit-content;\n width: 100%;\n background-color: #fff;\n color: ${({ theme }) => theme.colors.brand[600]};\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n\n ${StyledRoundShape} {\n & .DSIcon-root .DSIcon-svg {\n fill: #fff;\n height: 24px;\n width: 24px;\n }\n ${({ disabled }) => disabled && disabledRoundShape}\n }\n &:before {\n content: '';\n position: absolute;\n z-index: 20;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n pointer-events: none;\n }\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 24px;\n width: 24px;\n }\n\n & .DSIcon-root {\n height: 24px;\n width: 24px;\n }\n\n &:hover,\n &:focus {\n z-index: 10;\n\n ${StyledChipLabel} {\n text-align: left;\n }\n\n ${StyledSpanWithEllipsis} {\n overflow-wrap: break-word;\n white-space: pre-wrap;\n overflow: visible;\n }\n }\n\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:focus {\n &:before {\n border-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:disabled {\n color: ${({ theme }) => theme.colors.neutral[500]};\n cursor: not-allowed;\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &:focus,\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n }\n background-color: #fff;\n cursor: not-allowed;\n &:before {\n border-color: transparent;\n }\n\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n ${({ selected }) => (!selected ? '' : styledChipSelectedCss)}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAgD;AAChD,uBAAkG;AAElG,8BAAwC;AAaxC,MAAM,cAAc,CAAC,UAAwB,UAAU,6BAAY,QAAQ,8BAAa;AAEjF,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,oCAAY,MAAM,oCAAY,MAAM,CAAC;AAAA,eAC3E,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA,iBACtC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA;AAAA;AAAA,aAGrC,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASrD,MAAM,yBAAyB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtC,MAAM,oBAAgB,yBAAO,KAAK;AAAA;AAAA,YAE7B,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE;AAAA,WACvE,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE;AAAA,IAC7E;AAAA;AAGJ,MAAM,qBAAqB;AAAA,sBACL,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA,YAGjD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAI5C,MAAM,uBAAmB,yBAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,oCAAY;AACpB,CAAC;AAAA,sBACqB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,WAChD,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,mCAAkB;AAAA,YACxD,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,mCAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKrD,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,QAAQ;AAAA;AAGxD,MAAM,4BAAwB,yBAAO,OAAO,EAAE,MAAM,oCAAY,MAAM,oCAAY,iBAAiB,CAAC;AAAA;AAAA;AAAA;AAK3G,MAAM,wBAAwB;AAAA,IAC1B;AAAA,wBACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,WAElD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,sBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,YAG/C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA,wBAIzB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,0BAKnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAKxD,MAAM,iBAAa,yBAAO,UAAU,EAAE,MAAM,oCAAY,MAAM,oCAAY,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQxE,CAAC,UAAW,MAAM,gBAAgB,6BAAY,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMlE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,IAK5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAME,CAAC,EAAE,SAAS,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAgBxB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAc3C;AAAA;AAAA;AAAA;AAAA,MAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQA;AAAA,0BACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,aAElD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,wBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,cAE/C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAM7B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA,cAItC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,QAK7C;AAAA,4BACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQ3D;AAAA,iBACS,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,cAK1C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA,IAIjD,CAAC,EAAE,SAAS,MAAO,CAAC,WAAW,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSChip.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import { useConfig } from "./config/useConfig";
|
|
5
|
-
import { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from "./styles";
|
|
6
|
-
import { CHIP_SHAPES } from "./constants";
|
|
7
|
-
import { DSChipPropTypes } from "./react-desc-prop-types";
|
|
4
|
+
import { useConfig } from "./config/useConfig.js";
|
|
5
|
+
import { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from "./styles.js";
|
|
6
|
+
import { CHIP_SHAPES } from "./constants.js";
|
|
7
|
+
import { DSChipPropTypes } from "./react-desc-prop-types.js";
|
|
8
8
|
const DSChip = (props) => {
|
|
9
9
|
const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);
|
|
10
10
|
const { shape: shapeGlobal, type, disabled, className, ...restGlobals } = globalAttrs;
|
package/dist/esm/DSChip.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSChip.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useConfig } from './config/useConfig';\nimport { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from './styles';\nimport { CHIP_SHAPES } from './constants';\nimport type { DSChipT } from './react-desc-prop-types';\nimport { DSChipPropTypes } from './react-desc-prop-types';\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, className, ...restGlobals } = globalAttrs;\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size}>\n <StyledSpanWithEllipsis>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\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;ACejB,SAWM,KAXN;AAdN,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,iBAAiB,eAAe,kBAAkB,8BAA8B;AACrG,SAAS,mBAAmB;AAE5B,SAAS,uBAAuB;AAEhC,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,UAAU,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useConfig } from './config/useConfig.js';\nimport { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from './styles.js';\nimport { CHIP_SHAPES } from './constants.js';\nimport type { DSChipT } from './react-desc-prop-types.js';\nimport { DSChipPropTypes } from './react-desc-prop-types.js';\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, className, ...restGlobals } = globalAttrs;\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size}>\n <StyledSpanWithEllipsis>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\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;ACejB,SAWM,KAXN;AAdN,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,iBAAiB,eAAe,kBAAkB,8BAA8B;AACrG,SAAS,mBAAmB;AAE5B,SAAS,uBAAuB;AAEhC,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,UAAU,WAAW,GAAG,YAAY,IAAI;AAE1E,SACE,oBAAC,iBAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAC7E;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe;AAAA,MACf;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA,MAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,kBAAU,YAAY,QACrB,oBAAC,oBAAiB,UAAoB,MACpC,8BAAC,QAAK,GACR,IAEA,oBAAC,QAAK;AAAA,QAER,oBAAC,mBAAgB,MACf,8BAAC,0BAAwB,iBAAM,GACjC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
useValidateTypescriptPropTypes,
|
|
6
6
|
useGetXstyledProps
|
|
7
7
|
} from "@elliemae/ds-props-helpers";
|
|
8
|
-
import { DSChipName } from "../exported_related";
|
|
9
|
-
import { defaultProps, DSChipPropTypes } from "../react-desc-prop-types";
|
|
8
|
+
import { DSChipName } from "../exported_related/index.js";
|
|
9
|
+
import { defaultProps, DSChipPropTypes } from "../react-desc-prop-types.js";
|
|
10
10
|
const useConfig = (props) => {
|
|
11
11
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
12
12
|
useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfig.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../exported_related';\nimport type { DSChipT } from '../react-desc-prop-types';\nimport { defaultProps, DSChipPropTypes } from '../react-desc-prop-types';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSChipT.InternalProps>>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../exported_related/index.js';\nimport type { DSChipT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSChipPropTypes } from '../react-desc-prop-types.js';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSChipT.InternalProps>>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAE3B,SAAS,cAAc,uBAAuB;AAEvC,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,mBAAmB,6BAA8D,OAAO,YAAY;AAE1G,iCAA+B,kBAAkB,iBAAiB,UAAU;AAC5E,QAAM,cAAc,uBAAuB,gBAAgB;AAC3D,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAO,EAAE,GAAG,kBAAkB,aAAa,aAAa;AAC1D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported_related/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './data-test-ids';\nexport * from './theming';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './data-test-ids.js';\nexport * from './theming.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export * from "./DSChip";
|
|
3
|
-
export * from "./constants";
|
|
4
|
-
export * from "./exported_related";
|
|
2
|
+
export * from "./DSChip.js";
|
|
3
|
+
export * from "./constants.js";
|
|
4
|
+
export * from "./exported_related/index.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSChip';\nexport * from './constants';\nexport * from './exported_related';\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSChip.js';\nexport * from './constants.js';\nexport * from './exported_related/index.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n} from './constants';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n }\n interface OptionalProps {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n interface RequiredProps {\n label: string;\n icon: () => JSX.Element;\n }\n export interface InternalProps extends OptionalProps, Partial<DefaultProps>, RequiredProps {}\n export interface Props\n extends Omit<GlobalAttributesT<HTMLButtonElement>, keyof InternalProps>,\n InternalProps,\n XstyledProps {}\n}\n\nexport const DSChipPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n icon: PropTypes.func.isRequired.description('Chip Icon').defaultValue(() => {}),\n label: PropTypes.string.isRequired.description('Chip Label').defaultValue(''),\n selected: PropTypes.bool.description('Whether chip is selected').defaultValue(''),\n shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),\n size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as WeakValidationMap<unknown>;\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n} from './constants.js';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes.js';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n }\n interface OptionalProps {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n interface RequiredProps {\n label: string;\n icon: () => JSX.Element;\n }\n export interface InternalProps extends OptionalProps, Partial<DefaultProps>, RequiredProps {}\n export interface Props\n extends Omit<GlobalAttributesT<HTMLButtonElement>, keyof InternalProps>,\n InternalProps,\n XstyledProps {}\n}\n\nexport const DSChipPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n icon: PropTypes.func.isRequired.description('Chip Icon').defaultValue(() => {}),\n label: PropTypes.string.isRequired.description('Chip Label').defaultValue(''),\n selected: PropTypes.bool.description('Whether chip is selected').defaultValue(''),\n shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),\n size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,MAAM,eAAqC;AAAA,EAChD,MAAM,WAAW;AAAA,EACjB,OAAO,YAAY;AACrB;AAuBO,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,KAAK,WAAW,YAAY,WAAW,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC9E,OAAO,UAAU,OAAO,WAAW,YAAY,YAAY,EAAE,aAAa,EAAE;AAAA,EAC5E,UAAU,UAAU,KAAK,YAAY,0BAA0B,EAAE,aAAa,EAAE;AAAA,EAChF,OAAO,UAAU,MAAM,qBAAqB,EAAE,YAAY,sBAAsB,EAAE,aAAa,YAAY,OAAO;AAAA,EAClH,MAAM,UAAU,MAAM,oBAAoB,EAAE,YAAY,qBAAqB,EAAE,aAAa,WAAW,CAAC;AAAA,EACxG,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAChH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled, css, xStyledCommonProps } from "@elliemae/ds-system";
|
|
3
|
-
import { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from "./constants";
|
|
4
|
-
import { DSChipName, DSChipSlots } from "./exported_related";
|
|
3
|
+
import { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from "./constants.js";
|
|
4
|
+
import { DSChipName, DSChipSlots } from "./exported_related/index.js";
|
|
5
5
|
const getChipSize = (shape) => shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes;
|
|
6
|
-
const styledChipSelectedCss = css`
|
|
7
|
-
& > div:first-child {
|
|
8
|
-
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
9
|
-
}
|
|
10
|
-
color: ${({ theme }) => theme.colors.brand[800]};
|
|
11
|
-
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
12
|
-
|
|
13
|
-
.DSIcon-svg {
|
|
14
|
-
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&:before {
|
|
18
|
-
border: 1px solid ${({ theme }) => theme.colors.brand[600]};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&:focus {
|
|
22
|
-
&:before {
|
|
23
|
-
border: 2px solid ${({ theme }) => theme.colors.brand[800]};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
6
|
const StyledChipLabel = styled("div", { name: DSChipName, slot: DSChipSlots.LABEL })`
|
|
28
7
|
font-size: ${({ theme }) => theme.fontSizes.label[200]};
|
|
29
8
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
@@ -49,6 +28,51 @@ const StyledWrapper = styled("div")`
|
|
|
49
28
|
width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};
|
|
50
29
|
${xStyledCommonProps}
|
|
51
30
|
`;
|
|
31
|
+
const disabledRoundShape = css`
|
|
32
|
+
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
33
|
+
|
|
34
|
+
& .DSIcon-root .DSIcon-svg {
|
|
35
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const StyledRoundShape = styled("div", {
|
|
39
|
+
name: DSChipName,
|
|
40
|
+
slot: DSChipSlots.ROUND_SHAPE
|
|
41
|
+
})`
|
|
42
|
+
background-color: ${({ theme }) => theme.colors.brand[600]};
|
|
43
|
+
width: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
|
|
44
|
+
height: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
|
|
45
|
+
border-radius: 50px;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
margin-top: ${({ size }) => size === CHIP_SIZES.L ? "5px" : "10px"};
|
|
50
|
+
`;
|
|
51
|
+
const StyledChildrenWrapper = styled("div", { name: DSChipName, slot: DSChipSlots.CHILDREN_WRAPPER })`
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
`;
|
|
55
|
+
const styledChipSelectedCss = css`
|
|
56
|
+
${StyledRoundShape} {
|
|
57
|
+
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
58
|
+
}
|
|
59
|
+
color: ${({ theme }) => theme.colors.brand[800]};
|
|
60
|
+
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
61
|
+
|
|
62
|
+
.DSIcon-svg {
|
|
63
|
+
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:before {
|
|
67
|
+
border: 1px solid ${({ theme }) => theme.colors.brand[600]};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:focus {
|
|
71
|
+
&:before {
|
|
72
|
+
border: 2px solid ${({ theme }) => theme.colors.brand[800]};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
52
76
|
const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON })`
|
|
53
77
|
position: relative;
|
|
54
78
|
display: flex;
|
|
@@ -66,6 +90,14 @@ const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON
|
|
|
66
90
|
cursor: pointer;
|
|
67
91
|
outline: none;
|
|
68
92
|
|
|
93
|
+
${StyledRoundShape} {
|
|
94
|
+
& .DSIcon-root .DSIcon-svg {
|
|
95
|
+
fill: #fff;
|
|
96
|
+
height: 24px;
|
|
97
|
+
width: 24px;
|
|
98
|
+
}
|
|
99
|
+
${({ disabled }) => disabled && disabledRoundShape}
|
|
100
|
+
}
|
|
69
101
|
&:before {
|
|
70
102
|
content: '';
|
|
71
103
|
position: absolute;
|
|
@@ -106,7 +138,7 @@ const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON
|
|
|
106
138
|
}
|
|
107
139
|
|
|
108
140
|
&:hover {
|
|
109
|
-
|
|
141
|
+
${StyledRoundShape} {
|
|
110
142
|
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
111
143
|
}
|
|
112
144
|
color: ${({ theme }) => theme.colors.brand[800]};
|
|
@@ -132,7 +164,7 @@ const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON
|
|
|
132
164
|
|
|
133
165
|
&:focus,
|
|
134
166
|
&:hover {
|
|
135
|
-
|
|
167
|
+
${StyledRoundShape} {
|
|
136
168
|
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
137
169
|
}
|
|
138
170
|
background-color: #fff;
|
|
@@ -153,38 +185,6 @@ const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON
|
|
|
153
185
|
|
|
154
186
|
${({ selected }) => !selected ? "" : styledChipSelectedCss}
|
|
155
187
|
`;
|
|
156
|
-
const disabledRoundShape = css`
|
|
157
|
-
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
158
|
-
|
|
159
|
-
& .DSIcon-root .DSIcon-svg {
|
|
160
|
-
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
161
|
-
}
|
|
162
|
-
`;
|
|
163
|
-
const StyledRoundShape = styled("div", {
|
|
164
|
-
name: DSChipName,
|
|
165
|
-
slot: DSChipSlots.ROUND_SHAPE
|
|
166
|
-
})`
|
|
167
|
-
background-color: ${({ theme }) => theme.colors.brand[600]};
|
|
168
|
-
width: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
|
|
169
|
-
height: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
|
|
170
|
-
border-radius: 50px;
|
|
171
|
-
display: flex;
|
|
172
|
-
align-items: center;
|
|
173
|
-
justify-content: center;
|
|
174
|
-
margin-top: ${({ size }) => size === CHIP_SIZES.L ? "5px" : "10px"};
|
|
175
|
-
|
|
176
|
-
& .DSIcon-root .DSIcon-svg {
|
|
177
|
-
fill: #fff;
|
|
178
|
-
height: 24px;
|
|
179
|
-
width: 24px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
${({ disabled }) => disabled && disabledRoundShape}
|
|
183
|
-
`;
|
|
184
|
-
const StyledChildrenWrapper = styled("div", { name: DSChipName, slot: DSChipSlots.CHILDREN_WRAPPER })`
|
|
185
|
-
width: 100%;
|
|
186
|
-
height: 100%;
|
|
187
|
-
`;
|
|
188
188
|
export {
|
|
189
189
|
StyledChildrenWrapper,
|
|
190
190
|
StyledChip,
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes';\nimport { DSChipName, DSChipSlots } from './exported_related';\n\nexport interface StyledChipPropsT {\n buttonSize: ChipSizesT;\n buttonShape: ChipShapesT;\n selected?: boolean;\n}\n\nexport interface StyledRoundShapePropsT {\n size: ChipSizesT;\n disabled?: boolean;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,KAAK,0BAA0B;AAChD,SAAS,YAAY,YAAY,aAAa,YAAY,iBAAiB,uBAAuB;AAElG,SAAS,YAAY,mBAAmB;AAaxC,MAAM,cAAc,CAAC,UAAwB,UAAU,YAAY,QAAQ,aAAa;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants.js';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes.js';\nimport { DSChipName, DSChipSlots } from './exported_related/index.js';\n\nexport interface StyledChipPropsT {\n buttonSize: ChipSizesT;\n buttonShape: ChipShapesT;\n selected?: boolean;\n}\n\nexport interface StyledRoundShapePropsT {\n size: ChipSizesT;\n disabled?: boolean;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\nexport const StyledChipLabel = styled('div', { name: DSChipName, slot: DSChipSlots.LABEL })<{ size: ChipSizesT }>`\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n word-wrap: break-word;\n text-align: center;\n padding: ${({ size }) => (size === CHIP_SIZES.L ? '2px' : '4px')} 6px 6px 6px;\n z-index: 0;\n line-height: 1.27;\n width: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledSpanWithEllipsis = styled.span`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledWrapper = styled('div')<StyledChipPropsT>`\n display: flex;\n height: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].height};\n width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};\n ${xStyledCommonProps}\n`;\n\nconst disabledRoundShape = css`\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledRoundShape = styled('div', {\n name: DSChipName,\n slot: DSChipSlots.ROUND_SHAPE,\n})<StyledRoundShapePropsT>`\n background-color: ${({ theme }) => theme.colors.brand[600]};\n width: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n height: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n border-radius: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: ${({ size }) => (size === CHIP_SIZES.L ? '5px' : '10px')};\n`;\n\nexport const StyledChildrenWrapper = styled('div', { name: DSChipName, slot: DSChipSlots.CHILDREN_WRAPPER })`\n width: 100%;\n height: 100%;\n`;\n\nconst styledChipSelectedCss = css`\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n\n &:before {\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n }\n\n &:focus {\n &:before {\n border: 2px solid ${({ theme }) => theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledChip = styled('button', { name: DSChipName, slot: DSChipSlots.BUTTON })<\n Pick<StyledChipPropsT, 'selected' | 'buttonShape'>\n>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0;\n padding-top: ${(props) => (props.buttonShape === CHIP_SHAPES.ROUND ? '0' : '10px')};\n border: none;\n min-height: 100%;\n height: fit-content;\n width: 100%;\n background-color: #fff;\n color: ${({ theme }) => theme.colors.brand[600]};\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n\n ${StyledRoundShape} {\n & .DSIcon-root .DSIcon-svg {\n fill: #fff;\n height: 24px;\n width: 24px;\n }\n ${({ disabled }) => disabled && disabledRoundShape}\n }\n &:before {\n content: '';\n position: absolute;\n z-index: 20;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n pointer-events: none;\n }\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 24px;\n width: 24px;\n }\n\n & .DSIcon-root {\n height: 24px;\n width: 24px;\n }\n\n &:hover,\n &:focus {\n z-index: 10;\n\n ${StyledChipLabel} {\n text-align: left;\n }\n\n ${StyledSpanWithEllipsis} {\n overflow-wrap: break-word;\n white-space: pre-wrap;\n overflow: visible;\n }\n }\n\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:focus {\n &:before {\n border-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:disabled {\n color: ${({ theme }) => theme.colors.neutral[500]};\n cursor: not-allowed;\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &:focus,\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n }\n background-color: #fff;\n cursor: not-allowed;\n &:before {\n border-color: transparent;\n }\n\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n ${({ selected }) => (!selected ? '' : styledChipSelectedCss)}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,KAAK,0BAA0B;AAChD,SAAS,YAAY,YAAY,aAAa,YAAY,iBAAiB,uBAAuB;AAElG,SAAS,YAAY,mBAAmB;AAaxC,MAAM,cAAc,CAAC,UAAwB,UAAU,YAAY,QAAQ,aAAa;AAEjF,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,YAAY,MAAM,YAAY,MAAM,CAAC;AAAA,eAC3E,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG;AAAA,iBACtC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA;AAAA;AAAA,aAGrC,CAAC,EAAE,KAAK,MAAO,SAAS,WAAW,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASrD,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtC,MAAM,gBAAgB,OAAO,KAAK;AAAA;AAAA,YAE7B,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE;AAAA,WACvE,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE;AAAA,IAC7E;AAAA;AAGJ,MAAM,qBAAqB;AAAA,sBACL,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA,YAGjD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAI5C,MAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,YAAY;AACpB,CAAC;AAAA,sBACqB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,WAChD,CAAC,EAAE,KAAK,MAAO,SAAS,WAAW,IAAI,kBAAkB;AAAA,YACxD,CAAC,EAAE,KAAK,MAAO,SAAS,WAAW,IAAI,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKrD,CAAC,EAAE,KAAK,MAAO,SAAS,WAAW,IAAI,QAAQ;AAAA;AAGxD,MAAM,wBAAwB,OAAO,OAAO,EAAE,MAAM,YAAY,MAAM,YAAY,iBAAiB,CAAC;AAAA;AAAA;AAAA;AAK3G,MAAM,wBAAwB;AAAA,IAC1B;AAAA,wBACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,WAElD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,sBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,YAG/C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA,wBAIzB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,0BAKnC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAKxD,MAAM,aAAa,OAAO,UAAU,EAAE,MAAM,YAAY,MAAM,YAAY,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQxE,CAAC,UAAW,MAAM,gBAAgB,YAAY,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMlE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,IAK5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAME,CAAC,EAAE,SAAS,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAgBxB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAc3C;AAAA;AAAA;AAAA;AAAA,MAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQA;AAAA,0BACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,aAElD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA,wBAC1B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,cAE/C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAM7B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA,cAItC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,QAK7C;AAAA,4BACoB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQ3D;AAAA,iBACS,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,cAK1C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA,IAIjD,CAAC,EAAE,SAAS,MAAO,CAAC,WAAW,KAAK;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/DSChip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { DSChipT } from './react-desc-prop-types';
|
|
2
|
+
import type { DSChipT } from './react-desc-prop-types.js';
|
|
3
3
|
declare const DSChip: React.ComponentType<DSChipT.Props>;
|
|
4
|
-
declare const DSChipWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<DSChipT.Props>;
|
|
4
|
+
declare const DSChipWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChipT.Props>;
|
|
5
5
|
export { DSChip, DSChipWithSchema };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { DSChipT } from '../react-desc-prop-types';
|
|
2
|
+
import type { DSChipT } from '../react-desc-prop-types.js';
|
|
3
3
|
export declare const useConfig: (props: DSChipT.Props) => {
|
|
4
4
|
globalAttrs: import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>;
|
|
5
5
|
xStyledAttrs: import("@elliemae/ds-props-helpers").XstyledProps;
|
|
6
6
|
selected: boolean;
|
|
7
7
|
innerRef: import("react").RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);
|
|
8
|
-
size: import("../sharedTypes").ChipSizesT;
|
|
9
|
-
shape: import("../sharedTypes").ChipShapesT;
|
|
8
|
+
size: import("../sharedTypes.js").ChipSizesT;
|
|
9
|
+
shape: import("../sharedTypes.js").ChipShapesT;
|
|
10
10
|
label: string;
|
|
11
11
|
icon: () => JSX.Element;
|
|
12
12
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './data-test-ids';
|
|
2
|
-
export * from './theming';
|
|
1
|
+
export * from './data-test-ids.js';
|
|
2
|
+
export * from './theming.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './DSChip';
|
|
2
|
-
export * from './constants';
|
|
3
|
-
export * from './exported_related';
|
|
1
|
+
export * from './DSChip.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './exported_related/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CHIP_SIZES, CHIP_SHAPES, ChipInteractionStates } from './constants';
|
|
1
|
+
import type { CHIP_SIZES, CHIP_SHAPES, ChipInteractionStates } from './constants.js';
|
|
2
2
|
export type ChipSizesT = (typeof CHIP_SIZES)[keyof typeof CHIP_SIZES];
|
|
3
3
|
export type ChipShapesT = (typeof CHIP_SHAPES)[keyof typeof CHIP_SHAPES];
|
|
4
4
|
export type ChipInteractionStatesT = (typeof ChipInteractionStates)[number];
|
package/dist/types/styles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChipShapesT, ChipSizesT } from './sharedTypes';
|
|
1
|
+
import type { ChipShapesT, ChipSizesT } from './sharedTypes.js';
|
|
2
2
|
export interface StyledChipPropsT {
|
|
3
3
|
buttonSize: ChipSizesT;
|
|
4
4
|
buttonShape: ChipShapesT;
|
|
@@ -13,6 +13,6 @@ export declare const StyledChipLabel: import("styled-components").StyledComponen
|
|
|
13
13
|
}, never>;
|
|
14
14
|
export declare const StyledSpanWithEllipsis: import("styled-components").StyledComponent<keyof JSX.IntrinsicElements, import("@elliemae/ds-system").Theme, Record<string, unknown> & object, never>;
|
|
15
15
|
export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, StyledChipPropsT, never>;
|
|
16
|
-
export declare const StyledChip: import("styled-components").StyledComponent<"button", import("@elliemae/ds-system").Theme, Pick<StyledChipPropsT, "selected" | "buttonShape">, never>;
|
|
17
16
|
export declare const StyledRoundShape: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, StyledRoundShapePropsT, never>;
|
|
18
17
|
export declare const StyledChildrenWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object, never>;
|
|
18
|
+
export declare const StyledChip: import("styled-components").StyledComponent<"button", import("@elliemae/ds-system").Theme, Pick<StyledChipPropsT, "selected" | "buttonShape">, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chip",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chip",
|
|
6
6
|
"files": [
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"indent": 4
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-props-helpers": "3.16.
|
|
67
|
-
"@elliemae/ds-system": "3.16.
|
|
68
|
-
"@elliemae/ds-utilities": "3.16.
|
|
66
|
+
"@elliemae/ds-props-helpers": "3.16.1",
|
|
67
|
+
"@elliemae/ds-system": "3.16.1",
|
|
68
|
+
"@elliemae/ds-utilities": "3.16.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@testing-library/jest-dom": "~5.16.
|
|
71
|
+
"@testing-library/jest-dom": "~5.16.5",
|
|
72
72
|
"@testing-library/react": "~12.1.3",
|
|
73
|
-
"styled-components": "~5.3.
|
|
74
|
-
"@elliemae/ds-icons": "3.16.
|
|
73
|
+
"styled-components": "~5.3.9",
|
|
74
|
+
"@elliemae/ds-icons": "3.16.1"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^17.0.2",
|