@elliemae/ds-chip 3.57.0-next.9 → 3.57.0-rc.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.
Files changed (59) hide show
  1. package/dist/cjs/DSChip.js +2 -2
  2. package/dist/cjs/DSChip.js.map +2 -2
  3. package/dist/cjs/config/useConfig.js +5 -4
  4. package/dist/cjs/config/useConfig.js.map +2 -2
  5. package/dist/cjs/{constants.js → constants/index.js} +18 -1
  6. package/dist/cjs/constants/index.js.map +7 -0
  7. package/dist/cjs/index.js +29 -4
  8. package/dist/cjs/index.js.map +2 -2
  9. package/dist/cjs/react-desc-prop-types.js +6 -5
  10. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  11. package/dist/cjs/sharedTypes.js.map +1 -1
  12. package/dist/cjs/styles.js +9 -10
  13. package/dist/cjs/styles.js.map +2 -2
  14. package/dist/cjs/typescript-testing/typescript-chip-valid.js +91 -0
  15. package/dist/cjs/typescript-testing/typescript-chip-valid.js.map +7 -0
  16. package/dist/esm/DSChip.js +3 -3
  17. package/dist/esm/DSChip.js.map +2 -2
  18. package/dist/esm/config/useConfig.js +5 -4
  19. package/dist/esm/config/useConfig.js.map +2 -2
  20. package/dist/esm/{constants.js → constants/index.js} +18 -1
  21. package/dist/esm/constants/index.js.map +7 -0
  22. package/dist/esm/index.js +43 -3
  23. package/dist/esm/index.js.map +2 -2
  24. package/dist/esm/react-desc-prop-types.js +9 -6
  25. package/dist/esm/react-desc-prop-types.js.map +2 -2
  26. package/dist/esm/styles.js +15 -7
  27. package/dist/esm/styles.js.map +2 -2
  28. package/dist/esm/typescript-testing/typescript-chip-valid.js +68 -0
  29. package/dist/esm/typescript-testing/typescript-chip-valid.js.map +7 -0
  30. package/dist/types/config/useConfig.d.ts +452 -12
  31. package/dist/types/{constants.d.ts → constants/index.d.ts} +29 -0
  32. package/dist/types/index.d.ts +4 -3
  33. package/dist/types/react-desc-prop-types.d.ts +9 -8
  34. package/dist/types/sharedTypes.d.ts +1 -1
  35. package/dist/types/tests/DSChip.data-testid.test.d.ts +1 -0
  36. package/dist/types/tests/DSChip.events.test.d.ts +1 -0
  37. package/dist/types/tests/DSChip.exports.test.d.ts +1 -0
  38. package/dist/types/tests/DSChip.keyboard.test.d.ts +1 -0
  39. package/dist/types/tests/DSChips.get-owner-props.test.d.ts +1 -0
  40. package/dist/types/typescript-testing/typescript-chip-valid.d.ts +1 -0
  41. package/package.json +25 -24
  42. package/dist/cjs/constants.js.map +0 -7
  43. package/dist/cjs/exported_related/data-test-ids.js +0 -38
  44. package/dist/cjs/exported_related/data-test-ids.js.map +0 -7
  45. package/dist/cjs/exported_related/index.js +0 -31
  46. package/dist/cjs/exported_related/index.js.map +0 -7
  47. package/dist/cjs/exported_related/theming.js +0 -44
  48. package/dist/cjs/exported_related/theming.js.map +0 -7
  49. package/dist/esm/constants.js.map +0 -7
  50. package/dist/esm/exported_related/data-test-ids.js +0 -8
  51. package/dist/esm/exported_related/data-test-ids.js.map +0 -7
  52. package/dist/esm/exported_related/index.js +0 -4
  53. package/dist/esm/exported_related/index.js.map +0 -7
  54. package/dist/esm/exported_related/theming.js +0 -14
  55. package/dist/esm/exported_related/theming.js.map +0 -7
  56. package/dist/types/exported_related/data-test-ids.d.ts +0 -7
  57. package/dist/types/exported_related/index.d.ts +0 -2
  58. package/dist/types/exported_related/theming.d.ts +0 -8
  59. /package/dist/types/tests/{DSChip.test.d.ts → DSChip.api.test.d.ts} +0 -0
@@ -38,7 +38,7 @@ var import_react = require("react");
38
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
39
  var import_useConfig = require("./config/useConfig.js");
40
40
  var import_styles = require("./styles.js");
41
- var import_constants = require("./constants.js");
41
+ var import_constants = require("./constants/index.js");
42
42
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
43
43
  const DSChip = (props) => {
44
44
  const {
@@ -84,5 +84,5 @@ const DSChip = (props) => {
84
84
  };
85
85
  DSChip.displayName = "DSChip";
86
86
  const DSChipWithSchema = (0, import_ds_props_helpers.describe)(DSChip);
87
- DSChipWithSchema.propTypes = import_react_desc_prop_types.DSChipPropTypes;
87
+ DSChipWithSchema.propTypes = import_react_desc_prop_types.DSChipPropTypesSchema;
88
88
  //# sourceMappingURL=DSChip.js.map
@@ -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, { useCallback } 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 {\n size,\n shape,\n selected,\n applyAriaDisabled,\n innerRef,\n icon: Icon,\n label,\n globalAttrs,\n xStyledAttrs,\n ownerPropsConfig,\n } = useConfig(props);\n\n const { disabled, className, onClick, ...restGlobals } = globalAttrs;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (applyAriaDisabled) return;\n if (onClick) {\n onClick(e);\n }\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs} {...ownerPropsConfig}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled || applyAriaDisabled}\n disabled={disabled}\n innerRef={innerRef}\n selected={selected}\n role=\"button\"\n onClick={handleOnClick}\n {...restGlobals}\n {...ownerPropsConfig}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size} {...ownerPropsConfig}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size} {...ownerPropsConfig}>\n <StyledSpanWithEllipsis {...ownerPropsConfig}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </StyledWrapper>\n );\n};\n\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;ADoCjB;AApCN,mBAAmC;AACnC,8BAAyB;AACzB,uBAA0B;AAC1B,oBAAqG;AACrG,uBAA4B;AAE5B,mCAAgC;AAEhC,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,4BAAU,KAAK;AAEnB,QAAM,EAAE,UAAU,WAAW,SAAS,GAAG,YAAY,IAAI;AAEzD,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAAuD;AACtD,UAAI,kBAAmB;AACvB,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE,4CAAC,+BAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAAe,GAAG,kBAC/F;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,kBAAU,6BAAY,QACrB,4CAAC,kCAAiB,UAAoB,MAAa,GAAG,kBACpD,sDAAC,QAAK,GACR,IAEA,4CAAC,QAAK;AAAA,QAER,4CAAC,iCAAgB,MAAa,GAAG,kBAC/B,sDAAC,wCAAwB,GAAG,kBAAmB,iBAAM,GACvD;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,cAAc;AACrB,MAAM,uBAAmB,kCAAS,MAAM;AACxC,iBAAiB,YAAY;",
4
+ "sourcesContent": ["import React, { useCallback } 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/index.js';\nimport type { DSChipT } from './react-desc-prop-types.js';\nimport { DSChipPropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSChip: React.ComponentType<DSChipT.Props> = (props) => {\n const {\n size,\n shape,\n selected,\n applyAriaDisabled,\n innerRef,\n icon: Icon,\n label,\n globalAttrs,\n xStyledAttrs,\n ownerPropsConfig,\n } = useConfig(props);\n\n const { disabled, className, onClick, ...restGlobals } = globalAttrs;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (applyAriaDisabled) return;\n if (onClick) {\n onClick(e);\n }\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs} {...ownerPropsConfig}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled || applyAriaDisabled}\n disabled={disabled}\n innerRef={innerRef}\n selected={selected}\n role=\"button\"\n onClick={handleOnClick}\n {...restGlobals}\n {...ownerPropsConfig}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size} {...ownerPropsConfig}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size} {...ownerPropsConfig}>\n <StyledSpanWithEllipsis {...ownerPropsConfig}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </StyledWrapper>\n );\n};\n\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypesSchema;\n\nexport { DSChip, DSChipWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoCjB;AApCN,mBAAmC;AACnC,8BAAyB;AACzB,uBAA0B;AAC1B,oBAAqG;AACrG,uBAA4B;AAE5B,mCAAsC;AAEtC,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,4BAAU,KAAK;AAEnB,QAAM,EAAE,UAAU,WAAW,SAAS,GAAG,YAAY,IAAI;AAEzD,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAAuD;AACtD,UAAI,kBAAmB;AACvB,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE,4CAAC,+BAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAAe,GAAG,kBAC/F;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,kBAAU,6BAAY,QACrB,4CAAC,kCAAiB,UAAoB,MAAa,GAAG,kBACpD,sDAAC,QAAK,GACR,IAEA,4CAAC,QAAK;AAAA,QAER,4CAAC,iCAAgB,MAAa,GAAG,kBAC/B,sDAAC,wCAAwB,GAAG,kBAAmB,iBAAM,GACvD;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,cAAc;AACrB,MAAM,uBAAmB,kCAAS,MAAM;AACxC,iBAAiB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -33,12 +33,13 @@ __export(useConfig_exports, {
33
33
  module.exports = __toCommonJS(useConfig_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
- var import_exported_related = require("../exported_related/index.js");
36
+ var import_constants = require("../constants/index.js");
37
37
  var import_react_desc_prop_types = require("../react-desc-prop-types.js");
38
38
  const useConfig = (props) => {
39
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
40
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.DSChipPropTypes, import_exported_related.DSChipName);
41
- const globalAttrs = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
39
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.DSChipDefaultProps);
40
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.DSChipPropTypes, import_constants.DSChipName);
41
+ const { shape, label, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;
42
+ const globalAttrs = (0, import_ds_props_helpers.useGetGlobalAttributes)(globalPropsWithoutReusedReservedKeywords);
42
43
  const xStyledAttrs = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
43
44
  const ownerPropsConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault, { ...props });
44
45
  return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };
@@ -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 { useCallback } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n useOwnerProps,\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\n // const { applyAriaDisabled, onClick } = propsWithDefault;\n // const handleOnClick = useCallback(\n // (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // if (applyAriaDisabled) {\n // console.log('retorno viejo');\n // return;\n // }\n // if (onClick) {\n // onClick(e);\n // }\n // },\n // [applyAriaDisabled, onClick],\n // );\n\n const globalAttrs = useGetGlobalAttributes<\n DSChipT.InternalProps,\n HTMLButtonElement,\n { type?: 'button' | 'reset' | 'submit' }\n >(propsWithDefault);\n // >(propsWithDefault, { onClick: handleOnClick });\n\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n const ownerPropsConfig = useOwnerProps(propsWithDefault, { ...props });\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAMO;AACP,8BAA2B;AAE3B,mCAA8C;AAEvC,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,uBAAmB,sDAA8D,OAAO,yCAAY;AAE1G,8DAA+B,kBAAkB,8CAAiB,kCAAU;AAgB5E,QAAM,kBAAc,gDAIlB,gBAAgB;AAGlB,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,uBAAmB,uCAAc,kBAAkB,EAAE,GAAG,MAAM,CAAC;AAErE,SAAO,EAAE,GAAG,kBAAkB,aAAa,cAAc,iBAAiB;AAC5E;",
4
+ "sourcesContent": ["// import { useCallback } from 'react';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../constants/index.js';\nimport type { DSChipT } from '../react-desc-prop-types.js';\nimport { DSChipDefaultProps, DSChipPropTypes } from '../react-desc-prop-types.js';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChipT.InternalProps>(props, DSChipDefaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n\n // const { applyAriaDisabled, onClick } = propsWithDefault;\n // const handleOnClick = useCallback(\n // (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // if (applyAriaDisabled) {\n // console.log('retorno viejo');\n // return;\n // }\n // if (onClick) {\n // onClick(e);\n // }\n // },\n // [applyAriaDisabled, onClick],\n // );\n\n // exclude `shape` AND `label` as they are reused reserved keyword from global props,\n // we intend to \"consume\" those props, not \"spread\" in the html\n const { shape, label, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;\n const globalAttrs = useGetGlobalAttributes<\n Omit<DSChipT.InternalProps, 'shape' | 'label'>,\n HTMLButtonElement,\n { type?: 'button' | 'reset' | 'submit' }\n >(globalPropsWithoutReusedReservedKeywords) as Omit<\n GlobalAttributesT<HTMLButtonElement, { type?: 'button' | 'reset' | 'submit' }>,\n 'shape' | 'label'\n >;\n\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n const ownerPropsConfig = useOwnerProps(propsWithDefault, { ...props });\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAMO;AACP,uBAA2B;AAE3B,mCAAoD;AAE7C,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,uBAAmB,sDAAoD,OAAO,+CAAkB;AAEtG,8DAA+B,kBAAkB,8CAAiB,2BAAU;AAkB5E,QAAM,EAAE,OAAO,OAAO,GAAG,yCAAyC,IAAI;AACtE,QAAM,kBAAc,gDAIlB,wCAAwC;AAK1C,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,uBAAmB,uCAAc,kBAAkB,EAAE,GAAG,MAAM,CAAC;AAErE,SAAO,EAAE,GAAG,kBAAkB,aAAa,cAAc,iBAAiB;AAC5E;",
6
6
  "names": []
7
7
  }
@@ -28,14 +28,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var constants_exports = {};
30
30
  __export(constants_exports, {
31
+ CHIP_DATA_TESTID: () => CHIP_DATA_TESTID,
31
32
  CHIP_SHAPES: () => CHIP_SHAPES,
32
33
  CHIP_SIZES: () => CHIP_SIZES,
34
+ CHIP_SLOTS: () => CHIP_SLOTS,
33
35
  ChipInteractionStates: () => ChipInteractionStates,
34
36
  ChipInteractionStatesValuesString: () => ChipInteractionStatesValuesString,
35
37
  ChipShapesValuesArray: () => ChipShapesValuesArray,
36
38
  ChipShapesValuesString: () => ChipShapesValuesString,
37
39
  ChipSizesValuesArray: () => ChipSizesValuesArray,
38
40
  ChipSizesValuesString: () => ChipSizesValuesString,
41
+ DSChipDataTestIds: () => DSChipDataTestIds,
42
+ DSChipName: () => DSChipName,
43
+ DSChipSlots: () => DSChipSlots,
39
44
  basicSizes: () => basicSizes,
40
45
  roundShapeLarge: () => roundShapeLarge,
41
46
  roundShapeSmall: () => roundShapeSmall,
@@ -43,6 +48,18 @@ __export(constants_exports, {
43
48
  });
44
49
  module.exports = __toCommonJS(constants_exports);
45
50
  var React = __toESM(require("react"));
51
+ var import_ds_system = require("@elliemae/ds-system");
52
+ const DSChipName = "DSChip";
53
+ const CHIP_SLOTS = {
54
+ ROOT: "root",
55
+ BUTTON: "button",
56
+ LABEL: "label",
57
+ ROUND_SHAPE: "round-shape",
58
+ ELLIPSIS: "ellipsis"
59
+ };
60
+ const CHIP_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSChipName, CHIP_SLOTS);
61
+ const DSChipSlots = CHIP_SLOTS;
62
+ const DSChipDataTestIds = CHIP_DATA_TESTID;
46
63
  const CHIP_SHAPES = {
47
64
  DEFAULT: "default",
48
65
  ROUND: "round"
@@ -79,4 +96,4 @@ const ChipInteractionStates = ["hover", "focus", "active"];
79
96
  const ChipSizesValuesString = JSON.stringify(ChipSizesValuesArray);
80
97
  const ChipShapesValuesString = JSON.stringify(ChipShapesValuesArray);
81
98
  const ChipInteractionStatesValuesString = JSON.stringify(ChipInteractionStates);
82
- //# sourceMappingURL=constants.js.map
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSChipName = 'DSChip';\n\nexport const CHIP_SLOTS = {\n ROOT: 'root',\n BUTTON: 'button',\n LABEL: 'label',\n ROUND_SHAPE: 'round-shape',\n ELLIPSIS: 'ellipsis',\n} as const;\n\nexport const CHIP_DATA_TESTID = slotObjectToDataTestIds(DSChipName, CHIP_SLOTS);\n\nexport const DSChipSlots = CHIP_SLOTS;\nexport const DSChipDataTestIds = CHIP_DATA_TESTID;\n\nexport 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 = '4.308rem';\nexport const roundShapeSmall = '3.077rem';\n\nexport const basicSizes = {\n s: {\n width: '5.538rem',\n height: '5.154rem',\n } as const,\n l: {\n width: '7.077rem',\n height: '5.154rem',\n } as const,\n};\n\nexport const shapeSizes = {\n s: {\n width: '5.538rem',\n height: '5.923rem',\n } as const,\n l: {\n width: '7.077rem',\n height: '6.538rem',\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,aAAa;AAEnB,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AACZ;AAEO,MAAM,uBAAmB,0CAAwB,YAAY,UAAU;AAEvE,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAE1B,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
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
8
12
  var __copyProps = (to, from, except, desc) => {
9
13
  if (from && typeof from === "object" || typeof from === "function") {
10
14
  for (let key of __getOwnPropNames(from))
@@ -13,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
13
17
  }
14
18
  return to;
15
19
  };
16
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
21
  // If the importer is in node compatibility mode or this is not an ESM
19
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -24,9 +27,31 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
27
  ));
25
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
29
  var index_exports = {};
30
+ __export(index_exports, {
31
+ CHIP_DATA_TESTID: () => import_constants.CHIP_DATA_TESTID,
32
+ CHIP_SHAPES: () => import_constants.CHIP_SHAPES,
33
+ CHIP_SIZES: () => import_constants.CHIP_SIZES,
34
+ CHIP_SLOTS: () => import_constants.CHIP_SLOTS,
35
+ ChipInteractionStates: () => import_constants.ChipInteractionStates,
36
+ ChipInteractionStatesValuesString: () => import_constants.ChipInteractionStatesValuesString,
37
+ ChipShapesValuesArray: () => import_constants.ChipShapesValuesArray,
38
+ ChipShapesValuesString: () => import_constants.ChipShapesValuesString,
39
+ ChipSizesValuesArray: () => import_constants.ChipSizesValuesArray,
40
+ ChipSizesValuesString: () => import_constants.ChipSizesValuesString,
41
+ DSChip: () => import_DSChip.DSChip,
42
+ DSChipDataTestIds: () => import_constants.DSChipDataTestIds,
43
+ DSChipName: () => import_constants.DSChipName,
44
+ DSChipPropTypes: () => import_react_desc_prop_types.DSChipPropTypes,
45
+ DSChipSlots: () => import_constants.DSChipSlots,
46
+ DSChipWithSchema: () => import_DSChip.DSChipWithSchema,
47
+ basicSizes: () => import_constants.basicSizes,
48
+ roundShapeLarge: () => import_constants.roundShapeLarge,
49
+ roundShapeSmall: () => import_constants.roundShapeSmall,
50
+ shapeSizes: () => import_constants.shapeSizes
51
+ });
27
52
  module.exports = __toCommonJS(index_exports);
28
53
  var React = __toESM(require("react"));
29
- __reExport(index_exports, require("./DSChip.js"), module.exports);
30
- __reExport(index_exports, require("./constants.js"), module.exports);
31
- __reExport(index_exports, require("./exported_related/index.js"), module.exports);
54
+ var import_DSChip = require("./DSChip.js");
55
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
56
+ var import_constants = require("./constants/index.js");
32
57
  //# sourceMappingURL=index.js.map
@@ -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.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,0BAAc,wBAAd;AACA,0BAAc,2BADd;AAEA,0BAAc,wCAFd;",
4
+ "sourcesContent": ["export { DSChip, DSChipWithSchema } from './DSChip.js';\nexport { type DSChipT, DSChipPropTypes } from './react-desc-prop-types.js';\nexport {\n CHIP_SLOTS,\n CHIP_DATA_TESTID,\n DSChipName,\n // below are \"unusual\" exports that we keep for retrocompatibility but that are usually\n // not exported in other components\n CHIP_SHAPES,\n CHIP_SIZES,\n ChipInteractionStates,\n ChipInteractionStatesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n DSChipDataTestIds, // legacy test id constant name, same values as new one by default\n DSChipSlots,\n basicSizes,\n roundShapeLarge,\n roundShapeSmall,\n shapeSizes,\n} from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAyC;AACzC,mCAA8C;AAC9C,uBAoBO;",
6
6
  "names": []
7
7
  }
@@ -28,21 +28,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var react_desc_prop_types_exports = {};
30
30
  __export(react_desc_prop_types_exports, {
31
+ DSChipDefaultProps: () => DSChipDefaultProps,
31
32
  DSChipPropTypes: () => DSChipPropTypes,
32
- defaultProps: () => defaultProps
33
+ DSChipPropTypesSchema: () => DSChipPropTypesSchema
33
34
  });
34
35
  module.exports = __toCommonJS(react_desc_prop_types_exports);
35
36
  var React = __toESM(require("react"));
36
37
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
- var import_constants = require("./constants.js");
38
- var import_theming = require("./exported_related/theming.js");
39
- const defaultProps = {
38
+ var import_constants = require("./constants/index.js");
39
+ const DSChipDefaultProps = {
40
40
  size: import_constants.CHIP_SIZES.L,
41
41
  shape: import_constants.CHIP_SHAPES.DEFAULT,
42
42
  applyAriaDisabled: false
43
43
  };
44
44
  const DSChipPropTypes = {
45
- ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_theming.DSChipName, import_theming.DSChipSlots),
45
+ ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSChipName, import_constants.CHIP_SLOTS),
46
46
  ...import_ds_props_helpers.globalAttributesPropTypes,
47
47
  ...import_ds_props_helpers.xstyledPropTypes,
48
48
  icon: import_ds_props_helpers.PropTypes.func.isRequired.description("Chip Icon").defaultValue(() => {
@@ -56,4 +56,5 @@ const DSChipPropTypes = {
56
56
  ).defaultValue(false),
57
57
  innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.func]).description("Inner ref to button component.")
58
58
  };
59
+ const DSChipPropTypesSchema = DSChipPropTypes;
59
60
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -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 React from 'react';\nimport type { GlobalAttributesT, XstyledProps, ValidationMap } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerSlotPropTypes,\n} 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';\nimport { DSChipName, DSChipSlots } from './exported_related/theming.js';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n applyAriaDisabled: false,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n applyAriaDisabled: boolean;\n }\n interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSChipName, typeof DSChipSlots> {\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 ...getPropsPerSlotPropTypes(DSChipName, DSChipSlots),\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 applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as ValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,uBAOO;AAEP,qBAAwC;AAEjC,MAAM,eAAqC;AAAA,EAChD,MAAM,4BAAW;AAAA,EACjB,OAAO,6BAAY;AAAA,EACnB,mBAAmB;AACrB;AAwBO,MAAM,kBAAkB;AAAA,EAC7B,OAAG,kDAAyB,2BAAY,0BAAW;AAAA,EACnD,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,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAChH;",
4
+ "sourcesContent": ["import type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, ValidationMap, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerSlotPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n DSChipName,\n CHIP_SLOTS,\n} from './constants/index.js';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes.js';\n\nexport const DSChipDefaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n applyAriaDisabled: false,\n};\n\nexport declare namespace DSChipT {\n export interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n applyAriaDisabled: boolean;\n }\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSChipName, typeof CHIP_SLOTS> {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n export interface RequiredProps {\n label: string;\n icon: React.ComponentType<Record<string, never>>;\n }\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof DefaultProps | keyof XstyledProps | keyof RequiredProps | keyof OptionalProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof DefaultProps | keyof XstyledProps | keyof RequiredProps | keyof OptionalProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const DSChipPropTypes: DSPropTypesSchema<DSChipT.Props> = {\n ...getPropsPerSlotPropTypes(DSChipName, CHIP_SLOTS),\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 applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n};\n\nexport const DSChipPropTypesSchema = DSChipPropTypes as unknown as ValidationMap<DSChipT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAKO;AACP,uBASO;AAGA,MAAM,qBAA2C;AAAA,EACtD,MAAM,4BAAW;AAAA,EACjB,OAAO,6BAAY;AAAA,EACnB,mBAAmB;AACrB;AAuCO,MAAM,kBAAoD;AAAA,EAC/D,OAAG,kDAAyB,6BAAY,2BAAU;AAAA,EAClD,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,mBAAmB,kCAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAChH;AAEO,MAAM,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -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.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"],
4
+ "sourcesContent": ["import type { CHIP_SIZES, CHIP_SHAPES, ChipInteractionStates } from './constants/index.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
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -37,10 +37,9 @@ __export(styles_exports, {
37
37
  module.exports = __toCommonJS(styles_exports);
38
38
  var React = __toESM(require("react"));
39
39
  var import_ds_system = require("@elliemae/ds-system");
40
- var import_constants = require("./constants.js");
41
- var import_exported_related = require("./exported_related/index.js");
40
+ var import_constants = require("./constants/index.js");
42
41
  const getChipSize = (shape) => shape === import_constants.CHIP_SHAPES.ROUND ? import_constants.shapeSizes : import_constants.basicSizes;
43
- const StyledChipLabel = (0, import_ds_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.LABEL })`
42
+ const StyledChipLabel = (0, import_ds_system.styled)("div", { name: import_constants.DSChipName, slot: import_constants.CHIP_SLOTS.LABEL })`
44
43
  font-size: ${({ theme }) => theme.fontSizes.label[200]};
45
44
  font-weight: ${({ theme }) => theme.fontWeights.semibold};
46
45
  word-wrap: break-word;
@@ -54,8 +53,8 @@ const StyledChipLabel = (0, import_ds_system.styled)("div", { name: import_expor
54
53
  justify-content: center;
55
54
  `;
56
55
  const StyledSpanWithEllipsis = (0, import_ds_system.styled)("span", {
57
- name: import_exported_related.DSChipName,
58
- slot: import_exported_related.DSChipSlots.ELLIPSIS
56
+ name: import_constants.DSChipName,
57
+ slot: import_constants.CHIP_SLOTS.ELLIPSIS
59
58
  })`
60
59
  white-space: nowrap;
61
60
  overflow: hidden;
@@ -63,8 +62,8 @@ const StyledSpanWithEllipsis = (0, import_ds_system.styled)("span", {
63
62
  max-width: 100%;
64
63
  `;
65
64
  const StyledWrapper = (0, import_ds_system.styled)("div", {
66
- name: import_exported_related.DSChipName,
67
- slot: import_exported_related.DSChipSlots.ROOT
65
+ name: import_constants.DSChipName,
66
+ slot: import_constants.CHIP_SLOTS.ROOT
68
67
  })`
69
68
  display: flex;
70
69
  height: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].height};
@@ -79,8 +78,8 @@ const disabledRoundShape = import_ds_system.css`
79
78
  }
80
79
  `;
81
80
  const StyledRoundShape = (0, import_ds_system.styled)("div", {
82
- name: import_exported_related.DSChipName,
83
- slot: import_exported_related.DSChipSlots.ROUND_SHAPE
81
+ name: import_constants.DSChipName,
82
+ slot: import_constants.CHIP_SLOTS.ROUND_SHAPE
84
83
  })`
85
84
  background-color: ${({ theme }) => theme.colors.brand[600]};
86
85
  width: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
@@ -113,7 +112,7 @@ const styledChipSelectedCss = import_ds_system.css`
113
112
  }
114
113
  }
115
114
  `;
116
- const StyledChip = (0, import_ds_system.styled)("button", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.BUTTON })`
115
+ const StyledChip = (0, import_ds_system.styled)("button", { name: import_constants.DSChipName, slot: import_constants.CHIP_SLOTS.BUTTON })`
117
116
  position: relative;
118
117
  display: flex;
119
118
  flex-direction: column;
@@ -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.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 name: DSChipName,\n slot: DSChipSlots.ELLIPSIS,\n})`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledWrapper = styled('div', {\n name: DSChipName,\n slot: DSChipSlots.ROOT,\n})<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\nconst styledChipSelectedCss = css`\n // TODO: wrap css processor to process new HOC wrapping styled components\n ${StyledRoundShape.toString()} {\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-root .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 justify-content: 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: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\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 & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\n }\n & .DSIcon-root {\n height: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\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 &[aria-disabled='true'] {\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 ${StyledRoundShape} {\n ${disabledRoundShape}\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\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover {\n &:not(:focus) {\n &:before {\n border-color: transparent;\n }\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;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,CAAC;AAAA,iBACvC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,QAAQ;AAAA;AAAA;AAAA,aAG7C,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,QAAQ,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3D,MAAM,6BAAyB,yBAAO,QAAQ;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,oCAAY;AACpB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM,MAAM,oBAAgB,yBAAO,OAAO;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,oCAAY;AACpB,CAAC;AAAA;AAAA,YAEW,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE,MAAM;AAAA,WAC7E,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE,KAAK;AAAA,IAClF,mCAAkB;AAAA;AAGtB,MAAM,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-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport {\n basicSizes,\n shapeSizes,\n CHIP_SHAPES,\n CHIP_SIZES,\n roundShapeLarge,\n roundShapeSmall,\n DSChipName,\n CHIP_SLOTS,\n} from './constants/index.js';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes.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: CHIP_SLOTS.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 name: DSChipName,\n slot: CHIP_SLOTS.ELLIPSIS,\n})`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledWrapper = styled('div', {\n name: DSChipName,\n slot: CHIP_SLOTS.ROOT,\n})<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: CHIP_SLOTS.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\nconst styledChipSelectedCss = css`\n // TODO: wrap css processor to process new HOC wrapping styled components\n ${StyledRoundShape.toString()} {\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-root .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: CHIP_SLOTS.BUTTON })<\n Pick<StyledChipPropsT, 'selected' | 'buttonShape'>\n>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: 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: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\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 & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\n }\n & .DSIcon-root {\n height: 1.85rem;\n width: 1.85rem;\n @media (max-width: ${({ theme }) => theme.breakpoints.small}) {\n height: 1.5rem;\n width: 1.5rem;\n }\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 &[aria-disabled='true'] {\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 ${StyledRoundShape} {\n ${disabledRoundShape}\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\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover {\n &:not(:focus) {\n &:before {\n border-color: transparent;\n }\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;ACAA,YAAuB;ADCvB,uBAAgD;AAChD,uBASO;AAcP,MAAM,cAAc,CAAC,UAAwB,UAAU,6BAAY,QAAQ,8BAAa;AAEjF,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,6BAAY,MAAM,4BAAW,MAAM,CAAC;AAAA,eAC1E,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,MAAM,GAAG,CAAC;AAAA,iBACvC,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,QAAQ;AAAA;AAAA;AAAA,aAG7C,CAAC,EAAE,KAAK,MAAO,SAAS,4BAAW,IAAI,QAAQ,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3D,MAAM,6BAAyB,yBAAO,QAAQ;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,4BAAW;AACnB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM,MAAM,oBAAgB,yBAAO,OAAO;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,4BAAW;AACnB,CAAC;AAAA;AAAA,YAEW,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE,MAAM;AAAA,WAC7E,CAAC,EAAE,YAAY,YAAY,MAAM,YAAY,WAAW,EAAE,UAAU,EAAE,KAAK;AAAA,IAClF,mCAAkB;A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  "names": []
7
7
  }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
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.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = __toESM(require("react"));
27
+ var import__ = require("../index.js");
28
+ const Icon = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-testid": "icon-test" });
29
+ const testRequiredProps = {
30
+ label: "Label",
31
+ icon: Icon
32
+ };
33
+ const testOptionalPropsEmpty = {};
34
+ const testOptionalProps = {
35
+ selected: true,
36
+ innerRef: import_react.default.createRef()
37
+ };
38
+ const testPartialDefaults = {
39
+ applyAriaDisabled: true
40
+ };
41
+ const testProps = {
42
+ ...testRequiredProps,
43
+ ...testPartialDefaults
44
+ };
45
+ const testPropsAsSyntax = {
46
+ ...testRequiredProps,
47
+ ...testPartialDefaults
48
+ };
49
+ const testCompleteDefaults = {
50
+ size: "l",
51
+ shape: "default",
52
+ applyAriaDisabled: false
53
+ };
54
+ const testInternalProps = {
55
+ ...testRequiredProps,
56
+ ...testOptionalProps,
57
+ ...testCompleteDefaults
58
+ };
59
+ const testInternalPropsAsSyntax = {
60
+ ...testRequiredProps,
61
+ ...testOptionalProps,
62
+ ...testCompleteDefaults
63
+ };
64
+ const testExplicitDefinition = {
65
+ label: "Label",
66
+ icon: Icon,
67
+ size: "l",
68
+ shape: "default",
69
+ applyAriaDisabled: false
70
+ };
71
+ const testInferedTypeCompatibility = {
72
+ label: "Label",
73
+ icon: Icon,
74
+ size: "l",
75
+ shape: "default",
76
+ applyAriaDisabled: false
77
+ };
78
+ const testDefinitionAsConst = {
79
+ label: "Label",
80
+ icon: Icon,
81
+ size: "l",
82
+ shape: "default",
83
+ applyAriaDisabled: false
84
+ };
85
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSChip, { ...testExplicitDefinition }),
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSChip, { ...testInferedTypeCompatibility }),
88
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSChip, { ...testDefinitionAsConst }),
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSChip, { label: "Label", icon: Icon })
90
+ ] });
91
+ //# sourceMappingURL=typescript-chip-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chip-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSChip } from '../index.js';\nimport type { DSChipT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChipT.Props;\ntype ComponentPropsInternals = DSChipT.InternalProps;\ntype ComponentPropsDefaultProps = DSChipT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChipT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChipT.RequiredProps;\n\nconst Icon = () => <div data-testid=\"icon-test\" />;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n label: 'Label',\n icon: Icon,\n};\n\nconst testOptionalPropsEmpty: ComponentPropsOptionalProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n selected: true,\n innerRef: React.createRef<HTMLButtonElement>(),\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n applyAriaDisabled: true,\n};\n\n// ComponentPropsForApp only needs required props, default and optional are not mandatory\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n size: 'l',\n shape: 'default',\n applyAriaDisabled: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n label: 'Label',\n icon: Icon,\n size: 'l',\n shape: 'default',\n applyAriaDisabled: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n label: 'Label',\n icon: Icon,\n size: 'l',\n shape: 'default',\n applyAriaDisabled: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n label: 'Label',\n icon: Icon,\n size: 'l',\n shape: 'default',\n applyAriaDisabled: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSChip {...testExplicitDefinition} />\n <DSChip {...testInferedTypeCompatibility} />\n <DSChip {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSChip label=\"Label\" icon={Icon} />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACYJ;AAXnB,mBAAkB;AAClB,eAAuB;AAUvB,MAAM,OAAO,MAAM,4CAAC,SAAI,eAAY,aAAY;AAEhD,MAAM,oBAAiD;AAAA,EACrD,OAAO;AAAA,EACP,MAAM;AACR;AAEA,MAAM,yBAAsD,CAAC;AAE7D,MAAM,oBAAiD;AAAA,EACrD,UAAU;AAAA,EACV,UAAU,aAAAA,QAAM,UAA6B;AAC/C;AAIA,MAAM,sBAA2D;AAAA,EAC/D,mBAAmB;AACrB;AAGA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,OAAO;AAAA,EACP,mBAAmB;AACrB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,mBAAmB;AACrB;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,mBAAmB;AACrB;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,mBAAmB;AACrB;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,mBAAQ,GAAG,wBAAwB;AAAA,EACpC,4CAAC,mBAAQ,GAAG,8BAA8B;AAAA,EAC1C,4CAAC,mBAAQ,GAAG,uBAAuB;AAAA,EAEnC,4CAAC,mBAAO,OAAM,SAAQ,MAAM,MAAM;AAAA,GACpC;",
6
+ "names": ["React"]
7
+ }
@@ -4,8 +4,8 @@ import { useCallback } from "react";
4
4
  import { describe } from "@elliemae/ds-props-helpers";
5
5
  import { useConfig } from "./config/useConfig.js";
6
6
  import { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from "./styles.js";
7
- import { CHIP_SHAPES } from "./constants.js";
8
- import { DSChipPropTypes } from "./react-desc-prop-types.js";
7
+ import { CHIP_SHAPES } from "./constants/index.js";
8
+ import { DSChipPropTypesSchema } from "./react-desc-prop-types.js";
9
9
  const DSChip = (props) => {
10
10
  const {
11
11
  size,
@@ -50,7 +50,7 @@ const DSChip = (props) => {
50
50
  };
51
51
  DSChip.displayName = "DSChip";
52
52
  const DSChipWithSchema = describe(DSChip);
53
- DSChipWithSchema.propTypes = DSChipPropTypes;
53
+ DSChipWithSchema.propTypes = DSChipPropTypesSchema;
54
54
  export {
55
55
  DSChip,
56
56
  DSChipWithSchema
@@ -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, { useCallback } 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 {\n size,\n shape,\n selected,\n applyAriaDisabled,\n innerRef,\n icon: Icon,\n label,\n globalAttrs,\n xStyledAttrs,\n ownerPropsConfig,\n } = useConfig(props);\n\n const { disabled, className, onClick, ...restGlobals } = globalAttrs;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (applyAriaDisabled) return;\n if (onClick) {\n onClick(e);\n }\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs} {...ownerPropsConfig}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled || applyAriaDisabled}\n disabled={disabled}\n innerRef={innerRef}\n selected={selected}\n role=\"button\"\n onClick={handleOnClick}\n {...restGlobals}\n {...ownerPropsConfig}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size} {...ownerPropsConfig}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size} {...ownerPropsConfig}>\n <StyledSpanWithEllipsis {...ownerPropsConfig}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </StyledWrapper>\n );\n};\n\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypes;\n\nexport { DSChip, DSChipWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoCjB,SAaM,KAbN;AApCN,SAAgB,mBAAmB;AACnC,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;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,UAAU,KAAK;AAEnB,QAAM,EAAE,UAAU,WAAW,SAAS,GAAG,YAAY,IAAI;AAEzD,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAuD;AACtD,UAAI,kBAAmB;AACvB,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE,oBAAC,iBAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAAe,GAAG,kBAC/F;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,kBAAU,YAAY,QACrB,oBAAC,oBAAiB,UAAoB,MAAa,GAAG,kBACpD,8BAAC,QAAK,GACR,IAEA,oBAAC,QAAK;AAAA,QAER,oBAAC,mBAAgB,MAAa,GAAG,kBAC/B,8BAAC,0BAAwB,GAAG,kBAAmB,iBAAM,GACvD;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } 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/index.js';\nimport type { DSChipT } from './react-desc-prop-types.js';\nimport { DSChipPropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSChip: React.ComponentType<DSChipT.Props> = (props) => {\n const {\n size,\n shape,\n selected,\n applyAriaDisabled,\n innerRef,\n icon: Icon,\n label,\n globalAttrs,\n xStyledAttrs,\n ownerPropsConfig,\n } = useConfig(props);\n\n const { disabled, className, onClick, ...restGlobals } = globalAttrs;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (applyAriaDisabled) return;\n if (onClick) {\n onClick(e);\n }\n },\n [applyAriaDisabled, onClick],\n );\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs} {...ownerPropsConfig}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled || applyAriaDisabled}\n disabled={disabled}\n innerRef={innerRef}\n selected={selected}\n role=\"button\"\n onClick={handleOnClick}\n {...restGlobals}\n {...ownerPropsConfig}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size} {...ownerPropsConfig}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size} {...ownerPropsConfig}>\n <StyledSpanWithEllipsis {...ownerPropsConfig}>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </StyledWrapper>\n );\n};\n\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypesSchema;\n\nexport { DSChip, DSChipWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoCjB,SAaM,KAbN;AApCN,SAAgB,mBAAmB;AACnC,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,iBAAiB,eAAe,kBAAkB,8BAA8B;AACrG,SAAS,mBAAmB;AAE5B,SAAS,6BAA6B;AAEtC,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,UAAU,KAAK;AAEnB,QAAM,EAAE,UAAU,WAAW,SAAS,GAAG,YAAY,IAAI;AAEzD,QAAM,gBAAgB;AAAA,IACpB,CAAC,MAAuD;AACtD,UAAI,kBAAmB;AACvB,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,OAAO;AAAA,EAC7B;AAEA,SACE,oBAAC,iBAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAAe,GAAG,kBAC/F;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe,YAAY;AAAA,MAC3B;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,kBAAU,YAAY,QACrB,oBAAC,oBAAiB,UAAoB,MAAa,GAAG,kBACpD,8BAAC,QAAK,GACR,IAEA,oBAAC,QAAK;AAAA,QAER,oBAAC,mBAAgB,MAAa,GAAG,kBAC/B,8BAAC,0BAAwB,GAAG,kBAAmB,iBAAM,GACvD;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -6,12 +6,13 @@ import {
6
6
  useGetXstyledProps,
7
7
  useOwnerProps
8
8
  } from "@elliemae/ds-props-helpers";
9
- import { DSChipName } from "../exported_related/index.js";
10
- import { defaultProps, DSChipPropTypes } from "../react-desc-prop-types.js";
9
+ import { DSChipName } from "../constants/index.js";
10
+ import { DSChipDefaultProps, DSChipPropTypes } from "../react-desc-prop-types.js";
11
11
  const useConfig = (props) => {
12
- const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
12
+ const propsWithDefault = useMemoMergePropsWithDefault(props, DSChipDefaultProps);
13
13
  useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);
14
- const globalAttrs = useGetGlobalAttributes(propsWithDefault);
14
+ const { shape, label, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;
15
+ const globalAttrs = useGetGlobalAttributes(globalPropsWithoutReusedReservedKeywords);
15
16
  const xStyledAttrs = useGetXstyledProps(propsWithDefault);
16
17
  const ownerPropsConfig = useOwnerProps(propsWithDefault, { ...props });
17
18
  return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };
@@ -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 { useCallback } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n useOwnerProps,\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\n // const { applyAriaDisabled, onClick } = propsWithDefault;\n // const handleOnClick = useCallback(\n // (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // if (applyAriaDisabled) {\n // console.log('retorno viejo');\n // return;\n // }\n // if (onClick) {\n // onClick(e);\n // }\n // },\n // [applyAriaDisabled, onClick],\n // );\n\n const globalAttrs = useGetGlobalAttributes<\n DSChipT.InternalProps,\n HTMLButtonElement,\n { type?: 'button' | 'reset' | 'submit' }\n >(propsWithDefault);\n // >(propsWithDefault, { onClick: handleOnClick });\n\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n const ownerPropsConfig = useOwnerProps(propsWithDefault, { ...props });\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;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;AAgB5E,QAAM,cAAc,uBAIlB,gBAAgB;AAGlB,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,QAAM,mBAAmB,cAAc,kBAAkB,EAAE,GAAG,MAAM,CAAC;AAErE,SAAO,EAAE,GAAG,kBAAkB,aAAa,cAAc,iBAAiB;AAC5E;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// import { useCallback } from 'react';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport { DSChipName } from '../constants/index.js';\nimport type { DSChipT } from '../react-desc-prop-types.js';\nimport { DSChipDefaultProps, DSChipPropTypes } from '../react-desc-prop-types.js';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChipT.InternalProps>(props, DSChipDefaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n\n // const { applyAriaDisabled, onClick } = propsWithDefault;\n // const handleOnClick = useCallback(\n // (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n // if (applyAriaDisabled) {\n // console.log('retorno viejo');\n // return;\n // }\n // if (onClick) {\n // onClick(e);\n // }\n // },\n // [applyAriaDisabled, onClick],\n // );\n\n // exclude `shape` AND `label` as they are reused reserved keyword from global props,\n // we intend to \"consume\" those props, not \"spread\" in the html\n const { shape, label, ...globalPropsWithoutReusedReservedKeywords } = propsWithDefault;\n const globalAttrs = useGetGlobalAttributes<\n Omit<DSChipT.InternalProps, 'shape' | 'label'>,\n HTMLButtonElement,\n { type?: 'button' | 'reset' | 'submit' }\n >(globalPropsWithoutReusedReservedKeywords) as Omit<\n GlobalAttributesT<HTMLButtonElement, { type?: 'button' | 'reset' | 'submit' }>,\n 'shape' | 'label'\n >;\n\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n const ownerPropsConfig = useOwnerProps(propsWithDefault, { ...props });\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs, ownerPropsConfig };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,uBAAuB;AAE7C,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,mBAAmB,6BAAoD,OAAO,kBAAkB;AAEtG,iCAA+B,kBAAkB,iBAAiB,UAAU;AAkB5E,QAAM,EAAE,OAAO,OAAO,GAAG,yCAAyC,IAAI;AACtE,QAAM,cAAc,uBAIlB,wCAAwC;AAK1C,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,QAAM,mBAAmB,cAAc,kBAAkB,EAAE,GAAG,MAAM,CAAC;AAErE,SAAO,EAAE,GAAG,kBAAkB,aAAa,cAAc,iBAAiB;AAC5E;",
6
6
  "names": []
7
7
  }