@dynatrace/strato-components 0.85.0 → 0.85.10

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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/buttons/button/Button.css +92 -0
  3. package/buttons/button/Button.d.ts +94 -0
  4. package/buttons/button/Button.js +258 -0
  5. package/buttons/button/Button.sty.d.ts +51 -0
  6. package/buttons/button/Button.sty.js +33 -0
  7. package/buttons/button/Label.d.ts +16 -0
  8. package/buttons/button/Label.js +60 -0
  9. package/buttons/button/Prefix.d.ts +16 -0
  10. package/buttons/button/Prefix.js +54 -0
  11. package/buttons/button/Suffix.d.ts +16 -0
  12. package/buttons/button/Suffix.js +56 -0
  13. package/buttons/button/types/button-aria.d.ts +37 -0
  14. package/buttons/button/types/button-aria.js +15 -0
  15. package/buttons/button/utils/focus-without-scrolling.d.ts +5 -0
  16. package/buttons/button/utils/focus-without-scrolling.js +77 -0
  17. package/buttons/button/utils/is-virtual-event.d.ts +10 -0
  18. package/buttons/button/utils/is-virtual-event.js +32 -0
  19. package/buttons/index.d.ts +8 -0
  20. package/buttons/index.js +28 -0
  21. package/content/progress/ProgressBar.js +1 -2
  22. package/content/progress/ProgressCircle.js +1 -2
  23. package/esm/buttons/button/Button.css +92 -0
  24. package/esm/buttons/button/Button.js +233 -0
  25. package/esm/buttons/button/Button.js.map +7 -0
  26. package/esm/buttons/button/Button.sty.js +15 -0
  27. package/esm/buttons/button/Button.sty.js.map +7 -0
  28. package/esm/buttons/button/Label.js +32 -0
  29. package/esm/buttons/button/Label.js.map +7 -0
  30. package/esm/buttons/button/Prefix.js +26 -0
  31. package/esm/buttons/button/Prefix.js.map +7 -0
  32. package/esm/buttons/button/Suffix.js +28 -0
  33. package/esm/buttons/button/Suffix.js.map +7 -0
  34. package/esm/buttons/button/types/button-aria.js +1 -0
  35. package/esm/buttons/button/types/button-aria.js.map +7 -0
  36. package/esm/buttons/button/utils/focus-without-scrolling.js +59 -0
  37. package/esm/buttons/button/utils/focus-without-scrolling.js.map +7 -0
  38. package/esm/buttons/button/utils/is-virtual-event.js +14 -0
  39. package/esm/buttons/button/utils/is-virtual-event.js.map +7 -0
  40. package/esm/buttons/index.js +13 -0
  41. package/esm/buttons/index.js.map +7 -0
  42. package/esm/content/progress/ProgressBar.js +2 -3
  43. package/esm/content/progress/ProgressBar.js.map +2 -2
  44. package/esm/content/progress/ProgressCircle.js +2 -3
  45. package/esm/content/progress/ProgressCircle.js.map +2 -2
  46. package/esm/index.js +1 -0
  47. package/esm/index.js.map +2 -2
  48. package/esm/styles/field.css +208 -0
  49. package/esm/styles/field.sty.js +9 -0
  50. package/esm/styles/field.sty.js.map +7 -0
  51. package/esm/typography/Code/Code.js.map +1 -1
  52. package/esm/typography/ExternalLink/ExternalLink.js.map +1 -1
  53. package/esm/typography/Link/Link.js.map +1 -1
  54. package/index.d.ts +1 -0
  55. package/index.js +1 -0
  56. package/lang/en.json +6 -0
  57. package/lang/uncompiled/en.json +4 -0
  58. package/package.json +11 -4
  59. package/styles/field.css +208 -0
  60. package/styles/field.sty.d.ts +102 -0
  61. package/styles/field.sty.js +27 -0
  62. package/styles/sprinkles.sty.d.ts +107 -107
  63. package/typography/Code/Code.d.ts +1 -1
  64. package/typography/ExternalLink/ExternalLink.d.ts +1 -1
  65. package/typography/Link/Link.d.ts +1 -1
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/reference/design-system/)
15
+ Check out the extensive documentation on the [Dynatrace Developer Documentation](https://developer.dynatrace.com/design/components/)
@@ -0,0 +1,92 @@
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
+ border-color: transparent;
18
+ border-style: solid;
19
+ border-width: 0;
20
+ border-radius: var(--dt-borders-radius-field-default, 8px);
21
+ transition-timing-function: var(--dt-animations-fade-out-easing, cubic-bezier(0, 0, 0.2, 1));
22
+ transition-duration: var(--dt-animations-fade-out-duration-base, 250ms);
23
+ transition-property: color, background-color, transform;
24
+ }
25
+ .Button_buttonCSS__10kgnsa0:hover {
26
+ transition-timing-function: var(--dt-animations-fade-in-easing, cubic-bezier(0.5, 0, 1, 1));
27
+ transition-duration: var(--dt-animations-fade-in-duration-base, 250ms);
28
+ }
29
+ .Button_buttonCSS_textAlign_start__10kgnsa1 {
30
+ text-align: start;
31
+ justify-content: space-between;
32
+ }
33
+ .Button_buttonCSS_textAlign_center__10kgnsa2 {
34
+ text-align: center;
35
+ justify-content: center;
36
+ }
37
+ .Button_buttonCSS_size_condensed__10kgnsa3 {
38
+ padding-top: var(--dt-spacings-size-2, 2px);
39
+ padding-bottom: var(--dt-spacings-size-2, 2px);
40
+ padding-left: var(--dt-spacings-size-4, 4px);
41
+ padding-right: var(--dt-spacings-size-4, 4px);
42
+ gap: var(--dt-spacings-size-2, 2px);
43
+ }
44
+ .Button_buttonCSS_size_default__10kgnsa4 {
45
+ padding-top: var(--dt-spacings-size-6, 6px);
46
+ padding-bottom: var(--dt-spacings-size-6, 6px);
47
+ padding-left: var(--dt-spacings-size-8, 8px);
48
+ padding-right: var(--dt-spacings-size-8, 8px);
49
+ gap: var(--dt-spacings-size-4, 4px);
50
+ }
51
+ .Button_buttonCSS_disabled_true__10kgnsa5 {
52
+ cursor: not-allowed;
53
+ }
54
+ .Button_buttonCSS_readOnly_true__10kgnsa6 {
55
+ cursor: not-allowed;
56
+ background: var(--vars_backgroundStatic__bx32h2);
57
+ }
58
+ .Button_buttonWidthsCSS_full__10kgnsa7 {
59
+ width: 100%;
60
+ }
61
+ .Button_buttonWidthsCSS_content__10kgnsa8 {
62
+ width: fit-content;
63
+ }
64
+ .Button_buttonLoadingCSS__10kgnsa9 {
65
+ position: absolute;
66
+ top: 0;
67
+ left: 0;
68
+ width: 100%;
69
+ height: 100%;
70
+ border-radius: var(--dt-borders-radius-field-default, 8px);
71
+ display: flex;
72
+ justify-content: center;
73
+ align-items: center;
74
+ z-index: 1;
75
+ }
76
+ .Button_buttonCSS_size_condensed__10kgnsa3 .Button_buttonLabelCSS__10kgnsaa:not(:has(svg:only-child)) {
77
+ padding-top: 0;
78
+ padding-bottom: 0;
79
+ padding-left: 2px;
80
+ padding-right: 2px;
81
+ }
82
+ .Button_buttonCSS_size_default__10kgnsa4 .Button_buttonLabelCSS__10kgnsaa:not(:has(svg:only-child)) {
83
+ padding-top: 0;
84
+ padding-bottom: 0;
85
+ padding-left: 4px;
86
+ padding-right: 4px;
87
+ }
88
+ .Button_buttonLabelCSS_textual_false__10kgnsac {
89
+ display: inline-flex;
90
+ min-width: 0;
91
+ max-width: 100%;
92
+ }
@@ -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;