File tree Expand file tree Collapse file tree
src/components/Typography Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1010
1111- ` <ApplicationViewability /> `
1212 - component for hiding elements in specific media
13+ - ` <InlineText /> `
14+ - force children to get displayed as inline content
1315
1416### Fixed
1517
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ import { TestableComponent } from "../interfaces" ;
4+ import { CLASSPREFIX as eccgui } from "../../configuration/constants" ;
5+
6+ export interface InlineTextProps extends React . HTMLAttributes < HTMLElement > , TestableComponent {
7+ /**
8+ * Additional CSS class name.
9+ */
10+ className ?: string ;
11+ }
12+
13+ /**
14+ * Forces all children to be displayed as inline content.
15+ */
16+ export const InlineText = ( {
17+ className = "" ,
18+ children,
19+ ...otherProps
20+ } : InlineTextProps ) => {
21+
22+ return (
23+ < div
24+ { ...otherProps }
25+ className = {
26+ `${ eccgui } -typography__inlinetext` +
27+ ( className ? " " + className : "" )
28+ }
29+ >
30+ { children }
31+ </ div >
32+ ) ;
33+ } ;
34+
35+ export default InlineText ;
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export * from "./Highlighter";
22export * from "./HtmlContentBlock" ;
33export * from "./OverflowText" ;
44export * from "./WhiteSpaceContainer" ;
5+ export * from "./InlineText" ;
Original file line number Diff line number Diff line change @@ -263,6 +263,16 @@ table {
263263 }
264264}
265265
266+ // InlineText
267+
268+ .#{$eccgui } -typography__inlinetext {
269+ display : inline ;
270+
271+ * {
272+ display : inline ;
273+ }
274+ }
275+
266276// helpers
267277
268278.#{$eccgui } -typography--nooverflow {
You can’t perform that action at this time.
0 commit comments