@dynatrace/strato-components 1.3.0 → 1.5.1
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 +18 -22
- package/buttons/button/Button.js +1 -0
- package/buttons/button/Button.sty.js +5 -4
- package/buttons/button/Label.js +1 -0
- package/buttons/button/Prefix.js +1 -0
- package/buttons/button/Suffix.js +1 -0
- package/buttons/button/types/button-aria.js +1 -0
- package/buttons/button/utils/focus-without-scrolling.js +1 -0
- package/buttons/button/utils/is-virtual-event.js +1 -0
- package/buttons/index.js +1 -0
- package/buttons/intent-button/IntentButton.js +1 -0
- package/buttons/intent-button/useIntentButton.js +1 -0
- package/content/index.js +1 -0
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.js +1 -0
- package/content/progress/ProgressBar.sty.js +6 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.js +1 -0
- package/content/progress/ProgressBarIcon.sty.js +2 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.js +1 -0
- package/content/progress/ProgressBarLabel.sty.js +2 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +1 -0
- package/content/progress/ProgressBarValue.sty.js +2 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +1 -0
- package/content/progress/ProgressCircle.sty.js +6 -5
- package/content/progress/contexts/SharedProgressBarPropsContext.js +1 -0
- package/content/progress/hooks/useProgressAriaProps.js +1 -0
- package/content/progress/hooks/useProgressBarPropsContext.js +1 -0
- package/content/skeleton/Skeleton.css +6 -6
- package/content/skeleton/Skeleton.js +1 -0
- package/content/skeleton/Skeleton.sty.js +2 -1
- package/content/skeleton/SkeletonText.js +1 -0
- package/core/components/app-root/AppRoot.js +1 -0
- package/core/components/app-root/AppRoot.sty.js +1 -0
- package/core/components/focus-scope/FocusScope.js +1 -0
- package/core/contexts/FocusContext.js +1 -0
- package/core/hooks/useActiveElement.js +1 -0
- package/core/hooks/useAriaLabelingProps.js +1 -0
- package/core/hooks/useCurrentTheme.js +1 -0
- package/core/hooks/useFocusContext.js +1 -0
- package/core/hooks/useFontsUpdated.js +1 -0
- package/core/hooks/useId.js +1 -0
- package/core/hooks/useMergeRefs.js +1 -0
- package/core/hooks/useSafeForwardProps.js +1 -0
- package/core/index.js +1 -0
- package/core/providers/FocusProvider.js +1 -0
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.js +3 -2
- package/core/styles/useFocusRing.js +1 -0
- package/core/types/a11y-props.js +1 -0
- package/core/types/data-props.js +1 -0
- package/core/types/dom.js +1 -0
- package/core/types/heading.js +1 -0
- package/core/types/masking-props.js +1 -0
- package/core/types/polymorph.js +1 -0
- package/core/types/styling-props.js +1 -0
- package/core/types/with-children.js +1 -0
- package/core/utils/_is-string-children.js +1 -0
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +3 -2
- package/core/utils/focus-management/attempt-focus.js +1 -0
- package/core/utils/focus-management/focus-first-descendant.js +1 -0
- package/core/utils/focus-management/get-first-focusable-child.js +1 -0
- package/core/utils/focus-management/get-last-focusable-child.js +1 -0
- package/core/utils/focus-management/is-focusable.js +1 -0
- package/core/utils/isBrowser.js +1 -0
- package/core/utils/merge-props.js +1 -0
- package/core/utils/parse-boolean.js +1 -0
- package/core/utils/seed-random.js +1 -0
- package/core/utils/uuidv4.js +1 -0
- package/esm/buttons/button/Button.css +18 -22
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/content/progress/ProgressBar.css +71 -71
- 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.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +6 -6
- package/esm/content/skeleton/Skeleton.sty.js +1 -1
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- 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/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.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.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.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.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -6
- package/esm/typography/external-link/ExternalLink.sty.js +1 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
- package/esm/typography/heading/Heading.css +7 -7
- 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 -1
- package/esm/typography/highlight/Highlight.js +47 -7
- 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 +4 -4
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- 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.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.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.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.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +8 -5
- package/esm/typography/text-ellipsis/TextEllipsis.js +4 -4
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +4 -4
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +2 -2
- package/index.js +9 -8
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.js +1 -0
- package/layouts/container/Container.sty.js +2 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.js +1 -0
- package/layouts/divider/Divider.sty.js +2 -1
- package/layouts/flex/Flex.js +1 -0
- package/layouts/grid/Grid.js +1 -0
- package/layouts/helpers/spacingToCss.js +1 -0
- package/layouts/hooks/useBreakpoint.js +1 -0
- package/layouts/hooks/useLayoutSizeProps.js +1 -0
- package/layouts/hooks/useLayoutStyles.js +1 -0
- package/layouts/hooks/useMarginProps.js +1 -0
- package/layouts/hooks/usePaddingProps.js +1 -0
- package/layouts/index.js +1 -0
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.js +1 -0
- package/layouts/surface/Surface.sty.js +3 -2
- package/layouts/surface/variables.sty.js +2 -1
- package/layouts/types/layout.types.js +1 -0
- package/package.json +5 -5
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +3 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +3 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +2 -1
- package/styles/extract-util.js +1 -0
- package/styles/field.css +153 -153
- package/styles/field.sty.js +3 -2
- package/styles/getFlexStyles.js +1 -0
- package/styles/getGapSprinkles.js +1 -0
- package/styles/getGridFlexPositionSprinkles.js +1 -0
- package/styles/getGridStyles.js +1 -0
- package/styles/getLayoutSizeStyles.js +1 -0
- package/styles/getSpacingSprinkles.js +1 -0
- package/styles/index.js +1 -0
- package/styles/safe-sprinkles.js +1 -0
- package/styles/sprinkle-properties.js +1 -0
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +2 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +2 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.js +1 -0
- package/typography/block-quote/Blockquote.sty.js +2 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.js +1 -0
- package/typography/code/Code.sty.js +2 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.js +1 -0
- package/typography/emphasis/Emphasis.sty.js +2 -1
- package/typography/external-link/ExternalLink.css +6 -6
- package/typography/external-link/ExternalLink.js +1 -0
- package/typography/external-link/ExternalLink.sty.js +2 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.js +1 -0
- package/typography/heading/Heading.sty.js +2 -1
- package/typography/highlight/Highlight.css +2 -1
- package/typography/highlight/Highlight.js +48 -7
- package/typography/highlight/Highlight.sty.js +2 -1
- package/typography/index.js +1 -0
- package/typography/link/Link.css +4 -4
- package/typography/link/Link.js +1 -0
- package/typography/link/Link.sty.js +2 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.js +1 -0
- package/typography/list/List.sty.js +3 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +1 -0
- package/typography/paragraph/Paragraph.sty.js +2 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.js +1 -0
- package/typography/strikethrough/Strikethrough.sty.js +2 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.js +1 -0
- package/typography/strong/Strong.sty.js +2 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +1 -0
- package/typography/text/Text.sty.js +2 -1
- package/typography/text-ellipsis/TextEllipsis.css +8 -5
- package/typography/text-ellipsis/TextEllipsis.js +5 -4
- package/typography/text-ellipsis/TextEllipsis.sty.d.ts +7 -2
- package/typography/text-ellipsis/TextEllipsis.sty.js +5 -4
- package/typography/utils.js +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/highlight/Highlight.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport React, { ReactElement, ReactNode } from 'react';\n\nimport { highlightCSS } from './Highlight.sty.js';\nimport { type DataTestId, type WithChildren } from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Heading component.\n * @public\n */\nexport interface HighlightProps extends WithChildren, DataTestId, MaskingProps {\n /**\n * Either a substring or an array of multiple different substrings that\n * should be highlighted in the projected content.\n * Every occurrence of the string(s) is highlighted accordingly.\n */\n term: string | string[];\n\n /**\n * Property that determines whether the highlighting search is case-sensitive.\n * If set to `true`, the component searches for case sensitive occurrences.\n * @defaultValue false\n */\n caseSensitive?: boolean;\n}\n\nconst HTML_CHARS_OVERRIDES: [RegExp, string][] = [\n [/</g, '<'],\n [/>/g, '>'],\n [/&/g, '&'],\n [/ /g, ' '],\n];\n\n/** Escapes all characters that could be dangerous for a regular expression */\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/** Highlights all occurences of a list of terms within a ReactNode. */\nfunction highlightChildren(\n children: ReactNode,\n term: string | string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n) {\n const terms = (() => {\n if (Array.isArray(term)) {\n return term.filter((t) => t);\n }\n\n return term ? [term] : [];\n })();\n\n return terms.length > 0\n ? React.Children.map(children, (child: ReactNode) =>\n highlightRecursive(\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n )\n : children;\n}\n\n/**\n * Iterates over all children of a ReactNode recursively to look\n * for a list of terms and highlights them.\n */\nfunction highlightRecursive(\n sourceElement: ReactNode,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (!sourceElement) {\n return sourceElement;\n }\n\n if (React.isValidElement(
|
|
5
|
-
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,WAAwC;
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport React, { ReactElement, ReactNode } from 'react';\nimport { FormattedMessage, useIntl, type IntlShape } from 'react-intl';\nimport { isElement } from 'react-is';\n\nimport { highlightCSS } from './Highlight.sty.js';\nimport { type DataTestId, type WithChildren } from '../../core/index.js';\nimport type { MaskingProps } from '../../core/types/masking-props.js';\n\n/**\n * The props for the Heading component.\n * @public\n */\nexport interface HighlightProps extends WithChildren, DataTestId, MaskingProps {\n /**\n * Either a substring or an array of multiple different substrings that\n * should be highlighted in the projected content.\n * Every occurrence of the string(s) is highlighted accordingly.\n */\n term: string | string[];\n\n /**\n * Property that determines whether the highlighting search is case-sensitive.\n * If set to `true`, the component searches for case sensitive occurrences.\n * @defaultValue false\n */\n caseSensitive?: boolean;\n}\n\nconst HTML_CHARS_OVERRIDES: [RegExp, string][] = [\n [/</g, '<'],\n [/>/g, '>'],\n [/&/g, '&'],\n [/ /g, ' '],\n];\n\n/** Escapes all characters that could be dangerous for a regular expression */\nfunction escapeRegExp(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\n\n/** Highlights all occurences of a list of terms within a ReactNode. */\nfunction highlightChildren(\n intl: IntlShape,\n children: ReactNode,\n term: string | string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n) {\n const terms = (() => {\n if (Array.isArray(term)) {\n return term.filter((t) => t);\n }\n\n return term ? [term] : [];\n })();\n\n return terms.length > 0\n ? React.Children.map(children, (child: ReactNode) =>\n highlightRecursive(\n intl,\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n )\n : children;\n}\n\n/**\n * Iterates over all children of a ReactNode recursively to look\n * for a list of terms and highlights them.\n */\nfunction highlightRecursive(\n intl: IntlShape,\n sourceElement: ReactNode,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (!sourceElement) {\n return sourceElement;\n }\n\n let elementToHighlight = sourceElement;\n\n // For `FormattedMessage` components explicitly retrieve its node(s)\n if (\n isElement(elementToHighlight) &&\n elementToHighlight.type &&\n elementToHighlight.type === FormattedMessage\n ) {\n const { id, description, defaultMessage, values } =\n elementToHighlight.props;\n\n const messageDescriptor = {\n id,\n description,\n defaultMessage,\n };\n elementToHighlight = intl.formatMessage(messageDescriptor, values);\n\n if (Array.isArray(elementToHighlight)) {\n return highlightRecursive(\n intl,\n React.createElement(React.Fragment, { children: elementToHighlight }),\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n );\n }\n }\n\n if (React.isValidElement(elementToHighlight)) {\n const children = React.Children.map(\n elementToHighlight.props.children,\n (child) =>\n highlightRecursive(\n intl,\n child,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n ),\n );\n\n return React.cloneElement(\n elementToHighlight,\n elementToHighlight.props,\n children,\n );\n }\n\n return highlightLeafElement(\n elementToHighlight as string | number,\n terms,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n );\n}\n\n/** Highlights parts of the text that match a certain group of terms. */\nfunction highlightLeafElement(\n textContent: string | number,\n terms: string[],\n caseSensitive: boolean,\n dataTestId?: string,\n dataDtrumMask?: boolean,\n dataDtrumAllow?: boolean,\n): ReactNode {\n if (terms.length === 0) {\n return textContent;\n }\n\n const sanitizedTextContent = HTML_CHARS_OVERRIDES.reduce(\n (text, [needle, replacement]) => text.replace(needle, replacement),\n `${textContent}`,\n );\n const termsInLowerCase = terms.map((t) => t.toLowerCase());\n\n return getTextTokens(sanitizedTextContent, terms, caseSensitive).map(\n (token: string) =>\n termsInLowerCase.includes(token.toLowerCase()) ? (\n <mark\n role=\"mark\"\n className={clsx(highlightCSS)}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n >\n {token}\n </mark>\n ) : (\n <span\n style={{\n whiteSpace: 'pre-wrap',\n flex: 'none',\n }}\n >\n {token}\n </span>\n ),\n );\n}\n\n/**\n * Splits text into an array of strings where a given list of terms\n * acts as separator strings.\n */\nfunction getTextTokens(\n textContent: string | number,\n terms: string[],\n caseSensitive: boolean,\n): string[] {\n const flags = caseSensitive ? 'gm' : 'gmi';\n const regExp = new RegExp(\n `(${terms.map((t) => escapeRegExp(t)).join('|')})`,\n flags,\n );\n\n return textContent\n .toString()\n .split(regExp)\n .filter((s) => s.length > 0);\n}\n\n/**\n * Use the `Highlight` component to highlight one or more substrings within a\n * text.\n * @public\n */\nexport const Highlight = (props: HighlightProps): ReactElement => {\n const {\n children,\n term,\n caseSensitive = false,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n } = props;\n const intl = useIntl();\n\n return (\n <>\n {highlightChildren(\n intl,\n children,\n term,\n caseSensitive,\n dataTestId,\n dataDtrumMask,\n dataDtrumAllow,\n )}\n </>\n );\n};\n\n(Highlight as typeof Highlight & { displayName: string }).displayName =\n 'Highlight';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,WAAwC;AAC/C,SAAS,kBAAkB,eAA+B;AAC1D,SAAS,iBAAiB;AAE1B,SAAS,oBAAoB;AAwB7B,MAAM,uBAA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YACJ,SAAS,EACT,MAAM,MAAM,EACZ,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;AAC/B;AAOO,MAAM,YAAY,CAAC,UAAwC;AAChE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB,IAAI;AACJ,QAAM,OAAO,QAAQ;AAErB,SACE,0DACG;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AAEJ;AAEC,UAAyD,cACxD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/highlight/Highlight.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Highlight.css';\nexport var highlightCSS = '_lajjl30-1-
|
|
4
|
+
"sourcesContent": ["import './Highlight.css';\nexport var highlightCSS = '_lajjl30-1-5-1';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
._1iksxp40-1-
|
|
1
|
+
._1iksxp40-1-5-1 {
|
|
2
2
|
display: inline;
|
|
3
3
|
color: var(--dt-colors-text-primary-default, #454cc9);
|
|
4
4
|
text-decoration: underline;
|
|
5
5
|
overflow-wrap: anywhere;
|
|
6
6
|
}
|
|
7
|
-
._1iksxp40-1-
|
|
7
|
+
._1iksxp40-1-5-1:hover {
|
|
8
8
|
color: var(--dt-colors-text-primary-default-hover, #3332ae);
|
|
9
9
|
}
|
|
10
|
-
._1iksxp40-1-
|
|
10
|
+
._1iksxp40-1-5-1:active {
|
|
11
11
|
color: var(--dt-colors-text-primary-default-active, #241193);
|
|
12
12
|
}
|
|
13
|
-
._1iksxp40-1-
|
|
13
|
+
._1iksxp40-1-5-1:focus-visible {
|
|
14
14
|
text-decoration: none;
|
|
15
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/link/Link.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Link.css';\nexport var linkCSS = '_1iksxp40-1-
|
|
4
|
+
"sourcesContent": ["import './Link.css';\nexport var linkCSS = '_1iksxp40-1-5-1';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
._16276mt0-1-
|
|
1
|
+
._16276mt0-1-5-1 {
|
|
2
2
|
margin: 0;
|
|
3
3
|
padding-left: var(--dt-spacings-size-40, 40px);
|
|
4
4
|
}
|
|
5
|
-
._16276mt0-1-
|
|
5
|
+
._16276mt0-1-5-1 ._16276mt0-1-5-1 {
|
|
6
6
|
margin-block: var(--dt-spacings-size-4, 4px);
|
|
7
7
|
padding-left: var(--dt-spacings-size-28, 28px);
|
|
8
8
|
}
|
|
9
|
-
._16276mt1-1-
|
|
9
|
+
._16276mt1-1-5-1 {
|
|
10
10
|
position: relative;
|
|
11
11
|
overflow-wrap: break-word;
|
|
12
12
|
margin-block: var(--dt-spacings-size-2, 2px);
|
|
13
13
|
}
|
|
14
|
-
._16276mt1-1-
|
|
14
|
+
._16276mt1-1-5-1::marker {
|
|
15
15
|
font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/list/List.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './List.css';\nexport var listCSS = '_16276mt0-1-
|
|
4
|
+
"sourcesContent": ["import './List.css';\nexport var listCSS = '_16276mt0-1-5-1';\nexport var listItemCSS = '_16276mt1-1-5-1';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,UAAU;AACd,IAAI,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
._487p2n0-1-
|
|
1
|
+
._487p2n0-1-5-1 {
|
|
2
2
|
margin-top: 0;
|
|
3
3
|
margin-bottom: 0;
|
|
4
4
|
overflow-wrap: break-word;
|
|
5
5
|
color: inherit;
|
|
6
6
|
font-style: normal;
|
|
7
7
|
}
|
|
8
|
-
._487p2n1-1-
|
|
8
|
+
._487p2n1-1-5-1 {
|
|
9
9
|
display: block;
|
|
10
10
|
white-space: nowrap;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
12
|
overflow: hidden;
|
|
13
13
|
}
|
|
14
|
-
._487p2n2-1-
|
|
14
|
+
._487p2n2-1-5-1 {
|
|
15
15
|
display: -webkit-box;
|
|
16
16
|
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
17
17
|
-webkit-box-orient: vertical;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Paragraph.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var paragraphCSS = _7a468({ defaultClassName: "_487p2n0-1-
|
|
3
|
+
var paragraphCSS = _7a468({ defaultClassName: "_487p2n0-1-5-1", variantClassNames: { ellipsis: { singleLine: "_487p2n1-1-5-1", multiLine: "_487p2n2-1-5-1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
4
|
export {
|
|
5
5
|
paragraphCSS
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/paragraph/Paragraph.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Paragraph.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var paragraphCSS = _7a468({defaultClassName:'_487p2n0-1-
|
|
4
|
+
"sourcesContent": ["import './Paragraph.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var paragraphCSS = _7a468({defaultClassName:'_487p2n0-1-5-1',variantClassNames:{ellipsis:{singleLine:'_487p2n1-1-5-1',multiLine:'_487p2n2-1-5-1'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,UAAS,EAAC,YAAW,kBAAiB,WAAU,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/typography/strikethrough/Strikethrough.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Strikethrough.css';\nexport var strikethroughCSS = '_4oao6y0-1-
|
|
4
|
+
"sourcesContent": ["import './Strikethrough.css';\nexport var strikethroughCSS = '_4oao6y0-1-5-1';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,mBAAmB;",
|
|
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-5-1';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACA,IAAI,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
._rup8ap0-1-
|
|
1
|
+
._rup8ap0-1-5-1 {
|
|
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-5-1 {
|
|
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-5-1 {
|
|
14
14
|
display: -webkit-box;
|
|
15
15
|
-webkit-line-clamp: var(--strato-ellipsis-line-clamp);
|
|
16
16
|
-webkit-box-orient: vertical;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./Text.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var textCSS = _7a468({ defaultClassName: "_rup8ap0-1-
|
|
3
|
+
var textCSS = _7a468({ defaultClassName: "_rup8ap0-1-5-1", variantClassNames: { ellipsis: { singleLine: "_rup8ap1-1-5-1", multiLine: "_rup8ap2-1-5-1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
4
|
export {
|
|
5
5
|
textCSS
|
|
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 textCSS = _7a468({defaultClassName:'_rup8ap0-1-
|
|
4
|
+
"sourcesContent": ["import './Text.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var textCSS = _7a468({defaultClassName:'_rup8ap0-1-5-1',variantClassNames:{ellipsis:{singleLine:'_rup8ap1-1-5-1',multiLine:'_rup8ap2-1-5-1'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,UAAU,OAAO,EAAC,kBAAiB,kBAAiB,mBAAkB,EAAC,UAAS,EAAC,YAAW,kBAAiB,WAAU,iBAAgB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
._1mnpbqs1-1-
|
|
1
|
+
._1mnpbqs1-1-5-1 {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
vertical-align: middle;
|
|
@@ -9,15 +9,18 @@
|
|
|
9
9
|
text-decoration: inherit;
|
|
10
10
|
width: 100%;
|
|
11
11
|
}
|
|
12
|
-
._1mnpbqs2-1-
|
|
12
|
+
._1mnpbqs2-1-5-1 {
|
|
13
13
|
text-overflow: ellipsis;
|
|
14
14
|
direction: rtl;
|
|
15
15
|
text-align: left;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
._1mnpbqs2-1-5-1::after {
|
|
18
|
+
content: "";
|
|
19
|
+
}
|
|
20
|
+
._1mnpbqs3-1-5-1 {
|
|
18
21
|
text-overflow: clip;
|
|
19
22
|
}
|
|
20
|
-
._1mnpbqs3-1-
|
|
23
|
+
._1mnpbqs3-1-5-1._1mnpbqs0-1-5-1:after {
|
|
21
24
|
content: attr(data-sourcetext) / "";
|
|
22
25
|
color: transparent;
|
|
23
26
|
display: table;
|
|
@@ -25,6 +28,6 @@
|
|
|
25
28
|
line-height: 0;
|
|
26
29
|
user-select: none;
|
|
27
30
|
}
|
|
28
|
-
._1mnpbqs4-1-
|
|
31
|
+
._1mnpbqs4-1-5-1 {
|
|
29
32
|
text-overflow: ellipsis;
|
|
30
33
|
}
|
|
@@ -8,7 +8,7 @@ import useResizeObserver from "use-resize-observer";
|
|
|
8
8
|
import { useFontsUpdated } from "../../core/hooks/useFontsUpdated.js";
|
|
9
9
|
import { useMergeRefs } from "../../core/hooks/useMergeRefs.js";
|
|
10
10
|
import { centerEllipsizeText } from "../utils.js";
|
|
11
|
-
import
|
|
11
|
+
import { ellipsisCSS, isActiveCSS } from "./TextEllipsis.sty.js";
|
|
12
12
|
function getFontProps(innerSpanElement) {
|
|
13
13
|
const computedStyle = window.getComputedStyle(innerSpanElement, null);
|
|
14
14
|
return {
|
|
@@ -106,8 +106,8 @@ const ComputedTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) =>
|
|
|
106
106
|
"data-testid": dataTestId,
|
|
107
107
|
"data-dtrum-mask": dataDtrumMask,
|
|
108
108
|
"data-dtrum-allow": dataDtrumAllow,
|
|
109
|
-
className: clsx(
|
|
110
|
-
[
|
|
109
|
+
className: clsx(ellipsisCSS({ truncationMode }), consumerClassName, {
|
|
110
|
+
[isActiveCSS]: ellipsisStateRef.current
|
|
111
111
|
}),
|
|
112
112
|
style: consumerStyle,
|
|
113
113
|
...remainingProps
|
|
@@ -132,7 +132,7 @@ const CssTextEllipsis = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
132
132
|
"aria-label": children,
|
|
133
133
|
"data-ellipsis": true,
|
|
134
134
|
"data-testid": dataTestId,
|
|
135
|
-
className: clsx(
|
|
135
|
+
className: clsx(ellipsisCSS({ truncationMode }), consumerClassName),
|
|
136
136
|
style: consumerStyle,
|
|
137
137
|
...remainingProps
|
|
138
138
|
},
|
|
@@ -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 React, {\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
|
|
5
|
-
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO;AAAA,EACL;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,OAAO,uBAAuB;AAE9B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAI7B,SAAS,2BAAsC;AAC/C,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport React, {\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 { ellipsisCSS, isActiveCSS } from './TextEllipsis.sty.js';\n\n/**\n * Available modes for how overly long text is truncated and where the ellipsis is placed.\n * @internal\n */\nexport type TruncationMode = 'start' | 'middle' | 'end';\n\n/**\n * The props for the TextEllipsis component.\n * @public\n */\nexport interface TextEllipsisProps\n extends HTMLAttributes<HTMLSpanElement>,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** The children (as text) passed to the component. */\n children: string;\n /**\n * The mode used for for truncating the text, either at the start, in the middle or at the end.\n * @defaultValue 'end'\n */\n truncationMode?: 'start' | 'middle' | 'end';\n /** Gets called when text needs to get truncated due to lack of horizontal space. */\n onTextOverflow?: (ellipsized: boolean) => void;\n}\n\n/**\n * Returns an object containing all font-related CSS properties from\n * a given DOM element that are relevant for rendering formatted text\n * in a 2D canvas context.\n *\n * @param 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>,\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(ellipsisCSS({ truncationMode }), consumerClassName, {\n [isActiveCSS]: 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(ellipsisCSS({ 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 /* eslint-disable-next-line deprecated-jsx-props/deprecated-props -- The plugin can not properly analyze spread props:\n https://github.com/sebakerckhof/eslint-plugin-deprecated-jsx-props?tab=readme-ov-file#configuration, the deprecations here are in the HTMLAttributes type, which is fine. */\n <CssTextEllipsis ref={forwardedRef} {...props} />\n ) : (\n /* eslint-disable-next-line deprecated-jsx-props/deprecated-props -- The plugin can not properly analyze spread props:\n https://github.com/sebakerckhof/eslint-plugin-deprecated-jsx-props?tab=readme-ov-file#configuration, the deprecations here are in the HTMLAttributes type, which is fine. */\n <ComputedTextEllipsis ref={forwardedRef} {...props} />\n );\n});\n\n(TextEllipsis as typeof TextEllipsis & { displayName: string }).displayName =\n 'TextEllipsis';\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO;AAAA,EACL;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,OAAO,uBAAuB;AAE9B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAI7B,SAAS,2BAAsC;AAC/C,SAAS,aAAa,mBAAmB;AAmCzC,SAAS,aAAa,kBAAyC;AAC7D,QAAM,gBAAgB,OAAO,iBAAiB,kBAAkB,IAAI;AAEpE,SAAO;AAAA,IACL,WAAW,cAAc,iBAAiB,YAAY;AAAA,IACtD,YAAY,cAAc,iBAAiB,aAAa;AAAA,IACxD,UAAU,cAAc,iBAAiB,WAAW;AAAA,IACpD,YAAY,cAAc,iBAAiB,aAAa;AAAA,EAC1D;AACF;AAMA,SAAS,uBACP,kBACA,gBACS;AAGT,QAAM,oBAAoB,KAAK;AAAA,IAC7B,iBAAiB,sBAAsB,EAAE;AAAA,IACzC,iBAAiB;AAAA,EACnB;AACA,QAAM,YAAY,KAAK,MAAM,oBAAoB,GAAG,IAAI;AAExD,SAAO,YAAY;AACrB;AAEA,SAAS,cACP,kBACA,cACA;AACA,MAAI,iBAAiB,gBAAgB,cAAc;AACjD,qBAAiB,cAAc;AAAA,EACjC;AACF;AAEA,SAAS,SAAS,SAA0B;AAC1C,SAAO,KAAK,IAAI,QAAQ,sBAAsB,EAAE,OAAO,QAAQ,WAAW;AAC5E;AAEA,SAAS,kBAAkB,kBAAmC;AAC5D,SAAO,KAAK,KAAK,SAAS,gBAAgB,IAAI,GAAG,IAAI;AACvD;AAEA,SAAS,uBACP,SACA,eACA,gBACA;AACA,MAAI,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import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var ellipsisCSS = _7a468({ defaultClassName: "_1mnpbqs1-1-5-1", variantClassNames: { truncationMode: { start: "_1mnpbqs2-1-5-1", middle: "_1mnpbqs3-1-5-1", end: "_1mnpbqs4-1-5-1" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
var isActiveCSS = "_1mnpbqs0-1-5-1";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
ellipsisCSS,
|
|
7
|
+
isActiveCSS
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=TextEllipsis.sty.js.map
|
|
@@ -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
|
|
5
|
-
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,
|
|
4
|
+
"sourcesContent": ["import './TextEllipsis.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var ellipsisCSS = _7a468({defaultClassName:'_1mnpbqs1-1-5-1',variantClassNames:{truncationMode:{start:'_1mnpbqs2-1-5-1',middle:'_1mnpbqs3-1-5-1',end:'_1mnpbqs4-1-5-1'}},defaultVariants:{},compoundVariants:[]});\nexport var isActiveCSS = '_1mnpbqs0-1-5-1';"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,cAAc,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,gBAAe,EAAC,OAAM,mBAAkB,QAAO,mBAAkB,KAAI,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AAChN,IAAI,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -12,11 +13,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
12
13
|
};
|
|
13
14
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var
|
|
16
|
-
module.exports = __toCommonJS(
|
|
17
|
-
__reExport(
|
|
18
|
-
__reExport(
|
|
19
|
-
__reExport(
|
|
20
|
-
__reExport(
|
|
21
|
-
__reExport(
|
|
22
|
-
__reExport(
|
|
16
|
+
var index_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(index_exports);
|
|
18
|
+
__reExport(index_exports, require("./buttons/index.js"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./core/index.js"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./content/index.js"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./layouts/index.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./styles/index.js"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./typography/index.js"), module.exports);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
._f32lcd0-1-
|
|
1
|
+
._f32lcd0-1-5-1 {
|
|
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, 12px);
|
|
5
|
-
color: var(--_6levse0-1-
|
|
6
|
-
border-color: var(--_6levse2-1-
|
|
7
|
-
background-color: var(--_6levse1-1-
|
|
5
|
+
color: var(--_6levse0-1-5-1);
|
|
6
|
+
border-color: var(--_6levse2-1-5-1);
|
|
7
|
+
background-color: var(--_6levse1-1-5-1);
|
|
8
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -22,4 +23,4 @@ __export(Container_css_exports, {
|
|
|
22
23
|
module.exports = __toCommonJS(Container_css_exports);
|
|
23
24
|
var import_container_css_ts_vanilla = require("../../styles/container.css");
|
|
24
25
|
var import_Container_css_ts_vanilla = require("./Container.css");
|
|
25
|
-
var containerCSS = "_f32lcd0-1-
|
|
26
|
+
var containerCSS = "_f32lcd0-1-5-1";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
._1thxv8m0-1-
|
|
1
|
+
._1thxv8m0-1-5-1 {
|
|
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-5-1);
|
|
6
6
|
}
|
|
7
|
-
._1thxv8m1-1-
|
|
7
|
+
._1thxv8m1-1-5-1 {
|
|
8
8
|
width: 100%;
|
|
9
9
|
height: var(--dt-borders-width-default, 1px);
|
|
10
10
|
}
|
|
11
|
-
._1thxv8m2-1-
|
|
11
|
+
._1thxv8m2-1-5-1 {
|
|
12
12
|
width: var(--dt-borders-width-default, 1px);
|
|
13
13
|
height: 100%;
|
|
14
14
|
}
|
|
15
|
-
._1thxv8m5-1-
|
|
15
|
+
._1thxv8m5-1-5-1 {
|
|
16
16
|
flex-shrink: 0;
|
|
17
17
|
}
|
|
18
|
-
._1thxv8m6-1-
|
|
18
|
+
._1thxv8m6-1-5-1 {
|
|
19
19
|
flex-shrink: 0;
|
|
20
20
|
width: var(--dt-borders-width-default, 1px);
|
|
21
21
|
height: auto;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -23,4 +24,4 @@ module.exports = __toCommonJS(Divider_css_exports);
|
|
|
23
24
|
var import_colorUtils_css_ts_vanilla = require("../../core/utils/colorUtils.css");
|
|
24
25
|
var import_Divider_css_ts_vanilla = require("./Divider.css");
|
|
25
26
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
26
|
-
var dividerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1thxv8m0-1-
|
|
27
|
+
var dividerCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_1thxv8m0-1-5-1", variantClassNames: { orientation: { horizontal: "_1thxv8m1-1-5-1", vertical: "_1thxv8m2-1-5-1" }, flexItem: { true: "_1thxv8m3-1-5-1", false: "_1thxv8m4-1-5-1" } }, defaultVariants: {}, compoundVariants: [[{ orientation: "horizontal", flexItem: false }, "_1thxv8m5-1-5-1"], [{ orientation: "vertical", flexItem: true }, "_1thxv8m6-1-5-1"]] });
|
package/layouts/flex/Flex.js
CHANGED
package/layouts/grid/Grid.js
CHANGED
package/layouts/index.js
CHANGED