@elliemae/ds-typography 3.52.1 → 3.53.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Typography.js +4 -1
- package/dist/cjs/Typography.js.map +2 -2
- package/dist/cjs/constants/index.js +2 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/Typography.js +5 -2
- package/dist/esm/Typography.js.map +2 -2
- package/dist/esm/constants/index.js +2 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tests/DSTypography.data-testId.test.d.ts +1 -0
- package/package.json +7 -6
package/dist/cjs/Typography.js
CHANGED
|
@@ -43,8 +43,10 @@ const DSTypography = (props) => {
|
|
|
43
43
|
const {
|
|
44
44
|
globalAttributes: { ...othersGlobalAttributes },
|
|
45
45
|
xstyledProps,
|
|
46
|
-
propsWithDefault
|
|
46
|
+
propsWithDefault
|
|
47
47
|
} = (0, import_useTypography.useTypography)(props);
|
|
48
|
+
const { as, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore } = propsWithDefault;
|
|
49
|
+
const ownerPropsConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
48
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
51
|
import_styled.StyledTypography,
|
|
50
52
|
{
|
|
@@ -57,6 +59,7 @@ const DSTypography = (props) => {
|
|
|
57
59
|
innerRef,
|
|
58
60
|
$truncateWithEllipsis: truncateWithEllipsis,
|
|
59
61
|
$truncateWithReadMore: truncateWithReadMore,
|
|
62
|
+
...ownerPropsConfig,
|
|
60
63
|
children: props.children
|
|
61
64
|
}
|
|
62
65
|
);
|
|
@@ -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, 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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useOwnerProps } 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,\n } = useTypography(props);\n const { as, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore } = propsWithDefault;\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\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}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n {...ownerPropsConfig}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\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;ADiBnB;AAhBJ,8BAAwC;AACxC,2BAA8B;AAC9B,mCAAgE;AAChE,uBAA2E;AAC3E,oBAAiC;AAEjC,MAAM,eAA8C,CAAC,UAAU;AAC7D,QAAM;AAAA,IACJ,kBAAkB,EAAE,GAAG,uBAAuB;AAAA,IAC9C;AAAA,IACA;AAAA,EACF,QAAI,oCAAc,KAAK;AACvB,QAAM,EAAE,IAAI,SAAS,UAAU,UAAU,sBAAsB,qBAAqB,IAAI;AACxF,QAAM,uBAAmB,uCAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,eAAa,wCAAuB,kCAAiB,kBAAkB;AAAA,MACtE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACtB,GAAG;AAAA,MAEH,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -52,7 +52,8 @@ const LEGACY_DATA_TESTID = {
|
|
|
52
52
|
// we are hardcoding this "typography-element" for legacy reason,
|
|
53
53
|
// people that were using this constant doesn't expect us to change the `keys` arbitrarily,
|
|
54
54
|
// having constant keys and changing value is literally the point of this kind of constants
|
|
55
|
-
"typography-element": "ds-typography-element"
|
|
55
|
+
"typography-element": "ds-typography-element",
|
|
56
|
+
TYPOGRAPHY_ELEMENT: "ds-typography-element"
|
|
56
57
|
};
|
|
57
58
|
const TYPOGRAPHY_DATA_TESTID = {
|
|
58
59
|
...(0, import_ds_system.slotObjectToDataTestIds)(DSTypographyName, TYPOGRAPHY_SLOTS),
|
|
@@ -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';\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 H3_STRONG: 'h3-strong',\n H4_STRONG: 'h4-strong',\n H5_STRONG: 'h5-strong',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n B1_LIGHT: 'b1-light',\n B2_LIGHT: 'b2-light',\n B3_LIGHT: 'b3-light',\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 FEEDBACK_BRAND: 'feedback-brand',\n FEEDBACK_NEUTRAL: 'feedback-neutral',\n FEEDBACK_IMPORTANT: 'feedback-important',\n FEEDBACK_CRITICAL: 'feedback-critical',\n BUTTON: 'button',\n BUTTON_SML_TITLE: 'button-sml-title',\n BUTTON_MED_TITLE: 'button-med-title',\n BUTTON_LRG_TITLE: 'button-lrg-title',\n LINK: 'link',\n LINK_SML_TITLE: 'link-sml-title',\n LINK_MED_TITLE: 'link-med-title',\n LINK_LRG_TITLE: 'link-lrg-title',\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;
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nexport const DSTypographyName = 'DSTypography';\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 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 H3_STRONG: 'h3-strong',\n H4_STRONG: 'h4-strong',\n H5_STRONG: 'h5-strong',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n B1_LIGHT: 'b1-light',\n B2_LIGHT: 'b2-light',\n B3_LIGHT: 'b3-light',\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 FEEDBACK_BRAND: 'feedback-brand',\n FEEDBACK_NEUTRAL: 'feedback-neutral',\n FEEDBACK_IMPORTANT: 'feedback-important',\n FEEDBACK_CRITICAL: 'feedback-critical',\n BUTTON: 'button',\n BUTTON_SML_TITLE: 'button-sml-title',\n BUTTON_MED_TITLE: 'button-med-title',\n BUTTON_LRG_TITLE: 'button-lrg-title',\n LINK: 'link',\n LINK_SML_TITLE: 'link-sml-title',\n LINK_MED_TITLE: 'link-med-title',\n LINK_LRG_TITLE: 'link-lrg-title',\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;AAAA,EACtB,oBAAoB;AACtB;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,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,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,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,7 +29,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var index_exports = {};
|
|
30
30
|
__export(index_exports, {
|
|
31
31
|
DSTypography: () => import_Typography.DSTypography,
|
|
32
|
+
DSTypographyName: () => import_constants.DSTypographyName,
|
|
32
33
|
DSTypographyWithSchema: () => import_Typography.DSTypographyWithSchema,
|
|
34
|
+
TYPOGRAPHY_DATA_TESTID: () => import_constants.TYPOGRAPHY_DATA_TESTID,
|
|
35
|
+
TYPOGRAPHY_SLOTS: () => import_constants.TYPOGRAPHY_SLOTS,
|
|
33
36
|
TYPOGRAPHY_VARIANTS: () => import_constants.TYPOGRAPHY_VARIANTS
|
|
34
37
|
});
|
|
35
38
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type {} from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\n\nexport { DSTypography, DSTypographyWithSchema } from './Typography.js';\nexport { TYPOGRAPHY_VARIANTS } from './constants/index.js';\nexport type { DSTypographyT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,wBAAqD;AACrD,
|
|
4
|
+
"sourcesContent": ["import type {} from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\n\nexport { DSTypography, DSTypographyWithSchema } from './Typography.js';\nexport { TYPOGRAPHY_VARIANTS, TYPOGRAPHY_SLOTS, TYPOGRAPHY_DATA_TESTID, DSTypographyName } from './constants/index.js';\nexport type { DSTypographyT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,wBAAqD;AACrD,uBAAgG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Typography.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { describe } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { describe, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
4
4
|
import { useTypography } from "./config/useTypography.js";
|
|
5
5
|
import { DSTypographyPropTypesSchema } from "./react-desc-prop-types.js";
|
|
6
6
|
import { DSTypographyName, TYPOGRAPHY_DATA_TESTID, TYPOGRAPHY_SLOTS } from "./constants/index.js";
|
|
@@ -9,8 +9,10 @@ const DSTypography = (props) => {
|
|
|
9
9
|
const {
|
|
10
10
|
globalAttributes: { ...othersGlobalAttributes },
|
|
11
11
|
xstyledProps,
|
|
12
|
-
propsWithDefault
|
|
12
|
+
propsWithDefault
|
|
13
13
|
} = useTypography(props);
|
|
14
|
+
const { as, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore } = propsWithDefault;
|
|
15
|
+
const ownerPropsConfig = useOwnerProps(propsWithDefault);
|
|
14
16
|
return /* @__PURE__ */ jsx(
|
|
15
17
|
StyledTypography,
|
|
16
18
|
{
|
|
@@ -23,6 +25,7 @@ const DSTypography = (props) => {
|
|
|
23
25
|
innerRef,
|
|
24
26
|
$truncateWithEllipsis: truncateWithEllipsis,
|
|
25
27
|
$truncateWithReadMore: truncateWithReadMore,
|
|
28
|
+
...ownerPropsConfig,
|
|
26
29
|
children: props.children
|
|
27
30
|
}
|
|
28
31
|
);
|
|
@@ -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, 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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useOwnerProps } 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,\n } = useTypography(props);\n const { as, variant, fontSize, innerRef, truncateWithEllipsis, truncateWithReadMore } = propsWithDefault;\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n\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}\n variant={variant}\n fontSize={fontSize}\n innerRef={innerRef}\n $truncateWithEllipsis={truncateWithEllipsis}\n $truncateWithReadMore={truncateWithReadMore}\n {...ownerPropsConfig}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypesSchema;\n\nexport { DSTypography, DSTypographyWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiBnB;AAhBJ,SAAS,UAAU,qBAAqB;AACxC,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;AAAA,EACF,IAAI,cAAc,KAAK;AACvB,QAAM,EAAE,IAAI,SAAS,UAAU,UAAU,sBAAsB,qBAAqB,IAAI;AACxF,QAAM,mBAAmB,cAAc,gBAAgB;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,eAAa,uBAAuB,iBAAiB,kBAAkB;AAAA,MACtE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACtB,GAAG;AAAA,MAEH,gBAAM;AAAA;AAAA,EACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,8 @@ const LEGACY_DATA_TESTID = {
|
|
|
15
15
|
// we are hardcoding this "typography-element" for legacy reason,
|
|
16
16
|
// people that were using this constant doesn't expect us to change the `keys` arbitrarily,
|
|
17
17
|
// having constant keys and changing value is literally the point of this kind of constants
|
|
18
|
-
"typography-element": "ds-typography-element"
|
|
18
|
+
"typography-element": "ds-typography-element",
|
|
19
|
+
TYPOGRAPHY_ELEMENT: "ds-typography-element"
|
|
19
20
|
};
|
|
20
21
|
const TYPOGRAPHY_DATA_TESTID = {
|
|
21
22
|
...slotObjectToDataTestIds(DSTypographyName, TYPOGRAPHY_SLOTS),
|
|
@@ -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';\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 H3_STRONG: 'h3-strong',\n H4_STRONG: 'h4-strong',\n H5_STRONG: 'h5-strong',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n B1_LIGHT: 'b1-light',\n B2_LIGHT: 'b2-light',\n B3_LIGHT: 'b3-light',\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 FEEDBACK_BRAND: 'feedback-brand',\n FEEDBACK_NEUTRAL: 'feedback-neutral',\n FEEDBACK_IMPORTANT: 'feedback-important',\n FEEDBACK_CRITICAL: 'feedback-critical',\n BUTTON: 'button',\n BUTTON_SML_TITLE: 'button-sml-title',\n BUTTON_MED_TITLE: 'button-med-title',\n BUTTON_LRG_TITLE: 'button-lrg-title',\n LINK: 'link',\n LINK_SML_TITLE: 'link-sml-title',\n LINK_MED_TITLE: 'link-med-title',\n LINK_LRG_TITLE: 'link-lrg-title',\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;
|
|
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';\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 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 H3_STRONG: 'h3-strong',\n H4_STRONG: 'h4-strong',\n H5_STRONG: 'h5-strong',\n B1: 'b1',\n B2: 'b2',\n B3: 'b3',\n B4: 'b4',\n B1_LIGHT: 'b1-light',\n B2_LIGHT: 'b2-light',\n B3_LIGHT: 'b3-light',\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 FEEDBACK_BRAND: 'feedback-brand',\n FEEDBACK_NEUTRAL: 'feedback-neutral',\n FEEDBACK_IMPORTANT: 'feedback-important',\n FEEDBACK_CRITICAL: 'feedback-critical',\n BUTTON: 'button',\n BUTTON_SML_TITLE: 'button-sml-title',\n BUTTON_MED_TITLE: 'button-med-title',\n BUTTON_LRG_TITLE: 'button-lrg-title',\n LINK: 'link',\n LINK_SML_TITLE: 'link-sml-title',\n LINK_MED_TITLE: 'link-med-title',\n LINK_LRG_TITLE: 'link-lrg-title',\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;AAAA,EACtB,oBAAoB;AACtB;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,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,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,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DSTypography, DSTypographyWithSchema } from "./Typography.js";
|
|
3
|
-
import { TYPOGRAPHY_VARIANTS } from "./constants/index.js";
|
|
3
|
+
import { TYPOGRAPHY_VARIANTS, TYPOGRAPHY_SLOTS, TYPOGRAPHY_DATA_TESTID, DSTypographyName } from "./constants/index.js";
|
|
4
4
|
export {
|
|
5
5
|
DSTypography,
|
|
6
|
+
DSTypographyName,
|
|
6
7
|
DSTypographyWithSchema,
|
|
8
|
+
TYPOGRAPHY_DATA_TESTID,
|
|
9
|
+
TYPOGRAPHY_SLOTS,
|
|
7
10
|
TYPOGRAPHY_VARIANTS
|
|
8
11
|
};
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\n\nexport { DSTypography, DSTypographyWithSchema } from './Typography.js';\nexport { TYPOGRAPHY_VARIANTS } from './constants/index.js';\nexport type { DSTypographyT } from './react-desc-prop-types.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,cAAc,8BAA8B;AACrD,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-props-helpers';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\n\nexport { DSTypography, DSTypographyWithSchema } from './Typography.js';\nexport { TYPOGRAPHY_VARIANTS, TYPOGRAPHY_SLOTS, TYPOGRAPHY_DATA_TESTID, DSTypographyName } from './constants/index.js';\nexport type { DSTypographyT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,cAAc,8BAA8B;AACrD,SAAS,qBAAqB,kBAAkB,wBAAwB,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,9 +6,11 @@ export declare const TYPOGRAPHY_SLOTS: {
|
|
|
6
6
|
export declare const LEGACY_DATA_TESTID: {
|
|
7
7
|
root: string;
|
|
8
8
|
'typography-element': string;
|
|
9
|
+
TYPOGRAPHY_ELEMENT: string;
|
|
9
10
|
};
|
|
10
11
|
export declare const TYPOGRAPHY_DATA_TESTID: {
|
|
11
12
|
root: string;
|
|
12
13
|
'typography-element': string;
|
|
14
|
+
TYPOGRAPHY_ELEMENT: string;
|
|
13
15
|
};
|
|
14
16
|
export declare const TYPOGRAPHY_VARIANTS: DSTypographyT.VariantsMap;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DSTypography, DSTypographyWithSchema } from './Typography.js';
|
|
2
|
-
export { TYPOGRAPHY_VARIANTS } from './constants/index.js';
|
|
2
|
+
export { TYPOGRAPHY_VARIANTS, TYPOGRAPHY_SLOTS, TYPOGRAPHY_DATA_TESTID, DSTypographyName } from './constants/index.js';
|
|
3
3
|
export type { DSTypographyT } from './react-desc-prop-types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-typography",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.53.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Typography",
|
|
6
6
|
"files": [
|
|
@@ -38,17 +38,18 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xstyled/system": "~3.7.3",
|
|
40
40
|
"@xstyled/util": "~3.7.0",
|
|
41
|
-
"@elliemae/ds-props-helpers": "3.
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
41
|
+
"@elliemae/ds-props-helpers": "3.53.0-alpha.2",
|
|
42
|
+
"@elliemae/ds-typescript-helpers": "3.53.0-alpha.2",
|
|
43
|
+
"@elliemae/ds-system": "3.53.0-alpha.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
46
|
+
"@elliemae/pui-cli": "9.0.0-next.65",
|
|
47
47
|
"jest": "~29.7.0",
|
|
48
48
|
"react": "^18.3.1",
|
|
49
49
|
"react-dom": "^18.3.1",
|
|
50
50
|
"react-test-renderer": "^18.3.1",
|
|
51
|
-
"@elliemae/ds-
|
|
51
|
+
"@elliemae/ds-test-utils": "3.53.0-alpha.2",
|
|
52
|
+
"@elliemae/ds-monorepo-devops": "3.53.0-alpha.2"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"@testing-library/jest-dom": "^6.6.3",
|