carbon-react 134.0.3 → 134.0.4
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/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/components/typography/typography.component.js +1 -1
- package/esm/components/typography/typography.style.js +1 -1
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/components/typography/typography.component.js +2 -2
- package/lib/components/typography/typography.style.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
|
-
declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
4
|
+
export declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
5
5
|
export declare type VariantTypes = typeof VARIANT_TYPES[number];
|
|
6
6
|
export interface TypographyProps extends SpaceProps, TagProps {
|
|
7
7
|
/** Override the variant component */
|
|
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import tagComponent from "../../__internal__/utils/helpers/tags";
|
|
5
5
|
import { filterStyledSystemMarginProps, filterStyledSystemPaddingProps } from "../../style/utils";
|
|
6
6
|
import StyledTypography from "./typography.style";
|
|
7
|
-
const VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
7
|
+
export const VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
8
8
|
export const Typography = ({
|
|
9
9
|
"data-component": dataComponent,
|
|
10
10
|
variant = "p",
|
|
@@ -168,7 +168,7 @@ const StyledTypography = styled.span.attrs(({
|
|
|
168
168
|
white-space: ${truncate ? "nowrap" : whiteSpace};
|
|
169
169
|
word-wrap: ${wordWrap};
|
|
170
170
|
text-align: ${textAlign};
|
|
171
|
-
text-overflow: ${truncate
|
|
171
|
+
text-overflow: ${textOverflow || truncate && "ellipsis"};
|
|
172
172
|
${truncate && css`
|
|
173
173
|
overflow: hidden;
|
|
174
174
|
`};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
3
|
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
|
-
declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
4
|
+
export declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
5
5
|
export declare type VariantTypes = typeof VARIANT_TYPES[number];
|
|
6
6
|
export interface TypographyProps extends SpaceProps, TagProps {
|
|
7
7
|
/** Override the variant component */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Typography = void 0;
|
|
6
|
+
exports.default = exports.VARIANT_TYPES = exports.Typography = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
|
|
@@ -11,7 +11,7 @@ var _utils = require("../../style/utils");
|
|
|
11
11
|
var _typography = _interopRequireDefault(require("./typography.style"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
const VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
14
|
+
const VARIANT_TYPES = exports.VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
|
|
15
15
|
const Typography = ({
|
|
16
16
|
"data-component": dataComponent,
|
|
17
17
|
variant = "p",
|
|
@@ -177,7 +177,7 @@ const StyledTypography = _styledComponents.default.span.attrs(({
|
|
|
177
177
|
white-space: ${truncate ? "nowrap" : whiteSpace};
|
|
178
178
|
word-wrap: ${wordWrap};
|
|
179
179
|
text-align: ${textAlign};
|
|
180
|
-
text-overflow: ${truncate
|
|
180
|
+
text-overflow: ${textOverflow || truncate && "ellipsis"};
|
|
181
181
|
${truncate && (0, _styledComponents.css)`
|
|
182
182
|
overflow: hidden;
|
|
183
183
|
`};
|