@mirohq/design-system-typography 0.5.9 → 0.6.1

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
@@ -7,6 +7,7 @@ var React = require('react');
7
7
  var designSystemUseLocalStorage = require('@mirohq/design-system-use-local-storage');
8
8
  var designSystemStitches = require('@mirohq/design-system-stitches');
9
9
  var designSystemPrimitive = require('@mirohq/design-system-primitive');
10
+ var designSystemExperiments = require('@mirohq/design-system-experiments');
10
11
 
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
13
 
@@ -105,6 +106,11 @@ const textStyles = {
105
106
  const StyledText = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
106
107
  ...textStyles.default,
107
108
  variants: {
109
+ v1: {
110
+ true: {
111
+ fontFamily: "$body-v1"
112
+ }
113
+ },
108
114
  debug: {
109
115
  true: {
110
116
  color: "#06D834 !important"
@@ -126,10 +132,12 @@ const StyledText = designSystemStitches.styled(designSystemPrimitive.Primitive.s
126
132
  const Text = React__default["default"].forwardRef(
127
133
  ({ size, weight, ...restProps }, forwardRef) => {
128
134
  const [debug] = designSystemUseLocalStorage.useLocalStorage("DEBUG_TEXT", false);
135
+ const [v1] = designSystemExperiments.useNewDesignLanguage();
129
136
  return /* @__PURE__ */ jsxRuntime.jsx(
130
137
  StyledText,
131
138
  {
132
139
  ...restProps,
140
+ v1,
133
141
  ref: forwardRef,
134
142
  debug,
135
143
  size,
@@ -143,6 +151,11 @@ const StyledParagraph = designSystemStitches.styled(designSystemPrimitive.Primit
143
151
  ...textStyles.default,
144
152
  margin: 0,
145
153
  variants: {
154
+ v1: {
155
+ true: {
156
+ fontFamily: "$body-v1"
157
+ }
158
+ },
146
159
  debug: {
147
160
  true: {
148
161
  color: "#06D834 !important"
@@ -164,7 +177,8 @@ const StyledParagraph = designSystemStitches.styled(designSystemPrimitive.Primit
164
177
  const Paragraph = React__default["default"].forwardRef(
165
178
  (props, forwardRef) => {
166
179
  const [debug] = designSystemUseLocalStorage.useLocalStorage("DEBUG_TEXT", false);
167
- return /* @__PURE__ */ jsxRuntime.jsx(StyledParagraph, { ref: forwardRef, debug, ...props });
180
+ const [v1] = designSystemExperiments.useNewDesignLanguage();
181
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledParagraph, { ref: forwardRef, v1, debug, ...props });
168
182
  }
169
183
  );
170
184
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/heading.styled.tsx","../src/heading.tsx","../src/styles.ts","../src/text.styled.ts","../src/text.tsx","../src/paragraph.styled.ts","../src/paragraph.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ComponentPropsWithRef } from 'react'\n\nconst styles = {\n display: 'block',\n fontFamily: '$heading',\n margin: 0,\n color: '$text-neutrals',\n fontStyle: 'normal',\n fontWeight: 500,\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n level: {\n 1: {\n lineHeight: 1.2,\n fontSize: '$400',\n },\n 2: {\n lineHeight: 1.35,\n fontSize: '$300',\n },\n 3: {\n lineHeight: 1.4,\n fontSize: '$250',\n },\n 4: {\n lineHeight: 1.5,\n fontSize: '$200',\n },\n },\n },\n}\n\nexport const H1 = styled(Primitive.h1, styles)\n/** @knipignore */\nexport const H2 = styled(Primitive.h2, styles)\n/** @knipignore */\nexport const H3 = styled(Primitive.h3, styles)\n/** @knipignore */\nexport const H4 = styled(Primitive.h4, styles)\n\nexport type StyledHeadingProps = ComponentPropsWithRef<typeof H1>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport * as Styled from './heading.styled'\nimport type { StyledHeadingProps } from './heading.styled'\n\ntype Level = 1 | 2 | 3 | 4\ntype Tags = 'h1' | 'h2' | 'h3' | 'h4'\n\nexport interface HeadingProps extends StyledHeadingProps {\n /**\n * The sematic heading level used in the HTML markup.\n */\n level: Level\n\n /**\n * The way the sematic tag looks, it changes the styling of the heading.\n */\n styledAs?: Tags\n}\n\nexport const Heading = React.forwardRef<ElementRef<Tags>, HeadingProps>(\n ({ level, styledAs, children, ...props }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const HeadingLevel = Styled[`H${level}`]\n const styledAsLevel =\n styledAs !== undefined ? (+styledAs.replace('h', '') as Level) : styledAs\n return (\n <HeadingLevel\n {...props}\n debug={debug}\n level={styledAsLevel ?? level}\n ref={forwardRef}\n >\n {children}\n </HeadingLevel>\n )\n }\n)\n","export const textStyles = {\n default: {\n lineHeight: 1.5,\n },\n size: {\n normal: {\n fontSize: '$200',\n },\n small: {\n fontSize: '$175',\n },\n mini: {\n fontSize: '$150',\n },\n },\n weight: {\n normal: {\n fontWeight: 400,\n },\n bold: {\n fontWeight: 650,\n },\n },\n}\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledText = styled(Primitive.span, {\n ...textStyles.default,\n\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledTextProps = ComponentPropsWithRef<typeof StyledText>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport { StyledText } from './text.styled'\nimport type { StyledTextProps } from './text.styled'\n\nexport interface TextProps extends StyledTextProps {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the text font-size.\n */\n size?: StyledTextProps['size']\n\n /**\n * Change the text font-weight.\n */\n weight?: StyledTextProps['weight']\n}\n\nexport const Text = React.forwardRef<ElementRef<typeof StyledText>, TextProps>(\n ({ size, weight, ...restProps }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n return (\n <StyledText\n {...restProps}\n ref={forwardRef}\n debug={debug}\n size={size}\n weight={weight}\n />\n )\n }\n)\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledParagraph = styled(Primitive.p, {\n ...textStyles.default,\n margin: 0,\n\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledParagraphProps = ComponentPropsWithRef<typeof StyledParagraph>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport type { StyledParagraphProps } from './paragraph.styled'\nimport { StyledParagraph } from './paragraph.styled'\n\nexport interface ParagraphProps extends StyledParagraphProps {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the paragraph font-size.\n */\n size?: StyledParagraphProps['size']\n\n /**\n * Change the paragraph font-weight.\n */\n weight?: StyledParagraphProps['weight']\n}\n\nexport const Paragraph = React.forwardRef<ElementRef<'p'>, ParagraphProps>(\n (props, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n return <StyledParagraph ref={forwardRef} debug={debug} {...props} />\n }\n)\n"],"names":["styled","Primitive","React","useLocalStorage","jsx"],"mappings":";;;;;;;;;;;;;;AAIA,MAAM,MAAS,GAAA;AAAA,EACb,OAAS,EAAA,OAAA;AAAA,EACT,UAAY,EAAA,UAAA;AAAA,EACZ,MAAQ,EAAA,CAAA;AAAA,EACR,KAAO,EAAA,gBAAA;AAAA,EACP,SAAW,EAAA,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IAAA;AAAA,KAC1B;AAAA,GACF;AACF,CAAC,CAAA;;ACHM,MAAM,YAAYC,yBAAM,CAAA,UAAA;AAAA,EAC7B,CAAC,OAAO,UAAe,KAAA;AACrB,IAAA,MAAM,CAAC,KAAK,CAAI,GAAAC,2CAAA,CAAgB,cAAc,KAAK,CAAA,CAAA;AACnD,IAAA,sCAAQ,eAAgB,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,KAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GACpE;AACF;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../src/heading.styled.tsx","../src/heading.tsx","../src/styles.ts","../src/text.styled.ts","../src/text.tsx","../src/paragraph.styled.ts","../src/paragraph.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ComponentPropsWithRef } from 'react'\n\nconst styles = {\n display: 'block',\n fontFamily: '$heading',\n margin: 0,\n color: '$text-neutrals',\n fontStyle: 'normal',\n fontWeight: 500,\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n level: {\n 1: {\n lineHeight: 1.2,\n fontSize: '$400',\n },\n 2: {\n lineHeight: 1.35,\n fontSize: '$300',\n },\n 3: {\n lineHeight: 1.4,\n fontSize: '$250',\n },\n 4: {\n lineHeight: 1.5,\n fontSize: '$200',\n },\n },\n },\n}\n\nexport const H1 = styled(Primitive.h1, styles)\n/** @knipignore */\nexport const H2 = styled(Primitive.h2, styles)\n/** @knipignore */\nexport const H3 = styled(Primitive.h3, styles)\n/** @knipignore */\nexport const H4 = styled(Primitive.h4, styles)\n\nexport type StyledHeadingProps = ComponentPropsWithRef<typeof H1>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport * as Styled from './heading.styled'\nimport type { StyledHeadingProps } from './heading.styled'\n\ntype Level = 1 | 2 | 3 | 4\ntype Tags = 'h1' | 'h2' | 'h3' | 'h4'\n\nexport interface HeadingProps extends Omit<StyledHeadingProps, 'debug'> {\n /**\n * The sematic heading level used in the HTML markup.\n */\n level: Level\n\n /**\n * The way the sematic tag looks, it changes the styling of the heading.\n */\n styledAs?: Tags\n}\n\nexport const Heading = React.forwardRef<ElementRef<Tags>, HeadingProps>(\n ({ level, styledAs, children, ...props }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const HeadingLevel = Styled[`H${level}`]\n const styledAsLevel =\n styledAs !== undefined ? (+styledAs.replace('h', '') as Level) : styledAs\n return (\n <HeadingLevel\n {...props}\n debug={debug}\n level={styledAsLevel ?? level}\n ref={forwardRef}\n >\n {children}\n </HeadingLevel>\n )\n }\n)\n","export const textStyles = {\n default: {\n lineHeight: 1.5,\n },\n size: {\n normal: {\n fontSize: '$200',\n },\n small: {\n fontSize: '$175',\n },\n mini: {\n fontSize: '$150',\n },\n },\n weight: {\n normal: {\n fontWeight: 400,\n },\n bold: {\n fontWeight: 650,\n },\n },\n}\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledText = styled(Primitive.span, {\n ...textStyles.default,\n\n variants: {\n v1: {\n true: {\n fontFamily: '$body-v1',\n },\n },\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledTextProps = ComponentPropsWithRef<typeof StyledText>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport { StyledText } from './text.styled'\nimport type { StyledTextProps } from './text.styled'\n\nexport interface TextProps extends Omit<StyledTextProps, 'v1' | 'debug'> {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the text font-size.\n */\n size?: StyledTextProps['size']\n\n /**\n * Change the text font-weight.\n */\n weight?: StyledTextProps['weight']\n}\n\nexport const Text = React.forwardRef<ElementRef<typeof StyledText>, TextProps>(\n ({ size, weight, ...restProps }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const [v1] = useNewDesignLanguage()\n\n return (\n <StyledText\n {...restProps}\n v1={v1}\n ref={forwardRef}\n debug={debug}\n size={size}\n weight={weight}\n />\n )\n }\n)\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledParagraph = styled(Primitive.p, {\n ...textStyles.default,\n margin: 0,\n\n variants: {\n v1: {\n true: {\n fontFamily: '$body-v1',\n },\n },\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledParagraphProps = ComponentPropsWithRef<typeof StyledParagraph>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport type { StyledParagraphProps } from './paragraph.styled'\nimport { StyledParagraph } from './paragraph.styled'\n\nexport interface ParagraphProps\n extends Omit<StyledParagraphProps, 'v1' | 'debug'> {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the paragraph font-size.\n */\n size?: StyledParagraphProps['size']\n\n /**\n * Change the paragraph font-weight.\n */\n weight?: StyledParagraphProps['weight']\n}\n\nexport const Paragraph = React.forwardRef<ElementRef<'p'>, ParagraphProps>(\n (props, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const [v1] = useNewDesignLanguage()\n\n return <StyledParagraph ref={forwardRef} v1={v1} debug={debug} {...props} />\n }\n)\n"],"names":["styled","Primitive","React","useLocalStorage","jsx","useNewDesignLanguage"],"mappings":";;;;;;;;;;;;;;;AAIA,MAAM,MAAS,GAAA;AAAA,EACb,OAAS,EAAA,OAAA;AAAA,EACT,UAAY,EAAA,UAAA;AAAA,EACZ,MAAQ,EAAA,CAAA;AAAA,EACR,KAAO,EAAA,gBAAA;AAAA,EACP,SAAW,EAAA,QAAA;AAAA,EACX,UAAY,EAAA,GAAA;AAAA,EACZ,QAAU,EAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,MACA,OAAO,EAAC;AAAA,KACV;AAAA,IACA,KAAO,EAAA;AAAA,MACL,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,IAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,KACF;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,EAAK,GAAAA,2BAAA,CAAOC,+BAAU,CAAA,EAAA,EAAI,MAAM,CAAA,CAAA;AAEtC,MAAM,EAAK,GAAAD,2BAAA,CAAOC,+BAAU,CAAA,EAAA,EAAI,MAAM,CAAA,CAAA;AAEtC,MAAM,EAAK,GAAAD,2BAAA,CAAOC,+BAAU,CAAA,EAAA,EAAI,MAAM,CAAA,CAAA;AAEtC,MAAM,EAAK,GAAAD,2BAAA,CAAOC,+BA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,GAAG,UAAW,CAAA,OAAA;AAAA,EACd,MAAQ,EAAA,CAAA;AAAA,EAER,QAAU,EAAA;AAAA,IACR,EAAI,EAAA;AAAA,MACF,IAAM,EAAA;AAAA,QACJ,UAAY,EAAA,UAAA;AAAA,OACd;AAAA,KACF;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,MACA,OAAO,EAAC;AAAA,KACV;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,MAAA,EAAQ,WAAW,IAAK,CAAA,MAAA;AAAA,MACxB,KAAA,EAAO,WAAW,IAAK,CAAA,KAAA;AAAA,MACvB,IAAA,EAAM,WAAW,IAAK,CAAA,IAAA;AAAA,KACxB;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,MAAA,EAAQ,WAAW,MAAO,CAAA,MAAA;AAAA,MAC1B,IAAA,EAAM,WAAW,MAAO,CAAA,IAAA;AAAA,KAC1B;AAAA,GACF;AACF,CAAC,CAAA;;ACNM,MAAM,YAAYC,yBAAM,CAAA,UAAA;AAAA,EAC7B,CAAC,OAAO,UAAe,KAAA;AACrB,IAAA,MAAM,CAAC,KAAK,CAAI,GAAAC,2CAAA,CAAgB,cAAc,KAAK,CAAA,CAAA;AACnD,IAAM,MAAA,CAAC,EAAE,CAAA,GAAIE,4CAAqB,EAAA,CAAA;AAElC,IAAA,sCAAQ,eAAgB,EAAA,EAAA,GAAA,EAAK,YAAY,EAAQ,EAAA,KAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GAC5E;AACF;;;;;;"}
package/dist/module.js CHANGED
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { useLocalStorage } from '@mirohq/design-system-use-local-storage';
4
4
  import { styled } from '@mirohq/design-system-stitches';
5
5
  import { Primitive } from '@mirohq/design-system-primitive';
6
+ import { useNewDesignLanguage } from '@mirohq/design-system-experiments';
6
7
 
7
8
  const styles = {
8
9
  display: "block",
@@ -97,6 +98,11 @@ const textStyles = {
97
98
  const StyledText = styled(Primitive.span, {
98
99
  ...textStyles.default,
99
100
  variants: {
101
+ v1: {
102
+ true: {
103
+ fontFamily: "$body-v1"
104
+ }
105
+ },
100
106
  debug: {
101
107
  true: {
102
108
  color: "#06D834 !important"
@@ -118,10 +124,12 @@ const StyledText = styled(Primitive.span, {
118
124
  const Text = React.forwardRef(
119
125
  ({ size, weight, ...restProps }, forwardRef) => {
120
126
  const [debug] = useLocalStorage("DEBUG_TEXT", false);
127
+ const [v1] = useNewDesignLanguage();
121
128
  return /* @__PURE__ */ jsx(
122
129
  StyledText,
123
130
  {
124
131
  ...restProps,
132
+ v1,
125
133
  ref: forwardRef,
126
134
  debug,
127
135
  size,
@@ -135,6 +143,11 @@ const StyledParagraph = styled(Primitive.p, {
135
143
  ...textStyles.default,
136
144
  margin: 0,
137
145
  variants: {
146
+ v1: {
147
+ true: {
148
+ fontFamily: "$body-v1"
149
+ }
150
+ },
138
151
  debug: {
139
152
  true: {
140
153
  color: "#06D834 !important"
@@ -156,7 +169,8 @@ const StyledParagraph = styled(Primitive.p, {
156
169
  const Paragraph = React.forwardRef(
157
170
  (props, forwardRef) => {
158
171
  const [debug] = useLocalStorage("DEBUG_TEXT", false);
159
- return /* @__PURE__ */ jsx(StyledParagraph, { ref: forwardRef, debug, ...props });
172
+ const [v1] = useNewDesignLanguage();
173
+ return /* @__PURE__ */ jsx(StyledParagraph, { ref: forwardRef, v1, debug, ...props });
160
174
  }
161
175
  );
162
176
 
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/heading.styled.tsx","../src/heading.tsx","../src/styles.ts","../src/text.styled.ts","../src/text.tsx","../src/paragraph.styled.ts","../src/paragraph.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ComponentPropsWithRef } from 'react'\n\nconst styles = {\n display: 'block',\n fontFamily: '$heading',\n margin: 0,\n color: '$text-neutrals',\n fontStyle: 'normal',\n fontWeight: 500,\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n level: {\n 1: {\n lineHeight: 1.2,\n fontSize: '$400',\n },\n 2: {\n lineHeight: 1.35,\n fontSize: '$300',\n },\n 3: {\n lineHeight: 1.4,\n fontSize: '$250',\n },\n 4: {\n lineHeight: 1.5,\n fontSize: '$200',\n },\n },\n },\n}\n\nexport const H1 = styled(Primitive.h1, styles)\n/** @knipignore */\nexport const H2 = styled(Primitive.h2, styles)\n/** @knipignore */\nexport const H3 = styled(Primitive.h3, styles)\n/** @knipignore */\nexport const H4 = styled(Primitive.h4, styles)\n\nexport type StyledHeadingProps = ComponentPropsWithRef<typeof H1>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport * as Styled from './heading.styled'\nimport type { StyledHeadingProps } from './heading.styled'\n\ntype Level = 1 | 2 | 3 | 4\ntype Tags = 'h1' | 'h2' | 'h3' | 'h4'\n\nexport interface HeadingProps extends StyledHeadingProps {\n /**\n * The sematic heading level used in the HTML markup.\n */\n level: Level\n\n /**\n * The way the sematic tag looks, it changes the styling of the heading.\n */\n styledAs?: Tags\n}\n\nexport const Heading = React.forwardRef<ElementRef<Tags>, HeadingProps>(\n ({ level, styledAs, children, ...props }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const HeadingLevel = Styled[`H${level}`]\n const styledAsLevel =\n styledAs !== undefined ? (+styledAs.replace('h', '') as Level) : styledAs\n return (\n <HeadingLevel\n {...props}\n debug={debug}\n level={styledAsLevel ?? level}\n ref={forwardRef}\n >\n {children}\n </HeadingLevel>\n )\n }\n)\n","export const textStyles = {\n default: {\n lineHeight: 1.5,\n },\n size: {\n normal: {\n fontSize: '$200',\n },\n small: {\n fontSize: '$175',\n },\n mini: {\n fontSize: '$150',\n },\n },\n weight: {\n normal: {\n fontWeight: 400,\n },\n bold: {\n fontWeight: 650,\n },\n },\n}\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledText = styled(Primitive.span, {\n ...textStyles.default,\n\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledTextProps = ComponentPropsWithRef<typeof StyledText>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport { StyledText } from './text.styled'\nimport type { StyledTextProps } from './text.styled'\n\nexport interface TextProps extends StyledTextProps {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the text font-size.\n */\n size?: StyledTextProps['size']\n\n /**\n * Change the text font-weight.\n */\n weight?: StyledTextProps['weight']\n}\n\nexport const Text = React.forwardRef<ElementRef<typeof StyledText>, TextProps>(\n ({ size, weight, ...restProps }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n return (\n <StyledText\n {...restProps}\n ref={forwardRef}\n debug={debug}\n size={size}\n weight={weight}\n />\n )\n }\n)\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledParagraph = styled(Primitive.p, {\n ...textStyles.default,\n margin: 0,\n\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledParagraphProps = ComponentPropsWithRef<typeof StyledParagraph>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport type { StyledParagraphProps } from './paragraph.styled'\nimport { StyledParagraph } from './paragraph.styled'\n\nexport interface ParagraphProps extends StyledParagraphProps {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the paragraph font-size.\n */\n size?: StyledParagraphProps['size']\n\n /**\n * Change the paragraph font-weight.\n */\n weight?: StyledParagraphProps['weight']\n}\n\nexport const Paragraph = React.forwardRef<ElementRef<'p'>, ParagraphProps>(\n (props, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n return <StyledParagraph ref={forwardRef} debug={debug} {...props} />\n }\n)\n"],"names":[],"mappings":";;;;;;AAIA,MAAM,MAAS,GAAA;AAAA,EACb,OAAS,EAAA,OAAA;AAAA,EACT,UAAY,EAAA,UAAA;AAAA,EACZ,MAAQ,EAAA,CAAA;AAAA,EACR,KAAO,EAAA,gBAAA;AAAA,EACP,SAAW,EAAA,QAAA;AAAA,EACX,UAAY,EAAA,GAAA;AAAA,EACZ,QAAU,EAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,MACA,OAAO,EAAC;AAAA,KACV;AAAA,IACA,KAAO,EAAA;AAAA,MACL,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,IAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,KACF;AAAA,GACF;AACF,CAAA,CAAA;AAEO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Ba,MAAA,eAAA,GAAkB,MAAO,CAAA,SAAA,CAAU,CAAG,EAAA;AAAA,EACjD,GAAG,UAAW,CAAA,OAAA;AAAA,EACd,MAAQ,EAAA,CAAA;AAAA,EAER,QAAU,EAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,MACA,OAAO,EAAC;AAAA,KACV;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,MAAA,EAAQ,WAAW,IAAK,CAAA,MAAA;AAAA,MACxB,KAAA,EAAO,WAAW,IAAK,CAAA,KAAA;AAAA,MACvB,IAAA,EAAM,WAAW,IAAK,CAAA,IAAA;AAAA,KACxB;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,MAAA,EAAQ,WAAW,MAAO,CAAA,MAAA;AAAA,MAC1B,IAAA,EAAM,WAAW,MAAO,CAAA,IAAA;AAAA,KAC1B;AAAA,GACF;AACF,CAAC,CAAA;;ACHM,MAAM,YAAY,KAAM,CAAA,UAAA;AAAA,EAC7B,CAAC,OAAO,UAAe,KAAA;AACrB,IAAA,MAAM,CAAC,KAAK,CAAI,GAAA,eAAA,CAAgB,cAAc,KAAK,CAAA,CAAA;AACnD,IAAA,2BAAQ,eAAgB,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,KAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GACpE;AACF;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../src/heading.styled.tsx","../src/heading.tsx","../src/styles.ts","../src/text.styled.ts","../src/text.tsx","../src/paragraph.styled.ts","../src/paragraph.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ComponentPropsWithRef } from 'react'\n\nconst styles = {\n display: 'block',\n fontFamily: '$heading',\n margin: 0,\n color: '$text-neutrals',\n fontStyle: 'normal',\n fontWeight: 500,\n variants: {\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n level: {\n 1: {\n lineHeight: 1.2,\n fontSize: '$400',\n },\n 2: {\n lineHeight: 1.35,\n fontSize: '$300',\n },\n 3: {\n lineHeight: 1.4,\n fontSize: '$250',\n },\n 4: {\n lineHeight: 1.5,\n fontSize: '$200',\n },\n },\n },\n}\n\nexport const H1 = styled(Primitive.h1, styles)\n/** @knipignore */\nexport const H2 = styled(Primitive.h2, styles)\n/** @knipignore */\nexport const H3 = styled(Primitive.h3, styles)\n/** @knipignore */\nexport const H4 = styled(Primitive.h4, styles)\n\nexport type StyledHeadingProps = ComponentPropsWithRef<typeof H1>\n","import type { ElementRef } from 'react'\nimport React from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\n\nimport * as Styled from './heading.styled'\nimport type { StyledHeadingProps } from './heading.styled'\n\ntype Level = 1 | 2 | 3 | 4\ntype Tags = 'h1' | 'h2' | 'h3' | 'h4'\n\nexport interface HeadingProps extends Omit<StyledHeadingProps, 'debug'> {\n /**\n * The sematic heading level used in the HTML markup.\n */\n level: Level\n\n /**\n * The way the sematic tag looks, it changes the styling of the heading.\n */\n styledAs?: Tags\n}\n\nexport const Heading = React.forwardRef<ElementRef<Tags>, HeadingProps>(\n ({ level, styledAs, children, ...props }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const HeadingLevel = Styled[`H${level}`]\n const styledAsLevel =\n styledAs !== undefined ? (+styledAs.replace('h', '') as Level) : styledAs\n return (\n <HeadingLevel\n {...props}\n debug={debug}\n level={styledAsLevel ?? level}\n ref={forwardRef}\n >\n {children}\n </HeadingLevel>\n )\n }\n)\n","export const textStyles = {\n default: {\n lineHeight: 1.5,\n },\n size: {\n normal: {\n fontSize: '$200',\n },\n small: {\n fontSize: '$175',\n },\n mini: {\n fontSize: '$150',\n },\n },\n weight: {\n normal: {\n fontWeight: 400,\n },\n bold: {\n fontWeight: 650,\n },\n },\n}\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledText = styled(Primitive.span, {\n ...textStyles.default,\n\n variants: {\n v1: {\n true: {\n fontFamily: '$body-v1',\n },\n },\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledTextProps = ComponentPropsWithRef<typeof StyledText>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport { StyledText } from './text.styled'\nimport type { StyledTextProps } from './text.styled'\n\nexport interface TextProps extends Omit<StyledTextProps, 'v1' | 'debug'> {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the text font-size.\n */\n size?: StyledTextProps['size']\n\n /**\n * Change the text font-weight.\n */\n weight?: StyledTextProps['weight']\n}\n\nexport const Text = React.forwardRef<ElementRef<typeof StyledText>, TextProps>(\n ({ size, weight, ...restProps }, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const [v1] = useNewDesignLanguage()\n\n return (\n <StyledText\n {...restProps}\n v1={v1}\n ref={forwardRef}\n debug={debug}\n size={size}\n weight={weight}\n />\n )\n }\n)\n","import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\nimport { textStyles } from './styles'\n\nexport const StyledParagraph = styled(Primitive.p, {\n ...textStyles.default,\n margin: 0,\n\n variants: {\n v1: {\n true: {\n fontFamily: '$body-v1',\n },\n },\n debug: {\n true: {\n color: '#06D834 !important',\n },\n false: {},\n },\n size: {\n normal: textStyles.size.normal,\n small: textStyles.size.small,\n mini: textStyles.size.mini,\n },\n weight: {\n normal: textStyles.weight.normal,\n bold: textStyles.weight.bold,\n },\n },\n})\n\nexport type StyledParagraphProps = ComponentPropsWithRef<typeof StyledParagraph>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useLocalStorage } from '@mirohq/design-system-use-local-storage'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport type { StyledParagraphProps } from './paragraph.styled'\nimport { StyledParagraph } from './paragraph.styled'\n\nexport interface ParagraphProps\n extends Omit<StyledParagraphProps, 'v1' | 'debug'> {\n /**\n * The content.\n */\n children: React.ReactNode\n\n /**\n * Change the paragraph font-size.\n */\n size?: StyledParagraphProps['size']\n\n /**\n * Change the paragraph font-weight.\n */\n weight?: StyledParagraphProps['weight']\n}\n\nexport const Paragraph = React.forwardRef<ElementRef<'p'>, ParagraphProps>(\n (props, forwardRef) => {\n const [debug] = useLocalStorage('DEBUG_TEXT', false)\n const [v1] = useNewDesignLanguage()\n\n return <StyledParagraph ref={forwardRef} v1={v1} debug={debug} {...props} />\n }\n)\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,MAAS,GAAA;AAAA,EACb,OAAS,EAAA,OAAA;AAAA,EACT,UAAY,EAAA,UAAA;AAAA,EACZ,MAAQ,EAAA,CAAA;AAAA,EACR,KAAO,EAAA,gBAAA;AAAA,EACP,SAAW,EAAA,QAAA;AAAA,EACX,UAAY,EAAA,GAAA;AAAA,EACZ,QAAU,EAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,MACA,OAAO,EAAC;AAAA,KACV;AAAA,IACA,KAAO,EAAA;AAAA,MACL,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,CAAG,EAAA;AAAA,QACD,UAAY,EAAA,IAAA;AAAA,QACZ,QAAU,EAAA,MAAA;AAAA,OACZ;AAAA,MACA,C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gB,cAAc,KAAK,CAAA,CAAA;AACnD,IAAM,MAAA,CAAC,EAAE,CAAA,GAAI,oBAAqB,EAAA,CAAA;AAElC,IAAA,2BAAQ,eAAgB,EAAA,EAAA,GAAA,EAAK,YAAY,EAAQ,EAAA,KAAA,EAAe,GAAG,KAAO,EAAA,CAAA,CAAA;AAAA,GAC5E;AACF;;;;"}
package/dist/types.d.ts CHANGED
@@ -15,7 +15,7 @@ declare type StyledHeadingProps = ComponentPropsWithRef<typeof H1>;
15
15
 
16
16
  declare type Level = 1 | 2 | 3 | 4;
17
17
  declare type Tags = 'h1' | 'h2' | 'h3' | 'h4';
18
- interface HeadingProps extends StyledHeadingProps {
18
+ interface HeadingProps extends Omit<StyledHeadingProps, 'debug'> {
19
19
  /**
20
20
  * The sematic heading level used in the HTML markup.
21
21
  */
@@ -27,18 +27,20 @@ interface HeadingProps extends StyledHeadingProps {
27
27
  }
28
28
  declare const Heading: react__default.ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & react__default.RefAttributes<HTMLHeadingElement>>;
29
29
 
30
- declare const StyledText: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>>, "size" | "weight" | "debug"> & _stitches_react_types_styled_component.TransformProps<{
30
+ declare const StyledText: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>>, "size" | "weight" | "debug" | "v1"> & _stitches_react_types_styled_component.TransformProps<{
31
+ v1?: boolean | "true" | undefined;
31
32
  debug?: boolean | "true" | "false" | undefined;
32
33
  size?: "small" | "normal" | "mini" | undefined;
33
34
  weight?: "bold" | "normal" | undefined;
34
35
  }, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLSpanElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>, {
36
+ v1?: boolean | "true" | undefined;
35
37
  debug?: boolean | "true" | "false" | undefined;
36
38
  size?: "small" | "normal" | "mini" | undefined;
37
39
  weight?: "bold" | "normal" | undefined;
38
40
  }, {}>;
39
41
  declare type StyledTextProps = ComponentPropsWithRef<typeof StyledText>;
40
42
 
41
- interface TextProps extends StyledTextProps {
43
+ interface TextProps extends Omit<StyledTextProps, 'v1' | 'debug'> {
42
44
  /**
43
45
  * The content.
44
46
  */
@@ -54,18 +56,20 @@ interface TextProps extends StyledTextProps {
54
56
  }
55
57
  declare const Text: react__default.ForwardRefExoticComponent<Omit<TextProps, "ref"> & react__default.RefAttributes<HTMLSpanElement>>;
56
58
 
57
- declare const StyledParagraph: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"p">>>, "size" | "weight" | "debug"> & _stitches_react_types_styled_component.TransformProps<{
59
+ declare const StyledParagraph: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"p">>>, "size" | "weight" | "debug" | "v1"> & _stitches_react_types_styled_component.TransformProps<{
60
+ v1?: boolean | "true" | undefined;
58
61
  debug?: boolean | "true" | "false" | undefined;
59
62
  size?: "small" | "normal" | "mini" | undefined;
60
63
  weight?: "bold" | "normal" | undefined;
61
64
  }, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLParagraphElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"p">>, {
65
+ v1?: boolean | "true" | undefined;
62
66
  debug?: boolean | "true" | "false" | undefined;
63
67
  size?: "small" | "normal" | "mini" | undefined;
64
68
  weight?: "bold" | "normal" | undefined;
65
69
  }, {}>;
66
70
  declare type StyledParagraphProps = ComponentPropsWithRef<typeof StyledParagraph>;
67
71
 
68
- interface ParagraphProps extends StyledParagraphProps {
72
+ interface ParagraphProps extends Omit<StyledParagraphProps, 'v1' | 'debug'> {
69
73
  /**
70
74
  * The content.
71
75
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-typography",
3
- "version": "0.5.9",
3
+ "version": "0.6.1",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
@@ -26,9 +26,10 @@
26
26
  "react": "^16.14 || ^17 || ^18"
27
27
  },
28
28
  "dependencies": {
29
+ "@mirohq/design-system-experiments": "^0.2.0",
29
30
  "@mirohq/design-system-primitive": "^1.1.2",
30
- "@mirohq/design-system-stitches": "^2.6.22",
31
- "@mirohq/design-system-use-local-storage": "^0.3.11"
31
+ "@mirohq/design-system-use-local-storage": "^0.3.11",
32
+ "@mirohq/design-system-stitches": "^2.6.24"
32
33
  },
33
34
  "scripts": {
34
35
  "build": "rollup -c ../../../rollup.config.js",