@dynatrace/strato-components 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/buttons/button/Button.css +16 -16
- package/buttons/button/Button.js +16 -10
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/intent-button/IntentButton.d.ts +2 -0
- package/buttons/intent-button/IntentButton.js +4 -1
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.js +3 -1
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +3 -1
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +7 -7
- package/content/skeleton/Skeleton.js +3 -0
- package/content/skeleton/Skeleton.sty.js +5 -5
- package/content/skeleton/SkeletonText.js +3 -0
- package/core/components/app-root/AppRoot.js +3 -1
- package/core/hooks/useBehavioralTrackingProps.d.ts +2 -0
- package/core/hooks/useBehavioralTrackingProps.js +46 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +2 -0
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.d.ts +10 -6
- package/core/styles/focusRing.sty.js +2 -2
- package/core/styles/focusRingStatic.css +44 -0
- package/core/styles/focusRingStatic.sty.d.ts +77 -0
- package/core/styles/focusRingStatic.sty.js +26 -0
- package/core/styles/useFocusRing.d.ts +7 -6
- package/core/styles/useFocusRing.js +13 -13
- package/core/types/behavior-tracking-props.d.ts +33 -0
- package/core/types/behavior-tracking-props.js +16 -0
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +16 -10
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/buttons/index.js.map +1 -1
- package/esm/buttons/intent-button/IntentButton.js +4 -1
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js +3 -1
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +3 -1
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +7 -7
- package/esm/content/skeleton/Skeleton.js +3 -0
- package/esm/content/skeleton/Skeleton.js.map +2 -2
- package/esm/content/skeleton/Skeleton.sty.js +5 -5
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/content/skeleton/SkeletonText.js +3 -0
- package/esm/content/skeleton/SkeletonText.js.map +2 -2
- package/esm/core/components/app-root/AppRoot.js +3 -1
- package/esm/core/components/app-root/AppRoot.js.map +2 -2
- package/esm/core/hooks/useBehavioralTrackingProps.js +27 -0
- package/esm/core/hooks/useBehavioralTrackingProps.js.map +7 -0
- package/esm/core/index.js +4 -0
- package/esm/core/index.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/styles/focusRingStatic.css +44 -0
- package/esm/core/styles/focusRingStatic.sty.js +7 -0
- package/esm/core/styles/focusRingStatic.sty.js.map +7 -0
- package/esm/core/styles/useFocusRing.js +15 -15
- package/esm/core/styles/useFocusRing.js.map +2 -2
- package/esm/core/types/behavior-tracking-props.js +1 -0
- package/esm/core/types/behavior-tracking-props.js.map +7 -0
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.js +2 -6
- package/esm/layouts/surface/Surface.js.map +2 -2
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +1 -1
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +1 -1
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +1 -1
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.js +3 -1
- package/esm/typography/block-quote/Blockquote.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.js +3 -1
- package/esm/typography/code/Code.js.map +2 -2
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.js +3 -1
- package/esm/typography/emphasis/Emphasis.js.map +2 -2
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +8 -5
- package/esm/typography/external-link/ExternalLink.js +6 -13
- package/esm/typography/external-link/ExternalLink.js.map +2 -2
- package/esm/typography/external-link/ExternalLink.sty.js +2 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +2 -2
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.js +3 -1
- package/esm/typography/heading/Heading.js.map +2 -2
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +2 -2
- package/esm/typography/highlight/Highlight.js +3 -1
- package/esm/typography/highlight/Highlight.js.map +2 -2
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/link/Link.css +6 -3
- package/esm/typography/link/Link.js +6 -19
- package/esm/typography/link/Link.js.map +2 -2
- package/esm/typography/link/Link.sty.js +2 -1
- package/esm/typography/link/Link.sty.js.map +2 -2
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.js +3 -1
- package/esm/typography/list/List.js.map +2 -2
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.js +3 -1
- package/esm/typography/paragraph/Paragraph.js.map +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.js +3 -1
- package/esm/typography/strikethrough/Strikethrough.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.js +3 -1
- package/esm/typography/strong/Strong.js.map +2 -2
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.js +4 -1
- package/esm/typography/text/Text.js.map +2 -2
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.js +2 -6
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +6 -6
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.d.ts +12 -12
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.js +3 -1
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.js +3 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.js +3 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +8 -5
- package/typography/external-link/ExternalLink.js +6 -13
- package/typography/external-link/ExternalLink.sty.js +2 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.js +3 -1
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +2 -2
- package/typography/highlight/Highlight.js +3 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/link/Link.css +6 -3
- package/typography/link/Link.js +6 -19
- package/typography/link/Link.sty.js +2 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.js +3 -1
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +3 -1
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.js +3 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.js +3 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +4 -1
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { strongCSS } from "./Strong.sty.js";
|
|
5
|
+
const COMPONENT_NAME = "Strong";
|
|
5
6
|
const Strong = /* @__PURE__ */ forwardRef(
|
|
6
7
|
(props, ref) => {
|
|
7
8
|
const {
|
|
@@ -23,12 +24,13 @@ const Strong = /* @__PURE__ */ forwardRef(
|
|
|
23
24
|
className: clsx(strongCSS, consumerClassName),
|
|
24
25
|
style: consumerStyle,
|
|
25
26
|
...remainingProps,
|
|
27
|
+
"data-dt-component": COMPONENT_NAME,
|
|
26
28
|
children
|
|
27
29
|
}
|
|
28
30
|
);
|
|
29
31
|
}
|
|
30
32
|
);
|
|
31
|
-
Strong.displayName =
|
|
33
|
+
Strong.displayName = COMPONENT_NAME;
|
|
32
34
|
export {
|
|
33
35
|
Strong
|
|
34
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/strong/Strong.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef } from 'react';\n\nimport { strongCSS } from './Strong.sty.js';\nimport type { DataTestId } from '../../core/types/data-props.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport type { StylingProps } from '../../core/types/styling-props.js';\nimport type { WithChildren } from '../../core/types/with-children.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 * Use the `Strong` component to render text in bold type to emphasize it.\n * @public\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
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef } from 'react';\n\nimport { strongCSS } from './Strong.sty.js';\nimport type { DataTestId } from '../../core/types/data-props.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\nimport type { StylingProps } from '../../core/types/styling-props.js';\nimport type { WithChildren } from '../../core/types/with-children.js';\n\nconst COMPONENT_NAME = 'Strong';\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 * Use the `Strong` component to render text in bold type to emphasize it.\n * @public\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 data-dt-component={COMPONENT_NAME}\n >\n {children}\n </strong>\n );\n },\n);\n\n(Strong as typeof Strong & { displayName: string }).displayName =\n COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AAqCM;AArCN,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAE3B,SAAS,iBAAiB;AAM1B,MAAM,iBAAiB;AAgBhB,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,QACJ,qBAAmB;AAAA,QAElB;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,OAAmD,cAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/strong/Strong.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Strong.css';\nexport var strongCSS = '_wxp4dd0-1-
|
|
4
|
+
"sourcesContent": ["import './Strong.css';\nexport var strongCSS = '_wxp4dd0-1-17-0';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
._rup8ap0-1-
|
|
1
|
+
._rup8ap0-1-17-0 {
|
|
2
2
|
margin-top: 0;
|
|
3
3
|
margin-bottom: 0;
|
|
4
4
|
min-width: 0;
|
|
5
5
|
overflow-wrap: break-word;
|
|
6
6
|
}
|
|
7
|
-
._rup8ap1-1-
|
|
7
|
+
._rup8ap1-1-17-0 {
|
|
8
8
|
display: block;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
text-overflow: ellipsis;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
}
|
|
13
|
-
._rup8ap2-1-
|
|
13
|
+
._rup8ap2-1-17-0 {
|
|
14
14
|
display: -webkit-box;
|
|
15
15
|
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
16
16
|
-webkit-box-orient: vertical;
|
|
@@ -3,6 +3,7 @@ import clsx from "clsx";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { text } from "./Text.sty.js";
|
|
5
5
|
import { textStyle } from "../../styles/textStyle.sty.js";
|
|
6
|
+
const COMPONENT_NAME = "Text";
|
|
6
7
|
const Text = /* @__PURE__ */ forwardRef(
|
|
7
8
|
({
|
|
8
9
|
children,
|
|
@@ -14,6 +15,7 @@ const Text = /* @__PURE__ */ forwardRef(
|
|
|
14
15
|
"data-testid": dataTestId,
|
|
15
16
|
"data-dtrum-mask": dataDtrumMask,
|
|
16
17
|
"data-dtrum-allow": dataDtrumAllow,
|
|
18
|
+
"data-dt-component": dataDtComponent = COMPONENT_NAME,
|
|
17
19
|
...remainingProps
|
|
18
20
|
}, ref) => {
|
|
19
21
|
const TextTag = as || "span";
|
|
@@ -24,6 +26,7 @@ const Text = /* @__PURE__ */ forwardRef(
|
|
|
24
26
|
"data-testid": dataTestId,
|
|
25
27
|
"data-dtrum-mask": dataDtrumMask,
|
|
26
28
|
"data-dtrum-allow": dataDtrumAllow,
|
|
29
|
+
"data-dt-component": dataDtComponent,
|
|
27
30
|
ref,
|
|
28
31
|
className: clsx([
|
|
29
32
|
text({ ellipsis }),
|
|
@@ -37,7 +40,7 @@ const Text = /* @__PURE__ */ forwardRef(
|
|
|
37
40
|
);
|
|
38
41
|
}
|
|
39
42
|
);
|
|
40
|
-
Text.displayName =
|
|
43
|
+
Text.displayName = COMPONENT_NAME;
|
|
41
44
|
export {
|
|
42
45
|
Text
|
|
43
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/text/Text.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { type ElementType, type ReactElement, forwardRef } from 'react';\n\nimport { text } from './Text.sty.js';\nimport type { AriaLabelingProps } from '../../core/types/a11y-props.js';\nimport type { 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 type { StylingProps } from '../../core/types/styling-props.js';\nimport type { WithChildren } from '../../core/types/with-children.js';\nimport { textStyle } from '../../styles/textStyle.sty.js';\n\n/**\n * The props for the text component without any props coming from polymorphing.\n * @public\n */\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 * Combined props for the text component - polymorphing and own props.\n * @public\n */\nexport type TextProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n TextOwnProps\n>;\n\n/**\n * Use the `Text` component for text that is rendered without any semantic markup.\n * @public\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: textStyleProp,\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 text({ ellipsis }),\n (fontStyle || textStyleProp) &&\n textStyle({ fontStyle, textStyle: textStyleProp }),\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 =
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { type ElementType, type ReactElement, forwardRef } from 'react';\n\nimport { text } from './Text.sty.js';\nimport type { AriaLabelingProps } from '../../core/types/a11y-props.js';\nimport type { 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 type { StylingProps } from '../../core/types/styling-props.js';\nimport type { WithChildren } from '../../core/types/with-children.js';\nimport { textStyle } from '../../styles/textStyle.sty.js';\n\nconst COMPONENT_NAME = 'Text';\n\n/**\n * The props for the text component without any props coming from polymorphing.\n * @public\n */\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 * Combined props for the text component - polymorphing and own props.\n * @public\n */\nexport type TextProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n TextOwnProps\n>;\n\n/**\n * Use the `Text` component for text that is rendered without any semantic markup.\n * @public\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: textStyleProp,\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 'data-dt-component': dataDtComponent = COMPONENT_NAME,\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 data-dt-component={dataDtComponent}\n ref={ref}\n className={clsx([\n text({ ellipsis }),\n (fontStyle || textStyleProp) &&\n textStyle({ fontStyle, textStyle: textStyleProp }),\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 = COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AAqEM;AArEN,OAAO,UAAU;AACjB,SAA8C,kBAAkB;AAEhE,SAAS,YAAY;AAQrB,SAAS,iBAAiB;AAE1B,MAAM,iBAAiB;AAgChB,MAAM,OAE8B;AAAA,EACzC,CACE;AAAA,IACE;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,qBAAqB,kBAAkB;AAAA,IACvC,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,qBAAmB;AAAA,QACnB;AAAA,QACA,WAAW,KAAK;AAAA,UACd,KAAK,EAAE,SAAS,CAAC;AAAA,WAChB,aAAa,kBACZ,UAAU,EAAE,WAAW,WAAW,cAAc,CAAC;AAAA,UACnD;AAAA,QACF,CAAC;AAAA,QACD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,KAA+C,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Text.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var text = _7a468({ defaultClassName: "_rup8ap0-1-
|
|
3
|
+
var text = _7a468({ defaultClassName: "_rup8ap0-1-17-0", variantClassNames: { ellipsis: { singleLine: "_rup8ap1-1-17-0", multiLine: "_rup8ap2-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
4
|
export {
|
|
5
5
|
text
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 text = _7a468({defaultClassName:'_rup8ap0-1-
|
|
4
|
+
"sourcesContent": ["import './Text.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var text = _7a468({defaultClassName:'_rup8ap0-1-17-0',variantClassNames:{ellipsis:{singleLine:'_rup8ap1-1-17-0',multiLine:'_rup8ap2-1-17-0'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,OAAO,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,UAAS,EAAC,YAAW,mBAAkB,WAAU,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
._1mnpbqs1-1-
|
|
1
|
+
._1mnpbqs1-1-17-0 {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
vertical-align: middle;
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
text-decoration: inherit;
|
|
10
10
|
width: 100%;
|
|
11
11
|
}
|
|
12
|
-
._1mnpbqs2-1-
|
|
12
|
+
._1mnpbqs2-1-17-0 {
|
|
13
13
|
text-overflow: ellipsis;
|
|
14
14
|
direction: rtl;
|
|
15
15
|
text-align: left;
|
|
16
16
|
}
|
|
17
|
-
._1mnpbqs2-1-
|
|
17
|
+
._1mnpbqs2-1-17-0::after, ._1mnpbqs2-1-17-0::before {
|
|
18
18
|
content: "";
|
|
19
19
|
}
|
|
20
|
-
._1mnpbqs3-1-
|
|
20
|
+
._1mnpbqs3-1-17-0 {
|
|
21
21
|
text-overflow: clip;
|
|
22
22
|
}
|
|
23
|
-
._1mnpbqs3-1-
|
|
23
|
+
._1mnpbqs3-1-17-0._1mnpbqs0-1-17-0:after {
|
|
24
24
|
content: attr(data-sourcetext) / "";
|
|
25
25
|
color: transparent;
|
|
26
26
|
display: table;
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
line-height: 0;
|
|
29
29
|
user-select: none;
|
|
30
30
|
}
|
|
31
|
-
._1mnpbqs4-1-
|
|
31
|
+
._1mnpbqs4-1-17-0 {
|
|
32
32
|
text-overflow: ellipsis;
|
|
33
33
|
}
|
|
@@ -10,6 +10,7 @@ import { useFontsUpdated } from "../../core/hooks/useFontsUpdated.js";
|
|
|
10
10
|
import { useMergeRefs } from "../../core/hooks/useMergeRefs.js";
|
|
11
11
|
import { centerEllipsizeText } from "../utils.js";
|
|
12
12
|
import * as styles from "./TextEllipsis.sty.js";
|
|
13
|
+
const COMPONENT_NAME = "TextEllipsis";
|
|
13
14
|
function getFontProps(innerSpanElement) {
|
|
14
15
|
const computedStyle = window.getComputedStyle(innerSpanElement, null);
|
|
15
16
|
return {
|
|
@@ -112,6 +113,7 @@ const ComputedTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) =>
|
|
|
112
113
|
}),
|
|
113
114
|
style: consumerStyle,
|
|
114
115
|
...remainingProps,
|
|
116
|
+
"data-dt-component": COMPONENT_NAME,
|
|
115
117
|
children: /* @__PURE__ */ jsx("span", { children })
|
|
116
118
|
}
|
|
117
119
|
);
|
|
@@ -123,6 +125,8 @@ const CssTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
123
125
|
onTextOverflow,
|
|
124
126
|
className: consumerClassName,
|
|
125
127
|
style: consumerStyle,
|
|
128
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
129
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
126
130
|
"data-testid": dataTestId,
|
|
127
131
|
...remainingProps
|
|
128
132
|
} = props;
|
|
@@ -133,9 +137,12 @@ const CssTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
133
137
|
"aria-label": children,
|
|
134
138
|
"data-ellipsis": true,
|
|
135
139
|
"data-testid": dataTestId,
|
|
140
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
141
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
136
142
|
className: clsx(styles.ellipsis({ truncationMode }), consumerClassName),
|
|
137
143
|
style: consumerStyle,
|
|
138
144
|
...remainingProps,
|
|
145
|
+
"data-dt-component": COMPONENT_NAME,
|
|
139
146
|
children: /* @__PURE__ */ jsx("span", { children })
|
|
140
147
|
}
|
|
141
148
|
);
|
|
@@ -144,7 +151,7 @@ const TextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
144
151
|
const cssOnlyEllipsis = !props.onTextOverflow && props.truncationMode !== "middle";
|
|
145
152
|
return cssOnlyEllipsis ? /* @__PURE__ */ jsx(CssTextEllipsis, { ref: forwardedRef, ...props }) : /* @__PURE__ */ jsx(ComputedTextEllipsis, { ref: forwardedRef, ...props });
|
|
146
153
|
});
|
|
147
|
-
TextEllipsis.displayName =
|
|
154
|
+
TextEllipsis.displayName = COMPONENT_NAME;
|
|
148
155
|
export {
|
|
149
156
|
TextEllipsis
|
|
150
157
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/text-ellipsis/TextEllipsis.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport {\n forwardRef,\n type HTMLAttributes,\n type RefObject,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport useResizeObserver from 'use-resize-observer';\n\nimport { useFontsUpdated } from '../../core/hooks/useFontsUpdated.js';\nimport { useMergeRefs } from '../../core/hooks/useMergeRefs.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { centerEllipsizeText, type Font } from '../utils.js';\nimport * as styles from './TextEllipsis.sty.js';\n\n/**\n * Available modes for how overly long text is truncated and where the ellipsis is placed.\n * @public\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?: TruncationMode;\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 innerSpanElement - The HTML element to extract the CSS properties from\n */\nfunction getFontProps(innerSpanElement: HTMLSpanElement): Font {\n const computedStyle = window.getComputedStyle(innerSpanElement, 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 innerSpanElement: HTMLSpanElement,\n containerWidth: number,\n): boolean {\n // Sometimes there already is an ellipsis, which means `getBoundingClientRect().width` and `containerWidth` are the same.\n // In that case, `scrollWidth` specifies the actual width of the text if it was fully visible.\n const originalTextWidth = Math.max(\n innerSpanElement.getBoundingClientRect().width,\n innerSpanElement.scrollWidth,\n );\n const textWidth = Math.floor(originalTextWidth * 100) / 100;\n\n return textWidth > containerWidth;\n}\n\nfunction resetFullText(\n innerSpanElement: HTMLSpanElement,\n originalText: string,\n) {\n if (innerSpanElement.textContent !== originalText) {\n innerSpanElement.textContent = originalText;\n }\n}\n\nfunction getWidth(element: HTMLSpanElement) {\n return Math.max(element.getBoundingClientRect().width, element.clientWidth);\n}\n\nfunction getContainerWidth(containerElement: HTMLSpanElement) {\n return Math.ceil(getWidth(containerElement) * 100) / 100;\n}\n\nfunction onTextOverflowCallback(\n current: boolean,\n wasEllipsized: boolean,\n onTextOverflow: ((ellipsized: boolean) => void) | undefined,\n) {\n if (onTextOverflow && current !== wasEllipsized) {\n onTextOverflow(current);\n }\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 the container width\n * @param truncationMode - The mode used 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 *\n * @returns true, if the given text was ellipsized, false otherwise.\n */\nfunction renderEllipsizedText(\n originalText: string,\n truncationMode: TextEllipsisProps['truncationMode'],\n containerRef: RefObject<HTMLSpanElement | null>,\n wasEllipsized: boolean,\n onTextOverflow?: (ellipsized: boolean) => void,\n): boolean {\n const containerElement = containerRef.current;\n\n const innerSpanElement: HTMLSpanElement | null =\n (containerElement?.firstElementChild as HTMLSpanElement) || null;\n\n if (containerElement === null || innerSpanElement === null) {\n return false;\n }\n\n // always reset to full text before measuring container width\n resetFullText(innerSpanElement, originalText);\n const containerWidth = getContainerWidth(containerElement);\n\n if (!isNativeEllipsisActive(innerSpanElement, containerWidth)) {\n onTextOverflowCallback(false, wasEllipsized, onTextOverflow);\n return false;\n }\n\n if (truncationMode === 'middle') {\n innerSpanElement.textContent = centerEllipsizeText(\n originalText,\n getFontProps(innerSpanElement),\n containerWidth,\n );\n }\n\n onTextOverflowCallback(true, wasEllipsized, onTextOverflow);\n return true;\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-calculate the ellipsis in case of resizing\n const { ref: observerContainerRef, width } =\n 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\n const fontsUpdated = useFontsUpdated();\n\n useLayoutEffect(() => {\n ellipsisStateRef.current = renderEllipsizedText(\n children,\n truncationMode,\n containerRef,\n ellipsisStateRef.current,\n onTextOverflow,\n );\n }, [width, children, truncationMode, fontsUpdated, onTextOverflow]);\n\n return (\n <span\n ref={mergedRef}\n aria-label={children}\n data-sourcetext={children}\n data-ellipsis\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(styles.ellipsis({ truncationMode }), consumerClassName, {\n [styles.active]: ellipsisStateRef.current,\n })}\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(styles.ellipsis({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n >\n <span>{children}</span>\n </span>\n );\n});\n\n/**\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 * @public\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
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport {\n forwardRef,\n type HTMLAttributes,\n type RefObject,\n useLayoutEffect,\n useRef,\n} from 'react';\nimport useResizeObserver from 'use-resize-observer';\n\nimport { useFontsUpdated } from '../../core/hooks/useFontsUpdated.js';\nimport { useMergeRefs } from '../../core/hooks/useMergeRefs.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { centerEllipsizeText, type Font } from '../utils.js';\nimport * as styles from './TextEllipsis.sty.js';\n\nconst COMPONENT_NAME = 'TextEllipsis';\n\n/**\n * Available modes for how overly long text is truncated and where the ellipsis is placed.\n * @public\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?: TruncationMode;\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 innerSpanElement - The HTML element to extract the CSS properties from\n */\nfunction getFontProps(innerSpanElement: HTMLSpanElement): Font {\n const computedStyle = window.getComputedStyle(innerSpanElement, 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 innerSpanElement: HTMLSpanElement,\n containerWidth: number,\n): boolean {\n // Sometimes there already is an ellipsis, which means `getBoundingClientRect().width` and `containerWidth` are the same.\n // In that case, `scrollWidth` specifies the actual width of the text if it was fully visible.\n const originalTextWidth = Math.max(\n innerSpanElement.getBoundingClientRect().width,\n innerSpanElement.scrollWidth,\n );\n const textWidth = Math.floor(originalTextWidth * 100) / 100;\n\n return textWidth > containerWidth;\n}\n\nfunction resetFullText(\n innerSpanElement: HTMLSpanElement,\n originalText: string,\n) {\n if (innerSpanElement.textContent !== originalText) {\n innerSpanElement.textContent = originalText;\n }\n}\n\nfunction getWidth(element: HTMLSpanElement) {\n return Math.max(element.getBoundingClientRect().width, element.clientWidth);\n}\n\nfunction getContainerWidth(containerElement: HTMLSpanElement) {\n return Math.ceil(getWidth(containerElement) * 100) / 100;\n}\n\nfunction onTextOverflowCallback(\n current: boolean,\n wasEllipsized: boolean,\n onTextOverflow: ((ellipsized: boolean) => void) | undefined,\n) {\n if (onTextOverflow && current !== wasEllipsized) {\n onTextOverflow(current);\n }\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 the container width\n * @param truncationMode - The mode used 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 *\n * @returns true, if the given text was ellipsized, false otherwise.\n */\nfunction renderEllipsizedText(\n originalText: string,\n truncationMode: TextEllipsisProps['truncationMode'],\n containerRef: RefObject<HTMLSpanElement | null>,\n wasEllipsized: boolean,\n onTextOverflow?: (ellipsized: boolean) => void,\n): boolean {\n const containerElement = containerRef.current;\n\n const innerSpanElement: HTMLSpanElement | null =\n (containerElement?.firstElementChild as HTMLSpanElement) || null;\n\n if (containerElement === null || innerSpanElement === null) {\n return false;\n }\n\n // always reset to full text before measuring container width\n resetFullText(innerSpanElement, originalText);\n const containerWidth = getContainerWidth(containerElement);\n\n if (!isNativeEllipsisActive(innerSpanElement, containerWidth)) {\n onTextOverflowCallback(false, wasEllipsized, onTextOverflow);\n return false;\n }\n\n if (truncationMode === 'middle') {\n innerSpanElement.textContent = centerEllipsizeText(\n originalText,\n getFontProps(innerSpanElement),\n containerWidth,\n );\n }\n\n onTextOverflowCallback(true, wasEllipsized, onTextOverflow);\n return true;\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-calculate the ellipsis in case of resizing\n const { ref: observerContainerRef, width } =\n 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\n const fontsUpdated = useFontsUpdated();\n\n useLayoutEffect(() => {\n ellipsisStateRef.current = renderEllipsizedText(\n children,\n truncationMode,\n containerRef,\n ellipsisStateRef.current,\n onTextOverflow,\n );\n }, [width, children, truncationMode, fontsUpdated, onTextOverflow]);\n\n return (\n <span\n ref={mergedRef}\n aria-label={children}\n data-sourcetext={children}\n data-ellipsis\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(styles.ellipsis({ truncationMode }), consumerClassName, {\n [styles.active]: ellipsisStateRef.current,\n })}\n style={consumerStyle}\n {...remainingProps}\n data-dt-component={COMPONENT_NAME}\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-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\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 data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n className={clsx(styles.ellipsis({ truncationMode }), consumerClassName)}\n style={consumerStyle}\n {...remainingProps}\n data-dt-component={COMPONENT_NAME}\n >\n <span>{children}</span>\n </span>\n );\n});\n\n/**\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 * @public\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 COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./TextEllipsis.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var active = "_1mnpbqs0-1-
|
|
4
|
-
var ellipsis = _7a468({ defaultClassName: "_1mnpbqs1-1-
|
|
3
|
+
var active = "_1mnpbqs0-1-17-0";
|
|
4
|
+
var ellipsis = _7a468({ defaultClassName: "_1mnpbqs1-1-17-0", variantClassNames: { truncationMode: { start: "_1mnpbqs2-1-17-0", middle: "_1mnpbqs3-1-17-0", end: "_1mnpbqs4-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5
5
|
export {
|
|
6
6
|
active,
|
|
7
7
|
ellipsis
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/text-ellipsis/TextEllipsis.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './TextEllipsis.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var active = '_1mnpbqs0-1-
|
|
4
|
+
"sourcesContent": ["import './TextEllipsis.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var active = '_1mnpbqs0-1-17-0';\nexport var ellipsis = _7a468({defaultClassName:'_1mnpbqs1-1-17-0',variantClassNames:{truncationMode:{start:'_1mnpbqs2-1-17-0',middle:'_1mnpbqs3-1-17-0',end:'_1mnpbqs4-1-17-0'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,SAAS;AACb,IAAI,WAAW,OAAO,EAAC,kBAAiB,oBAAmB,mBAAkB,EAAC,gBAAe,EAAC,OAAM,oBAAmB,QAAO,oBAAmB,KAAI,mBAAkB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
._f32lcd0-1-
|
|
1
|
+
._f32lcd0-1-17-0 {
|
|
2
2
|
border-style: var(--dt-borders-style-default, solid);
|
|
3
3
|
border-width: var(--dt-borders-width-emphasized, 2px);
|
|
4
4
|
border-radius: var(--dt-borders-radius-container-default, 9px);
|
|
5
|
-
color: var(--_6levse0-1-
|
|
6
|
-
border-color: var(--_6levse2-1-
|
|
7
|
-
background-color: var(--_6levse1-1-
|
|
5
|
+
color: var(--_6levse0-1-17-0);
|
|
6
|
+
border-color: var(--_6levse2-1-17-0);
|
|
7
|
+
background-color: var(--_6levse1-1-17-0);
|
|
8
8
|
}
|
|
@@ -23,4 +23,4 @@ __export(Container_css_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(Container_css_exports);
|
|
24
24
|
var import_container_css_ts_vanilla = require("../../styles/container.css");
|
|
25
25
|
var import_Container_css_ts_vanilla = require("./Container.css");
|
|
26
|
-
var containerCSS = "_f32lcd0-1-
|
|
26
|
+
var containerCSS = "_f32lcd0-1-17-0";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
._1thxv8m0-1-
|
|
1
|
+
._1thxv8m0-1-17-0 {
|
|
2
2
|
border: none;
|
|
3
3
|
margin: 0;
|
|
4
4
|
overflow-wrap: break-word;
|
|
5
|
-
background-color: var(--_k096v42-1-
|
|
5
|
+
background-color: var(--_k096v42-1-17-0);
|
|
6
6
|
}
|
|
7
|
-
._1thxv8m1-1-
|
|
7
|
+
._1thxv8m1-1-17-0 {
|
|
8
8
|
width: 100%;
|
|
9
9
|
height: var(--dt-borders-width-default, 1px);
|
|
10
10
|
}
|
|
11
|
-
._1thxv8m2-1-
|
|
11
|
+
._1thxv8m2-1-17-0 {
|
|
12
12
|
width: var(--dt-borders-width-default, 1px);
|
|
13
13
|
height: 100%;
|
|
14
14
|
}
|
|
15
|
-
._1thxv8m5-1-
|
|
15
|
+
._1thxv8m5-1-17-0 {
|
|
16
16
|
flex-shrink: 0;
|
|
17
17
|
}
|
|
18
|
-
._1thxv8m6-1-
|
|
18
|
+
._1thxv8m6-1-17-0 {
|
|
19
19
|
flex-shrink: 0;
|
|
20
20
|
width: var(--dt-borders-width-default, 1px);
|
|
21
21
|
height: auto;
|
|
@@ -24,4 +24,4 @@ module.exports = __toCommonJS(Divider_css_exports);
|
|
|
24
24
|
var import_colorUtils_css_ts_vanilla = require("../../core/utils/colorUtils.css");
|
|
25
25
|
var import_Divider_css_ts_vanilla = require("./Divider.css");
|
|
26
26
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
27
|
-
var dividerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1thxv8m0-1-
|
|
27
|
+
var dividerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1thxv8m0-1-17-0", variantClassNames: { orientation: { horizontal: "_1thxv8m1-1-17-0", vertical: "_1thxv8m2-1-17-0" }, flexItem: { true: "_1thxv8m3-1-17-0", false: "_1thxv8m4-1-17-0" } }, defaultVariants: {}, compoundVariants: [[{ orientation: "horizontal", flexItem: false }, "_1thxv8m5-1-17-0"], [{ orientation: "vertical", flexItem: true }, "_1thxv8m6-1-17-0"]] });
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
._1qto6jt6-1-
|
|
2
|
-
--_1igzksy0-1-
|
|
1
|
+
._1qto6jt6-1-17-0 {
|
|
2
|
+
--_1igzksy0-1-17-0: var(--dt-borders-radius-surface-default, 12px);
|
|
3
3
|
color: var(--dt-colors-text-neutral-default, #2f2f4f);
|
|
4
4
|
text-align: left;
|
|
5
5
|
border: none;
|
|
6
6
|
outline: none;
|
|
7
7
|
position: relative;
|
|
8
8
|
background-color: var(--dt-colors-background-surface-default, #fff);
|
|
9
|
-
border-radius: var(--_1igzksy0-1-
|
|
9
|
+
border-radius: var(--_1igzksy0-1-17-0);
|
|
10
10
|
}
|
|
11
|
-
._1qto6jt6-1-
|
|
11
|
+
._1qto6jt6-1-17-0::before, ._1qto6jt6-1-17-0::after {
|
|
12
12
|
content: "";
|
|
13
13
|
width: 100%;
|
|
14
14
|
height: 100%;
|
|
15
15
|
position: absolute;
|
|
16
16
|
left: 0;
|
|
17
17
|
top: 0;
|
|
18
|
-
border-radius: var(--_1igzksy0-1-
|
|
18
|
+
border-radius: var(--_1igzksy0-1-17-0);
|
|
19
19
|
pointer-events: none;
|
|
20
20
|
}
|
|
21
|
-
._1qto6jt6-1-
|
|
21
|
+
._1qto6jt6-1-17-0::after {
|
|
22
22
|
outline-offset: 2px;
|
|
23
|
-
outline: 2px solid var(--_17bwkb02-1-
|
|
24
|
-
opacity: var(--_1qto6jt4-1-
|
|
25
|
-
transition: var(--_1qto6jt5-1-
|
|
23
|
+
outline: 2px solid var(--_17bwkb02-1-17-0);
|
|
24
|
+
opacity: var(--_1qto6jt4-1-17-0);
|
|
25
|
+
transition: var(--_1qto6jt5-1-17-0);
|
|
26
26
|
}
|
|
27
|
-
._1qto6jt7-1-
|
|
28
|
-
--_1qto6jt4-1-
|
|
29
|
-
--_1qto6jt5-1-
|
|
27
|
+
._1qto6jt7-1-17-0 {
|
|
28
|
+
--_1qto6jt4-1-17-0: 1;
|
|
29
|
+
--_1qto6jt5-1-17-0: var(--dt-animations-fade-in-easing, cubic-bezier(0.5, 0, 1, 1)) var(--dt-animations-fade-in-duration-fast, 150ms);
|
|
30
30
|
}
|
|
31
|
-
._1qto6jt8-1-
|
|
32
|
-
--_1qto6jt4-1-
|
|
33
|
-
--_1qto6jt5-1-
|
|
31
|
+
._1qto6jt8-1-17-0 {
|
|
32
|
+
--_1qto6jt4-1-17-0: 0;
|
|
33
|
+
--_1qto6jt5-1-17-0: var(--dt-animations-fade-out-easing, cubic-bezier(0, 0, 0.2, 1)) var(--dt-animations-fade-out-duration-fast, 150ms);
|
|
34
34
|
}
|
|
35
|
-
._1qto6jt9-1-
|
|
36
|
-
--_1qto6jt1-1-
|
|
37
|
-
--_1qto6jt2-1-
|
|
38
|
-
--_1qto6jt3-1-
|
|
35
|
+
._1qto6jt9-1-17-0 {
|
|
36
|
+
--_1qto6jt1-1-17-0: 0;
|
|
37
|
+
--_1qto6jt2-1-17-0: pointer;
|
|
38
|
+
--_1qto6jt3-1-17-0: var(--dt-box-shadows-surface-flat-hover, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 4px 8px -2px #2d2e4e12);
|
|
39
39
|
width: 100%;
|
|
40
40
|
height: 100%;
|
|
41
41
|
position: absolute;
|
|
42
42
|
left: 0;
|
|
43
43
|
top: 0;
|
|
44
|
-
border-radius: var(--_1igzksy0-1-
|
|
44
|
+
border-radius: var(--_1igzksy0-1-17-0);
|
|
45
45
|
pointer-events: none;
|
|
46
46
|
}
|
|
47
|
-
._1qto6jt9-1-
|
|
47
|
+
._1qto6jt9-1-17-0::after,._1qto6jt9-1-17-0::before {
|
|
48
48
|
content: "";
|
|
49
49
|
width: 100%;
|
|
50
50
|
height: 100%;
|
|
51
51
|
position: absolute;
|
|
52
52
|
left: 0;
|
|
53
53
|
top: 0;
|
|
54
|
-
border-radius: var(--_1igzksy0-1-
|
|
54
|
+
border-radius: var(--_1igzksy0-1-17-0);
|
|
55
55
|
pointer-events: none;
|
|
56
56
|
transition: var(--dt-animations-fade-in-easing, cubic-bezier(0.5, 0, 1, 1)) var(--dt-animations-fade-in-duration-fast, 150ms);
|
|
57
57
|
}
|
|
58
|
-
._1qto6jt9-1-
|
|
59
|
-
box-shadow: var(--_1qto6jt0-1-
|
|
60
|
-
opacity: var(--_1qto6jt1-1-
|
|
58
|
+
._1qto6jt9-1-17-0::after {
|
|
59
|
+
box-shadow: var(--_1qto6jt0-1-17-0);
|
|
60
|
+
opacity: var(--_1qto6jt1-1-17-0);
|
|
61
61
|
}
|
|
62
|
-
._1qto6jt9-1-
|
|
63
|
-
box-shadow: var(--_1qto6jt3-1-
|
|
62
|
+
._1qto6jt9-1-17-0::before {
|
|
63
|
+
box-shadow: var(--_1qto6jt3-1-17-0);
|
|
64
64
|
opacity: 0;
|
|
65
65
|
}
|
|
66
|
-
._1qto6jta-1-
|
|
67
|
-
--_1qto6jt0-1-
|
|
68
|
-
--_1qto6jt3-1-
|
|
66
|
+
._1qto6jta-1-17-0 {
|
|
67
|
+
--_1qto6jt0-1-17-0: var(--dt-box-shadows-surface-flat-drag, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 7px 17px -2px #2d2e4e52);
|
|
68
|
+
--_1qto6jt3-1-17-0: var(--dt-box-shadows-surface-flat-hover, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 4px 8px -2px #2d2e4e12);
|
|
69
69
|
box-shadow: var(--dt-box-shadows-surface-flat-rest, 0px 0px 0px 1px #2d2e4e0d);
|
|
70
70
|
}
|
|
71
|
-
._1qto6jtb-1-
|
|
72
|
-
--_1qto6jt0-1-
|
|
73
|
-
--_1qto6jt3-1-
|
|
71
|
+
._1qto6jtb-1-17-0 {
|
|
72
|
+
--_1qto6jt0-1-17-0: var(--dt-box-shadows-surface-raised-drag, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 7px 17px -2px #2d2e4e52);
|
|
73
|
+
--_1qto6jt3-1-17-0: var(--dt-box-shadows-surface-raised-hover, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 5px 11px -2px #2d2e4e29);
|
|
74
74
|
box-shadow: var(--dt-box-shadows-surface-raised-rest, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 4px 8px -2px #2d2e4e12);
|
|
75
75
|
}
|
|
76
|
-
._1qto6jtc-1-
|
|
77
|
-
--_1qto6jt0-1-
|
|
78
|
-
--_1qto6jt3-1-
|
|
76
|
+
._1qto6jtc-1-17-0 {
|
|
77
|
+
--_1qto6jt0-1-17-0: var(--dt-box-shadows-surface-floating-drag, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 7px 17px -2px #2d2e4e52);
|
|
78
|
+
--_1qto6jt3-1-17-0: var(--dt-box-shadows-surface-floating-hover, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 6px 14px -2px #2d2e4e3d);
|
|
79
79
|
box-shadow: var(--dt-box-shadows-surface-floating-rest, 0px 0px 0px 1px #2d2e4e08, 0px 1px 2px #2d2e4e0d, 0px 5px 11px -2px #2d2e4e29);
|
|
80
80
|
}
|
|
81
|
-
._1qto6jtd-1-
|
|
82
|
-
--_1qto6jt1-1-
|
|
83
|
-
--_1qto6jt2-1-
|
|
81
|
+
._1qto6jtd-1-17-0 {
|
|
82
|
+
--_1qto6jt1-1-17-0: 1;
|
|
83
|
+
--_1qto6jt2-1-17-0: grab;
|
|
84
84
|
}
|
|
85
85
|
button.strato-surface:not(:disabled), a.strato-surface:not(:disabled) {
|
|
86
86
|
cursor: pointer;
|
|
@@ -36,7 +36,7 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var styles = __toESM(require("./Surface.sty.js"));
|
|
38
38
|
var import_useAriaLabelingProps = require("../../core/hooks/useAriaLabelingProps.js");
|
|
39
|
-
var
|
|
39
|
+
var import_focusRingStatic_css = require("../../core/styles/focusRingStatic.sty.js");
|
|
40
40
|
var import_merge_props = require("../../core/utils/merge-props.js");
|
|
41
41
|
var import_colorUtils_css = require("../../styles/colorUtils.sty.js");
|
|
42
42
|
var import_getSpacingSprinkles = require("../../styles/getSpacingSprinkles.js");
|
|
@@ -63,16 +63,12 @@ const Surface = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
|
63
63
|
remainingProps,
|
|
64
64
|
{ paddingDefaults: { padding: 24 } }
|
|
65
65
|
);
|
|
66
|
-
const { focusProps, focusClassName } = (0, import_useFocusRing.useFocusRing)({
|
|
67
|
-
variant: color
|
|
68
|
-
});
|
|
69
66
|
const surfaceMergedProps = {
|
|
70
67
|
...(0, import_merge_props.mergeProps)(
|
|
71
68
|
// Need to cast this one as the inference of mergeProps would generate
|
|
72
69
|
// a not allowed overlap. The remainingProps type is too complex due to the
|
|
73
70
|
// polymorphic inheritance.
|
|
74
71
|
surfaceProps,
|
|
75
|
-
focusProps,
|
|
76
72
|
ariaLabelingProps
|
|
77
73
|
)
|
|
78
74
|
};
|
|
@@ -89,7 +85,7 @@ const Surface = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
|
89
85
|
"strato-surface",
|
|
90
86
|
(0, import_colorUtils_css.colorUtils)({ color, variant: selected ? "accent" : "default" }),
|
|
91
87
|
styles.surface({ selected }),
|
|
92
|
-
|
|
88
|
+
(0, import_focusRingStatic_css.focusRingStatic)({ color, when: "focus-visible" }),
|
|
93
89
|
consumerClassName,
|
|
94
90
|
(0, import_getSpacingSprinkles.getSpacingSprinkles)(remainingProps, { padding: 24 }),
|
|
95
91
|
(0, import_textStyle_css.textStyle)({ textStyle: "base" })
|
|
@@ -25,5 +25,5 @@ module.exports = __toCommonJS(Surface_css_exports);
|
|
|
25
25
|
var import_colorUtils_css_ts_vanilla = require("../../styles/colorUtils.css");
|
|
26
26
|
var import_Surface_css_ts_vanilla = require("./Surface.css");
|
|
27
27
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
28
|
-
var pseudoElement = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1qto6jt9-1-
|
|
29
|
-
var surface = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1qto6jt6-1-
|
|
28
|
+
var pseudoElement = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1qto6jt9-1-17-0", variantClassNames: { elevation: { flat: "_1qto6jta-1-17-0", raised: "_1qto6jtb-1-17-0", floating: "_1qto6jtc-1-17-0" }, dragged: { true: "_1qto6jtd-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
29
|
+
var surface = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1qto6jt6-1-17-0", variantClassNames: { selected: { true: "_1qto6jt7-1-17-0", false: "_1qto6jt8-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/strato-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"lang": "lang/uncompiled",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@dynatrace-sdk/units": "^1.
|
|
66
|
+
"@dynatrace-sdk/units": "^1.4.2",
|
|
67
67
|
"@dynatrace/devkit": "^0.3.5",
|
|
68
68
|
"@formatjs/icu-messageformat-parser": "^2.7.8",
|
|
69
|
-
"@vanilla-extract/css": "^1.
|
|
69
|
+
"@vanilla-extract/css": "^1.18.0",
|
|
70
70
|
"@vanilla-extract/dynamic": "^2.1.5",
|
|
71
71
|
"@vanilla-extract/recipes": "^0.5.7",
|
|
72
72
|
"@vanilla-extract/sprinkles": "^1.6.5",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
|
-
"lodash-es": "^4.17.
|
|
74
|
+
"lodash-es": "^4.17.23",
|
|
75
75
|
"use-resize-observer": "^9.1.0",
|
|
76
76
|
"wicg-inert": "^3.1.2"
|
|
77
77
|
},
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"react-dom": "^18.0.0",
|
|
85
85
|
"react-intl": "^6.0.8 || ^7.0.0",
|
|
86
86
|
"react-is": "^18.0.0",
|
|
87
|
-
"@dynatrace/strato-
|
|
88
|
-
"@dynatrace/strato-
|
|
87
|
+
"@dynatrace/strato-icons": "^1.12.0",
|
|
88
|
+
"@dynatrace/strato-design-tokens": "^1.3.1"
|
|
89
89
|
},
|
|
90
90
|
"sideEffects": [
|
|
91
91
|
"./core/components/app-root/AppRoot.css",
|