@elliemae/ds-typography 3.24.0-next.0 → 3.24.0-next.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 +5 -6
- package/dist/cjs/Typography.js.map +2 -2
- package/dist/cjs/config/useDefaultProps.js +15 -1
- package/dist/cjs/config/useDefaultProps.js.map +2 -2
- package/dist/cjs/config/useTypography.js +2 -2
- package/dist/cjs/config/useTypography.js.map +2 -2
- package/dist/cjs/constants/index.js +78 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/styled.js +92 -0
- package/dist/cjs/parts/styled.js.map +7 -0
- package/dist/cjs/parts/variants/body-article.js +82 -0
- package/dist/cjs/parts/variants/body-article.js.map +7 -0
- package/dist/cjs/parts/variants/body.js +72 -0
- package/dist/cjs/parts/variants/body.js.map +7 -0
- package/dist/cjs/parts/variants/button.js +64 -0
- package/dist/cjs/parts/variants/button.js.map +7 -0
- package/dist/cjs/parts/variants/header-article.js +110 -0
- package/dist/cjs/parts/variants/header-article.js.map +7 -0
- package/dist/cjs/parts/variants/header.js +82 -0
- package/dist/cjs/parts/variants/header.js.map +7 -0
- package/dist/cjs/parts/variants/highlight.js +68 -0
- package/dist/cjs/parts/variants/highlight.js.map +7 -0
- package/dist/cjs/parts/variants/index.js +71 -0
- package/dist/cjs/parts/variants/index.js.map +7 -0
- package/dist/cjs/{DSTypographyDatatestId.js → parts/variants/link.js} +31 -9
- package/dist/cjs/parts/variants/link.js.map +7 -0
- package/dist/cjs/parts/variants/quote.js +76 -0
- package/dist/cjs/parts/variants/quote.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +59 -15
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/Typography.js +5 -6
- package/dist/esm/Typography.js.map +2 -2
- package/dist/esm/config/useDefaultProps.js +15 -1
- package/dist/esm/config/useDefaultProps.js.map +2 -2
- package/dist/esm/config/useTypography.js +1 -1
- package/dist/esm/config/useTypography.js.map +1 -1
- package/dist/esm/constants/index.js +48 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/styled.js +62 -0
- package/dist/esm/parts/styled.js.map +7 -0
- package/dist/esm/parts/variants/body-article.js +52 -0
- package/dist/esm/parts/variants/body-article.js.map +7 -0
- package/dist/esm/parts/variants/body.js +42 -0
- package/dist/esm/parts/variants/body.js.map +7 -0
- package/dist/esm/parts/variants/button.js +34 -0
- package/dist/esm/parts/variants/button.js.map +7 -0
- package/dist/esm/parts/variants/header-article.js +80 -0
- package/dist/esm/parts/variants/header-article.js.map +7 -0
- package/dist/esm/parts/variants/header.js +52 -0
- package/dist/esm/parts/variants/header.js.map +7 -0
- package/dist/esm/parts/variants/highlight.js +38 -0
- package/dist/esm/parts/variants/highlight.js.map +7 -0
- package/dist/esm/parts/variants/index.js +41 -0
- package/dist/esm/parts/variants/index.js.map +7 -0
- package/dist/esm/parts/variants/link.js +32 -0
- package/dist/esm/parts/variants/link.js.map +7 -0
- package/dist/esm/parts/variants/quote.js +46 -0
- package/dist/esm/parts/variants/quote.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +59 -15
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/constants/index.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/parts/styled.d.ts +11 -0
- package/dist/types/parts/variants/body-article.d.ts +7 -0
- package/dist/types/parts/variants/body.d.ts +7 -0
- package/dist/types/parts/variants/button.d.ts +7 -0
- package/dist/types/parts/variants/header-article.d.ts +7 -0
- package/dist/types/parts/variants/header.d.ts +7 -0
- package/dist/types/parts/variants/highlight.d.ts +7 -0
- package/dist/types/parts/variants/index.d.ts +14 -0
- package/dist/types/parts/variants/link.d.ts +7 -0
- package/dist/types/parts/variants/quote.d.ts +7 -0
- package/dist/types/react-desc-prop-types.d.ts +23 -3
- package/package.json +6 -8
- package/dist/cjs/DSTypographyDatatestId.js.map +0 -7
- package/dist/cjs/styled.js +0 -251
- package/dist/cjs/styled.js.map +0 -7
- package/dist/esm/DSTypographyDatatestId.js +0 -10
- package/dist/esm/DSTypographyDatatestId.js.map +0 -7
- package/dist/esm/styled.js +0 -221
- package/dist/esm/styled.js.map +0 -7
- package/dist/types/DSTypographyDatatestId.d.ts +0 -4
- package/dist/types/styled.d.ts +0 -100
package/dist/cjs/Typography.js
CHANGED
|
@@ -37,8 +37,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
38
|
var import_useTypography = require("./config/useTypography.js");
|
|
39
39
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
-
var
|
|
41
|
-
var import_styled = require("./styled.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
|
+
var import_styled = require("./parts/styled.js");
|
|
42
42
|
const DSTypography = (props) => {
|
|
43
43
|
const {
|
|
44
44
|
globalAttributes: { ...othersGlobalAttributes },
|
|
@@ -48,7 +48,6 @@ const DSTypography = (props) => {
|
|
|
48
48
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
49
|
import_styled.StyledTypography,
|
|
50
50
|
{
|
|
51
|
-
"data-testid": import_DSTypographyDatatestId.DSTypographyDataTestId.TYPOGRAPHY_ELEMENT,
|
|
52
51
|
...othersGlobalAttributes,
|
|
53
52
|
...xstyledProps,
|
|
54
53
|
as: as || component,
|
|
@@ -61,8 +60,8 @@ const DSTypography = (props) => {
|
|
|
61
60
|
}
|
|
62
61
|
);
|
|
63
62
|
};
|
|
64
|
-
DSTypography.displayName =
|
|
65
|
-
DSTypography.propTypes = import_react_desc_prop_types.
|
|
63
|
+
DSTypography.displayName = import_constants.DSTypographyName;
|
|
64
|
+
DSTypography.propTypes = import_react_desc_prop_types.DSTypographyPropTypesSchema;
|
|
66
65
|
const DSTypographyWithSchema = (0, import_ds_props_helpers.describe)(DSTypography);
|
|
67
|
-
DSTypographyWithSchema.propTypes = import_react_desc_prop_types.
|
|
66
|
+
DSTypographyWithSchema.propTypes = import_react_desc_prop_types.DSTypographyPropTypesSchema;
|
|
68
67
|
//# sourceMappingURL=Typography.js.map
|
|
@@ -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,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcnB;AAbJ,8BAAyB;AACzB,2BAA8B;AAC9B,
|
|
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 ref={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,KAAK;AAAA,MACL,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
|
}
|
|
@@ -44,7 +44,21 @@ const VariantToAsMap = {
|
|
|
44
44
|
b3: "p",
|
|
45
45
|
b4: "p",
|
|
46
46
|
button: "button",
|
|
47
|
-
link: "a"
|
|
47
|
+
link: "a",
|
|
48
|
+
"quote-brand": "pre",
|
|
49
|
+
"quote-neutral": "pre",
|
|
50
|
+
"highlight-neutral": "span",
|
|
51
|
+
"highlight-brand": "span",
|
|
52
|
+
"highlight-important": "span",
|
|
53
|
+
"highlight-critical": "span",
|
|
54
|
+
"h1-article": "h1",
|
|
55
|
+
"h2-article": "h2",
|
|
56
|
+
"h3-article": "h3",
|
|
57
|
+
"h4-article": "h4",
|
|
58
|
+
"h5-article": "h5",
|
|
59
|
+
"b1-article": "p",
|
|
60
|
+
"b2-article": "p",
|
|
61
|
+
"b3-article": "p"
|
|
48
62
|
};
|
|
49
63
|
const useDefaultProps = ({ variant, as: userAs }) => {
|
|
50
64
|
const defaultAs = userAs || VariantToAsMap[variant];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useDefaultProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nconst VariantToAsMap: Record<DSTypographyT.Variant, keyof JSX.IntrinsicElements> = {\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 button: 'button',\n link: 'a',\n};\nexport const useDefaultProps = ({ variant, as: userAs }: DSTypographyT.Props): { as: keyof JSX.IntrinsicElements } => {\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,iBAA6E;AAAA,EACjF,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,QAAQ;AAAA,EACR,MAAM;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\n\nconst VariantToAsMap: Record<DSTypographyT.Variant, keyof JSX.IntrinsicElements> = {\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 button: 'button',\n link: 'a',\n 'quote-brand': 'pre',\n 'quote-neutral': 'pre',\n 'highlight-neutral': 'span',\n 'highlight-brand': 'span',\n 'highlight-important': 'span',\n 'highlight-critical': 'span',\n 'h1-article': 'h1',\n 'h2-article': 'h2',\n 'h3-article': 'h3',\n 'h4-article': 'h4',\n 'h5-article': 'h5',\n 'b1-article': 'p',\n 'b2-article': 'p',\n 'b3-article': 'p',\n};\nexport const useDefaultProps = ({ variant, as: userAs }: DSTypographyT.Props): { as: keyof JSX.IntrinsicElements } => {\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,iBAA6E;AAAA,EACjF,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,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAChB;AACO,MAAM,kBAAkB,CAAC,EAAE,SAAS,IAAI,OAAO,MAAgE;AACpH,QAAM,YAAY,UAAU,eAAe,OAAO;AAClD,QAAM,eAAe,aAAAA,QAAM,QAAQ,OAAO,EAAE,IAAI,UAAU,IAAI,CAAC,SAAS,CAAC;AACzE,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -36,9 +36,9 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
37
|
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
38
38
|
var import_useDefaultProps = require("./useDefaultProps.js");
|
|
39
|
-
var
|
|
39
|
+
var import_constants = require("../constants/index.js");
|
|
40
40
|
const useTypography = (props) => {
|
|
41
|
-
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_react_desc_prop_types.DSTypographyPropTypes,
|
|
41
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, import_react_desc_prop_types.DSTypographyPropTypes, import_constants.DSTypographyName);
|
|
42
42
|
const defaultProps = (0, import_useDefaultProps.useDefaultProps)(props);
|
|
43
43
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, defaultProps);
|
|
44
44
|
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useTypography.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\nimport { DSTypographyPropTypes } from '../react-desc-prop-types.js';\nimport { useDefaultProps } from './useDefaultProps.js';\nimport { DSTypographyName } from '../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGlB,8BAKO;AAEP,mCAAsC;AACtC,6BAAgC;AAChC,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\nimport { DSTypographyPropTypes } from '../react-desc-prop-types.js';\nimport { useDefaultProps } from './useDefaultProps.js';\nimport { DSTypographyName } from '../constants/index.js';\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, DSTypographyName);\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;AAGlB,8BAKO;AAEP,mCAAsC;AACtC,6BAAgC;AAChC,uBAAiC;AAQ1B,MAAM,gBAAgB,CAAC,UAA+C;AAC3E,8DAA+B,OAAO,oDAAuB,iCAAgB;AAC7E,QAAM,mBAAe,wCAAgB,KAAK;AAC1C,QAAM,uBAAmB,sDAA0D,OAAO,YAAY;AACtG,QAAM,uBAAmB,gDAAuB,gBAAgB;AAEhE,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO,EAAE,kBAAkB,kBAAkB,aAAa;AAAA,IAC1D,CAAC,kBAAkB,kBAAkB,YAAY;AAAA,EACnD;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DSTypographyName: () => DSTypographyName,
|
|
32
|
+
TYPOGRAPHY_DATA_TESTID: () => TYPOGRAPHY_DATA_TESTID,
|
|
33
|
+
TYPOGRAPHY_SLOTS: () => TYPOGRAPHY_SLOTS,
|
|
34
|
+
TYPOGRAPHY_VARIANTS: () => TYPOGRAPHY_VARIANTS
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(constants_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
const DSTypographyName = "DSTypography";
|
|
40
|
+
const TYPOGRAPHY_SLOTS = {
|
|
41
|
+
// 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...
|
|
44
|
+
};
|
|
45
|
+
const TYPOGRAPHY_DATA_TESTID = {
|
|
46
|
+
...(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"
|
|
50
|
+
};
|
|
51
|
+
const TYPOGRAPHY_VARIANTS = {
|
|
52
|
+
H1: "h1",
|
|
53
|
+
H2: "h2",
|
|
54
|
+
H3: "h3",
|
|
55
|
+
H4: "h4",
|
|
56
|
+
H5: "h5",
|
|
57
|
+
B1: "b1",
|
|
58
|
+
B2: "b2",
|
|
59
|
+
B3: "b3",
|
|
60
|
+
B4: "b4",
|
|
61
|
+
H1_ARTICLE: "h1-article",
|
|
62
|
+
H2_ARTICLE: "h2-article",
|
|
63
|
+
H3_ARTICLE: "h3-article",
|
|
64
|
+
H4_ARTICLE: "h4-article",
|
|
65
|
+
H5_ARTICLE: "h5-article",
|
|
66
|
+
B1_ARTICLE: "b1-article",
|
|
67
|
+
B2_ARTICLE: "b2-article",
|
|
68
|
+
B3_ARTICLE: "b3-article",
|
|
69
|
+
QUOTE_BRAND: "quote-brand",
|
|
70
|
+
QUOTE_NEUTRAL: "quote-neutral",
|
|
71
|
+
HIGHLIGHT_NEUTRAL: "highlight-neutral",
|
|
72
|
+
HIGHLIGHT_BRAND: "highlight-brand",
|
|
73
|
+
HIGHLIGHT_IMPORTANT: "highlight-important",
|
|
74
|
+
HIGHLIGHT_CRITICAL: "highlight-critical",
|
|
75
|
+
BUTTON: "button",
|
|
76
|
+
LINK: "link"
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,9 +29,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var src_exports = {};
|
|
30
30
|
__export(src_exports, {
|
|
31
31
|
DSTypography: () => import_Typography.DSTypography,
|
|
32
|
-
DSTypographyWithSchema: () => import_Typography.DSTypographyWithSchema
|
|
32
|
+
DSTypographyWithSchema: () => import_Typography.DSTypographyWithSchema,
|
|
33
|
+
TYPOGRAPHY_VARIANTS: () => import_constants.TYPOGRAPHY_VARIANTS
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(src_exports);
|
|
35
36
|
var React = __toESM(require("react"));
|
|
36
37
|
var import_Typography = require("./Typography.js");
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
37
39
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.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';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,wBAAqD;",
|
|
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';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,wBAAqD;AACrD,uBAAoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styled_exports = {};
|
|
30
|
+
__export(styled_exports, {
|
|
31
|
+
StyledTypography: () => StyledTypography
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(styled_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
var import_variants = require("./variants/index.js");
|
|
38
|
+
const noWrapStyle = import_ds_system.css`
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
`;
|
|
45
|
+
const wrapStyle = import_ds_system.css`
|
|
46
|
+
overflow-wrap: break-word;
|
|
47
|
+
white-space: pre-wrap;
|
|
48
|
+
`;
|
|
49
|
+
const truncateWithReadMoreStyle = (readMoreMeta) => import_ds_system.css`
|
|
50
|
+
display: -webkit-box;
|
|
51
|
+
-webkit-line-clamp: ${readMoreMeta.expanded ? "unset" : readMoreMeta.lines};
|
|
52
|
+
-webkit-box-orient: vertical;
|
|
53
|
+
hyphens: auto;
|
|
54
|
+
word-break: break-all;
|
|
55
|
+
`;
|
|
56
|
+
const shortHandsColorMap = {
|
|
57
|
+
neutral: import_ds_system.css`
|
|
58
|
+
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
59
|
+
`,
|
|
60
|
+
brand: import_ds_system.css`
|
|
61
|
+
color: ${({ theme }) => theme.colors.brand[800]};
|
|
62
|
+
`,
|
|
63
|
+
important: import_ds_system.css`
|
|
64
|
+
color: #853c12;
|
|
65
|
+
`,
|
|
66
|
+
critical: import_ds_system.css`
|
|
67
|
+
color: #c70916;
|
|
68
|
+
`
|
|
69
|
+
};
|
|
70
|
+
const specificShorthands = ["neutral", "brand", "important", "critical"];
|
|
71
|
+
const isSpecificShorthand = (color) => specificShorthands.includes(color);
|
|
72
|
+
const StyledTypography = (0, import_ds_system.styled)("div", {
|
|
73
|
+
name: import_constants.DSTypographyName,
|
|
74
|
+
slot: import_constants.TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT
|
|
75
|
+
}).withConfig({
|
|
76
|
+
shouldForwardProp: (prop, defaultValidatorFn) => !["fontSize", "color", "as", "variant"].includes(String(prop)) && defaultValidatorFn(prop)
|
|
77
|
+
})`
|
|
78
|
+
margin: 0;
|
|
79
|
+
padding: 0;
|
|
80
|
+
${(props) => import_variants.VARIANTS_CSS_MAP[props.variant]}
|
|
81
|
+
${import_ds_system.xStyledCommonProps}
|
|
82
|
+
${(props) => {
|
|
83
|
+
if (!props.color || !isSpecificShorthand(props.color))
|
|
84
|
+
return import_ds_system.css``;
|
|
85
|
+
return shortHandsColorMap[props.color];
|
|
86
|
+
}}
|
|
87
|
+
|
|
88
|
+
${(props) => props.$truncateWithEllipsis ? noWrapStyle : wrapStyle}
|
|
89
|
+
|
|
90
|
+
${(props) => props.$truncateWithReadMore ? truncateWithReadMoreStyle(props.$truncateWithReadMore) : ""}
|
|
91
|
+
`;
|
|
92
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/styled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../react-desc-prop-types.js';\nimport { DSTypographyName, TYPOGRAPHY_SLOTS } from '../constants/index.js';\nimport { VARIANTS_CSS_MAP } from './variants/index.js';\n\nconst noWrapStyle = css`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\nconst wrapStyle = css`\n overflow-wrap: break-word;\n white-space: pre-wrap;\n`;\n\nconst truncateWithReadMoreStyle = (\n readMoreMeta: Required<DSTypographyT.StyledPropsInterface>['$truncateWithReadMore'],\n) => css`\n display: -webkit-box;\n -webkit-line-clamp: ${readMoreMeta.expanded ? 'unset' : readMoreMeta.lines};\n -webkit-box-orient: vertical;\n hyphens: auto;\n word-break: break-all;\n`;\n\n// support for `color` shorthands that are not available in the theme and are specific to the typography component\nconst shortHandsColorMap = {\n neutral: css`\n color: ${({ theme }) => theme.colors.neutral[600]};\n `,\n brand: css`\n color: ${({ theme }) => theme.colors.brand[800]};\n `,\n important: css`\n color: #853c12;\n `,\n critical: css`\n color: #c70916;\n `,\n};\nconst specificShorthands = ['neutral', 'brand', 'important', 'critical'];\nconst isSpecificShorthand = (color: string): color is keyof typeof shortHandsColorMap =>\n specificShorthands.includes(color);\n\n// xStyledCommonProps need to be always AFTER the VARIANTS_CSS_MAP\n// this allows to override the default styles with the props if users want to\nexport const StyledTypography = styled('div', {\n name: DSTypographyName,\n slot: TYPOGRAPHY_SLOTS.TYPOGRAPHY_ELEMENT,\n}).withConfig({\n shouldForwardProp: (prop, defaultValidatorFn) =>\n !['fontSize', 'color', 'as', 'variant'].includes(String(prop)) && defaultValidatorFn(prop),\n})<DSTypographyT.StyledPropsInterface>`\n margin: 0;\n padding: 0;\n ${(props: DSTypographyT.StyledPropsInterface) => VARIANTS_CSS_MAP[props.variant]}\n ${xStyledCommonProps}\n ${(props) => {\n // support for color shorthands that are not available in the theme\n if (!props.color || !isSpecificShorthand(props.color)) return css``;\n\n return shortHandsColorMap[props.color];\n }}\n\n ${(props: DSTypographyT.StyledPropsInterface) => (props.$truncateWithEllipsis ? noWrapStyle : wrapStyle)}\n\n ${(props: DSTypographyT.StyledPropsInterface) =>\n props.$truncateWithReadMore ? truncateWithReadMoreStyle(props.$truncateWithReadMore) : ''}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAgD;AAEhD,uBAAmD;AACnD,sBAAiC;AAEjC,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,MAAM,YAAY;AAAA;AAAA;AAAA;AAKlB,MAAM,4BAA4B,CAChC,iBACG;AAAA;AAAA,wBAEmB,aAAa,WAAW,UAAU,aAAa;AAAA;AAAA;AAAA;AAAA;AAOvE,MAAM,qBAAqB;AAAA,EACzB,SAAS;AAAA,aACE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA,EAElD,OAAO;AAAA,aACI,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA,EAEhD,WAAW;AAAA;AAAA;AAAA,EAGX,UAAU;AAAA;AAAA;AAGZ;AACA,MAAM,qBAAqB,CAAC,WAAW,SAAS,aAAa,UAAU;AACvE,MAAM,sBAAsB,CAAC,UAC3B,mBAAmB,SAAS,KAAK;AAI5B,MAAM,uBAAmB,yBAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC,EAAE,WAAW;AAAA,EACZ,mBAAmB,CAAC,MAAM,uBACxB,CAAC,CAAC,YAAY,SAAS,MAAM,SAAS,EAAE,SAAS,OAAO,IAAI,CAAC,KAAK,mBAAmB,IAAI;AAC7F,CAAC;AAAA;AAAA;AAAA,IAGG,CAAC,UAA8C,iCAAiB,MAAM,OAAO;AAAA,IAC7E;AAAA,IACA,CAAC,UAAU;AAEX,MAAI,CAAC,MAAM,SAAS,CAAC,oBAAoB,MAAM,KAAK;AAAG,WAAO;AAE9D,SAAO,mBAAmB,MAAM,KAAK;AACvC;AAAA;AAAA,IAEE,CAAC,UAA+C,MAAM,wBAAwB,cAAc;AAAA;AAAA,IAE5F,CAAC,UACD,MAAM,wBAAwB,0BAA0B,MAAM,qBAAqB,IAAI;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var body_article_exports = {};
|
|
30
|
+
__export(body_article_exports, {
|
|
31
|
+
VARIANTS_CSS_BODY_ARTICLE: () => VARIANTS_CSS_BODY_ARTICLE
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(body_article_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_constants = require("../../constants/index.js");
|
|
37
|
+
const typedCss = () => import_ds_system.css``;
|
|
38
|
+
const VARIANTS_CSS_BODY_ARTICLE = {
|
|
39
|
+
// font-size: 16px/RT | line-height: 20px/RT
|
|
40
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B1_ARTICLE]: import_ds_system.css`
|
|
41
|
+
font-size: ${(props) => props.fontSize ?? "1rem"}; // 16px -> 16/16 = 1rem
|
|
42
|
+
line-height: ${(props) => props.lineHeight ?? "1.25rem"}; // 20px -> 20/16 = 1.25rem
|
|
43
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
44
|
+
font-size: ${(props) => props.fontSize ?? "1.230769230769231rem"}; // 16px -> 16/13 = 1.230769230769231rem
|
|
45
|
+
line-height: ${(props) => props.lineHeight ?? "1.538461538461538rem"}; // 20px -> 20/13 = 1.538461538461538rem
|
|
46
|
+
}
|
|
47
|
+
margin-bottom: 24px;
|
|
48
|
+
color: ${(props) => props.theme.colors.neutral[700]};
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
overflow-wrap: break-word;
|
|
51
|
+
white-space: pre-wrap;
|
|
52
|
+
`,
|
|
53
|
+
// font-size: 14px/RT | line-height: 18px/RT
|
|
54
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B2_ARTICLE]: import_ds_system.css`
|
|
55
|
+
font-size: ${(props) => props.fontSize ?? "0.875rem"}; // 14px -> 14/16 = 0.875rem
|
|
56
|
+
line-height: ${(props) => props.lineHeight ?? "1.125rem"}; // 18px -> 18/16 = 1.125rem
|
|
57
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
58
|
+
font-size: ${(props) => props.fontSize ?? "1.076923076923077rem"}; // 14px -> 14/13 = 1.076923076923077rem
|
|
59
|
+
line-height: ${(props) => props.lineHeight ?? "1.384615384615385rem"}; // 18px -> 18/13 = 1.384615384615385rem
|
|
60
|
+
}
|
|
61
|
+
margin-bottom: 24px;
|
|
62
|
+
color: ${(props) => props.theme.colors.neutral[700]};
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
overflow-wrap: break-word;
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
`,
|
|
67
|
+
// font-size: 13px/RT | line-height: 17px/RT
|
|
68
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B3_ARTICLE]: import_ds_system.css`
|
|
69
|
+
font-size: ${(props) => props.fontSize ?? "0.8125rem"}; // 13px -> 13/16 = 0.8125rem
|
|
70
|
+
line-height: ${(props) => props.lineHeight ?? "1.0625rem"}; // 17px -> 17/16 = 1.0625rem
|
|
71
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
72
|
+
font-size: ${(props) => props.fontSize ?? "1rem"}; // 13px -> 13/13 = 1rem
|
|
73
|
+
line-height: ${(props) => props.lineHeight ?? "1.307692307692308rem"}; // 17px -> 17/13 = 1.307692307692308rem
|
|
74
|
+
}
|
|
75
|
+
margin-bottom: 24px;
|
|
76
|
+
color: ${(props) => props.theme.colors.neutral[700]};
|
|
77
|
+
font-weight: 400;
|
|
78
|
+
overflow-wrap: break-word;
|
|
79
|
+
white-space: pre-wrap;
|
|
80
|
+
`
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=body-article.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/variants/body-article.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { css } from '@elliemae/ds-system';\nimport { TYPOGRAPHY_VARIANTS } from '../../constants/index.js';\nimport type { DSTypographyT } from '../../react-desc-prop-types.js';\n\n// typescript \"hack\" to infer the ReturnType of a generic function (css) with a generic argument (DSTypographyT.StyledPropsInterface)\n// as of 14/november/2023 I was not able to find a better way to do this.\nconst typedCss = () => css<DSTypographyT.StyledPropsInterface>``;\ntype ArticleBodyCSSMap = {\n [key in DSTypographyT.ArticleBodyVariants]: ReturnType<typeof typedCss>;\n};\n\n// as of 14/november/2023\n// mobile -> font-size: 16px\n// desktop -> font-size: 13px\n// the \"magic values\" of the rem units are the result of the following formula:\n// (variant's requirement px/RT value / 16px) for mobile\n// (variant's requirement px/RT value / 13px) for desktop\nexport const VARIANTS_CSS_BODY_ARTICLE: ArticleBodyCSSMap = {\n // font-size: 16px/RT | line-height: 20px/RT\n [TYPOGRAPHY_VARIANTS.B1_ARTICLE]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '1rem'}; // 16px -> 16/16 = 1rem\n line-height: ${(props) => props.lineHeight ?? '1.25rem'}; // 20px -> 20/16 = 1.25rem\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1.230769230769231rem'}; // 16px -> 16/13 = 1.230769230769231rem\n line-height: ${(props) => props.lineHeight ?? '1.538461538461538rem'}; // 20px -> 20/13 = 1.538461538461538rem\n }\n margin-bottom: 24px;\n color: ${(props) => props.theme.colors.neutral[700]};\n font-weight: 400;\n overflow-wrap: break-word;\n white-space: pre-wrap;\n `,\n // font-size: 14px/RT | line-height: 18px/RT\n [TYPOGRAPHY_VARIANTS.B2_ARTICLE]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.875rem'}; // 14px -> 14/16 = 0.875rem\n line-height: ${(props) => props.lineHeight ?? '1.125rem'}; // 18px -> 18/16 = 1.125rem\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1.076923076923077rem'}; // 14px -> 14/13 = 1.076923076923077rem\n line-height: ${(props) => props.lineHeight ?? '1.384615384615385rem'}; // 18px -> 18/13 = 1.384615384615385rem\n }\n margin-bottom: 24px;\n color: ${(props) => props.theme.colors.neutral[700]};\n font-weight: 400;\n overflow-wrap: break-word;\n white-space: pre-wrap;\n `,\n // font-size: 13px/RT | line-height: 17px/RT\n [TYPOGRAPHY_VARIANTS.B3_ARTICLE]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.8125rem'}; // 13px -> 13/16 = 0.8125rem\n line-height: ${(props) => props.lineHeight ?? '1.0625rem'}; // 17px -> 17/16 = 1.0625rem\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1rem'}; // 13px -> 13/13 = 1rem\n line-height: ${(props) => props.lineHeight ?? '1.307692307692308rem'}; // 17px -> 17/13 = 1.307692307692308rem\n }\n margin-bottom: 24px;\n color: ${(props) => props.theme.colors.neutral[700]};\n font-weight: 400;\n overflow-wrap: break-word;\n white-space: pre-wrap;\n `,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AACpB,uBAAoC;AAKpC,MAAM,WAAW,MAAM;AAWhB,MAAM,4BAA+C;AAAA;AAAA,EAE1D,CAAC,qCAAoB,UAAU,GAAG;AAAA,iBACnB,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,aAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpD,CAAC,qCAAoB,UAAU,GAAG;AAAA,iBACnB,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,aAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpD,CAAC,qCAAoB,UAAU,GAAG;AAAA,iBACnB,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,aAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAKtD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var body_exports = {};
|
|
30
|
+
__export(body_exports, {
|
|
31
|
+
VARIANTS_CSS_BODY: () => VARIANTS_CSS_BODY
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(body_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_constants = require("../../constants/index.js");
|
|
37
|
+
const typedCss = () => import_ds_system.css``;
|
|
38
|
+
const VARIANTS_CSS_BODY = {
|
|
39
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B1]: import_ds_system.css`
|
|
40
|
+
font-size: ${(props) => props.fontSize ?? "0.8775000000000001rem"};
|
|
41
|
+
line-height: ${(props) => props.lineHeight ?? "1.1212499999999999rem"};
|
|
42
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
43
|
+
font-size: ${(props) => props.fontSize ?? "1.08rem"};
|
|
44
|
+
line-height: ${(props) => props.lineHeight ?? "1.38rem"};
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B2]: import_ds_system.css`
|
|
48
|
+
font-size: ${(props) => props.fontSize ?? "0.8125rem"};
|
|
49
|
+
line-height: ${(props) => props.lineHeight ?? "1.064375rem"};
|
|
50
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
51
|
+
font-size: ${(props) => props.fontSize ?? "1rem"};
|
|
52
|
+
line-height: ${(props) => props.lineHeight ?? "1.31rem"};
|
|
53
|
+
}
|
|
54
|
+
`,
|
|
55
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B3]: import_ds_system.css`
|
|
56
|
+
font-size: ${(props) => props.fontSize ?? "0.7475rem"};
|
|
57
|
+
line-height: ${(props) => props.lineHeight ?? "0.999375rem"};
|
|
58
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
59
|
+
font-size: ${(props) => props.fontSize ?? "0.92rem"};
|
|
60
|
+
line-height: ${(props) => props.lineHeight ?? "1.23rem"};
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
[import_constants.TYPOGRAPHY_VARIANTS.B4]: import_ds_system.css`
|
|
64
|
+
font-size: ${(props) => props.fontSize ?? "0.6906249999999999rem"};
|
|
65
|
+
line-height: ${(props) => props.lineHeight ?? "0.8125rem"};
|
|
66
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
67
|
+
font-size: ${(props) => props.fontSize ?? "0.85rem"};
|
|
68
|
+
line-height: ${(props) => props.lineHeight ?? "1rem"};
|
|
69
|
+
}
|
|
70
|
+
`
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=body.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/variants/body.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { css } from '@elliemae/ds-system';\nimport { TYPOGRAPHY_VARIANTS } from '../../constants/index.js';\nimport type { DSTypographyT } from '../../react-desc-prop-types.js';\n\n// typescript \"hack\" to infer the ReturnType of a generic function (css) with a generic argument (DSTypographyT.StyledPropsInterface)\n// as of 14/november/2023 I was not able to find a better way to do this.\nconst typedCss = () => css<DSTypographyT.StyledPropsInterface>``;\ntype BodyCSSMap = {\n [key in DSTypographyT.BodyVariants]: ReturnType<typeof typedCss>;\n};\n\n// as of 14/november/2023\n// mobile -> font-size: 16px\n// desktop -> font-size: 13px\n// the \"magic values\" of the rem units are the result of the following formula:\n// (variant's requirement px/RT value / 16px) for mobile\n// (variant's requirement px/RT value / 13px) for desktop\nexport const VARIANTS_CSS_BODY: BodyCSSMap = {\n [TYPOGRAPHY_VARIANTS.B1]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.8775000000000001rem'};\n line-height: ${(props) => props.lineHeight ?? '1.1212499999999999rem'};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1.08rem'};\n line-height: ${(props) => props.lineHeight ?? '1.38rem'};\n }\n `,\n [TYPOGRAPHY_VARIANTS.B2]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.8125rem'};\n line-height: ${(props) => props.lineHeight ?? '1.064375rem'};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1rem'};\n line-height: ${(props) => props.lineHeight ?? '1.31rem'};\n }\n `,\n [TYPOGRAPHY_VARIANTS.B3]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.7475rem'};\n line-height: ${(props) => props.lineHeight ?? '0.999375rem'};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '0.92rem'};\n line-height: ${(props) => props.lineHeight ?? '1.23rem'};\n }\n `,\n [TYPOGRAPHY_VARIANTS.B4]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.6906249999999999rem'};\n line-height: ${(props) => props.lineHeight ?? '0.8125rem'};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '0.85rem'};\n line-height: ${(props) => props.lineHeight ?? '1rem'};\n }\n `,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AACpB,uBAAoC;AAKpC,MAAM,WAAW,MAAM;AAWhB,MAAM,oBAAgC;AAAA,EAC3C,CAAC,qCAAoB,EAAE,GAAG;AAAA,iBACX,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,EAGlD,CAAC,qCAAoB,EAAE,GAAG;AAAA,iBACX,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,EAGlD,CAAC,qCAAoB,EAAE,GAAG;AAAA,iBACX,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,EAGlD,CAAC,qCAAoB,EAAE,GAAG;AAAA,iBACX,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAGpD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var button_exports = {};
|
|
30
|
+
__export(button_exports, {
|
|
31
|
+
VARIANTS_BUTTON: () => VARIANTS_BUTTON
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(button_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
36
|
+
var import_constants = require("../../constants/index.js");
|
|
37
|
+
const typedCss = () => import_ds_system.css``;
|
|
38
|
+
const VARIANTS_BUTTON = {
|
|
39
|
+
[import_constants.TYPOGRAPHY_VARIANTS.BUTTON]: import_ds_system.css`
|
|
40
|
+
font-size: ${(props) => props.fontSize ?? "0.8125rem"};
|
|
41
|
+
line-height: ${(props) => props.lineHeight ?? "1.503125rem"};
|
|
42
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
43
|
+
font-size: ${(props) => props.fontSize ?? "1rem"};
|
|
44
|
+
line-height: ${(props) => props.lineHeight ?? "1.85rem"};
|
|
45
|
+
}
|
|
46
|
+
text-decoration: underline;
|
|
47
|
+
color: ${(props) => props.theme.colors.brand[600]};
|
|
48
|
+
background: none;
|
|
49
|
+
border: none;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
text-align: left;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
&:hover {
|
|
54
|
+
color: ${(props) => props.theme.colors.brand[700]};
|
|
55
|
+
}
|
|
56
|
+
&:active {
|
|
57
|
+
color: ${(props) => props.theme.colors.brand[800]};
|
|
58
|
+
}
|
|
59
|
+
&:focus {
|
|
60
|
+
color: ${(props) => props.theme.colors.brand[700]};
|
|
61
|
+
}
|
|
62
|
+
`
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/variants/button.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { css } from '@elliemae/ds-system';\nimport type { DSTypographyT } from '../../react-desc-prop-types.js';\nimport { TYPOGRAPHY_VARIANTS } from '../../constants/index.js';\n\n// typescript \"hack\" to infer the ReturnType of a generic function (css) with a generic argument (DSTypographyT.StyledPropsInterface)\n// as of 14/november/2023 I was not able to find a better way to do this.\nconst typedCss = () => css<DSTypographyT.StyledPropsInterface>``;\ntype ButtonCSSMap = {\n [key in DSTypographyT.ButtonVariants]: ReturnType<typeof typedCss>;\n};\n\n// as of 14/november/2023\n// mobile -> font-size: 16px\n// desktop -> font-size: 13px\n// the \"magic values\" of the rem units are the result of the following formula:\n// (variant's requirement px/RT value / 16px) for mobile\n// (variant's requirement px/RT value / 13px) for desktop\nexport const VARIANTS_BUTTON: ButtonCSSMap = {\n [TYPOGRAPHY_VARIANTS.BUTTON]: css<DSTypographyT.StyledPropsInterface>`\n font-size: ${(props) => props.fontSize ?? '0.8125rem'};\n line-height: ${(props) => props.lineHeight ?? '1.503125rem'};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => props.fontSize ?? '1rem'};\n line-height: ${(props) => props.lineHeight ?? '1.85rem'};\n }\n text-decoration: underline;\n color: ${(props) => props.theme.colors.brand[600]};\n background: none;\n border: none;\n display: inline-block;\n text-align: left;\n cursor: pointer;\n &:hover {\n color: ${(props) => props.theme.colors.brand[700]};\n }\n &:active {\n color: ${(props) => props.theme.colors.brand[800]};\n }\n &:focus {\n color: ${(props) => props.theme.colors.brand[700]};\n }\n `,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AAEpB,uBAAoC;AAIpC,MAAM,WAAW,MAAM;AAWhB,MAAM,kBAAgC;AAAA,EAC3C,CAAC,qCAAoB,MAAM,GAAG;AAAA,iBACf,CAAC,UAAU,MAAM,YAAY;AAAA,mBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA,yBACzB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACvC,CAAC,UAAU,MAAM,YAAY;AAAA,qBAC3B,CAAC,UAAU,MAAM,cAAc;AAAA;AAAA;AAAA,aAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,eAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,eAGvC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAGtD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|