@elliemae/ds-typography 3.25.0-next.3 → 3.25.0-next.5

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.
@@ -48,6 +48,7 @@ const DSTypography = (props) => {
48
48
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
49
  import_styled.StyledTypography,
50
50
  {
51
+ "data-testid": import_constants.TYPOGRAPHY_DATA_TESTID[import_constants.TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT],
51
52
  ...othersGlobalAttributes,
52
53
  ...xstyledProps,
53
54
  as: as || component,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Typography.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useTypography } from './config/useTypography.js';\nimport { type DSTypographyT, DSTypographyPropTypesSchema } from './react-desc-prop-types.js';\nimport { DSTypographyName } from './constants/index.js';\nimport { StyledTypography } from './parts/styled.js';\n\nconst DSTypography: React.FC<DSTypographyT.Props> = (props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault: { as, component, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore },\n } = useTypography(props);\n return (\n <StyledTypography\n {...othersGlobalAttributes}\n {...xstyledProps}\n as={as || component}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypesSchema;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypesSchema;\n\nexport { DSTypography, DSTypographyWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcnB;AAbJ,8BAAyB;AACzB,2BAA8B;AAC9B,mCAAgE;AAChE,uBAAiC;AACjC,oBAAiC;AAEjC,MAAM,eAA8C,CAAC,UAAU;AAC7D,QAAM;AAAA,IACJ,kBAAkB,EAAE,GAAG,uBAAuB;AAAA,IAC9C;AAAA,IACA,kBAAkB,EAAE,IAAI,WAAW,SAAS,UAAU,UAAU,sBAAsB,qBAAqB;AAAA,EAC7G,QAAI,oCAAc,KAAK;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MAEtB,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
4
+ "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useTypography } from './config/useTypography.js';\nimport { type DSTypographyT, DSTypographyPropTypesSchema } from './react-desc-prop-types.js';\nimport { DSTypographyName, TYPOGRAPHY_DATA_TESTID, TYPOGRAPHY_SLOTS } from './constants/index.js';\nimport { StyledTypography } from './parts/styled.js';\n\nconst DSTypography: React.FC<DSTypographyT.Props> = (props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault: { as, component, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore },\n } = useTypography(props);\n return (\n <StyledTypography\n // we can't use the out-of-the-box data-testid because legacy reasons\n // check the \"constant\" file where this constant is coming from for more info\n data-testid={TYPOGRAPHY_DATA_TESTID[TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]}\n {...othersGlobalAttributes}\n {...xstyledProps}\n as={as || component}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypesSchema;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypesSchema;\n\nexport { DSTypography, DSTypographyWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcnB;AAbJ,8BAAyB;AACzB,2BAA8B;AAC9B,mCAAgE;AAChE,uBAA2E;AAC3E,oBAAiC;AAEjC,MAAM,eAA8C,CAAC,UAAU;AAC7D,QAAM;AAAA,IACJ,kBAAkB,EAAE,GAAG,uBAAuB;AAAA,IAC9C;AAAA,IACA,kBAAkB,EAAE,IAAI,WAAW,SAAS,UAAU,UAAU,sBAAsB,qBAAqB;AAAA,EAC7G,QAAI,oCAAc,KAAK;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,eAAa,wCAAuB,kCAAiB,kBAAkB;AAAA,MACtE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MAEtB,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var constants_exports = {};
30
30
  __export(constants_exports, {
31
31
  DSTypographyName: () => DSTypographyName,
32
+ LEGACY_DATA_TESTID: () => LEGACY_DATA_TESTID,
32
33
  TYPOGRAPHY_DATA_TESTID: () => TYPOGRAPHY_DATA_TESTID,
33
34
  TYPOGRAPHY_SLOTS: () => TYPOGRAPHY_SLOTS,
34
35
  TYPOGRAPHY_VARIANTS: () => TYPOGRAPHY_VARIANTS
@@ -39,14 +40,23 @@ var import_ds_system = require("@elliemae/ds-system");
39
40
  const DSTypographyName = "DSTypography";
40
41
  const TYPOGRAPHY_SLOTS = {
41
42
  // this is the only slot that was present before the slotObjectToDataTestIds function was created
42
- TYPOGRAPHY_ELEMENT: "typography-element"
43
- // from here on we rely on the slotObjectToDataTestIds function...
43
+ // since we have splitted the data-testid and the slot responsabilities in the styled helpers,
44
+ // we can now freely change the "values" of this constant without implying breakign changes
45
+ // if a user get a breaking change it's because they hardcoded the slot instead of using the constant.
46
+ TYPOGRAPHY_ELEMENT: "root"
47
+ };
48
+ const LEGACY_DATA_TESTID = {
49
+ // the new "slot" value -> 'root' need to point to the "old" data-testid value -> 'ds-typography-element'
50
+ [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: "ds-typography-element",
51
+ // the old "slot" value -> 'typography-element' need to point to the "old" data-testid value -> 'ds-typography-element'
52
+ // we are hardcoding this "typography-element" for legacy reason,
53
+ // people that were using this constant doesn't expect us to change the `keys` arbitrarily,
54
+ // having constant keys and changing value is literally the point of this kind of constants
55
+ "typography-element": "ds-typography-element"
44
56
  };
45
57
  const TYPOGRAPHY_DATA_TESTID = {
46
58
  ...(0, import_ds_system.slotObjectToDataTestIds)(DSTypographyName, TYPOGRAPHY_SLOTS),
47
- // this component was created before the slotObjectToDataTestIds function was created
48
- // to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds
49
- [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: "ds-typography-element"
59
+ ...LEGACY_DATA_TESTID
50
60
  };
51
61
  const TYPOGRAPHY_VARIANTS = {
52
62
  H1: "h1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nexport const DSTypographyName = 'DSTypography' as const;\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const TYPOGRAPHY_SLOTS = {\n // this is the only slot that was present before the slotObjectToDataTestIds function was created\n TYPOGRAPHY_ELEMENT: 'typography-element',\n // from here on we rely on the slotObjectToDataTestIds function...\n} as const;\n\nexport const TYPOGRAPHY_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),\n // this component was created before the slotObjectToDataTestIds function was created\n // to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds\n [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: 'ds-typography-element',\n};\n\nexport const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap = {\n H1: 'h1',\n H2: 'h2',\n H3: 'h3',\n H4: 'h4',\n H5: 'h5',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n H1_ARTICLE: 'h1-article',\n H2_ARTICLE: 'h2-article',\n H3_ARTICLE: 'h3-article',\n H4_ARTICLE: 'h4-article',\n H5_ARTICLE: 'h5-article',\n B1_ARTICLE: 'b1-article',\n B2_ARTICLE: 'b2-article',\n B3_ARTICLE: 'b3-article',\n QUOTE_BRAND: 'quote-brand',\n QUOTE_NEUTRAL: 'quote-neutral',\n HIGHLIGHT_NEUTRAL: 'highlight-neutral',\n HIGHLIGHT_BRAND: 'highlight-brand',\n HIGHLIGHT_IMPORTANT: 'highlight-important',\n HIGHLIGHT_CRITICAL: 'highlight-critical',\n BUTTON: 'button',\n LINK: 'link',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAGjC,MAAM,mBAAmB;AAGzB,MAAM,mBAAmB;AAAA;AAAA,EAE9B,oBAAoB;AAAA;AAEtB;AAEO,MAAM,yBAAyB;AAAA,EACpC,OAAG,0CAAwB,kBAAkB,gBAAgB;AAAA;AAAA;AAAA,EAG7D,CAAC,iBAAiB,kBAAkB,GAAG;AACzC;AAEO,MAAM,sBAAiD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,MAAM;AACR;",
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nexport const DSTypographyName = 'DSTypography' as const;\n\nexport const TYPOGRAPHY_SLOTS = {\n // this is the only slot that was present before the slotObjectToDataTestIds function was created\n // since we have splitted the data-testid and the slot responsabilities in the styled helpers,\n // we can now freely change the \"values\" of this constant without implying breakign changes\n // if a user get a breaking change it's because they hardcoded the slot instead of using the constant.\n TYPOGRAPHY_ELEMENT: 'root',\n} as const;\n\n// this component was created before the slotObjectToDataTestIds function was created\n// to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds\nexport const LEGACY_DATA_TESTID = {\n // the new \"slot\" value -> 'root' need to point to the \"old\" data-testid value -> 'ds-typography-element'\n [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: 'ds-typography-element',\n // the old \"slot\" value -> 'typography-element' need to point to the \"old\" data-testid value -> 'ds-typography-element'\n // we are hardcoding this \"typography-element\" for legacy reason,\n // people that were using this constant doesn't expect us to change the `keys` arbitrarily,\n // having constant keys and changing value is literally the point of this kind of constants\n 'typography-element': 'ds-typography-element',\n};\n\nexport const TYPOGRAPHY_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),\n ...LEGACY_DATA_TESTID,\n};\n\nexport const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap = {\n H1: 'h1',\n H2: 'h2',\n H3: 'h3',\n H4: 'h4',\n H5: 'h5',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n H1_ARTICLE: 'h1-article',\n H2_ARTICLE: 'h2-article',\n H3_ARTICLE: 'h3-article',\n H4_ARTICLE: 'h4-article',\n H5_ARTICLE: 'h5-article',\n B1_ARTICLE: 'b1-article',\n B2_ARTICLE: 'b2-article',\n B3_ARTICLE: 'b3-article',\n QUOTE_BRAND: 'quote-brand',\n QUOTE_NEUTRAL: 'quote-neutral',\n HIGHLIGHT_NEUTRAL: 'highlight-neutral',\n HIGHLIGHT_BRAND: 'highlight-brand',\n HIGHLIGHT_IMPORTANT: 'highlight-important',\n HIGHLIGHT_CRITICAL: 'highlight-critical',\n BUTTON: 'button',\n LINK: 'link',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAGjC,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9B,oBAAoB;AACtB;AAIO,MAAM,qBAAqB;AAAA;AAAA,EAEhC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAKvC,sBAAsB;AACxB;AAEO,MAAM,yBAAyB;AAAA,EACpC,OAAG,0CAAwB,kBAAkB,gBAAgB;AAAA,EAC7D,GAAG;AACL;AAEO,MAAM,sBAAiD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
3
3
  import { describe } from "@elliemae/ds-props-helpers";
4
4
  import { useTypography } from "./config/useTypography.js";
5
5
  import { DSTypographyPropTypesSchema } from "./react-desc-prop-types.js";
6
- import { DSTypographyName } from "./constants/index.js";
6
+ import { DSTypographyName, TYPOGRAPHY_DATA_TESTID, TYPOGRAPHY_SLOTS } from "./constants/index.js";
7
7
  import { StyledTypography } from "./parts/styled.js";
8
8
  const DSTypography = (props) => {
9
9
  const {
@@ -14,6 +14,7 @@ const DSTypography = (props) => {
14
14
  return /* @__PURE__ */ jsx(
15
15
  StyledTypography,
16
16
  {
17
+ "data-testid": TYPOGRAPHY_DATA_TESTID[TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT],
17
18
  ...othersGlobalAttributes,
18
19
  ...xstyledProps,
19
20
  as: as || component,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/Typography.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useTypography } from './config/useTypography.js';\nimport { type DSTypographyT, DSTypographyPropTypesSchema } from './react-desc-prop-types.js';\nimport { DSTypographyName } from './constants/index.js';\nimport { StyledTypography } from './parts/styled.js';\n\nconst DSTypography: React.FC<DSTypographyT.Props> = (props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault: { as, component, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore },\n } = useTypography(props);\n return (\n <StyledTypography\n {...othersGlobalAttributes}\n {...xstyledProps}\n as={as || component}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypesSchema;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypesSchema;\n\nexport { DSTypography, DSTypographyWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACcnB;AAbJ,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAA6B,mCAAmC;AAChE,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAEjC,MAAM,eAA8C,CAAC,UAAU;AAC7D,QAAM;AAAA,IACJ,kBAAkB,EAAE,GAAG,uBAAuB;AAAA,IAC9C;AAAA,IACA,kBAAkB,EAAE,IAAI,WAAW,SAAS,UAAU,UAAU,sBAAsB,qBAAqB;AAAA,EAC7G,IAAI,cAAc,KAAK;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MAEtB,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useTypography } from './config/useTypography.js';\nimport { type DSTypographyT, DSTypographyPropTypesSchema } from './react-desc-prop-types.js';\nimport { DSTypographyName, TYPOGRAPHY_DATA_TESTID, TYPOGRAPHY_SLOTS } from './constants/index.js';\nimport { StyledTypography } from './parts/styled.js';\n\nconst DSTypography: React.FC<DSTypographyT.Props> = (props) => {\n const {\n globalAttributes: { ...othersGlobalAttributes },\n xstyledProps,\n propsWithDefault: { as, component, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore },\n } = useTypography(props);\n return (\n <StyledTypography\n // we can't use the out-of-the-box data-testid because legacy reasons\n // check the \"constant\" file where this constant is coming from for more info\n data-testid={TYPOGRAPHY_DATA_TESTID[TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]}\n {...othersGlobalAttributes}\n {...xstyledProps}\n as={as || component}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypesSchema;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypesSchema;\n\nexport { DSTypography, DSTypographyWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACcnB;AAbJ,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAA6B,mCAAmC;AAChE,SAAS,kBAAkB,wBAAwB,wBAAwB;AAC3E,SAAS,wBAAwB;AAEjC,MAAM,eAA8C,CAAC,UAAU;AAC7D,QAAM;AAAA,IACJ,kBAAkB,EAAE,GAAG,uBAAuB;AAAA,IAC9C;AAAA,IACA,kBAAkB,EAAE,IAAI,WAAW,SAAS,UAAU,UAAU,sBAAsB,qBAAqB;AAAA,EAC7G,IAAI,cAAc,KAAK;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,eAAa,uBAAuB,iBAAiB,kBAAkB;AAAA,MACtE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI,MAAM;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MAEtB,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -3,14 +3,23 @@ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
3
  const DSTypographyName = "DSTypography";
4
4
  const TYPOGRAPHY_SLOTS = {
5
5
  // this is the only slot that was present before the slotObjectToDataTestIds function was created
6
- TYPOGRAPHY_ELEMENT: "typography-element"
7
- // from here on we rely on the slotObjectToDataTestIds function...
6
+ // since we have splitted the data-testid and the slot responsabilities in the styled helpers,
7
+ // we can now freely change the "values" of this constant without implying breakign changes
8
+ // if a user get a breaking change it's because they hardcoded the slot instead of using the constant.
9
+ TYPOGRAPHY_ELEMENT: "root"
10
+ };
11
+ const LEGACY_DATA_TESTID = {
12
+ // the new "slot" value -> 'root' need to point to the "old" data-testid value -> 'ds-typography-element'
13
+ [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: "ds-typography-element",
14
+ // the old "slot" value -> 'typography-element' need to point to the "old" data-testid value -> 'ds-typography-element'
15
+ // we are hardcoding this "typography-element" for legacy reason,
16
+ // people that were using this constant doesn't expect us to change the `keys` arbitrarily,
17
+ // having constant keys and changing value is literally the point of this kind of constants
18
+ "typography-element": "ds-typography-element"
8
19
  };
9
20
  const TYPOGRAPHY_DATA_TESTID = {
10
21
  ...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),
11
- // this component was created before the slotObjectToDataTestIds function was created
12
- // to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds
13
- [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: "ds-typography-element"
22
+ ...LEGACY_DATA_TESTID
14
23
  };
15
24
  const TYPOGRAPHY_VARIANTS = {
16
25
  H1: "h1",
@@ -41,6 +50,7 @@ const TYPOGRAPHY_VARIANTS = {
41
50
  };
42
51
  export {
43
52
  DSTypographyName,
53
+ LEGACY_DATA_TESTID,
44
54
  TYPOGRAPHY_DATA_TESTID,
45
55
  TYPOGRAPHY_SLOTS,
46
56
  TYPOGRAPHY_VARIANTS
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nexport const DSTypographyName = 'DSTypography' as const;\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const TYPOGRAPHY_SLOTS = {\n // this is the only slot that was present before the slotObjectToDataTestIds function was created\n TYPOGRAPHY_ELEMENT: 'typography-element',\n // from here on we rely on the slotObjectToDataTestIds function...\n} as const;\n\nexport const TYPOGRAPHY_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),\n // this component was created before the slotObjectToDataTestIds function was created\n // to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds\n [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: 'ds-typography-element',\n};\n\nexport const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap = {\n H1: 'h1',\n H2: 'h2',\n H3: 'h3',\n H4: 'h4',\n H5: 'h5',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n H1_ARTICLE: 'h1-article',\n H2_ARTICLE: 'h2-article',\n H3_ARTICLE: 'h3-article',\n H4_ARTICLE: 'h4-article',\n H5_ARTICLE: 'h5-article',\n B1_ARTICLE: 'b1-article',\n B2_ARTICLE: 'b2-article',\n B3_ARTICLE: 'b3-article',\n QUOTE_BRAND: 'quote-brand',\n QUOTE_NEUTRAL: 'quote-neutral',\n HIGHLIGHT_NEUTRAL: 'highlight-neutral',\n HIGHLIGHT_BRAND: 'highlight-brand',\n HIGHLIGHT_IMPORTANT: 'highlight-important',\n HIGHLIGHT_CRITICAL: 'highlight-critical',\n BUTTON: 'button',\n LINK: 'link',\n} as const;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAGjC,MAAM,mBAAmB;AAGzB,MAAM,mBAAmB;AAAA;AAAA,EAE9B,oBAAoB;AAAA;AAEtB;AAEO,MAAM,yBAAyB;AAAA,EACpC,GAAG,wBAAwB,kBAAkB,gBAAgB;AAAA;AAAA;AAAA,EAG7D,CAAC,iBAAiB,kBAAkB,GAAG;AACzC;AAEO,MAAM,sBAAiD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,MAAM;AACR;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nexport const DSTypographyName = 'DSTypography' as const;\n\nexport const TYPOGRAPHY_SLOTS = {\n // this is the only slot that was present before the slotObjectToDataTestIds function was created\n // since we have splitted the data-testid and the slot responsabilities in the styled helpers,\n // we can now freely change the \"values\" of this constant without implying breakign changes\n // if a user get a breaking change it's because they hardcoded the slot instead of using the constant.\n TYPOGRAPHY_ELEMENT: 'root',\n} as const;\n\n// this component was created before the slotObjectToDataTestIds function was created\n// to avoid breaking change we overwrite the slots that for legacy reason where not using the slotObjectToDataTestIds\nexport const LEGACY_DATA_TESTID = {\n // the new \"slot\" value -> 'root' need to point to the \"old\" data-testid value -> 'ds-typography-element'\n [TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT]: 'ds-typography-element',\n // the old \"slot\" value -> 'typography-element' need to point to the \"old\" data-testid value -> 'ds-typography-element'\n // we are hardcoding this \"typography-element\" for legacy reason,\n // people that were using this constant doesn't expect us to change the `keys` arbitrarily,\n // having constant keys and changing value is literally the point of this kind of constants\n 'typography-element': 'ds-typography-element',\n};\n\nexport const TYPOGRAPHY_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),\n ...LEGACY_DATA_TESTID,\n};\n\nexport const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap = {\n H1: 'h1',\n H2: 'h2',\n H3: 'h3',\n H4: 'h4',\n H5: 'h5',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n H1_ARTICLE: 'h1-article',\n H2_ARTICLE: 'h2-article',\n H3_ARTICLE: 'h3-article',\n H4_ARTICLE: 'h4-article',\n H5_ARTICLE: 'h5-article',\n B1_ARTICLE: 'b1-article',\n B2_ARTICLE: 'b2-article',\n B3_ARTICLE: 'b3-article',\n QUOTE_BRAND: 'quote-brand',\n QUOTE_NEUTRAL: 'quote-neutral',\n HIGHLIGHT_NEUTRAL: 'highlight-neutral',\n HIGHLIGHT_BRAND: 'highlight-brand',\n HIGHLIGHT_IMPORTANT: 'highlight-important',\n HIGHLIGHT_CRITICAL: 'highlight-critical',\n BUTTON: 'button',\n LINK: 'link',\n} as const;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAGjC,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9B,oBAAoB;AACtB;AAIO,MAAM,qBAAqB;AAAA;AAAA,EAEhC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAKvC,sBAAsB;AACxB;AAEO,MAAM,yBAAyB;AAAA,EACpC,GAAG,wBAAwB,kBAAkB,gBAAgB;AAAA,EAC7D,GAAG;AACL;AAEO,MAAM,sBAAiD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,QAAQ;AAAA,EACR,MAAM;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,14 @@
1
1
  import type { DSTypographyT } from '../react-desc-prop-types.js';
2
2
  export declare const DSTypographyName: "DSTypography";
3
3
  export declare const TYPOGRAPHY_SLOTS: {
4
- readonly TYPOGRAPHY_ELEMENT: "typography-element";
4
+ readonly TYPOGRAPHY_ELEMENT: "root";
5
+ };
6
+ export declare const LEGACY_DATA_TESTID: {
7
+ root: string;
8
+ 'typography-element': string;
5
9
  };
6
10
  export declare const TYPOGRAPHY_DATA_TESTID: {
7
- "typography-element": string;
11
+ root: string;
12
+ 'typography-element': string;
8
13
  };
9
14
  export declare const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-typography",
3
- "version": "3.25.0-next.3",
3
+ "version": "3.25.0-next.5",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Typography",
6
6
  "files": [
@@ -37,16 +37,16 @@
37
37
  "dependencies": {
38
38
  "@xstyled/system": "~3.7.3",
39
39
  "@xstyled/util": "3.7.0",
40
- "@elliemae/ds-props-helpers": "3.25.0-next.3",
41
- "@elliemae/ds-system": "3.25.0-next.3",
42
- "@elliemae/ds-utilities": "3.25.0-next.3"
40
+ "@elliemae/ds-props-helpers": "3.25.0-next.5",
41
+ "@elliemae/ds-system": "3.25.0-next.5",
42
+ "@elliemae/ds-utilities": "3.25.0-next.5"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@elliemae/pui-cli": "~9.0.0-next.31",
46
46
  "react": "^17.0.2",
47
47
  "react-dom": "^17.0.2",
48
48
  "react-test-renderer": "~17.0.2",
49
- "@elliemae/ds-monorepo-devops": "3.25.0-next.3"
49
+ "@elliemae/ds-monorepo-devops": "3.25.0-next.5"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^17.0.2",