@dynatrace/strato-components 1.14.0 → 1.16.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 +10 -10
- package/buttons/button/Button.sty.d.ts +4 -4
- package/buttons/button/Button.sty.js +8 -8
- package/buttons/button/Label.js +1 -1
- package/buttons/intent-button/IntentButton.d.ts +1 -0
- package/content/progress/ProgressBar.css +71 -71
- 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.js +3 -3
- package/content/progress/ProgressBarLabel.sty.d.ts +1 -1
- package/content/progress/ProgressBarLabel.sty.js +2 -2
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +2 -2
- package/content/progress/ProgressBarValue.sty.d.ts +1 -1
- package/content/progress/ProgressBarValue.sty.js +2 -2
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.js +1 -1
- package/content/progress/ProgressCircle.sty.d.ts +13 -7
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +7 -7
- package/content/skeleton/Skeleton.js +2 -2
- package/content/skeleton/Skeleton.sty.js +5 -5
- package/content/skeleton/SkeletonText.js +3 -3
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.d.ts +34 -10
- package/core/styles/focusRing.sty.js +2 -2
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.d.ts +15 -5
- package/core/utils/colorUtils.sty.js +2 -2
- package/core/utils/is-node-environment.d.ts +15 -0
- package/core/utils/is-node-environment.js +34 -0
- package/core/utils/logging.d.ts +8 -0
- package/core/utils/logging.js +33 -0
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +11 -11
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +8 -8
- package/esm/buttons/button/Button.sty.js.map +2 -2
- package/esm/buttons/button/Label.js +2 -2
- package/esm/buttons/button/Label.js.map +2 -2
- package/esm/buttons/index.js.map +2 -2
- package/esm/buttons/intent-button/IntentButton.js.map +2 -2
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.js +6 -6
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.js +4 -4
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js.map +2 -2
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js +2 -2
- 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 +1 -1
- package/esm/content/skeleton/Skeleton.js.map +1 -1
- 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 +1 -1
- package/esm/content/skeleton/SkeletonText.js.map +1 -1
- package/esm/core/hooks/useId.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/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/core/utils/is-node-environment.js +15 -0
- package/esm/core/utils/is-node-environment.js.map +7 -0
- package/esm/core/utils/logging.js +14 -0
- package/esm/core/utils/logging.js.map +7 -0
- 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 +4 -4
- 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 +3 -3
- package/esm/styles/colorUtils.sty.js.map +2 -2
- 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 +2 -2
- package/esm/styles/ellipsis.sty.js.map +2 -2
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +3 -3
- package/esm/styles/field.sty.js.map +2 -2
- package/esm/styles/index.js +2 -2
- package/esm/styles/index.js.map +2 -2
- 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 +2 -2
- package/esm/styles/textStyle.sty.js.map +2 -2
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -8
- package/esm/typography/external-link/ExternalLink.js +1 -1
- 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.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +5 -6
- package/esm/typography/highlight/Highlight.js +45 -138
- package/esm/typography/highlight/Highlight.js.map +3 -3
- package/esm/typography/highlight/Highlight.sty.js +2 -4
- package/esm/typography/highlight/Highlight.sty.js.map +2 -2
- package/esm/typography/highlight/utils/create-ranged-highlights.js +51 -0
- package/esm/typography/highlight/utils/create-ranged-highlights.js.map +7 -0
- package/esm/typography/highlight/utils/get-or-create-shared-highlight.js +25 -0
- package/esm/typography/highlight/utils/get-or-create-shared-highlight.js.map +7 -0
- package/esm/typography/link/Link.css +3 -3
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.js +3 -7
- package/esm/typography/paragraph/Paragraph.js.map +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js +2 -2
- package/esm/typography/paragraph/Paragraph.sty.js.map +2 -2
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.js +5 -5
- package/esm/typography/text/Text.js.map +2 -2
- package/esm/typography/text/Text.sty.js +2 -2
- package/esm/typography/text/Text.sty.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/esm/typography/utils.js +17 -9
- package/esm/typography/utils.js.map +2 -2
- 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 -2
- package/layouts/surface/Surface.sty.d.ts +19 -6
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +3 -3
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.d.ts +16 -6
- package/styles/colorUtils.sty.js +3 -3
- package/styles/container.css +47 -47
- package/styles/container.sty.d.ts +16 -6
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.d.ts +1 -1
- package/styles/ellipsis.sty.js +2 -2
- package/styles/field.css +153 -153
- package/styles/field.sty.d.ts +25 -18
- package/styles/field.sty.js +3 -3
- package/styles/index.d.ts +1 -1
- package/styles/index.js +1 -1
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.d.ts +1 -1
- package/styles/textStyle.sty.js +2 -2
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +6 -8
- package/typography/external-link/ExternalLink.js +1 -1
- package/typography/external-link/ExternalLink.sty.js +1 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +5 -6
- package/typography/highlight/Highlight.d.ts +1 -1
- package/typography/highlight/Highlight.js +43 -127
- package/typography/highlight/Highlight.sty.d.ts +1 -2
- package/typography/highlight/Highlight.sty.js +2 -4
- package/typography/highlight/utils/create-ranged-highlights.d.ts +10 -0
- package/typography/highlight/utils/create-ranged-highlights.js +70 -0
- package/typography/highlight/utils/get-or-create-shared-highlight.d.ts +7 -0
- package/typography/highlight/utils/get-or-create-shared-highlight.js +44 -0
- package/typography/link/Link.css +3 -3
- package/typography/link/Link.sty.js +1 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.js +1 -5
- package/typography/paragraph/Paragraph.sty.d.ts +1 -1
- package/typography/paragraph/Paragraph.sty.js +2 -2
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.js +3 -3
- package/typography/text/Text.sty.d.ts +1 -1
- package/typography/text/Text.sty.js +2 -2
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/typography/utils.js +17 -9
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
._k096v44-1-
|
|
2
|
-
--_k096v40-1-
|
|
3
|
-
--_k096v41-1-
|
|
4
|
-
--_k096v42-1-
|
|
1
|
+
._k096v44-1-16-0 {
|
|
2
|
+
--_k096v40-1-16-0: var(--dt-colors-text-critical-default, #bb0731);
|
|
3
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-critical-default, #bb0731);
|
|
4
|
+
--_k096v42-1-16-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-16-0 {
|
|
7
|
+
--_k096v40-1-16-0: var(--dt-colors-text-neutral-default, #2f2f4f);
|
|
8
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-neutral-default, #2f2f4f);
|
|
9
|
+
--_k096v42-1-16-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-16-0 {
|
|
12
|
+
--_k096v40-1-16-0: var(--dt-colors-text-primary-default, #464cce);
|
|
13
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-primary-default, #464cce);
|
|
14
|
+
--_k096v42-1-16-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-16-0 {
|
|
17
|
+
--_k096v40-1-16-0: var(--dt-colors-text-success-default, #2d6761);
|
|
18
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-success-default, #2d6761);
|
|
19
|
+
--_k096v42-1-16-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-16-0 {
|
|
22
|
+
--_k096v40-1-16-0: var(--dt-colors-text-warning-default, #855400);
|
|
23
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-warning-default, #855400);
|
|
24
|
+
--_k096v42-1-16-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-16-0 {
|
|
27
|
+
--_k096v40-1-16-0: var(--dt-colors-text-primary-on-accent-default, #f4f4fb);
|
|
28
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-primary-on-accent-default, #f4f4fb);
|
|
29
|
+
--_k096v42-1-16-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-16-0 {
|
|
32
|
+
--_k096v40-1-16-0: var(--dt-colors-text-success-on-accent-default, #f1f4f4);
|
|
33
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-success-on-accent-default, #f1f4f4);
|
|
34
|
+
--_k096v42-1-16-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-16-0 {
|
|
37
|
+
--_k096v40-1-16-0: var(--dt-colors-text-warning-on-accent-default, #272024);
|
|
38
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-warning-on-accent-default, #272024);
|
|
39
|
+
--_k096v42-1-16-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-16-0 {
|
|
42
|
+
--_k096v40-1-16-0: var(--dt-colors-text-critical-on-accent-default, #f9f1f3);
|
|
43
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-critical-on-accent-default, #f9f1f3);
|
|
44
|
+
--_k096v42-1-16-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-16-0 {
|
|
47
|
+
--_k096v40-1-16-0: var(--dt-colors-text-neutral-on-accent-default, #f3f3f6);
|
|
48
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-neutral-on-accent-default, #f3f3f6);
|
|
49
|
+
--_k096v42-1-16-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-16-0 {
|
|
52
|
+
--_k096v40-1-16-0: var(--dt-colors-text-primary-disabled, #595a7d80);
|
|
53
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-primary-disabled, #595a7d80);
|
|
54
|
+
--_k096v42-1-16-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-16-0 {
|
|
57
|
+
--_k096v40-1-16-0: var(--dt-colors-text-success-disabled, #595a7d80);
|
|
58
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-success-disabled, #595a7d80);
|
|
59
|
+
--_k096v42-1-16-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-16-0 {
|
|
62
|
+
--_k096v40-1-16-0: var(--dt-colors-text-warning-disabled, #595a7d80);
|
|
63
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-warning-disabled, #595a7d80);
|
|
64
|
+
--_k096v42-1-16-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-16-0 {
|
|
67
|
+
--_k096v40-1-16-0: var(--dt-colors-text-critical-disabled, #595a7d80);
|
|
68
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-critical-disabled, #595a7d80);
|
|
69
|
+
--_k096v42-1-16-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-16-0 {
|
|
72
|
+
--_k096v40-1-16-0: var(--dt-colors-text-neutral-disabled, #595a7d80);
|
|
73
|
+
--_k096v41-1-16-0: var(--dt-colors-icon-neutral-disabled, #595a7d80);
|
|
74
|
+
--_k096v42-1-16-0: var(--dt-colors-border-neutral-disabled, #dadbe480);
|
|
75
75
|
}
|
|
@@ -7,27 +7,37 @@ export declare const colorUtilsCSS: import("@vanilla-extract/recipes").RuntimeFn
|
|
|
7
7
|
color: {
|
|
8
8
|
critical: {
|
|
9
9
|
vars: {
|
|
10
|
-
[
|
|
10
|
+
[vars.text]: string;
|
|
11
|
+
[vars.icon]: string;
|
|
12
|
+
[vars.borderColor]: string;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
neutral: {
|
|
14
16
|
vars: {
|
|
15
|
-
[
|
|
17
|
+
[vars.text]: string;
|
|
18
|
+
[vars.icon]: string;
|
|
19
|
+
[vars.borderColor]: string;
|
|
16
20
|
};
|
|
17
21
|
};
|
|
18
22
|
primary: {
|
|
19
23
|
vars: {
|
|
20
|
-
[
|
|
24
|
+
[vars.text]: string;
|
|
25
|
+
[vars.icon]: string;
|
|
26
|
+
[vars.borderColor]: string;
|
|
21
27
|
};
|
|
22
28
|
};
|
|
23
29
|
success: {
|
|
24
30
|
vars: {
|
|
25
|
-
[
|
|
31
|
+
[vars.text]: string;
|
|
32
|
+
[vars.icon]: string;
|
|
33
|
+
[vars.borderColor]: string;
|
|
26
34
|
};
|
|
27
35
|
};
|
|
28
36
|
warning: {
|
|
29
37
|
vars: {
|
|
30
|
-
[
|
|
38
|
+
[vars.text]: string;
|
|
39
|
+
[vars.icon]: string;
|
|
40
|
+
[vars.borderColor]: string;
|
|
31
41
|
};
|
|
32
42
|
};
|
|
33
43
|
};
|
|
@@ -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-16-0", variantClassNames: { color: { critical: "_k096v44-1-16-0", neutral: "_k096v45-1-16-0", primary: "_k096v46-1-16-0", success: "_k096v47-1-16-0", warning: "_k096v48-1-16-0" }, variant: { "default": "_k096v49-1-16-0", accent: "_k096v4a-1-16-0" }, disabled: { true: "_k096v4b-1-16-0", false: "_k096v4c-1-16-0" } }, defaultVariants: {}, compoundVariants: [[{ color: "primary", variant: "accent" }, "_k096v4d-1-16-0"], [{ color: "success", variant: "accent" }, "_k096v4e-1-16-0"], [{ color: "warning", variant: "accent" }, "_k096v4f-1-16-0"], [{ color: "critical", variant: "accent" }, "_k096v4g-1-16-0"], [{ color: "neutral", variant: "accent" }, "_k096v4h-1-16-0"], [{ color: "primary", disabled: true }, "_k096v4i-1-16-0"], [{ color: "success", disabled: true }, "_k096v4j-1-16-0"], [{ color: "warning", disabled: true }, "_k096v4k-1-16-0"], [{ color: "critical", disabled: true }, "_k096v4l-1-16-0"], [{ color: "neutral", disabled: true }, "_k096v4m-1-16-0"]] });
|
|
28
|
+
var colorUtilsVars = { text: "var(--_k096v40-1-16-0)", icon: "var(--_k096v41-1-16-0)", borderColor: "var(--_k096v42-1-16-0)" };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a boolean depending on whether we are in developer mode
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function isDev(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a boolean depending on whether we are in production mode
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function isProduction(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a boolean depending on whether we are in testing mode
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function isTest(): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var is_node_environment_exports = {};
|
|
20
|
+
__export(is_node_environment_exports, {
|
|
21
|
+
isDev: () => isDev,
|
|
22
|
+
isProduction: () => isProduction,
|
|
23
|
+
isTest: () => isTest
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(is_node_environment_exports);
|
|
26
|
+
function isDev() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function isProduction() {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
function isTest() {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs the given message as a warning, if we are in developer mode.
|
|
3
|
+
* Does nothing otherwise.
|
|
4
|
+
*
|
|
5
|
+
* @param log - main part of the log message.
|
|
6
|
+
* @param details - passed as second parameter to the console warn.
|
|
7
|
+
*/
|
|
8
|
+
export declare function devLog(log: string, details?: unknown): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var logging_exports = {};
|
|
20
|
+
__export(logging_exports, {
|
|
21
|
+
devLog: () => devLog
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(logging_exports);
|
|
24
|
+
var import_is_node_environment = require("./is-node-environment.js");
|
|
25
|
+
function devLog(log, details) {
|
|
26
|
+
if ((0, import_is_node_environment.isDev)()) {
|
|
27
|
+
if (details) {
|
|
28
|
+
console.warn(log, details);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
console.warn(log);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
._10kgnsa0-1-
|
|
1
|
+
._10kgnsa0-1-16-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-16-0);
|
|
9
|
+
color: var(--_bx32h0-1-16-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-16-0 {
|
|
27
27
|
text-align: start;
|
|
28
28
|
justify-content: space-between;
|
|
29
29
|
}
|
|
30
|
-
._10kgnsa2-1-
|
|
30
|
+
._10kgnsa2-1-16-0 {
|
|
31
31
|
text-align: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
}
|
|
34
|
-
._10kgnsa3-1-
|
|
34
|
+
._10kgnsa3-1-16-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-16-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-16-0 {
|
|
49
49
|
cursor: not-allowed;
|
|
50
50
|
}
|
|
51
|
-
._10kgnsa6-1-
|
|
51
|
+
._10kgnsa6-1-16-0 {
|
|
52
52
|
cursor: not-allowed;
|
|
53
|
-
background: var(--_bx32h2-1-
|
|
53
|
+
background: var(--_bx32h2-1-16-0);
|
|
54
54
|
}
|
|
55
|
-
._10kgnsa7-1-
|
|
55
|
+
._10kgnsa7-1-16-0 {
|
|
56
56
|
width: 100%;
|
|
57
57
|
}
|
|
58
|
-
._10kgnsa8-1-
|
|
58
|
+
._10kgnsa8-1-16-0 {
|
|
59
59
|
width: fit-content;
|
|
60
60
|
}
|
|
61
|
-
._10kgnsa9-1-
|
|
61
|
+
._10kgnsa9-1-16-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-16-0 ._10kgnsaa-1-16-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-16-0 ._10kgnsaa-1-16-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-16-0 {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
min-width: 0;
|
|
88
88
|
max-width: 100%;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
9
9
|
import { isElement } from "react-is";
|
|
10
|
-
import
|
|
10
|
+
import * as styles from "./Button.sty.js";
|
|
11
11
|
import { Label } from "./Label.js";
|
|
12
12
|
import { Prefix } from "./Prefix.js";
|
|
13
13
|
import { Suffix } from "./Suffix.js";
|
|
@@ -18,7 +18,7 @@ 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
|
-
import {
|
|
21
|
+
import { fieldColors } from "../../styles/field.sty.js";
|
|
22
22
|
function getButtonSlots(children) {
|
|
23
23
|
const slots = {};
|
|
24
24
|
Children.forEach(children, (child) => {
|
|
@@ -146,8 +146,8 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
146
146
|
className: clsx(
|
|
147
147
|
consumerClassName,
|
|
148
148
|
"strato-inputgroup",
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
fieldColors({ variant, color, disabled: disabledOrLoading }),
|
|
150
|
+
styles.button({
|
|
151
151
|
disabled: disabledOrLoading,
|
|
152
152
|
textAlign,
|
|
153
153
|
size,
|
|
@@ -155,8 +155,8 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
155
155
|
}),
|
|
156
156
|
focusClassName,
|
|
157
157
|
{
|
|
158
|
-
[`${
|
|
159
|
-
[`${
|
|
158
|
+
[`${styles.widths.content}`]: width === "content",
|
|
159
|
+
[`${styles.widths.full}`]: width === "full"
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
style: {
|
|
@@ -171,20 +171,20 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
171
171
|
className: clsx(
|
|
172
172
|
consumerClassName,
|
|
173
173
|
"strato-inputgroup",
|
|
174
|
-
|
|
174
|
+
fieldColors({
|
|
175
175
|
variant,
|
|
176
176
|
color,
|
|
177
177
|
disabled: disabledOrLoading || ariaDisabled
|
|
178
178
|
}),
|
|
179
|
-
|
|
179
|
+
styles.button({
|
|
180
180
|
disabled: disabledOrLoading || ariaDisabled,
|
|
181
181
|
textAlign,
|
|
182
182
|
size,
|
|
183
183
|
readOnly
|
|
184
184
|
}),
|
|
185
185
|
{
|
|
186
|
-
[`${
|
|
187
|
-
[`${
|
|
186
|
+
[`${styles.widths.content}`]: width === "content",
|
|
187
|
+
[`${styles.widths.full}`]: width === "full"
|
|
188
188
|
},
|
|
189
189
|
focusClassName
|
|
190
190
|
),
|
|
@@ -194,7 +194,7 @@ const _Button = /* @__PURE__ */ forwardRef(
|
|
|
194
194
|
},
|
|
195
195
|
...buttonMergedProps,
|
|
196
196
|
children: [
|
|
197
|
-
loading && /* @__PURE__ */ jsx("div", { className:
|
|
197
|
+
loading && /* @__PURE__ */ jsx("div", { className: styles.loading, children: /* @__PURE__ */ jsx(
|
|
198
198
|
ProgressCircle,
|
|
199
199
|
{
|
|
200
200
|
size: "small",
|
|
@@ -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 { 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 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 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 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": "AAsRQ,SAoFI,UApFJ,KA8EI,YA9EJ;AAtRR,OAAO,UAAU;AAEjB;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAE1B,
|
|
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": "AAsRQ,SAoFI,UApFJ,KA8EI,YA9EJ;AAtRR,OAAO,UAAU;AAEjB;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAE1B,YAAY,YAAY;AACxB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAU7B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAmGb,SAAR,eAAgC,UAAqB;AAC1D,QAAM,QAAqB,CAAC;AAE5B,WAAS,QAAQ,UAAU,CAAC,UAAU;AACpC,QAAI,UAAU,KAAK,GAAG;AACpB,cAAQ,MAAM,MAAM;AAAA,QAClB,KAAK;AACH,gBAAM,SAAS;AACf;AAAA,QACF,KAAK;AACH,gBAAM,SAAS;AACf;AAAA,QACF,KAAK;AACH,gBAAM,QAAQ;AACd;AAAA,QACF;AACE,gBAAM,aAAa,CAAC;AACpB,gBAAM,SAAS,KAAK,KAAK;AACzB;AAAA,MACJ;AAAA,IACF,OAAO;AACL,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,cAAM,aAAa,CAAC;AACpB,cAAM,SAAS,KAAK,KAAK;AAAA,MAC3B;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAEA,MAAM,UAEqC;AAAA,EACzC,CAAwB,OAAuB,QAA0B;AACvE,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,MACA,IAAI;AAAA,MACJ,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,OAAO;AAAA,MACP,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA;AAAA,MAEpB;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAoB;AACpB,UAAM,QAAQ,eAAe,QAAQ;AAErC,UAAM,eAAe,aAAa,gBAAgB;AAElD,UAAM,0BAA0B;AAAA,MAC9B,MAAO,UAAU,OAAO;AAAA,MACxB,CAAC,UAAU,OAAO;AAAA,IACpB;AACA,UAAM,oBAAoB;AAAA,MACxB,MAAM,2BAA2B;AAAA,MACjC,CAAC,cAAc,uBAAuB;AAAA,IACxC;AAEA,UAAM,EAAE,YAAY,eAAe,IAAI,aAAa;AAAA,MAClD,SAAS,CAAC,oBAAoB,QAAQ;AAAA,MACtC,UAAU;AAAA,IACZ,CAAC;AAED,UAAM,oBAAoB,qBAAqB,cAAc;AAE7D,UAAM,oBAAoD,CAAC,UAAU;AACnE,UAAI,yBAAyB;AAC3B,cAAM,eAAe;AACrB,cAAM,gBAAgB;AACtB;AAAA,MACF;AAEA,gBAAU,KAAK;AAAA,IACjB;AAEA,UAAM,cAAc;AAAA,MAClB;AAAA,MACA,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB;AAAA,MACA,UAAU,2BAA2B,CAAC;AAAA,MACtC,IAAI;AAAA,MACJ;AAAA,MACA,GAAG;AAAA,MACH,iBAAiB;AAAA,MACjB,SAAS;AAAA,IACX;AAKA,UAAM,2BAA2B;AAAA,MAC/B,cAAc,KAAmB;AAC/B,YAAI,yBAAyB;AAC3B,cAAI,eAAe;AACnB,cAAI,gBAAgB;AAAA,QACtB;AAAA,MACF;AAAA,MACA,YAAY,KAAmB;AAC7B,YAAI,yBAAyB;AAC3B,cAAI,eAAe;AACnB,cAAI,gBAAgB;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAEA,UAAM,cAAc,YAAY,aAAa;AAE7C,UAAM,oBAAoB;AAAA,MACxB,GAAG;AAAA,QACD;AAAA,QACA;AAAA;AAAA;AAAA;AAAA,QAIA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,UAAM,OAAO,QAAQ;AAGrB,UAAM,YAAY,MAAM;AAGxB,QAAI,CAAC,aAAa;AAChB,aACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA,YAAY,EAAE,SAAS,OAAO,UAAU,kBAAkB,CAAC;AAAA,YAC3D,OAAO,OAAO;AAAA,cACZ,UAAU;AAAA,cACV;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,YACD;AAAA,YACA;AAAA,cACE,CAAC,GAAG,OAAO,OAAO,OAAO,EAAE,GAAG,UAAU;AAAA,cACxC,CAAC,GAAG,OAAO,OAAO,IAAI,EAAE,GAAG,UAAU;AAAA,YACvC;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,OAAO,UAAU,aAAa,UAAU,SAAS,QAAQ;AAAA,UAC3D;AAAA;AAAA,MACF;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA,YAAY;AAAA,YACV;AAAA,YACA;AAAA,YACA,UAAU,qBAAqB;AAAA,UACjC,CAAC;AAAA,UACD,OAAO,OAAO;AAAA,YACZ,UAAU,qBAAqB;AAAA,YAC/B;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA,UACD;AAAA,YACE,CAAC,GAAG,OAAO,OAAO,OAAO,EAAE,GAAG,UAAU;AAAA,YACxC,CAAC,GAAG,OAAO,OAAO,IAAI,EAAE,GAAG,UAAU;AAAA,UACvC;AAAA,UACA;AAAA,QACF;AAAA,QACA,OAAO;AAAA,UACL,OAAO,UAAU,aAAa,UAAU,SAAS,QAAQ;AAAA,UACzD,GAAG;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QAEH;AAAA,qBACC,oBAAC,SAAI,WAAW,OAAO,SACrB;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,cACA,cAAY,KAAK,cAAc;AAAA,gBAC7B,gBAAgB;AAAA,gBAChB,IAAI;AAAA,gBACJ,aAAa;AAAA,cACf,CAAC;AAAA;AAAA,UACH,GACF;AAAA,UAEF;AAAA,YAAC;AAAA;AAAA,cACC,KAAK,SAAS,YAAY,IAAI;AAAA,cAC9B,MAAK;AAAA,cACL,OAAM;AAAA,cACN,UAAS;AAAA,cACT,YAAW;AAAA,cACX,gBAAgB,cAAc,UAAU,kBAAkB;AAAA,cAC1D,OAAO;AAAA,gBACL,YAAY,UAAU,WAAW;AAAA,cACnC;AAAA,cAEC;AAAA,8BAAc,UACb,qBAAC,QAAK,UAAU,GAAG,KAAK,SAAS,YAAY,IAAI,GAC9C;AAAA,wBAAM;AAAA,kBACN,MAAM;AAAA,kBACN,MAAM,YAAY,oBAAC,OAAO,OAAP,EAAc,gBAAM,UAAS;AAAA,mBACnD,IAEA,iCACG;AAAA,wBAAM;AAAA,kBACN,MAAM;AAAA,kBACN,MAAM,YAAY,oBAAC,OAAO,OAAP,EAAc,gBAAM,UAAS;AAAA,mBACnD;AAAA,gBAED,MAAM;AAAA;AAAA;AAAA,UACT;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEC,QAAqD,cAAc;AAQ7D,MAAM,SAAS,OAAO,OAAO,SAAS;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,14 +2,14 @@ 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
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var button = _7a468({ defaultClassName: "_10kgnsa0-1-16-0", variantClassNames: { textAlign: { start: "_10kgnsa1-1-16-0", center: "_10kgnsa2-1-16-0" }, size: { condensed: "_10kgnsa3-1-16-0", "default": "_10kgnsa4-1-16-0" }, disabled: { true: "_10kgnsa5-1-16-0" }, readOnly: { true: "_10kgnsa6-1-16-0" } }, defaultVariants: { size: "default", textAlign: "center", disabled: false }, compoundVariants: [] });
|
|
6
|
+
var label = _7a468({ defaultClassName: "_10kgnsaa-1-16-0", variantClassNames: { textual: { true: "_oqqp1n0-1-16-0", false: "_10kgnsac-1-16-0" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7
|
+
var loading = "_10kgnsa9-1-16-0";
|
|
8
|
+
var widths = { full: "_10kgnsa7-1-16-0", content: "_10kgnsa8-1-16-0" };
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
button,
|
|
11
|
+
label,
|
|
12
|
+
loading,
|
|
13
|
+
widths
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=Button.sty.js.map
|
|
@@ -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
|
|
5
|
-
"mappings": "AAAA,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,mBAAmB,cAAc;AACnC,IAAI,
|
|
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-16-0',variantClassNames:{textAlign:{start:'_10kgnsa1-1-16-0',center:'_10kgnsa2-1-16-0'},size:{condensed:'_10kgnsa3-1-16-0','default':'_10kgnsa4-1-16-0'},disabled:{true:'_10kgnsa5-1-16-0'},readOnly:{true:'_10kgnsa6-1-16-0'}},defaultVariants:{size:'default',textAlign:'center',disabled:false},compoundVariants:[]});\nexport var label = _7a468({defaultClassName:'_10kgnsaa-1-16-0',variantClassNames:{textual:{true:'_oqqp1n0-1-16-0',false:'_10kgnsac-1-16-0'}},defaultVariants:{},compoundVariants:[]});\nexport var loading = '_10kgnsa9-1-16-0';\nexport var widths = {full:'_10kgnsa7-1-16-0',content:'_10kgnsa8-1-16-0'};"],
|
|
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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { label } from "./Button.sty.js";
|
|
5
5
|
import { canReceiveDefaultTextFormat } from "../../core/utils/can-receive-default-text-format.js";
|
|
6
6
|
const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
7
7
|
const {
|
|
@@ -18,7 +18,7 @@ const Label = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
18
18
|
"data-testid": dataTestId,
|
|
19
19
|
className: clsx(
|
|
20
20
|
"strato-button-label",
|
|
21
|
-
|
|
21
|
+
label({ textual }),
|
|
22
22
|
consumerClassName
|
|
23
23
|
),
|
|
24
24
|
style: consumerStyle,
|
|
@@ -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 { forwardRef, type ReactNode } from 'react';\n\nimport {
|
|
5
|
-
"mappings": "AAqCI;AArCJ,OAAO,UAAU;AACjB,SAAS,kBAAkC;AAE3C,SAAS,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { label } from './Button.sty.js';\nimport { type DataTestId } from '../../core/types/data-props.js';\nimport { type StylingProps } from '../../core/types/styling-props.js';\nimport { canReceiveDefaultTextFormat } from '../../core/utils/can-receive-default-text-format.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 = canReceiveDefaultTextFormat(children);\n\n return (\n <div\n ref={forwardedRef}\n data-testid={dataTestId}\n className={clsx(\n 'strato-button-label',\n label({ 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,aAAa;AAGtB,SAAS,mCAAmC;AAiBrC,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,4BAA4B,QAAQ;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa;AAAA,MACb,WAAW;AAAA,QACT;AAAA,QACA,MAAM,EAAE,QAAQ,CAAC;AAAA,QACjB;AAAA,MACF;AAAA,MACA,OAAO;AAAA,MAEN;AAAA;AAAA,EACH;AAEJ,CAAC;AAEA,MAAiD,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|