@dynatrace/strato-components 1.16.1 → 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 +12 -9
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/intent-button/IntentButton.d.ts +2 -0
- 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/index.d.ts +1 -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/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 +12 -9
- 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.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/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/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 +3 -3
- 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.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/progress/ProgressCircle.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { type CSSProperties, forwardRef } from 'react';\n\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport {\n progressCircleBackgroundCSS,\n progressCircleContainerCSS,\n progressCircleCSS,\n progressCircleRootCSS,\n progressCircleSvgCss,\n} from './ProgressCircle.sty.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { useContainerColoring } from '../../layouts/container/Container.js';\nimport { containerColorsCSS } from '../../styles/container.sty.js';\nimport { textStyle } from '../../styles/textStyle.sty.js';\n\n/**\n * Accepted properties for ProgressCircle.\n * @public\n */\nexport interface ProgressCircleProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The smallest allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the size of the rendered progress.\n * @defaultValue 'large'\n */\n size?: 'small' | 'large';\n /**\n * Controls the color of the progress.\n * @defaultValue 'primary' or a container's color.\n */\n color?: 'neutral' | 'primary' | 'success' | 'warning' | 'critical';\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * Default the value as percentage will be provided. If the value is not a percentage please provide the aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\nconst progressCircleSizes = {\n small: 20,\n large: 40,\n};\nconst progressCircleThickness = 5;\n\n/**\n * The `ProgressCircle` component is used to indicate the progress or completion status of a task or process.\n * @public\n * */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n min = 0,\n max = 100,\n size = 'large',\n color,\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressCircleProps = props;\n\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n\n const containerColoring = useContainerColoring();\n const derivedVariant =\n containerColoring.variant === 'accent' ? 'accent' : 'default';\n\n // for the color in the ProgressCircle the fallback logic is a bit different - usually\n // the fallback from the container is \"neutral\" - but in the case of the progress circle the default\n // fallback color is \"primary\"\n const fallbackColor = containerColoring.default\n ? 'primary'\n : containerColoring.color;\n const derivedColor = color ?? fallbackColor;\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId();\n const id = propId ?? generatedId;\n\n const circleStyles: CSSProperties = {};\n const rootProps = {};\n\n if (!isIndeterminate && value !== undefined) {\n const circumference =\n 2 *\n Math.PI *\n ((progressCircleSizes[size] - progressCircleThickness) / 2);\n circleStyles['strokeDasharray'] = circumference.toFixed(3);\n const dashOffset = Number(\n (((max - value) / max) * circumference).toFixed(3),\n );\n circleStyles['strokeDashoffset'] = `${\n dashOffset >= 0 ? dashOffset : 0\n }px`;\n }\n\n if (\n !children &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n return (\n <div\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n className={clsx(\n consumerClassName,\n containerColorsCSS({\n color: derivedColor,\n variant: derivedVariant,\n }),\n progressCircleContainerCSS({\n size,\n color: derivedColor,\n variant: derivedVariant,\n }),\n )}\n style={consumerStyle}\n {...forwardProps}\n >\n <span\n id={id}\n className={clsx(progressCircleRootCSS)}\n style={{\n height: `${progressCircleSizes[size]}px`,\n width: `${progressCircleSizes[size]}px`,\n }}\n {...ariaLabelingProps}\n {...progressAriaProps}\n {...rootProps}\n >\n <svg\n className={progressCircleSvgCss}\n viewBox={`0 0 ${progressCircleSizes[size]} ${progressCircleSizes[size]}`}\n width=\"100%\"\n height=\"100%\"\n >\n <circle\n fill=\"none\"\n className={clsx(progressCircleBackgroundCSS)}\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n <circle\n style={circleStyles}\n className={progressCircleCSS({ indeterminate: isIndeterminate })}\n fill=\"none\"\n pathLength={\n isIndeterminate ? 360 : circleStyles['strokeDasharray']\n }\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n </svg>\n </span>\n {children && (\n <label\n className={clsx(\n textStyle({ textStyle: size === 'small' ? 'small' : 'base' }),\n )}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </div>\n );\n },\n);\n\n(\n ProgressCircle as typeof ProgressCircle & { displayName: string }\n).displayName =
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { type CSSProperties, forwardRef } from 'react';\n\nimport { useProgressAriaProps } from './hooks/useProgressAriaProps.js';\nimport {\n progressCircleBackgroundCSS,\n progressCircleContainerCSS,\n progressCircleCSS,\n progressCircleRootCSS,\n progressCircleSvgCss,\n} from './ProgressCircle.sty.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { useSafeForwardProps } from '../../core/hooks/useSafeForwardProps.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 StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { useContainerColoring } from '../../layouts/container/Container.js';\nimport { containerColorsCSS } from '../../styles/container.sty.js';\nimport { textStyle } from '../../styles/textStyle.sty.js';\n\nconst COMPONENT_NAME = 'ProgressCircle';\n\n/**\n * Accepted properties for ProgressCircle.\n * @public\n */\nexport interface ProgressCircleProps\n extends WithChildren,\n DOMProps,\n AriaLabelingProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * The current value.\n * @defaultValue 'indeterminate'\n */\n value?: number | 'indeterminate';\n /**\n * The smallest allowed value.\n * @defaultValue 0\n */\n min?: number;\n /**\n * The maximum allowed value.\n * @defaultValue 100\n */\n max?: number;\n /**\n * Controls the size of the rendered progress.\n * @defaultValue 'large'\n */\n size?: 'small' | 'large';\n /**\n * Controls the color of the progress.\n * @defaultValue 'primary' or a container's color.\n */\n color?: 'neutral' | 'primary' | 'success' | 'warning' | 'critical';\n /**\n * The aria-valuetext attribute defines the human-readable text alternative of aria-valuenow for a range widget.\n * Default the value as percentage will be provided. If the value is not a percentage please provide the aria-valuetext.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext\n * @defaultValue the value of the progress as percentage.\n */\n 'aria-valuetext'?: string;\n}\n\nconst progressCircleSizes = {\n small: 20,\n large: 40,\n};\nconst progressCircleThickness = 5;\n\n/**\n * The `ProgressCircle` component is used to indicate the progress or completion status of a task or process.\n * @public\n * */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (props, forwardedRef) => {\n const {\n value: originalValue,\n min = 0,\n max = 100,\n size = 'large',\n color,\n children,\n id: propId,\n 'aria-valuetext': ariaValuetext,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n ...remainingProps\n }: ProgressCircleProps = props;\n\n const { value, isIndeterminate, progressAriaProps } = useProgressAriaProps(\n originalValue,\n min,\n max,\n ariaValuetext,\n );\n\n const containerColoring = useContainerColoring();\n const derivedVariant =\n containerColoring.variant === 'accent' ? 'accent' : 'default';\n\n // for the color in the ProgressCircle the fallback logic is a bit different - usually\n // the fallback from the container is \"neutral\" - but in the case of the progress circle the default\n // fallback color is \"primary\"\n const fallbackColor = containerColoring.default\n ? 'primary'\n : containerColoring.color;\n const derivedColor = color ?? fallbackColor;\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n const forwardProps = useSafeForwardProps(remainingProps, ariaLabelingProps);\n\n const generatedId = useId();\n const id = propId ?? generatedId;\n\n const circleStyles: CSSProperties = {};\n const rootProps = {};\n\n if (!isIndeterminate && value !== undefined) {\n const circumference =\n 2 *\n Math.PI *\n ((progressCircleSizes[size] - progressCircleThickness) / 2);\n circleStyles['strokeDasharray'] = circumference.toFixed(3);\n const dashOffset = Number(\n (((max - value) / max) * circumference).toFixed(3),\n );\n circleStyles['strokeDashoffset'] = `${\n dashOffset >= 0 ? dashOffset : 0\n }px`;\n }\n\n if (\n !children &&\n !ariaLabelingProps['aria-label'] &&\n !ariaLabelingProps['aria-labelledby']\n ) {\n process.env.NODE_ENV === 'development' &&\n // eslint-disable-next-line no-console\n console.warn(\n 'If no label is provided please make sure to provide an aria label on your progressCircle element.',\n );\n }\n\n return (\n <div\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n ref={forwardedRef}\n className={clsx(\n consumerClassName,\n containerColorsCSS({\n color: derivedColor,\n variant: derivedVariant,\n }),\n progressCircleContainerCSS({\n size,\n color: derivedColor,\n variant: derivedVariant,\n }),\n )}\n style={consumerStyle}\n {...forwardProps}\n data-dt-component={COMPONENT_NAME}\n >\n <span\n id={id}\n className={clsx(progressCircleRootCSS)}\n style={{\n height: `${progressCircleSizes[size]}px`,\n width: `${progressCircleSizes[size]}px`,\n }}\n {...ariaLabelingProps}\n {...progressAriaProps}\n {...rootProps}\n >\n <svg\n className={progressCircleSvgCss}\n viewBox={`0 0 ${progressCircleSizes[size]} ${progressCircleSizes[size]}`}\n width=\"100%\"\n height=\"100%\"\n >\n <circle\n fill=\"none\"\n className={clsx(progressCircleBackgroundCSS)}\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n <circle\n style={circleStyles}\n className={progressCircleCSS({ indeterminate: isIndeterminate })}\n fill=\"none\"\n pathLength={\n isIndeterminate ? 360 : circleStyles['strokeDasharray']\n }\n cx={progressCircleSizes[size] / 2}\n cy={progressCircleSizes[size] / 2}\n r={(progressCircleSizes[size] - progressCircleThickness) / 2}\n strokeWidth={progressCircleThickness}\n />\n </svg>\n </span>\n {children && (\n <label\n className={clsx(\n textStyle({ textStyle: size === 'small' ? 'small' : 'base' }),\n )}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </div>\n );\n },\n);\n\n(\n ProgressCircle as typeof ProgressCircle & { displayName: string }\n).displayName = COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AA2LU,SAME,KANF;AA3LV,OAAO,UAAU;AACjB,SAA6B,kBAAkB;AAE/C,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,aAAa;AACtB,SAAS,2BAA2B;AAOpC,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAE1B,MAAM,iBAAiB;AA+CvB,MAAM,sBAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,OAAO;AACT;AACA,MAAM,0BAA0B;AAMzB,MAAM,iBAAiB;AAAA,EAC5B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,IAAI;AAAA,MACJ,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,GAAG;AAAA,IACL,IAAyB;AAEzB,UAAM,EAAE,OAAO,iBAAiB,kBAAkB,IAAI;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,UAAM,oBAAoB,qBAAqB;AAC/C,UAAM,iBACJ,kBAAkB,YAAY,WAAW,WAAW;AAKtD,UAAM,gBAAgB,kBAAkB,UACpC,YACA,kBAAkB;AACtB,UAAM,eAAe,SAAS;AAE9B,UAAM,oBAAoB,qBAAqB,cAAc;AAC7D,UAAM,eAAe,oBAAoB,gBAAgB,iBAAiB;AAE1E,UAAM,cAAc,MAAM;AAC1B,UAAM,KAAK,UAAU;AAErB,UAAM,eAA8B,CAAC;AACrC,UAAM,YAAY,CAAC;AAEnB,QAAI,CAAC,mBAAmB,UAAU,QAAW;AAC3C,YAAM,gBACJ,IACA,KAAK,OACH,oBAAoB,IAAI,IAAI,2BAA2B;AAC3D,mBAAa,iBAAiB,IAAI,cAAc,QAAQ,CAAC;AACzD,YAAM,aAAa;AAAA,UACd,MAAM,SAAS,MAAO,eAAe,QAAQ,CAAC;AAAA,MACnD;AACA,mBAAa,kBAAkB,IAAI,GACjC,cAAc,IAAI,aAAa,CACjC;AAAA,IACF;AAEA,QACE,CAAC,YACD,CAAC,kBAAkB,YAAY,KAC/B,CAAC,kBAAkB,iBAAiB,GACpC;AACA;AAAA,MAEE,QAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,KAAK;AAAA,QACL,WAAW;AAAA,UACT;AAAA,UACA,mBAAmB;AAAA,YACjB,OAAO;AAAA,YACP,SAAS;AAAA,UACX,CAAC;AAAA,UACD,2BAA2B;AAAA,YACzB;AAAA,YACA,OAAO;AAAA,YACP,SAAS;AAAA,UACX,CAAC;AAAA,QACH;AAAA,QACA,OAAO;AAAA,QACN,GAAG;AAAA,QACJ,qBAAmB;AAAA,QAEnB;AAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,WAAW,KAAK,qBAAqB;AAAA,cACrC,OAAO;AAAA,gBACL,QAAQ,GAAG,oBAAoB,IAAI,CAAC;AAAA,gBACpC,OAAO,GAAG,oBAAoB,IAAI,CAAC;AAAA,cACrC;AAAA,cACC,GAAG;AAAA,cACH,GAAG;AAAA,cACH,GAAG;AAAA,cAEJ;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW;AAAA,kBACX,SAAS,OAAO,oBAAoB,IAAI,CAAC,IAAI,oBAAoB,IAAI,CAAC;AAAA,kBACtE,OAAM;AAAA,kBACN,QAAO;AAAA,kBAEP;AAAA;AAAA,sBAAC;AAAA;AAAA,wBACC,MAAK;AAAA,wBACL,WAAW,KAAK,2BAA2B;AAAA,wBAC3C,IAAI,oBAAoB,IAAI,IAAI;AAAA,wBAChC,IAAI,oBAAoB,IAAI,IAAI;AAAA,wBAChC,IAAI,oBAAoB,IAAI,IAAI,2BAA2B;AAAA,wBAC3D,aAAa;AAAA;AAAA,oBACf;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO;AAAA,wBACP,WAAW,kBAAkB,EAAE,eAAe,gBAAgB,CAAC;AAAA,wBAC/D,MAAK;AAAA,wBACL,YACE,kBAAkB,MAAM,aAAa,iBAAiB;AAAA,wBAExD,IAAI,oBAAoB,IAAI,IAAI;AAAA,wBAChC,IAAI,oBAAoB,IAAI,IAAI;AAAA,wBAChC,IAAI,oBAAoB,IAAI,IAAI,2BAA2B;AAAA,wBAC3D,aAAa;AAAA;AAAA,oBACf;AAAA;AAAA;AAAA,cACF;AAAA;AAAA,UACF;AAAA,UACC,YACC;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT,UAAU,EAAE,WAAW,SAAS,UAAU,UAAU,OAAO,CAAC;AAAA,cAC9D;AAAA,cACA,SAAS;AAAA,cAER;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAGE,eACA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./ProgressCircle.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var progressCircleBackgroundCSS = "_kvldjh9-1-
|
|
4
|
-
var progressCircleCSS = _7a468({ defaultClassName: "_kvldjh6-1-
|
|
5
|
-
var progressCircleContainerCSS = _7a468({ defaultClassName: "_kvldjha-1-
|
|
6
|
-
var progressCircleRootCSS = "_kvldjh4-1-
|
|
7
|
-
var progressCircleSvgCss = "_kvldjh5-1-
|
|
3
|
+
var progressCircleBackgroundCSS = "_kvldjh9-1-17-0";
|
|
4
|
+
var progressCircleCSS = _7a468({ defaultClassName: "_kvldjh6-1-17-0", variantClassNames: { indeterminate: { true: "_kvldjh7-1-17-0", false: "_kvldjh8-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5
|
+
var progressCircleContainerCSS = _7a468({ defaultClassName: "_kvldjha-1-17-0", variantClassNames: { size: { small: "_kvldjhb-1-17-0", large: "_kvldjhc-1-17-0" }, color: { critical: "_kvldjhd-1-17-0", neutral: "_kvldjhe-1-17-0", primary: "_kvldjhf-1-17-0", success: "_kvldjhg-1-17-0", warning: "_kvldjhh-1-17-0" }, variant: { "default": "_kvldjhi-1-17-0", accent: "_kvldjhj-1-17-0" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "_kvldjhk-1-17-0"], [{ color: "success", variant: "accent" }, "_kvldjhl-1-17-0"], [{ color: "warning", variant: "accent" }, "_kvldjhm-1-17-0"], [{ color: "critical", variant: "accent" }, "_kvldjhn-1-17-0"], [{ color: "neutral", variant: "accent" }, "_kvldjho-1-17-0"]] });
|
|
6
|
+
var progressCircleRootCSS = "_kvldjh4-1-17-0";
|
|
7
|
+
var progressCircleSvgCss = "_kvldjh5-1-17-0";
|
|
8
8
|
export {
|
|
9
9
|
progressCircleBackgroundCSS,
|
|
10
10
|
progressCircleCSS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/progress/ProgressCircle.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './ProgressCircle.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var progressCircleBackgroundCSS = '_kvldjh9-1-
|
|
4
|
+
"sourcesContent": ["import './ProgressCircle.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var progressCircleBackgroundCSS = '_kvldjh9-1-17-0';\nexport var progressCircleCSS = _7a468({defaultClassName:'_kvldjh6-1-17-0',variantClassNames:{indeterminate:{true:'_kvldjh7-1-17-0',false:'_kvldjh8-1-17-0'}},defaultVariants:{},compoundVariants:[]});\nexport var progressCircleContainerCSS = _7a468({defaultClassName:'_kvldjha-1-17-0',variantClassNames:{size:{small:'_kvldjhb-1-17-0',large:'_kvldjhc-1-17-0'},color:{critical:'_kvldjhd-1-17-0',neutral:'_kvldjhe-1-17-0',primary:'_kvldjhf-1-17-0',success:'_kvldjhg-1-17-0',warning:'_kvldjhh-1-17-0'},variant:{'default':'_kvldjhi-1-17-0',accent:'_kvldjhj-1-17-0'}},defaultVariants:{},compoundVariants:[[{color:'primary',variant:'accent'},'_kvldjhk-1-17-0'],[{color:'success',variant:'accent'},'_kvldjhl-1-17-0'],[{color:'warning',variant:'accent'},'_kvldjhm-1-17-0'],[{color:'critical',variant:'accent'},'_kvldjhn-1-17-0'],[{color:'neutral',variant:'accent'},'_kvldjho-1-17-0']]});\nexport var progressCircleRootCSS = '_kvldjh4-1-17-0';\nexport var progressCircleSvgCss = '_kvldjh5-1-17-0';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,8BAA8B;AAClC,IAAI,oBAAoB,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,eAAc,EAAC,MAAK,mBAAkB,OAAM,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AAC7L,IAAI,6BAA6B,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,MAAK,EAAC,OAAM,mBAAkB,OAAM,kBAAiB,GAAE,OAAM,EAAC,UAAS,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,kBAAiB,GAAE,SAAQ,EAAC,WAAU,mBAAkB,QAAO,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,iBAAiB,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,iBAAiB,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,iBAAiB,GAAE,CAAC,EAAC,OAAM,YAAW,SAAQ,SAAQ,GAAE,iBAAiB,GAAE,CAAC,EAAC,OAAM,WAAU,SAAQ,SAAQ,GAAE,iBAAiB,CAAC,EAAC,CAAC;AAC3pB,IAAI,wBAAwB;AAC5B,IAAI,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
._1a1ozfd0-1-
|
|
1
|
+
._1a1ozfd0-1-17-0 {
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
}
|
|
5
|
-
._1a1ozfd1-1-
|
|
5
|
+
._1a1ozfd1-1-17-0 {
|
|
6
6
|
border-radius: var(--dt-borders-radius-container-subdued, 6px);
|
|
7
7
|
}
|
|
8
|
-
._1a1ozfd2-1-
|
|
8
|
+
._1a1ozfd2-1-17-0 {
|
|
9
9
|
border-radius: 9999px;
|
|
10
10
|
}
|
|
11
|
-
._1a1ozfd3-1-
|
|
11
|
+
._1a1ozfd3-1-17-0 {
|
|
12
12
|
width: 100%;
|
|
13
13
|
height: 100%;
|
|
14
14
|
}
|
|
15
|
-
._1a1ozfd4-1-
|
|
15
|
+
._1a1ozfd4-1-17-0 stop {
|
|
16
16
|
stop-color: var(--dt-colors-background-field-neutral-disabled, #e4e5eb80);
|
|
17
17
|
}
|
|
18
|
-
._1a1ozfd5-1-
|
|
18
|
+
._1a1ozfd5-1-17-0 {
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
fill: var(--dt-colors-background-field-neutral-disabled, #e4e5eb80);
|
|
22
22
|
}
|
|
23
23
|
@media (prefers-reduced-motion) {
|
|
24
|
-
._1a1ozfd6-1-
|
|
24
|
+
._1a1ozfd6-1-17-0 {
|
|
25
25
|
display: contents;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -4,6 +4,7 @@ import { forwardRef } from "react";
|
|
|
4
4
|
import { skeletonPlaceholderCSS, skeletonSvgCSS } from "./Skeleton.sty.js";
|
|
5
5
|
import { SkeletonDrawer, SkeletonGradient } from "./utils.js";
|
|
6
6
|
import { useId } from "../../core/hooks/useId.js";
|
|
7
|
+
const COMPONENT_NAME = "Skeleton";
|
|
7
8
|
const Skeleton = forwardRef(
|
|
8
9
|
(props, forwardedRef) => {
|
|
9
10
|
const {
|
|
@@ -25,6 +26,7 @@ const Skeleton = forwardRef(
|
|
|
25
26
|
className: clsx(skeletonPlaceholderCSS({ variant }), consumerClassName),
|
|
26
27
|
style: { width, height, ...consumerStyle },
|
|
27
28
|
...remainingProps,
|
|
29
|
+
"data-dt-component": COMPONENT_NAME,
|
|
28
30
|
children: [
|
|
29
31
|
/* @__PURE__ */ jsxs("svg", { className: skeletonSvgCSS, children: [
|
|
30
32
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(SkeletonGradient, { id: gradientId }) }),
|
|
@@ -36,6 +38,7 @@ const Skeleton = forwardRef(
|
|
|
36
38
|
);
|
|
37
39
|
}
|
|
38
40
|
);
|
|
41
|
+
Skeleton.displayName = COMPONENT_NAME;
|
|
39
42
|
export {
|
|
40
43
|
Skeleton
|
|
41
44
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/skeleton/Skeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { type CSSProperties, forwardRef } from 'react';\n\nimport { skeletonPlaceholderCSS, skeletonSvgCSS } from './Skeleton.sty.js';\nimport { SkeletonDrawer, SkeletonGradient } from './utils.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\n\n/**\n * Accepted properties for Skeleton\n * @public\n */\nexport interface SkeletonProps extends WithChildren, StylingProps, DataTestId {\n /**\n * Defines the shape of the Skeleton.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'rounded';\n /**\n * Width of the Skeleton placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Height of the Skeleton placeholder.\n * @defaultValue 100%\n */\n height?: CSSProperties['height'];\n}\n\n/**\n * The `Skeleton` component renders a colored block with an animated background, indicating that something is loading.\n * @public\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n (props, forwardedRef) => {\n const {\n children,\n variant = 'default',\n width = '100%',\n height = '100%',\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonProps = props;\n\n const gradientId = useId();\n\n return (\n <div\n data-testid={dataTestId}\n ref={forwardedRef}\n className={clsx(skeletonPlaceholderCSS({ variant }), consumerClassName)}\n style={{ width: width, height: height, ...consumerStyle }}\n {...remainingProps}\n >\n <svg className={skeletonSvgCSS}>\n <defs>\n <SkeletonGradient id={gradientId} />\n </defs>\n\n <SkeletonDrawer gradientId={gradientId} />\n </svg>\n\n {children}\n </div>\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { type CSSProperties, forwardRef } from 'react';\n\nimport { skeletonPlaceholderCSS, skeletonSvgCSS } from './Skeleton.sty.js';\nimport { SkeletonDrawer, SkeletonGradient } from './utils.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\n\nconst COMPONENT_NAME = 'Skeleton';\n\n/**\n * Accepted properties for Skeleton\n * @public\n */\nexport interface SkeletonProps extends WithChildren, StylingProps, DataTestId {\n /**\n * Defines the shape of the Skeleton.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'rounded';\n /**\n * Width of the Skeleton placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Height of the Skeleton placeholder.\n * @defaultValue 100%\n */\n height?: CSSProperties['height'];\n}\n\n/**\n * The `Skeleton` component renders a colored block with an animated background, indicating that something is loading.\n * @public\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n (props, forwardedRef) => {\n const {\n children,\n variant = 'default',\n width = '100%',\n height = '100%',\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonProps = props;\n\n const gradientId = useId();\n\n return (\n <div\n data-testid={dataTestId}\n ref={forwardedRef}\n className={clsx(skeletonPlaceholderCSS({ variant }), consumerClassName)}\n style={{ width: width, height: height, ...consumerStyle }}\n {...remainingProps}\n data-dt-component={COMPONENT_NAME}\n >\n <svg className={skeletonSvgCSS}>\n <defs>\n <SkeletonGradient id={gradientId} />\n </defs>\n\n <SkeletonDrawer gradientId={gradientId} />\n </svg>\n\n {children}\n </div>\n );\n },\n);\n\n(Skeleton as typeof Skeleton & { displayName: string }).displayName =\n COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AA8DQ,SAEI,KAFJ;AA9DR,OAAO,UAAU;AACjB,SAA6B,kBAAkB;AAE/C,SAAS,wBAAwB,sBAAsB;AACvD,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,aAAa;AAKtB,MAAM,iBAAiB;AA4BhB,MAAM,WAAW;AAAA,EACtB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,GAAG;AAAA,IACL,IAAmB;AAEnB,UAAM,aAAa,MAAM;AAEzB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,KAAK;AAAA,QACL,WAAW,KAAK,uBAAuB,EAAE,QAAQ,CAAC,GAAG,iBAAiB;AAAA,QACtE,OAAO,EAAE,OAAc,QAAgB,GAAG,cAAc;AAAA,QACvD,GAAG;AAAA,QACJ,qBAAmB;AAAA,QAEnB;AAAA,+BAAC,SAAI,WAAW,gBACd;AAAA,gCAAC,UACC,8BAAC,oBAAiB,IAAI,YAAY,GACpC;AAAA,YAEA,oBAAC,kBAAe,YAAwB;AAAA,aAC1C;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEC,SAAuD,cACtD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./Skeleton.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var skeletonPlaceholderCSS = _7a468({ defaultClassName: "_1a1ozfd0-1-
|
|
4
|
-
var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-
|
|
5
|
-
var skeletonSvgCSS = "_1a1ozfd3-1-
|
|
6
|
-
var skeletonSvgGradientCSS = "_1a1ozfd4-1-
|
|
7
|
-
var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-
|
|
3
|
+
var skeletonPlaceholderCSS = _7a468({ defaultClassName: "_1a1ozfd0-1-17-0", variantClassNames: { variant: { "default": "_1a1ozfd1-1-17-0", rounded: "_1a1ozfd2-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
var skeletonSvgBackgroundFillCSS = "_1a1ozfd5-1-17-0";
|
|
5
|
+
var skeletonSvgCSS = "_1a1ozfd3-1-17-0";
|
|
6
|
+
var skeletonSvgGradientCSS = "_1a1ozfd4-1-17-0";
|
|
7
|
+
var skeletonSvgGradientRectCSS = "_1a1ozfd6-1-17-0";
|
|
8
8
|
export {
|
|
9
9
|
skeletonPlaceholderCSS,
|
|
10
10
|
skeletonSvgBackgroundFillCSS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/skeleton/Skeleton.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './Skeleton.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var skeletonPlaceholderCSS = _7a468({defaultClassName:'_1a1ozfd0-1-
|
|
4
|
+
"sourcesContent": ["import './Skeleton.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var skeletonPlaceholderCSS = _7a468({defaultClassName:'_1a1ozfd0-1-17-0',variantClassNames:{variant:{'default':'_1a1ozfd1-1-17-0',rounded:'_1a1ozfd2-1-17-0'}},defaultVariants:{},compoundVariants:[]});\nexport var skeletonSvgBackgroundFillCSS = '_1a1ozfd5-1-17-0';\nexport var skeletonSvgCSS = '_1a1ozfd3-1-17-0';\nexport var skeletonSvgGradientCSS = '_1a1ozfd4-1-17-0';\nexport var skeletonSvgGradientRectCSS = '_1a1ozfd6-1-17-0';"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,yBAAyB,OAAO,EAAC,kBAAiB,oBAAmB,mBAAkB,EAAC,SAAQ,EAAC,WAAU,oBAAmB,SAAQ,mBAAkB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACtM,IAAI,+BAA+B;AACnC,IAAI,iBAAiB;AACrB,IAAI,yBAAyB;AAC7B,IAAI,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import { skeletonSvgCSS } from "./Skeleton.sty.js";
|
|
4
4
|
import { SkeletonDrawer, SkeletonGradient } from "./utils.js";
|
|
5
5
|
import { useId } from "../../core/hooks/useId.js";
|
|
6
|
+
const COMPONENT_NAME = "SkeletonText";
|
|
6
7
|
const lineHeight = 12;
|
|
7
8
|
const linePadding = 8;
|
|
8
9
|
const baseYOffset = linePadding * 0.5;
|
|
@@ -38,6 +39,7 @@ const SkeletonText = forwardRef(
|
|
|
38
39
|
...consumerStyle
|
|
39
40
|
},
|
|
40
41
|
...remainingProps,
|
|
42
|
+
"data-dt-component": COMPONENT_NAME,
|
|
41
43
|
children: /* @__PURE__ */ jsxs("svg", { className: skeletonSvgCSS, children: [
|
|
42
44
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(SkeletonGradient, { id: gradientId }) }),
|
|
43
45
|
/* @__PURE__ */ jsx("mask", { id: maskId, children: new Array(lines).fill(null).map((_, lineIndex) => /* @__PURE__ */ jsx(
|
|
@@ -63,6 +65,7 @@ const SkeletonText = forwardRef(
|
|
|
63
65
|
);
|
|
64
66
|
}
|
|
65
67
|
);
|
|
68
|
+
SkeletonText.displayName = COMPONENT_NAME;
|
|
66
69
|
export {
|
|
67
70
|
SkeletonText
|
|
68
71
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/content/skeleton/SkeletonText.tsx"],
|
|
4
|
-
"sourcesContent": ["import { type CSSProperties, forwardRef } from 'react';\n\nimport { skeletonSvgCSS } from './Skeleton.sty.js';\nimport { SkeletonDrawer, SkeletonGradient } from './utils.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\n\n/**\n * Accepted properties for SkeletonText\n * @public\n */\nexport interface SkeletonTextProps extends StylingProps, DataTestId {\n /**\n * Width of the SkeletonText placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Number of Lines of the SkeletonText placeholder.\n * @defaultValue 3\n */\n lines?: number;\n}\n\nconst lineHeight = 12;\nconst linePadding = 8;\n\nconst baseYOffset = linePadding * 0.5;\nconst lineCapSize = lineHeight * 0.5;\nconst lineStep = lineHeight + linePadding;\n\nconst getSkeletonLinesMargin = (line: number, lines: number) => {\n if (lines === 1) {\n // do not add any margin for single-line SkeletonTexts\n return 0;\n }\n return ((line + 2) % 3) * lineHeight;\n};\n\n/**\n * The `SkeletonText` component renders a specified number of placeholder boxes for lines of text with an animated background.\n * @public\n */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n (props, forwardedRef) => {\n const {\n width = '100%',\n lines = 3,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonTextProps = props;\n\n const maskId = useId();\n const gradientId = useId();\n\n return (\n <div\n data-testid={dataTestId}\n ref={forwardedRef}\n className={consumerClassName}\n style={{\n width: width,\n height: `${lineStep * lines}px`,\n ...consumerStyle,\n }}\n {...remainingProps}\n >\n <svg className={skeletonSvgCSS}>\n <defs>\n <SkeletonGradient id={gradientId} />\n </defs>\n <mask id={maskId}>\n {new Array(lines).fill(null).map((_, lineIndex) => (\n <rect\n key={`${lines}-${lineIndex}`}\n y={baseYOffset + lineStep * lineIndex}\n height={lineHeight}\n rx={lineCapSize}\n fill=\"white\"\n style={{\n // we also substract 1px, to make sure the line cap is fully within the svg, and isn't cut\n width: `calc(100% - 1px - ${getSkeletonLinesMargin(\n lineIndex,\n lines,\n )}px)`,\n }}\n />\n ))}\n </mask>\n\n <g mask={`url(#${maskId})`}>\n <SkeletonDrawer gradientId={gradientId} />\n </g>\n </svg>\n </div>\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { type CSSProperties, forwardRef } from 'react';\n\nimport { skeletonSvgCSS } from './Skeleton.sty.js';\nimport { SkeletonDrawer, SkeletonGradient } from './utils.js';\nimport { useId } from '../../core/hooks/useId.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\n\nconst COMPONENT_NAME = 'SkeletonText';\n\n/**\n * Accepted properties for SkeletonText\n * @public\n */\nexport interface SkeletonTextProps extends StylingProps, DataTestId {\n /**\n * Width of the SkeletonText placeholder.\n * @defaultValue 100%\n */\n width?: CSSProperties['width'];\n /**\n * Number of Lines of the SkeletonText placeholder.\n * @defaultValue 3\n */\n lines?: number;\n}\n\nconst lineHeight = 12;\nconst linePadding = 8;\n\nconst baseYOffset = linePadding * 0.5;\nconst lineCapSize = lineHeight * 0.5;\nconst lineStep = lineHeight + linePadding;\n\nconst getSkeletonLinesMargin = (line: number, lines: number) => {\n if (lines === 1) {\n // do not add any margin for single-line SkeletonTexts\n return 0;\n }\n return ((line + 2) % 3) * lineHeight;\n};\n\n/**\n * The `SkeletonText` component renders a specified number of placeholder boxes for lines of text with an animated background.\n * @public\n */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n (props, forwardedRef) => {\n const {\n width = '100%',\n lines = 3,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n ...remainingProps\n }: SkeletonTextProps = props;\n\n const maskId = useId();\n const gradientId = useId();\n\n return (\n <div\n data-testid={dataTestId}\n ref={forwardedRef}\n className={consumerClassName}\n style={{\n width: width,\n height: `${lineStep * lines}px`,\n ...consumerStyle,\n }}\n {...remainingProps}\n data-dt-component={COMPONENT_NAME}\n >\n <svg className={skeletonSvgCSS}>\n <defs>\n <SkeletonGradient id={gradientId} />\n </defs>\n <mask id={maskId}>\n {new Array(lines).fill(null).map((_, lineIndex) => (\n <rect\n key={`${lines}-${lineIndex}`}\n y={baseYOffset + lineStep * lineIndex}\n height={lineHeight}\n rx={lineCapSize}\n fill=\"white\"\n style={{\n // we also substract 1px, to make sure the line cap is fully within the svg, and isn't cut\n width: `calc(100% - 1px - ${getSkeletonLinesMargin(\n lineIndex,\n lines,\n )}px)`,\n }}\n />\n ))}\n </mask>\n\n <g mask={`url(#${maskId})`}>\n <SkeletonDrawer gradientId={gradientId} />\n </g>\n </svg>\n </div>\n );\n },\n);\n\n(SkeletonText as typeof SkeletonText & { displayName: string }).displayName =\n COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AAyEQ,SAEI,KAFJ;AAzER,SAA6B,kBAAkB;AAE/C,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,aAAa;AAItB,MAAM,iBAAiB;AAmBvB,MAAM,aAAa;AACnB,MAAM,cAAc;AAEpB,MAAM,cAAc,cAAc;AAClC,MAAM,cAAc,aAAa;AACjC,MAAM,WAAW,aAAa;AAE9B,MAAM,yBAAyB,CAAC,MAAc,UAAkB;AAC9D,MAAI,UAAU,GAAG;AAEf,WAAO;AAAA,EACT;AACA,UAAS,OAAO,KAAK,IAAK;AAC5B;AAMO,MAAM,eAAe;AAAA,EAC1B,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,GAAG;AAAA,IACL,IAAuB;AAEvB,UAAM,SAAS,MAAM;AACrB,UAAM,aAAa,MAAM;AAEzB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAa;AAAA,QACb,KAAK;AAAA,QACL,WAAW;AAAA,QACX,OAAO;AAAA,UACL;AAAA,UACA,QAAQ,GAAG,WAAW,KAAK;AAAA,UAC3B,GAAG;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QACJ,qBAAmB;AAAA,QAEnB,+BAAC,SAAI,WAAW,gBACd;AAAA,8BAAC,UACC,8BAAC,oBAAiB,IAAI,YAAY,GACpC;AAAA,UACA,oBAAC,UAAK,IAAI,QACP,cAAI,MAAM,KAAK,EAAE,KAAK,IAAI,EAAE,IAAI,CAAC,GAAG,cACnC;AAAA,YAAC;AAAA;AAAA,cAEC,GAAG,cAAc,WAAW;AAAA,cAC5B,QAAQ;AAAA,cACR,IAAI;AAAA,cACJ,MAAK;AAAA,cACL,OAAO;AAAA;AAAA,gBAEL,OAAO,qBAAqB;AAAA,kBAC1B;AAAA,kBACA;AAAA,gBACF,CAAC;AAAA,cACH;AAAA;AAAA,YAXK,GAAG,KAAK,IAAI,SAAS;AAAA,UAY5B,CACD,GACH;AAAA,UAEA,oBAAC,OAAE,MAAM,QAAQ,MAAM,KACrB,8BAAC,kBAAe,YAAwB,GAC1C;AAAA,WACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEC,aAA+D,cAC9D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esm/core/index.js
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
} from "./components/focus-scope/FocusScope.js";
|
|
5
5
|
import { useCurrentTheme } from "./hooks/useCurrentTheme.js";
|
|
6
6
|
import { useFocusContext } from "./hooks/useFocusContext.js";
|
|
7
|
+
import {
|
|
8
|
+
useFocusRing
|
|
9
|
+
} from "./styles/useFocusRing.js";
|
|
7
10
|
import {
|
|
8
11
|
FocusProvider
|
|
9
12
|
} from "./providers/FocusProvider.js";
|
|
@@ -38,6 +41,7 @@ export {
|
|
|
38
41
|
useFocusContext as _useFocusContext,
|
|
39
42
|
useSafeForwardProps as _useSafeForwardProps,
|
|
40
43
|
useCurrentTheme,
|
|
44
|
+
useFocusRing,
|
|
41
45
|
useId
|
|
42
46
|
};
|
|
43
47
|
//# sourceMappingURL=index.js.map
|
package/esm/core/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/core/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { AppRoot, type AppRootProps } from './components/app-root/AppRoot.js';\nexport {\n FocusScope,\n type FocusScopeProps,\n} from './components/focus-scope/FocusScope.js';\n\nexport { type FocusContextProps as _FocusContextProps } from './contexts/FocusContext.js';\n\nexport { useCurrentTheme } from './hooks/useCurrentTheme.js';\nexport { useFocusContext as _useFocusContext } from './hooks/useFocusContext.js';\nexport {\n FocusProvider as _FocusProvider,\n type Modality as _Modality,\n} from './providers/FocusProvider.js';\nexport type { MaskingProps } from './types/masking-props.js';\nexport type { DataTestId } from './types/data-props.js';\nexport type { StylingProps } from './types/styling-props.js';\nexport type { WithChildren } from './types/with-children.js';\nexport type {\n PolymorphOwnProps,\n PolymorphProps,\n PolymorphicComponentProps,\n} from './types/polymorph.js';\nexport { attemptFocus as _attemptFocus } from './utils/focus-management/attempt-focus.js';\nexport { focusFirstDescendant as _focusFirstDescendant } from './utils/focus-management/focus-first-descendant.js';\nexport { getFirstFocusableChild as _getFirstFocusableChild } from './utils/focus-management/get-first-focusable-child.js';\nexport { getLastFocusableChild as _getLastFocusableChild } from './utils/focus-management/get-last-focusable-child.js';\nexport { isFocusable as _isFocusable } from './utils/focus-management/is-focusable.js';\nexport { isBrowser as _isBrowser } from './utils/isBrowser.js';\nexport {\n mergeProps as _mergeProps,\n type NullToObject as _NullToObject,\n type TupleTypes as _TupleTypes,\n type UnionToIntersection as _UnionToIntersection,\n} from './utils/merge-props.js';\nexport { type _HeadingLevel, type _HeadingTag } from './types/heading.js';\nexport { useAriaLabelingProps as _useAriaLabelingProps } from './hooks/useAriaLabelingProps.js';\nexport { useId } from './hooks/useId.js';\nexport { useSafeForwardProps as _useSafeForwardProps } from './hooks/useSafeForwardProps.js';\nexport type { UseSafeForwardReturnProps as _UseSafeForwardReturnProps } from './hooks/useSafeForwardProps.js';\nexport type {\n AriaDisabledProps,\n AriaLabelingProps,\n} from './types/a11y-props.js';\nexport type { DOMProps } from './types/dom.js';\nexport { canReceiveDefaultTextFormat as _canReceiveDefaultTextFormat } from './utils/can-receive-default-text-format.js';\nexport { parseBoolean as _parseBoolean } from './utils/parse-boolean.js';\nexport type { BehaviorTrackingProps } from './types/behavior-tracking-props.js';\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EACmB;AAAA,OAEZ;AAUP,SAAyB,oBAAqB;AAC9C,SAAiC,4BAA6B;AAC9D,SAAmC,8BAA+B;AAClE,SAAkC,6BAA8B;AAChE,SAAwB,mBAAoB;AAC5C,SAAsB,iBAAkB;AACxC;AAAA,EACgB;AAAA,OAIT;AAEP,SAAiC,4BAA6B;AAC9D,SAAS,aAAa;AACtB,SAAgC,2BAA4B;AAO5D,SAAwC,mCAAoC;AAC5E,SAAyB,oBAAqB;",
|
|
4
|
+
"sourcesContent": ["export { AppRoot, type AppRootProps } from './components/app-root/AppRoot.js';\nexport {\n FocusScope,\n type FocusScopeProps,\n} from './components/focus-scope/FocusScope.js';\n\nexport { type FocusContextProps as _FocusContextProps } from './contexts/FocusContext.js';\n\nexport { useCurrentTheme } from './hooks/useCurrentTheme.js';\nexport { useFocusContext as _useFocusContext } from './hooks/useFocusContext.js';\nexport {\n type VariantType,\n type UseFocusRingProps,\n type FocusRingProps,\n useFocusRing,\n} from './styles/useFocusRing.js';\nexport {\n FocusProvider as _FocusProvider,\n type Modality as _Modality,\n} from './providers/FocusProvider.js';\nexport type { MaskingProps } from './types/masking-props.js';\nexport type { DataTestId } from './types/data-props.js';\nexport type { StylingProps } from './types/styling-props.js';\nexport type { WithChildren } from './types/with-children.js';\nexport type {\n PolymorphOwnProps,\n PolymorphProps,\n PolymorphicComponentProps,\n} from './types/polymorph.js';\nexport { attemptFocus as _attemptFocus } from './utils/focus-management/attempt-focus.js';\nexport { focusFirstDescendant as _focusFirstDescendant } from './utils/focus-management/focus-first-descendant.js';\nexport { getFirstFocusableChild as _getFirstFocusableChild } from './utils/focus-management/get-first-focusable-child.js';\nexport { getLastFocusableChild as _getLastFocusableChild } from './utils/focus-management/get-last-focusable-child.js';\nexport { isFocusable as _isFocusable } from './utils/focus-management/is-focusable.js';\nexport { isBrowser as _isBrowser } from './utils/isBrowser.js';\nexport {\n mergeProps as _mergeProps,\n type NullToObject as _NullToObject,\n type TupleTypes as _TupleTypes,\n type UnionToIntersection as _UnionToIntersection,\n} from './utils/merge-props.js';\nexport { type _HeadingLevel, type _HeadingTag } from './types/heading.js';\nexport { useAriaLabelingProps as _useAriaLabelingProps } from './hooks/useAriaLabelingProps.js';\nexport { useId } from './hooks/useId.js';\nexport { useSafeForwardProps as _useSafeForwardProps } from './hooks/useSafeForwardProps.js';\nexport type { UseSafeForwardReturnProps as _UseSafeForwardReturnProps } from './hooks/useSafeForwardProps.js';\nexport type {\n AriaDisabledProps,\n AriaLabelingProps,\n} from './types/a11y-props.js';\nexport type { DOMProps } from './types/dom.js';\nexport { canReceiveDefaultTextFormat as _canReceiveDefaultTextFormat } from './utils/can-receive-default-text-format.js';\nexport { parseBoolean as _parseBoolean } from './utils/parse-boolean.js';\nexport type { BehaviorTrackingProps } from './types/behavior-tracking-props.js';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAkC;AAC3C;AAAA,EACE;AAAA,OAEK;AAIP,SAAS,uBAAuB;AAChC,SAA4B,uBAAwB;AACpD;AAAA,EAIE;AAAA,OACK;AACP;AAAA,EACmB;AAAA,OAEZ;AAUP,SAAyB,oBAAqB;AAC9C,SAAiC,4BAA6B;AAC9D,SAAmC,8BAA+B;AAClE,SAAkC,6BAA8B;AAChE,SAAwB,mBAAoB;AAC5C,SAAsB,iBAAkB;AACxC;AAAA,EACgB;AAAA,OAIT;AAEP,SAAiC,4BAA6B;AAC9D,SAAS,aAAa;AACtB,SAAgC,2BAA4B;AAO5D,SAAwC,mCAAoC;AAC5E,SAAyB,oBAAqB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
._z2r50s3-1-
|
|
1
|
+
._z2r50s3-1-17-0 {
|
|
2
2
|
outline: none;
|
|
3
3
|
}
|
|
4
|
-
._z2r50s3-1-
|
|
4
|
+
._z2r50s3-1-17-0:focus-visible {
|
|
5
5
|
outline: none;
|
|
6
6
|
}
|
|
7
|
-
._z2r50s4-1-
|
|
7
|
+
._z2r50s4-1-17-0 {
|
|
8
8
|
border-radius: var(--dt-borders-radius-field-subdued, 3px);
|
|
9
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-
|
|
10
|
-
background-color: var(--_z2r50s2-1-
|
|
11
|
-
}
|
|
12
|
-
._z2r50s5-1-
|
|
13
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-
|
|
14
|
-
}
|
|
15
|
-
._z2r50s6-1-
|
|
16
|
-
--_z2r50s0-1-
|
|
17
|
-
--_z2r50s1-1-
|
|
18
|
-
--_z2r50s2-1-
|
|
19
|
-
}
|
|
20
|
-
._z2r50s7-1-
|
|
21
|
-
--_z2r50s0-1-
|
|
22
|
-
--_z2r50s1-1-
|
|
23
|
-
--_z2r50s2-1-
|
|
24
|
-
}
|
|
25
|
-
._z2r50s8-1-
|
|
26
|
-
--_z2r50s0-1-
|
|
27
|
-
--_z2r50s1-1-
|
|
28
|
-
--_z2r50s2-1-
|
|
29
|
-
}
|
|
30
|
-
._z2r50s9-1-
|
|
31
|
-
--_z2r50s0-1-
|
|
32
|
-
--_z2r50s1-1-
|
|
33
|
-
--_z2r50s2-1-
|
|
34
|
-
}
|
|
35
|
-
._z2r50sa-1-
|
|
36
|
-
--_z2r50s0-1-
|
|
37
|
-
--_z2r50s1-1-
|
|
38
|
-
--_z2r50s2-1-
|
|
39
|
-
}
|
|
40
|
-
._z2r50sb-1-
|
|
9
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-17-0);
|
|
10
|
+
background-color: var(--_z2r50s2-1-17-0);
|
|
11
|
+
}
|
|
12
|
+
._z2r50s5-1-17-0._z2r50s5-1-17-0 {
|
|
13
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-17-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-17-0);
|
|
14
|
+
}
|
|
15
|
+
._z2r50s6-1-17-0 {
|
|
16
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
17
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
18
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
|
|
19
|
+
}
|
|
20
|
+
._z2r50s7-1-17-0 {
|
|
21
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
22
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
23
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
|
|
24
|
+
}
|
|
25
|
+
._z2r50s8-1-17-0 {
|
|
26
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
27
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
28
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
|
|
29
|
+
}
|
|
30
|
+
._z2r50s9-1-17-0 {
|
|
31
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
|
|
32
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
33
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
|
|
34
|
+
}
|
|
35
|
+
._z2r50sa-1-17-0 {
|
|
36
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
37
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
38
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
|
|
39
|
+
}
|
|
40
|
+
._z2r50sb-1-17-0:focus-within {
|
|
41
41
|
outline: none;
|
|
42
42
|
}
|
|
43
|
-
._z2r50sc-1-
|
|
43
|
+
._z2r50sc-1-17-0._z2r50sc-1-17-0:focus-within {
|
|
44
44
|
border-radius: var(--dt-borders-radius-field-subdued, 3px);
|
|
45
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-
|
|
46
|
-
background-color: var(--_z2r50s2-1-
|
|
47
|
-
}
|
|
48
|
-
._z2r50sd-1-
|
|
49
|
-
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-
|
|
50
|
-
}
|
|
51
|
-
._z2r50se-1-
|
|
52
|
-
--_z2r50s0-1-
|
|
53
|
-
--_z2r50s1-1-
|
|
54
|
-
--_z2r50s2-1-
|
|
55
|
-
}
|
|
56
|
-
._z2r50sf-1-
|
|
57
|
-
--_z2r50s0-1-
|
|
58
|
-
--_z2r50s1-1-
|
|
59
|
-
--_z2r50s2-1-
|
|
60
|
-
}
|
|
61
|
-
._z2r50sg-1-
|
|
62
|
-
--_z2r50s0-1-
|
|
63
|
-
--_z2r50s1-1-
|
|
64
|
-
--_z2r50s2-1-
|
|
65
|
-
}
|
|
66
|
-
._z2r50sh-1-
|
|
67
|
-
--_z2r50s0-1-
|
|
68
|
-
--_z2r50s1-1-
|
|
69
|
-
--_z2r50s2-1-
|
|
70
|
-
}
|
|
71
|
-
._z2r50si-1-
|
|
72
|
-
--_z2r50s0-1-
|
|
73
|
-
--_z2r50s1-1-
|
|
74
|
-
--_z2r50s2-1-
|
|
45
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-default, 1px) var(--_z2r50s0-1-17-0);
|
|
46
|
+
background-color: var(--_z2r50s2-1-17-0);
|
|
47
|
+
}
|
|
48
|
+
._z2r50sd-1-17-0._z2r50sd-1-17-0:focus-within {
|
|
49
|
+
box-shadow: inset 0 0 0 var(--dt-borders-width-emphasized, 2px) var(--_z2r50s0-1-17-0), inset 0 0 0 calc(var(--dt-borders-width-emphasized, 2px) + 1px) var(--_z2r50s1-1-17-0);
|
|
50
|
+
}
|
|
51
|
+
._z2r50se-1-17-0 {
|
|
52
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
53
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
54
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-neutral-emphasized, #e4e5eb);
|
|
55
|
+
}
|
|
56
|
+
._z2r50sf-1-17-0 {
|
|
57
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
58
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
59
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-primary-emphasized, #e1e5f7);
|
|
60
|
+
}
|
|
61
|
+
._z2r50sg-1-17-0 {
|
|
62
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
63
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
64
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-success-emphasized, #e0e7e6);
|
|
65
|
+
}
|
|
66
|
+
._z2r50sh-1-17-0 {
|
|
67
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
|
|
68
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
69
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-warning-emphasized, #f9f0e5);
|
|
70
|
+
}
|
|
71
|
+
._z2r50si-1-17-0 {
|
|
72
|
+
--_z2r50s0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
73
|
+
--_z2r50s1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
74
|
+
--_z2r50s2-1-17-0: var(--dt-colors-background-field-critical-emphasized, #f8e1e1);
|
|
75
75
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./focusRing.css";
|
|
2
2
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
-
var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-
|
|
4
|
-
var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-
|
|
3
|
+
var focusRingCSS = _7a468({ defaultClassName: "_z2r50s3-1-17-0", variantClassNames: { minimal: { true: "_z2r50s4-1-17-0", false: "_z2r50s5-1-17-0" }, variant: { neutral: "_z2r50s6-1-17-0", primary: "_z2r50s7-1-17-0", success: "_z2r50s8-1-17-0", warning: "_z2r50s9-1-17-0", critical: "_z2r50sa-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
4
|
+
var focusRingFocusWithinCSS = _7a468({ defaultClassName: "_z2r50sb-1-17-0", variantClassNames: { minimal: { true: "_z2r50sc-1-17-0", false: "_z2r50sd-1-17-0" }, variant: { neutral: "_z2r50se-1-17-0", primary: "_z2r50sf-1-17-0", success: "_z2r50sg-1-17-0", warning: "_z2r50sh-1-17-0", critical: "_z2r50si-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
5
5
|
export {
|
|
6
6
|
focusRingCSS,
|
|
7
7
|
focusRingFocusWithinCSS
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/styles/focusRing.css.ts"],
|
|
4
|
-
"sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-
|
|
4
|
+
"sourcesContent": ["import './focusRing.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingCSS = _7a468({defaultClassName:'_z2r50s3-1-17-0',variantClassNames:{minimal:{true:'_z2r50s4-1-17-0',false:'_z2r50s5-1-17-0'},variant:{neutral:'_z2r50s6-1-17-0',primary:'_z2r50s7-1-17-0',success:'_z2r50s8-1-17-0',warning:'_z2r50s9-1-17-0',critical:'_z2r50sa-1-17-0'}},defaultVariants:{},compoundVariants:[]});\nexport var focusRingFocusWithinCSS = _7a468({defaultClassName:'_z2r50sb-1-17-0',variantClassNames:{minimal:{true:'_z2r50sc-1-17-0',false:'_z2r50sd-1-17-0'},variant:{neutral:'_z2r50se-1-17-0',primary:'_z2r50sf-1-17-0',success:'_z2r50sg-1-17-0',warning:'_z2r50sh-1-17-0',critical:'_z2r50si-1-17-0'}},defaultVariants:{},compoundVariants:[]});"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,eAAe,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,mBAAkB,OAAM,kBAAiB,GAAE,SAAQ,EAAC,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,UAAS,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AAC/T,IAAI,0BAA0B,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,mBAAkB,OAAM,kBAAiB,GAAE,SAAQ,EAAC,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,UAAS,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
._z0fq9b4-1-17-0 {
|
|
2
|
+
outline: none;
|
|
3
|
+
box-shadow: none;
|
|
4
|
+
}
|
|
5
|
+
._z0fq9b5-1-17-0 {
|
|
6
|
+
--_z0fq9b3-1-17-0: var(--dt-borders-width-default, 1px);
|
|
7
|
+
--_z0fq9b2-1-17-0: 0 0 0 var(--_z0fq9b3-1-17-0) var(--_z0fq9b0-1-17-0) inset;
|
|
8
|
+
}
|
|
9
|
+
._z0fq9b6-1-17-0 {
|
|
10
|
+
--_z0fq9b3-1-17-0: var(--dt-borders-width-emphasized, 2px);
|
|
11
|
+
--_z0fq9b2-1-17-0: 0 0 0 var(--_z0fq9b3-1-17-0) var(--_z0fq9b0-1-17-0) inset, 0 0 0 calc(var(--_z0fq9b3-1-17-0) + 1px) var(--_z0fq9b1-1-17-0) inset;
|
|
12
|
+
}
|
|
13
|
+
._z0fq9b7-1-17-0 {
|
|
14
|
+
--_z0fq9b2-1-17-0: none;
|
|
15
|
+
}
|
|
16
|
+
._z0fq9b8-1-17-0:focus-visible {
|
|
17
|
+
box-shadow: var(--_z0fq9b2-1-17-0);
|
|
18
|
+
}
|
|
19
|
+
._z0fq9b9-1-17-0:focus-within {
|
|
20
|
+
box-shadow: var(--_z0fq9b2-1-17-0);
|
|
21
|
+
}
|
|
22
|
+
._z0fq9ba-1-17-0:focus {
|
|
23
|
+
box-shadow: var(--_z0fq9b2-1-17-0);
|
|
24
|
+
}
|
|
25
|
+
._z0fq9bb-1-17-0 {
|
|
26
|
+
--_z0fq9b0-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
27
|
+
--_z0fq9b1-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
28
|
+
}
|
|
29
|
+
._z0fq9bc-1-17-0 {
|
|
30
|
+
--_z0fq9b0-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
31
|
+
--_z0fq9b1-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
32
|
+
}
|
|
33
|
+
._z0fq9bd-1-17-0 {
|
|
34
|
+
--_z0fq9b0-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
35
|
+
--_z0fq9b1-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
36
|
+
}
|
|
37
|
+
._z0fq9be-1-17-0 {
|
|
38
|
+
--_z0fq9b0-1-17-0: var(--dt-colors-border-warning-accent, #855400);
|
|
39
|
+
--_z0fq9b1-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
40
|
+
}
|
|
41
|
+
._z0fq9bf-1-17-0 {
|
|
42
|
+
--_z0fq9b0-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
43
|
+
--_z0fq9b1-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./focusRingStatic.css";
|
|
2
|
+
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
var focusRingStatic = _7a468({ defaultClassName: "_z0fq9b4-1-17-0", variantClassNames: { minimal: { true: "_z0fq9b5-1-17-0", false: "_z0fq9b6-1-17-0" }, disabled: { true: "_z0fq9b7-1-17-0" }, when: { "focus-visible": "_z0fq9b8-1-17-0", "focus-within": "_z0fq9b9-1-17-0", focus: "_z0fq9ba-1-17-0" }, color: { neutral: "_z0fq9bb-1-17-0", primary: "_z0fq9bc-1-17-0", success: "_z0fq9bd-1-17-0", warning: "_z0fq9be-1-17-0", critical: "_z0fq9bf-1-17-0" } }, defaultVariants: { color: "neutral", minimal: false, when: "focus", disabled: false }, compoundVariants: [] });
|
|
4
|
+
export {
|
|
5
|
+
focusRingStatic
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=focusRingStatic.sty.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/core/styles/focusRingStatic.css.ts"],
|
|
4
|
+
"sourcesContent": ["import './focusRingStatic.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var focusRingStatic = _7a468({defaultClassName:'_z0fq9b4-1-17-0',variantClassNames:{minimal:{true:'_z0fq9b5-1-17-0',false:'_z0fq9b6-1-17-0'},disabled:{true:'_z0fq9b7-1-17-0'},when:{'focus-visible':'_z0fq9b8-1-17-0','focus-within':'_z0fq9b9-1-17-0',focus:'_z0fq9ba-1-17-0'},color:{neutral:'_z0fq9bb-1-17-0',primary:'_z0fq9bc-1-17-0',success:'_z0fq9bd-1-17-0',warning:'_z0fq9be-1-17-0',critical:'_z0fq9bf-1-17-0'}},defaultVariants:{color:'neutral',minimal:false,when:'focus',disabled:false},compoundVariants:[]});"],
|
|
5
|
+
"mappings": "AAAA,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,kBAAkB,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,mBAAkB,OAAM,kBAAiB,GAAE,UAAS,EAAC,MAAK,kBAAiB,GAAE,MAAK,EAAC,iBAAgB,mBAAkB,gBAAe,mBAAkB,OAAM,kBAAiB,GAAE,OAAM,EAAC,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,SAAQ,mBAAkB,UAAS,kBAAiB,EAAC,GAAE,iBAAgB,EAAC,OAAM,WAAU,SAAQ,OAAM,MAAK,SAAQ,UAAS,MAAK,GAAE,kBAAiB,CAAC,EAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
useCallback,
|
|
3
2
|
useEffect,
|
|
4
|
-
useState
|
|
3
|
+
useState,
|
|
4
|
+
useMemo
|
|
5
5
|
} from "react";
|
|
6
6
|
import { focusRingCSS, focusRingFocusWithinCSS } from "./focusRing.sty.js";
|
|
7
7
|
import { useFocusContext } from "../hooks/useFocusContext.js";
|
|
@@ -20,20 +20,20 @@ function useFocusRing(props = {}) {
|
|
|
20
20
|
setIsFocused(false);
|
|
21
21
|
}
|
|
22
22
|
}, [disabled]);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
const focusProps = useMemo(() => {
|
|
24
|
+
return {
|
|
25
|
+
onBlur: (event) => {
|
|
26
|
+
if (event.currentTarget === event.target) {
|
|
27
|
+
setIsFocused(false);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onFocus: (event) => {
|
|
31
|
+
if (event.currentTarget === event.target) {
|
|
32
|
+
setIsFocused(true);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
32
36
|
}, []);
|
|
33
|
-
const focusProps = {
|
|
34
|
-
onFocus,
|
|
35
|
-
onBlur
|
|
36
|
-
};
|
|
37
37
|
if ((ignoreModality || modality === "keyboard") && isFocused || focusWithin) {
|
|
38
38
|
if (isMinimal) {
|
|
39
39
|
return {
|