@elliemae/ds-typography 3.1.0-next.7
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/DSTypographyDatatestId.js +32 -0
- package/dist/cjs/DSTypographyDatatestId.js.map +7 -0
- package/dist/cjs/Typography.js +70 -0
- package/dist/cjs/Typography.js.map +7 -0
- package/dist/cjs/config/useDefaultProps.js +44 -0
- package/dist/cjs/config/useDefaultProps.js.map +7 -0
- package/dist/cjs/config/useTypography.js +39 -0
- package/dist/cjs/config/useTypography.js.map +7 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +62 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styled.js +119 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSTypographyDatatestId.js +10 -0
- package/dist/esm/DSTypographyDatatestId.js.map +7 -0
- package/dist/esm/Typography.js +50 -0
- package/dist/esm/Typography.js.map +7 -0
- package/dist/esm/config/useDefaultProps.js +22 -0
- package/dist/esm/config/useDefaultProps.js.map +7 -0
- package/dist/esm/config/useTypography.js +22 -0
- package/dist/esm/config/useTypography.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +46 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styled.js +97 -0
- package/dist/esm/styled.js.map +7 -0
- package/package.json +64 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var DSTypographyDatatestId_exports = {};
|
|
22
|
+
__export(DSTypographyDatatestId_exports, {
|
|
23
|
+
DSTypographyDataTestId: () => DSTypographyDataTestId,
|
|
24
|
+
DSTypographyName: () => DSTypographyName
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(DSTypographyDatatestId_exports);
|
|
27
|
+
var React = __toESM(require("react"));
|
|
28
|
+
const DSTypographyName = "DSTypography";
|
|
29
|
+
const DSTypographyDataTestId = {
|
|
30
|
+
TYPOGRAPHY_ELEMENT: "ds-typography-element"
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=DSTypographyDatatestId.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSTypographyDatatestId.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSTypographyName = 'DSTypography';\n\nexport const DSTypographyDataTestId = {\n TYPOGRAPHY_ELEMENT: 'ds-typography-element',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB;AAEzB,MAAM,yBAAyB;AAAA,EACpC,oBAAoB;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var Typography_exports = {};
|
|
39
|
+
__export(Typography_exports, {
|
|
40
|
+
DSTypography: () => DSTypography,
|
|
41
|
+
DSTypographyWithSchema: () => DSTypographyWithSchema
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(Typography_exports);
|
|
44
|
+
var React = __toESM(require("react"));
|
|
45
|
+
var import_react = __toESM(require("react"));
|
|
46
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
47
|
+
var import_useTypography = require("./config/useTypography");
|
|
48
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
49
|
+
var import_DSTypographyDatatestId = require("./DSTypographyDatatestId");
|
|
50
|
+
var import_styled = require("./styled");
|
|
51
|
+
const DSTypography = (props) => {
|
|
52
|
+
const {
|
|
53
|
+
globalAttributes,
|
|
54
|
+
xstyledProps,
|
|
55
|
+
propsWithDefault: { as, variant, color, fontSize }
|
|
56
|
+
} = (0, import_useTypography.useTypography)(props);
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledTypography, __spreadProps(__spreadValues(__spreadValues({
|
|
58
|
+
"data-testid": import_DSTypographyDatatestId.DSTypographyDataTestId.TYPOGRAPHY_ELEMENT
|
|
59
|
+
}, globalAttributes), xstyledProps), {
|
|
60
|
+
$as: as,
|
|
61
|
+
$variant: variant,
|
|
62
|
+
$color: color,
|
|
63
|
+
$fontSize: fontSize
|
|
64
|
+
}), props.children);
|
|
65
|
+
};
|
|
66
|
+
DSTypography.displayName = import_DSTypographyDatatestId.DSTypographyName;
|
|
67
|
+
DSTypography.propTypes = import_react_desc_prop_types.DSTypographyPropTypes;
|
|
68
|
+
const DSTypographyWithSchema = (0, import_ds_utilities.describe)(DSTypography);
|
|
69
|
+
DSTypographyWithSchema.propTypes = import_react_desc_prop_types.DSTypographyPropTypes;
|
|
70
|
+
//# sourceMappingURL=Typography.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Typography.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { useTypography } from './config/useTypography';\nimport { type DSTypographyT, DSTypographyPropTypes } from './react-desc-prop-types';\nimport { DSTypographyName, DSTypographyDataTestId } from './DSTypographyDatatestId';\nimport { StyledTypography } from './styled';\n\nconst DSTypography = (props: DSTypographyT.Props) => {\n const {\n globalAttributes,\n xstyledProps,\n propsWithDefault: { as, variant, color, fontSize },\n } = useTypography(props);\n return (\n <StyledTypography\n data-testid={DSTypographyDataTestId.TYPOGRAPHY_ELEMENT}\n {...globalAttributes}\n {...xstyledProps}\n $as={as}\n $variant={variant}\n $color={color}\n $fontSize={fontSize}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypes;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypes;\n\nexport { DSTypography, DSTypographyWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,0BAAyB;AACzB,2BAA8B;AAC9B,mCAA0D;AAC1D,oCAAyD;AACzD,oBAAiC;AAEjC,MAAM,eAAe,CAAC,UAA+B;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,IAAI,SAAS,OAAO;AAAA,MACtC,wCAAc,KAAK;AACvB,SACE,mDAAC;AAAA,IACC,eAAa,qDAAuB;AAAA,KAChC,mBACA,eAHL;AAAA,IAIC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,MAEV,MAAM,QACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,yBAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var useDefaultProps_exports = {};
|
|
22
|
+
__export(useDefaultProps_exports, {
|
|
23
|
+
useDefaultProps: () => useDefaultProps
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(useDefaultProps_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_react = __toESM(require("react"));
|
|
28
|
+
const VariantToAsMap = {
|
|
29
|
+
h1: "h1",
|
|
30
|
+
h2: "h2",
|
|
31
|
+
h3: "h3",
|
|
32
|
+
h4: "h4",
|
|
33
|
+
h5: "h5",
|
|
34
|
+
b1: "p",
|
|
35
|
+
b2: "p",
|
|
36
|
+
b3: "p",
|
|
37
|
+
b4: "p"
|
|
38
|
+
};
|
|
39
|
+
const useDefaultProps = ({ variant, as: userAs }) => {
|
|
40
|
+
const defaultAs = userAs || VariantToAsMap[variant];
|
|
41
|
+
const defaultProps = import_react.default.useMemo(() => ({ as: defaultAs }), [defaultAs]);
|
|
42
|
+
return defaultProps;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=useDefaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useDefaultProps.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { DSTypographyT } from '../react-desc-prop-types';\n\nconst VariantToAsMap = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n b1: 'p',\n b2: 'p',\n b3: 'p',\n b4: 'p',\n};\nexport const useDefaultProps = ({ variant, as: userAs }: DSTypographyT.Props) => {\n const defaultAs = userAs || VariantToAsMap[variant];\n const defaultProps = React.useMemo(() => ({ as: defaultAs }), [defaultAs]);\n return defaultProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGlB,MAAM,iBAAiB;AAAA,EACrB,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;AACN;AACO,MAAM,kBAAkB,CAAC,EAAE,SAAS,IAAI,aAAkC;AAC/E,QAAM,YAAY,UAAU,eAAe;AAC3C,QAAM,eAAe,qBAAM,QAAQ,MAAO,GAAE,IAAI,UAAU,IAAI,CAAC,SAAS,CAAC;AACzE,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var useTypography_exports = {};
|
|
22
|
+
__export(useTypography_exports, {
|
|
23
|
+
useTypography: () => useTypography
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(useTypography_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_react = __toESM(require("react"));
|
|
28
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
29
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types");
|
|
30
|
+
var import_useDefaultProps = require("./useDefaultProps");
|
|
31
|
+
const useTypography = (props) => {
|
|
32
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(props, import_react_desc_prop_types.DSTypographyPropTypes);
|
|
33
|
+
const defaultProps = (0, import_useDefaultProps.useDefaultProps)(props);
|
|
34
|
+
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
35
|
+
const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefault);
|
|
36
|
+
const xstyledProps = (0, import_ds_utilities.useGetXstyledProps)(propsWithDefault);
|
|
37
|
+
return import_react.default.useMemo(() => ({ propsWithDefault, globalAttributes, xstyledProps }), [globalAttributes, propsWithDefault, xstyledProps]);
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useTypography.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useTypography.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { DSTypographyPropTypes, DSTypographyT } from '../react-desc-prop-types';\nimport { useDefaultProps } from './useDefaultProps';\n\ninterface UseTypographyT {\n propsWithDefault: DSTypographyT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useTypography = (props: DSTypographyT.Props): UseTypographyT => {\n useValidateTypescriptPropTypes(props, DSTypographyPropTypes);\n const defaultProps = useDefaultProps(props);\n const propsWithDefault = useMemoMergePropsWithDefault<DSTypographyT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ propsWithDefault, globalAttributes, xstyledProps }),\n [globalAttributes, propsWithDefault, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,0BAOO;AAEP,mCAAqD;AACrD,6BAAgC;AAQzB,MAAM,gBAAgB,CAAC,UAA+C;AAC3E,0DAA+B,OAAO,kDAAqB;AAC3D,QAAM,eAAe,4CAAgB,KAAK;AAC1C,QAAM,mBAAmB,sDAA0D,OAAO,YAAY;AACtG,QAAM,mBAAmB,gDAAuB,gBAAgB;AAEhE,QAAM,eAAe,4CAAmB,gBAAgB;AACxD,SAAO,qBAAM,QACX,MAAO,GAAE,kBAAkB,kBAAkB,aAAa,IAC1D,CAAC,kBAAkB,kBAAkB,YAAY,CACnD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
DSTypography: () => import_Typography.DSTypography,
|
|
24
|
+
DSTypographyWithSchema: () => import_Typography.DSTypographyWithSchema
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
var React = __toESM(require("react"));
|
|
28
|
+
var import_Typography = require("./Typography");
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { DSTypography, DSTypographyWithSchema } from './Typography';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAqD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var react_desc_prop_types_exports = {};
|
|
39
|
+
__export(react_desc_prop_types_exports, {
|
|
40
|
+
DSTypographyPropTypes: () => DSTypographyPropTypes
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
43
|
+
var React = __toESM(require("react"));
|
|
44
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
45
|
+
const DSTypographyPropTypes = __spreadProps(__spreadValues(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), import_ds_utilities.xstyledPropTypes), {
|
|
46
|
+
variant: import_ds_utilities.PropTypes.oneOf(["h1", "h2", "h3", "h4", "h5", "b1", "b2", "b3", "b4"]).description(`
|
|
47
|
+
render the default style based on the variant and the default mapping HTML tag:
|
|
48
|
+
Variant to HTML Tag
|
|
49
|
+
h1 => <h1 />
|
|
50
|
+
h2 => <h2 />
|
|
51
|
+
h3 => <h3 />
|
|
52
|
+
h4 => <h4 />
|
|
53
|
+
h5 => <h5 />
|
|
54
|
+
b1 => <p />
|
|
55
|
+
b2 => <p />
|
|
56
|
+
b3 => <p />
|
|
57
|
+
b4 => <p />
|
|
58
|
+
`).isRequired,
|
|
59
|
+
children: import_ds_utilities.PropTypes.node.description("Children element").isRequired,
|
|
60
|
+
as: import_ds_utilities.PropTypes.string.description("Use to override the printed HTML tag, ex: `span` or `strong`")
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import {\n PropTypes,\n GlobalAttributesT,\n XstyledProps,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nexport declare namespace DSTypographyT {\n type Ivariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'b1' | 'b2' | 'b3' | 'b4';\n interface IProps {\n variant: Ivariant;\n as?: string;\n children: React.ReactNode | React.ReactNode[];\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLElement>, keyof IProps>, XstyledProps {}\n export interface InternalProps extends Props {\n as: string;\n }\n}\n\nexport const DSTypographyPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'b1', 'b2', 'b3', 'b4']).description(\n `\n render the default style based on the variant and the default mapping HTML tag:\n Variant to HTML Tag\n h1 => <h1 />\n h2 => <h2 />\n h3 => <h3 />\n h4 => <h4 />\n h5 => <h5 />\n b1 => <p />\n b2 => <p />\n b3 => <p />\n b4 => <p />\n `,\n ).isRequired,\n children: PropTypes.node.description('Children element').isRequired,\n as: PropTypes.string.description('Use to override the printed HTML tag, ex: `span` or `strong`'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAMO;AAiBA,MAAM,wBAAwB,gDAChC,gDACA,uCAFgC;AAAA,EAGnC,SAAS,8BAAU,MAAM,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,CAAC,EAAE,YAC/E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAaF,EAAE;AAAA,EACF,UAAU,8BAAU,KAAK,YAAY,kBAAkB,EAAE;AAAA,EACzD,IAAI,8BAAU,OAAO,YAAY,8DAA8D;AACjG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var styled_exports = {};
|
|
22
|
+
__export(styled_exports, {
|
|
23
|
+
StyledTypography: () => StyledTypography,
|
|
24
|
+
styleMap: () => styleMap
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(styled_exports);
|
|
27
|
+
var React = __toESM(require("react"));
|
|
28
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
29
|
+
var import_DSTypographyDatatestId = require("./DSTypographyDatatestId");
|
|
30
|
+
const styleMap = {
|
|
31
|
+
h1: {
|
|
32
|
+
fontSize: "34px",
|
|
33
|
+
lineHeight: "41px"
|
|
34
|
+
},
|
|
35
|
+
h2: {
|
|
36
|
+
fontSize: "24px",
|
|
37
|
+
lineHeight: "31px"
|
|
38
|
+
},
|
|
39
|
+
h3: {
|
|
40
|
+
fontSize: "18px",
|
|
41
|
+
lineHeight: "22px"
|
|
42
|
+
},
|
|
43
|
+
h4: {
|
|
44
|
+
fontSize: "16px",
|
|
45
|
+
lineHeight: "20px"
|
|
46
|
+
},
|
|
47
|
+
h5: {
|
|
48
|
+
fontSize: "14px",
|
|
49
|
+
lineHeight: "17px"
|
|
50
|
+
},
|
|
51
|
+
b1: {
|
|
52
|
+
fontSize: "14px",
|
|
53
|
+
lineHeight: "18px"
|
|
54
|
+
},
|
|
55
|
+
b2: {
|
|
56
|
+
fontSize: "13px",
|
|
57
|
+
lineHeight: "17px"
|
|
58
|
+
},
|
|
59
|
+
b3: {
|
|
60
|
+
fontSize: "12px",
|
|
61
|
+
lineHeight: "16px"
|
|
62
|
+
},
|
|
63
|
+
b4: {
|
|
64
|
+
fontSize: "11px",
|
|
65
|
+
lineHeight: "13px"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const mapper = {
|
|
69
|
+
h1: import_ds_system.css`
|
|
70
|
+
font-size: ${styleMap.h1.fontSize};
|
|
71
|
+
line-height: ${styleMap.h1.lineHeight};
|
|
72
|
+
`,
|
|
73
|
+
h2: import_ds_system.css`
|
|
74
|
+
font-size: ${styleMap.h2.fontSize};
|
|
75
|
+
line-height: ${styleMap.h2.lineHeight};
|
|
76
|
+
`,
|
|
77
|
+
h3: import_ds_system.css`
|
|
78
|
+
font-size: ${styleMap.h3.fontSize};
|
|
79
|
+
line-height: ${styleMap.h3.lineHeight};
|
|
80
|
+
`,
|
|
81
|
+
h4: import_ds_system.css`
|
|
82
|
+
font-size: ${styleMap.h4.fontSize};
|
|
83
|
+
line-height: ${styleMap.h4.lineHeight};
|
|
84
|
+
`,
|
|
85
|
+
h5: import_ds_system.css`
|
|
86
|
+
font-size: ${styleMap.h5.fontSize};
|
|
87
|
+
line-height: ${styleMap.h5.lineHeight};
|
|
88
|
+
`,
|
|
89
|
+
b1: import_ds_system.css`
|
|
90
|
+
font-size: ${styleMap.b1.fontSize};
|
|
91
|
+
line-height: ${styleMap.b1.lineHeight};
|
|
92
|
+
`,
|
|
93
|
+
b2: import_ds_system.css`
|
|
94
|
+
font-size: ${styleMap.b2.fontSize};
|
|
95
|
+
line-height: ${styleMap.b2.lineHeight};
|
|
96
|
+
`,
|
|
97
|
+
b3: import_ds_system.css`
|
|
98
|
+
font-size: ${styleMap.b3.fontSize};
|
|
99
|
+
line-height: ${styleMap.b3.lineHeight};
|
|
100
|
+
`,
|
|
101
|
+
b4: import_ds_system.css`
|
|
102
|
+
font-size: ${styleMap.b4.fontSize};
|
|
103
|
+
line-height: ${styleMap.b4.lineHeight};
|
|
104
|
+
`
|
|
105
|
+
};
|
|
106
|
+
const StyledTypography = (0, import_ds_system.styled)("div", {
|
|
107
|
+
name: import_DSTypographyDatatestId.DSTypographyName,
|
|
108
|
+
slot: import_DSTypographyDatatestId.DSTypographyDataTestId.TYPOGRAPHY_ELEMENT
|
|
109
|
+
})`
|
|
110
|
+
margin: 0;
|
|
111
|
+
padding: 0;
|
|
112
|
+
${(props) => mapper[props.$variant]}
|
|
113
|
+
${import_ds_system.fontSize}
|
|
114
|
+
${import_ds_system.space}
|
|
115
|
+
${import_ds_system.sizing}
|
|
116
|
+
${import_ds_system.layout}
|
|
117
|
+
${import_ds_system.color}
|
|
118
|
+
`;
|
|
119
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styled.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { styled, css, space, sizing, layout, color, fontSize } from '@elliemae/ds-system';\nimport { DSTypographyName, DSTypographyDataTestId } from './DSTypographyDatatestId';\nimport { DSTypographyT } from './react-desc-prop-types';\n\nexport const styleMap = {\n h1: {\n fontSize: '34px',\n lineHeight: '41px',\n },\n h2: {\n fontSize: '24px',\n lineHeight: '31px',\n },\n h3: {\n fontSize: '18px',\n lineHeight: '22px',\n },\n h4: {\n fontSize: '16px',\n lineHeight: '20px',\n },\n h5: {\n fontSize: '14px',\n lineHeight: '17px',\n },\n b1: {\n fontSize: '14px',\n lineHeight: '18px',\n },\n b2: {\n fontSize: '13px',\n lineHeight: '17px',\n },\n b3: {\n fontSize: '12px',\n lineHeight: '16px',\n },\n b4: {\n fontSize: '11px',\n lineHeight: '13px',\n },\n};\n\nconst mapper = {\n h1: css`\n font-size: ${styleMap.h1.fontSize};\n line-height: ${styleMap.h1.lineHeight};\n `,\n h2: css`\n font-size: ${styleMap.h2.fontSize};\n line-height: ${styleMap.h2.lineHeight};\n `,\n h3: css`\n font-size: ${styleMap.h3.fontSize};\n line-height: ${styleMap.h3.lineHeight};\n `,\n h4: css`\n font-size: ${styleMap.h4.fontSize};\n line-height: ${styleMap.h4.lineHeight};\n `,\n h5: css`\n font-size: ${styleMap.h5.fontSize};\n line-height: ${styleMap.h5.lineHeight};\n `,\n b1: css`\n font-size: ${styleMap.b1.fontSize};\n line-height: ${styleMap.b1.lineHeight};\n `,\n b2: css`\n font-size: ${styleMap.b2.fontSize};\n line-height: ${styleMap.b2.lineHeight};\n `,\n b3: css`\n font-size: ${styleMap.b3.fontSize};\n line-height: ${styleMap.b3.lineHeight};\n `,\n b4: css`\n font-size: ${styleMap.b4.fontSize};\n line-height: ${styleMap.b4.lineHeight};\n `,\n};\n\ntype StyleIProp = DSTypographyT.InternalProps & {\n $as: DSTypographyT.InternalProps['as'];\n $variant: DSTypographyT.InternalProps['variant'];\n children: DSTypographyT.InternalProps['children'];\n};\n\nexport const StyledTypography = styled('div', {\n name: DSTypographyName,\n slot: DSTypographyDataTestId.TYPOGRAPHY_ELEMENT,\n})<StyleIProp>`\n margin: 0;\n padding: 0;\n ${(props: StyleIProp) => mapper[props.$variant]}\n ${fontSize}\n ${space}\n ${sizing}\n ${layout}\n ${color}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoE;AACpE,oCAAyD;AAGlD,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF;AAEA,MAAM,SAAS;AAAA,EACb,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAE/B;AAQO,MAAM,mBAAmB,6BAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,qDAAuB;AAC/B,CAAC;AAAA;AAAA;AAAA,IAGG,CAAC,UAAsB,OAAO,MAAM;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const DSTypographyName = "DSTypography";
|
|
3
|
+
const DSTypographyDataTestId = {
|
|
4
|
+
TYPOGRAPHY_ELEMENT: "ds-typography-element"
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
DSTypographyDataTestId,
|
|
8
|
+
DSTypographyName
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=DSTypographyDatatestId.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTypographyDatatestId.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSTypographyName = 'DSTypography';\n\nexport const DSTypographyDataTestId = {\n TYPOGRAPHY_ELEMENT: 'ds-typography-element',\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,mBAAmB;AAEzB,MAAM,yBAAyB;AAAA,EACpC,oBAAoB;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import React2 from "react";
|
|
22
|
+
import { describe } from "@elliemae/ds-utilities";
|
|
23
|
+
import { useTypography } from "./config/useTypography";
|
|
24
|
+
import { DSTypographyPropTypes } from "./react-desc-prop-types";
|
|
25
|
+
import { DSTypographyName, DSTypographyDataTestId } from "./DSTypographyDatatestId";
|
|
26
|
+
import { StyledTypography } from "./styled";
|
|
27
|
+
const DSTypography = (props) => {
|
|
28
|
+
const {
|
|
29
|
+
globalAttributes,
|
|
30
|
+
xstyledProps,
|
|
31
|
+
propsWithDefault: { as, variant, color, fontSize }
|
|
32
|
+
} = useTypography(props);
|
|
33
|
+
return /* @__PURE__ */ React2.createElement(StyledTypography, __spreadProps(__spreadValues(__spreadValues({
|
|
34
|
+
"data-testid": DSTypographyDataTestId.TYPOGRAPHY_ELEMENT
|
|
35
|
+
}, globalAttributes), xstyledProps), {
|
|
36
|
+
$as: as,
|
|
37
|
+
$variant: variant,
|
|
38
|
+
$color: color,
|
|
39
|
+
$fontSize: fontSize
|
|
40
|
+
}), props.children);
|
|
41
|
+
};
|
|
42
|
+
DSTypography.displayName = DSTypographyName;
|
|
43
|
+
DSTypography.propTypes = DSTypographyPropTypes;
|
|
44
|
+
const DSTypographyWithSchema = describe(DSTypography);
|
|
45
|
+
DSTypographyWithSchema.propTypes = DSTypographyPropTypes;
|
|
46
|
+
export {
|
|
47
|
+
DSTypography,
|
|
48
|
+
DSTypographyWithSchema
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=Typography.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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-utilities';\nimport { useTypography } from './config/useTypography';\nimport { type DSTypographyT, DSTypographyPropTypes } from './react-desc-prop-types';\nimport { DSTypographyName, DSTypographyDataTestId } from './DSTypographyDatatestId';\nimport { StyledTypography } from './styled';\n\nconst DSTypography = (props: DSTypographyT.Props) => {\n const {\n globalAttributes,\n xstyledProps,\n propsWithDefault: { as, variant, color, fontSize },\n } = useTypography(props);\n return (\n <StyledTypography\n data-testid={DSTypographyDataTestId.TYPOGRAPHY_ELEMENT}\n {...globalAttributes}\n {...xstyledProps}\n $as={as}\n $variant={variant}\n $color={color}\n $fontSize={fontSize}\n >\n {props.children}\n </StyledTypography>\n );\n};\n\nDSTypography.displayName = DSTypographyName;\nDSTypography.propTypes = DSTypographyPropTypes;\nconst DSTypographyWithSchema = describe(DSTypography);\nDSTypographyWithSchema.propTypes = DSTypographyPropTypes;\n\nexport { DSTypography, DSTypographyWithSchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,eAAe,CAAC,UAA+B;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,kBAAkB,EAAE,IAAI,SAAS,OAAO;AAAA,MACtC,cAAc,KAAK;AACvB,SACE,qCAAC;AAAA,IACC,eAAa,uBAAuB;AAAA,KAChC,mBACA,eAHL;AAAA,IAIC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,WAAW;AAAA,MAEV,MAAM,QACT;AAEJ;AAEA,aAAa,cAAc;AAC3B,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
const VariantToAsMap = {
|
|
4
|
+
h1: "h1",
|
|
5
|
+
h2: "h2",
|
|
6
|
+
h3: "h3",
|
|
7
|
+
h4: "h4",
|
|
8
|
+
h5: "h5",
|
|
9
|
+
b1: "p",
|
|
10
|
+
b2: "p",
|
|
11
|
+
b3: "p",
|
|
12
|
+
b4: "p"
|
|
13
|
+
};
|
|
14
|
+
const useDefaultProps = ({ variant, as: userAs }) => {
|
|
15
|
+
const defaultAs = userAs || VariantToAsMap[variant];
|
|
16
|
+
const defaultProps = React2.useMemo(() => ({ as: defaultAs }), [defaultAs]);
|
|
17
|
+
return defaultProps;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
useDefaultProps
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useDefaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useDefaultProps.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSTypographyT } from '../react-desc-prop-types';\n\nconst VariantToAsMap = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n b1: 'p',\n b2: 'p',\n b3: 'p',\n b4: 'p',\n};\nexport const useDefaultProps = ({ variant, as: userAs }: DSTypographyT.Props) => {\n const defaultAs = userAs || VariantToAsMap[variant];\n const defaultProps = React.useMemo(() => ({ as: defaultAs }), [defaultAs]);\n return defaultProps;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGA,MAAM,iBAAiB;AAAA,EACrB,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;AACN;AACO,MAAM,kBAAkB,CAAC,EAAE,SAAS,IAAI,aAAkC;AAC/E,QAAM,YAAY,UAAU,eAAe;AAC3C,QAAM,eAAe,OAAM,QAAQ,MAAO,GAAE,IAAI,UAAU,IAAI,CAAC,SAAS,CAAC;AACzE,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import {
|
|
4
|
+
useGetGlobalAttributes,
|
|
5
|
+
useGetXstyledProps,
|
|
6
|
+
useMemoMergePropsWithDefault,
|
|
7
|
+
useValidateTypescriptPropTypes
|
|
8
|
+
} from "@elliemae/ds-utilities";
|
|
9
|
+
import { DSTypographyPropTypes } from "../react-desc-prop-types";
|
|
10
|
+
import { useDefaultProps } from "./useDefaultProps";
|
|
11
|
+
const useTypography = (props) => {
|
|
12
|
+
useValidateTypescriptPropTypes(props, DSTypographyPropTypes);
|
|
13
|
+
const defaultProps = useDefaultProps(props);
|
|
14
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
15
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
16
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
17
|
+
return React2.useMemo(() => ({ propsWithDefault, globalAttributes, xstyledProps }), [globalAttributes, propsWithDefault, xstyledProps]);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
useTypography
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useTypography.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTypography.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\n\nimport { DSTypographyPropTypes, DSTypographyT } from '../react-desc-prop-types';\nimport { useDefaultProps } from './useDefaultProps';\n\ninterface UseTypographyT {\n propsWithDefault: DSTypographyT.InternalProps;\n globalAttributes: GlobalAttributesT;\n xstyledProps: XstyledProps;\n}\n\nexport const useTypography = (props: DSTypographyT.Props): UseTypographyT => {\n useValidateTypescriptPropTypes(props, DSTypographyPropTypes);\n const defaultProps = useDefaultProps(props);\n const propsWithDefault = useMemoMergePropsWithDefault<DSTypographyT.InternalProps>(props, defaultProps);\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n return React.useMemo(\n () => ({ propsWithDefault, globalAttributes, xstyledProps }),\n [globalAttributes, propsWithDefault, xstyledProps],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAQO,MAAM,gBAAgB,CAAC,UAA+C;AAC3E,iCAA+B,OAAO,qBAAqB;AAC3D,QAAM,eAAe,gBAAgB,KAAK;AAC1C,QAAM,mBAAmB,6BAA0D,OAAO,YAAY;AACtG,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,SAAO,OAAM,QACX,MAAO,GAAE,kBAAkB,kBAAkB,aAAa,IAC1D,CAAC,kBAAkB,kBAAkB,YAAY,CACnD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTypography, DSTypographyWithSchema } from './Typography';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import {
|
|
22
|
+
PropTypes,
|
|
23
|
+
globalAttributesPropTypes,
|
|
24
|
+
xstyledPropTypes
|
|
25
|
+
} from "@elliemae/ds-utilities";
|
|
26
|
+
const DSTypographyPropTypes = __spreadProps(__spreadValues(__spreadValues({}, globalAttributesPropTypes), xstyledPropTypes), {
|
|
27
|
+
variant: PropTypes.oneOf(["h1", "h2", "h3", "h4", "h5", "b1", "b2", "b3", "b4"]).description(`
|
|
28
|
+
render the default style based on the variant and the default mapping HTML tag:
|
|
29
|
+
Variant to HTML Tag
|
|
30
|
+
h1 => <h1 />
|
|
31
|
+
h2 => <h2 />
|
|
32
|
+
h3 => <h3 />
|
|
33
|
+
h4 => <h4 />
|
|
34
|
+
h5 => <h5 />
|
|
35
|
+
b1 => <p />
|
|
36
|
+
b2 => <p />
|
|
37
|
+
b3 => <p />
|
|
38
|
+
b4 => <p />
|
|
39
|
+
`).isRequired,
|
|
40
|
+
children: PropTypes.node.description("Children element").isRequired,
|
|
41
|
+
as: PropTypes.string.description("Use to override the printed HTML tag, ex: `span` or `strong`")
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
DSTypographyPropTypes
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n PropTypes,\n GlobalAttributesT,\n XstyledProps,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nexport declare namespace DSTypographyT {\n type Ivariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'b1' | 'b2' | 'b3' | 'b4';\n interface IProps {\n variant: Ivariant;\n as?: string;\n children: React.ReactNode | React.ReactNode[];\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLElement>, keyof IProps>, XstyledProps {}\n export interface InternalProps extends Props {\n as: string;\n }\n}\n\nexport const DSTypographyPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'b1', 'b2', 'b3', 'b4']).description(\n `\n render the default style based on the variant and the default mapping HTML tag:\n Variant to HTML Tag\n h1 => <h1 />\n h2 => <h2 />\n h3 => <h3 />\n h4 => <h4 />\n h5 => <h5 />\n b1 => <p />\n b2 => <p />\n b3 => <p />\n b4 => <p />\n `,\n ).isRequired,\n children: PropTypes.node.description('Children element').isRequired,\n as: PropTypes.string.description('Use to override the printed HTML tag, ex: `span` or `strong`'),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAAA;AAAA;AAAA;AAAA;AAuBO,MAAM,wBAAwB,gDAChC,4BACA,mBAFgC;AAAA,EAGnC,SAAS,UAAU,MAAM,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,CAAC,EAAE,YAC/E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAaF,EAAE;AAAA,EACF,UAAU,UAAU,KAAK,YAAY,kBAAkB,EAAE;AAAA,EACzD,IAAI,UAAU,OAAO,YAAY,8DAA8D;AACjG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled, css, space, sizing, layout, color, fontSize } from "@elliemae/ds-system";
|
|
3
|
+
import { DSTypographyName, DSTypographyDataTestId } from "./DSTypographyDatatestId";
|
|
4
|
+
const styleMap = {
|
|
5
|
+
h1: {
|
|
6
|
+
fontSize: "34px",
|
|
7
|
+
lineHeight: "41px"
|
|
8
|
+
},
|
|
9
|
+
h2: {
|
|
10
|
+
fontSize: "24px",
|
|
11
|
+
lineHeight: "31px"
|
|
12
|
+
},
|
|
13
|
+
h3: {
|
|
14
|
+
fontSize: "18px",
|
|
15
|
+
lineHeight: "22px"
|
|
16
|
+
},
|
|
17
|
+
h4: {
|
|
18
|
+
fontSize: "16px",
|
|
19
|
+
lineHeight: "20px"
|
|
20
|
+
},
|
|
21
|
+
h5: {
|
|
22
|
+
fontSize: "14px",
|
|
23
|
+
lineHeight: "17px"
|
|
24
|
+
},
|
|
25
|
+
b1: {
|
|
26
|
+
fontSize: "14px",
|
|
27
|
+
lineHeight: "18px"
|
|
28
|
+
},
|
|
29
|
+
b2: {
|
|
30
|
+
fontSize: "13px",
|
|
31
|
+
lineHeight: "17px"
|
|
32
|
+
},
|
|
33
|
+
b3: {
|
|
34
|
+
fontSize: "12px",
|
|
35
|
+
lineHeight: "16px"
|
|
36
|
+
},
|
|
37
|
+
b4: {
|
|
38
|
+
fontSize: "11px",
|
|
39
|
+
lineHeight: "13px"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const mapper = {
|
|
43
|
+
h1: css`
|
|
44
|
+
font-size: ${styleMap.h1.fontSize};
|
|
45
|
+
line-height: ${styleMap.h1.lineHeight};
|
|
46
|
+
`,
|
|
47
|
+
h2: css`
|
|
48
|
+
font-size: ${styleMap.h2.fontSize};
|
|
49
|
+
line-height: ${styleMap.h2.lineHeight};
|
|
50
|
+
`,
|
|
51
|
+
h3: css`
|
|
52
|
+
font-size: ${styleMap.h3.fontSize};
|
|
53
|
+
line-height: ${styleMap.h3.lineHeight};
|
|
54
|
+
`,
|
|
55
|
+
h4: css`
|
|
56
|
+
font-size: ${styleMap.h4.fontSize};
|
|
57
|
+
line-height: ${styleMap.h4.lineHeight};
|
|
58
|
+
`,
|
|
59
|
+
h5: css`
|
|
60
|
+
font-size: ${styleMap.h5.fontSize};
|
|
61
|
+
line-height: ${styleMap.h5.lineHeight};
|
|
62
|
+
`,
|
|
63
|
+
b1: css`
|
|
64
|
+
font-size: ${styleMap.b1.fontSize};
|
|
65
|
+
line-height: ${styleMap.b1.lineHeight};
|
|
66
|
+
`,
|
|
67
|
+
b2: css`
|
|
68
|
+
font-size: ${styleMap.b2.fontSize};
|
|
69
|
+
line-height: ${styleMap.b2.lineHeight};
|
|
70
|
+
`,
|
|
71
|
+
b3: css`
|
|
72
|
+
font-size: ${styleMap.b3.fontSize};
|
|
73
|
+
line-height: ${styleMap.b3.lineHeight};
|
|
74
|
+
`,
|
|
75
|
+
b4: css`
|
|
76
|
+
font-size: ${styleMap.b4.fontSize};
|
|
77
|
+
line-height: ${styleMap.b4.lineHeight};
|
|
78
|
+
`
|
|
79
|
+
};
|
|
80
|
+
const StyledTypography = styled("div", {
|
|
81
|
+
name: DSTypographyName,
|
|
82
|
+
slot: DSTypographyDataTestId.TYPOGRAPHY_ELEMENT
|
|
83
|
+
})`
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 0;
|
|
86
|
+
${(props) => mapper[props.$variant]}
|
|
87
|
+
${fontSize}
|
|
88
|
+
${space}
|
|
89
|
+
${sizing}
|
|
90
|
+
${layout}
|
|
91
|
+
${color}
|
|
92
|
+
`;
|
|
93
|
+
export {
|
|
94
|
+
StyledTypography,
|
|
95
|
+
styleMap
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css, space, sizing, layout, color, fontSize } from '@elliemae/ds-system';\nimport { DSTypographyName, DSTypographyDataTestId } from './DSTypographyDatatestId';\nimport { DSTypographyT } from './react-desc-prop-types';\n\nexport const styleMap = {\n h1: {\n fontSize: '34px',\n lineHeight: '41px',\n },\n h2: {\n fontSize: '24px',\n lineHeight: '31px',\n },\n h3: {\n fontSize: '18px',\n lineHeight: '22px',\n },\n h4: {\n fontSize: '16px',\n lineHeight: '20px',\n },\n h5: {\n fontSize: '14px',\n lineHeight: '17px',\n },\n b1: {\n fontSize: '14px',\n lineHeight: '18px',\n },\n b2: {\n fontSize: '13px',\n lineHeight: '17px',\n },\n b3: {\n fontSize: '12px',\n lineHeight: '16px',\n },\n b4: {\n fontSize: '11px',\n lineHeight: '13px',\n },\n};\n\nconst mapper = {\n h1: css`\n font-size: ${styleMap.h1.fontSize};\n line-height: ${styleMap.h1.lineHeight};\n `,\n h2: css`\n font-size: ${styleMap.h2.fontSize};\n line-height: ${styleMap.h2.lineHeight};\n `,\n h3: css`\n font-size: ${styleMap.h3.fontSize};\n line-height: ${styleMap.h3.lineHeight};\n `,\n h4: css`\n font-size: ${styleMap.h4.fontSize};\n line-height: ${styleMap.h4.lineHeight};\n `,\n h5: css`\n font-size: ${styleMap.h5.fontSize};\n line-height: ${styleMap.h5.lineHeight};\n `,\n b1: css`\n font-size: ${styleMap.b1.fontSize};\n line-height: ${styleMap.b1.lineHeight};\n `,\n b2: css`\n font-size: ${styleMap.b2.fontSize};\n line-height: ${styleMap.b2.lineHeight};\n `,\n b3: css`\n font-size: ${styleMap.b3.fontSize};\n line-height: ${styleMap.b3.lineHeight};\n `,\n b4: css`\n font-size: ${styleMap.b4.fontSize};\n line-height: ${styleMap.b4.lineHeight};\n `,\n};\n\ntype StyleIProp = DSTypographyT.InternalProps & {\n $as: DSTypographyT.InternalProps['as'];\n $variant: DSTypographyT.InternalProps['variant'];\n children: DSTypographyT.InternalProps['children'];\n};\n\nexport const StyledTypography = styled('div', {\n name: DSTypographyName,\n slot: DSTypographyDataTestId.TYPOGRAPHY_ELEMENT,\n})<StyleIProp>`\n margin: 0;\n padding: 0;\n ${(props: StyleIProp) => mapper[props.$variant]}\n ${fontSize}\n ${space}\n ${sizing}\n ${layout}\n ${color}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAGO,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AACF;AAEA,MAAM,SAAS;AAAA,EACb,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAAA,EAE7B,IAAI;AAAA,iBACW,SAAS,GAAG;AAAA,mBACV,SAAS,GAAG;AAAA;AAE/B;AAQO,MAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,uBAAuB;AAC/B,CAAC;AAAA;AAAA;AAAA,IAGG,CAAC,UAAsB,OAAO,MAAM;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-typography",
|
|
3
|
+
"version": "3.1.0-next.7",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Typography",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"*.css",
|
|
20
|
+
"*.scss"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"pnpm": ">=6",
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"author": "ICE MT",
|
|
31
|
+
"jestSonar": {
|
|
32
|
+
"sonar56x": true,
|
|
33
|
+
"reportPath": "reports",
|
|
34
|
+
"reportFile": "tests.xml",
|
|
35
|
+
"indent": 4
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@elliemae/ds-system": "3.1.0-next.7",
|
|
39
|
+
"@elliemae/ds-utilities": "3.1.0-next.7"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@testing-library/jest-dom": "~5.16.2",
|
|
43
|
+
"@testing-library/react": "~12.1.2",
|
|
44
|
+
"@testing-library/user-event": "~13.5.0",
|
|
45
|
+
"react": "^17.0.2",
|
|
46
|
+
"react-dom": "^17.0.2"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^17.0.2",
|
|
50
|
+
"react-dom": "^17.0.2",
|
|
51
|
+
"styled-components": "^5.3.3"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public",
|
|
55
|
+
"typeSafety": false
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
59
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
60
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
61
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
62
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
63
|
+
}
|
|
64
|
+
}
|