@dynatrace/strato-components 1.4.0 → 1.6.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 +18 -22
- package/buttons/button/Button.d.ts +4 -4
- package/buttons/button/Button.js +48 -34
- package/buttons/button/Button.sty.js +5 -4
- package/buttons/button/Label.d.ts +2 -2
- package/buttons/button/Label.js +7 -5
- package/buttons/button/Prefix.d.ts +2 -2
- package/buttons/button/Prefix.js +7 -15
- package/buttons/button/Suffix.d.ts +3 -3
- package/buttons/button/Suffix.js +7 -15
- 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.d.ts +2 -2
- package/buttons/intent-button/IntentButton.js +17 -21
- package/buttons/intent-button/useIntentButton.d.ts +4 -3
- 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.d.ts +4 -5
- package/content/progress/ProgressBar.js +50 -41
- package/content/progress/ProgressBar.sty.js +6 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.d.ts +1 -2
- package/content/progress/ProgressBarIcon.js +7 -5
- package/content/progress/ProgressBarIcon.sty.js +2 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.d.ts +1 -2
- package/content/progress/ProgressBarLabel.js +7 -5
- package/content/progress/ProgressBarLabel.sty.js +2 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.d.ts +1 -2
- package/content/progress/ProgressBarValue.js +7 -5
- package/content/progress/ProgressBarValue.sty.js +2 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.d.ts +1 -2
- package/content/progress/ProgressCircle.js +61 -55
- package/content/progress/ProgressCircle.sty.js +6 -5
- package/content/progress/contexts/SharedProgressBarPropsContext.d.ts +1 -2
- package/content/progress/contexts/SharedProgressBarPropsContext.js +3 -12
- 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.d.ts +2 -2
- package/content/skeleton/Skeleton.js +7 -5
- package/content/skeleton/Skeleton.sty.js +2 -1
- package/content/skeleton/SkeletonText.d.ts +2 -2
- package/content/skeleton/SkeletonText.js +10 -18
- package/core/components/app-root/AppRoot.d.ts +3 -3
- package/core/components/app-root/AppRoot.js +16 -24
- package/core/components/app-root/AppRoot.sty.js +1 -0
- package/core/components/focus-scope/FocusScope.d.ts +1 -2
- package/core/components/focus-scope/FocusScope.js +7 -15
- 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 +2 -1
- package/core/hooks/useId.js +1 -0
- package/core/hooks/useMergeRefs.d.ts +2 -2
- package/core/hooks/useMergeRefs.js +1 -0
- package/core/hooks/useSafeForwardProps.js +1 -0
- package/core/index.js +1 -0
- package/core/providers/FocusProvider.d.ts +1 -2
- package/core/providers/FocusProvider.js +7 -15
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.js +3 -2
- package/core/styles/useFocusRing.d.ts +3 -3
- 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.d.ts +1 -1
- package/core/types/polymorph.js +1 -0
- package/core/types/styling-props.d.ts +1 -1
- package/core/types/styling-props.js +1 -0
- package/core/types/with-children.d.ts +1 -1
- package/core/types/with-children.js +1 -0
- package/core/utils/_is-string-children.d.ts +2 -2
- package/core/utils/_is-string-children.js +3 -12
- 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.js +49 -35
- 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/button/Label.js +6 -5
- package/esm/buttons/button/Label.js.map +2 -2
- package/esm/buttons/button/Prefix.js +6 -5
- package/esm/buttons/button/Prefix.js.map +2 -2
- package/esm/buttons/button/Suffix.js +6 -5
- package/esm/buttons/button/Suffix.js.map +2 -2
- package/esm/buttons/intent-button/IntentButton.js +16 -11
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/buttons/intent-button/useIntentButton.js +4 -1
- package/esm/buttons/intent-button/useIntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js +53 -41
- 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.js +6 -5
- package/esm/content/progress/ProgressBarIcon.js.map +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.js +6 -5
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- 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.js +6 -5
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- 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 +60 -55
- 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/progress/contexts/SharedProgressBarPropsContext.js +2 -2
- package/esm/content/progress/contexts/SharedProgressBarPropsContext.js.map +2 -2
- package/esm/content/skeleton/Skeleton.css +6 -6
- package/esm/content/skeleton/Skeleton.js +6 -5
- package/esm/content/skeleton/Skeleton.js.map +2 -2
- package/esm/content/skeleton/Skeleton.sty.js +1 -1
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/content/skeleton/SkeletonText.js +9 -8
- package/esm/content/skeleton/SkeletonText.js.map +2 -2
- package/esm/core/components/app-root/AppRoot.js +15 -14
- package/esm/core/components/app-root/AppRoot.js.map +2 -2
- package/esm/core/components/focus-scope/FocusScope.js +6 -5
- package/esm/core/components/focus-scope/FocusScope.js.map +2 -2
- package/esm/core/hooks/useFontsUpdated.js +1 -1
- package/esm/core/hooks/useFontsUpdated.js.map +2 -2
- package/esm/core/hooks/useMergeRefs.js +3 -1
- package/esm/core/hooks/useMergeRefs.js.map +2 -2
- package/esm/core/providers/FocusProvider.js +6 -5
- package/esm/core/providers/FocusProvider.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/useFocusRing.js.map +1 -1
- package/esm/core/utils/_is-string-children.js +2 -2
- package/esm/core/utils/_is-string-children.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.js +7 -6
- package/esm/layouts/container/Container.js.map +2 -2
- 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.js +3 -2
- package/esm/layouts/divider/Divider.js.map +2 -2
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/flex/Flex.js +6 -5
- package/esm/layouts/flex/Flex.js.map +2 -2
- package/esm/layouts/grid/Grid.js +6 -5
- package/esm/layouts/grid/Grid.js.map +2 -2
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.js +17 -14
- 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/getFlexStyles.js.map +1 -1
- package/esm/styles/getGridStyles.js.map +1 -1
- package/esm/styles/getLayoutSizeStyles.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 +6 -5
- 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 +6 -5
- 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 +6 -5
- 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 +6 -6
- package/esm/typography/external-link/ExternalLink.js +22 -16
- package/esm/typography/external-link/ExternalLink.js.map +2 -2
- 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.js +6 -5
- 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 -1
- package/esm/typography/highlight/Highlight.js +31 -18
- package/esm/typography/highlight/Highlight.js.map +3 -3
- 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.js +6 -5
- package/esm/typography/link/Link.js.map +2 -2
- 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.js +14 -9
- 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 +6 -5
- 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 +6 -5
- 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 +6 -5
- 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 +6 -5
- 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 +8 -5
- package/esm/typography/text-ellipsis/TextEllipsis.js +16 -15
- 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 +1 -0
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.js +8 -6
- package/layouts/container/Container.sty.js +2 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.d.ts +1 -2
- package/layouts/divider/Divider.js +4 -2
- package/layouts/divider/Divider.sty.js +2 -1
- package/layouts/flex/Flex.js +7 -5
- package/layouts/grid/Grid.d.ts +1 -1
- package/layouts/grid/Grid.js +7 -5
- 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 +18 -14
- package/layouts/surface/Surface.sty.js +3 -2
- package/layouts/surface/variables.sty.js +2 -1
- package/layouts/types/layout.types.d.ts +1 -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.d.ts +17 -17
- package/styles/getFlexStyles.js +1 -0
- package/styles/getGapSprinkles.js +1 -0
- package/styles/getGridFlexPositionSprinkles.js +1 -0
- package/styles/getGridStyles.d.ts +22 -22
- package/styles/getGridStyles.js +1 -0
- package/styles/getLayoutSizeStyles.d.ts +1 -1
- 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.d.ts +1 -2
- package/typography/block-quote/Blockquote.js +7 -5
- package/typography/block-quote/Blockquote.sty.js +2 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.d.ts +1 -2
- package/typography/code/Code.js +7 -5
- package/typography/code/Code.sty.js +2 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.d.ts +1 -2
- package/typography/emphasis/Emphasis.js +7 -5
- package/typography/emphasis/Emphasis.sty.js +2 -1
- package/typography/external-link/ExternalLink.css +6 -6
- package/typography/external-link/ExternalLink.d.ts +2 -2
- package/typography/external-link/ExternalLink.js +23 -16
- package/typography/external-link/ExternalLink.sty.js +2 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.d.ts +1 -2
- package/typography/heading/Heading.js +7 -5
- package/typography/heading/Heading.sty.js +2 -1
- package/typography/highlight/Highlight.css +2 -1
- package/typography/highlight/Highlight.d.ts +1 -1
- package/typography/highlight/Highlight.js +22 -17
- 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.d.ts +1 -1
- package/typography/link/Link.js +7 -5
- package/typography/link/Link.sty.js +2 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.d.ts +1 -2
- package/typography/list/List.js +11 -9
- package/typography/list/List.sty.js +3 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.d.ts +1 -2
- package/typography/paragraph/Paragraph.js +7 -5
- package/typography/paragraph/Paragraph.sty.js +2 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.d.ts +1 -2
- package/typography/strikethrough/Strikethrough.js +7 -5
- package/typography/strikethrough/Strikethrough.sty.js +2 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.d.ts +1 -2
- package/typography/strong/Strong.js +7 -5
- package/typography/strong/Strong.sty.js +2 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +7 -5
- package/typography/text/Text.sty.js +2 -1
- package/typography/text-ellipsis/TextEllipsis.css +8 -5
- package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
- package/typography/text-ellipsis/TextEllipsis.js +17 -15
- 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,75 +1,75 @@
|
|
|
1
|
-
._k096v44-1-
|
|
2
|
-
--_k096v40-1-
|
|
3
|
-
--_k096v41-1-
|
|
4
|
-
--_k096v42-1-
|
|
1
|
+
._k096v44-1-6-0 {
|
|
2
|
+
--_k096v40-1-6-0: var(--dt-colors-text-critical-default, #b80031);
|
|
3
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-critical-default, #b80031);
|
|
4
|
+
--_k096v42-1-6-0: var(--dt-colors-border-critical-default, #f1cdcf);
|
|
5
5
|
}
|
|
6
|
-
._k096v45-1-
|
|
7
|
-
--_k096v40-1-
|
|
8
|
-
--_k096v41-1-
|
|
9
|
-
--_k096v42-1-
|
|
6
|
+
._k096v45-1-6-0 {
|
|
7
|
+
--_k096v40-1-6-0: var(--dt-colors-text-neutral-default, #2b2a58);
|
|
8
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-neutral-default, #2b2a58);
|
|
9
|
+
--_k096v42-1-6-0: var(--dt-colors-border-neutral-default, #d2d3e1);
|
|
10
10
|
}
|
|
11
|
-
._k096v46-1-
|
|
12
|
-
--_k096v40-1-
|
|
13
|
-
--_k096v41-1-
|
|
14
|
-
--_k096v42-1-
|
|
11
|
+
._k096v46-1-6-0 {
|
|
12
|
+
--_k096v40-1-6-0: var(--dt-colors-text-primary-default, #454cc9);
|
|
13
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-primary-default, #454cc9);
|
|
14
|
+
--_k096v42-1-6-0: var(--dt-colors-border-primary-default, #ccd3f3);
|
|
15
15
|
}
|
|
16
|
-
._k096v47-1-
|
|
17
|
-
--_k096v40-1-
|
|
18
|
-
--_k096v41-1-
|
|
19
|
-
--_k096v42-1-
|
|
16
|
+
._k096v47-1-6-0 {
|
|
17
|
+
--_k096v40-1-6-0: var(--dt-colors-text-success-default, #2c6360);
|
|
18
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-success-default, #2c6360);
|
|
19
|
+
--_k096v42-1-6-0: var(--dt-colors-border-success-default, #cad6d7);
|
|
20
20
|
}
|
|
21
|
-
._k096v48-1-
|
|
22
|
-
--_k096v40-1-
|
|
23
|
-
--_k096v41-1-
|
|
24
|
-
--_k096v42-1-
|
|
21
|
+
._k096v48-1-6-0 {
|
|
22
|
+
--_k096v40-1-6-0: var(--dt-colors-text-warning-default, #805100);
|
|
23
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-warning-default, #805100);
|
|
24
|
+
--_k096v42-1-6-0: var(--dt-colors-border-warning-default, #f4e5d5);
|
|
25
25
|
}
|
|
26
|
-
._k096v4d-1-
|
|
27
|
-
--_k096v40-1-
|
|
28
|
-
--_k096v41-1-
|
|
29
|
-
--_k096v42-1-
|
|
26
|
+
._k096v4d-1-6-0 {
|
|
27
|
+
--_k096v40-1-6-0: var(--dt-colors-text-primary-on-accent-default, #f4f4fb);
|
|
28
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-primary-on-accent-default, #f4f4fb);
|
|
29
|
+
--_k096v42-1-6-0: var(--dt-colors-border-primary-accent, #454cc9);
|
|
30
30
|
}
|
|
31
|
-
._k096v4e-1-
|
|
32
|
-
--_k096v40-1-
|
|
33
|
-
--_k096v41-1-
|
|
34
|
-
--_k096v42-1-
|
|
31
|
+
._k096v4e-1-6-0 {
|
|
32
|
+
--_k096v40-1-6-0: var(--dt-colors-text-success-on-accent-default, #f1f4f4);
|
|
33
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-success-on-accent-default, #f1f4f4);
|
|
34
|
+
--_k096v42-1-6-0: var(--dt-colors-border-success-accent, #2c6360);
|
|
35
35
|
}
|
|
36
|
-
._k096v4f-1-
|
|
37
|
-
--_k096v40-1-
|
|
38
|
-
--_k096v41-1-
|
|
39
|
-
--_k096v42-1-
|
|
36
|
+
._k096v4f-1-6-0 {
|
|
37
|
+
--_k096v40-1-6-0: var(--dt-colors-text-warning-on-accent-default, #272025);
|
|
38
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-warning-on-accent-default, #272025);
|
|
39
|
+
--_k096v42-1-6-0: var(--dt-colors-border-warning-accent, #805100);
|
|
40
40
|
}
|
|
41
|
-
._k096v4g-1-
|
|
42
|
-
--_k096v40-1-
|
|
43
|
-
--_k096v41-1-
|
|
44
|
-
--_k096v42-1-
|
|
41
|
+
._k096v4g-1-6-0 {
|
|
42
|
+
--_k096v40-1-6-0: var(--dt-colors-text-critical-on-accent-default, #f9f1f3);
|
|
43
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-critical-on-accent-default, #f9f1f3);
|
|
44
|
+
--_k096v42-1-6-0: var(--dt-colors-border-critical-accent, #b80031);
|
|
45
45
|
}
|
|
46
|
-
._k096v4h-1-
|
|
47
|
-
--_k096v40-1-
|
|
48
|
-
--_k096v41-1-
|
|
49
|
-
--_k096v42-1-
|
|
46
|
+
._k096v4h-1-6-0 {
|
|
47
|
+
--_k096v40-1-6-0: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
|
|
48
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-neutral-on-accent-default, #f3f3f6);
|
|
49
|
+
--_k096v42-1-6-0: var(--dt-colors-border-neutral-accent, #545587);
|
|
50
50
|
}
|
|
51
|
-
._k096v4i-1-
|
|
52
|
-
--_k096v40-1-
|
|
53
|
-
--_k096v41-1-
|
|
54
|
-
--_k096v42-1-
|
|
51
|
+
._k096v4i-1-6-0 {
|
|
52
|
+
--_k096v40-1-6-0: var(--dt-colors-text-primary-disabled, #54558780);
|
|
53
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-primary-disabled, #54558780);
|
|
54
|
+
--_k096v42-1-6-0: var(--dt-colors-border-primary-disabled, #d2d3e180);
|
|
55
55
|
}
|
|
56
|
-
._k096v4j-1-
|
|
57
|
-
--_k096v40-1-
|
|
58
|
-
--_k096v41-1-
|
|
59
|
-
--_k096v42-1-
|
|
56
|
+
._k096v4j-1-6-0 {
|
|
57
|
+
--_k096v40-1-6-0: var(--dt-colors-text-success-disabled, #54558780);
|
|
58
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-success-disabled, #54558780);
|
|
59
|
+
--_k096v42-1-6-0: var(--dt-colors-border-success-disabled, #d2d3e180);
|
|
60
60
|
}
|
|
61
|
-
._k096v4k-1-
|
|
62
|
-
--_k096v40-1-
|
|
63
|
-
--_k096v41-1-
|
|
64
|
-
--_k096v42-1-
|
|
61
|
+
._k096v4k-1-6-0 {
|
|
62
|
+
--_k096v40-1-6-0: var(--dt-colors-text-warning-disabled, #54558780);
|
|
63
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-warning-disabled, #54558780);
|
|
64
|
+
--_k096v42-1-6-0: var(--dt-colors-border-warning-disabled, #d2d3e180);
|
|
65
65
|
}
|
|
66
|
-
._k096v4l-1-
|
|
67
|
-
--_k096v40-1-
|
|
68
|
-
--_k096v41-1-
|
|
69
|
-
--_k096v42-1-
|
|
66
|
+
._k096v4l-1-6-0 {
|
|
67
|
+
--_k096v40-1-6-0: var(--dt-colors-text-critical-disabled, #54558780);
|
|
68
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-critical-disabled, #54558780);
|
|
69
|
+
--_k096v42-1-6-0: var(--dt-colors-border-critical-disabled, #d2d3e180);
|
|
70
70
|
}
|
|
71
|
-
._k096v4m-1-
|
|
72
|
-
--_k096v40-1-
|
|
73
|
-
--_k096v41-1-
|
|
74
|
-
--_k096v42-1-
|
|
71
|
+
._k096v4m-1-6-0 {
|
|
72
|
+
--_k096v40-1-6-0: var(--dt-colors-text-neutral-disabled, #54558780);
|
|
73
|
+
--_k096v41-1-6-0: var(--dt-colors-icon-neutral-disabled, #54558780);
|
|
74
|
+
--_k096v42-1-6-0: var(--dt-colors-border-neutral-disabled, #d2d3e180);
|
|
75
75
|
}
|
|
@@ -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,5 +24,5 @@ __export(colorUtils_css_exports, {
|
|
|
23
24
|
module.exports = __toCommonJS(colorUtils_css_exports);
|
|
24
25
|
var import_colorUtils_css_ts_vanilla = require("./colorUtils.css");
|
|
25
26
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
26
|
-
var colorUtilsCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_k096v43-1-
|
|
27
|
-
var colorUtilsVars = { text: "var(--_k096v40-1-
|
|
27
|
+
var colorUtilsCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_k096v43-1-6-0", variantClassNames: { color: { critical: "_k096v44-1-6-0", neutral: "_k096v45-1-6-0", primary: "_k096v46-1-6-0", success: "_k096v47-1-6-0", warning: "_k096v48-1-6-0" }, variant: { "default": "_k096v49-1-6-0", accent: "_k096v4a-1-6-0" }, disabled: { true: "_k096v4b-1-6-0", false: "_k096v4c-1-6-0" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "_k096v4d-1-6-0"], [{ color: "success", variant: "accent" }, "_k096v4e-1-6-0"], [{ color: "warning", variant: "accent" }, "_k096v4f-1-6-0"], [{ color: "critical", variant: "accent" }, "_k096v4g-1-6-0"], [{ color: "neutral", variant: "accent" }, "_k096v4h-1-6-0"], [{ color: "primary", disabled: true }, "_k096v4i-1-6-0"], [{ color: "success", disabled: true }, "_k096v4j-1-6-0"], [{ color: "warning", disabled: true }, "_k096v4k-1-6-0"], [{ color: "critical", disabled: true }, "_k096v4l-1-6-0"], [{ color: "neutral", disabled: true }, "_k096v4m-1-6-0"]] });
|
|
28
|
+
var colorUtilsVars = { text: "var(--_k096v40-1-6-0)", icon: "var(--_k096v41-1-6-0)", borderColor: "var(--_k096v42-1-6-0)" };
|
package/core/utils/isBrowser.js
CHANGED
package/core/utils/uuidv4.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
._10kgnsa0-1-
|
|
1
|
+
._10kgnsa0-1-6-0 {
|
|
2
2
|
font-family: var(--dt-typography-text-base-default-family, DynatraceFlow,Roboto,Helvetica,sans-serif);
|
|
3
3
|
font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
|
|
4
4
|
font-size: var(--dt-typography-text-base-default-size, 14px);
|
|
5
5
|
line-height: var(--dt-typography-text-base-default-line-height, 1.4285714286);
|
|
6
6
|
text-decoration: var(--dt-typography-text-base-default-text-decoration, none);
|
|
7
7
|
text-transform: none;
|
|
8
|
-
background: var(--_bx32h3-1-
|
|
9
|
-
color: var(--_bx32h0-1-
|
|
8
|
+
background: var(--_bx32h3-1-6-0);
|
|
9
|
+
color: var(--_bx32h0-1-6-0);
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
position: relative;
|
|
12
12
|
align-items: center;
|
|
@@ -19,50 +19,46 @@
|
|
|
19
19
|
border-style: solid;
|
|
20
20
|
border-width: 0;
|
|
21
21
|
border-radius: var(--dt-borders-radius-field-default, 8px);
|
|
22
|
-
transition-timing-function: var(--dt-animations-
|
|
23
|
-
transition-duration: var(--dt-animations-
|
|
22
|
+
transition-timing-function: var(--dt-animations-hover-easing, cubic-bezier(0, 0, 0.2, 1));
|
|
23
|
+
transition-duration: var(--dt-animations-hover-duration-base, 150ms);
|
|
24
24
|
transition-property: color, background-color, transform;
|
|
25
25
|
}
|
|
26
|
-
.
|
|
27
|
-
transition-timing-function: var(--dt-animations-fade-in-easing, cubic-bezier(0.5, 0, 1, 1));
|
|
28
|
-
transition-duration: var(--dt-animations-fade-in-duration-base, 250ms);
|
|
29
|
-
}
|
|
30
|
-
._10kgnsa1-1-4-0 {
|
|
26
|
+
._10kgnsa1-1-6-0 {
|
|
31
27
|
text-align: start;
|
|
32
28
|
justify-content: space-between;
|
|
33
29
|
}
|
|
34
|
-
._10kgnsa2-1-
|
|
30
|
+
._10kgnsa2-1-6-0 {
|
|
35
31
|
text-align: center;
|
|
36
32
|
justify-content: center;
|
|
37
33
|
}
|
|
38
|
-
._10kgnsa3-1-
|
|
34
|
+
._10kgnsa3-1-6-0 {
|
|
39
35
|
padding-top: var(--dt-spacings-size-2, 2px);
|
|
40
36
|
padding-bottom: var(--dt-spacings-size-2, 2px);
|
|
41
37
|
padding-left: var(--dt-spacings-size-4, 4px);
|
|
42
38
|
padding-right: var(--dt-spacings-size-4, 4px);
|
|
43
39
|
gap: var(--dt-spacings-size-2, 2px);
|
|
44
40
|
}
|
|
45
|
-
._10kgnsa4-1-
|
|
41
|
+
._10kgnsa4-1-6-0 {
|
|
46
42
|
padding-top: var(--dt-spacings-size-6, 6px);
|
|
47
43
|
padding-bottom: var(--dt-spacings-size-6, 6px);
|
|
48
44
|
padding-left: var(--dt-spacings-size-8, 8px);
|
|
49
45
|
padding-right: var(--dt-spacings-size-8, 8px);
|
|
50
46
|
gap: var(--dt-spacings-size-4, 4px);
|
|
51
47
|
}
|
|
52
|
-
._10kgnsa5-1-
|
|
48
|
+
._10kgnsa5-1-6-0 {
|
|
53
49
|
cursor: not-allowed;
|
|
54
50
|
}
|
|
55
|
-
._10kgnsa6-1-
|
|
51
|
+
._10kgnsa6-1-6-0 {
|
|
56
52
|
cursor: not-allowed;
|
|
57
|
-
background: var(--_bx32h2-1-
|
|
53
|
+
background: var(--_bx32h2-1-6-0);
|
|
58
54
|
}
|
|
59
|
-
._10kgnsa7-1-
|
|
55
|
+
._10kgnsa7-1-6-0 {
|
|
60
56
|
width: 100%;
|
|
61
57
|
}
|
|
62
|
-
._10kgnsa8-1-
|
|
58
|
+
._10kgnsa8-1-6-0 {
|
|
63
59
|
width: fit-content;
|
|
64
60
|
}
|
|
65
|
-
._10kgnsa9-1-
|
|
61
|
+
._10kgnsa9-1-6-0 {
|
|
66
62
|
position: absolute;
|
|
67
63
|
top: 0;
|
|
68
64
|
left: 0;
|
|
@@ -74,19 +70,19 @@
|
|
|
74
70
|
align-items: center;
|
|
75
71
|
z-index: 1;
|
|
76
72
|
}
|
|
77
|
-
._10kgnsa3-1-
|
|
73
|
+
._10kgnsa3-1-6-0 ._10kgnsaa-1-6-0:not(:has(svg:only-child)) {
|
|
78
74
|
padding-top: 0;
|
|
79
75
|
padding-bottom: 0;
|
|
80
76
|
padding-left: 2px;
|
|
81
77
|
padding-right: 2px;
|
|
82
78
|
}
|
|
83
|
-
._10kgnsa4-1-
|
|
79
|
+
._10kgnsa4-1-6-0 ._10kgnsaa-1-6-0:not(:has(svg:only-child)) {
|
|
84
80
|
padding-top: 0;
|
|
85
81
|
padding-bottom: 0;
|
|
86
82
|
padding-left: 4px;
|
|
87
83
|
padding-right: 4px;
|
|
88
84
|
}
|
|
89
|
-
._10kgnsac-1-
|
|
85
|
+
._10kgnsac-1-6-0 {
|
|
90
86
|
display: inline-flex;
|
|
91
87
|
min-width: 0;
|
|
92
88
|
max-width: 100%;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
1
2
|
import clsx from "clsx";
|
|
2
|
-
import
|
|
3
|
+
import {
|
|
3
4
|
forwardRef,
|
|
4
|
-
useMemo
|
|
5
|
+
useMemo,
|
|
6
|
+
Children
|
|
5
7
|
} from "react";
|
|
6
8
|
import { useIntl } from "react-intl";
|
|
7
9
|
import { isElement } from "react-is";
|
|
@@ -19,7 +21,7 @@ import { Grid } from "../../layouts/grid/Grid.js";
|
|
|
19
21
|
import { fieldColorsCSS } from "../../styles/field.sty.js";
|
|
20
22
|
function getButtonSlots(children) {
|
|
21
23
|
const slots = {};
|
|
22
|
-
|
|
24
|
+
Children.forEach(children, (child) => {
|
|
23
25
|
if (isElement(child)) {
|
|
24
26
|
switch (child.type) {
|
|
25
27
|
case Suffix:
|
|
@@ -137,7 +139,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
137
139
|
const intl = useIntl();
|
|
138
140
|
const Component = as || "button";
|
|
139
141
|
if (!hasChildren) {
|
|
140
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
141
143
|
Component,
|
|
142
144
|
{
|
|
143
145
|
...buttonMergedProps,
|
|
@@ -163,7 +165,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
163
165
|
}
|
|
164
166
|
);
|
|
165
167
|
}
|
|
166
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ jsxs(
|
|
167
169
|
Component,
|
|
168
170
|
{
|
|
169
171
|
className: clsx(
|
|
@@ -190,36 +192,48 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
190
192
|
width: width !== "content" && width !== "full" ? width : void 0,
|
|
191
193
|
...consumerStyle
|
|
192
194
|
},
|
|
193
|
-
...buttonMergedProps
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
195
|
+
...buttonMergedProps,
|
|
196
|
+
children: [
|
|
197
|
+
loading && /* @__PURE__ */ jsx("div", { className: buttonLoadingCSS, children: /* @__PURE__ */ jsx(
|
|
198
|
+
ProgressCircle,
|
|
199
|
+
{
|
|
200
|
+
size: "small",
|
|
201
|
+
color,
|
|
202
|
+
"aria-label": intl.formatMessage({
|
|
203
|
+
defaultMessage: "Loading",
|
|
204
|
+
id: "cycz+bYG+VH7Of4e",
|
|
205
|
+
description: "Label for the loading state."
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
) }),
|
|
209
|
+
/* @__PURE__ */ jsxs(
|
|
210
|
+
Grid,
|
|
211
|
+
{
|
|
212
|
+
gap: size === "default" ? 4 : 2,
|
|
213
|
+
grid: "auto / auto-flow auto",
|
|
214
|
+
width: "100%",
|
|
215
|
+
maxWidth: "100%",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
justifyContent: textAlign === "start" ? "space-between" : "center",
|
|
218
|
+
style: {
|
|
219
|
+
visibility: loading ? "hidden" : void 0
|
|
220
|
+
},
|
|
221
|
+
children: [
|
|
222
|
+
textAlign === "start" ? /* @__PURE__ */ jsxs(Flex, { minWidth: 0, gap: size === "default" ? 4 : 2, children: [
|
|
223
|
+
slots.prefix,
|
|
224
|
+
slots.label,
|
|
225
|
+
slots.freeform && /* @__PURE__ */ jsx(Button.Label, { children: slots.freeform })
|
|
226
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
227
|
+
slots.prefix,
|
|
228
|
+
slots.label,
|
|
229
|
+
slots.freeform && /* @__PURE__ */ jsx(Button.Label, { children: slots.freeform })
|
|
230
|
+
] }),
|
|
231
|
+
slots.suffix
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
]
|
|
236
|
+
}
|
|
223
237
|
);
|
|
224
238
|
}
|
|
225
239
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/buttons/button/Button.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport * as CSS from 'csstype';\nimport React, {\n type ElementType,\n type MouseEventHandler,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useMemo,\n} from 'react';\nimport { useIntl } from 'react-intl';\nimport { isElement } from 'react-is';\n\nimport { buttonCSS, buttonLoadingCSS, buttonWidthsCSS } from './Button.sty.js';\nimport { Label } from './Label.js';\nimport { Prefix } from './Prefix.js';\nimport { Suffix } from './Suffix.js';\nimport { ProgressCircle } from '../../content/progress/ProgressCircle.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useFocusRing } from '../../core/styles/useFocusRing.js';\nimport {\n type AriaDisabledProps,\n type AriaLabelingProps,\n} from '../../core/types/a11y-props.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type PolymorphicComponentProps } from '../../core/types/polymorph.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { mergeProps } from '../../core/utils/merge-props.js';\nimport { parseBoolean } from '../../core/utils/parse-boolean.js';\nimport { Flex } from '../../layouts/flex/Flex.js';\nimport { Grid } from '../../layouts/grid/Grid.js';\nimport { fieldColorsCSS } from '../../styles/field.sty.js';\n\n//#region Typings\n\n/**\n * Accepted properties for the Button.\n * @public\n */\nexport interface ButtonOwnProps\n extends AriaLabelingProps,\n AriaDisabledProps,\n WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * If a button is disabled e.g. it cannot be interacted with.\n * @defaultValue false\n */\n disabled?: boolean;\n\n /**\n * Different variants have different styles.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'emphasized' | 'accent';\n\n /**\n * The HTML button type.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type}\n * @defaultValue 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n\n /** Called when the button is interacted with. */\n onClick?: MouseEventHandler;\n\n /**\n * The width of the button.\n * @defaultValue 'content'\n */\n // eslint-disable-next-line @typescript-eslint/no-restricted-types\n width?: 'content' | 'full' | CSS.Property.Width<string & {}>;\n\n /**\n * The color of the button. This should be chosen based on the context\n * the button is used in.\n * @defaultValue 'neutral'\n */\n color?: 'primary' | 'neutral' | 'success' | 'critical' | 'warning';\n\n /**\n * Controls the text alignment inside the button. Only affects the button\n * if the width is not set to 'content'.\n * @defaultValue 'center'\n */\n textAlign?: 'center' | 'start';\n\n /**\n * The size of the button.\n * @defaultValue 'default'\n */\n size?: 'default' | 'condensed';\n\n /**\n * The current loading state of the button. If true, a loading icon is shown and the button is disabled.\n * @defaultValue false\n */\n loading?: boolean;\n\n /**\n * Determines whether the element is in read-only mode.\n * @defaultValue false\n * @deprecated - readOnly is not a valid property on a button. Please use disabled if needed.\n */\n readOnly?: boolean;\n}\n\n/**\n * Merge own props with others inherited from the underlying element type.\n * @public\n */\nexport type ButtonProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n ButtonOwnProps\n>;\n\ntype ButtonSlots = {\n label?: ReactNode;\n prefix?: ReactNode;\n suffix?: ReactNode;\n freeform?: ReactNode[];\n};\n\n//#endregion\n\n/**\n * Iterates over child nodes to extract specific component slots.\n * @public\n */\nexport default function getButtonSlots(children: ReactNode) {\n const slots: ButtonSlots = {};\n\n React.Children.forEach(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case Suffix:\n slots.suffix = child;\n break;\n case Prefix:\n slots.prefix = child;\n break;\n case Label:\n slots.label = child;\n break;\n default:\n slots.freeform ??= [];\n slots.freeform.push(child);\n break;\n }\n } else {\n if (child !== null && child !== undefined) {\n slots.freeform ??= [];\n slots.freeform.push(child);\n }\n }\n });\n\n return slots;\n}\n\nexport const _Button: <E extends ElementType = 'button'>(\n props: ButtonProps<E>,\n) => ReactElement | null = /* @__PURE__ */ forwardRef(\n <E extends ElementType>(props: ButtonProps<E>, ref: typeof props.ref) => {\n const {\n children,\n variant = 'default',\n disabled,\n 'aria-disabled': ariaDisabledProp,\n required,\n id: propId,\n type = 'button',\n onClick,\n ariaLabel,\n width = 'content',\n color = 'neutral',\n textAlign = 'center',\n size = 'default',\n loading = false,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n // eslint-disable-next-line deprecation/deprecation\n readOnly,\n as,\n ...remainingProps\n }: ButtonProps<E> = props;\n const slots = getButtonSlots(children);\n\n const ariaDisabled = parseBoolean(ariaDisabledProp);\n\n const nativeDisabledOrLoading = useMemo(\n () => (loading ? true : disabled),\n [disabled, loading],\n );\n const disabledOrLoading = useMemo(\n () => nativeDisabledOrLoading || ariaDisabled,\n [ariaDisabled, nativeDisabledOrLoading],\n );\n\n const { focusProps, focusClassName } = useFocusRing({\n variant: !disabledOrLoading ? color : 'neutral',\n disabled: nativeDisabledOrLoading,\n });\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n\n const handleButtonClick: MouseEventHandler<HTMLElement> = (event) => {\n if (nativeDisabledOrLoading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n onClick?.(event);\n };\n\n const buttonProps = {\n ref,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n required,\n disabled: nativeDisabledOrLoading && !ariaDisabled,\n id: propId,\n type,\n ...ariaLabelingProps,\n 'aria-disabled': ariaDisabledProp,\n onClick: handleButtonClick,\n };\n\n // Propagation needs to be disabled on the disabled button because\n // it would still trigger actions on parents that would listen to it.\n // For example the menu or the useOverlay hook.\n const disabledPropagationProps = {\n onPointerDown(evt: PointerEvent) {\n if (nativeDisabledOrLoading) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n },\n onPointerUp(evt: PointerEvent) {\n if (nativeDisabledOrLoading) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n },\n };\n\n const hasChildren = children || children === 0;\n\n const buttonMergedProps = {\n ...mergeProps(\n buttonProps,\n disabledPropagationProps,\n // Need to cast this one as the inference of mergeProps would generate\n // a not allowed overlap. The remainingProps type is too complex due to the\n // polymorphic inheritance.\n remainingProps as Record<string, unknown>,\n focusProps,\n ),\n };\n\n const intl = useIntl();\n\n // Make the component polymorphic\n const Component = as || 'button';\n\n // Render a void element if no children are set and it's not loading (so self-closing polymorphed tags won't break)\n if (!hasChildren) {\n return (\n <Component\n {...buttonMergedProps}\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColorsCSS({ variant, color, disabled: disabledOrLoading }),\n buttonCSS({\n disabled: disabledOrLoading,\n textAlign,\n size,\n readOnly,\n }),\n focusClassName,\n {\n [`${buttonWidthsCSS.content}`]: width === 'content',\n [`${buttonWidthsCSS.full}`]: width === 'full',\n },\n )}\n style={{\n width: width !== 'content' && width !== 'full' ? width : undefined,\n }}\n />\n );\n }\n\n return (\n <Component\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColorsCSS({\n variant,\n color,\n disabled: disabledOrLoading || ariaDisabled,\n }),\n buttonCSS({\n disabled: disabledOrLoading || ariaDisabled,\n textAlign,\n size,\n readOnly,\n }),\n {\n [`${buttonWidthsCSS.content}`]: width === 'content',\n [`${buttonWidthsCSS.full}`]: width === 'full',\n },\n focusClassName,\n )}\n style={{\n width: width !== 'content' && width !== 'full' ? width : undefined,\n ...consumerStyle,\n }}\n {...buttonMergedProps}\n >\n {loading && (\n <div className={buttonLoadingCSS}>\n <ProgressCircle\n size=\"small\"\n color={color}\n aria-label={intl.formatMessage({\n defaultMessage: 'Loading',\n id: 'cycz+bYG+VH7Of4e',\n description: 'Label for the loading state.',\n })}\n />\n </div>\n )}\n <Grid\n gap={size === 'default' ? 4 : 2}\n grid=\"auto / auto-flow auto\"\n width={'100%'}\n maxWidth=\"100%\"\n alignItems=\"center\"\n justifyContent={textAlign === 'start' ? 'space-between' : 'center'}\n style={{\n visibility: loading ? 'hidden' : undefined,\n }}\n >\n {textAlign === 'start' ? (\n <Flex minWidth={0} gap={size === 'default' ? 4 : 2}>\n {slots.prefix}\n {slots.label}\n {slots.freeform && <Button.Label>{slots.freeform}</Button.Label>}\n </Flex>\n ) : (\n <>\n {slots.prefix}\n {slots.label}\n {slots.freeform && <Button.Label>{slots.freeform}</Button.Label>}\n </>\n )}\n {slots.suffix}\n </Grid>\n </Component>\n );\n },\n);\n\n(_Button as typeof _Button & { displayName: string }).displayName = 'Button';\n\n/**\n * Buttons allow users to trigger actions or events\n * with a single click anywhere within the button container.\n * Users can also trigger a button by pressing\n * `Enter` or `Space` while the button has focus.\n * @public\n */\nexport const Button = Object.assign(_Button, {\n Suffix,\n Prefix,\n Label,\n});\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport * as CSS from 'csstype';\nimport {\n type ElementType,\n type MouseEventHandler,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useMemo,\n Children,\n} from 'react';\nimport { useIntl } from 'react-intl';\nimport { isElement } from 'react-is';\n\nimport { buttonCSS, buttonLoadingCSS, buttonWidthsCSS } from './Button.sty.js';\nimport { Label } from './Label.js';\nimport { Prefix } from './Prefix.js';\nimport { Suffix } from './Suffix.js';\nimport { ProgressCircle } from '../../content/progress/ProgressCircle.js';\nimport { useAriaLabelingProps } from '../../core/hooks/useAriaLabelingProps.js';\nimport { useFocusRing } from '../../core/styles/useFocusRing.js';\nimport {\n type AriaDisabledProps,\n type AriaLabelingProps,\n} from '../../core/types/a11y-props.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type MaskingProps } from '../../core/types/masking-props.js';\nimport { type PolymorphicComponentProps } from '../../core/types/polymorph.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { type WithChildren } from '../../core/types/with-children.js';\nimport { mergeProps } from '../../core/utils/merge-props.js';\nimport { parseBoolean } from '../../core/utils/parse-boolean.js';\nimport { Flex } from '../../layouts/flex/Flex.js';\nimport { Grid } from '../../layouts/grid/Grid.js';\nimport { fieldColorsCSS } from '../../styles/field.sty.js';\n\n//#region Typings\n\n/**\n * Accepted properties for the Button.\n * @public\n */\nexport interface ButtonOwnProps\n extends AriaLabelingProps,\n AriaDisabledProps,\n WithChildren,\n StylingProps,\n DataTestId,\n MaskingProps {\n /**\n * If a button is disabled e.g. it cannot be interacted with.\n * @defaultValue false\n */\n disabled?: boolean;\n\n /**\n * Different variants have different styles.\n * @defaultValue 'default'\n */\n variant?: 'default' | 'emphasized' | 'accent';\n\n /**\n * The HTML button type.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type}\n * @defaultValue 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n\n /** Called when the button is interacted with. */\n onClick?: MouseEventHandler;\n\n /**\n * The width of the button.\n * @defaultValue 'content'\n */\n // eslint-disable-next-line @typescript-eslint/no-restricted-types\n width?: 'content' | 'full' | CSS.Property.Width<string & {}>;\n\n /**\n * The color of the button. This should be chosen based on the context\n * the button is used in.\n * @defaultValue 'neutral'\n */\n color?: 'primary' | 'neutral' | 'success' | 'critical' | 'warning';\n\n /**\n * Controls the text alignment inside the button. Only affects the button\n * if the width is not set to 'content'.\n * @defaultValue 'center'\n */\n textAlign?: 'center' | 'start';\n\n /**\n * The size of the button.\n * @defaultValue 'default'\n */\n size?: 'default' | 'condensed';\n\n /**\n * The current loading state of the button. If true, a loading icon is shown and the button is disabled.\n * @defaultValue false\n */\n loading?: boolean;\n\n /**\n * Determines whether the element is in read-only mode.\n * @defaultValue false\n * @deprecated - readOnly is not a valid property on a button. Please use disabled if needed.\n */\n readOnly?: boolean;\n}\n\n/**\n * Merge own props with others inherited from the underlying element type.\n * @public\n */\nexport type ButtonProps<E extends ElementType> = PolymorphicComponentProps<\n E,\n ButtonOwnProps\n>;\n\ntype ButtonSlots = {\n label?: ReactNode;\n prefix?: ReactNode;\n suffix?: ReactNode;\n freeform?: ReactNode[];\n};\n\n//#endregion\n\n/**\n * Iterates over child nodes to extract specific component slots.\n * @public\n */\nexport default function getButtonSlots(children: ReactNode) {\n const slots: ButtonSlots = {};\n\n Children.forEach(children, (child) => {\n if (isElement(child)) {\n switch (child.type) {\n case Suffix:\n slots.suffix = child;\n break;\n case Prefix:\n slots.prefix = child;\n break;\n case Label:\n slots.label = child;\n break;\n default:\n slots.freeform ??= [];\n slots.freeform.push(child);\n break;\n }\n } else {\n if (child !== null && child !== undefined) {\n slots.freeform ??= [];\n slots.freeform.push(child);\n }\n }\n });\n\n return slots;\n}\n\nexport const _Button: <E extends ElementType = 'button'>(\n props: ButtonProps<E>,\n) => ReactElement | null = /* @__PURE__ */ forwardRef(\n <E extends ElementType>(props: ButtonProps<E>, ref: typeof props.ref) => {\n const {\n children,\n variant = 'default',\n disabled,\n 'aria-disabled': ariaDisabledProp,\n required,\n id: propId,\n type = 'button',\n onClick,\n ariaLabel,\n width = 'content',\n color = 'neutral',\n textAlign = 'center',\n size = 'default',\n loading = false,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n // eslint-disable-next-line deprecation/deprecation\n readOnly,\n as,\n ...remainingProps\n }: ButtonProps<E> = props;\n const slots = getButtonSlots(children);\n\n const ariaDisabled = parseBoolean(ariaDisabledProp);\n\n const nativeDisabledOrLoading = useMemo(\n () => (loading ? true : disabled),\n [disabled, loading],\n );\n const disabledOrLoading = useMemo(\n () => nativeDisabledOrLoading || ariaDisabled,\n [ariaDisabled, nativeDisabledOrLoading],\n );\n\n const { focusProps, focusClassName } = useFocusRing({\n variant: !disabledOrLoading ? color : 'neutral',\n disabled: nativeDisabledOrLoading,\n });\n\n const ariaLabelingProps = useAriaLabelingProps(remainingProps);\n\n const handleButtonClick: MouseEventHandler<HTMLElement> = (event) => {\n if (nativeDisabledOrLoading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n onClick?.(event);\n };\n\n const buttonProps = {\n ref,\n 'data-testid': dataTestId,\n 'data-dtrum-mask': dataDtrumMask,\n 'data-dtrum-allow': dataDtrumAllow,\n required,\n disabled: nativeDisabledOrLoading && !ariaDisabled,\n id: propId,\n type,\n ...ariaLabelingProps,\n 'aria-disabled': ariaDisabledProp,\n onClick: handleButtonClick,\n };\n\n // Propagation needs to be disabled on the disabled button because\n // it would still trigger actions on parents that would listen to it.\n // For example the menu or the useOverlay hook.\n const disabledPropagationProps = {\n onPointerDown(evt: PointerEvent) {\n if (nativeDisabledOrLoading) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n },\n onPointerUp(evt: PointerEvent) {\n if (nativeDisabledOrLoading) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n },\n };\n\n const hasChildren = children || children === 0;\n\n const buttonMergedProps = {\n ...mergeProps(\n buttonProps,\n disabledPropagationProps,\n // Need to cast this one as the inference of mergeProps would generate\n // a not allowed overlap. The remainingProps type is too complex due to the\n // polymorphic inheritance.\n remainingProps as Record<string, unknown>,\n focusProps,\n ),\n };\n\n const intl = useIntl();\n\n // Make the component polymorphic\n const Component = as || 'button';\n\n // Render a void element if no children are set and it's not loading (so self-closing polymorphed tags won't break)\n if (!hasChildren) {\n return (\n <Component\n {...buttonMergedProps}\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColorsCSS({ variant, color, disabled: disabledOrLoading }),\n buttonCSS({\n disabled: disabledOrLoading,\n textAlign,\n size,\n readOnly,\n }),\n focusClassName,\n {\n [`${buttonWidthsCSS.content}`]: width === 'content',\n [`${buttonWidthsCSS.full}`]: width === 'full',\n },\n )}\n style={{\n width: width !== 'content' && width !== 'full' ? width : undefined,\n }}\n />\n );\n }\n\n return (\n <Component\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColorsCSS({\n variant,\n color,\n disabled: disabledOrLoading || ariaDisabled,\n }),\n buttonCSS({\n disabled: disabledOrLoading || ariaDisabled,\n textAlign,\n size,\n readOnly,\n }),\n {\n [`${buttonWidthsCSS.content}`]: width === 'content',\n [`${buttonWidthsCSS.full}`]: width === 'full',\n },\n focusClassName,\n )}\n style={{\n width: width !== 'content' && width !== 'full' ? width : undefined,\n ...consumerStyle,\n }}\n {...buttonMergedProps}\n >\n {loading && (\n <div className={buttonLoadingCSS}>\n <ProgressCircle\n size=\"small\"\n color={color}\n aria-label={intl.formatMessage({\n defaultMessage: 'Loading',\n id: 'cycz+bYG+VH7Of4e',\n description: 'Label for the loading state.',\n })}\n />\n </div>\n )}\n <Grid\n gap={size === 'default' ? 4 : 2}\n grid=\"auto / auto-flow auto\"\n width={'100%'}\n maxWidth=\"100%\"\n alignItems=\"center\"\n justifyContent={textAlign === 'start' ? 'space-between' : 'center'}\n style={{\n visibility: loading ? 'hidden' : undefined,\n }}\n >\n {textAlign === 'start' ? (\n <Flex minWidth={0} gap={size === 'default' ? 4 : 2}>\n {slots.prefix}\n {slots.label}\n {slots.freeform && <Button.Label>{slots.freeform}</Button.Label>}\n </Flex>\n ) : (\n <>\n {slots.prefix}\n {slots.label}\n {slots.freeform && <Button.Label>{slots.freeform}</Button.Label>}\n </>\n )}\n {slots.suffix}\n </Grid>\n </Component>\n );\n },\n);\n\n(_Button as typeof _Button & { displayName: string }).displayName = 'Button';\n\n/**\n * Buttons allow users to trigger actions or events\n * with a single click anywhere within the button container.\n * Users can also trigger a button by pressing\n * `Enter` or `Space` while the button has focus.\n * @public\n */\nexport const Button = Object.assign(_Button, {\n Suffix,\n Prefix,\n Label,\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,10 +2,10 @@ import "../../styles/ellipsis.css";
|
|
|
2
2
|
import "../../styles/field.css";
|
|
3
3
|
import "./Button.css";
|
|
4
4
|
import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
|
-
var buttonCSS = _7a468({ defaultClassName: "_10kgnsa0-1-
|
|
6
|
-
var buttonLabelCSS = _7a468({ defaultClassName: "_10kgnsaa-1-
|
|
7
|
-
var buttonLoadingCSS = "_10kgnsa9-1-
|
|
8
|
-
var buttonWidthsCSS = { full: "_10kgnsa7-1-
|
|
5
|
+
var buttonCSS = _7a468({ defaultClassName: "_10kgnsa0-1-6-0", variantClassNames: { textAlign: { start: "_10kgnsa1-1-6-0", center: "_10kgnsa2-1-6-0" }, size: { condensed: "_10kgnsa3-1-6-0", "default": "_10kgnsa4-1-6-0" }, disabled: { true: "_10kgnsa5-1-6-0" }, readOnly: { true: "_10kgnsa6-1-6-0" } }, defaultVariants: { size: "default", textAlign: "center", disabled: false }, compoundVariants: [] });
|
|
6
|
+
var buttonLabelCSS = _7a468({ defaultClassName: "_10kgnsaa-1-6-0", variantClassNames: { textual: { true: "_oqqp1n0-1-6-0", false: "_10kgnsac-1-6-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7
|
+
var buttonLoadingCSS = "_10kgnsa9-1-6-0";
|
|
8
|
+
var buttonWidthsCSS = { full: "_10kgnsa7-1-6-0", content: "_10kgnsa8-1-6-0" };
|
|
9
9
|
export {
|
|
10
10
|
buttonCSS,
|
|
11
11
|
buttonLabelCSS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/buttons/button/Button.css.ts"],
|
|
4
|
-
"sourcesContent": ["import '../../styles/ellipsis.css';\nimport '../../styles/field.css';\nimport './Button.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var buttonCSS = _7a468({defaultClassName:'_10kgnsa0-1-
|
|
4
|
+
"sourcesContent": ["import '../../styles/ellipsis.css';\nimport '../../styles/field.css';\nimport './Button.css';\nimport { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn';\nexport var buttonCSS = _7a468({defaultClassName:'_10kgnsa0-1-6-0',variantClassNames:{textAlign:{start:'_10kgnsa1-1-6-0',center:'_10kgnsa2-1-6-0'},size:{condensed:'_10kgnsa3-1-6-0','default':'_10kgnsa4-1-6-0'},disabled:{true:'_10kgnsa5-1-6-0'},readOnly:{true:'_10kgnsa6-1-6-0'}},defaultVariants:{size:'default',textAlign:'center',disabled:false},compoundVariants:[]});\nexport var buttonLabelCSS = _7a468({defaultClassName:'_10kgnsaa-1-6-0',variantClassNames:{textual:{true:'_oqqp1n0-1-6-0',false:'_10kgnsac-1-6-0'}},defaultVariants:{},compoundVariants:[]});\nexport var buttonLoadingCSS = '_10kgnsa9-1-6-0';\nexport var buttonWidthsCSS = {full:'_10kgnsa7-1-6-0',content:'_10kgnsa8-1-6-0'};"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,YAAY,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,WAAU,EAAC,OAAM,mBAAkB,QAAO,kBAAiB,GAAE,MAAK,EAAC,WAAU,mBAAkB,WAAU,kBAAiB,GAAE,UAAS,EAAC,MAAK,kBAAiB,GAAE,UAAS,EAAC,MAAK,kBAAiB,EAAC,GAAE,iBAAgB,EAAC,MAAK,WAAU,WAAU,UAAS,UAAS,MAAK,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACtW,IAAI,iBAAiB,OAAO,EAAC,kBAAiB,mBAAkB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,kBAAiB,OAAM,kBAAiB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AACnL,IAAI,mBAAmB;AACvB,IAAI,kBAAkB,EAAC,MAAK,mBAAkB,SAAQ,kBAAiB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import clsx from "clsx";
|
|
2
|
-
import
|
|
3
|
+
import { forwardRef } from "react";
|
|
3
4
|
import { buttonLabelCSS } from "./Button.sty.js";
|
|
4
5
|
import { isStringChildren } from "../../core/utils/_is-string-children.js";
|
|
5
6
|
const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
@@ -10,7 +11,7 @@ const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
10
11
|
"data-testid": dataTestId
|
|
11
12
|
} = props;
|
|
12
13
|
const textual = isStringChildren(children);
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
14
15
|
"div",
|
|
15
16
|
{
|
|
16
17
|
ref: forwardedRef,
|
|
@@ -20,9 +21,9 @@ const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
20
21
|
buttonLabelCSS({ textual }),
|
|
21
22
|
consumerClassName
|
|
22
23
|
),
|
|
23
|
-
style: consumerStyle
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
style: consumerStyle,
|
|
25
|
+
children
|
|
26
|
+
}
|
|
26
27
|
);
|
|
27
28
|
});
|
|
28
29
|
Label.displayName = "Button.Label";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/buttons/button/Label.tsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { buttonLabelCSS } from './Button.sty.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { isStringChildren } from '../../core/utils/_is-string-children.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button Label.\n * @public\n */\nexport interface ButtonLabelProps extends StylingProps, DataTestId {\n /** Elements to be displayed in the Button Label slot. */\n children: ReactNode;\n}\n//#endregion\n\n/**\n * Button Label component.\n * @public\n */\nexport const Label = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n ButtonLabelProps\n>((props, forwardedRef) => {\n const {\n children,\n className: consumerClassName,\n style: consumerStyle,\n 'data-testid': dataTestId,\n }: ButtonLabelProps = props;\n\n const textual = isStringChildren(children);\n\n return (\n <div\n ref={forwardedRef}\n data-testid={dataTestId}\n className={clsx(\n 'strato-button-label',\n buttonLabelCSS({ textual }),\n consumerClassName,\n )}\n style={consumerStyle}\n >\n {children}\n </div>\n );\n});\n\n(Label as typeof Label & { displayName: string }).displayName = 'Button.Label';\n"],
|
|
5
|
+
"mappings": "AAqCI;AArCJ,OAAO,UAAU;AACjB,SAAS,kBAAkC;AAE3C,SAAS,sBAAsB;AAG/B,SAAS,wBAAwB;AAiB1B,MAAM,QAAwB,2BAGnC,CAAC,OAAO,iBAAiB;AACzB,QAAM;AAAA,IACJ;AAAA,IACA,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,EACjB,IAAsB;AAEtB,QAAM,UAAU,iBAAiB,QAAQ;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA,eAAe,EAAE,QAAQ,CAAC;AAAA,QAC1B;AAAA,MACF;AAAA,MACA,OAAO;AAAA,MAEN;AAAA;AAAA,EACH;AAEJ,CAAC;AAEA,MAAiD,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|