@pushwoosh/kit-typography 1.14.0 → 2.1.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.
- package/h1/h1.types.d.ts +3 -2
- package/h1/styles.d.ts +6 -3
- package/h1/styles.js +3 -1
- package/h2/h2.types.d.ts +3 -2
- package/h2/styles.d.ts +6 -3
- package/h2/styles.js +3 -1
- package/h3/h3.types.d.ts +3 -2
- package/h3/styles.d.ts +6 -3
- package/h3/styles.js +3 -1
- package/h4/h4.component.d.ts +1 -1
- package/h4/h4.component.js +1 -1
- package/h4/h4.types.d.ts +3 -2
- package/h4/styles.d.ts +6 -3
- package/h4/styles.js +3 -1
- package/index.d.ts +1 -2
- package/index.js +2 -2
- package/map.d.ts +1 -3
- package/map.js +1 -2
- package/package.json +2 -2
- package/h5/h5.component.d.ts +0 -4
- package/h5/h5.component.js +0 -13
- package/h5/h5.types.d.ts +0 -6
- package/h5/h5.types.js +0 -1
- package/h5/index.d.ts +0 -3
- package/h5/index.js +0 -3
- package/h5/styles.d.ts +0 -4
- package/h5/styles.js +0 -8
package/h1/h1.types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { JSX, ReactNode, Ref } from 'react';
|
|
2
|
-
/** Props of {@link H1}: every `<h1>` attribute plus `boxRef` — `ref` is taken by the wrapper
|
|
1
|
+
import type { CSSProperties, JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
/** Props of {@link H1}: every `<h1>` attribute plus `boxRef` — `ref` is taken by the wrapper — and `$textTransform`. */
|
|
3
3
|
export type H1Props = Omit<JSX.IntrinsicElements['h1'], 'ref'> & {
|
|
4
4
|
readonly boxRef?: Ref<HTMLHeadingElement>;
|
|
5
5
|
readonly children: ReactNode;
|
|
6
|
+
readonly $textTransform?: CSSProperties['textTransform'];
|
|
6
7
|
};
|
package/h1/styles.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
/** Styled `<h1>` behind {@link H1}; use it when you need to extend the styles. */
|
|
2
|
-
export declare const H1Box: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
3
|
-
style?:
|
|
4
|
-
}
|
|
3
|
+
export declare const H1Box: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
4
|
+
style?: CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
$textTransform?: CSSProperties["textTransform"];
|
|
7
|
+
}>> & string;
|
package/h1/styles.js
CHANGED
|
@@ -4,5 +4,7 @@ import { variants } from '../map';
|
|
|
4
4
|
export const H1Box = styled.h1.withConfig({
|
|
5
5
|
displayName: "H1Box",
|
|
6
6
|
componentId: "sc-58pfxn-0"
|
|
7
|
-
})(["margin:0;", ""], variants.h1
|
|
7
|
+
})(["margin:0;", " ", ""], variants.h1, ({
|
|
8
|
+
$textTransform
|
|
9
|
+
}) => $textTransform && `text-transform: ${$textTransform};`);
|
|
8
10
|
H1Box.displayName = 'H1Box';
|
package/h2/h2.types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { JSX, ReactNode, Ref } from 'react';
|
|
2
|
-
/** Props of {@link H2}: every `<h2>` attribute plus `boxRef` — `ref` is taken by the wrapper
|
|
1
|
+
import type { CSSProperties, JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
/** Props of {@link H2}: every `<h2>` attribute plus `boxRef` — `ref` is taken by the wrapper — and `$textTransform`. */
|
|
3
3
|
export type H2Props = Omit<JSX.IntrinsicElements['h2'], 'ref'> & {
|
|
4
4
|
readonly boxRef?: Ref<HTMLHeadingElement>;
|
|
5
5
|
readonly children: ReactNode;
|
|
6
|
+
readonly $textTransform?: CSSProperties['textTransform'];
|
|
6
7
|
};
|
package/h2/styles.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
/** Styled `<h2>` behind {@link H2}; use it when you need to extend the styles. */
|
|
2
|
-
export declare const H2Box: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
3
|
-
style?:
|
|
4
|
-
}
|
|
3
|
+
export declare const H2Box: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
4
|
+
style?: CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
$textTransform?: CSSProperties["textTransform"];
|
|
7
|
+
}>> & string;
|
package/h2/styles.js
CHANGED
|
@@ -4,5 +4,7 @@ import { variants } from '../map';
|
|
|
4
4
|
export const H2Box = styled.h2.withConfig({
|
|
5
5
|
displayName: "H2Box",
|
|
6
6
|
componentId: "sc-1a137gg-0"
|
|
7
|
-
})(["margin:0;", ""], variants.h2
|
|
7
|
+
})(["margin:0;", " ", ""], variants.h2, ({
|
|
8
|
+
$textTransform
|
|
9
|
+
}) => $textTransform && `text-transform: ${$textTransform};`);
|
|
8
10
|
H2Box.displayName = 'H2Box';
|
package/h3/h3.types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { JSX, ReactNode, Ref } from 'react';
|
|
2
|
-
/** Props of {@link H3}: every `<h3>` attribute plus `boxRef` — `ref` is taken by the wrapper
|
|
1
|
+
import type { CSSProperties, JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
/** Props of {@link H3}: every `<h3>` attribute plus `boxRef` — `ref` is taken by the wrapper — and `$textTransform`. */
|
|
3
3
|
export type H3Props = Omit<JSX.IntrinsicElements['h3'], 'ref'> & {
|
|
4
4
|
readonly boxRef?: Ref<HTMLHeadingElement>;
|
|
5
5
|
readonly children: ReactNode;
|
|
6
|
+
readonly $textTransform?: CSSProperties['textTransform'];
|
|
6
7
|
};
|
package/h3/styles.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
/** Styled `<h3>` behind {@link H3}; use it when you need to extend the styles. */
|
|
2
|
-
export declare const H3Box: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
3
|
-
style?:
|
|
4
|
-
}
|
|
3
|
+
export declare const H3Box: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
4
|
+
style?: CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
$textTransform?: CSSProperties["textTransform"];
|
|
7
|
+
}>> & string;
|
package/h3/styles.js
CHANGED
|
@@ -4,5 +4,7 @@ import { variants } from '../map';
|
|
|
4
4
|
export const H3Box = styled.h3.withConfig({
|
|
5
5
|
displayName: "H3Box",
|
|
6
6
|
componentId: "sc-4j45cg-0"
|
|
7
|
-
})(["margin:0;", ""], variants.h3
|
|
7
|
+
})(["margin:0;", " ", ""], variants.h3, ({
|
|
8
|
+
$textTransform
|
|
9
|
+
}) => $textTransform && `text-transform: ${$textTransform};`);
|
|
8
10
|
H3Box.displayName = 'H3Box';
|
package/h4/h4.component.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import { type H4Props } from './h4.types';
|
|
3
|
-
/**
|
|
3
|
+
/** Smallest heading — renders `<h4>` with the `h4` typography variant. */
|
|
4
4
|
export declare function H4(props: H4Props): ReactElement;
|
package/h4/h4.component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { H4Box } from './styles';
|
|
3
|
-
/**
|
|
3
|
+
/** Smallest heading — renders `<h4>` with the `h4` typography variant. */
|
|
4
4
|
export function H4(props) {
|
|
5
5
|
const {
|
|
6
6
|
boxRef,
|
package/h4/h4.types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { JSX, ReactNode, Ref } from 'react';
|
|
2
|
-
/** Props of {@link H4}: every `<h4>` attribute plus `boxRef` — `ref` is taken by the wrapper
|
|
1
|
+
import type { CSSProperties, JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
/** Props of {@link H4}: every `<h4>` attribute plus `boxRef` — `ref` is taken by the wrapper — and `$textTransform`. */
|
|
3
3
|
export type H4Props = Omit<JSX.IntrinsicElements['h4'], 'ref'> & {
|
|
4
4
|
readonly boxRef?: Ref<HTMLHeadingElement>;
|
|
5
5
|
readonly children: ReactNode;
|
|
6
|
+
readonly $textTransform?: CSSProperties['textTransform'];
|
|
6
7
|
};
|
package/h4/styles.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
/** Styled `<h4>` behind {@link H4}; use it when you need to extend the styles. */
|
|
2
|
-
export declare const H4Box: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
3
|
-
style?:
|
|
4
|
-
}
|
|
3
|
+
export declare const H4Box: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
4
|
+
style?: CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
$textTransform?: CSSProperties["textTransform"];
|
|
7
|
+
}>> & string;
|
package/h4/styles.js
CHANGED
|
@@ -4,5 +4,7 @@ import { variants } from '../map';
|
|
|
4
4
|
export const H4Box = styled.h4.withConfig({
|
|
5
5
|
displayName: "H4Box",
|
|
6
6
|
componentId: "sc-1eb3cj5-0"
|
|
7
|
-
})(["margin:0;", ""], variants.h4
|
|
7
|
+
})(["margin:0;", " ", ""], variants.h4, ({
|
|
8
|
+
$textTransform
|
|
9
|
+
}) => $textTransform && `text-transform: ${$textTransform};`);
|
|
8
10
|
H4Box.displayName = 'H4Box';
|
package/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './h1';
|
|
|
5
5
|
export * from './h2';
|
|
6
6
|
export * from './h3';
|
|
7
7
|
export * from './h4';
|
|
8
|
-
export * from './h5';
|
|
9
8
|
export * from './paragraph';
|
|
10
9
|
export { Text } from './text/Text';
|
|
11
|
-
export { type TypographyVariant } from './map';
|
|
10
|
+
export { variants, type TypographyVariant } from './map';
|
package/index.js
CHANGED
package/map.d.ts
CHANGED
|
@@ -11,10 +11,8 @@ export type TypographyVariant =
|
|
|
11
11
|
| 'h2'
|
|
12
12
|
/** Sub-section heading. */
|
|
13
13
|
| 'h3'
|
|
14
|
-
/**
|
|
14
|
+
/** Smallest heading. */
|
|
15
15
|
| 'h4'
|
|
16
|
-
/** Smallest heading; `H5` also uppercases it, the variant alone does not. */
|
|
17
|
-
| 'h5'
|
|
18
16
|
/** Monospaced text: code, ids, tokens. */
|
|
19
17
|
| 'code'
|
|
20
18
|
/** Standalone figure — a metric tile, a total, an order amount. Not a heading: no `h*` tag. */
|
package/map.js
CHANGED
|
@@ -6,9 +6,8 @@ export const variants = {
|
|
|
6
6
|
footnote: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.SMALL, FontWeight.REGULAR, LineHeight.SMALL),
|
|
7
7
|
h1: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING1, FontWeight.BOLD, LineHeight.HEADING1),
|
|
8
8
|
h2: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING2, FontWeight.BOLD, LineHeight.HEADING2),
|
|
9
|
-
h3: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING3, FontWeight.
|
|
9
|
+
h3: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING3, FontWeight.MEDIUM, LineHeight.HEADING3),
|
|
10
10
|
h4: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING4, FontWeight.MEDIUM, LineHeight.HEADING4),
|
|
11
|
-
h5: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.HEADING5, FontWeight.MEDIUM, LineHeight.HEADING5),
|
|
12
11
|
code: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MONO, FontSize.REGULAR, FontWeight.REGULAR, LineHeight.REGULAR),
|
|
13
12
|
display: css(["font-family:", ";font-size:", ";font-weight:", ";line-height:", ";"], FontFamily.MAIN, FontSize.DISPLAY, FontWeight.BOLD, LineHeight.DISPLAY)
|
|
14
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/kit-typography",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "React component for build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@pushwoosh/kit-constants": "^
|
|
14
|
+
"@pushwoosh/kit-constants": "^3.1.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/react": "^19.3.0",
|
package/h5/h5.component.d.ts
DELETED
package/h5/h5.component.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { H5Box } from './styles';
|
|
3
|
-
/** Smallest heading, rendered uppercase — renders `<h5>` with the `h5` typography variant. */
|
|
4
|
-
export function H5(props) {
|
|
5
|
-
const {
|
|
6
|
-
boxRef,
|
|
7
|
-
...rest
|
|
8
|
-
} = props;
|
|
9
|
-
return _jsx(H5Box, {
|
|
10
|
-
...rest,
|
|
11
|
-
ref: boxRef
|
|
12
|
-
});
|
|
13
|
-
}
|
package/h5/h5.types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { JSX, ReactNode, Ref } from 'react';
|
|
2
|
-
/** Props of {@link H5}: every `<h5>` attribute plus `boxRef` — `ref` is taken by the wrapper. */
|
|
3
|
-
export type H5Props = Omit<JSX.IntrinsicElements['h5'], 'ref'> & {
|
|
4
|
-
readonly boxRef?: Ref<HTMLHeadingElement>;
|
|
5
|
-
readonly children: ReactNode;
|
|
6
|
-
};
|
package/h5/h5.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/h5/index.d.ts
DELETED
package/h5/index.js
DELETED
package/h5/styles.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Styled `<h5>` behind {@link H5}; use it when you need to extend the styles. */
|
|
2
|
-
export declare const H5Box: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
|
|
3
|
-
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
4
|
-
}> & string;
|
package/h5/styles.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { variants } from '../map';
|
|
3
|
-
/** Styled `<h5>` behind {@link H5}; use it when you need to extend the styles. */
|
|
4
|
-
export const H5Box = styled.h5.withConfig({
|
|
5
|
-
displayName: "H5Box",
|
|
6
|
-
componentId: "sc-uuwth8-0"
|
|
7
|
-
})(["margin:0;", " text-transform:uppercase;"], variants.h5);
|
|
8
|
-
H5Box.displayName = 'H5Box';
|