@pushwoosh/kit-typography 1.5.1 → 1.6.0

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.
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const CodeBox = styled.div.withConfig({
4
4
  displayName: "CodeBox",
5
5
  componentId: "sc-15hd43f-0"
6
- })(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MONO, FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR);
6
+ })(["", ""], variants.code);
7
7
  CodeBox.displayName = 'CodeBox';
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const FootnoteBox = styled.div.withConfig({
4
4
  displayName: "FootnoteBox",
5
5
  componentId: "sc-1yebxfg-0"
6
- })(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.SMALL, FontWeight.REGULAR, LineHeight.SMALL);
6
+ })(["", ""], variants.footnote);
7
7
  FootnoteBox.displayName = 'FootnoteBox';
package/h1/h1.styles.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const H1Box = styled.h1.withConfig({
4
4
  displayName: "H1Box",
5
5
  componentId: "sc-nenzzw-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING1, FontWeight.BOLD, LineHeight.HEADING1);
6
+ })(["margin:0;", ""], variants.h1);
7
7
  H1Box.displayName = 'H1Box';
package/h2/h2.styles.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const H2Box = styled.h2.withConfig({
4
4
  displayName: "H2Box",
5
5
  componentId: "sc-ev7pmn-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING2, FontWeight.BOLD, LineHeight.HEADING2);
6
+ })(["margin:0;", ""], variants.h2);
7
7
  H2Box.displayName = 'H2Box';
package/h3/h3.styles.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const H3Box = styled.h3.withConfig({
4
4
  displayName: "H3Box",
5
5
  componentId: "sc-mhts3r-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING3, FontWeight.BOLD, LineHeight.HEADING3);
6
+ })(["margin:0;", ""], variants.h3);
7
7
  H3Box.displayName = 'H3Box';
package/h4/h4.styles.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const H4Box = styled.h4.withConfig({
4
4
  displayName: "H4Box",
5
5
  componentId: "sc-1178dfn-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING4, FontWeight.MEDIUM, LineHeight.HEADING4);
6
+ })(["margin:0;", ""], variants.h4);
7
7
  H4Box.displayName = 'H4Box';
package/h5/h5.styles.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const H5Box = styled.h5.withConfig({
4
4
  displayName: "H5Box",
5
5
  componentId: "sc-1nc3vby-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING5, FontWeight.MEDIUM, LineHeight.HEADING5);
6
+ })(["margin:0;", " text-transform:uppercase;"], variants.h5);
7
7
  H5Box.displayName = 'H5Box';
package/index.d.ts CHANGED
@@ -7,3 +7,5 @@ export * from './h3';
7
7
  export * from './h4';
8
8
  export * from './h5';
9
9
  export * from './paragraph';
10
+ export { Text } from './text/Text';
11
+ export { type TypographyVariant } from './map';
package/index.js CHANGED
@@ -6,4 +6,5 @@ export * from './h2';
6
6
  export * from './h3';
7
7
  export * from './h4';
8
8
  export * from './h5';
9
- export * from './paragraph';
9
+ export * from './paragraph';
10
+ export { Text } from './text/Text';
package/map.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { type FlattenSimpleInterpolation } from 'styled-components';
2
+ export type TypographyVariant = 'standard' | 'footnote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'code';
3
+ export declare const variants: Record<TypographyVariant, FlattenSimpleInterpolation>;
package/map.js ADDED
@@ -0,0 +1,12 @@
1
+ import { css } from 'styled-components';
2
+ import { FontFamily, FontSize, LineHeight, FontWeight } from '@pushwoosh/kit-constants';
3
+ export const variants = {
4
+ standard: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR),
5
+ footnote: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.SMALL, FontWeight.REGULAR, LineHeight.SMALL),
6
+ h1: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING1, FontWeight.BOLD, LineHeight.HEADING1),
7
+ h2: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING2, FontWeight.BOLD, LineHeight.HEADING2),
8
+ h3: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING3, FontWeight.BOLD, LineHeight.HEADING3),
9
+ h4: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING4, FontWeight.BOLD, LineHeight.HEADING4),
10
+ h5: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING5, FontWeight.MEDIUM, LineHeight.HEADING5),
11
+ code: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MONO, FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR)
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/kit-typography",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "React component for build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
- import { FontFamily, FontSize, FontWeight, LineHeight } from '@pushwoosh/kit-constants';
2
+ import { variants } from '../map';
3
3
  export const ParagraphBox = styled.p.withConfig({
4
4
  displayName: "ParagraphBox",
5
5
  componentId: "sc-1o1vp14-0"
6
- })(["margin:0;font-family:", ";font-size:", ";font-weight:", ";line-height:", ";& + &{margin:0.5em 0 0;}"], FontFamily.MAIN, FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR);
6
+ })(["margin:0;", " & + &{margin:0.5em 0 0;}"], variants.standard);
7
7
  ParagraphBox.displayName = 'ParagraphBox';
package/text/Text.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { type TypographyVariant } from '../map';
2
+ export declare const Text: import("styled-components").StyledComponent<"span", any, {
3
+ $color?: string | undefined;
4
+ $variant?: TypographyVariant | undefined;
5
+ }, never>;
package/text/Text.js ADDED
@@ -0,0 +1,10 @@
1
+ import styled from 'styled-components';
2
+ import { variants } from '../map';
3
+ export const Text = styled.span.withConfig({
4
+ displayName: "Text",
5
+ componentId: "sc-s3ssy9-0"
6
+ })(["", " ", "}"], ({
7
+ $color
8
+ }) => $color && `color: ${$color};`, ({
9
+ $variant = 'standard'
10
+ }) => variants[$variant]);