@dynatrace/strato-components 0.84.31 → 0.84.42
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/core/components/app-root/AppRoot.d.ts +2 -2
- package/core/hooks/useFontsUpdated.d.ts +9 -0
- package/core/hooks/useFontsUpdated.js +51 -0
- package/core/hooks/useMergeRefs.d.ts +7 -0
- package/core/hooks/useMergeRefs.js +34 -0
- package/core/index.d.ts +4 -0
- package/core/styles/focusRing.css +88 -0
- package/core/styles/focusRing.sty.d.ts +96 -0
- package/core/styles/focusRing.sty.js +27 -0
- package/core/styles/useFocusRing.d.ts +49 -0
- package/core/styles/useFocusRing.js +83 -0
- package/core/types/a11y-props.d.ts +19 -0
- package/core/types/a11y-props.js +15 -0
- package/core/types/dom.d.ts +19 -0
- package/core/types/dom.js +15 -0
- package/core/types/focusable-element.d.ts +5 -0
- package/core/types/focusable-element.js +15 -0
- package/core/types/heading.d.ts +9 -0
- package/core/types/heading.js +15 -0
- package/core/types/polymorph.d.ts +25 -0
- package/core/types/polymorph.js +15 -0
- package/core/utils/colorUtils.css +80 -0
- package/core/utils/colorUtils.sty.d.ts +48 -0
- package/core/utils/colorUtils.sty.js +27 -0
- package/esm/core/hooks/useFontsUpdated.js +33 -0
- package/esm/core/hooks/useFontsUpdated.js.map +7 -0
- package/esm/core/hooks/useMergeRefs.js +16 -0
- package/esm/core/hooks/useMergeRefs.js.map +7 -0
- package/esm/core/index.js.map +1 -1
- package/esm/core/styles/focusRing.css +88 -0
- package/esm/core/styles/focusRing.sty.js +9 -0
- package/esm/core/styles/focusRing.sty.js.map +7 -0
- package/esm/core/styles/useFocusRing.js +69 -0
- package/esm/core/styles/useFocusRing.js.map +7 -0
- package/esm/core/types/a11y-props.js +1 -0
- package/esm/core/types/a11y-props.js.map +7 -0
- package/esm/core/types/dom.js +1 -0
- package/esm/core/types/dom.js.map +7 -0
- package/esm/core/types/focusable-element.js +1 -0
- package/esm/core/types/focusable-element.js.map +7 -0
- package/esm/core/types/heading.js +1 -0
- package/esm/core/types/heading.js.map +7 -0
- package/esm/core/types/polymorph.js +1 -0
- package/esm/core/types/polymorph.js.map +7 -0
- package/esm/core/utils/colorUtils.css +80 -0
- package/esm/core/utils/colorUtils.sty.js +9 -0
- package/esm/core/utils/colorUtils.sty.js.map +7 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +2 -2
- package/esm/layouts/Divider/Divider.css +23 -0
- package/esm/layouts/Divider/Divider.js +39 -0
- package/esm/layouts/Divider/Divider.js.map +7 -0
- package/esm/layouts/Divider/Divider.sty.js +8 -0
- package/esm/layouts/Divider/Divider.sty.js.map +7 -0
- package/esm/layouts/index.js +5 -0
- package/esm/layouts/index.js.map +7 -0
- package/esm/styles/textStyle.css +64 -0
- package/esm/styles/textStyle.sty.js +7 -0
- package/esm/styles/textStyle.sty.js.map +7 -0
- package/esm/typography/BlockQuote/Blockquote.css +17 -0
- package/esm/typography/BlockQuote/Blockquote.js +34 -0
- package/esm/typography/BlockQuote/Blockquote.js.map +7 -0
- package/esm/typography/BlockQuote/Blockquote.sty.js +6 -0
- package/esm/typography/BlockQuote/Blockquote.sty.js.map +7 -0
- package/esm/typography/Code/Code.css +16 -0
- package/esm/typography/Code/Code.js +34 -0
- package/esm/typography/Code/Code.js.map +7 -0
- package/esm/typography/Code/Code.sty.js +6 -0
- package/esm/typography/Code/Code.sty.js.map +7 -0
- package/esm/typography/Emphasis/Emphasis.css +4 -0
- package/esm/typography/Emphasis/Emphasis.js +34 -0
- package/esm/typography/Emphasis/Emphasis.js.map +7 -0
- package/esm/typography/Emphasis/Emphasis.sty.js +6 -0
- package/esm/typography/Emphasis/Emphasis.sty.js.map +7 -0
- package/esm/typography/ExternalLink/ExternalLink.css +28 -0
- package/esm/typography/ExternalLink/ExternalLink.js +56 -0
- package/esm/typography/ExternalLink/ExternalLink.js.map +7 -0
- package/esm/typography/ExternalLink/ExternalLink.sty.js +6 -0
- package/esm/typography/ExternalLink/ExternalLink.sty.js.map +7 -0
- package/esm/typography/Heading/Heading.css +54 -0
- package/esm/typography/Heading/Heading.js +36 -0
- package/esm/typography/Heading/Heading.js.map +7 -0
- package/esm/typography/Heading/Heading.sty.js +7 -0
- package/esm/typography/Heading/Heading.sty.js.map +7 -0
- package/esm/typography/Highlight/Highlight.css +4 -0
- package/esm/typography/Highlight/Highlight.js +111 -0
- package/esm/typography/Highlight/Highlight.js.map +7 -0
- package/esm/typography/Highlight/Highlight.sty.js +6 -0
- package/esm/typography/Highlight/Highlight.sty.js.map +7 -0
- package/esm/typography/Link/Link.css +15 -0
- package/esm/typography/Link/Link.js +49 -0
- package/esm/typography/Link/Link.js.map +7 -0
- package/esm/typography/Link/Link.sty.js +6 -0
- package/esm/typography/Link/Link.sty.js.map +7 -0
- package/esm/typography/List/List.css +16 -0
- package/esm/typography/List/List.js +81 -0
- package/esm/typography/List/List.js.map +7 -0
- package/esm/typography/List/List.sty.js +8 -0
- package/esm/typography/List/List.sty.js.map +7 -0
- package/esm/typography/Paragraph/Paragraph.css +19 -0
- package/esm/typography/Paragraph/Paragraph.js +49 -0
- package/esm/typography/Paragraph/Paragraph.js.map +7 -0
- package/esm/typography/Paragraph/Paragraph.sty.js +7 -0
- package/esm/typography/Paragraph/Paragraph.sty.js.map +7 -0
- package/esm/typography/Strikethrough/Strikethrough.css +5 -0
- package/esm/typography/Strikethrough/Strikethrough.js +32 -0
- package/esm/typography/Strikethrough/Strikethrough.js.map +7 -0
- package/esm/typography/Strikethrough/Strikethrough.sty.js +6 -0
- package/esm/typography/Strikethrough/Strikethrough.sty.js.map +7 -0
- package/esm/typography/Strong/Strong.css +4 -0
- package/esm/typography/Strong/Strong.js +34 -0
- package/esm/typography/Strong/Strong.js.map +7 -0
- package/esm/typography/Strong/Strong.sty.js +6 -0
- package/esm/typography/Strong/Strong.sty.js.map +7 -0
- package/esm/typography/Text/Text.css +18 -0
- package/esm/typography/Text/Text.js +43 -0
- package/esm/typography/Text/Text.js.map +7 -0
- package/esm/typography/Text/Text.sty.js +7 -0
- package/esm/typography/Text/Text.sty.js.map +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.css +22 -0
- package/esm/typography/TextEllipsis/TextEllipsis.js +143 -0
- package/esm/typography/TextEllipsis/TextEllipsis.js.map +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.sty.js +7 -0
- package/esm/typography/TextEllipsis/TextEllipsis.sty.js.map +7 -0
- package/esm/typography/index.js +43 -0
- package/esm/typography/index.js.map +7 -0
- package/esm/typography/utils.js +101 -0
- package/esm/typography/utils.js.map +7 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/lang/en.json +6 -0
- package/lang/uncompiled/en.json +6 -1
- package/layouts/Divider/Divider.css +23 -0
- package/layouts/Divider/Divider.d.ts +39 -0
- package/layouts/Divider/Divider.js +67 -0
- package/layouts/Divider/Divider.sty.d.ts +16 -0
- package/layouts/Divider/Divider.sty.js +26 -0
- package/layouts/index.d.ts +2 -0
- package/layouts/index.js +23 -0
- package/package.json +17 -2
- package/styles/textStyle.css +64 -0
- package/styles/textStyle.sty.d.ts +12 -0
- package/styles/textStyle.sty.js +25 -0
- package/testing/mocks/text-ellipsis-mock.d.ts +1 -1
- package/testing/mocks/text-ellipsis-mock.js +8 -3
- package/typography/BlockQuote/Blockquote.css +17 -0
- package/typography/BlockQuote/Blockquote.d.ts +19 -0
- package/typography/BlockQuote/Blockquote.js +62 -0
- package/typography/BlockQuote/Blockquote.sty.d.ts +1 -0
- package/typography/BlockQuote/Blockquote.sty.js +24 -0
- package/typography/Code/Code.css +16 -0
- package/typography/Code/Code.d.ts +17 -0
- package/typography/Code/Code.js +62 -0
- package/typography/Code/Code.sty.d.ts +1 -0
- package/typography/Code/Code.sty.js +24 -0
- package/typography/Emphasis/Emphasis.css +4 -0
- package/typography/Emphasis/Emphasis.d.ts +14 -0
- package/typography/Emphasis/Emphasis.js +62 -0
- package/typography/Emphasis/Emphasis.sty.d.ts +1 -0
- package/typography/Emphasis/Emphasis.sty.js +24 -0
- package/typography/ExternalLink/ExternalLink.css +28 -0
- package/typography/ExternalLink/ExternalLink.d.ts +21 -0
- package/typography/ExternalLink/ExternalLink.js +82 -0
- package/typography/ExternalLink/ExternalLink.sty.d.ts +1 -0
- package/typography/ExternalLink/ExternalLink.sty.js +24 -0
- package/typography/Heading/Heading.css +54 -0
- package/typography/Heading/Heading.d.ts +24 -0
- package/typography/Heading/Heading.js +64 -0
- package/typography/Heading/Heading.sty.d.ts +52 -0
- package/typography/Heading/Heading.sty.js +25 -0
- package/typography/Highlight/Highlight.css +4 -0
- package/typography/Highlight/Highlight.d.ts +27 -0
- package/typography/Highlight/Highlight.js +139 -0
- package/typography/Highlight/Highlight.sty.d.ts +1 -0
- package/typography/Highlight/Highlight.sty.js +24 -0
- package/typography/Link/Link.css +15 -0
- package/typography/Link/Link.d.ts +17 -0
- package/typography/Link/Link.js +75 -0
- package/typography/Link/Link.sty.d.ts +1 -0
- package/typography/Link/Link.sty.js +24 -0
- package/typography/List/List.css +16 -0
- package/typography/List/List.d.ts +39 -0
- package/typography/List/List.js +109 -0
- package/typography/List/List.sty.d.ts +2 -0
- package/typography/List/List.sty.js +26 -0
- package/typography/Paragraph/Paragraph.css +19 -0
- package/typography/Paragraph/Paragraph.d.ts +19 -0
- package/typography/Paragraph/Paragraph.js +77 -0
- package/typography/Paragraph/Paragraph.sty.d.ts +16 -0
- package/typography/Paragraph/Paragraph.sty.js +25 -0
- package/typography/Strikethrough/Strikethrough.css +5 -0
- package/typography/Strikethrough/Strikethrough.d.ts +15 -0
- package/typography/Strikethrough/Strikethrough.js +60 -0
- package/typography/Strikethrough/Strikethrough.sty.d.ts +1 -0
- package/typography/Strikethrough/Strikethrough.sty.js +24 -0
- package/typography/Strong/Strong.css +4 -0
- package/typography/Strong/Strong.d.ts +14 -0
- package/typography/Strong/Strong.js +62 -0
- package/typography/Strong/Strong.sty.d.ts +1 -0
- package/typography/Strong/Strong.sty.js +24 -0
- package/typography/Text/Text.css +18 -0
- package/typography/Text/Text.d.ts +26 -0
- package/typography/Text/Text.js +71 -0
- package/typography/Text/Text.sty.d.ts +16 -0
- package/typography/Text/Text.sty.js +25 -0
- package/typography/TextEllipsis/TextEllipsis.css +22 -0
- package/typography/TextEllipsis/TextEllipsis.d.ts +32 -0
- package/typography/TextEllipsis/TextEllipsis.js +167 -0
- package/typography/TextEllipsis/TextEllipsis.sty.d.ts +15 -0
- package/typography/TextEllipsis/TextEllipsis.sty.js +25 -0
- package/typography/index.d.ts +28 -0
- package/typography/index.js +54 -0
- package/typography/utils.d.ts +52 -0
- package/typography/utils.js +119 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { strongCSS } from "./Strong.sty.js";
|
|
4
|
+
const Strong = /* @__PURE__ */ forwardRef(
|
|
5
|
+
(props, ref) => {
|
|
6
|
+
const {
|
|
7
|
+
children,
|
|
8
|
+
"data-testid": dataTestId,
|
|
9
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
10
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
11
|
+
className: consumerClassName,
|
|
12
|
+
style: consumerStyle,
|
|
13
|
+
...remainingProps
|
|
14
|
+
} = props;
|
|
15
|
+
return /* @__PURE__ */ React.createElement(
|
|
16
|
+
"strong",
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
"data-testid": dataTestId,
|
|
20
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
21
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
22
|
+
className: clsx(strongCSS, consumerClassName),
|
|
23
|
+
style: consumerStyle,
|
|
24
|
+
...remainingProps
|
|
25
|
+
},
|
|
26
|
+
children
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
Strong.displayName = "Strong";
|
|
31
|
+
export {
|
|
32
|
+
Strong
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Strong.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/typography/Strong/Strong.tsx"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport React, { forwardRef } from 'react';\n\nimport { strongCSS } from './Strong.sty.js';\nimport {\n type DataTestId,\n type StylingProps,\n type WithChildren,\n} from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Strong component.\n * @public\n * */\nexport interface StrongProps\n extends WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {}\n\n/**\n * @public\n * Use the `Strong` component to render text in bold type to emphasize it.\n */\nexport const Strong = /* @__PURE__ */ forwardRef<HTMLElement, StrongProps>(\n (props, ref) => {\n const {\n children,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n className: consumerClassName,\n style: consumerStyle,\n ...remainingProps\n } = props;\n return (\n <strong\n ref={ref}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(strongCSS, consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </strong>\n );\n },\n);\n\n(Strong as typeof Strong & { displayName: string }).displayName = 'Strong';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAAS,kBAAkB;AAElC,SAAS,iBAAiB;AAsBnB,MAAM,SAAyB;AAAA,EACpC,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ;AAAA,MACA,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,GAAG;AAAA,IACL,IAAI;AACJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,WAAW,KAAK,WAAW,iBAAiB;AAAA,QAC5C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,OAAmD,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.Text_textCSS__ty6wu50 {
|
|
2
|
+
margin-top: 0;
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
overflow-wrap: break-word;
|
|
6
|
+
}
|
|
7
|
+
.Text_textCSS_ellipsis_singleLine__ty6wu51 {
|
|
8
|
+
display: block;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
text-overflow: ellipsis;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.Text_textCSS_ellipsis_multiLine__ty6wu52 {
|
|
14
|
+
display: -webkit-box;
|
|
15
|
+
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
16
|
+
-webkit-box-orient: vertical;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { textCSS } from "./Text.sty.js";
|
|
4
|
+
import { textStyleCSS } from "../../styles/textStyle.sty.js";
|
|
5
|
+
const Text = /* @__PURE__ */ forwardRef(
|
|
6
|
+
({
|
|
7
|
+
children,
|
|
8
|
+
textStyle,
|
|
9
|
+
fontStyle,
|
|
10
|
+
as,
|
|
11
|
+
className: consumerClassName,
|
|
12
|
+
style: consumerStyle,
|
|
13
|
+
"data-testid": dataTestId,
|
|
14
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
15
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
16
|
+
...remainingProps
|
|
17
|
+
}, ref) => {
|
|
18
|
+
const TextTag = as || "span";
|
|
19
|
+
let ellipsis;
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
TextTag,
|
|
22
|
+
{
|
|
23
|
+
"data-testid": dataTestId,
|
|
24
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
25
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
26
|
+
ref,
|
|
27
|
+
className: clsx([
|
|
28
|
+
textCSS({ ellipsis }),
|
|
29
|
+
(fontStyle || textStyle) && textStyleCSS({ fontStyle, textStyle }),
|
|
30
|
+
consumerClassName
|
|
31
|
+
]),
|
|
32
|
+
style: consumerStyle,
|
|
33
|
+
...remainingProps
|
|
34
|
+
},
|
|
35
|
+
children
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
Text.displayName = "Text";
|
|
40
|
+
export {
|
|
41
|
+
Text
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/typography/Text/Text.tsx"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport React, { type ElementType, type ReactElement, forwardRef } from 'react';\n\nimport { textCSS } from './Text.sty.js';\nimport type { AriaLabelingProps } from '../../core/types/a11y-props.js';\nimport { DataTestId } from '../../core/types/data-props.js';\nimport type { DOMProps } from '../../core/types/dom.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport type { PolymorphicComponentProps } from '../../core/types/polymorph.js';\nimport { StylingProps } from '../../core/types/styling-props.js';\nimport { WithChildren } from '../../core/types/with-children.js';\nimport { textStyleCSS } from '../../styles/textStyle.sty.js';\n\n/**\n * @public\n * The props for the text component without any props coming from polymorphing. */\nexport interface TextOwnProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** Sets the text style. Variants include \"base\", \"base-emphasized\", etc. */\n textStyle?: 'base' | 'base-emphasized' | 'small' | 'small-emphasized';\n /** Sets the font style. Can either be \"text\" or \"code\" */\n fontStyle?: 'text' | 'code';\n}\n\n/**\n * @public\n * Combined props for the text component - polymorphing and own props. */\nexport type TextProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n TextOwnProps\n>;\n\n/**\n * @public\n * Use the `Text` component for text that is rendered without any semantic markup.\n */\nexport const Text: <E extends ElementType = 'span'>(\n props: TextProps<E>,\n) => ReactElement | null = /* @__PURE__ */ forwardRef(\n <E extends ElementType>(\n {\n children,\n textStyle,\n fontStyle,\n as,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: TextProps<E>,\n ref: typeof remainingProps.ref,\n ) => {\n const TextTag = as || 'span';\n\n let ellipsis: undefined | 'singleLine' | 'multiLine';\n\n return (\n <TextTag\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={ref}\n className={clsx([\n textCSS({ ellipsis }),\n (fontStyle || textStyle) && textStyleCSS({ fontStyle, textStyle }),\n consumerClassName,\n ])}\n style={consumerStyle}\n {...remainingProps}\n >\n {children}\n </TextTag>\n );\n },\n);\n\n(Text as typeof Text & { displayName: string }).displayName = 'Text';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,SAA8C,kBAAkB;AAEvE,SAAS,eAAe;AAQxB,SAAS,oBAAoB;AA8BtB,MAAM,OAE8B;AAAA,EACzC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,UAAU,MAAM;AAEtB,QAAI;AAEJ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB;AAAA,QACA,WAAW,KAAK;AAAA,UACd,QAAQ,EAAE,SAAS,CAAC;AAAA,WACnB,aAAa,cAAc,aAAa,EAAE,WAAW,UAAU,CAAC;AAAA,UACjE;AAAA,QACF,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,MAEH;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,KAA+C,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./Text.css";
|
|
2
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
var textCSS = _7a468({ defaultClassName: "Text_textCSS__ty6wu50", variantClassNames: { ellipsis: { singleLine: "Text_textCSS_ellipsis_singleLine__ty6wu51", multiLine: "Text_textCSS_ellipsis_multiLine__ty6wu52" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
export {
|
|
5
|
+
textCSS
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=Text.sty.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/typography/Text/Text.css.ts"],
|
|
4
|
+
"sourcesContent": ["import './Text.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var textCSS = _7a468({defaultClassName:'Text_textCSS__ty6wu50',variantClassNames:{ellipsis:{singleLine:'Text_textCSS_ellipsis_singleLine__ty6wu51',multiLine:'Text_textCSS_ellipsis_multiLine__ty6wu52'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,UAAU,OAAO,EAAC,kBAAiB,yBAAwB,mBAAkB,EAAC,UAAS,EAAC,YAAW,6CAA4C,WAAU,2CAA0C,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.TextEllipsis_textEllipsisCSS__1n6xzhd0 {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
word-break: keep-all;
|
|
7
|
+
overflow-wrap: normal;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-decoration: inherit;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
.TextEllipsis_textEllipsisCSS_truncationMode_start__1n6xzhd1 {
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
direction: rtl;
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
.TextEllipsis_textEllipsisCSS_truncationMode_middle__1n6xzhd2 {
|
|
18
|
+
text-overflow: clip;
|
|
19
|
+
}
|
|
20
|
+
.TextEllipsis_textEllipsisCSS_truncationMode_end__1n6xzhd3 {
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import React, {
|
|
3
|
+
forwardRef,
|
|
4
|
+
useLayoutEffect,
|
|
5
|
+
useRef
|
|
6
|
+
} from "react";
|
|
7
|
+
import useResizeObserver from "use-resize-observer";
|
|
8
|
+
import { textEllipsisCSS } from "./TextEllipsis.sty.js";
|
|
9
|
+
import { _useFontsUpdated } from "../../core/hooks/useFontsUpdated.js";
|
|
10
|
+
import { useMergeRefs } from "../../core/hooks/useMergeRefs.js";
|
|
11
|
+
import { _centerEllipsizeText } from "../utils.js";
|
|
12
|
+
function getFontProps(textWrapper) {
|
|
13
|
+
const computedStyle = window.getComputedStyle(textWrapper, null);
|
|
14
|
+
return {
|
|
15
|
+
fontStyle: computedStyle.getPropertyValue("font-style"),
|
|
16
|
+
fontWeight: computedStyle.getPropertyValue("font-weight"),
|
|
17
|
+
fontSize: computedStyle.getPropertyValue("font-size"),
|
|
18
|
+
fontFamily: computedStyle.getPropertyValue("font-family")
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isNativeEllipsisActive(textWrapper, containerWidth) {
|
|
22
|
+
const textWidth = Math.floor(textWrapper.getBoundingClientRect().width * 100) / 100;
|
|
23
|
+
return textWidth > containerWidth;
|
|
24
|
+
}
|
|
25
|
+
function renderEllipsizedText(originalText, truncationMode, containerRef, wasEllipsized, onTextOverflow) {
|
|
26
|
+
const containerElement = containerRef.current;
|
|
27
|
+
const textWrapper = containerElement?.firstElementChild || null;
|
|
28
|
+
if (containerElement !== null && textWrapper !== null) {
|
|
29
|
+
if (textWrapper.textContent !== originalText) {
|
|
30
|
+
textWrapper.textContent = originalText;
|
|
31
|
+
}
|
|
32
|
+
const containerWidth = Math.ceil(containerElement.getBoundingClientRect().width * 100) / 100;
|
|
33
|
+
if (truncationMode === "middle") {
|
|
34
|
+
if (isNativeEllipsisActive(textWrapper, containerWidth)) {
|
|
35
|
+
const ellipsizedText = _centerEllipsizeText(
|
|
36
|
+
originalText,
|
|
37
|
+
getFontProps(textWrapper),
|
|
38
|
+
containerWidth
|
|
39
|
+
);
|
|
40
|
+
textWrapper.textContent = ellipsizedText;
|
|
41
|
+
if (ellipsizedText !== originalText) {
|
|
42
|
+
if (onTextOverflow && !wasEllipsized) {
|
|
43
|
+
onTextOverflow(true);
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (onTextOverflow && wasEllipsized) {
|
|
49
|
+
onTextOverflow(false);
|
|
50
|
+
}
|
|
51
|
+
} else if (isNativeEllipsisActive(textWrapper, containerWidth)) {
|
|
52
|
+
if (onTextOverflow && !wasEllipsized) {
|
|
53
|
+
onTextOverflow(true);
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
} else if (onTextOverflow && wasEllipsized) {
|
|
57
|
+
onTextOverflow(false);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const ComputedTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
63
|
+
const {
|
|
64
|
+
children,
|
|
65
|
+
truncationMode = "end",
|
|
66
|
+
onTextOverflow,
|
|
67
|
+
className: consumerClassName,
|
|
68
|
+
style: consumerStyle,
|
|
69
|
+
"data-testid": dataTestId,
|
|
70
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
71
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
72
|
+
...remainingProps
|
|
73
|
+
} = props;
|
|
74
|
+
const { ref: observerContainerRef } = useResizeObserver();
|
|
75
|
+
const containerRef = useRef(null);
|
|
76
|
+
const ellipsisStateRef = useRef(false);
|
|
77
|
+
const mergedRef = useMergeRefs([
|
|
78
|
+
observerContainerRef,
|
|
79
|
+
(instance) => {
|
|
80
|
+
containerRef.current = instance;
|
|
81
|
+
},
|
|
82
|
+
forwardedRef
|
|
83
|
+
]);
|
|
84
|
+
const containerWidth = containerRef.current?.getBoundingClientRect().width;
|
|
85
|
+
const fontsUpdated = _useFontsUpdated();
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
ellipsisStateRef.current = renderEllipsizedText(
|
|
88
|
+
children,
|
|
89
|
+
truncationMode,
|
|
90
|
+
containerRef,
|
|
91
|
+
ellipsisStateRef.current,
|
|
92
|
+
onTextOverflow
|
|
93
|
+
);
|
|
94
|
+
}, [containerWidth, children, truncationMode, fontsUpdated, onTextOverflow]);
|
|
95
|
+
return /* @__PURE__ */ React.createElement(
|
|
96
|
+
"span",
|
|
97
|
+
{
|
|
98
|
+
ref: mergedRef,
|
|
99
|
+
"aria-label": children,
|
|
100
|
+
"data-ellipsis": true,
|
|
101
|
+
"data-testid": dataTestId,
|
|
102
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
103
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
104
|
+
className: clsx(textEllipsisCSS({ truncationMode }), consumerClassName),
|
|
105
|
+
style: consumerStyle,
|
|
106
|
+
...remainingProps
|
|
107
|
+
},
|
|
108
|
+
/* @__PURE__ */ React.createElement("span", null, children)
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
const CssTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
112
|
+
const {
|
|
113
|
+
children,
|
|
114
|
+
truncationMode = "end",
|
|
115
|
+
onTextOverflow,
|
|
116
|
+
className: consumerClassName,
|
|
117
|
+
style: consumerStyle,
|
|
118
|
+
"data-testid": dataTestId,
|
|
119
|
+
...remainingProps
|
|
120
|
+
} = props;
|
|
121
|
+
return /* @__PURE__ */ React.createElement(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
ref: forwardedRef,
|
|
125
|
+
"aria-label": children,
|
|
126
|
+
"data-ellipsis": true,
|
|
127
|
+
"data-testid": dataTestId,
|
|
128
|
+
className: clsx(textEllipsisCSS({ truncationMode }), consumerClassName),
|
|
129
|
+
style: consumerStyle,
|
|
130
|
+
...remainingProps
|
|
131
|
+
},
|
|
132
|
+
/* @__PURE__ */ React.createElement("span", null, children)
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
const TextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
136
|
+
const cssOnlyEllipsis = !props.onTextOverflow && props.truncationMode !== "middle";
|
|
137
|
+
return cssOnlyEllipsis ? /* @__PURE__ */ React.createElement(CssTextEllipsis, { ref: forwardedRef, ...props }) : /* @__PURE__ */ React.createElement(ComputedTextEllipsis, { ref: forwardedRef, ...props });
|
|
138
|
+
});
|
|
139
|
+
TextEllipsis.displayName = "TextEllipsis";
|
|
140
|
+
export {
|
|
141
|
+
TextEllipsis
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=TextEllipsis.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/typography/TextEllipsis/TextEllipsis.tsx"],
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport React, {\n forwardRef,\n HTMLAttributes,\n RefObject,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport useResizeObserver from 'use-resize-observer';\n\nimport { textEllipsisCSS } from './TextEllipsis.sty.js';\nimport { _useFontsUpdated } from '../../core/hooks/useFontsUpdated.js';\nimport { useMergeRefs } from '../../core/hooks/useMergeRefs.js';\nimport { DataTestId } from '../../core/types/data-props.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport { StylingProps } from '../../core/types/styling-props.js';\nimport type { _Font } from '../utils.js';\nimport { _centerEllipsizeText } from '../utils.js';\n\n/**\n * Available modes for how overly long text is truncated and where the ellipsis is placed.\n * @internal\n * */\nexport type _TruncationMode = 'start' | 'middle' | 'end';\n\n/**\n * The props for the TextEllipsis component.\n * @public\n * */\nexport interface TextEllipsisProps\n extends HTMLAttributes<HTMLSpanElement>,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** The children (as text) passed to the component. */\n children: string;\n /**\n * The mode used for for truncating the text, either at the start, in the middle or at the end.\n * @defaultValue 'end'\n */\n truncationMode?: 'start' | 'middle' | 'end';\n /** Gets called when text needs to get truncated due to lack of horizontal space. */\n onTextOverflow?: (ellipsized: boolean) => void;\n}\n\n/**\n * Returns an object containing all font-related CSS properties from\n * a given DOM element that are relevant for rendering formatted text\n * in a 2D canvas context.\n *\n * @param textWrapper - The HTML element to extract the CSS properties from\n */\nfunction getFontProps(textWrapper: HTMLSpanElement): _Font {\n const computedStyle = window.getComputedStyle(textWrapper, null);\n\n return {\n fontStyle: computedStyle.getPropertyValue('font-style'),\n fontWeight: computedStyle.getPropertyValue('font-weight'),\n fontSize: computedStyle.getPropertyValue('font-size'),\n fontFamily: computedStyle.getPropertyValue('font-family'),\n };\n}\n\n/**\n * Determines whether a CSS text-ellipsis is currently rendered in a container.\n * Note: `containerWidth` is only passed to avoid unnecessary reflows by calling `getBoundingClientRect()`\n */\nfunction isNativeEllipsisActive(\n textWrapper: HTMLSpanElement,\n containerWidth: number,\n): boolean {\n const textWidth =\n Math.floor(textWrapper.getBoundingClientRect().width * 100) / 100;\n\n return textWidth > containerWidth;\n}\n\n/**\n * Detects whether a given formatted text has enough space within its\n * parent container and applies or removes an ellipsis accordingly.\n *\n * @param originalText - The text to be truncated if its width exceeds <code>maxWidthInPx</code>\n * @param truncationMode - The mode used for for truncating the text, either at the start, in the middle or at the end\n * @param containerRef - Object ref pointing towards the root element of the TextEllipsis component\n * @param wasEllipsized - Whether an ellipsis was applied during the last render cycle\n * @param onTextOverflow - Callback that gets called whenever the state of the ellipsis changes since the last render cycle\n */\nfunction renderEllipsizedText(\n originalText: string,\n truncationMode: TextEllipsisProps['truncationMode'],\n containerRef: RefObject<HTMLSpanElement>,\n wasEllipsized: boolean,\n onTextOverflow?: (ellipsized: boolean) => void,\n): boolean {\n const containerElement = containerRef.current;\n const textWrapper: HTMLSpanElement | null =\n (containerElement?.firstElementChild as HTMLSpanElement) || null;\n\n if (containerElement !== null && textWrapper !== null) {\n if (textWrapper.textContent !== originalText) {\n textWrapper.textContent = originalText; // always reset to full text before measuring container width\n }\n\n const containerWidth =\n Math.ceil(containerElement.getBoundingClientRect().width * 100) / 100;\n\n if (truncationMode === 'middle') {\n if (isNativeEllipsisActive(textWrapper, containerWidth)) {\n const ellipsizedText = _centerEllipsizeText(\n originalText,\n getFontProps(textWrapper),\n containerWidth,\n );\n textWrapper.textContent = ellipsizedText;\n\n if (ellipsizedText !== originalText) {\n if (onTextOverflow && !wasEllipsized) {\n onTextOverflow(true);\n }\n\n return true;\n }\n }\n\n if (onTextOverflow && wasEllipsized) {\n onTextOverflow(false);\n }\n } else if (isNativeEllipsisActive(textWrapper, containerWidth)) {\n if (onTextOverflow && !wasEllipsized) {\n onTextOverflow(true);\n }\n\n return true;\n } else if (onTextOverflow && wasEllipsized) {\n onTextOverflow(false);\n }\n }\n\n return false;\n}\n\nconst ComputedTextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n const {\n children,\n truncationMode = 'end',\n onTextOverflow,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n } = props;\n\n // resize observer is needed to re-render the component in case of resizing\n const { ref: observerContainerRef } = useResizeObserver<HTMLSpanElement>();\n const containerRef = useRef<HTMLSpanElement | null>(null);\n const ellipsisStateRef = useRef<boolean>(false);\n const mergedRef = useMergeRefs<HTMLSpanElement | null>([\n observerContainerRef,\n (instance: HTMLSpanElement) => {\n containerRef.current = instance;\n },\n forwardedRef,\n ]);\n const containerWidth = containerRef.current?.getBoundingClientRect().width;\n const fontsUpdated = _useFontsUpdated();\n\n useLayoutEffect(() => {\n ellipsisStateRef.current = renderEllipsizedText(\n children,\n truncationMode,\n containerRef,\n ellipsisStateRef.current,\n onTextOverflow,\n );\n }, [containerWidth, children, truncationMode, fontsUpdated, onTextOverflow]);\n\n return (\n <span\n ref={mergedRef}\n aria-label={children}\n data-ellipsis\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(textEllipsisCSS({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n <span>{children}</span>\n </span>\n );\n});\n\nconst CssTextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n const {\n children,\n truncationMode = 'end',\n onTextOverflow,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n } = props;\n\n return (\n <span\n ref={forwardedRef}\n aria-label={children}\n data-ellipsis\n data-testid={dataTestId}\n className={clsx(textEllipsisCSS({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n <span>{children}</span>\n </span>\n );\n});\n\n/**\n * @public\n * Use the `TextEllipsis` component to truncate text and show an ellipsis whenever\n * there is insufficient space to render the entire text. While some of our Strato\n * components provide ellipsis out of the box, you need to take care of this yourself\n * when writing your own components.\n */\nexport const TextEllipsis = /* @__PURE__ */ forwardRef<\n HTMLSpanElement,\n TextEllipsisProps\n>((props, forwardedRef) => {\n // in case onTextOverflow is not defined and the ellipsis is start or end\n // we can use css only which is significantly more performant\n const cssOnlyEllipsis =\n !props.onTextOverflow && props.truncationMode !== 'middle';\n\n return cssOnlyEllipsis ? (\n <CssTextEllipsis ref={forwardedRef} {...props} />\n ) : (\n <ComputedTextEllipsis ref={forwardedRef} {...props} />\n );\n});\n\n(TextEllipsis as typeof TextEllipsis & { displayName: string }).displayName =\n 'TextEllipsis';\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./TextEllipsis.css";
|
|
2
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
var textEllipsisCSS = _7a468({ defaultClassName: "TextEllipsis_textEllipsisCSS__1n6xzhd0", variantClassNames: { truncationMode: { start: "TextEllipsis_textEllipsisCSS_truncationMode_start__1n6xzhd1", middle: "TextEllipsis_textEllipsisCSS_truncationMode_middle__1n6xzhd2", end: "TextEllipsis_textEllipsisCSS_truncationMode_end__1n6xzhd3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
export {
|
|
5
|
+
textEllipsisCSS
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=TextEllipsis.sty.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/typography/TextEllipsis/TextEllipsis.css.ts"],
|
|
4
|
+
"sourcesContent": ["import './TextEllipsis.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var textEllipsisCSS = _7a468({defaultClassName:'TextEllipsis_textEllipsisCSS__1n6xzhd0',variantClassNames:{truncationMode:{start:'TextEllipsis_textEllipsisCSS_truncationMode_start__1n6xzhd1',middle:'TextEllipsis_textEllipsisCSS_truncationMode_middle__1n6xzhd2',end:'TextEllipsis_textEllipsisCSS_truncationMode_end__1n6xzhd3'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,kBAAkB,OAAO,EAAC,kBAAiB,0CAAyC,mBAAkB,EAAC,gBAAe,EAAC,OAAM,+DAA8D,QAAO,gEAA+D,KAAI,4DAA2D,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Blockquote } from "./BlockQuote/Blockquote.js";
|
|
2
|
+
import { Code } from "./Code/Code.js";
|
|
3
|
+
import { Emphasis } from "./Emphasis/Emphasis.js";
|
|
4
|
+
import { ExternalLink } from "./ExternalLink/ExternalLink.js";
|
|
5
|
+
import { Heading } from "./Heading/Heading.js";
|
|
6
|
+
import { Highlight } from "./Highlight/Highlight.js";
|
|
7
|
+
import { Link } from "./Link/Link.js";
|
|
8
|
+
import { List } from "./List/List.js";
|
|
9
|
+
import { Paragraph } from "./Paragraph/Paragraph.js";
|
|
10
|
+
import { Strikethrough } from "./Strikethrough/Strikethrough.js";
|
|
11
|
+
import { Strong } from "./Strong/Strong.js";
|
|
12
|
+
import { Text } from "./Text/Text.js";
|
|
13
|
+
import { TextEllipsis } from "./TextEllipsis/TextEllipsis.js";
|
|
14
|
+
import {
|
|
15
|
+
_calculateEllipsisInfo,
|
|
16
|
+
_getTextHeight,
|
|
17
|
+
_centerEllipsizeText,
|
|
18
|
+
_getTextWidth,
|
|
19
|
+
_ELLIPSIS_APPROXIMATION_THRESHOLD,
|
|
20
|
+
_ELLIPSIS_CHARACTER
|
|
21
|
+
} from "./utils.js";
|
|
22
|
+
export {
|
|
23
|
+
Blockquote,
|
|
24
|
+
Code,
|
|
25
|
+
Emphasis,
|
|
26
|
+
ExternalLink,
|
|
27
|
+
Heading,
|
|
28
|
+
Highlight,
|
|
29
|
+
Link,
|
|
30
|
+
List,
|
|
31
|
+
Paragraph,
|
|
32
|
+
Strikethrough,
|
|
33
|
+
Strong,
|
|
34
|
+
Text,
|
|
35
|
+
TextEllipsis,
|
|
36
|
+
_ELLIPSIS_APPROXIMATION_THRESHOLD,
|
|
37
|
+
_ELLIPSIS_CHARACTER,
|
|
38
|
+
_calculateEllipsisInfo,
|
|
39
|
+
_centerEllipsizeText,
|
|
40
|
+
_getTextHeight,
|
|
41
|
+
_getTextWidth
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/typography/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { Blockquote } from './BlockQuote/Blockquote.js';\nexport type { BlockquoteProps } from './BlockQuote/Blockquote.js';\nexport { Code } from './Code/Code.js';\nexport type { CodeProps } from './Code/Code.js';\nexport { Emphasis } from './Emphasis/Emphasis.js';\nexport type { EmphasisProps } from './Emphasis/Emphasis.js';\nexport { ExternalLink } from './ExternalLink/ExternalLink.js';\nexport type { ExternalLinkProps } from './ExternalLink/ExternalLink.js';\nexport { Heading } from './Heading/Heading.js';\nexport type { HeadingProps } from './Heading/Heading.js';\nexport { Highlight } from './Highlight/Highlight.js';\nexport type { HighlightProps } from './Highlight/Highlight.js';\nexport { Link } from './Link/Link.js';\nexport type { LinkProps } from './Link/Link.js';\nexport { List } from './List/List.js';\nexport type { ListProps } from './List/List.js';\nexport { Paragraph } from './Paragraph/Paragraph.js';\nexport type { ParagraphProps } from './Paragraph/Paragraph.js';\nexport { Strikethrough } from './Strikethrough/Strikethrough.js';\nexport type { StrikethroughProps } from './Strikethrough/Strikethrough.js';\nexport { Strong } from './Strong/Strong.js';\nexport type { StrongProps } from './Strong/Strong.js';\nexport { Text } from './Text/Text.js';\nexport type { TextOwnProps, TextProps } from './Text/Text.js';\nexport { TextEllipsis } from './TextEllipsis/TextEllipsis.js';\nexport type {\n TextEllipsisProps,\n _TruncationMode,\n} from './TextEllipsis/TextEllipsis.js';\nexport {\n _calculateEllipsisInfo,\n _getTextHeight,\n _centerEllipsizeText,\n _getTextWidth,\n _ELLIPSIS_APPROXIMATION_THRESHOLD,\n _ELLIPSIS_CHARACTER,\n} from './utils.js';\nexport type { _Font } from './utils.js';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AAErB,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAE7B,SAAS,eAAe;AAExB,SAAS,iBAAiB;AAE1B,SAAS,YAAY;AAErB,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAE1B,SAAS,qBAAqB;AAE9B,SAAS,cAAc;AAEvB,SAAS,YAAY;AAErB,SAAS,oBAAoB;AAK7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const _ELLIPSIS_CHARACTER = "\u2026";
|
|
2
|
+
const _ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
|
|
3
|
+
let inMemContext2d;
|
|
4
|
+
function _getTextWidth(text, textFont) {
|
|
5
|
+
const context = getCanvasContext2d();
|
|
6
|
+
context.font = getFontString(textFont);
|
|
7
|
+
const textMetrics = context.measureText(text);
|
|
8
|
+
if (textMetrics.width < 0) {
|
|
9
|
+
return textMetrics.width;
|
|
10
|
+
}
|
|
11
|
+
const actualTextWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
12
|
+
return Math.ceil(actualTextWidth);
|
|
13
|
+
}
|
|
14
|
+
function _getTextHeight(text, textFont) {
|
|
15
|
+
const context = getCanvasContext2d();
|
|
16
|
+
context.font = getFontString(textFont);
|
|
17
|
+
const textMetrics = context.measureText(text);
|
|
18
|
+
const actualTextHeight = Math.abs(textMetrics.actualBoundingBoxAscent) + Math.abs(textMetrics.actualBoundingBoxDescent);
|
|
19
|
+
return Math.ceil(actualTextHeight);
|
|
20
|
+
}
|
|
21
|
+
function _centerEllipsizeText(originalText, textFont, maxWidthInPx) {
|
|
22
|
+
const ellipsisInfo = _calculateEllipsisInfo(
|
|
23
|
+
originalText,
|
|
24
|
+
textFont,
|
|
25
|
+
maxWidthInPx
|
|
26
|
+
);
|
|
27
|
+
if (ellipsisInfo === null) {
|
|
28
|
+
return originalText;
|
|
29
|
+
}
|
|
30
|
+
const { ellipsisWidth, avgLetterWidth } = ellipsisInfo;
|
|
31
|
+
const availableTextWidth = maxWidthInPx - ellipsisWidth;
|
|
32
|
+
if (availableTextWidth <= ellipsisWidth) {
|
|
33
|
+
return _ELLIPSIS_CHARACTER;
|
|
34
|
+
}
|
|
35
|
+
const initialPrefixSuffixLength = Math.floor(availableTextWidth / avgLetterWidth / 2) + 1;
|
|
36
|
+
let prefix;
|
|
37
|
+
let suffix;
|
|
38
|
+
let ellipsizedText;
|
|
39
|
+
let approximatedTextWidth;
|
|
40
|
+
let attempt = 1;
|
|
41
|
+
let prefixLength = initialPrefixSuffixLength;
|
|
42
|
+
let suffixLength = initialPrefixSuffixLength;
|
|
43
|
+
do {
|
|
44
|
+
prefixLength -= attempt % 2 === 1 ? 1 : 0;
|
|
45
|
+
suffixLength -= attempt % 2 === 0 ? 1 : 0;
|
|
46
|
+
prefix = originalText.substring(0, prefixLength);
|
|
47
|
+
suffix = originalText.substring(originalText.length - suffixLength);
|
|
48
|
+
ellipsizedText = `${prefix}${_ELLIPSIS_CHARACTER}${suffix}`;
|
|
49
|
+
approximatedTextWidth = _getTextWidth(ellipsizedText, textFont);
|
|
50
|
+
attempt++;
|
|
51
|
+
} while (attempt <= _ELLIPSIS_APPROXIMATION_THRESHOLD && approximatedTextWidth >= maxWidthInPx);
|
|
52
|
+
return ellipsizedText;
|
|
53
|
+
}
|
|
54
|
+
function getFontString(textFont) {
|
|
55
|
+
const { fontStyle, fontWeight, fontSize, fontFamily } = textFont;
|
|
56
|
+
return [
|
|
57
|
+
fontStyle === "normal" ? "" : fontStyle,
|
|
58
|
+
fontWeight === "400" ? "" : fontWeight,
|
|
59
|
+
fontSize,
|
|
60
|
+
fontFamily
|
|
61
|
+
].filter((value) => value !== void 0 && value !== "").map(
|
|
62
|
+
(value) => (
|
|
63
|
+
// we need to resolve CSS variables manually because they are not supported by the canvas API
|
|
64
|
+
value?.trim().startsWith("var(") ? value.replace(/^\s*var\(--[0-9A-Za-z-]+,\s*([^)]+)\)\s*$/, "$1") : value
|
|
65
|
+
)
|
|
66
|
+
).join(" ");
|
|
67
|
+
}
|
|
68
|
+
function _calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
|
|
69
|
+
const originalTextLength = originalText.length;
|
|
70
|
+
if (originalTextLength <= 1) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const textWidth = _getTextWidth(originalText, textFont);
|
|
74
|
+
const avgLetterWidth = textWidth / originalTextLength;
|
|
75
|
+
return textWidth > maxWidthInPx ? {
|
|
76
|
+
ellipsisWidth: _getTextWidth(_ELLIPSIS_CHARACTER, textFont),
|
|
77
|
+
avgLetterWidth
|
|
78
|
+
} : null;
|
|
79
|
+
}
|
|
80
|
+
function getCanvasContext2d() {
|
|
81
|
+
if (!inMemContext2d) {
|
|
82
|
+
const context = document.createElement("canvas").getContext("2d");
|
|
83
|
+
if (context !== null) {
|
|
84
|
+
context.imageSmoothingEnabled = false;
|
|
85
|
+
context.imageSmoothingQuality = "low";
|
|
86
|
+
inMemContext2d = context;
|
|
87
|
+
} else {
|
|
88
|
+
throw new Error("Failed to create a Canvas 2D context");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return inMemContext2d;
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
_ELLIPSIS_APPROXIMATION_THRESHOLD,
|
|
95
|
+
_ELLIPSIS_CHARACTER,
|
|
96
|
+
_calculateEllipsisInfo,
|
|
97
|
+
_centerEllipsizeText,
|
|
98
|
+
_getTextHeight,
|
|
99
|
+
_getTextWidth
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/typography/utils.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @internal\n * Properties describing how a piece of text is formatted. */\nexport type _Font = {\n fontStyle?: string;\n fontWeight?: string;\n fontSize: string;\n fontFamily: string;\n};\n\n/**\n * @internal\n * The Unicode character representing an ellipsis. */\nexport const _ELLIPSIS_CHARACTER = '\\u2026';\n\n/**\n * @internal\n * Max iterations for finding the perfect truncated text for a given width */\nexport const _ELLIPSIS_APPROXIMATION_THRESHOLD = 15;\n\nlet inMemContext2d: CanvasRenderingContext2D;\n\n/**\n * Calculates the width of formatted text in pixels.\n *\n * @param text - The text to calculate the width of\n * @param textFont - The font settings for the text\n * @internal\n */\nexport function _getTextWidth(text: string, textFont: _Font): number {\n const context = getCanvasContext2d();\n\n context.font = getFontString(textFont);\n\n const textMetrics = context.measureText(text);\n\n // this branch is relevant for mocked canvas API in unit tests\n if (textMetrics.width < 0) {\n return textMetrics.width;\n }\n\n // more accurate than using metrics width\n // see https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#measuring_text_width\n const actualTextWidth =\n Math.abs(textMetrics.actualBoundingBoxLeft) +\n Math.abs(textMetrics.actualBoundingBoxRight);\n\n // Scrap sub-pixel accuracy and always round up to be on the safer side\n return Math.ceil(actualTextWidth);\n}\n\n/**\n * @internal\n * Calculates the height of formatted text in pixels.\n * @param text - The text to calculate the height of\n * @param textFont - The font settings for the text\n */\nexport function _getTextHeight(text: string, textFont: _Font): number {\n const context = getCanvasContext2d();\n\n context.font = getFontString(textFont);\n\n const textMetrics = context.measureText(text);\n\n const actualTextHeight =\n Math.abs(textMetrics.actualBoundingBoxAscent) +\n Math.abs(textMetrics.actualBoundingBoxDescent);\n\n // Scrap sub-pixel accuracy and always round up to be on the safer side\n return Math.ceil(actualTextHeight);\n}\n\n/**\n * Cuts off text that exceeds the maximum width in the center and\n * concatenates both shortened ends of the text with an ellipsis.\n *\n * @param originalText - The text to be truncated if its width exceeds <code>maxWidthInPx</code>\n * @param textFont - Different font settings to be considered when determining the width of the text\n * @param maxWidthInPx - If the text's width exceeds this value, the text will be truncated to a string whose width is guaranteed to be below it\n * @internal\n */\nexport function _centerEllipsizeText(\n originalText: string,\n textFont: _Font,\n maxWidthInPx: number,\n): string {\n const ellipsisInfo = _calculateEllipsisInfo(\n originalText,\n textFont,\n maxWidthInPx,\n );\n\n if (ellipsisInfo === null) {\n return originalText;\n }\n\n const { ellipsisWidth, avgLetterWidth } = ellipsisInfo;\n const availableTextWidth = maxWidthInPx - ellipsisWidth;\n\n if (availableTextWidth <= ellipsisWidth) {\n return _ELLIPSIS_CHARACTER;\n }\n\n const initialPrefixSuffixLength =\n Math.floor(availableTextWidth / avgLetterWidth / 2) + 1;\n\n let prefix: string;\n let suffix: string;\n let ellipsizedText: string;\n let approximatedTextWidth: number;\n let attempt = 1;\n let prefixLength = initialPrefixSuffixLength;\n let suffixLength = initialPrefixSuffixLength;\n\n do {\n prefixLength -= attempt % 2 === 1 ? 1 : 0;\n suffixLength -= attempt % 2 === 0 ? 1 : 0;\n\n prefix = originalText.substring(0, prefixLength);\n suffix = originalText.substring(originalText.length - suffixLength);\n\n ellipsizedText = `${prefix}${_ELLIPSIS_CHARACTER}${suffix}`;\n approximatedTextWidth = _getTextWidth(ellipsizedText, textFont);\n\n attempt++;\n } while (\n attempt <= _ELLIPSIS_APPROXIMATION_THRESHOLD &&\n approximatedTextWidth >= maxWidthInPx\n );\n\n return ellipsizedText;\n}\n\n/**\n * Transforms a font settings object into a CSS font specifier string\n * that can be used on 2D canvas contexts.\n */\nfunction getFontString(textFont: _Font): string {\n const { fontStyle, fontWeight, fontSize, fontFamily } = textFont;\n\n // Note: always drop default values for fontStyle and fontWeight as\n // these can randomly (!) break text width detection!\n return [\n fontStyle === 'normal' ? '' : fontStyle,\n fontWeight === '400' ? '' : fontWeight,\n fontSize,\n fontFamily,\n ]\n .filter((value) => value !== undefined && value !== '')\n .map((value) =>\n // we need to resolve CSS variables manually because they are not supported by the canvas API\n value?.trim().startsWith('var(')\n ? value.replace(/^\\s*var\\(--[0-9A-Za-z-]+,\\s*([^)]+)\\)\\s*$/, '$1')\n : value,\n )\n .join(' ');\n}\n\n/**\n * Returns an object containing the width of a given formatted text and the\n * width of an ellipsis character with the same text format or `null`\n * if the text width does not exceed its maximum available width.\n * @internal\n */\nexport function _calculateEllipsisInfo(\n originalText: string,\n textFont: _Font,\n maxWidthInPx: number,\n): { ellipsisWidth: number; avgLetterWidth: number } | null {\n const originalTextLength = originalText.length;\n\n if (originalTextLength <= 1) {\n return null;\n }\n\n const textWidth = _getTextWidth(originalText, textFont);\n const avgLetterWidth = textWidth / originalTextLength;\n\n return textWidth > maxWidthInPx\n ? {\n ellipsisWidth: _getTextWidth(_ELLIPSIS_CHARACTER, textFont),\n avgLetterWidth,\n }\n : null;\n}\n\n/** Returns the canvas 2D context used for measuring the width of formatted text. */\nfunction getCanvasContext2d() {\n if (!inMemContext2d) {\n const context = document.createElement('canvas').getContext('2d');\n\n if (context !== null) {\n context.imageSmoothingEnabled = false;\n context.imageSmoothingQuality = 'low';\n inMemContext2d = context;\n } else {\n throw new Error('Failed to create a Canvas 2D context');\n }\n }\n\n return inMemContext2d;\n}\n"],
|
|
5
|
+
"mappings": "AAaO,MAAM,sBAAsB;AAK5B,MAAM,oCAAoC;AAEjD,IAAI;AASG,SAAS,cAAc,MAAc,UAAyB;AACnE,QAAM,UAAU,mBAAmB;AAEnC,UAAQ,OAAO,cAAc,QAAQ;AAErC,QAAM,cAAc,QAAQ,YAAY,IAAI;AAG5C,MAAI,YAAY,QAAQ,GAAG;AACzB,WAAO,YAAY;AAAA,EACrB;AAIA,QAAM,kBACJ,KAAK,IAAI,YAAY,qBAAqB,IAC1C,KAAK,IAAI,YAAY,sBAAsB;AAG7C,SAAO,KAAK,KAAK,eAAe;AAClC;AAQO,SAAS,eAAe,MAAc,UAAyB;AACpE,QAAM,UAAU,mBAAmB;AAEnC,UAAQ,OAAO,cAAc,QAAQ;AAErC,QAAM,cAAc,QAAQ,YAAY,IAAI;AAE5C,QAAM,mBACJ,KAAK,IAAI,YAAY,uBAAuB,IAC5C,KAAK,IAAI,YAAY,wBAAwB;AAG/C,SAAO,KAAK,KAAK,gBAAgB;AACnC;AAWO,SAAS,qBACd,cACA,UACA,cACQ;AACR,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,MAAI,iBAAiB,MAAM;AACzB,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,eAAe,eAAe,IAAI;AAC1C,QAAM,qBAAqB,eAAe;AAE1C,MAAI,sBAAsB,eAAe;AACvC,WAAO;AAAA,EACT;AAEA,QAAM,4BACJ,KAAK,MAAM,qBAAqB,iBAAiB,CAAC,IAAI;AAExD,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,UAAU;AACd,MAAI,eAAe;AACnB,MAAI,eAAe;AAEnB,KAAG;AACD,oBAAgB,UAAU,MAAM,IAAI,IAAI;AACxC,oBAAgB,UAAU,MAAM,IAAI,IAAI;AAExC,aAAS,aAAa,UAAU,GAAG,YAAY;AAC/C,aAAS,aAAa,UAAU,aAAa,SAAS,YAAY;AAElE,qBAAiB,GAAG,MAAM,GAAG,mBAAmB,GAAG,MAAM;AACzD,4BAAwB,cAAc,gBAAgB,QAAQ;AAE9D;AAAA,EACF,SACE,WAAW,qCACX,yBAAyB;AAG3B,SAAO;AACT;AAMA,SAAS,cAAc,UAAyB;AAC9C,QAAM,EAAE,WAAW,YAAY,UAAU,WAAW,IAAI;AAIxD,SAAO;AAAA,IACL,cAAc,WAAW,KAAK;AAAA,IAC9B,eAAe,QAAQ,KAAK;AAAA,IAC5B;AAAA,IACA;AAAA,EACF,EACG,OAAO,CAAC,UAAU,UAAU,UAAa,UAAU,EAAE,EACrD;AAAA,IAAI,CAAC;AAAA;AAAA,MAEJ,OAAO,KAAK,EAAE,WAAW,MAAM,IAC3B,MAAM,QAAQ,6CAA6C,IAAI,IAC/D;AAAA;AAAA,EACN,EACC,KAAK,GAAG;AACb;AAQO,SAAS,uBACd,cACA,UACA,cAC0D;AAC1D,QAAM,qBAAqB,aAAa;AAExC,MAAI,sBAAsB,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,QAAM,YAAY,cAAc,cAAc,QAAQ;AACtD,QAAM,iBAAiB,YAAY;AAEnC,SAAO,YAAY,eACf;AAAA,IACE,eAAe,cAAc,qBAAqB,QAAQ;AAAA,IAC1D;AAAA,EACF,IACA;AACN;AAGA,SAAS,qBAAqB;AAC5B,MAAI,CAAC,gBAAgB;AACnB,UAAM,UAAU,SAAS,cAAc,QAAQ,EAAE,WAAW,IAAI;AAEhE,QAAI,YAAY,MAAM;AACpB,cAAQ,wBAAwB;AAChC,cAAQ,wBAAwB;AAChC,uBAAiB;AAAA,IACnB,OAAO;AACL,YAAM,IAAI,MAAM,sCAAsC;AAAA,IACxD;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -15,3 +15,5 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
15
15
|
var src_exports = {};
|
|
16
16
|
module.exports = __toCommonJS(src_exports);
|
|
17
17
|
__reExport(src_exports, require("./core/index.js"), module.exports);
|
|
18
|
+
__reExport(src_exports, require("./layouts/index.js"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./typography/index.js"), module.exports);
|
package/lang/en.json
CHANGED
package/lang/uncompiled/en.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.Divider_dividerCSS__1ljcfp90 {
|
|
2
|
+
border: none;
|
|
3
|
+
margin: 0;
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
background-color: var(--vars_borderColor__k096v42);
|
|
6
|
+
}
|
|
7
|
+
.Divider_dividerCSS_orientation_horizontal__1ljcfp91 {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--dt-borders-width-default, 1px);
|
|
10
|
+
}
|
|
11
|
+
.Divider_dividerCSS_orientation_vertical__1ljcfp92 {
|
|
12
|
+
width: var(--dt-borders-width-default, 1px);
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
.Divider_dividerCSS_compound_0__1ljcfp95 {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
}
|
|
18
|
+
.Divider_dividerCSS_compound_1__1ljcfp96 {
|
|
19
|
+
flex-shrink: 0;
|
|
20
|
+
width: var(--dt-borders-width-default, 1px);
|
|
21
|
+
height: auto;
|
|
22
|
+
align-self: stretch;
|
|
23
|
+
}
|