@dynatrace/strato-components 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/buttons/button/Button.css +16 -16
- package/buttons/button/Button.js +16 -10
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/intent-button/IntentButton.d.ts +2 -0
- package/buttons/intent-button/IntentButton.js +4 -1
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.js +3 -1
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +3 -1
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +7 -7
- package/content/skeleton/Skeleton.js +3 -0
- package/content/skeleton/Skeleton.sty.js +5 -5
- package/content/skeleton/SkeletonText.js +3 -0
- package/core/components/app-root/AppRoot.js +3 -1
- package/core/hooks/useBehavioralTrackingProps.d.ts +2 -0
- package/core/hooks/useBehavioralTrackingProps.js +46 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +2 -0
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.d.ts +10 -6
- package/core/styles/focusRing.sty.js +2 -2
- package/core/styles/focusRingStatic.css +44 -0
- package/core/styles/focusRingStatic.sty.d.ts +77 -0
- package/core/styles/focusRingStatic.sty.js +26 -0
- package/core/styles/useFocusRing.d.ts +7 -6
- package/core/styles/useFocusRing.js +13 -13
- package/core/types/behavior-tracking-props.d.ts +33 -0
- package/core/types/behavior-tracking-props.js +16 -0
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +16 -10
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/buttons/index.js.map +1 -1
- package/esm/buttons/intent-button/IntentButton.js +4 -1
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js +3 -1
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +3 -1
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/skeleton/Skeleton.css +7 -7
- package/esm/content/skeleton/Skeleton.js +3 -0
- package/esm/content/skeleton/Skeleton.js.map +2 -2
- package/esm/content/skeleton/Skeleton.sty.js +5 -5
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/content/skeleton/SkeletonText.js +3 -0
- package/esm/content/skeleton/SkeletonText.js.map +2 -2
- package/esm/core/components/app-root/AppRoot.js +3 -1
- package/esm/core/components/app-root/AppRoot.js.map +2 -2
- package/esm/core/hooks/useBehavioralTrackingProps.js +27 -0
- package/esm/core/hooks/useBehavioralTrackingProps.js.map +7 -0
- package/esm/core/index.js +4 -0
- package/esm/core/index.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/styles/focusRingStatic.css +44 -0
- package/esm/core/styles/focusRingStatic.sty.js +7 -0
- package/esm/core/styles/focusRingStatic.sty.js.map +7 -0
- package/esm/core/styles/useFocusRing.js +15 -15
- package/esm/core/styles/useFocusRing.js.map +2 -2
- package/esm/core/types/behavior-tracking-props.js +1 -0
- package/esm/core/types/behavior-tracking-props.js.map +7 -0
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.js +2 -6
- package/esm/layouts/surface/Surface.js.map +2 -2
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +1 -1
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +1 -1
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +1 -1
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.js +3 -1
- package/esm/typography/block-quote/Blockquote.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.js +3 -1
- package/esm/typography/code/Code.js.map +2 -2
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.js +3 -1
- package/esm/typography/emphasis/Emphasis.js.map +2 -2
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +8 -5
- package/esm/typography/external-link/ExternalLink.js +6 -13
- package/esm/typography/external-link/ExternalLink.js.map +2 -2
- package/esm/typography/external-link/ExternalLink.sty.js +2 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +2 -2
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.js +3 -1
- package/esm/typography/heading/Heading.js.map +2 -2
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +2 -2
- package/esm/typography/highlight/Highlight.js +3 -1
- package/esm/typography/highlight/Highlight.js.map +2 -2
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/link/Link.css +6 -3
- package/esm/typography/link/Link.js +6 -19
- package/esm/typography/link/Link.js.map +2 -2
- package/esm/typography/link/Link.sty.js +2 -1
- package/esm/typography/link/Link.sty.js.map +2 -2
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.js +3 -1
- package/esm/typography/list/List.js.map +2 -2
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.js +3 -1
- package/esm/typography/paragraph/Paragraph.js.map +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.js +3 -1
- package/esm/typography/strikethrough/Strikethrough.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.js +3 -1
- package/esm/typography/strong/Strong.js.map +2 -2
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.js +4 -1
- package/esm/typography/text/Text.js.map +2 -2
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.js +2 -6
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +6 -6
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.d.ts +12 -12
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.js +3 -1
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.js +3 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.js +3 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +8 -5
- package/typography/external-link/ExternalLink.js +6 -13
- package/typography/external-link/ExternalLink.sty.js +2 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.js +3 -1
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +2 -2
- package/typography/highlight/Highlight.js +3 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/link/Link.css +6 -3
- package/typography/link/Link.js +6 -19
- package/typography/link/Link.sty.js +2 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.js +3 -1
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +3 -1
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.js +3 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.js +3 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +4 -1
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.js +8 -1
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data tracking attributes required for components and their children.
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface BehaviorTrackingProps {
|
|
6
|
+
'data-dt-content'?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Sets a custom name for a specific element.
|
|
9
|
+
*/
|
|
10
|
+
'data-dt-name'?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Sets a custom name for the element itself and all descendant elements that don't have their own naming attributes.
|
|
13
|
+
*/
|
|
14
|
+
'data-dt-children-name'?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Groups elements into logical features for tracking and analysis. Features are inherited from all ancestors and concatenated together.
|
|
17
|
+
*/
|
|
18
|
+
'data-dt-features'?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Attaches key-value properties to a specific element for additional context and metadata.
|
|
21
|
+
*/
|
|
22
|
+
'data-dt-properties'?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Enables mouse hover tracking with a minimum duration threshold. Only captures hover events if the user stays over the element for the specified milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
'data-dt-mouse-over'?: string;
|
|
27
|
+
'data-dt-value-content'?: string;
|
|
28
|
+
'data-dt-children-value-content'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Overrides the DOM parent relationship with a logical parent for attribute inheritance.
|
|
31
|
+
*/
|
|
32
|
+
'data-dt-ancestor'?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var behavior_tracking_props_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(behavior_tracking_props_exports);
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
._k096v44-1-
|
|
2
|
-
--_k096v40-1-
|
|
3
|
-
--_k096v41-1-
|
|
4
|
-
--_k096v42-1-
|
|
1
|
+
._k096v44-1-17-0 {
|
|
2
|
+
--_k096v40-1-17-0: var(--dt-colors-text-critical-default, #bb0731);
|
|
3
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-critical-default, #bb0731);
|
|
4
|
+
--_k096v42-1-17-0: var(--dt-colors-border-critical-default, #f6d6d5);
|
|
5
5
|
}
|
|
6
|
-
._k096v45-1-
|
|
7
|
-
--_k096v40-1-
|
|
8
|
-
--_k096v41-1-
|
|
9
|
-
--_k096v42-1-
|
|
6
|
+
._k096v45-1-17-0 {
|
|
7
|
+
--_k096v40-1-17-0: var(--dt-colors-text-neutral-default, #2f2f4f);
|
|
8
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-neutral-default, #2f2f4f);
|
|
9
|
+
--_k096v42-1-17-0: var(--dt-colors-border-neutral-default, #dadbe4);
|
|
10
10
|
}
|
|
11
|
-
._k096v46-1-
|
|
12
|
-
--_k096v40-1-
|
|
13
|
-
--_k096v41-1-
|
|
14
|
-
--_k096v42-1-
|
|
11
|
+
._k096v46-1-17-0 {
|
|
12
|
+
--_k096v40-1-17-0: var(--dt-colors-text-primary-default, #464cce);
|
|
13
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-primary-default, #464cce);
|
|
14
|
+
--_k096v42-1-17-0: var(--dt-colors-border-primary-default, #d5dbf6);
|
|
15
15
|
}
|
|
16
|
-
._k096v47-1-
|
|
17
|
-
--_k096v40-1-
|
|
18
|
-
--_k096v41-1-
|
|
19
|
-
--_k096v42-1-
|
|
16
|
+
._k096v47-1-17-0 {
|
|
17
|
+
--_k096v40-1-17-0: var(--dt-colors-text-success-default, #2d6761);
|
|
18
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-success-default, #2d6761);
|
|
19
|
+
--_k096v42-1-17-0: var(--dt-colors-border-success-default, #d3dedd);
|
|
20
20
|
}
|
|
21
|
-
._k096v48-1-
|
|
22
|
-
--_k096v40-1-
|
|
23
|
-
--_k096v41-1-
|
|
24
|
-
--_k096v42-1-
|
|
21
|
+
._k096v48-1-17-0 {
|
|
22
|
+
--_k096v40-1-17-0: var(--dt-colors-text-warning-default, #855400);
|
|
23
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-warning-default, #855400);
|
|
24
|
+
--_k096v42-1-17-0: var(--dt-colors-border-warning-default, #f9ebdb);
|
|
25
25
|
}
|
|
26
|
-
._k096v4d-1-
|
|
27
|
-
--_k096v40-1-
|
|
28
|
-
--_k096v41-1-
|
|
29
|
-
--_k096v42-1-
|
|
26
|
+
._k096v4d-1-17-0 {
|
|
27
|
+
--_k096v40-1-17-0: var(--dt-colors-text-primary-on-accent-default, #f4f4fb);
|
|
28
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-primary-on-accent-default, #f4f4fb);
|
|
29
|
+
--_k096v42-1-17-0: var(--dt-colors-border-primary-accent, #464cce);
|
|
30
30
|
}
|
|
31
|
-
._k096v4e-1-
|
|
32
|
-
--_k096v40-1-
|
|
33
|
-
--_k096v41-1-
|
|
34
|
-
--_k096v42-1-
|
|
31
|
+
._k096v4e-1-17-0 {
|
|
32
|
+
--_k096v40-1-17-0: var(--dt-colors-text-success-on-accent-default, #f1f4f4);
|
|
33
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-success-on-accent-default, #f1f4f4);
|
|
34
|
+
--_k096v42-1-17-0: var(--dt-colors-border-success-accent, #2d6761);
|
|
35
35
|
}
|
|
36
|
-
._k096v4f-1-
|
|
37
|
-
--_k096v40-1-
|
|
38
|
-
--_k096v41-1-
|
|
39
|
-
--_k096v42-1-
|
|
36
|
+
._k096v4f-1-17-0 {
|
|
37
|
+
--_k096v40-1-17-0: var(--dt-colors-text-warning-on-accent-default, #272024);
|
|
38
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-warning-on-accent-default, #272024);
|
|
39
|
+
--_k096v42-1-17-0: var(--dt-colors-border-warning-accent, #855400);
|
|
40
40
|
}
|
|
41
|
-
._k096v4g-1-
|
|
42
|
-
--_k096v40-1-
|
|
43
|
-
--_k096v41-1-
|
|
44
|
-
--_k096v42-1-
|
|
41
|
+
._k096v4g-1-17-0 {
|
|
42
|
+
--_k096v40-1-17-0: var(--dt-colors-text-critical-on-accent-default, #f9f1f3);
|
|
43
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-critical-on-accent-default, #f9f1f3);
|
|
44
|
+
--_k096v42-1-17-0: var(--dt-colors-border-critical-accent, #bb0731);
|
|
45
45
|
}
|
|
46
|
-
._k096v4h-1-
|
|
47
|
-
--_k096v40-1-
|
|
48
|
-
--_k096v41-1-
|
|
49
|
-
--_k096v42-1-
|
|
46
|
+
._k096v4h-1-17-0 {
|
|
47
|
+
--_k096v40-1-17-0: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
|
|
48
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-neutral-on-accent-default, #f3f3f6);
|
|
49
|
+
--_k096v42-1-17-0: var(--dt-colors-border-neutral-accent, #595a7d);
|
|
50
50
|
}
|
|
51
|
-
._k096v4i-1-
|
|
52
|
-
--_k096v40-1-
|
|
53
|
-
--_k096v41-1-
|
|
54
|
-
--_k096v42-1-
|
|
51
|
+
._k096v4i-1-17-0 {
|
|
52
|
+
--_k096v40-1-17-0: var(--dt-colors-text-primary-disabled, #595a7d80);
|
|
53
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-primary-disabled, #595a7d80);
|
|
54
|
+
--_k096v42-1-17-0: var(--dt-colors-border-primary-disabled, #dadbe480);
|
|
55
55
|
}
|
|
56
|
-
._k096v4j-1-
|
|
57
|
-
--_k096v40-1-
|
|
58
|
-
--_k096v41-1-
|
|
59
|
-
--_k096v42-1-
|
|
56
|
+
._k096v4j-1-17-0 {
|
|
57
|
+
--_k096v40-1-17-0: var(--dt-colors-text-success-disabled, #595a7d80);
|
|
58
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-success-disabled, #595a7d80);
|
|
59
|
+
--_k096v42-1-17-0: var(--dt-colors-border-success-disabled, #dadbe480);
|
|
60
60
|
}
|
|
61
|
-
._k096v4k-1-
|
|
62
|
-
--_k096v40-1-
|
|
63
|
-
--_k096v41-1-
|
|
64
|
-
--_k096v42-1-
|
|
61
|
+
._k096v4k-1-17-0 {
|
|
62
|
+
--_k096v40-1-17-0: var(--dt-colors-text-warning-disabled, #595a7d80);
|
|
63
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-warning-disabled, #595a7d80);
|
|
64
|
+
--_k096v42-1-17-0: var(--dt-colors-border-warning-disabled, #dadbe480);
|
|
65
65
|
}
|
|
66
|
-
._k096v4l-1-
|
|
67
|
-
--_k096v40-1-
|
|
68
|
-
--_k096v41-1-
|
|
69
|
-
--_k096v42-1-
|
|
66
|
+
._k096v4l-1-17-0 {
|
|
67
|
+
--_k096v40-1-17-0: var(--dt-colors-text-critical-disabled, #595a7d80);
|
|
68
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-critical-disabled, #595a7d80);
|
|
69
|
+
--_k096v42-1-17-0: var(--dt-colors-border-critical-disabled, #dadbe480);
|
|
70
70
|
}
|
|
71
|
-
._k096v4m-1-
|
|
72
|
-
--_k096v40-1-
|
|
73
|
-
--_k096v41-1-
|
|
74
|
-
--_k096v42-1-
|
|
71
|
+
._k096v4m-1-17-0 {
|
|
72
|
+
--_k096v40-1-17-0: var(--dt-colors-text-neutral-disabled, #595a7d80);
|
|
73
|
+
--_k096v41-1-17-0: var(--dt-colors-icon-neutral-disabled, #595a7d80);
|
|
74
|
+
--_k096v42-1-17-0: var(--dt-colors-border-neutral-disabled, #dadbe480);
|
|
75
75
|
}
|
|
@@ -24,5 +24,5 @@ __export(colorUtils_css_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(colorUtils_css_exports);
|
|
25
25
|
var import_colorUtils_css_ts_vanilla = require("./colorUtils.css");
|
|
26
26
|
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
27
|
-
var colorUtilsCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_k096v43-1-
|
|
28
|
-
var colorUtilsVars = { text: "var(--_k096v40-1-
|
|
27
|
+
var colorUtilsCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "_k096v43-1-17-0", variantClassNames: { color: { critical: "_k096v44-1-17-0", neutral: "_k096v45-1-17-0", primary: "_k096v46-1-17-0", success: "_k096v47-1-17-0", warning: "_k096v48-1-17-0" }, variant: { "default": "_k096v49-1-17-0", accent: "_k096v4a-1-17-0" }, disabled: { true: "_k096v4b-1-17-0", false: "_k096v4c-1-17-0" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "_k096v4d-1-17-0"], [{ color: "success", variant: "accent" }, "_k096v4e-1-17-0"], [{ color: "warning", variant: "accent" }, "_k096v4f-1-17-0"], [{ color: "critical", variant: "accent" }, "_k096v4g-1-17-0"], [{ color: "neutral", variant: "accent" }, "_k096v4h-1-17-0"], [{ color: "primary", disabled: true }, "_k096v4i-1-17-0"], [{ color: "success", disabled: true }, "_k096v4j-1-17-0"], [{ color: "warning", disabled: true }, "_k096v4k-1-17-0"], [{ color: "critical", disabled: true }, "_k096v4l-1-17-0"], [{ color: "neutral", disabled: true }, "_k096v4m-1-17-0"]] });
|
|
28
|
+
var colorUtilsVars = { text: "var(--_k096v40-1-17-0)", icon: "var(--_k096v41-1-17-0)", borderColor: "var(--_k096v42-1-17-0)" };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
._10kgnsa0-1-
|
|
1
|
+
._10kgnsa0-1-17-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-17-0);
|
|
9
|
+
color: var(--_bx32h0-1-17-0);
|
|
10
10
|
display: inline-flex;
|
|
11
11
|
position: relative;
|
|
12
12
|
align-items: center;
|
|
@@ -23,42 +23,42 @@
|
|
|
23
23
|
transition-duration: var(--dt-animations-hover-duration-base, 150ms);
|
|
24
24
|
transition-property: color, background-color, transform;
|
|
25
25
|
}
|
|
26
|
-
._10kgnsa1-1-
|
|
26
|
+
._10kgnsa1-1-17-0 {
|
|
27
27
|
text-align: start;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
}
|
|
30
|
-
._10kgnsa2-1-
|
|
30
|
+
._10kgnsa2-1-17-0 {
|
|
31
31
|
text-align: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
}
|
|
34
|
-
._10kgnsa3-1-
|
|
34
|
+
._10kgnsa3-1-17-0 {
|
|
35
35
|
padding-top: var(--dt-spacings-size-2, 2px);
|
|
36
36
|
padding-bottom: var(--dt-spacings-size-2, 2px);
|
|
37
37
|
padding-left: var(--dt-spacings-size-4, 4px);
|
|
38
38
|
padding-right: var(--dt-spacings-size-4, 4px);
|
|
39
39
|
gap: var(--dt-spacings-size-2, 2px);
|
|
40
40
|
}
|
|
41
|
-
._10kgnsa4-1-
|
|
41
|
+
._10kgnsa4-1-17-0 {
|
|
42
42
|
padding-top: var(--dt-spacings-size-6, 6px);
|
|
43
43
|
padding-bottom: var(--dt-spacings-size-6, 6px);
|
|
44
44
|
padding-left: var(--dt-spacings-size-8, 8px);
|
|
45
45
|
padding-right: var(--dt-spacings-size-8, 8px);
|
|
46
46
|
gap: var(--dt-spacings-size-4, 4px);
|
|
47
47
|
}
|
|
48
|
-
._10kgnsa5-1-
|
|
48
|
+
._10kgnsa5-1-17-0 {
|
|
49
49
|
cursor: not-allowed;
|
|
50
50
|
}
|
|
51
|
-
._10kgnsa6-1-
|
|
51
|
+
._10kgnsa6-1-17-0 {
|
|
52
52
|
cursor: not-allowed;
|
|
53
|
-
background: var(--_bx32h2-1-
|
|
53
|
+
background: var(--_bx32h2-1-17-0);
|
|
54
54
|
}
|
|
55
|
-
._10kgnsa7-1-
|
|
55
|
+
._10kgnsa7-1-17-0 {
|
|
56
56
|
width: 100%;
|
|
57
57
|
}
|
|
58
|
-
._10kgnsa8-1-
|
|
58
|
+
._10kgnsa8-1-17-0 {
|
|
59
59
|
width: fit-content;
|
|
60
60
|
}
|
|
61
|
-
._10kgnsa9-1-
|
|
61
|
+
._10kgnsa9-1-17-0 {
|
|
62
62
|
position: absolute;
|
|
63
63
|
top: 0;
|
|
64
64
|
left: 0;
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
align-items: center;
|
|
71
71
|
z-index: 1;
|
|
72
72
|
}
|
|
73
|
-
._10kgnsa3-1-
|
|
73
|
+
._10kgnsa3-1-17-0 ._10kgnsaa-1-17-0:not(:has(svg:only-child)) {
|
|
74
74
|
padding-top: 0;
|
|
75
75
|
padding-bottom: 0;
|
|
76
76
|
padding-left: 2px;
|
|
77
77
|
padding-right: 2px;
|
|
78
78
|
}
|
|
79
|
-
._10kgnsa4-1-
|
|
79
|
+
._10kgnsa4-1-17-0 ._10kgnsaa-1-17-0:not(:has(svg:only-child)) {
|
|
80
80
|
padding-top: 0;
|
|
81
81
|
padding-bottom: 0;
|
|
82
82
|
padding-left: 4px;
|
|
83
83
|
padding-right: 4px;
|
|
84
84
|
}
|
|
85
|
-
._10kgnsac-1-
|
|
85
|
+
._10kgnsac-1-17-0 {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
min-width: 0;
|
|
88
88
|
max-width: 100%;
|
|
@@ -13,12 +13,13 @@ import { Prefix } from "./Prefix.js";
|
|
|
13
13
|
import { Suffix } from "./Suffix.js";
|
|
14
14
|
import { ProgressCircle } from "../../content/progress/ProgressCircle.js";
|
|
15
15
|
import { useAriaLabelingProps } from "../../core/hooks/useAriaLabelingProps.js";
|
|
16
|
-
import {
|
|
16
|
+
import { focusRingStatic } from "../../core/styles/focusRingStatic.sty.js";
|
|
17
17
|
import { mergeProps } from "../../core/utils/merge-props.js";
|
|
18
18
|
import { parseBoolean } from "../../core/utils/parse-boolean.js";
|
|
19
19
|
import { Flex } from "../../layouts/flex/Flex.js";
|
|
20
20
|
import { Grid } from "../../layouts/grid/Grid.js";
|
|
21
21
|
import { fieldColors } from "../../styles/field.sty.js";
|
|
22
|
+
const COMPONENT_NAME = "Button";
|
|
22
23
|
function getButtonSlots(children) {
|
|
23
24
|
const slots = {};
|
|
24
25
|
Children.forEach(children, (child) => {
|
|
@@ -84,10 +85,6 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
84
85
|
() => nativeDisabledOrLoading || ariaDisabled,
|
|
85
86
|
[ariaDisabled, nativeDisabledOrLoading]
|
|
86
87
|
);
|
|
87
|
-
const { focusProps, focusClassName } = useFocusRing({
|
|
88
|
-
variant: !disabledOrLoading ? color : "neutral",
|
|
89
|
-
disabled: nativeDisabledOrLoading
|
|
90
|
-
});
|
|
91
88
|
const ariaLabelingProps = useAriaLabelingProps(remainingProps);
|
|
92
89
|
const handleButtonClick = (event) => {
|
|
93
90
|
if (nativeDisabledOrLoading) {
|
|
@@ -132,8 +129,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
132
129
|
// Need to cast this one as the inference of mergeProps would generate
|
|
133
130
|
// a not allowed overlap. The remainingProps type is too complex due to the
|
|
134
131
|
// polymorphic inheritance.
|
|
135
|
-
remainingProps
|
|
136
|
-
focusProps
|
|
132
|
+
remainingProps
|
|
137
133
|
)
|
|
138
134
|
};
|
|
139
135
|
const intl = useIntl();
|
|
@@ -142,6 +138,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
142
138
|
return /* @__PURE__ */ jsx(
|
|
143
139
|
Component,
|
|
144
140
|
{
|
|
141
|
+
"data-dt-component": COMPONENT_NAME,
|
|
145
142
|
...buttonMergedProps,
|
|
146
143
|
className: clsx(
|
|
147
144
|
consumerClassName,
|
|
@@ -153,7 +150,11 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
153
150
|
size,
|
|
154
151
|
readOnly
|
|
155
152
|
}),
|
|
156
|
-
|
|
153
|
+
focusRingStatic({
|
|
154
|
+
when: "focus-visible",
|
|
155
|
+
color,
|
|
156
|
+
disabled: nativeDisabledOrLoading
|
|
157
|
+
}),
|
|
157
158
|
{
|
|
158
159
|
[`${styles.widths.content}`]: width === "content",
|
|
159
160
|
[`${styles.widths.full}`]: width === "full"
|
|
@@ -168,6 +169,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
168
169
|
return /* @__PURE__ */ jsxs(
|
|
169
170
|
Component,
|
|
170
171
|
{
|
|
172
|
+
"data-dt-component": COMPONENT_NAME,
|
|
171
173
|
className: clsx(
|
|
172
174
|
consumerClassName,
|
|
173
175
|
"strato-inputgroup",
|
|
@@ -186,7 +188,11 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
186
188
|
[`${styles.widths.content}`]: width === "content",
|
|
187
189
|
[`${styles.widths.full}`]: width === "full"
|
|
188
190
|
},
|
|
189
|
-
|
|
191
|
+
focusRingStatic({
|
|
192
|
+
when: "focus-visible",
|
|
193
|
+
color,
|
|
194
|
+
disabled: nativeDisabledOrLoading
|
|
195
|
+
})
|
|
190
196
|
),
|
|
191
197
|
style: {
|
|
192
198
|
width: width !== "content" && width !== "full" ? width : void 0,
|
|
@@ -237,7 +243,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
237
243
|
);
|
|
238
244
|
}
|
|
239
245
|
);
|
|
240
|
-
_Button.displayName =
|
|
246
|
+
_Button.displayName = COMPONENT_NAME;
|
|
241
247
|
const Button = Object.assign(_Button, {
|
|
242
248
|
Suffix,
|
|
243
249
|
Prefix,
|
|
@@ -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 {\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 * as styles 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 { fieldColors } 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 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\nconst _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 @typescript-eslint/no-deprecated\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 fieldColors({ variant, color, disabled: disabledOrLoading }),\n styles.button({\n disabled: disabledOrLoading,\n textAlign,\n size,\n readOnly,\n }),\n focusClassName,\n {\n [`${styles.widths.content}`]: width === 'content',\n [`${styles.widths.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 fieldColors({\n variant,\n color,\n disabled: disabledOrLoading || ariaDisabled,\n }),\n styles.button({\n disabled: disabledOrLoading || ariaDisabled,\n textAlign,\n size,\n readOnly,\n }),\n {\n [`${styles.widths.content}`]: width === 'content',\n [`${styles.widths.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={styles.loading}>\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 let users trigger actions or events\n * with a single click, or 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 * as styles 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 { focusRingStatic } from '../../core/styles/focusRingStatic.sty.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 { fieldColors } from '../../styles/field.sty.js';\n\nconst COMPONENT_NAME = 'Button';\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 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\nconst _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 @typescript-eslint/no-deprecated\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 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 ),\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 data-dt-component={COMPONENT_NAME}\n {...buttonMergedProps}\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColors({ variant, color, disabled: disabledOrLoading }),\n styles.button({\n disabled: disabledOrLoading,\n textAlign,\n size,\n readOnly,\n }),\n focusRingStatic({\n when: 'focus-visible',\n color,\n disabled: nativeDisabledOrLoading,\n }),\n {\n [`${styles.widths.content}`]: width === 'content',\n [`${styles.widths.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 data-dt-component={COMPONENT_NAME}\n className={clsx(\n consumerClassName,\n 'strato-inputgroup',\n fieldColors({\n variant,\n color,\n disabled: disabledOrLoading || ariaDisabled,\n }),\n styles.button({\n disabled: disabledOrLoading || ariaDisabled,\n textAlign,\n size,\n readOnly,\n }),\n {\n [`${styles.widths.content}`]: width === 'content',\n [`${styles.widths.full}`]: width === 'full',\n },\n focusRingStatic({\n when: 'focus-visible',\n color,\n disabled: nativeDisabledOrLoading,\n }),\n )}\n style={{\n width: width !== 'content' && width !== 'full' ? width : undefined,\n ...consumerStyle,\n }}\n {...buttonMergedProps}\n >\n {loading && (\n <div className={styles.loading}>\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 =\n COMPONENT_NAME;\n\n/**\n * Buttons let users trigger actions or events\n * with a single click, or 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 button = _7a468({ defaultClassName: "_10kgnsa0-1-
|
|
6
|
-
var label = _7a468({ defaultClassName: "_10kgnsaa-1-
|
|
7
|
-
var loading = "_10kgnsa9-1-
|
|
8
|
-
var widths = { full: "_10kgnsa7-1-
|
|
5
|
+
var button = _7a468({ defaultClassName: "_10kgnsa0-1-17-0", variantClassNames: { textAlign: { start: "_10kgnsa1-1-17-0", center: "_10kgnsa2-1-17-0" }, size: { condensed: "_10kgnsa3-1-17-0", "default": "_10kgnsa4-1-17-0" }, disabled: { true: "_10kgnsa5-1-17-0" }, readOnly: { true: "_10kgnsa6-1-17-0" } }, defaultVariants: { size: "default", textAlign: "center", disabled: false }, compoundVariants: [] });
|
|
6
|
+
var label = _7a468({ defaultClassName: "_10kgnsaa-1-17-0", variantClassNames: { textual: { true: "_oqqp1n0-1-17-0", false: "_10kgnsac-1-17-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7
|
+
var loading = "_10kgnsa9-1-17-0";
|
|
8
|
+
var widths = { full: "_10kgnsa7-1-17-0", content: "_10kgnsa8-1-17-0" };
|
|
9
9
|
export {
|
|
10
10
|
button,
|
|
11
11
|
label,
|
|
@@ -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 button = _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 button = _7a468({defaultClassName:'_10kgnsa0-1-17-0',variantClassNames:{textAlign:{start:'_10kgnsa1-1-17-0',center:'_10kgnsa2-1-17-0'},size:{condensed:'_10kgnsa3-1-17-0','default':'_10kgnsa4-1-17-0'},disabled:{true:'_10kgnsa5-1-17-0'},readOnly:{true:'_10kgnsa6-1-17-0'}},defaultVariants:{size:'default',textAlign:'center',disabled:false},compoundVariants:[]});\nexport var label = _7a468({defaultClassName:'_10kgnsaa-1-17-0',variantClassNames:{textual:{true:'_oqqp1n0-1-17-0',false:'_10kgnsac-1-17-0'}},defaultVariants:{},compoundVariants:[]});\nexport var loading = '_10kgnsa9-1-17-0';\nexport var widths = {full:'_10kgnsa7-1-17-0',content:'_10kgnsa8-1-17-0'};"],
|
|
5
5
|
"mappings": "AAAA,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,SAAS,OAAO,EAAC,kBAAiB,oBAAmB,mBAAkB,EAAC,WAAU,EAAC,OAAM,oBAAmB,QAAO,mBAAkB,GAAE,MAAK,EAAC,WAAU,oBAAmB,WAAU,mBAAkB,GAAE,UAAS,EAAC,MAAK,mBAAkB,GAAE,UAAS,EAAC,MAAK,mBAAkB,EAAC,GAAE,iBAAgB,EAAC,MAAK,WAAU,WAAU,UAAS,UAAS,MAAK,GAAE,kBAAiB,CAAC,EAAC,CAAC;AAC1W,IAAI,QAAQ,OAAO,EAAC,kBAAiB,oBAAmB,mBAAkB,EAAC,SAAQ,EAAC,MAAK,mBAAkB,OAAM,mBAAkB,EAAC,GAAE,iBAAgB,CAAC,GAAE,kBAAiB,CAAC,EAAC,CAAC;AAC7K,IAAI,UAAU;AACd,IAAI,SAAS,EAAC,MAAK,oBAAmB,SAAQ,mBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esm/buttons/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/buttons/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { Button } from './button/Button.js';\nexport type { ButtonOwnProps, ButtonProps } from './button/Button.js';\nexport type { ButtonLabelProps } from './button/Label.js';\nexport type { ButtonPrefixProps } from './button/Prefix.js';\nexport type { ButtonSuffixProps } from './button/Suffix.js';\nexport type {\n AriaButtonProps as _AriaButtonProps,\n ButtonAria as _ButtonAria,\n AriaBaseButtonProps as _AriaBaseButtonProps,\n} from './button/types/button-aria.js';\nexport { focusWithoutScrolling as _focusWithoutScrolling } from './button/utils/focus-without-scrolling.js';\nexport {\n isVirtualPointerEvent as _isVirtualPointerEvent,\n isVirtualClick as _isVirtualClick,\n} from './button/utils/is-virtual-event.js';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { IntentButton } from './intent-button/IntentButton.js';\nexport type {\n IntentButtonProps,\n IntentButtonPropsBase,\n} from './intent-button/IntentButton.js';\n"],
|
|
4
|
+
"sourcesContent": ["export { Button } from './button/Button.js';\nexport type { ButtonOwnProps, ButtonProps } from './button/Button.js';\nexport type { ButtonLabelProps } from './button/Label.js';\nexport type { ButtonPrefixProps } from './button/Prefix.js';\nexport type { ButtonSuffixProps } from './button/Suffix.js';\nexport type {\n AriaButtonProps as _AriaButtonProps,\n ButtonAria as _ButtonAria,\n AriaBaseButtonProps as _AriaBaseButtonProps,\n} from './button/types/button-aria.js';\nexport { focusWithoutScrolling as _focusWithoutScrolling } from './button/utils/focus-without-scrolling.js';\nexport {\n isVirtualPointerEvent as _isVirtualPointerEvent,\n isVirtualClick as _isVirtualClick,\n} from './button/utils/is-virtual-event.js';\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { IntentButton } from './intent-button/IntentButton.js';\nexport type {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n IntentButtonProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n IntentButtonPropsBase,\n} from './intent-button/IntentButton.js';\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,cAAc;AAUvB,SAAkC,6BAA8B;AAChE;AAAA,EAC2B;AAAA,EACP;AAAA,OACb;AAEP,SAAS,oBAAoB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,6 +4,7 @@ import { useIntl } from "react-intl";
|
|
|
4
4
|
import { OpenWithIcon } from "@dynatrace/strato-icons";
|
|
5
5
|
import { useIntentButton } from "./useIntentButton.js";
|
|
6
6
|
import { Button } from "../button/Button.js";
|
|
7
|
+
const COMPONENT_NAME = "IntentButton";
|
|
7
8
|
const IntentButton = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
8
9
|
const intl = useIntl();
|
|
9
10
|
const {
|
|
@@ -51,6 +52,7 @@ const IntentButton = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
51
52
|
style: consumerStyle,
|
|
52
53
|
readOnly,
|
|
53
54
|
...remainingProps,
|
|
55
|
+
"data-dt-component": COMPONENT_NAME,
|
|
54
56
|
children: [
|
|
55
57
|
label,
|
|
56
58
|
/* @__PURE__ */ jsx(Button.Suffix, { children: /* @__PURE__ */ jsx(OpenWithIcon, {}) })
|
|
@@ -72,6 +74,7 @@ const IntentButton = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
72
74
|
readOnly,
|
|
73
75
|
...remainingProps,
|
|
74
76
|
...intentButtonProps,
|
|
77
|
+
"data-dt-component": COMPONENT_NAME,
|
|
75
78
|
children: [
|
|
76
79
|
label,
|
|
77
80
|
/* @__PURE__ */ jsx(Button.Suffix, { children: /* @__PURE__ */ jsx(OpenWithIcon, {}) })
|
|
@@ -79,7 +82,7 @@ const IntentButton = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
79
82
|
}
|
|
80
83
|
);
|
|
81
84
|
});
|
|
82
|
-
IntentButton.displayName =
|
|
85
|
+
IntentButton.displayName = COMPONENT_NAME;
|
|
83
86
|
export {
|
|
84
87
|
IntentButton
|
|
85
88
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/buttons/intent-button/IntentButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import { forwardRef, type ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { OpenWithIcon } from '@dynatrace/strato-icons';\nimport { type IntentPayload } from '@dynatrace-sdk/navigation';\n\nimport { useIntentButton } from './useIntentButton.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 { Button, type ButtonOwnProps } from '../button/Button.js';\n\n//#region Typings\n/**\n * Accepted properties for the Button.\n * @public\n */\nexport interface IntentButtonPropsBase\n extends Omit<ButtonOwnProps, 'loading' | 'type'>,\n AriaLabelingProps,\n DOMProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** Intent payload passed between apps.*/\n payload: IntentPayload;\n\n /** Intended for setting a custom button label. When nothing is set, no label is shown. */\n children?: ReactNode;\n}\n\n/**\n * Merge own props with ID props.\n * Props for recommending an app to receive the intent. Either both properties or none of them needs to be specified.\n * @public\n */\nexport type IntentButtonProps = IntentButtonPropsBase &\n (\n | {\n appId?: never;\n intentId?: never;\n }\n | {\n /**\n * ID of the app that will be launched to handle the intent.\n */\n appId: string;\n\n /**\n * ID of the action that will be passed to the app.\n */\n intentId: string;\n }\n );\n\n//#endregion\n\n// DEPRECATION: [APPDEV-15793] BREAKING-CHANGE: IntentButton: Remove deprecated IntentButton from components\n/**\n * The `IntentButton` is a dedicated button component for sending\n * {@link https://developer.dynatrace.com/develop/intents/ | intents}.\n * It takes care of opening the intent dialog. An `IntentButton` only works\n * in the AppShell context.\n * @deprecated Will be removed, use `IntentButton` from preview instead.\n * @public\n */\nexport const IntentButton = /* @__PURE__ */ forwardRef<\n HTMLAnchorElement,\n IntentButtonProps\n>((props, forwardedRef) => {\n const intl = useIntl();\n const {\n children,\n payload,\n appId,\n intentId,\n disabled,\n onClick: onClickProp,\n 'aria-label': ariaLabelProp,\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 @typescript-eslint/no-deprecated\n readOnly,\n ...remainingProps\n }: IntentButtonProps = props;\n\n let label = children;\n if (typeof label === 'string') {\n label = label.trim();\n }\n\n const ariaLabel =\n ariaLabelProp ||\n intl.formatMessage({\n description: 'Intent button open label',\n defaultMessage: 'Open with',\n id: 'JQOGuaGgqJObmSY1',\n });\n\n const intentButtonProps = useIntentButton(\n payload,\n appId,\n intentId,\n onClickProp,\n );\n\n // polymorph it back to a button in case it's disabled.\n // Keep the button focusable if disabled for better screen reader support.\n if (disabled) {\n return (\n <Button\n disabled\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel}\n className={consumerClassName}\n style={consumerStyle}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n readOnly={readOnly}\n {...remainingProps}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n }\n\n return (\n <Button\n as=\"a\"\n ref={forwardedRef}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel ?? label}\n className={consumerClassName}\n style={consumerStyle}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n readOnly={readOnly}\n {...remainingProps}\n {...intentButtonProps}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n});\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\n(IntentButton as typeof IntentButton & { displayName: string }).displayName =\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { forwardRef, type ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { OpenWithIcon } from '@dynatrace/strato-icons';\nimport { type IntentPayload } from '@dynatrace-sdk/navigation';\n\nimport { useIntentButton } from './useIntentButton.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 { Button, type ButtonOwnProps } from '../button/Button.js';\n\nconst COMPONENT_NAME = 'IntentButton';\n\n//#region Typings\n/**\n * Accepted properties for the Button.\n * @deprecated Will be removed, use `IntentButtonProps` from preview instead.\n * @public\n */\nexport interface IntentButtonPropsBase\n extends Omit<ButtonOwnProps, 'loading' | 'type'>,\n AriaLabelingProps,\n DOMProps,\n StylingProps,\n DataTestId,\n MaskingProps {\n /** Intent payload passed between apps.*/\n payload: IntentPayload;\n\n /** Intended for setting a custom button label. When nothing is set, no label is shown. */\n children?: ReactNode;\n}\n\n/**\n * Merge own props with ID props.\n * Props for recommending an app to receive the intent. Either both properties or none of them needs to be specified.\n * @deprecated Will be removed, use `IntentButtonProps` from preview instead.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport type IntentButtonProps = IntentButtonPropsBase &\n (\n | {\n appId?: never;\n intentId?: never;\n }\n | {\n /**\n * ID of the app that will be launched to handle the intent.\n */\n appId: string;\n\n /**\n * ID of the action that will be passed to the app.\n */\n intentId: string;\n }\n );\n\n//#endregion\n\n// DEPRECATION: [APPDEV-15793] BREAKING-CHANGE: IntentButton: Remove deprecated IntentButton from components\n/**\n * The `IntentButton` is a dedicated button component for sending\n * {@link https://developer.dynatrace.com/develop/intents/ | intents}.\n * It takes care of opening the intent dialog. An `IntentButton` only works\n * in the AppShell context.\n * @deprecated Will be removed, use `IntentButton` from preview instead.\n * @public\n */\nexport const IntentButton = /* @__PURE__ */ forwardRef<\n HTMLAnchorElement,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n IntentButtonProps\n>((props, forwardedRef) => {\n const intl = useIntl();\n const {\n children,\n payload,\n appId,\n intentId,\n disabled,\n onClick: onClickProp,\n 'aria-label': ariaLabelProp,\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 @typescript-eslint/no-deprecated\n readOnly,\n ...remainingProps\n }: // eslint-disable-next-line @typescript-eslint/no-deprecated\n IntentButtonProps = props;\n\n let label = children;\n if (typeof label === 'string') {\n label = label.trim();\n }\n\n const ariaLabel =\n ariaLabelProp ||\n intl.formatMessage({\n description: 'Intent button open label',\n defaultMessage: 'Open with',\n id: 'JQOGuaGgqJObmSY1',\n });\n\n const intentButtonProps = useIntentButton(\n payload,\n appId,\n intentId,\n onClickProp,\n );\n\n // polymorph it back to a button in case it's disabled.\n // Keep the button focusable if disabled for better screen reader support.\n if (disabled) {\n return (\n <Button\n disabled\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel}\n className={consumerClassName}\n style={consumerStyle}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n readOnly={readOnly}\n {...remainingProps}\n data-dt-component={COMPONENT_NAME}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n }\n\n return (\n <Button\n as=\"a\"\n ref={forwardedRef}\n data-testid={dataTestId}\n data-dtrum-mask={dataDtrumMask}\n data-dtrum-allow={dataDtrumAllow}\n aria-label={ariaLabel ?? label}\n className={consumerClassName}\n style={consumerStyle}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n readOnly={readOnly}\n {...remainingProps}\n {...intentButtonProps}\n data-dt-component={COMPONENT_NAME}\n >\n {label}\n <Button.Suffix>\n <OpenWithIcon />\n </Button.Suffix>\n </Button>\n );\n});\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\n(IntentButton as typeof IntentButton & { displayName: string }).displayName =\n COMPONENT_NAME;\n"],
|
|
5
|
+
"mappings": "AA0HM,SAeI,KAfJ;AA1HN,SAAS,kBAAkC;AAC3C,SAAS,eAAe;AAExB,SAAS,oBAAoB;AAG7B,SAAS,uBAAuB;AAMhC,SAAS,cAAmC;AAE5C,MAAM,iBAAiB;AA2DhB,MAAM,eAA+B,2BAI1C,CAAC,OAAO,iBAAiB;AACzB,QAAM,OAAO,QAAQ;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,OAAO;AAAA,IACP,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,oBAAoB;AAAA;AAAA,IAEpB;AAAA,IACA,GAAG;AAAA,EACL,IACoB;AAEpB,MAAI,QAAQ;AACZ,MAAI,OAAO,UAAU,UAAU;AAC7B,YAAQ,MAAM,KAAK;AAAA,EACrB;AAEA,QAAM,YACJ,iBACA,KAAK,cAAc;AAAA,IACjB,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,IAAI;AAAA,EACN,CAAC;AAEH,QAAM,oBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAIA,MAAI,UAAU;AACZ,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAQ;AAAA,QACR,eAAa;AAAA,QACb,mBAAiB;AAAA,QACjB,oBAAkB;AAAA,QAClB,cAAY;AAAA,QACZ,WAAW;AAAA,QACX,OAAO;AAAA,QAEP;AAAA,QACC,GAAG;AAAA,QACJ,qBAAmB;AAAA,QAElB;AAAA;AAAA,UACD,oBAAC,OAAO,QAAP,EACC,8BAAC,gBAAa,GAChB;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAG;AAAA,MACH,KAAK;AAAA,MACL,eAAa;AAAA,MACb,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MAClB,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,MACX,OAAO;AAAA,MAEP;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,qBAAmB;AAAA,MAElB;AAAA;AAAA,QACD,oBAAC,OAAO,QAAP,EACC,8BAAC,gBAAa,GAChB;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AAGA,aAA+D,cAC9D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|