@contentful/f36-typography 4.0.1-beta.2590 → 4.0.1-beta.2705

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/main.js CHANGED
@@ -1,5 +1,4 @@
1
1
  var $5fdCT$react = require("react");
2
- var $5fdCT$reactjsxruntime = require("react/jsx-runtime");
3
2
  var $5fdCT$emotion = require("emotion");
4
3
  var $5fdCT$contentfulf36tokens = require("@contentful/f36-tokens");
5
4
  var $5fdCT$contentfulf36core = require("@contentful/f36-core");
@@ -24,8 +23,6 @@ $parcel$export(module.exports, "Text", () => $dd9fe96501c8d4c8$export$5f1af8db98
24
23
 
25
24
 
26
25
 
27
-
28
-
29
26
  const $dd9fe96501c8d4c8$var$TEXT_DEFAULT_TAG = 'span';
30
27
  function $dd9fe96501c8d4c8$var$truncatedStyle() {
31
28
  return(/*#__PURE__*/ $5fdCT$emotion.css({
@@ -35,28 +32,27 @@ function $dd9fe96501c8d4c8$var$truncatedStyle() {
35
32
  }
36
33
  function $dd9fe96501c8d4c8$var$_Text({ fontSize: fontSize = 'fontSizeM' , fontStack: fontStack = 'fontStackPrimary' , fontWeight: fontWeight = 'fontWeightNormal' , fontColor: fontColor = 'gray800' , lineHeight: lineHeight = 'lineHeightM' , children: children , isTruncated: isTruncated , as: as , className: className , margin: margin = 'none' , ...otherProps }, ref) {
37
34
  const Element = as || $dd9fe96501c8d4c8$var$TEXT_DEFAULT_TAG;
38
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($5fdCT$contentfulf36core.Box, {
35
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($5fdCT$contentfulf36core.Box, {
39
36
  ...otherProps,
40
37
  as: Element,
41
38
  className: $5fdCT$emotion.cx(/*#__PURE__*/ $5fdCT$emotion.css({
42
39
  padding: 0,
43
- fontFamily: $parcel$interopDefault($5fdCT$contentfulf36tokens)[fontStack],
44
- fontWeight: $parcel$interopDefault($5fdCT$contentfulf36tokens)[fontWeight],
45
- color: $parcel$interopDefault($5fdCT$contentfulf36tokens)[fontColor],
46
- fontSize: $parcel$interopDefault($5fdCT$contentfulf36tokens)[fontSize],
47
- lineHeight: $parcel$interopDefault($5fdCT$contentfulf36tokens)[lineHeight]
40
+ fontFamily: ($parcel$interopDefault($5fdCT$contentfulf36tokens))[fontStack],
41
+ fontWeight: ($parcel$interopDefault($5fdCT$contentfulf36tokens))[fontWeight],
42
+ color: ($parcel$interopDefault($5fdCT$contentfulf36tokens))[fontColor],
43
+ fontSize: ($parcel$interopDefault($5fdCT$contentfulf36tokens))[fontSize],
44
+ lineHeight: ($parcel$interopDefault($5fdCT$contentfulf36tokens))[lineHeight]
48
45
  }), isTruncated ? $dd9fe96501c8d4c8$var$truncatedStyle() : null, className),
49
46
  margin: margin,
50
- ref: ref,
51
- children: children
52
- }));
47
+ ref: ref
48
+ }, children));
53
49
  }
54
- const $dd9fe96501c8d4c8$export$5f1af8db9871e1d6 = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef($dd9fe96501c8d4c8$var$_Text);
50
+ const $dd9fe96501c8d4c8$export$5f1af8db9871e1d6 = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef($dd9fe96501c8d4c8$var$_Text);
55
51
 
56
52
 
57
53
  const $edf6509e8a752df1$var$HEADING_DEFAULT_TAG = 'h1';
58
54
  function $edf6509e8a752df1$var$_Heading({ children: children , testId: testId = 'cf-ui-heading' , ...otherProps }, ref) {
59
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
55
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
60
56
  as: $edf6509e8a752df1$var$HEADING_DEFAULT_TAG,
61
57
  testId: testId,
62
58
  marginBottom: "spacingM",
@@ -65,19 +61,17 @@ function $edf6509e8a752df1$var$_Heading({ children: children , testId: testId =
65
61
  fontSize: "fontSizeXl",
66
62
  lineHeight: "lineHeightXl",
67
63
  ...otherProps,
68
- ref: ref,
69
- children: children
70
- }));
64
+ ref: ref
65
+ }, children));
71
66
  }
72
- const $edf6509e8a752df1$export$a8a3e93435678ff9 = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef($edf6509e8a752df1$var$_Heading);
73
-
67
+ const $edf6509e8a752df1$export$a8a3e93435678ff9 = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef($edf6509e8a752df1$var$_Heading);
74
68
 
75
69
 
76
70
 
77
71
 
78
72
  const $831292c032eb183f$var$SUBHEADING_DEFAULT_TAG = 'h3';
79
73
  function $831292c032eb183f$var$_Subheading({ children: children , testId: testId = 'cf-ui-subheading' , ...otherProps }, ref) {
80
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
74
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
81
75
  as: $831292c032eb183f$var$SUBHEADING_DEFAULT_TAG,
82
76
  testId: testId,
83
77
  marginBottom: "spacingM",
@@ -86,12 +80,10 @@ function $831292c032eb183f$var$_Subheading({ children: children , testId: testId
86
80
  fontWeight: "fontWeightDemiBold",
87
81
  fontColor: "gray900",
88
82
  ...otherProps,
89
- ref: ref,
90
- children: children
91
- }));
83
+ ref: ref
84
+ }, children));
92
85
  }
93
- const $831292c032eb183f$export$5404b1d39162d870 = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef($831292c032eb183f$var$_Subheading);
94
-
86
+ const $831292c032eb183f$export$5404b1d39162d870 = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef($831292c032eb183f$var$_Subheading);
95
87
 
96
88
 
97
89
 
@@ -99,15 +91,12 @@ function $d22050ec5fdf0a29$export$1c6175f3aa4394b7(props) {
99
91
  $5fdCT$react.useEffect(()=>{
100
92
  console.warn('Forma 36: Typography component is deprecated. You can safely remove it from your components.');
101
93
  }, []);
102
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($5fdCT$reactjsxruntime.Fragment, {
103
- children: props.children
104
- }));
94
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement(($parcel$interopDefault($5fdCT$react)).Fragment, null, props.children));
105
95
  }
106
96
 
107
97
 
108
98
 
109
99
 
110
-
111
100
  const $2918aeb7dafaacc0$var$DISPLAY_TEXT_DEFAULT_TAG = 'h2';
112
101
  function $2918aeb7dafaacc0$var$_DisplayText({ children: children , size: size = 'default' , testId: testId = 'cf-ui-display-text' , ...otherProps }, ref) {
113
102
  let fontSize = 'fontSize2Xl';
@@ -119,7 +108,7 @@ function $2918aeb7dafaacc0$var$_DisplayText({ children: children , size: size =
119
108
  fontSize = 'fontSize3Xl';
120
109
  lineHeight = 'lineHeight3Xl';
121
110
  }
122
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
111
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
123
112
  as: $2918aeb7dafaacc0$var$DISPLAY_TEXT_DEFAULT_TAG,
124
113
  testId: testId,
125
114
  marginBottom: size === 'default' ? 'spacingL' : 'spacingXl',
@@ -128,12 +117,10 @@ function $2918aeb7dafaacc0$var$_DisplayText({ children: children , size: size =
128
117
  fontColor: "gray900",
129
118
  fontWeight: "fontWeightDemiBold",
130
119
  ...otherProps,
131
- ref: ref,
132
- children: children
133
- }));
120
+ ref: ref
121
+ }, children));
134
122
  }
135
- const $2918aeb7dafaacc0$export$60374ee25b7d5e87 = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef($2918aeb7dafaacc0$var$_DisplayText);
136
-
123
+ const $2918aeb7dafaacc0$export$60374ee25b7d5e87 = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef($2918aeb7dafaacc0$var$_DisplayText);
137
124
 
138
125
 
139
126
 
@@ -143,7 +130,7 @@ const $2918aeb7dafaacc0$export$60374ee25b7d5e87 = /*#__PURE__*/ $parcel$interopD
143
130
 
144
131
  const $6b033735b9eed406$var$SECTION_HEADING_DEFAULT_TAG = 'h2';
145
132
  function $6b033735b9eed406$var$_SectionHeading({ children: children , className: className , testId: testId = 'cf-ui-section-heading' , ...otherProps }, ref) {
146
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
133
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
147
134
  as: $6b033735b9eed406$var$SECTION_HEADING_DEFAULT_TAG,
148
135
  testId: testId,
149
136
  marginBottom: "spacingL",
@@ -152,30 +139,27 @@ function $6b033735b9eed406$var$_SectionHeading({ children: children , className:
152
139
  fontSize: "fontSizeS",
153
140
  lineHeight: "lineHeightS",
154
141
  className: $5fdCT$emotion.cx(/*#__PURE__*/ $5fdCT$emotion.css({
155
- letterSpacing: $parcel$interopDefault($5fdCT$contentfulf36tokens).letterSpacingWide,
142
+ letterSpacing: ($parcel$interopDefault($5fdCT$contentfulf36tokens)).letterSpacingWide,
156
143
  textTransform: 'uppercase'
157
144
  }), className),
158
145
  ...otherProps,
159
- ref: ref,
160
- children: children
161
- }));
146
+ ref: ref
147
+ }, children));
162
148
  }
163
- const $6b033735b9eed406$export$72d7ca7a5d1d4807 = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef($6b033735b9eed406$var$_SectionHeading);
164
-
149
+ const $6b033735b9eed406$export$72d7ca7a5d1d4807 = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef($6b033735b9eed406$var$_SectionHeading);
165
150
 
166
151
 
167
152
 
168
153
 
169
- const $4236a7ca048922f6$export$358a232cca1ab2ac = /*#__PURE__*/ $parcel$interopDefault($5fdCT$react).forwardRef(({ children: children , testId: testId = 'cf-ui-paragraph' , ...otherProps }, ref)=>{
170
- return(/*#__PURE__*/ $5fdCT$reactjsxruntime.jsx($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
154
+ const $4236a7ca048922f6$export$358a232cca1ab2ac = /*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).forwardRef(({ children: children , testId: testId = 'cf-ui-paragraph' , ...otherProps }, ref)=>{
155
+ return(/*#__PURE__*/ ($parcel$interopDefault($5fdCT$react)).createElement($dd9fe96501c8d4c8$export$5f1af8db9871e1d6, {
171
156
  as: "p",
172
157
  testId: testId,
173
158
  marginBottom: "spacingM",
174
159
  lineHeight: "lineHeightM",
175
160
  ...otherProps,
176
- ref: ref,
177
- children: children
178
- }));
161
+ ref: ref
162
+ }, children));
179
163
  });
180
164
  $4236a7ca048922f6$export$358a232cca1ab2ac.displayName = 'Paragraph';
181
165
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AE4BA,KAAA,CAAMgD,sCAAgB,GAAG,CAAzB;SAESC,oCAAT,GAA0B,CAA1B;IACE,MAAA,CAAA,EAAO,AAAP,SAAO,AAAP,EAAO,CAAA,kBAAP,CAAA,CAAA;QAAO,IAAA,EAAA,CAAA;QAAA,MAAA,EAAA,CAAA;IAAA,CAAA;AAKR,CAAA;SAMQC,2BAAK,CACZ,CADF,WAEIP,QAAQ,GAAG,CADb,wBAEEE,SAAS,GAAG,CAFd,gCAGEC,UAAU,GAAG,CAHf,+BAIEC,SAAS,GAAG,CAJd,uBAKEH,UAAU,GAAG,CALf,yBAMEpB,QANF,gBAOEE,WAPF,OAQEH,EARF,cASE4B,SATF,WAUEC,MAAM,GAAG,CAVX,WAWKrB,UAAH,CACU,CAbd,EAcEC,GAdF,EAeE,CAdA;IAeA,KAAA,CAAMqB,OAAO,GAAsB9B,EAAE,IAAIyB,sCAAzC;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,QAAD;;AAGL,CAhBwB;AAkBzBb,yCAAS,CAACkE,WAAV,GAAwB,CAAxB;;","sources":["packages/components/typography/src/index.ts","packages/components/typography/src/Heading.tsx","packages/components/typography/src/Text.tsx","packages/components/typography/src/Subheading.tsx","packages/components/typography/src/Typography.tsx","packages/components/typography/src/DisplayText.tsx","packages/components/typography/src/SectionHeading.tsx","packages/components/typography/src/Paragraph.tsx"],"sourcesContent":["export { Heading } from './Heading';\nexport type { HeadingProps, HeadingElement } from './Heading';\nexport { Subheading } from './Subheading';\nexport type { SubheadingProps } from './Subheading';\nexport { Typography } from './Typography';\nexport type { TypographyProps } from './Typography';\nexport { DisplayText } from './DisplayText';\nexport type { DisplayTextProps } from './DisplayText';\nexport { SectionHeading } from './SectionHeading';\nexport type { SectionHeadingProps } from './SectionHeading';\nexport { Paragraph } from './Paragraph';\nexport type { ParagraphProps } from './Paragraph';\nexport { Text } from './Text';\nexport type { TextProps } from './Text';\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nconst HEADING_DEFAULT_TAG = 'h1';\n\nexport type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface HeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n children?: React.ReactNode;\n isTruncated?: boolean;\n}\n\nexport type HeadingProps<\n E extends React.ElementType = typeof HEADING_DEFAULT_TAG\n> = PolymorphicProps<HeadingInternalProps, E>;\n\nfunction _Heading<E extends React.ElementType = typeof HEADING_DEFAULT_TAG>(\n { children, testId = 'cf-ui-heading', ...otherProps }: HeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeXl\"\n lineHeight=\"lineHeightXl\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Heading: PolymorphicComponent<\n ExpandProps<HeadingInternalProps>,\n typeof HEADING_DEFAULT_TAG\n> = React.forwardRef(_Heading);\n","import React from 'react';\nimport tokens, {\n FontSizeTokens,\n LineHeightTokens,\n FontWeightTokens,\n FontStackTokens,\n ColorTokens,\n} from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n PolymorphicComponent,\n CommonProps,\n MarginProps,\n PolymorphicProps,\n Box,\n ExpandProps,\n} from '@contentful/f36-core';\n\nexport interface TextInternalProps extends CommonProps, MarginProps {\n children?: React.ReactNode;\n fontSize?: FontSizeTokens;\n lineHeight?: LineHeightTokens;\n fontStack?: FontStackTokens;\n fontWeight?: FontWeightTokens;\n fontColor?: ColorTokens;\n isTruncated?: boolean;\n}\n\nconst TEXT_DEFAULT_TAG = 'span';\n\nfunction truncatedStyle() {\n return css({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n });\n}\n\nexport type TextProps<\n E extends React.ElementType = typeof TEXT_DEFAULT_TAG\n> = PolymorphicProps<TextInternalProps, E>;\n\nfunction _Text<E extends React.ElementType = typeof TEXT_DEFAULT_TAG>(\n {\n fontSize = 'fontSizeM',\n fontStack = 'fontStackPrimary',\n fontWeight = 'fontWeightNormal',\n fontColor = 'gray800',\n lineHeight = 'lineHeightM',\n children,\n isTruncated,\n as,\n className,\n margin = 'none',\n ...otherProps\n }: TextProps<E>,\n ref: React.Ref<any>,\n) {\n const Element: React.ElementType = as || TEXT_DEFAULT_TAG;\n\n return (\n <Box\n {...otherProps}\n as={Element}\n className={cx(\n css({\n padding: 0,\n fontFamily: tokens[fontStack],\n fontWeight: tokens[fontWeight],\n color: tokens[fontColor],\n fontSize: tokens[fontSize],\n lineHeight: tokens[lineHeight],\n }),\n isTruncated ? truncatedStyle() : null,\n className,\n )}\n margin={margin}\n ref={ref}\n >\n {children}\n </Box>\n );\n}\n\nexport const Text: PolymorphicComponent<\n ExpandProps<TextInternalProps>,\n typeof TEXT_DEFAULT_TAG\n> = React.forwardRef(_Text);\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SUBHEADING_DEFAULT_TAG = 'h3';\n\nexport interface SubheadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SubheadingProps<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n> = PolymorphicProps<SubheadingInternalProps, E>;\n\nfunction _Subheading<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n>(\n { children, testId = 'cf-ui-subheading', ...otherProps }: SubheadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SUBHEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontSize=\"fontSizeL\"\n lineHeight=\"lineHeightL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Subheading: PolymorphicComponent<\n ExpandProps<SubheadingInternalProps>,\n typeof SUBHEADING_DEFAULT_TAG\n> = React.forwardRef(_Subheading);\n","import React, { useEffect } from 'react';\n\nexport interface TypographyProps {\n children?: React.ReactNode;\n}\n\n/**\n * @deprecated\n */\nexport function Typography(props: TypographyProps) {\n useEffect(() => {\n console.warn(\n 'Forma 36: Typography component is deprecated. You can safely remove it from your components.',\n );\n }, []);\n return <>{props.children}</>;\n}\n","import React from 'react';\nimport { FontSizeTokens, LineHeightTokens } from '@contentful/f36-tokens';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\nimport type { HeadingElement } from './Heading';\n\nconst DISPLAY_TEXT_DEFAULT_TAG = 'h2';\n\nexport interface DisplayTextInternalProps extends CommonProps, MarginProps {\n size?: 'default' | 'large' | 'huge';\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type DisplayTextProps<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n> = PolymorphicProps<DisplayTextInternalProps, E>;\n\nfunction _DisplayText<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n>(\n {\n children,\n size = 'default',\n testId = 'cf-ui-display-text',\n ...otherProps\n }: DisplayTextProps<E>,\n ref: React.Ref<any>,\n) {\n let fontSize: FontSizeTokens = 'fontSize2Xl';\n let lineHeight: LineHeightTokens = 'lineHeight2Xl';\n\n if (size === 'huge') {\n fontSize = 'fontSize4Xl';\n lineHeight = 'lineHeight4Xl';\n } else if (size === 'large') {\n fontSize = 'fontSize3Xl';\n lineHeight = 'lineHeight3Xl';\n }\n\n return (\n <Text\n as={DISPLAY_TEXT_DEFAULT_TAG}\n testId={testId}\n marginBottom={size === 'default' ? 'spacingL' : 'spacingXl'}\n fontSize={fontSize}\n lineHeight={lineHeight}\n fontColor=\"gray900\"\n fontWeight=\"fontWeightDemiBold\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const DisplayText: PolymorphicComponent<\n ExpandProps<DisplayTextInternalProps>,\n typeof DISPLAY_TEXT_DEFAULT_TAG\n> = React.forwardRef(_DisplayText);\n","import React from 'react';\nimport tokens from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SECTION_HEADING_DEFAULT_TAG = 'h2';\n\nexport interface SectionHeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SectionHeadingProps<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n> = PolymorphicProps<SectionHeadingInternalProps, E>;\n\nfunction _SectionHeading<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n>(\n {\n children,\n className,\n testId = 'cf-ui-section-heading',\n ...otherProps\n }: SectionHeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SECTION_HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeS\"\n lineHeight=\"lineHeightS\"\n className={cx(\n css({\n letterSpacing: tokens.letterSpacingWide,\n textTransform: 'uppercase',\n }),\n className,\n )}\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const SectionHeading: PolymorphicComponent<\n ExpandProps<SectionHeadingInternalProps>,\n typeof SECTION_HEADING_DEFAULT_TAG\n> = React.forwardRef(_SectionHeading);\n","import React from 'react';\nimport {\n PropsWithHTMLElement,\n CommonProps,\n MarginProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nexport type ParagraphInternalProps = CommonProps &\n MarginProps & {\n children: React.ReactNode;\n isTruncated?: boolean;\n };\n\nexport type ParagraphProps = PropsWithHTMLElement<ParagraphInternalProps, 'p'>;\n\nexport const Paragraph = React.forwardRef<\n HTMLParagraphElement,\n ExpandProps<ParagraphProps>\n>(({ children, testId = 'cf-ui-paragraph', ...otherProps }, ref) => {\n return (\n <Text\n as=\"p\"\n testId={testId}\n marginBottom=\"spacingM\"\n lineHeight=\"lineHeightM\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n});\n\nParagraph.displayName = 'Paragraph';\n"],"names":["Heading","HeadingProps","HeadingElement","Subheading","SubheadingProps","Typography","TypographyProps","DisplayText","DisplayTextProps","SectionHeading","SectionHeadingProps","Paragraph","ParagraphProps","Text","TextProps","React","CommonProps","MarginProps","PolymorphicComponent","PolymorphicProps","ExpandProps","HEADING_DEFAULT_TAG","HeadingInternalProps","as","children","ReactNode","isTruncated","ElementType","E","_Heading","testId","otherProps","ref","Ref","forwardRef","tokens","FontSizeTokens","LineHeightTokens","FontWeightTokens","FontStackTokens","ColorTokens","Box","TextInternalProps","fontSize","lineHeight","fontStack","fontWeight","fontColor","TEXT_DEFAULT_TAG","truncatedStyle","_Text","className","margin","Element","padding","fontFamily","color","SUBHEADING_DEFAULT_TAG","SubheadingInternalProps","_Subheading","useEffect","props","console","warn","DISPLAY_TEXT_DEFAULT_TAG","DisplayTextInternalProps","size","_DisplayText","SECTION_HEADING_DEFAULT_TAG","SectionHeadingInternalProps","_SectionHeading","letterSpacing","letterSpacingWide","textTransform","PropsWithHTMLElement","ParagraphInternalProps","HTMLParagraphElement","displayName"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AE4BA,KAAA,CAAMgD,sCAAgB,GAAG,CAAzB;SAESC,oCAAT,GAA0B,CAA1B;IACE,MAAA,CAAA,EAAO,AAAP,SAAO,AAAP,EAAO,CAAA,kBAAP,CAAA,CAAA;QAAO,IAAA,EAAA,CAAA;QAAA,MAAA,EAAA,CAAA;IAAA,CAAA;AAKR,CAAA;SAMQC,2BAAK,CACZ,CADF,WAEIP,QAAQ,GAAG,CADb,wBAEEE,SAAS,GAAG,CAFd,gCAGEC,UAAU,GAAG,CAHf,+BAIEC,SAAS,GAAG,CAJd,uBAKEH,UAAU,GAAG,CALf,yBAMEpB,QANF,gBAOEE,WAPF,OAQEH,EARF,cASE4B,SATF,WAUEC,MAAM,GAAG,CAVX,WAWKrB,UAAH,CACU,CAbd,EAcEC,GAdF,EAeE,CAdA;IAeA,KAAA,CAAMqB,OAAO,GAAsB9B,EAAE,IAAIyB,sCAAzC;IAEA,MAAA,oEACG,4BAAD;WACMjB,UAAJ;QACA,EAAA,EAAIsB,OAAD;QACH,SAAA,EAAW,iBAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,kBAAA,CAAI,CALV;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Q,sCAAK,CAACmB,UAAN,CAAiBiC,kCAAjB;;;;;;;;ACrDJ,KAAA,CAAMC,iDAA2B,GAAG,CAApC;SAWSE,qCAAe,CAGtB,CAHF,WAII9C,QADF,cAEE2B,SAFF,WAGErB,MAAM,GAAG,CAHX,4BAIKC,UAAH,CACoB,CARxB,EASEC,GATF,EAUE,CAPA;IAQA,MAAA,oEACG,yCAAD;QACE,EAAA,EAAIoC,iDAAD;QACH,MAAA,EAAQtC,MAAD;QACP,YAAA,EAAa,CAHf;QAIE,UAAA,EAAW,CAJb;QAKE,SAAA,EAAU,CALZ;QAME,QAAA,EAAS,CANX;QAOE,UAAA,EAAW,CAPb;QAQE,SAAA,EAAW,iBAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,kBAAA,CAAI,CAVV;YAWQyC,aAAa,EAAEpC,oDAAM,CAACqC,iBADpB;YAEFC,aAAa,EAAE,CAAfA;QAFE,CAAJ,GAIAtB,SALS;WAOPpB,UAAJ;QACA,GAAA,EAAKC,GAAD;OAEHR,QAAD;AAGL,CAAA;AAEM,KAAA,CAAMf,yCAAc,iBAGvBM,sCAAK,CAACmB,UAAN,CAAiBoC,qCAAjB;;;;;AC7CG,KAAA,CAAM3D,yCAAS,iBAAGI,sCAAK,CAACmB,UAAU,EAGtC,CAHH,WAGKV,QAAF,WAAYM,MAAM,GAAG,CAArB,sBAA2CC,UAAH,CAAxC,CAAD,EAA0DC,GAA1D,GAAkE,CAAjE;IACD,MAAA,oEACG,yCAAD;QACE,EAAA,EAAG,CADL;QAEE,MAAA,EAAQF,MAAD;QACP,YAAA,EAAa,CAHf;QAIE,UAAA,EAAW,CAJb;WAKMC,UAAJ;QACA,GAAA,EAAKC,GAAD;OAEHR,QAAD;AAGL,CAhBwB;AAkBzBb,yCAAS,CAACkE,WAAV,GAAwB,CAAxB;;","sources":["packages/components/typography/src/index.ts","packages/components/typography/src/Heading.tsx","packages/components/typography/src/Text.tsx","packages/components/typography/src/Subheading.tsx","packages/components/typography/src/Typography.tsx","packages/components/typography/src/DisplayText.tsx","packages/components/typography/src/SectionHeading.tsx","packages/components/typography/src/Paragraph.tsx"],"sourcesContent":["export { Heading } from './Heading';\nexport type { HeadingProps, HeadingElement } from './Heading';\nexport { Subheading } from './Subheading';\nexport type { SubheadingProps } from './Subheading';\nexport { Typography } from './Typography';\nexport type { TypographyProps } from './Typography';\nexport { DisplayText } from './DisplayText';\nexport type { DisplayTextProps } from './DisplayText';\nexport { SectionHeading } from './SectionHeading';\nexport type { SectionHeadingProps } from './SectionHeading';\nexport { Paragraph } from './Paragraph';\nexport type { ParagraphProps } from './Paragraph';\nexport { Text } from './Text';\nexport type { TextProps } from './Text';\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nconst HEADING_DEFAULT_TAG = 'h1';\n\nexport type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface HeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n children?: React.ReactNode;\n isTruncated?: boolean;\n}\n\nexport type HeadingProps<\n E extends React.ElementType = typeof HEADING_DEFAULT_TAG\n> = PolymorphicProps<HeadingInternalProps, E>;\n\nfunction _Heading<E extends React.ElementType = typeof HEADING_DEFAULT_TAG>(\n { children, testId = 'cf-ui-heading', ...otherProps }: HeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeXl\"\n lineHeight=\"lineHeightXl\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Heading: PolymorphicComponent<\n ExpandProps<HeadingInternalProps>,\n typeof HEADING_DEFAULT_TAG\n> = React.forwardRef(_Heading);\n","import React from 'react';\nimport tokens, {\n FontSizeTokens,\n LineHeightTokens,\n FontWeightTokens,\n FontStackTokens,\n ColorTokens,\n} from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n PolymorphicComponent,\n CommonProps,\n MarginProps,\n PolymorphicProps,\n Box,\n ExpandProps,\n} from '@contentful/f36-core';\n\nexport interface TextInternalProps extends CommonProps, MarginProps {\n children?: React.ReactNode;\n fontSize?: FontSizeTokens;\n lineHeight?: LineHeightTokens;\n fontStack?: FontStackTokens;\n fontWeight?: FontWeightTokens;\n fontColor?: ColorTokens;\n isTruncated?: boolean;\n}\n\nconst TEXT_DEFAULT_TAG = 'span';\n\nfunction truncatedStyle() {\n return css({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n });\n}\n\nexport type TextProps<\n E extends React.ElementType = typeof TEXT_DEFAULT_TAG\n> = PolymorphicProps<TextInternalProps, E>;\n\nfunction _Text<E extends React.ElementType = typeof TEXT_DEFAULT_TAG>(\n {\n fontSize = 'fontSizeM',\n fontStack = 'fontStackPrimary',\n fontWeight = 'fontWeightNormal',\n fontColor = 'gray800',\n lineHeight = 'lineHeightM',\n children,\n isTruncated,\n as,\n className,\n margin = 'none',\n ...otherProps\n }: TextProps<E>,\n ref: React.Ref<any>,\n) {\n const Element: React.ElementType = as || TEXT_DEFAULT_TAG;\n\n return (\n <Box\n {...otherProps}\n as={Element}\n className={cx(\n css({\n padding: 0,\n fontFamily: tokens[fontStack],\n fontWeight: tokens[fontWeight],\n color: tokens[fontColor],\n fontSize: tokens[fontSize],\n lineHeight: tokens[lineHeight],\n }),\n isTruncated ? truncatedStyle() : null,\n className,\n )}\n margin={margin}\n ref={ref}\n >\n {children}\n </Box>\n );\n}\n\nexport const Text: PolymorphicComponent<\n ExpandProps<TextInternalProps>,\n typeof TEXT_DEFAULT_TAG\n> = React.forwardRef(_Text);\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SUBHEADING_DEFAULT_TAG = 'h3';\n\nexport interface SubheadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SubheadingProps<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n> = PolymorphicProps<SubheadingInternalProps, E>;\n\nfunction _Subheading<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n>(\n { children, testId = 'cf-ui-subheading', ...otherProps }: SubheadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SUBHEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontSize=\"fontSizeL\"\n lineHeight=\"lineHeightL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Subheading: PolymorphicComponent<\n ExpandProps<SubheadingInternalProps>,\n typeof SUBHEADING_DEFAULT_TAG\n> = React.forwardRef(_Subheading);\n","import React, { useEffect } from 'react';\n\nexport interface TypographyProps {\n children?: React.ReactNode;\n}\n\n/**\n * @deprecated\n */\nexport function Typography(props: TypographyProps) {\n useEffect(() => {\n console.warn(\n 'Forma 36: Typography component is deprecated. You can safely remove it from your components.',\n );\n }, []);\n return <>{props.children}</>;\n}\n","import React from 'react';\nimport { FontSizeTokens, LineHeightTokens } from '@contentful/f36-tokens';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\nimport type { HeadingElement } from './Heading';\n\nconst DISPLAY_TEXT_DEFAULT_TAG = 'h2';\n\nexport interface DisplayTextInternalProps extends CommonProps, MarginProps {\n size?: 'default' | 'large' | 'huge';\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type DisplayTextProps<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n> = PolymorphicProps<DisplayTextInternalProps, E>;\n\nfunction _DisplayText<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n>(\n {\n children,\n size = 'default',\n testId = 'cf-ui-display-text',\n ...otherProps\n }: DisplayTextProps<E>,\n ref: React.Ref<any>,\n) {\n let fontSize: FontSizeTokens = 'fontSize2Xl';\n let lineHeight: LineHeightTokens = 'lineHeight2Xl';\n\n if (size === 'huge') {\n fontSize = 'fontSize4Xl';\n lineHeight = 'lineHeight4Xl';\n } else if (size === 'large') {\n fontSize = 'fontSize3Xl';\n lineHeight = 'lineHeight3Xl';\n }\n\n return (\n <Text\n as={DISPLAY_TEXT_DEFAULT_TAG}\n testId={testId}\n marginBottom={size === 'default' ? 'spacingL' : 'spacingXl'}\n fontSize={fontSize}\n lineHeight={lineHeight}\n fontColor=\"gray900\"\n fontWeight=\"fontWeightDemiBold\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const DisplayText: PolymorphicComponent<\n ExpandProps<DisplayTextInternalProps>,\n typeof DISPLAY_TEXT_DEFAULT_TAG\n> = React.forwardRef(_DisplayText);\n","import React from 'react';\nimport tokens from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SECTION_HEADING_DEFAULT_TAG = 'h2';\n\nexport interface SectionHeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SectionHeadingProps<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n> = PolymorphicProps<SectionHeadingInternalProps, E>;\n\nfunction _SectionHeading<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n>(\n {\n children,\n className,\n testId = 'cf-ui-section-heading',\n ...otherProps\n }: SectionHeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SECTION_HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeS\"\n lineHeight=\"lineHeightS\"\n className={cx(\n css({\n letterSpacing: tokens.letterSpacingWide,\n textTransform: 'uppercase',\n }),\n className,\n )}\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const SectionHeading: PolymorphicComponent<\n ExpandProps<SectionHeadingInternalProps>,\n typeof SECTION_HEADING_DEFAULT_TAG\n> = React.forwardRef(_SectionHeading);\n","import React from 'react';\nimport {\n PropsWithHTMLElement,\n CommonProps,\n MarginProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nexport type ParagraphInternalProps = CommonProps &\n MarginProps & {\n children: React.ReactNode;\n isTruncated?: boolean;\n };\n\nexport type ParagraphProps = PropsWithHTMLElement<ParagraphInternalProps, 'p'>;\n\nexport const Paragraph = React.forwardRef<\n HTMLParagraphElement,\n ExpandProps<ParagraphProps>\n>(({ children, testId = 'cf-ui-paragraph', ...otherProps }, ref) => {\n return (\n <Text\n as=\"p\"\n testId={testId}\n marginBottom=\"spacingM\"\n lineHeight=\"lineHeightM\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n});\n\nParagraph.displayName = 'Paragraph';\n"],"names":["Heading","HeadingProps","HeadingElement","Subheading","SubheadingProps","Typography","TypographyProps","DisplayText","DisplayTextProps","SectionHeading","SectionHeadingProps","Paragraph","ParagraphProps","Text","TextProps","React","CommonProps","MarginProps","PolymorphicComponent","PolymorphicProps","ExpandProps","HEADING_DEFAULT_TAG","HeadingInternalProps","as","children","ReactNode","isTruncated","ElementType","E","_Heading","testId","otherProps","ref","Ref","forwardRef","tokens","FontSizeTokens","LineHeightTokens","FontWeightTokens","FontStackTokens","ColorTokens","Box","TextInternalProps","fontSize","lineHeight","fontStack","fontWeight","fontColor","TEXT_DEFAULT_TAG","truncatedStyle","_Text","className","margin","Element","padding","fontFamily","color","SUBHEADING_DEFAULT_TAG","SubheadingInternalProps","_Subheading","useEffect","props","console","warn","DISPLAY_TEXT_DEFAULT_TAG","DisplayTextInternalProps","size","_DisplayText","SECTION_HEADING_DEFAULT_TAG","SectionHeadingInternalProps","_SectionHeading","letterSpacing","letterSpacingWide","textTransform","PropsWithHTMLElement","ParagraphInternalProps","HTMLParagraphElement","displayName"],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import $4MbOE$react, {useEffect as $4MbOE$useEffect} from "react";
2
- import {jsx as $4MbOE$jsx, Fragment as $4MbOE$Fragment} from "react/jsx-runtime";
3
2
  import {css as $4MbOE$css, cx as $4MbOE$cx} from "emotion";
4
3
  import $4MbOE$contentfulf36tokens from "@contentful/f36-tokens";
5
4
  import {Box as $4MbOE$Box} from "@contentful/f36-core";
@@ -10,8 +9,6 @@ import {Box as $4MbOE$Box} from "@contentful/f36-core";
10
9
 
11
10
 
12
11
 
13
-
14
-
15
12
  const $6ed778543c9a7861$var$TEXT_DEFAULT_TAG = 'span';
16
13
  function $6ed778543c9a7861$var$truncatedStyle() {
17
14
  return(/*#__PURE__*/ $4MbOE$css({
@@ -21,7 +18,7 @@ function $6ed778543c9a7861$var$truncatedStyle() {
21
18
  }
22
19
  function $6ed778543c9a7861$var$_Text({ fontSize: fontSize = 'fontSizeM' , fontStack: fontStack = 'fontStackPrimary' , fontWeight: fontWeight = 'fontWeightNormal' , fontColor: fontColor = 'gray800' , lineHeight: lineHeight = 'lineHeightM' , children: children , isTruncated: isTruncated , as: as , className: className , margin: margin = 'none' , ...otherProps }, ref) {
23
20
  const Element = as || $6ed778543c9a7861$var$TEXT_DEFAULT_TAG;
24
- return(/*#__PURE__*/ $4MbOE$jsx($4MbOE$Box, {
21
+ return(/*#__PURE__*/ $4MbOE$react.createElement($4MbOE$Box, {
25
22
  ...otherProps,
26
23
  as: Element,
27
24
  className: $4MbOE$cx(/*#__PURE__*/ $4MbOE$css({
@@ -33,16 +30,15 @@ function $6ed778543c9a7861$var$_Text({ fontSize: fontSize = 'fontSizeM' , fontSt
33
30
  lineHeight: $4MbOE$contentfulf36tokens[lineHeight]
34
31
  }), isTruncated ? $6ed778543c9a7861$var$truncatedStyle() : null, className),
35
32
  margin: margin,
36
- ref: ref,
37
- children: children
38
- }));
33
+ ref: ref
34
+ }, children));
39
35
  }
40
36
  const $6ed778543c9a7861$export$5f1af8db9871e1d6 = /*#__PURE__*/ $4MbOE$react.forwardRef($6ed778543c9a7861$var$_Text);
41
37
 
42
38
 
43
39
  const $2757f13134d7f609$var$HEADING_DEFAULT_TAG = 'h1';
44
40
  function $2757f13134d7f609$var$_Heading({ children: children , testId: testId = 'cf-ui-heading' , ...otherProps }, ref) {
45
- return(/*#__PURE__*/ $4MbOE$jsx($6ed778543c9a7861$export$5f1af8db9871e1d6, {
41
+ return(/*#__PURE__*/ $4MbOE$react.createElement($6ed778543c9a7861$export$5f1af8db9871e1d6, {
46
42
  as: $2757f13134d7f609$var$HEADING_DEFAULT_TAG,
47
43
  testId: testId,
48
44
  marginBottom: "spacingM",
@@ -51,19 +47,17 @@ function $2757f13134d7f609$var$_Heading({ children: children , testId: testId =
51
47
  fontSize: "fontSizeXl",
52
48
  lineHeight: "lineHeightXl",
53
49
  ...otherProps,
54
- ref: ref,
55
- children: children
56
- }));
50
+ ref: ref
51
+ }, children));
57
52
  }
58
53
  const $2757f13134d7f609$export$a8a3e93435678ff9 = /*#__PURE__*/ $4MbOE$react.forwardRef($2757f13134d7f609$var$_Heading);
59
54
 
60
55
 
61
56
 
62
57
 
63
-
64
58
  const $7d17967797388737$var$SUBHEADING_DEFAULT_TAG = 'h3';
65
59
  function $7d17967797388737$var$_Subheading({ children: children , testId: testId = 'cf-ui-subheading' , ...otherProps }, ref) {
66
- return(/*#__PURE__*/ $4MbOE$jsx($6ed778543c9a7861$export$5f1af8db9871e1d6, {
60
+ return(/*#__PURE__*/ $4MbOE$react.createElement($6ed778543c9a7861$export$5f1af8db9871e1d6, {
67
61
  as: $7d17967797388737$var$SUBHEADING_DEFAULT_TAG,
68
62
  testId: testId,
69
63
  marginBottom: "spacingM",
@@ -72,28 +66,23 @@ function $7d17967797388737$var$_Subheading({ children: children , testId: testId
72
66
  fontWeight: "fontWeightDemiBold",
73
67
  fontColor: "gray900",
74
68
  ...otherProps,
75
- ref: ref,
76
- children: children
77
- }));
69
+ ref: ref
70
+ }, children));
78
71
  }
79
72
  const $7d17967797388737$export$5404b1d39162d870 = /*#__PURE__*/ $4MbOE$react.forwardRef($7d17967797388737$var$_Subheading);
80
73
 
81
74
 
82
75
 
83
-
84
76
  function $3e422817efdc58c6$export$1c6175f3aa4394b7(props) {
85
77
  $4MbOE$useEffect(()=>{
86
78
  console.warn('Forma 36: Typography component is deprecated. You can safely remove it from your components.');
87
79
  }, []);
88
- return(/*#__PURE__*/ $4MbOE$jsx($4MbOE$Fragment, {
89
- children: props.children
90
- }));
80
+ return(/*#__PURE__*/ $4MbOE$react.createElement($4MbOE$react.Fragment, null, props.children));
91
81
  }
92
82
 
93
83
 
94
84
 
95
85
 
96
-
97
86
  const $222901889a3a3efa$var$DISPLAY_TEXT_DEFAULT_TAG = 'h2';
98
87
  function $222901889a3a3efa$var$_DisplayText({ children: children , size: size = 'default' , testId: testId = 'cf-ui-display-text' , ...otherProps }, ref) {
99
88
  let fontSize = 'fontSize2Xl';
@@ -105,7 +94,7 @@ function $222901889a3a3efa$var$_DisplayText({ children: children , size: size =
105
94
  fontSize = 'fontSize3Xl';
106
95
  lineHeight = 'lineHeight3Xl';
107
96
  }
108
- return(/*#__PURE__*/ $4MbOE$jsx($6ed778543c9a7861$export$5f1af8db9871e1d6, {
97
+ return(/*#__PURE__*/ $4MbOE$react.createElement($6ed778543c9a7861$export$5f1af8db9871e1d6, {
109
98
  as: $222901889a3a3efa$var$DISPLAY_TEXT_DEFAULT_TAG,
110
99
  testId: testId,
111
100
  marginBottom: size === 'default' ? 'spacingL' : 'spacingXl',
@@ -114,9 +103,8 @@ function $222901889a3a3efa$var$_DisplayText({ children: children , size: size =
114
103
  fontColor: "gray900",
115
104
  fontWeight: "fontWeightDemiBold",
116
105
  ...otherProps,
117
- ref: ref,
118
- children: children
119
- }));
106
+ ref: ref
107
+ }, children));
120
108
  }
121
109
  const $222901889a3a3efa$export$60374ee25b7d5e87 = /*#__PURE__*/ $4MbOE$react.forwardRef($222901889a3a3efa$var$_DisplayText);
122
110
 
@@ -126,10 +114,9 @@ const $222901889a3a3efa$export$60374ee25b7d5e87 = /*#__PURE__*/ $4MbOE$react.for
126
114
 
127
115
 
128
116
 
129
-
130
117
  const $7382fd5d78575daf$var$SECTION_HEADING_DEFAULT_TAG = 'h2';
131
118
  function $7382fd5d78575daf$var$_SectionHeading({ children: children , className: className , testId: testId = 'cf-ui-section-heading' , ...otherProps }, ref) {
132
- return(/*#__PURE__*/ $4MbOE$jsx($6ed778543c9a7861$export$5f1af8db9871e1d6, {
119
+ return(/*#__PURE__*/ $4MbOE$react.createElement($6ed778543c9a7861$export$5f1af8db9871e1d6, {
133
120
  as: $7382fd5d78575daf$var$SECTION_HEADING_DEFAULT_TAG,
134
121
  testId: testId,
135
122
  marginBottom: "spacingL",
@@ -142,26 +129,23 @@ function $7382fd5d78575daf$var$_SectionHeading({ children: children , className:
142
129
  textTransform: 'uppercase'
143
130
  }), className),
144
131
  ...otherProps,
145
- ref: ref,
146
- children: children
147
- }));
132
+ ref: ref
133
+ }, children));
148
134
  }
149
135
  const $7382fd5d78575daf$export$72d7ca7a5d1d4807 = /*#__PURE__*/ $4MbOE$react.forwardRef($7382fd5d78575daf$var$_SectionHeading);
150
136
 
151
137
 
152
138
 
153
139
 
154
-
155
140
  const $8c581f9822f07d46$export$358a232cca1ab2ac = /*#__PURE__*/ $4MbOE$react.forwardRef(({ children: children , testId: testId = 'cf-ui-paragraph' , ...otherProps }, ref)=>{
156
- return(/*#__PURE__*/ $4MbOE$jsx($6ed778543c9a7861$export$5f1af8db9871e1d6, {
141
+ return(/*#__PURE__*/ $4MbOE$react.createElement($6ed778543c9a7861$export$5f1af8db9871e1d6, {
157
142
  as: "p",
158
143
  testId: testId,
159
144
  marginBottom: "spacingM",
160
145
  lineHeight: "lineHeightM",
161
146
  ...otherProps,
162
- ref: ref,
163
- children: children
164
- }));
147
+ ref: ref
148
+ }, children));
165
149
  });
166
150
  $8c581f9822f07d46$export$358a232cca1ab2ac.displayName = 'Paragraph';
167
151
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AE4BA,KAAA,CAAMgD,sCAAgB,GAAG,CAAzB;SAESC,oCAAT,GAA0B,CAA1B;IACE,MAAA,CAAA,EAAO,AAAP,SAAO,AAAP,EAAO,CAAA,UAAP,CAAA,CAAA;QAAO,IAAA,EAAA,CAAA;QAAA,MAAA,EAAA,CAAA;IAAA,CAAA;AAKR,CAAA;SAMQC,2BAAK,CACZ,CADF,WAEIP,QAAQ,GAAG,CADb,wBAEEE,SAAS,GAAG,CAFd,gCAGEC,UAAU,GAAG,CAHf,+BAIEC,SAAS,GAAG,CAJd,uBAKEH,UAAU,GAAG,CALf,yBAMEpB,QANF,gBAOEE,WAPF,OAQEH,EARF,cASE4B,SATF,WAUEC,MAAM,GAAG,CAVX,WAWKrB,UAAH,CACU,CAbd,EAcEC,GAdF,EAeE,CAdA;IAeA,KAAA,CAAMqB,OAAO,GAAsB9B,EAAE,IAAIyB,sCAAzC;IAEA,MAAA,0BACG,UAAD;WACMjB,UAAJ;QACA,EAAA,EAAIsB,OAAD;QACH,SAAA,EAAW,SAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,UAAA,CAAI,CALV;YAMQC,OAAO,EAAE,CADP;YAEFC,UAAU,EAAEpB,0BAAM,CAACU,SAAD;YAClBC,UAAU,EAAEX,0BAAM,CAACW,UAAD;YAClBU,KAAK,EAAErB,0BAAM,CAACY,SAAD;YACbJ,QAAQ,EA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ErB,MAAM,GAAG,CAHX,4BAIKC,UAAH,CACoB,CARxB,EASEC,GATF,EAUE,CAPA;IAQA,MAAA,0BACG,yCAAD;QACE,EAAA,EAAIoC,iDAAD;QACH,MAAA,EAAQtC,MAAD;QACP,YAAA,EAAa,CAHf;QAIE,UAAA,EAAW,CAJb;QAKE,SAAA,EAAU,CALZ;QAME,QAAA,EAAS,CANX;QAOE,UAAA,EAAW,CAPb;QAQE,SAAA,EAAW,SAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,UAAA,CAAI,CAVV;YAWQyC,aAAa,EAAEpC,0BAAM,CAACqC,iBADpB;YAEFC,aAAa,EAAE,CAAfA;QAFE,CAAJ,GAIAtB,SALS;WAOPpB,UAAJ;QACA,GAAA,EAAKC,GAAD;kBAEHR,QAAD;;AAGL,CAAA;AAEM,KAAA,CAAMf,yCAAc,iBAGvBM,YAAK,CAACmB,UAAN,CAAiBoC,qCAAjB;;;;;;AC7CG,KAAA,CAAM3D,yCAAS,iBAAGI,YAAK,CAACmB,UAAU,EAGtC,CAHH,WAGKV,QAAF,WAAYM,MAAM,GAAG,CAArB,sBAA2CC,UAAH,CAAxC,CAAD,EAA0DC,GAA1D,GAAkE,CAAjE;IACD,MAAA,0BACG,yCAAD;QACE,EAAA,EAAG,CADL;QAEE,MAAA,EAAQF,MAAD;QACP,YAAA,EAAa,CAHf;QAIE,UAAA,EAAW,CAJb;WAKMC,UAAJ;QACA,GAAA,EAAKC,GAAD;kBAEHR,QAAD;;AAGL,CAhBwB;AAkBzBb,yCAAS,CAACkE,WAAV,GAAwB,CAAxB;;","sources":["packages/components/typography/src/index.ts","packages/components/typography/src/Heading.tsx","packages/components/typography/src/Text.tsx","packages/components/typography/src/Subheading.tsx","packages/components/typography/src/Typography.tsx","packages/components/typography/src/DisplayText.tsx","packages/components/typography/src/SectionHeading.tsx","packages/components/typography/src/Paragraph.tsx"],"sourcesContent":["export { Heading } from './Heading';\nexport type { HeadingProps, HeadingElement } from './Heading';\nexport { Subheading } from './Subheading';\nexport type { SubheadingProps } from './Subheading';\nexport { Typography } from './Typography';\nexport type { TypographyProps } from './Typography';\nexport { DisplayText } from './DisplayText';\nexport type { DisplayTextProps } from './DisplayText';\nexport { SectionHeading } from './SectionHeading';\nexport type { SectionHeadingProps } from './SectionHeading';\nexport { Paragraph } from './Paragraph';\nexport type { ParagraphProps } from './Paragraph';\nexport { Text } from './Text';\nexport type { TextProps } from './Text';\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nconst HEADING_DEFAULT_TAG = 'h1';\n\nexport type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface HeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n children?: React.ReactNode;\n isTruncated?: boolean;\n}\n\nexport type HeadingProps<\n E extends React.ElementType = typeof HEADING_DEFAULT_TAG\n> = PolymorphicProps<HeadingInternalProps, E>;\n\nfunction _Heading<E extends React.ElementType = typeof HEADING_DEFAULT_TAG>(\n { children, testId = 'cf-ui-heading', ...otherProps }: HeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeXl\"\n lineHeight=\"lineHeightXl\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Heading: PolymorphicComponent<\n ExpandProps<HeadingInternalProps>,\n typeof HEADING_DEFAULT_TAG\n> = React.forwardRef(_Heading);\n","import React from 'react';\nimport tokens, {\n FontSizeTokens,\n LineHeightTokens,\n FontWeightTokens,\n FontStackTokens,\n ColorTokens,\n} from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n PolymorphicComponent,\n CommonProps,\n MarginProps,\n PolymorphicProps,\n Box,\n ExpandProps,\n} from '@contentful/f36-core';\n\nexport interface TextInternalProps extends CommonProps, MarginProps {\n children?: React.ReactNode;\n fontSize?: FontSizeTokens;\n lineHeight?: LineHeightTokens;\n fontStack?: FontStackTokens;\n fontWeight?: FontWeightTokens;\n fontColor?: ColorTokens;\n isTruncated?: boolean;\n}\n\nconst TEXT_DEFAULT_TAG = 'span';\n\nfunction truncatedStyle() {\n return css({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n });\n}\n\nexport type TextProps<\n E extends React.ElementType = typeof TEXT_DEFAULT_TAG\n> = PolymorphicProps<TextInternalProps, E>;\n\nfunction _Text<E extends React.ElementType = typeof TEXT_DEFAULT_TAG>(\n {\n fontSize = 'fontSizeM',\n fontStack = 'fontStackPrimary',\n fontWeight = 'fontWeightNormal',\n fontColor = 'gray800',\n lineHeight = 'lineHeightM',\n children,\n isTruncated,\n as,\n className,\n margin = 'none',\n ...otherProps\n }: TextProps<E>,\n ref: React.Ref<any>,\n) {\n const Element: React.ElementType = as || TEXT_DEFAULT_TAG;\n\n return (\n <Box\n {...otherProps}\n as={Element}\n className={cx(\n css({\n padding: 0,\n fontFamily: tokens[fontStack],\n fontWeight: tokens[fontWeight],\n color: tokens[fontColor],\n fontSize: tokens[fontSize],\n lineHeight: tokens[lineHeight],\n }),\n isTruncated ? truncatedStyle() : null,\n className,\n )}\n margin={margin}\n ref={ref}\n >\n {children}\n </Box>\n );\n}\n\nexport const Text: PolymorphicComponent<\n ExpandProps<TextInternalProps>,\n typeof TEXT_DEFAULT_TAG\n> = React.forwardRef(_Text);\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SUBHEADING_DEFAULT_TAG = 'h3';\n\nexport interface SubheadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SubheadingProps<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n> = PolymorphicProps<SubheadingInternalProps, E>;\n\nfunction _Subheading<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n>(\n { children, testId = 'cf-ui-subheading', ...otherProps }: SubheadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SUBHEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontSize=\"fontSizeL\"\n lineHeight=\"lineHeightL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Subheading: PolymorphicComponent<\n ExpandProps<SubheadingInternalProps>,\n typeof SUBHEADING_DEFAULT_TAG\n> = React.forwardRef(_Subheading);\n","import React, { useEffect } from 'react';\n\nexport interface TypographyProps {\n children?: React.ReactNode;\n}\n\n/**\n * @deprecated\n */\nexport function Typography(props: TypographyProps) {\n useEffect(() => {\n console.warn(\n 'Forma 36: Typography component is deprecated. You can safely remove it from your components.',\n );\n }, []);\n return <>{props.children}</>;\n}\n","import React from 'react';\nimport { FontSizeTokens, LineHeightTokens } from '@contentful/f36-tokens';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\nimport type { HeadingElement } from './Heading';\n\nconst DISPLAY_TEXT_DEFAULT_TAG = 'h2';\n\nexport interface DisplayTextInternalProps extends CommonProps, MarginProps {\n size?: 'default' | 'large' | 'huge';\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type DisplayTextProps<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n> = PolymorphicProps<DisplayTextInternalProps, E>;\n\nfunction _DisplayText<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n>(\n {\n children,\n size = 'default',\n testId = 'cf-ui-display-text',\n ...otherProps\n }: DisplayTextProps<E>,\n ref: React.Ref<any>,\n) {\n let fontSize: FontSizeTokens = 'fontSize2Xl';\n let lineHeight: LineHeightTokens = 'lineHeight2Xl';\n\n if (size === 'huge') {\n fontSize = 'fontSize4Xl';\n lineHeight = 'lineHeight4Xl';\n } else if (size === 'large') {\n fontSize = 'fontSize3Xl';\n lineHeight = 'lineHeight3Xl';\n }\n\n return (\n <Text\n as={DISPLAY_TEXT_DEFAULT_TAG}\n testId={testId}\n marginBottom={size === 'default' ? 'spacingL' : 'spacingXl'}\n fontSize={fontSize}\n lineHeight={lineHeight}\n fontColor=\"gray900\"\n fontWeight=\"fontWeightDemiBold\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const DisplayText: PolymorphicComponent<\n ExpandProps<DisplayTextInternalProps>,\n typeof DISPLAY_TEXT_DEFAULT_TAG\n> = React.forwardRef(_DisplayText);\n","import React from 'react';\nimport tokens from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SECTION_HEADING_DEFAULT_TAG = 'h2';\n\nexport interface SectionHeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SectionHeadingProps<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n> = PolymorphicProps<SectionHeadingInternalProps, E>;\n\nfunction _SectionHeading<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n>(\n {\n children,\n className,\n testId = 'cf-ui-section-heading',\n ...otherProps\n }: SectionHeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SECTION_HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeS\"\n lineHeight=\"lineHeightS\"\n className={cx(\n css({\n letterSpacing: tokens.letterSpacingWide,\n textTransform: 'uppercase',\n }),\n className,\n )}\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const SectionHeading: PolymorphicComponent<\n ExpandProps<SectionHeadingInternalProps>,\n typeof SECTION_HEADING_DEFAULT_TAG\n> = React.forwardRef(_SectionHeading);\n","import React from 'react';\nimport {\n PropsWithHTMLElement,\n CommonProps,\n MarginProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nexport type ParagraphInternalProps = CommonProps &\n MarginProps & {\n children: React.ReactNode;\n isTruncated?: boolean;\n };\n\nexport type ParagraphProps = PropsWithHTMLElement<ParagraphInternalProps, 'p'>;\n\nexport const Paragraph = React.forwardRef<\n HTMLParagraphElement,\n ExpandProps<ParagraphProps>\n>(({ children, testId = 'cf-ui-paragraph', ...otherProps }, ref) => {\n return (\n <Text\n as=\"p\"\n testId={testId}\n marginBottom=\"spacingM\"\n lineHeight=\"lineHeightM\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n});\n\nParagraph.displayName = 'Paragraph';\n"],"names":["Heading","HeadingProps","HeadingElement","Subheading","SubheadingProps","Typography","TypographyProps","DisplayText","DisplayTextProps","SectionHeading","SectionHeadingProps","Paragraph","ParagraphProps","Text","TextProps","React","CommonProps","MarginProps","PolymorphicComponent","PolymorphicProps","ExpandProps","HEADING_DEFAULT_TAG","HeadingInternalProps","as","children","ReactNode","isTruncated","ElementType","E","_Heading","testId","otherProps","ref","Ref","forwardRef","tokens","FontSizeTokens","LineHeightTokens","FontWeightTokens","FontStackTokens","ColorTokens","Box","TextInternalProps","fontSize","lineHeight","fontStack","fontWeight","fontColor","TEXT_DEFAULT_TAG","truncatedStyle","_Text","className","margin","Element","padding","fontFamily","color","SUBHEADING_DEFAULT_TAG","SubheadingInternalProps","_Subheading","useEffect","props","console","warn","DISPLAY_TEXT_DEFAULT_TAG","DisplayTextInternalProps","size","_DisplayText","SECTION_HEADING_DEFAULT_TAG","SectionHeadingInternalProps","_SectionHeading","letterSpacing","letterSpacingWide","textTransform","PropsWithHTMLElement","ParagraphInternalProps","HTMLParagraphElement","displayName"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;AE4BA,KAAA,CAAMgD,sCAAgB,GAAG,CAAzB;SAESC,oCAAT,GAA0B,CAA1B;IACE,MAAA,CAAA,EAAO,AAAP,SAAO,AAAP,EAAO,CAAA,UAAP,CAAA,CAAA;QAAO,IAAA,EAAA,CAAA;QAAA,MAAA,EAAA,CAAA;IAAA,CAAA;AAKR,CAAA;SAMQC,2BAAK,CACZ,CADF,WAEIP,QAAQ,GAAG,CADb,wBAEEE,SAAS,GAAG,CAFd,gCAGEC,UAAU,GAAG,CAHf,+BAIEC,SAAS,GAAG,CAJd,uBAKEH,UAAU,GAAG,CALf,yBAMEpB,QANF,gBAOEE,WAPF,OAQEH,EARF,cASE4B,SATF,WAUEC,MAAM,GAAG,CAVX,WAWKrB,UAAH,CACU,CAbd,EAcEC,GAdF,EAeE,CAdA;IAeA,KAAA,CAAMqB,OAAO,GAAsB9B,EAAE,IAAIyB,sCAAzC;IAEA,MAAA,0CACG,UAAD;WACMjB,UAAJ;QACA,EAAA,EAAIsB,OAAD;QACH,SAAA,EAAW,SAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,UAAA,CAAI,CALV;YAMQC,OAAO,EAAE,CADP;YAEFC,UAAU,EAAEpB,0BAAM,CAACU,SAAD;YAClBC,UAAU,EAAEX,0BAAM,CAACW,UAAD;YAClBU,KAAK,EAAErB,0BAAM,CAACY,SAAD;YACbJ,QAAQ,EAAER,0BAAM,CAACQ,QAAD;YAChBC,UAAU,EAAET,0BAAM,CAACS,UAAD;QANhB,CAAJ,GAQAlB,WAAW,GAAGuB,oCAAc,KAAK,IATxB,EAUTE,SAVS;QAYX,MAAA,EAAQC,MAAD;QACP,GAAA,EAAKpB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AJb;QAKE,SAAA,EAAU,CALZ;QAME,QAAA,EAAS,CANX;QAOE,UAAA,EAAW,CAPb;QAQE,SAAA,EAAW,SAAA,CAAA,EACT,AADS,SACT,AADS,EACT,CAAA,UAAA,CAAI,CAVV;YAWQyC,aAAa,EAAEpC,0BAAM,CAACqC,iBADpB;YAEFC,aAAa,EAAE,CAAfA;QAFE,CAAJ,GAIAtB,SALS;WAOPpB,UAAJ;QACA,GAAA,EAAKC,GAAD;OAEHR,QAAD;AAGL,CAAA;AAEM,KAAA,CAAMf,yCAAc,iBAGvBM,YAAK,CAACmB,UAAN,CAAiBoC,qCAAjB;;;;;AC7CG,KAAA,CAAM3D,yCAAS,iBAAGI,YAAK,CAACmB,UAAU,EAGtC,CAHH,WAGKV,QAAF,WAAYM,MAAM,GAAG,CAArB,sBAA2CC,UAAH,CAAxC,CAAD,EAA0DC,GAA1D,GAAkE,CAAjE;IACD,MAAA,0CACG,yCAAD;QACE,EAAA,EAAG,CADL;QAEE,MAAA,EAAQF,MAAD;QACP,YAAA,EAAa,CAHf;QAIE,UAAA,EAAW,CAJb;WAKMC,UAAJ;QACA,GAAA,EAAKC,GAAD;OAEHR,QAAD;AAGL,CAhBwB;AAkBzBb,yCAAS,CAACkE,WAAV,GAAwB,CAAxB;;","sources":["packages/components/typography/src/index.ts","packages/components/typography/src/Heading.tsx","packages/components/typography/src/Text.tsx","packages/components/typography/src/Subheading.tsx","packages/components/typography/src/Typography.tsx","packages/components/typography/src/DisplayText.tsx","packages/components/typography/src/SectionHeading.tsx","packages/components/typography/src/Paragraph.tsx"],"sourcesContent":["export { Heading } from './Heading';\nexport type { HeadingProps, HeadingElement } from './Heading';\nexport { Subheading } from './Subheading';\nexport type { SubheadingProps } from './Subheading';\nexport { Typography } from './Typography';\nexport type { TypographyProps } from './Typography';\nexport { DisplayText } from './DisplayText';\nexport type { DisplayTextProps } from './DisplayText';\nexport { SectionHeading } from './SectionHeading';\nexport type { SectionHeadingProps } from './SectionHeading';\nexport { Paragraph } from './Paragraph';\nexport type { ParagraphProps } from './Paragraph';\nexport { Text } from './Text';\nexport type { TextProps } from './Text';\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nconst HEADING_DEFAULT_TAG = 'h1';\n\nexport type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface HeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n children?: React.ReactNode;\n isTruncated?: boolean;\n}\n\nexport type HeadingProps<\n E extends React.ElementType = typeof HEADING_DEFAULT_TAG\n> = PolymorphicProps<HeadingInternalProps, E>;\n\nfunction _Heading<E extends React.ElementType = typeof HEADING_DEFAULT_TAG>(\n { children, testId = 'cf-ui-heading', ...otherProps }: HeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeXl\"\n lineHeight=\"lineHeightXl\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Heading: PolymorphicComponent<\n ExpandProps<HeadingInternalProps>,\n typeof HEADING_DEFAULT_TAG\n> = React.forwardRef(_Heading);\n","import React from 'react';\nimport tokens, {\n FontSizeTokens,\n LineHeightTokens,\n FontWeightTokens,\n FontStackTokens,\n ColorTokens,\n} from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n PolymorphicComponent,\n CommonProps,\n MarginProps,\n PolymorphicProps,\n Box,\n ExpandProps,\n} from '@contentful/f36-core';\n\nexport interface TextInternalProps extends CommonProps, MarginProps {\n children?: React.ReactNode;\n fontSize?: FontSizeTokens;\n lineHeight?: LineHeightTokens;\n fontStack?: FontStackTokens;\n fontWeight?: FontWeightTokens;\n fontColor?: ColorTokens;\n isTruncated?: boolean;\n}\n\nconst TEXT_DEFAULT_TAG = 'span';\n\nfunction truncatedStyle() {\n return css({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n });\n}\n\nexport type TextProps<\n E extends React.ElementType = typeof TEXT_DEFAULT_TAG\n> = PolymorphicProps<TextInternalProps, E>;\n\nfunction _Text<E extends React.ElementType = typeof TEXT_DEFAULT_TAG>(\n {\n fontSize = 'fontSizeM',\n fontStack = 'fontStackPrimary',\n fontWeight = 'fontWeightNormal',\n fontColor = 'gray800',\n lineHeight = 'lineHeightM',\n children,\n isTruncated,\n as,\n className,\n margin = 'none',\n ...otherProps\n }: TextProps<E>,\n ref: React.Ref<any>,\n) {\n const Element: React.ElementType = as || TEXT_DEFAULT_TAG;\n\n return (\n <Box\n {...otherProps}\n as={Element}\n className={cx(\n css({\n padding: 0,\n fontFamily: tokens[fontStack],\n fontWeight: tokens[fontWeight],\n color: tokens[fontColor],\n fontSize: tokens[fontSize],\n lineHeight: tokens[lineHeight],\n }),\n isTruncated ? truncatedStyle() : null,\n className,\n )}\n margin={margin}\n ref={ref}\n >\n {children}\n </Box>\n );\n}\n\nexport const Text: PolymorphicComponent<\n ExpandProps<TextInternalProps>,\n typeof TEXT_DEFAULT_TAG\n> = React.forwardRef(_Text);\n","import React from 'react';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SUBHEADING_DEFAULT_TAG = 'h3';\n\nexport interface SubheadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SubheadingProps<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n> = PolymorphicProps<SubheadingInternalProps, E>;\n\nfunction _Subheading<\n E extends React.ElementType = typeof SUBHEADING_DEFAULT_TAG\n>(\n { children, testId = 'cf-ui-subheading', ...otherProps }: SubheadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SUBHEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingM\"\n fontSize=\"fontSizeL\"\n lineHeight=\"lineHeightL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const Subheading: PolymorphicComponent<\n ExpandProps<SubheadingInternalProps>,\n typeof SUBHEADING_DEFAULT_TAG\n> = React.forwardRef(_Subheading);\n","import React, { useEffect } from 'react';\n\nexport interface TypographyProps {\n children?: React.ReactNode;\n}\n\n/**\n * @deprecated\n */\nexport function Typography(props: TypographyProps) {\n useEffect(() => {\n console.warn(\n 'Forma 36: Typography component is deprecated. You can safely remove it from your components.',\n );\n }, []);\n return <>{props.children}</>;\n}\n","import React from 'react';\nimport { FontSizeTokens, LineHeightTokens } from '@contentful/f36-tokens';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\nimport type { HeadingElement } from './Heading';\n\nconst DISPLAY_TEXT_DEFAULT_TAG = 'h2';\n\nexport interface DisplayTextInternalProps extends CommonProps, MarginProps {\n size?: 'default' | 'large' | 'huge';\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type DisplayTextProps<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n> = PolymorphicProps<DisplayTextInternalProps, E>;\n\nfunction _DisplayText<\n E extends React.ElementType = typeof DISPLAY_TEXT_DEFAULT_TAG\n>(\n {\n children,\n size = 'default',\n testId = 'cf-ui-display-text',\n ...otherProps\n }: DisplayTextProps<E>,\n ref: React.Ref<any>,\n) {\n let fontSize: FontSizeTokens = 'fontSize2Xl';\n let lineHeight: LineHeightTokens = 'lineHeight2Xl';\n\n if (size === 'huge') {\n fontSize = 'fontSize4Xl';\n lineHeight = 'lineHeight4Xl';\n } else if (size === 'large') {\n fontSize = 'fontSize3Xl';\n lineHeight = 'lineHeight3Xl';\n }\n\n return (\n <Text\n as={DISPLAY_TEXT_DEFAULT_TAG}\n testId={testId}\n marginBottom={size === 'default' ? 'spacingL' : 'spacingXl'}\n fontSize={fontSize}\n lineHeight={lineHeight}\n fontColor=\"gray900\"\n fontWeight=\"fontWeightDemiBold\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const DisplayText: PolymorphicComponent<\n ExpandProps<DisplayTextInternalProps>,\n typeof DISPLAY_TEXT_DEFAULT_TAG\n> = React.forwardRef(_DisplayText);\n","import React from 'react';\nimport tokens from '@contentful/f36-tokens';\nimport { css, cx } from 'emotion';\nimport {\n CommonProps,\n MarginProps,\n PolymorphicComponent,\n PolymorphicProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport type { HeadingElement } from './Heading';\nimport { Text } from './Text';\n\nconst SECTION_HEADING_DEFAULT_TAG = 'h2';\n\nexport interface SectionHeadingInternalProps extends CommonProps, MarginProps {\n as?: HeadingElement;\n isTruncated?: boolean;\n}\n\nexport type SectionHeadingProps<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n> = PolymorphicProps<SectionHeadingInternalProps, E>;\n\nfunction _SectionHeading<\n E extends React.ElementType = typeof SECTION_HEADING_DEFAULT_TAG\n>(\n {\n children,\n className,\n testId = 'cf-ui-section-heading',\n ...otherProps\n }: SectionHeadingProps<E>,\n ref: React.Ref<any>,\n) {\n return (\n <Text\n as={SECTION_HEADING_DEFAULT_TAG}\n testId={testId}\n marginBottom=\"spacingL\"\n fontWeight=\"fontWeightDemiBold\"\n fontColor=\"gray900\"\n fontSize=\"fontSizeS\"\n lineHeight=\"lineHeightS\"\n className={cx(\n css({\n letterSpacing: tokens.letterSpacingWide,\n textTransform: 'uppercase',\n }),\n className,\n )}\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n}\n\nexport const SectionHeading: PolymorphicComponent<\n ExpandProps<SectionHeadingInternalProps>,\n typeof SECTION_HEADING_DEFAULT_TAG\n> = React.forwardRef(_SectionHeading);\n","import React from 'react';\nimport {\n PropsWithHTMLElement,\n CommonProps,\n MarginProps,\n ExpandProps,\n} from '@contentful/f36-core';\nimport { Text } from './Text';\n\nexport type ParagraphInternalProps = CommonProps &\n MarginProps & {\n children: React.ReactNode;\n isTruncated?: boolean;\n };\n\nexport type ParagraphProps = PropsWithHTMLElement<ParagraphInternalProps, 'p'>;\n\nexport const Paragraph = React.forwardRef<\n HTMLParagraphElement,\n ExpandProps<ParagraphProps>\n>(({ children, testId = 'cf-ui-paragraph', ...otherProps }, ref) => {\n return (\n <Text\n as=\"p\"\n testId={testId}\n marginBottom=\"spacingM\"\n lineHeight=\"lineHeightM\"\n {...otherProps}\n ref={ref}\n >\n {children}\n </Text>\n );\n});\n\nParagraph.displayName = 'Paragraph';\n"],"names":["Heading","HeadingProps","HeadingElement","Subheading","SubheadingProps","Typography","TypographyProps","DisplayText","DisplayTextProps","SectionHeading","SectionHeadingProps","Paragraph","ParagraphProps","Text","TextProps","React","CommonProps","MarginProps","PolymorphicComponent","PolymorphicProps","ExpandProps","HEADING_DEFAULT_TAG","HeadingInternalProps","as","children","ReactNode","isTruncated","ElementType","E","_Heading","testId","otherProps","ref","Ref","forwardRef","tokens","FontSizeTokens","LineHeightTokens","FontWeightTokens","FontStackTokens","ColorTokens","Box","TextInternalProps","fontSize","lineHeight","fontStack","fontWeight","fontColor","TEXT_DEFAULT_TAG","truncatedStyle","_Text","className","margin","Element","padding","fontFamily","color","SUBHEADING_DEFAULT_TAG","SubheadingInternalProps","_Subheading","useEffect","props","console","warn","DISPLAY_TEXT_DEFAULT_TAG","DisplayTextInternalProps","size","_DisplayText","SECTION_HEADING_DEFAULT_TAG","SectionHeadingInternalProps","_SectionHeading","letterSpacing","letterSpacingWide","textTransform","PropsWithHTMLElement","ParagraphInternalProps","HTMLParagraphElement","displayName"],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/f36-typography",
3
- "version": "4.0.1-beta.2590+bfd9a9a5",
3
+ "version": "4.0.1-beta.2705+752a0cc0",
4
4
  "description": "Forma 36: typography React Component",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@babel/runtime": "^7.6.2",
24
- "@contentful/f36-core": "4.0.1-beta.2590+bfd9a9a5",
25
- "@contentful/f36-tokens": "4.0.1-beta.2590+bfd9a9a5",
24
+ "@contentful/f36-core": "4.0.1-beta.2705+752a0cc0",
25
+ "@contentful/f36-tokens": "4.0.1-beta.2705+752a0cc0",
26
26
  "emotion": "^10.0.17"
27
27
  },
28
28
  "peerDependencies": {
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "bfd9a9a5affcb943abbc97639ebae3abc67844fd"
34
+ "gitHead": "752a0cc09fdc3b90aa349ca973d0a1f73b03650a"
35
35
  }