@dynatrace/strato-components 0.85.0 → 0.85.21
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/README.md +1 -1
- package/buttons/button/Button.css +93 -0
- package/buttons/button/Button.d.ts +94 -0
- package/buttons/button/Button.js +258 -0
- package/buttons/button/Button.sty.d.ts +51 -0
- package/buttons/button/Button.sty.js +33 -0
- package/buttons/button/Label.d.ts +16 -0
- package/buttons/button/Label.js +60 -0
- package/buttons/button/Prefix.d.ts +16 -0
- package/buttons/button/Prefix.js +54 -0
- package/buttons/button/Suffix.d.ts +16 -0
- package/buttons/button/Suffix.js +56 -0
- package/buttons/button/types/button-aria.d.ts +37 -0
- package/buttons/button/types/button-aria.js +15 -0
- package/buttons/button/utils/focus-without-scrolling.d.ts +5 -0
- package/buttons/button/utils/focus-without-scrolling.js +77 -0
- package/buttons/button/utils/is-virtual-event.d.ts +10 -0
- package/buttons/button/utils/is-virtual-event.js +32 -0
- package/buttons/index.d.ts +10 -0
- package/buttons/index.js +30 -0
- package/buttons/intent-button/IntentButton.d.ts +44 -0
- package/buttons/intent-button/IntentButton.js +102 -0
- package/buttons/intent-button/useIntentButton.d.ts +12 -0
- package/buttons/intent-button/useIntentButton.js +72 -0
- package/content/index.d.ts +4 -0
- package/content/index.js +5 -1
- package/content/progress/ProgressBar.js +1 -2
- package/content/progress/ProgressCircle.js +1 -2
- package/content/skeleton/Skeleton.css +33 -0
- package/content/skeleton/Skeleton.d.ts +30 -0
- package/content/skeleton/Skeleton.js +60 -0
- package/content/skeleton/Skeleton.sty.d.ts +10 -0
- package/content/skeleton/Skeleton.sty.js +25 -0
- package/content/skeleton/SkeletonText.d.ts +24 -0
- package/content/skeleton/SkeletonText.js +84 -0
- package/esm/buttons/button/Button.css +93 -0
- package/esm/buttons/button/Button.js +233 -0
- package/esm/buttons/button/Button.js.map +7 -0
- package/esm/buttons/button/Button.sty.js +15 -0
- package/esm/buttons/button/Button.sty.js.map +7 -0
- package/esm/buttons/button/Label.js +32 -0
- package/esm/buttons/button/Label.js.map +7 -0
- package/esm/buttons/button/Prefix.js +26 -0
- package/esm/buttons/button/Prefix.js.map +7 -0
- package/esm/buttons/button/Suffix.js +28 -0
- package/esm/buttons/button/Suffix.js.map +7 -0
- package/esm/buttons/button/types/button-aria.js +1 -0
- package/esm/buttons/button/types/button-aria.js.map +7 -0
- package/esm/buttons/button/utils/focus-without-scrolling.js +59 -0
- package/esm/buttons/button/utils/focus-without-scrolling.js.map +7 -0
- package/esm/buttons/button/utils/is-virtual-event.js +14 -0
- package/esm/buttons/button/utils/is-virtual-event.js.map +7 -0
- package/esm/buttons/index.js +15 -0
- package/esm/buttons/index.js.map +7 -0
- package/esm/buttons/intent-button/IntentButton.js +74 -0
- package/esm/buttons/intent-button/IntentButton.js.map +7 -0
- package/esm/buttons/intent-button/useIntentButton.js +57 -0
- package/esm/buttons/intent-button/useIntentButton.js.map +7 -0
- package/esm/content/index.js +5 -1
- package/esm/content/index.js.map +2 -2
- package/esm/content/progress/ProgressBar.js +2 -3
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressCircle.js +2 -3
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/skeleton/Skeleton.css +33 -0
- package/esm/content/skeleton/Skeleton.js +32 -0
- package/esm/content/skeleton/Skeleton.js.map +7 -0
- package/esm/content/skeleton/Skeleton.sty.js +7 -0
- package/esm/content/skeleton/Skeleton.sty.js.map +7 -0
- package/esm/content/skeleton/SkeletonText.js +56 -0
- package/esm/content/skeleton/SkeletonText.js.map +7 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +2 -2
- package/esm/layouts/{Divider → divider}/Divider.css +5 -5
- package/esm/layouts/{Divider → divider}/Divider.js.map +1 -1
- package/esm/layouts/{Divider → divider}/Divider.sty.js +1 -1
- package/esm/layouts/{Divider → divider}/Divider.sty.js.map +2 -2
- package/esm/layouts/helpers/spacingToCss.js +13 -0
- package/esm/layouts/helpers/spacingToCss.js.map +7 -0
- package/esm/layouts/hooks/useLayoutSizeProps.js +15 -0
- package/esm/layouts/hooks/useLayoutSizeProps.js.map +7 -0
- package/esm/layouts/hooks/useLayoutStyles.js +105 -0
- package/esm/layouts/hooks/useLayoutStyles.js.map +7 -0
- package/esm/layouts/hooks/useMarginProps.js +55 -0
- package/esm/layouts/hooks/useMarginProps.js.map +7 -0
- package/esm/layouts/hooks/usePaddingProps.js +59 -0
- package/esm/layouts/hooks/usePaddingProps.js.map +7 -0
- package/esm/layouts/index.js +6 -2
- package/esm/layouts/index.js.map +2 -2
- package/esm/layouts/surface/Surface.css +95 -0
- package/esm/layouts/surface/Surface.js +84 -0
- package/esm/layouts/surface/Surface.js.map +7 -0
- package/esm/layouts/surface/Surface.sty.js +10 -0
- package/esm/layouts/surface/Surface.sty.js.map +7 -0
- package/esm/layouts/surface/variables.sty.js +5 -0
- package/esm/layouts/surface/variables.sty.js.map +7 -0
- package/esm/layouts/types/layout.types.js +1 -0
- package/esm/layouts/types/layout.types.js.map +7 -0
- package/esm/styles/field.css +208 -0
- package/esm/styles/field.sty.js +9 -0
- package/esm/styles/field.sty.js.map +7 -0
- package/esm/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
- package/esm/typography/{BlockQuote → block-quote}/Blockquote.js.map +2 -2
- package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
- package/esm/typography/{BlockQuote → block-quote}/Blockquote.sty.js.map +2 -2
- package/{typography/Code → esm/typography/code}/Code.css +1 -1
- package/esm/typography/code/Code.js.map +7 -0
- package/esm/typography/{Code → code}/Code.sty.js +1 -1
- package/esm/typography/{Code → code}/Code.sty.js.map +2 -2
- package/esm/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
- package/esm/typography/{Emphasis → emphasis}/Emphasis.js.map +2 -2
- package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
- package/esm/typography/{Emphasis → emphasis}/Emphasis.sty.js.map +2 -2
- package/{typography/ExternalLink → esm/typography/external-link}/ExternalLink.css +6 -6
- package/esm/typography/external-link/ExternalLink.js.map +7 -0
- package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
- package/esm/typography/{ExternalLink → external-link}/ExternalLink.sty.js.map +2 -2
- package/esm/typography/{Heading → heading}/Heading.css +7 -7
- package/esm/typography/heading/Heading.js.map +7 -0
- package/esm/typography/heading/Heading.sty.js +7 -0
- package/esm/typography/{Heading → heading}/Heading.sty.js.map +2 -2
- package/esm/typography/{Highlight → highlight}/Highlight.css +1 -1
- package/esm/typography/{Highlight → highlight}/Highlight.js.map +2 -2
- package/esm/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
- package/esm/typography/{Highlight → highlight}/Highlight.sty.js.map +2 -2
- package/esm/typography/index.js +13 -13
- package/esm/typography/index.js.map +1 -1
- package/{typography/Link → esm/typography/link}/Link.css +4 -4
- package/esm/typography/{Link → link}/Link.js +1 -1
- package/esm/typography/link/Link.js.map +7 -0
- package/esm/typography/{Link → link}/Link.sty.js +1 -1
- package/esm/typography/{Link → link}/Link.sty.js.map +2 -2
- package/esm/typography/{List → list}/List.css +4 -4
- package/esm/typography/{List → list}/List.js +1 -1
- package/esm/typography/{List → list}/List.js.map +2 -2
- package/esm/typography/{List → list}/List.sty.js +2 -2
- package/esm/typography/{List → list}/List.sty.js.map +2 -2
- package/esm/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
- package/esm/typography/{Paragraph → paragraph}/Paragraph.js.map +2 -2
- package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
- package/esm/typography/{Paragraph → paragraph}/Paragraph.sty.js.map +2 -2
- package/{typography/Strikethrough → esm/typography/strikethrough}/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.js.map +7 -0
- package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
- package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js.map +2 -2
- package/{typography/Strong → esm/typography/strong}/Strong.css +1 -1
- package/esm/typography/{Strong → strong}/Strong.js.map +2 -2
- package/esm/typography/{Strong → strong}/Strong.sty.js +1 -1
- package/esm/typography/{Strong → strong}/Strong.sty.js.map +2 -2
- package/{typography/Text → esm/typography/text}/Text.css +3 -3
- package/esm/typography/text/Text.js.map +7 -0
- package/esm/typography/{Text → text}/Text.sty.js +1 -1
- package/esm/typography/{Text → text}/Text.sty.js.map +2 -2
- package/{typography/TextEllipsis → esm/typography/text-ellipsis}/TextEllipsis.css +4 -4
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +7 -0
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +7 -0
- package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js.map +2 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/lang/en.json +12 -0
- package/lang/ja.json +24 -0
- package/lang/uncompiled/en.json +8 -0
- package/lang/uncompiled/ja.json +14 -1
- package/layouts/{Divider → divider}/Divider.css +5 -5
- package/layouts/{Divider → divider}/Divider.sty.js +1 -1
- package/layouts/helpers/spacingToCss.d.ts +6 -0
- package/layouts/helpers/spacingToCss.js +29 -0
- package/layouts/hooks/useLayoutSizeProps.d.ts +6 -0
- package/layouts/hooks/useLayoutSizeProps.js +33 -0
- package/layouts/hooks/useLayoutStyles.d.ts +7 -0
- package/layouts/hooks/useLayoutStyles.js +123 -0
- package/layouts/hooks/useMarginProps.d.ts +7 -0
- package/layouts/hooks/useMarginProps.js +73 -0
- package/layouts/hooks/usePaddingProps.d.ts +7 -0
- package/layouts/hooks/usePaddingProps.js +77 -0
- package/layouts/index.d.ts +6 -2
- package/layouts/index.js +6 -2
- package/layouts/surface/Surface.css +95 -0
- package/layouts/surface/Surface.d.ts +46 -0
- package/layouts/surface/Surface.js +110 -0
- package/layouts/surface/Surface.sty.d.ts +43 -0
- package/layouts/surface/Surface.sty.js +28 -0
- package/layouts/surface/variables.sty.d.ts +1 -0
- package/layouts/surface/variables.sty.js +23 -0
- package/layouts/types/layout.types.d.ts +64 -0
- package/layouts/types/layout.types.js +15 -0
- package/package.json +11 -4
- package/styles/field.css +208 -0
- package/styles/field.sty.d.ts +102 -0
- package/styles/field.sty.js +27 -0
- package/styles/sprinkles.sty.d.ts +107 -107
- package/typography/{BlockQuote → block-quote}/Blockquote.css +2 -2
- package/typography/{BlockQuote → block-quote}/Blockquote.sty.js +1 -1
- package/{esm/typography/Code → typography/code}/Code.css +1 -1
- package/typography/{Code → code}/Code.d.ts +2 -2
- package/typography/{Code → code}/Code.sty.js +1 -1
- package/typography/{Emphasis → emphasis}/Emphasis.css +1 -1
- package/typography/{Emphasis → emphasis}/Emphasis.sty.js +1 -1
- package/{esm/typography/ExternalLink → typography/external-link}/ExternalLink.css +6 -6
- package/typography/{ExternalLink → external-link}/ExternalLink.d.ts +2 -2
- package/typography/{ExternalLink → external-link}/ExternalLink.sty.js +1 -1
- package/typography/{Heading → heading}/Heading.css +7 -7
- package/typography/{Heading → heading}/Heading.d.ts +3 -2
- package/typography/{Heading → heading}/Heading.sty.js +1 -1
- package/typography/{Highlight → highlight}/Highlight.css +1 -1
- package/typography/{Highlight → highlight}/Highlight.sty.js +1 -1
- package/typography/index.d.ts +26 -26
- package/typography/index.js +13 -13
- package/{esm/typography/Link → typography/link}/Link.css +4 -4
- package/typography/{Link → link}/Link.d.ts +2 -2
- package/typography/{Link → link}/Link.js +1 -1
- package/typography/{Link → link}/Link.sty.js +1 -1
- package/typography/{List → list}/List.css +4 -4
- package/typography/{List → list}/List.js +1 -1
- package/typography/{List → list}/List.sty.js +2 -2
- package/typography/{Paragraph → paragraph}/Paragraph.css +3 -3
- package/typography/{Paragraph → paragraph}/Paragraph.sty.js +1 -1
- package/{esm/typography/Strikethrough → typography/strikethrough}/Strikethrough.css +1 -1
- package/typography/{Strikethrough → strikethrough}/Strikethrough.d.ts +2 -2
- package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.js +1 -1
- package/{esm/typography/Strong → typography/strong}/Strong.css +1 -1
- package/typography/{Strong → strong}/Strong.sty.js +1 -1
- package/{esm/typography/Text → typography/text}/Text.css +3 -3
- package/typography/{Text → text}/Text.d.ts +3 -2
- package/typography/{Text → text}/Text.sty.js +1 -1
- package/{esm/typography/TextEllipsis → typography/text-ellipsis}/TextEllipsis.css +4 -4
- package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.d.ts +3 -3
- package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.js +1 -1
- package/esm/typography/Code/Code.js.map +0 -7
- package/esm/typography/ExternalLink/ExternalLink.js.map +0 -7
- package/esm/typography/Heading/Heading.js.map +0 -7
- package/esm/typography/Heading/Heading.sty.js +0 -7
- package/esm/typography/Link/Link.js.map +0 -7
- package/esm/typography/Strikethrough/Strikethrough.js.map +0 -7
- package/esm/typography/Text/Text.js.map +0 -7
- package/esm/typography/TextEllipsis/TextEllipsis.js.map +0 -7
- package/esm/typography/TextEllipsis/TextEllipsis.sty.js +0 -7
- package/esm/layouts/{Divider → divider}/Divider.js +0 -0
- package/esm/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
- package/esm/typography/{Code → code}/Code.js +0 -0
- package/esm/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
- package/esm/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
- package/esm/typography/{Heading → heading}/Heading.js +0 -0
- package/esm/typography/{Highlight → highlight}/Highlight.js +0 -0
- package/esm/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
- package/esm/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
- package/esm/typography/{Strong → strong}/Strong.js +0 -0
- package/esm/typography/{Text → text}/Text.js +0 -0
- package/esm/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
- package/layouts/{Divider → divider}/Divider.d.ts +0 -0
- package/layouts/{Divider → divider}/Divider.js +0 -0
- package/layouts/{Divider → divider}/Divider.sty.d.ts +0 -0
- package/typography/{BlockQuote → block-quote}/Blockquote.d.ts +1 -1
- package/typography/{BlockQuote → block-quote}/Blockquote.js +0 -0
- package/typography/{BlockQuote → block-quote}/Blockquote.sty.d.ts +0 -0
- package/typography/{Code → code}/Code.js +0 -0
- package/typography/{Code → code}/Code.sty.d.ts +0 -0
- package/typography/{Emphasis → emphasis}/Emphasis.d.ts +1 -1
- package/typography/{Emphasis → emphasis}/Emphasis.js +0 -0
- package/typography/{Emphasis → emphasis}/Emphasis.sty.d.ts +0 -0
- package/typography/{ExternalLink → external-link}/ExternalLink.js +0 -0
- package/typography/{ExternalLink → external-link}/ExternalLink.sty.d.ts +0 -0
- package/typography/{Heading → heading}/Heading.js +0 -0
- package/typography/{Heading → heading}/Heading.sty.d.ts +0 -0
- package/typography/{Highlight → highlight}/Highlight.d.ts +1 -1
- package/typography/{Highlight → highlight}/Highlight.js +0 -0
- package/typography/{Highlight → highlight}/Highlight.sty.d.ts +0 -0
- package/typography/{Link → link}/Link.sty.d.ts +0 -0
- package/typography/{List → list}/List.d.ts +1 -1
- package/typography/{List → list}/List.sty.d.ts +0 -0
- package/typography/{Paragraph → paragraph}/Paragraph.d.ts +1 -1
- package/typography/{Paragraph → paragraph}/Paragraph.js +0 -0
- package/typography/{Paragraph → paragraph}/Paragraph.sty.d.ts +0 -0
- package/typography/{Strikethrough → strikethrough}/Strikethrough.js +0 -0
- package/typography/{Strikethrough → strikethrough}/Strikethrough.sty.d.ts +0 -0
- package/typography/{Strong → strong}/Strong.d.ts +1 -1
- /package/typography/{Strong → strong}/Strong.js +0 -0
- /package/typography/{Strong → strong}/Strong.sty.d.ts +0 -0
- /package/typography/{Text → text}/Text.js +0 -0
- /package/typography/{Text → text}/Text.sty.d.ts +0 -0
- /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.js +0 -0
- /package/typography/{TextEllipsis → text-ellipsis}/TextEllipsis.sty.d.ts +0 -0
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ npm install @dynatrace/strato-components
|
|
|
12
12
|
|
|
13
13
|
## Documentation
|
|
14
14
|
|
|
15
|
-
Check out the extensive documentation on the [Dynatrace Developer Documentation](https://developer.dynatrace.com/
|
|
15
|
+
Check out the extensive documentation on the [Dynatrace Developer Documentation](https://developer.dynatrace.com/design/components/)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.Button_buttonCSS__10kgnsa0 {
|
|
2
|
+
font-family: var(--dt-typography-text-base-default-family, DynatraceFlow,Roboto,Helvetica,sans-serif);
|
|
3
|
+
font-weight: var(--dt-typography-text-base-emphasized-weight, 500);
|
|
4
|
+
font-size: var(--dt-typography-text-base-default-size, 14px);
|
|
5
|
+
line-height: var(--dt-typography-text-base-default-line-height, 1.4285714286);
|
|
6
|
+
text-decoration: var(--dt-typography-text-base-default-text-decoration, none);
|
|
7
|
+
text-transform: none;
|
|
8
|
+
background: var(--vars_background__bx32h3);
|
|
9
|
+
color: var(--vars_text__bx32h0);
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
position: relative;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
height: max-content;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
border-color: transparent;
|
|
19
|
+
border-style: solid;
|
|
20
|
+
border-width: 0;
|
|
21
|
+
border-radius: var(--dt-borders-radius-field-default, 8px);
|
|
22
|
+
transition-timing-function: var(--dt-animations-fade-out-easing, cubic-bezier(0, 0, 0.2, 1));
|
|
23
|
+
transition-duration: var(--dt-animations-fade-out-duration-base, 250ms);
|
|
24
|
+
transition-property: color, background-color, transform;
|
|
25
|
+
}
|
|
26
|
+
.Button_buttonCSS__10kgnsa0:hover {
|
|
27
|
+
transition-timing-function: var(--dt-animations-fade-in-easing, cubic-bezier(0.5, 0, 1, 1));
|
|
28
|
+
transition-duration: var(--dt-animations-fade-in-duration-base, 250ms);
|
|
29
|
+
}
|
|
30
|
+
.Button_buttonCSS_textAlign_start__10kgnsa1 {
|
|
31
|
+
text-align: start;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
}
|
|
34
|
+
.Button_buttonCSS_textAlign_center__10kgnsa2 {
|
|
35
|
+
text-align: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
.Button_buttonCSS_size_condensed__10kgnsa3 {
|
|
39
|
+
padding-top: var(--dt-spacings-size-2, 2px);
|
|
40
|
+
padding-bottom: var(--dt-spacings-size-2, 2px);
|
|
41
|
+
padding-left: var(--dt-spacings-size-4, 4px);
|
|
42
|
+
padding-right: var(--dt-spacings-size-4, 4px);
|
|
43
|
+
gap: var(--dt-spacings-size-2, 2px);
|
|
44
|
+
}
|
|
45
|
+
.Button_buttonCSS_size_default__10kgnsa4 {
|
|
46
|
+
padding-top: var(--dt-spacings-size-6, 6px);
|
|
47
|
+
padding-bottom: var(--dt-spacings-size-6, 6px);
|
|
48
|
+
padding-left: var(--dt-spacings-size-8, 8px);
|
|
49
|
+
padding-right: var(--dt-spacings-size-8, 8px);
|
|
50
|
+
gap: var(--dt-spacings-size-4, 4px);
|
|
51
|
+
}
|
|
52
|
+
.Button_buttonCSS_disabled_true__10kgnsa5 {
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
.Button_buttonCSS_readOnly_true__10kgnsa6 {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
background: var(--vars_backgroundStatic__bx32h2);
|
|
58
|
+
}
|
|
59
|
+
.Button_buttonWidthsCSS_full__10kgnsa7 {
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
.Button_buttonWidthsCSS_content__10kgnsa8 {
|
|
63
|
+
width: fit-content;
|
|
64
|
+
}
|
|
65
|
+
.Button_buttonLoadingCSS__10kgnsa9 {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
left: 0;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
border-radius: var(--dt-borders-radius-field-default, 8px);
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
}
|
|
77
|
+
.Button_buttonCSS_size_condensed__10kgnsa3 .Button_buttonLabelCSS__10kgnsaa:not(:has(svg:only-child)) {
|
|
78
|
+
padding-top: 0;
|
|
79
|
+
padding-bottom: 0;
|
|
80
|
+
padding-left: 2px;
|
|
81
|
+
padding-right: 2px;
|
|
82
|
+
}
|
|
83
|
+
.Button_buttonCSS_size_default__10kgnsa4 .Button_buttonLabelCSS__10kgnsaa:not(:has(svg:only-child)) {
|
|
84
|
+
padding-top: 0;
|
|
85
|
+
padding-bottom: 0;
|
|
86
|
+
padding-left: 4px;
|
|
87
|
+
padding-right: 4px;
|
|
88
|
+
}
|
|
89
|
+
.Button_buttonLabelCSS_textual_false__10kgnsac {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
import React, { type ElementType, type MouseEventHandler, type ReactElement, type ReactNode } from 'react';
|
|
3
|
+
import { type AriaDisabledProps, type AriaLabelingProps } from '../../core/types/a11y-props.js';
|
|
4
|
+
import { type DataTestId } from '../../core/types/data-props.js';
|
|
5
|
+
import { type MaskingProps } from '../../core/types/masking-props.js';
|
|
6
|
+
import { type PolymorphicComponentProps } from '../../core/types/polymorph.js';
|
|
7
|
+
import { type StylingProps } from '../../core/types/styling-props.js';
|
|
8
|
+
import { type WithChildren } from '../../core/types/with-children.js';
|
|
9
|
+
/**
|
|
10
|
+
* Accepted properties for the Button.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ButtonOwnProps extends AriaLabelingProps, AriaDisabledProps, WithChildren, StylingProps, DataTestId, MaskingProps {
|
|
14
|
+
/**
|
|
15
|
+
* If a button is disabled e.g. it cannot be interacted with.
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Different variants have different styles.
|
|
21
|
+
* @defaultValue 'default'
|
|
22
|
+
*/
|
|
23
|
+
variant?: 'default' | 'emphasized' | 'accent';
|
|
24
|
+
/**
|
|
25
|
+
* The HTML button type.
|
|
26
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type}
|
|
27
|
+
* @defaultValue 'button'
|
|
28
|
+
*/
|
|
29
|
+
type?: 'button' | 'reset' | 'submit';
|
|
30
|
+
/** Called when the button is interacted with. */
|
|
31
|
+
onClick?: MouseEventHandler;
|
|
32
|
+
/**
|
|
33
|
+
* The width of the button.
|
|
34
|
+
* @defaultValue 'content'
|
|
35
|
+
*/
|
|
36
|
+
width?: 'content' | 'full' | CSS.Property.Width<string & {}>;
|
|
37
|
+
/**
|
|
38
|
+
* The color of the button. This should be chosen based on the context
|
|
39
|
+
* the button is used in.
|
|
40
|
+
* @defaultValue 'neutral'
|
|
41
|
+
*/
|
|
42
|
+
color?: 'primary' | 'neutral' | 'success' | 'critical' | 'warning';
|
|
43
|
+
/**
|
|
44
|
+
* Controls the text alignment inside the button. Only affects the button
|
|
45
|
+
* if the width is not set to 'content'.
|
|
46
|
+
* @defaultValue 'center'
|
|
47
|
+
*/
|
|
48
|
+
textAlign?: 'center' | 'start';
|
|
49
|
+
/**
|
|
50
|
+
* The size of the button.
|
|
51
|
+
* @defaultValue 'default'
|
|
52
|
+
*/
|
|
53
|
+
size?: 'default' | 'condensed';
|
|
54
|
+
/**
|
|
55
|
+
* The current loading state of the button. If true, a loading icon is shown and the button is disabled.
|
|
56
|
+
* @defaultValue false
|
|
57
|
+
*/
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Determines whether the element is in read-only mode.
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
63
|
+
readOnly?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Merge own props with others inherited from the underlying element type.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export type ButtonProps<E extends ElementType> = PolymorphicComponentProps<E, ButtonOwnProps>;
|
|
70
|
+
type ButtonSlots = {
|
|
71
|
+
label?: ReactNode;
|
|
72
|
+
prefix?: ReactNode;
|
|
73
|
+
suffix?: ReactNode;
|
|
74
|
+
freeform?: ReactNode[];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Iterates over child nodes to extract specific component slots.
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export default function getButtonSlots(children: ReactNode): ButtonSlots;
|
|
81
|
+
export declare const _Button: <E extends ElementType = 'button'>(props: ButtonProps<E>) => ReactElement | null;
|
|
82
|
+
/**
|
|
83
|
+
* Buttons allow users to trigger actions or events
|
|
84
|
+
* with a single click anywhere within the button container.
|
|
85
|
+
* Users can also trigger a button by pressing
|
|
86
|
+
* `Enter` or `Space` while the button has focus.
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export declare const Button: (<E extends React.ElementType = "button">(props: ButtonProps<E>) => ReactElement | null) & {
|
|
90
|
+
Suffix: (props: import("./Suffix.js").ButtonSuffixProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
91
|
+
Prefix: (props: import("./Prefix.js").ButtonPrefixProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
92
|
+
Label: (props: import("./Label.js").ButtonLabelProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
93
|
+
};
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Button_exports = {};
|
|
29
|
+
__export(Button_exports, {
|
|
30
|
+
Button: () => Button,
|
|
31
|
+
_Button: () => _Button,
|
|
32
|
+
default: () => getButtonSlots
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Button_exports);
|
|
35
|
+
var import_clsx = __toESM(require("clsx"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_react_intl = require("react-intl");
|
|
38
|
+
var import_react_is = require("react-is");
|
|
39
|
+
var import_Button_css = require("./Button.sty.js");
|
|
40
|
+
var import_Label = require("./Label.js");
|
|
41
|
+
var import_Prefix = require("./Prefix.js");
|
|
42
|
+
var import_Suffix = require("./Suffix.js");
|
|
43
|
+
var import_ProgressCircle = require("../../content/progress/ProgressCircle.js");
|
|
44
|
+
var import_useAriaLabelingProps = require("../../core/hooks/useAriaLabelingProps.js");
|
|
45
|
+
var import_useFocusRing = require("../../core/styles/useFocusRing.js");
|
|
46
|
+
var import_merge_props = require("../../core/utils/merge-props.js");
|
|
47
|
+
var import_Flex = require("../../layouts/flex/Flex.js");
|
|
48
|
+
var import_Grid = require("../../layouts/grid/Grid.js");
|
|
49
|
+
var import_field_css = require("../../styles/field.sty.js");
|
|
50
|
+
function getButtonSlots(children) {
|
|
51
|
+
const slots = {};
|
|
52
|
+
import_react.default.Children.forEach(children, (child) => {
|
|
53
|
+
if ((0, import_react_is.isElement)(child)) {
|
|
54
|
+
switch (child.type) {
|
|
55
|
+
case import_Suffix.Suffix:
|
|
56
|
+
slots.suffix = child;
|
|
57
|
+
break;
|
|
58
|
+
case import_Prefix.Prefix:
|
|
59
|
+
slots.prefix = child;
|
|
60
|
+
break;
|
|
61
|
+
case import_Label.Label:
|
|
62
|
+
slots.label = child;
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
slots.freeform ??= [];
|
|
66
|
+
slots.freeform.push(child);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
if (child) {
|
|
71
|
+
slots.freeform ??= [];
|
|
72
|
+
slots.freeform.push(child);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return slots;
|
|
77
|
+
}
|
|
78
|
+
const _Button = /* @__PURE__ */ (0, import_react.forwardRef)(
|
|
79
|
+
(props, ref) => {
|
|
80
|
+
const {
|
|
81
|
+
children,
|
|
82
|
+
variant = "default",
|
|
83
|
+
disabled,
|
|
84
|
+
"aria-disabled": ariaDisabledProp,
|
|
85
|
+
required,
|
|
86
|
+
id: propId,
|
|
87
|
+
type = "button",
|
|
88
|
+
onClick,
|
|
89
|
+
ariaLabel,
|
|
90
|
+
width = "content",
|
|
91
|
+
color = "neutral",
|
|
92
|
+
textAlign = "center",
|
|
93
|
+
size = "default",
|
|
94
|
+
loading = false,
|
|
95
|
+
className: consumerClassName,
|
|
96
|
+
style: consumerStyle,
|
|
97
|
+
"data-testid": dataTestId,
|
|
98
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
99
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
100
|
+
readOnly,
|
|
101
|
+
as,
|
|
102
|
+
...remainingProps
|
|
103
|
+
} = props;
|
|
104
|
+
const slots = getButtonSlots(children);
|
|
105
|
+
const ariaDisabled = ariaDisabledProp === true || ariaDisabledProp === "true";
|
|
106
|
+
const nativeDisabledOrLoading = (0, import_react.useMemo)(
|
|
107
|
+
() => loading ? true : disabled,
|
|
108
|
+
[disabled, loading]
|
|
109
|
+
);
|
|
110
|
+
const disabledOrLoading = (0, import_react.useMemo)(
|
|
111
|
+
() => nativeDisabledOrLoading || ariaDisabled,
|
|
112
|
+
[ariaDisabled, nativeDisabledOrLoading]
|
|
113
|
+
);
|
|
114
|
+
const { focusProps, focusClassName } = (0, import_useFocusRing.useFocusRing)({
|
|
115
|
+
variant: !disabledOrLoading ? color : "neutral",
|
|
116
|
+
disabled: nativeDisabledOrLoading
|
|
117
|
+
});
|
|
118
|
+
const ariaLabelingProps = (0, import_useAriaLabelingProps.useAriaLabelingProps)(remainingProps);
|
|
119
|
+
const handleButtonClick = (event) => {
|
|
120
|
+
if (nativeDisabledOrLoading) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
event.stopPropagation();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
onClick?.(event);
|
|
126
|
+
};
|
|
127
|
+
const buttonProps = {
|
|
128
|
+
ref,
|
|
129
|
+
"data-testid": dataTestId,
|
|
130
|
+
"data-dtrum-mask": dataDtrumMask,
|
|
131
|
+
"data-dtrum-allow": dataDtrumAllow,
|
|
132
|
+
required,
|
|
133
|
+
disabled: nativeDisabledOrLoading && !ariaDisabled,
|
|
134
|
+
id: propId,
|
|
135
|
+
type,
|
|
136
|
+
...ariaLabelingProps,
|
|
137
|
+
"aria-disabled": ariaDisabledProp,
|
|
138
|
+
onClick: handleButtonClick
|
|
139
|
+
};
|
|
140
|
+
const disabledPropagationProps = {
|
|
141
|
+
onPointerDown(evt) {
|
|
142
|
+
if (nativeDisabledOrLoading) {
|
|
143
|
+
evt.preventDefault();
|
|
144
|
+
evt.stopPropagation();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
onPointerUp(evt) {
|
|
148
|
+
if (nativeDisabledOrLoading) {
|
|
149
|
+
evt.preventDefault();
|
|
150
|
+
evt.stopPropagation();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const hasChildren = children || children === 0;
|
|
155
|
+
const buttonMergedProps = {
|
|
156
|
+
...(0, import_merge_props.mergeProps)(
|
|
157
|
+
buttonProps,
|
|
158
|
+
disabledPropagationProps,
|
|
159
|
+
// Need to cast this one as the inference of mergeProps would generate
|
|
160
|
+
// a not allowed overlap. The remainingProps type is too complex due to the
|
|
161
|
+
// polymorphic inheritance.
|
|
162
|
+
remainingProps,
|
|
163
|
+
focusProps
|
|
164
|
+
)
|
|
165
|
+
};
|
|
166
|
+
const intl = (0, import_react_intl.useIntl)();
|
|
167
|
+
const Component = as || "button";
|
|
168
|
+
if (!hasChildren) {
|
|
169
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
170
|
+
Component,
|
|
171
|
+
{
|
|
172
|
+
...buttonMergedProps,
|
|
173
|
+
className: (0, import_clsx.default)(
|
|
174
|
+
consumerClassName,
|
|
175
|
+
(0, import_field_css.fieldColorsCSS)({ variant, color, disabled: disabledOrLoading }),
|
|
176
|
+
(0, import_Button_css.buttonCSS)({
|
|
177
|
+
disabled: disabledOrLoading,
|
|
178
|
+
textAlign,
|
|
179
|
+
size,
|
|
180
|
+
readOnly
|
|
181
|
+
}),
|
|
182
|
+
focusClassName,
|
|
183
|
+
{
|
|
184
|
+
[`${import_Button_css.buttonWidthsCSS.content}`]: width === "content",
|
|
185
|
+
[`${import_Button_css.buttonWidthsCSS.full}`]: width === "full"
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
style: {
|
|
189
|
+
width: width !== "content" && width !== "full" ? width : void 0
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
195
|
+
Component,
|
|
196
|
+
{
|
|
197
|
+
className: (0, import_clsx.default)(
|
|
198
|
+
consumerClassName,
|
|
199
|
+
(0, import_field_css.fieldColorsCSS)({
|
|
200
|
+
variant,
|
|
201
|
+
color,
|
|
202
|
+
disabled: disabledOrLoading || ariaDisabled
|
|
203
|
+
}),
|
|
204
|
+
(0, import_Button_css.buttonCSS)({
|
|
205
|
+
disabled: disabledOrLoading || ariaDisabled,
|
|
206
|
+
textAlign,
|
|
207
|
+
size,
|
|
208
|
+
readOnly
|
|
209
|
+
}),
|
|
210
|
+
{
|
|
211
|
+
[`${import_Button_css.buttonWidthsCSS.content}`]: width === "content",
|
|
212
|
+
[`${import_Button_css.buttonWidthsCSS.full}`]: width === "full"
|
|
213
|
+
},
|
|
214
|
+
focusClassName
|
|
215
|
+
),
|
|
216
|
+
style: {
|
|
217
|
+
width: width !== "content" && width !== "full" ? width : void 0,
|
|
218
|
+
...consumerStyle
|
|
219
|
+
},
|
|
220
|
+
...buttonMergedProps
|
|
221
|
+
},
|
|
222
|
+
loading && /* @__PURE__ */ import_react.default.createElement("div", { className: import_Button_css.buttonLoadingCSS }, /* @__PURE__ */ import_react.default.createElement(
|
|
223
|
+
import_ProgressCircle.ProgressCircle,
|
|
224
|
+
{
|
|
225
|
+
size: "small",
|
|
226
|
+
variant: color,
|
|
227
|
+
"aria-label": intl.formatMessage({
|
|
228
|
+
defaultMessage: "Loading",
|
|
229
|
+
id: "cycz+bYG+VH7Of4e",
|
|
230
|
+
description: "Label for the loading state."
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
)),
|
|
234
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
235
|
+
import_Grid.Grid,
|
|
236
|
+
{
|
|
237
|
+
gap: size === "default" ? 4 : 2,
|
|
238
|
+
grid: "auto / auto-flow auto",
|
|
239
|
+
width: "100%",
|
|
240
|
+
maxWidth: "100%",
|
|
241
|
+
alignItems: "center",
|
|
242
|
+
justifyContent: textAlign === "start" ? "space-between" : "center",
|
|
243
|
+
style: {
|
|
244
|
+
visibility: loading ? "hidden" : void 0
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
textAlign === "start" ? /* @__PURE__ */ import_react.default.createElement(import_Flex.Flex, { minWidth: 0, gap: size === "default" ? 4 : 2 }, slots.prefix, slots.label, slots.freeform && /* @__PURE__ */ import_react.default.createElement(Button.Label, null, slots.freeform)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, slots.prefix, slots.label, slots.freeform && /* @__PURE__ */ import_react.default.createElement(Button.Label, null, slots.freeform)),
|
|
248
|
+
slots.suffix
|
|
249
|
+
)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
_Button.displayName = "Button";
|
|
254
|
+
const Button = Object.assign(_Button, {
|
|
255
|
+
Suffix: import_Suffix.Suffix,
|
|
256
|
+
Prefix: import_Prefix.Prefix,
|
|
257
|
+
Label: import_Label.Label
|
|
258
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const buttonCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
textAlign: {
|
|
3
|
+
start: {
|
|
4
|
+
textAlign: "start";
|
|
5
|
+
justifyContent: "space-between";
|
|
6
|
+
};
|
|
7
|
+
center: {
|
|
8
|
+
textAlign: "center";
|
|
9
|
+
justifyContent: "center";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
size: {
|
|
13
|
+
condensed: {
|
|
14
|
+
paddingTop: string;
|
|
15
|
+
paddingBottom: string;
|
|
16
|
+
paddingLeft: string;
|
|
17
|
+
paddingRight: string;
|
|
18
|
+
gap: string;
|
|
19
|
+
};
|
|
20
|
+
default: {
|
|
21
|
+
paddingTop: string;
|
|
22
|
+
paddingBottom: string;
|
|
23
|
+
paddingLeft: string;
|
|
24
|
+
paddingRight: string;
|
|
25
|
+
gap: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
disabled: {
|
|
29
|
+
true: {
|
|
30
|
+
cursor: "not-allowed";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readOnly: {
|
|
34
|
+
true: {
|
|
35
|
+
cursor: "not-allowed";
|
|
36
|
+
background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
export declare const buttonWidthsCSS: Record<"content" | "full", string>;
|
|
41
|
+
export declare const buttonLoadingCSS: string;
|
|
42
|
+
export declare const buttonLabelCSS: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
43
|
+
textual: {
|
|
44
|
+
true: string[];
|
|
45
|
+
false: {
|
|
46
|
+
display: "inline-flex";
|
|
47
|
+
minWidth: number;
|
|
48
|
+
maxWidth: "100%";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var Button_css_exports = {};
|
|
19
|
+
__export(Button_css_exports, {
|
|
20
|
+
buttonCSS: () => buttonCSS,
|
|
21
|
+
buttonLabelCSS: () => buttonLabelCSS,
|
|
22
|
+
buttonLoadingCSS: () => buttonLoadingCSS,
|
|
23
|
+
buttonWidthsCSS: () => buttonWidthsCSS
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Button_css_exports);
|
|
26
|
+
var import_ellipsis_css_ts_vanilla = require("../../styles/ellipsis.css");
|
|
27
|
+
var import_field_css_ts_vanilla = require("../../styles/field.css");
|
|
28
|
+
var import_Button_css_ts_vanilla = require("./Button.css");
|
|
29
|
+
var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
30
|
+
var buttonCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Button_buttonCSS__10kgnsa0", variantClassNames: { textAlign: { start: "Button_buttonCSS_textAlign_start__10kgnsa1", center: "Button_buttonCSS_textAlign_center__10kgnsa2" }, size: { condensed: "Button_buttonCSS_size_condensed__10kgnsa3", "default": "Button_buttonCSS_size_default__10kgnsa4" }, disabled: { true: "Button_buttonCSS_disabled_true__10kgnsa5" }, readOnly: { true: "Button_buttonCSS_readOnly_true__10kgnsa6" } }, defaultVariants: { size: "default", textAlign: "center", disabled: false }, compoundVariants: [] });
|
|
31
|
+
var buttonLabelCSS = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "Button_buttonLabelCSS__10kgnsaa", variantClassNames: { textual: { true: "ellipsis_ellipsisCSS__oqqp1n0", false: "Button_buttonLabelCSS_textual_false__10kgnsac" } }, defaultVariants: {}, compoundVariants: [] });
|
|
32
|
+
var buttonLoadingCSS = "Button_buttonLoadingCSS__10kgnsa9";
|
|
33
|
+
var buttonWidthsCSS = { full: "Button_buttonWidthsCSS_full__10kgnsa7", content: "Button_buttonWidthsCSS_content__10kgnsa8" };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type DataTestId } from '../../core/types/data-props.js';
|
|
3
|
+
import { type StylingProps } from '../../core/types/styling-props.js';
|
|
4
|
+
/**
|
|
5
|
+
* Accepted properties for the Button Label.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonLabelProps extends StylingProps, DataTestId {
|
|
9
|
+
/** Elements to be displayed in the Button Label slot. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Button Label component.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare const Label: (props: ButtonLabelProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Label_exports = {};
|
|
29
|
+
__export(Label_exports, {
|
|
30
|
+
Label: () => Label
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Label_exports);
|
|
33
|
+
var import_clsx = __toESM(require("clsx"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_Button_css = require("./Button.sty.js");
|
|
36
|
+
var import_is_string_children = require("../../core/utils/_is-string-children.js");
|
|
37
|
+
const Label = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
|
|
38
|
+
const {
|
|
39
|
+
children,
|
|
40
|
+
className: consumerClassName,
|
|
41
|
+
style: consumerStyle,
|
|
42
|
+
"data-testid": dataTestId
|
|
43
|
+
} = props;
|
|
44
|
+
const textual = (0, import_is_string_children.isStringChildren)(children);
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
ref: forwardedRef,
|
|
49
|
+
"data-testid": dataTestId,
|
|
50
|
+
className: (0, import_clsx.default)(
|
|
51
|
+
"strato-button-label",
|
|
52
|
+
(0, import_Button_css.buttonLabelCSS)({ textual }),
|
|
53
|
+
consumerClassName
|
|
54
|
+
),
|
|
55
|
+
style: consumerStyle
|
|
56
|
+
},
|
|
57
|
+
children
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
Label.displayName = "Button.Label";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type DataTestId } from '../../core/types/data-props.js';
|
|
3
|
+
import { type StylingProps } from '../../core/types/styling-props.js';
|
|
4
|
+
/**
|
|
5
|
+
* Accepted properties for the Button Prefix.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonPrefixProps extends StylingProps, DataTestId {
|
|
9
|
+
/** Elements to be displayed in the Button Prefix slot. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Button Prefix component.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare const Prefix: (props: ButtonPrefixProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|