@dynatrace/strato-components 0.84.21 → 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 +9 -4
- package/core/components/app-root/AppRoot.js +6 -2
- package/core/contexts/FocusContext.d.ts +1 -1
- package/core/hooks/useCurrentTheme.d.ts +4 -1
- 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 +5 -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/data-props.d.ts +1 -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/masking-props.d.ts +9 -0
- package/core/types/masking-props.js +15 -0
- package/core/types/polymorph.d.ts +25 -0
- package/core/types/polymorph.js +15 -0
- package/core/types/styling-props.d.ts +3 -2
- package/core/types/with-children.d.ts +4 -1
- 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/components/app-root/AppRoot.js +6 -2
- package/esm/core/components/app-root/AppRoot.js.map +2 -2
- package/esm/core/contexts/FocusContext.js.map +1 -1
- package/esm/core/hooks/useCurrentTheme.js.map +2 -2
- 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 +2 -2
- 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/masking-props.js +1 -0
- package/esm/core/types/masking-props.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/custom-render.d.ts +1 -1
- package/testing/mocks/resize-observer-mock.d.ts +1 -1
- 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,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var List_css_exports = {};
|
|
19
|
+
__export(List_css_exports, {
|
|
20
|
+
listCSS: () => listCSS,
|
|
21
|
+
listItemCSS: () => listItemCSS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(List_css_exports);
|
|
24
|
+
var import_List_css_ts_vanilla = require("./List.css");
|
|
25
|
+
var listCSS = "List_listCSS__13d6w3n0";
|
|
26
|
+
var listItemCSS = "List_listItemCSS__13d6w3n1";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.Paragraph_paragraphCSS__42lz6l0 {
|
|
2
|
+
margin-top: 0;
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
color: var(--dt-colors-text-neutral-default, #2b2a58);
|
|
6
|
+
font-style: normal;
|
|
7
|
+
}
|
|
8
|
+
.Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1 {
|
|
9
|
+
display: block;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
14
|
+
.Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2 {
|
|
15
|
+
display: -webkit-box;
|
|
16
|
+
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
17
|
+
-webkit-box-orient: vertical;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DataTestId, type StylingProps, type WithChildren } from '../../core/index.js';
|
|
3
|
+
import type { DOMProps } from '../../core/types/dom.js';
|
|
4
|
+
import type { MaskingProps } from '../../core/types/masking-props.js';
|
|
5
|
+
/**
|
|
6
|
+
* The props for the Paragraph component.
|
|
7
|
+
* @public
|
|
8
|
+
* */
|
|
9
|
+
export interface ParagraphProps extends WithChildren, DOMProps, StylingProps, DataTestId, MaskingProps {
|
|
10
|
+
/**
|
|
11
|
+
* Limits the text to the given number of lines and adds ellipsis if the text would need more lines.
|
|
12
|
+
*/
|
|
13
|
+
maxLines?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
* The `Paragraph` component displays a block of text with the default text style and supports text truncation.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Paragraph: (props: ParagraphProps & React.RefAttributes<HTMLParagraphElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Paragraph_exports = {};
|
|
29
|
+
__export(Paragraph_exports, {
|
|
30
|
+
Paragraph: () => Paragraph
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Paragraph_exports);
|
|
33
|
+
var import_clsx = __toESM(require("clsx"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_Paragraph_css = require("./Paragraph.sty.js");
|
|
36
|
+
var import_textStyle_css = require("../../styles/textStyle.sty.js");
|
|
37
|
+
const Paragraph = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
|
|
38
|
+
const {
|
|
39
|
+
children,
|
|
40
|
+
maxLines,
|
|
41
|
+
className: consumerClassName,
|
|
42
|
+
style: consumerStyle,
|
|
43
|
+
"data-testid": dataTestId,
|
|
44
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
45
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
46
|
+
...remainingProps
|
|
47
|
+
} = props;
|
|
48
|
+
let ellipsis;
|
|
49
|
+
if (maxLines === void 0 || maxLines === 0) {
|
|
50
|
+
ellipsis = void 0;
|
|
51
|
+
} else if (maxLines === 1) {
|
|
52
|
+
ellipsis = "singleLine";
|
|
53
|
+
} else {
|
|
54
|
+
ellipsis = "multiLine";
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
+
"p",
|
|
58
|
+
{
|
|
59
|
+
ref,
|
|
60
|
+
"data-testid": dataTestId,
|
|
61
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
62
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
63
|
+
className: (0, import_clsx.default)(
|
|
64
|
+
(0, import_Paragraph_css.paragraphCSS)({ ellipsis }),
|
|
65
|
+
(0, import_textStyle_css.textStyleCSS)(),
|
|
66
|
+
consumerClassName
|
|
67
|
+
),
|
|
68
|
+
style: {
|
|
69
|
+
...consumerStyle,
|
|
70
|
+
"--strato-ellipsis-line-clamp": maxLines
|
|
71
|
+
},
|
|
72
|
+
...remainingProps
|
|
73
|
+
},
|
|
74
|
+
children
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
Paragraph.displayName = "Paragraph";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const paragraphCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
ellipsis: {
|
|
3
|
+
singleLine: {
|
|
4
|
+
display: "block";
|
|
5
|
+
whiteSpace: "nowrap";
|
|
6
|
+
textOverflow: "ellipsis";
|
|
7
|
+
overflow: "hidden";
|
|
8
|
+
};
|
|
9
|
+
multiLine: {
|
|
10
|
+
display: "-webkit-box";
|
|
11
|
+
WebkitLineClamp: "var(--strato-ellipsis-line-clamp)";
|
|
12
|
+
WebkitBoxOrient: "vertical";
|
|
13
|
+
overflow: "hidden";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Paragraph_css_exports = {};
|
|
19
|
+
__export(Paragraph_css_exports, {
|
|
20
|
+
paragraphCSS: () => paragraphCSS
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Paragraph_css_exports);
|
|
23
|
+
var import_Paragraph_css_ts_vanilla = require("./Paragraph.css");
|
|
24
|
+
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
25
|
+
var paragraphCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Paragraph_paragraphCSS__42lz6l0", variantClassNames: { ellipsis: { singleLine: "Paragraph_paragraphCSS_ellipsis_singleLine__42lz6l1", multiLine: "Paragraph_paragraphCSS_ellipsis_multiLine__42lz6l2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DataTestId, type StylingProps, type WithChildren } from '../../core/index.js';
|
|
3
|
+
import type { MaskingProps } from '../../core/types/masking-props.js';
|
|
4
|
+
/**
|
|
5
|
+
* The props for the Strikethrough component.
|
|
6
|
+
* @public
|
|
7
|
+
* */
|
|
8
|
+
export interface StrikethroughProps extends WithChildren, StylingProps, DataTestId, MaskingProps {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
* The `Strikethrough` component renders text with a line through it. Use it to
|
|
13
|
+
* represent things that are no longer relevant or accurate.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Strikethrough: (props: StrikethroughProps & React.RefAttributes<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Strikethrough_exports = {};
|
|
29
|
+
__export(Strikethrough_exports, {
|
|
30
|
+
Strikethrough: () => Strikethrough
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Strikethrough_exports);
|
|
33
|
+
var import_clsx = __toESM(require("clsx"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_Strikethrough_css = require("./Strikethrough.sty.js");
|
|
36
|
+
const Strikethrough = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
|
|
37
|
+
const {
|
|
38
|
+
children,
|
|
39
|
+
"data-testid": dataTestId,
|
|
40
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
41
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
42
|
+
className: consumerClassName,
|
|
43
|
+
style: consumerStyle,
|
|
44
|
+
...remainingProps
|
|
45
|
+
} = props;
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
"s",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
"data-testid": dataTestId,
|
|
51
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
52
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
53
|
+
className: (0, import_clsx.default)(import_Strikethrough_css.strikethroughCSS, consumerClassName),
|
|
54
|
+
style: consumerStyle,
|
|
55
|
+
...remainingProps
|
|
56
|
+
},
|
|
57
|
+
children
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
Strikethrough.displayName = "Strikethrough";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const strikethroughCSS: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Strikethrough_css_exports = {};
|
|
19
|
+
__export(Strikethrough_css_exports, {
|
|
20
|
+
strikethroughCSS: () => strikethroughCSS
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Strikethrough_css_exports);
|
|
23
|
+
var import_Strikethrough_css_ts_vanilla = require("./Strikethrough.css");
|
|
24
|
+
var strikethroughCSS = "Strikethrough_strikethroughCSS__1178y080";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DataTestId, type StylingProps, type WithChildren } from '../../core/index.js';
|
|
3
|
+
import type { MaskingProps } from '../../core/types/masking-props.js';
|
|
4
|
+
/**
|
|
5
|
+
* The props for the Strong component.
|
|
6
|
+
* @public
|
|
7
|
+
* */
|
|
8
|
+
export interface StrongProps extends WithChildren, StylingProps, DataTestId, MaskingProps {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
* Use the `Strong` component to render text in bold type to emphasize it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Strong: (props: StrongProps & React.RefAttributes<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Strong_exports = {};
|
|
29
|
+
__export(Strong_exports, {
|
|
30
|
+
Strong: () => Strong
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Strong_exports);
|
|
33
|
+
var import_clsx = __toESM(require("clsx"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_Strong_css = require("./Strong.sty.js");
|
|
36
|
+
const Strong = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
37
|
+
(props, ref) => {
|
|
38
|
+
const {
|
|
39
|
+
children,
|
|
40
|
+
"data-testid": dataTestId,
|
|
41
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
42
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
43
|
+
className: consumerClassName,
|
|
44
|
+
style: consumerStyle,
|
|
45
|
+
...remainingProps
|
|
46
|
+
} = props;
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
"strong",
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
"data-testid": dataTestId,
|
|
52
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
53
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
54
|
+
className: (0, import_clsx.default)(import_Strong_css.strongCSS, consumerClassName),
|
|
55
|
+
style: consumerStyle,
|
|
56
|
+
...remainingProps
|
|
57
|
+
},
|
|
58
|
+
children
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
Strong.displayName = "Strong";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const strongCSS: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Strong_css_exports = {};
|
|
19
|
+
__export(Strong_css_exports, {
|
|
20
|
+
strongCSS: () => strongCSS
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Strong_css_exports);
|
|
23
|
+
var import_Strong_css_ts_vanilla = require("./Strong.css");
|
|
24
|
+
var strongCSS = "Strong_strongCSS__1sqovlt0";
|
|
@@ -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,26 @@
|
|
|
1
|
+
import { type ElementType, type ReactElement } from 'react';
|
|
2
|
+
import type { AriaLabelingProps } from '../../core/types/a11y-props.js';
|
|
3
|
+
import { DataTestId } from '../../core/types/data-props.js';
|
|
4
|
+
import type { DOMProps } from '../../core/types/dom.js';
|
|
5
|
+
import type { MaskingProps } from '../../core/types/masking-props.js';
|
|
6
|
+
import type { PolymorphicComponentProps } from '../../core/types/polymorph.js';
|
|
7
|
+
import { StylingProps } from '../../core/types/styling-props.js';
|
|
8
|
+
import { WithChildren } from '../../core/types/with-children.js';
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
* The props for the text component without any props coming from polymorphing. */
|
|
12
|
+
export interface TextOwnProps extends WithChildren, DOMProps, AriaLabelingProps, StylingProps, DataTestId, MaskingProps {
|
|
13
|
+
/** Sets the text style. Variants include "base", "base-emphasized", etc. */
|
|
14
|
+
textStyle?: 'base' | 'base-emphasized' | 'small' | 'small-emphasized';
|
|
15
|
+
/** Sets the font style. Can either be "text" or "code" */
|
|
16
|
+
fontStyle?: 'text' | 'code';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* Combined props for the text component - polymorphing and own props. */
|
|
21
|
+
export type TextProps<E extends ElementType> = PolymorphicComponentProps<E, TextOwnProps>;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
* Use the `Text` component for text that is rendered without any semantic markup.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Text: <E extends ElementType = 'span'>(props: TextProps<E>) => ReactElement | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Text_exports = {};
|
|
29
|
+
__export(Text_exports, {
|
|
30
|
+
Text: () => Text
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Text_exports);
|
|
33
|
+
var import_clsx = __toESM(require("clsx"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_Text_css = require("./Text.sty.js");
|
|
36
|
+
var import_textStyle_css = require("../../styles/textStyle.sty.js");
|
|
37
|
+
const Text = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
38
|
+
({
|
|
39
|
+
children,
|
|
40
|
+
textStyle,
|
|
41
|
+
fontStyle,
|
|
42
|
+
as,
|
|
43
|
+
className: consumerClassName,
|
|
44
|
+
style: consumerStyle,
|
|
45
|
+
"data-testid": dataTestId,
|
|
46
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
47
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
48
|
+
...remainingProps
|
|
49
|
+
}, ref) => {
|
|
50
|
+
const TextTag = as || "span";
|
|
51
|
+
let ellipsis;
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
53
|
+
TextTag,
|
|
54
|
+
{
|
|
55
|
+
"data-testid": dataTestId,
|
|
56
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
57
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
58
|
+
ref,
|
|
59
|
+
className: (0, import_clsx.default)([
|
|
60
|
+
(0, import_Text_css.textCSS)({ ellipsis }),
|
|
61
|
+
(fontStyle || textStyle) && (0, import_textStyle_css.textStyleCSS)({ fontStyle, textStyle }),
|
|
62
|
+
consumerClassName
|
|
63
|
+
]),
|
|
64
|
+
style: consumerStyle,
|
|
65
|
+
...remainingProps
|
|
66
|
+
},
|
|
67
|
+
children
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
Text.displayName = "Text";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const textCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
ellipsis: {
|
|
3
|
+
singleLine: {
|
|
4
|
+
display: "block";
|
|
5
|
+
whiteSpace: "nowrap";
|
|
6
|
+
textOverflow: "ellipsis";
|
|
7
|
+
overflow: "hidden";
|
|
8
|
+
};
|
|
9
|
+
multiLine: {
|
|
10
|
+
display: "-webkit-box";
|
|
11
|
+
WebkitLineClamp: "var(--strato-ellipsis-line-clamp)";
|
|
12
|
+
WebkitBoxOrient: "vertical";
|
|
13
|
+
overflow: "hidden";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Text_css_exports = {};
|
|
19
|
+
__export(Text_css_exports, {
|
|
20
|
+
textCSS: () => textCSS
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(Text_css_exports);
|
|
23
|
+
var import_Text_css_ts_vanilla = require("./Text.css");
|
|
24
|
+
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
25
|
+
var textCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Text_textCSS__ty6wu50", variantClassNames: { ellipsis: { singleLine: "Text_textCSS_ellipsis_singleLine__ty6wu51", multiLine: "Text_textCSS_ellipsis_multiLine__ty6wu52" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -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,32 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { DataTestId } from '../../core/types/data-props.js';
|
|
3
|
+
import type { MaskingProps } from '../../core/types/masking-props.js';
|
|
4
|
+
import { StylingProps } from '../../core/types/styling-props.js';
|
|
5
|
+
/**
|
|
6
|
+
* Available modes for how overly long text is truncated and where the ellipsis is placed.
|
|
7
|
+
* @internal
|
|
8
|
+
* */
|
|
9
|
+
export type _TruncationMode = 'start' | 'middle' | 'end';
|
|
10
|
+
/**
|
|
11
|
+
* The props for the TextEllipsis component.
|
|
12
|
+
* @public
|
|
13
|
+
* */
|
|
14
|
+
export interface TextEllipsisProps extends HTMLAttributes<HTMLSpanElement>, StylingProps, DataTestId, MaskingProps {
|
|
15
|
+
/** The children (as text) passed to the component. */
|
|
16
|
+
children: string;
|
|
17
|
+
/**
|
|
18
|
+
* The mode used for for truncating the text, either at the start, in the middle or at the end.
|
|
19
|
+
* @defaultValue 'end'
|
|
20
|
+
*/
|
|
21
|
+
truncationMode?: 'start' | 'middle' | 'end';
|
|
22
|
+
/** Gets called when text needs to get truncated due to lack of horizontal space. */
|
|
23
|
+
onTextOverflow?: (ellipsized: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
* Use the `TextEllipsis` component to truncate text and show an ellipsis whenever
|
|
28
|
+
* there is insufficient space to render the entire text. While some of our Strato
|
|
29
|
+
* components provide ellipsis out of the box, you need to take care of this yourself
|
|
30
|
+
* when writing your own components.
|
|
31
|
+
*/
|
|
32
|
+
export declare const TextEllipsis: (props: TextEllipsisProps & React.RefAttributes<HTMLSpanElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|