@pushwoosh/kit-typography 1.10.0 → 1.11.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/package.json +1 -1
- package/text/Text.d.ts +5 -3
- package/text/Text.js +7 -5
package/package.json
CHANGED
package/text/Text.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
import { type TypographyVariant } from '../map';
|
|
2
3
|
/**
|
|
3
|
-
* Inline text in any typography variant: `$variant`, plus `$color`, `$
|
|
4
|
+
* Inline text in any typography variant: `$variant`, plus `$color`, `$textAlign`, `$textTransform` and `$ellipsis`.
|
|
4
5
|
* `$ellipsis` needs a bounded width — it makes the span `inline-block` at `max-width: 100%`.
|
|
5
6
|
*/
|
|
6
7
|
export declare const Text: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
7
|
-
style?:
|
|
8
|
+
style?: CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
8
9
|
}, {
|
|
9
10
|
$color?: string;
|
|
10
|
-
$
|
|
11
|
+
$textAlign?: CSSProperties["textAlign"];
|
|
12
|
+
$textTransform?: CSSProperties["textTransform"];
|
|
11
13
|
$ellipsis?: boolean;
|
|
12
14
|
$variant?: TypographyVariant;
|
|
13
15
|
}>> & string;
|
package/text/Text.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { variants } from '../map';
|
|
3
3
|
/**
|
|
4
|
-
* Inline text in any typography variant: `$variant`, plus `$color`, `$
|
|
4
|
+
* Inline text in any typography variant: `$variant`, plus `$color`, `$textAlign`, `$textTransform` and `$ellipsis`.
|
|
5
5
|
* `$ellipsis` needs a bounded width — it makes the span `inline-block` at `max-width: 100%`.
|
|
6
6
|
*/
|
|
7
7
|
export const Text = styled.span.withConfig({
|
|
8
8
|
displayName: "Text",
|
|
9
9
|
componentId: "sc-s3ssy9-0"
|
|
10
|
-
})(["", " ", " ", " ", ""], ({
|
|
10
|
+
})(["", " ", " ", " ", " ", ""], ({
|
|
11
11
|
$color
|
|
12
12
|
}) => $color && `color: ${$color};`, ({
|
|
13
13
|
$variant = 'standard'
|
|
14
14
|
}) => variants[$variant], ({
|
|
15
|
-
$
|
|
16
|
-
}) => $
|
|
15
|
+
$textTransform
|
|
16
|
+
}) => $textTransform && `text-transform: ${$textTransform};`, ({
|
|
17
17
|
$ellipsis
|
|
18
|
-
}) => $ellipsis && 'text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block; max-width: 100%;'
|
|
18
|
+
}) => $ellipsis && 'text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block; max-width: 100%;', ({
|
|
19
|
+
$textAlign
|
|
20
|
+
}) => $textAlign && `text-align: ${$textAlign}; display: block;`);
|