@react-spectrum/button 3.11.1 → 3.12.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.
@@ -0,0 +1,488 @@
1
+ import "./main.css";
2
+ import {useSlotProps as $d7FTw$useSlotProps, useFocusableRef as $d7FTw$useFocusableRef, useStyleProps as $d7FTw$useStyleProps, useHasChild as $d7FTw$useHasChild, classNames as $d7FTw$classNames, SlotProvider as $d7FTw$SlotProvider} from "@react-spectrum/utils";
3
+ import {FocusRing as $d7FTw$FocusRing} from "@react-aria/focus";
4
+ import {mergeProps as $d7FTw$mergeProps} from "@react-aria/utils";
5
+ import $d7FTw$react from "react";
6
+ import {Text as $d7FTw$Text} from "@react-spectrum/text";
7
+ import {useButton as $d7FTw$useButton, useToggleButton as $d7FTw$useToggleButton} from "@react-aria/button";
8
+ import {useHover as $d7FTw$useHover} from "@react-aria/interactions";
9
+ import {useProviderProps as $d7FTw$useProviderProps} from "@react-spectrum/provider";
10
+ import $d7FTw$spectrumiconsuiCornerTriangle from "@spectrum-icons/ui/CornerTriangle";
11
+ import $d7FTw$spectrumiconsuiCrossSmall from "@spectrum-icons/ui/CrossSmall";
12
+ import {useToggleState as $d7FTw$useToggleState} from "@react-stately/toggle";
13
+
14
+ function $parcel$interopDefault(a) {
15
+ return a && a.__esModule ? a.default : a;
16
+ }
17
+ function $parcel$export(e, n, v, s) {
18
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
+ }
20
+ /*
21
+ * Copyright 2020 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */ /// <reference types="css-module-types" />
31
+ /*
32
+ * Copyright 2020 Adobe. All rights reserved.
33
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
34
+ * you may not use this file except in compliance with the License. You may obtain a copy
35
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
36
+ *
37
+ * Unless required by applicable law or agreed to in writing, software distributed under
38
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
+ * OF ANY KIND, either express or implied. See the License for the specific language
40
+ * governing permissions and limitations under the License.
41
+ */
42
+
43
+
44
+
45
+ var $086e93d2352a4536$exports = {};
46
+
47
+ $parcel$export($086e93d2352a4536$exports, "spectrum-Button", () => $086e93d2352a4536$export$1db4cca5b4ade39a, (v) => $086e93d2352a4536$export$1db4cca5b4ade39a = v);
48
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton", () => $086e93d2352a4536$export$53da69f51b770d3, (v) => $086e93d2352a4536$export$53da69f51b770d3 = v);
49
+ $parcel$export($086e93d2352a4536$exports, "spectrum-LogicButton", () => $086e93d2352a4536$export$36ae67a131730482, (v) => $086e93d2352a4536$export$36ae67a131730482 = v);
50
+ $parcel$export($086e93d2352a4536$exports, "spectrum-FieldButton", () => $086e93d2352a4536$export$a024c99ecf6b5741, (v) => $086e93d2352a4536$export$a024c99ecf6b5741 = v);
51
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ClearButton", () => $086e93d2352a4536$export$b752ce409e5660c, (v) => $086e93d2352a4536$export$b752ce409e5660c = v);
52
+ $parcel$export($086e93d2352a4536$exports, "focus-ring", () => $086e93d2352a4536$export$f39a09f249340e2a, (v) => $086e93d2352a4536$export$f39a09f249340e2a = v);
53
+ $parcel$export($086e93d2352a4536$exports, "spectrum-FieldButton--quiet", () => $086e93d2352a4536$export$5ca7b274e4fff9fc, (v) => $086e93d2352a4536$export$5ca7b274e4fff9fc = v);
54
+ $parcel$export($086e93d2352a4536$exports, "spectrum-Icon", () => $086e93d2352a4536$export$d374b04f30360026, (v) => $086e93d2352a4536$export$d374b04f30360026 = v);
55
+ $parcel$export($086e93d2352a4536$exports, "is-hovered", () => $086e93d2352a4536$export$b8813cd5d7824ce7, (v) => $086e93d2352a4536$export$b8813cd5d7824ce7 = v);
56
+ $parcel$export($086e93d2352a4536$exports, "spectrum-Button-label", () => $086e93d2352a4536$export$c081ba562e204942, (v) => $086e93d2352a4536$export$c081ba562e204942 = v);
57
+ $parcel$export($086e93d2352a4536$exports, "spectrum-Button--iconOnly", () => $086e93d2352a4536$export$c1d306ec0fae3838, (v) => $086e93d2352a4536$export$c1d306ec0fae3838 = v);
58
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton-label", () => $086e93d2352a4536$export$ebb4635c66bacdb9, (v) => $086e93d2352a4536$export$ebb4635c66bacdb9 = v);
59
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton-hold", () => $086e93d2352a4536$export$4a4f01c443eff992, (v) => $086e93d2352a4536$export$4a4f01c443eff992 = v);
60
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton--quiet", () => $086e93d2352a4536$export$40e1f009544bacf3, (v) => $086e93d2352a4536$export$40e1f009544bacf3 = v);
61
+ $parcel$export($086e93d2352a4536$exports, "is-disabled", () => $086e93d2352a4536$export$d35bc1e505d1ebbf, (v) => $086e93d2352a4536$export$d35bc1e505d1ebbf = v);
62
+ $parcel$export($086e93d2352a4536$exports, "is-open", () => $086e93d2352a4536$export$a9781837241c946d, (v) => $086e93d2352a4536$export$a9781837241c946d = v);
63
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ClearButton--small", () => $086e93d2352a4536$export$49280ffa5236ba8b, (v) => $086e93d2352a4536$export$49280ffa5236ba8b = v);
64
+ $parcel$export($086e93d2352a4536$exports, "is-active", () => $086e93d2352a4536$export$20fd0f7cd4e6112f, (v) => $086e93d2352a4536$export$20fd0f7cd4e6112f = v);
65
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ClearButton--overBackground", () => $086e93d2352a4536$export$116f2fccf941d34d, (v) => $086e93d2352a4536$export$116f2fccf941d34d = v);
66
+ $parcel$export($086e93d2352a4536$exports, "is-selected", () => $086e93d2352a4536$export$1e0fb04f31d3c22a, (v) => $086e93d2352a4536$export$1e0fb04f31d3c22a = v);
67
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton--emphasized", () => $086e93d2352a4536$export$5aabb61a966e266f, (v) => $086e93d2352a4536$export$5aabb61a966e266f = v);
68
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton--staticWhite", () => $086e93d2352a4536$export$ccc536e1adbdc059, (v) => $086e93d2352a4536$export$ccc536e1adbdc059 = v);
69
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton--staticBlack", () => $086e93d2352a4536$export$8f7c9db66978d20f, (v) => $086e93d2352a4536$export$8f7c9db66978d20f = v);
70
+ $parcel$export($086e93d2352a4536$exports, "spectrum-ActionButton--staticColor", () => $086e93d2352a4536$export$29b7b5d6a5a497c5, (v) => $086e93d2352a4536$export$29b7b5d6a5a497c5 = v);
71
+ $parcel$export($086e93d2352a4536$exports, "spectrum-LogicButton--and", () => $086e93d2352a4536$export$e52daab43a62c528, (v) => $086e93d2352a4536$export$e52daab43a62c528 = v);
72
+ $parcel$export($086e93d2352a4536$exports, "spectrum-LogicButton--or", () => $086e93d2352a4536$export$da76be6126aaa633, (v) => $086e93d2352a4536$export$da76be6126aaa633 = v);
73
+ $parcel$export($086e93d2352a4536$exports, "is-focused", () => $086e93d2352a4536$export$e7dc768d35940237, (v) => $086e93d2352a4536$export$e7dc768d35940237 = v);
74
+ $parcel$export($086e93d2352a4536$exports, "is-placeholder", () => $086e93d2352a4536$export$e5b2f5233e4e5194, (v) => $086e93d2352a4536$export$e5b2f5233e4e5194 = v);
75
+ $parcel$export($086e93d2352a4536$exports, "spectrum-FieldButton--invalid", () => $086e93d2352a4536$export$c9f503f672e8a3c1, (v) => $086e93d2352a4536$export$c9f503f672e8a3c1 = v);
76
+ $parcel$export($086e93d2352a4536$exports, "spectrum-Button--overBackground", () => $086e93d2352a4536$export$5cda1128f9112d2e, (v) => $086e93d2352a4536$export$5cda1128f9112d2e = v);
77
+ var $086e93d2352a4536$export$1db4cca5b4ade39a;
78
+ var $086e93d2352a4536$export$53da69f51b770d3;
79
+ var $086e93d2352a4536$export$36ae67a131730482;
80
+ var $086e93d2352a4536$export$a024c99ecf6b5741;
81
+ var $086e93d2352a4536$export$b752ce409e5660c;
82
+ var $086e93d2352a4536$export$f39a09f249340e2a;
83
+ var $086e93d2352a4536$export$5ca7b274e4fff9fc;
84
+ var $086e93d2352a4536$export$d374b04f30360026;
85
+ var $086e93d2352a4536$export$b8813cd5d7824ce7;
86
+ var $086e93d2352a4536$export$c081ba562e204942;
87
+ var $086e93d2352a4536$export$c1d306ec0fae3838;
88
+ var $086e93d2352a4536$export$ebb4635c66bacdb9;
89
+ var $086e93d2352a4536$export$4a4f01c443eff992;
90
+ var $086e93d2352a4536$export$40e1f009544bacf3;
91
+ var $086e93d2352a4536$export$d35bc1e505d1ebbf;
92
+ var $086e93d2352a4536$export$a9781837241c946d;
93
+ var $086e93d2352a4536$export$49280ffa5236ba8b;
94
+ var $086e93d2352a4536$export$20fd0f7cd4e6112f;
95
+ var $086e93d2352a4536$export$116f2fccf941d34d;
96
+ var $086e93d2352a4536$export$1e0fb04f31d3c22a;
97
+ var $086e93d2352a4536$export$5aabb61a966e266f;
98
+ var $086e93d2352a4536$export$ccc536e1adbdc059;
99
+ var $086e93d2352a4536$export$8f7c9db66978d20f;
100
+ var $086e93d2352a4536$export$29b7b5d6a5a497c5;
101
+ var $086e93d2352a4536$export$e52daab43a62c528;
102
+ var $086e93d2352a4536$export$da76be6126aaa633;
103
+ var $086e93d2352a4536$export$e7dc768d35940237;
104
+ var $086e93d2352a4536$export$e5b2f5233e4e5194;
105
+ var $086e93d2352a4536$export$c9f503f672e8a3c1;
106
+ var $086e93d2352a4536$export$5cda1128f9112d2e;
107
+ $086e93d2352a4536$export$1db4cca5b4ade39a = "spectrum-Button_e2d99e";
108
+ $086e93d2352a4536$export$53da69f51b770d3 = "spectrum-ActionButton_e2d99e";
109
+ $086e93d2352a4536$export$36ae67a131730482 = "spectrum-LogicButton_e2d99e";
110
+ $086e93d2352a4536$export$a024c99ecf6b5741 = "spectrum-FieldButton_e2d99e";
111
+ $086e93d2352a4536$export$b752ce409e5660c = "spectrum-ClearButton_e2d99e";
112
+ $086e93d2352a4536$export$f39a09f249340e2a = "focus-ring_e2d99e";
113
+ $086e93d2352a4536$export$5ca7b274e4fff9fc = "spectrum-FieldButton--quiet_e2d99e";
114
+ $086e93d2352a4536$export$d374b04f30360026 = "spectrum-Icon_e2d99e";
115
+ $086e93d2352a4536$export$b8813cd5d7824ce7 = "is-hovered_e2d99e";
116
+ $086e93d2352a4536$export$c081ba562e204942 = "spectrum-Button-label_e2d99e";
117
+ $086e93d2352a4536$export$c1d306ec0fae3838 = "spectrum-Button--iconOnly_e2d99e";
118
+ $086e93d2352a4536$export$ebb4635c66bacdb9 = "spectrum-ActionButton-label_e2d99e";
119
+ $086e93d2352a4536$export$4a4f01c443eff992 = "spectrum-ActionButton-hold_e2d99e";
120
+ $086e93d2352a4536$export$40e1f009544bacf3 = "spectrum-ActionButton--quiet_e2d99e";
121
+ $086e93d2352a4536$export$d35bc1e505d1ebbf = "is-disabled_e2d99e";
122
+ $086e93d2352a4536$export$a9781837241c946d = "is-open_e2d99e";
123
+ $086e93d2352a4536$export$49280ffa5236ba8b = "spectrum-ClearButton--small_e2d99e";
124
+ $086e93d2352a4536$export$20fd0f7cd4e6112f = "is-active_e2d99e";
125
+ $086e93d2352a4536$export$116f2fccf941d34d = "spectrum-ClearButton--overBackground_e2d99e";
126
+ $086e93d2352a4536$export$1e0fb04f31d3c22a = "is-selected_e2d99e";
127
+ $086e93d2352a4536$export$5aabb61a966e266f = "spectrum-ActionButton--emphasized_e2d99e";
128
+ $086e93d2352a4536$export$ccc536e1adbdc059 = "spectrum-ActionButton--staticWhite_e2d99e";
129
+ $086e93d2352a4536$export$8f7c9db66978d20f = "spectrum-ActionButton--staticBlack_e2d99e";
130
+ $086e93d2352a4536$export$29b7b5d6a5a497c5 = "spectrum-ActionButton--staticColor_e2d99e";
131
+ $086e93d2352a4536$export$e52daab43a62c528 = "spectrum-LogicButton--and_e2d99e";
132
+ $086e93d2352a4536$export$da76be6126aaa633 = "spectrum-LogicButton--or_e2d99e";
133
+ $086e93d2352a4536$export$e7dc768d35940237 = "is-focused_e2d99e";
134
+ $086e93d2352a4536$export$e5b2f5233e4e5194 = "is-placeholder_e2d99e";
135
+ $086e93d2352a4536$export$c9f503f672e8a3c1 = "spectrum-FieldButton--invalid_e2d99e";
136
+ $086e93d2352a4536$export$5cda1128f9112d2e = "spectrum-Button--overBackground_e2d99e";
137
+
138
+
139
+
140
+
141
+
142
+
143
+ function $b865a6f0049e2d66$var$Button(props, ref) {
144
+ props = (0, $d7FTw$useProviderProps)(props);
145
+ props = (0, $d7FTw$useSlotProps)(props, "button");
146
+ let { elementType: ElementType = "button" , children: children , variant: variant , style: style = variant === "accent" || variant === "cta" ? "fill" : "outline" , staticColor: staticColor , isDisabled: isDisabled , autoFocus: autoFocus , ...otherProps } = props;
147
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
148
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useButton)(props, domRef);
149
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
150
+ isDisabled: isDisabled
151
+ });
152
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
153
+ let hasLabel = (0, $d7FTw$useHasChild)(`.${(0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports)))["spectrum-Button-label"]}`, domRef);
154
+ let hasIcon = (0, $d7FTw$useHasChild)(`.${(0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports)))["spectrum-Icon"]}`, domRef);
155
+ if (variant === "cta") variant = "accent";
156
+ else if (variant === "overBackground") {
157
+ variant = "primary";
158
+ staticColor = "white";
159
+ }
160
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
161
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring"),
162
+ autoFocus: autoFocus
163
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement(ElementType, {
164
+ ...styleProps,
165
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
166
+ ref: domRef,
167
+ "data-variant": variant,
168
+ "data-style": style,
169
+ "data-static-color": staticColor || undefined,
170
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button", {
171
+ "spectrum-Button--iconOnly": hasIcon && !hasLabel,
172
+ "is-disabled": isDisabled,
173
+ "is-active": isPressed,
174
+ "is-hovered": isHovered
175
+ }, styleProps.className)
176
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$SlotProvider), {
177
+ slots: {
178
+ icon: {
179
+ size: "S",
180
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Icon")
181
+ },
182
+ text: {
183
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button-label")
184
+ }
185
+ }
186
+ }, typeof children === "string" ? /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$Text), null, children) : children)));
187
+ }
188
+ /**
189
+ * Buttons allow users to perform an action or to navigate to another page.
190
+ * They have multiple styles for various needs, and are ideal for calling attention to
191
+ * where a user needs to do something in order to move forward in a flow.
192
+ */ let $b865a6f0049e2d66$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($b865a6f0049e2d66$var$Button);
193
+
194
+
195
+ /*
196
+ * Copyright 2020 Adobe. All rights reserved.
197
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
198
+ * you may not use this file except in compliance with the License. You may obtain a copy
199
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
200
+ *
201
+ * Unless required by applicable law or agreed to in writing, software distributed under
202
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
203
+ * OF ANY KIND, either express or implied. See the License for the specific language
204
+ * governing permissions and limitations under the License.
205
+ */
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+ function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
216
+ props = (0, $d7FTw$useProviderProps)(props);
217
+ props = (0, $d7FTw$useSlotProps)(props, "actionButton");
218
+ let { isQuiet: isQuiet , isDisabled: isDisabled , staticColor: staticColor , children: children , autoFocus: autoFocus , holdAffordance: // @ts-ignore (private)
219
+ holdAffordance , ...otherProps } = props;
220
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
221
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useButton)(props, domRef);
222
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
223
+ isDisabled: isDisabled
224
+ });
225
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
226
+ let isTextOnly = (0, $d7FTw$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $d7FTw$react).isValidElement(c));
227
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
228
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring"),
229
+ autoFocus: autoFocus
230
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement("button", {
231
+ ...styleProps,
232
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
233
+ ref: domRef,
234
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ActionButton", {
235
+ "spectrum-ActionButton--quiet": isQuiet,
236
+ "spectrum-ActionButton--staticColor": !!staticColor,
237
+ "spectrum-ActionButton--staticWhite": staticColor === "white",
238
+ "spectrum-ActionButton--staticBlack": staticColor === "black",
239
+ "is-active": isPressed,
240
+ "is-disabled": isDisabled,
241
+ "is-hovered": isHovered
242
+ }, styleProps.className)
243
+ }, holdAffordance && /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$spectrumiconsuiCornerTriangle), {
244
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ActionButton-hold")
245
+ }), /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$SlotProvider), {
246
+ slots: {
247
+ icon: {
248
+ size: "S",
249
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Icon")
250
+ },
251
+ text: {
252
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ActionButton-label")
253
+ }
254
+ }
255
+ }, typeof children === "string" || isTextOnly ? /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$Text), null, children) : children)));
256
+ }
257
+ /**
258
+ * ActionButtons allow users to perform an action.
259
+ * They’re used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren’t meant to draw a lot of attention.
260
+ */ let $042ad0b3a4a55b33$export$cfc7921d29ef7b80 = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($042ad0b3a4a55b33$var$ActionButton);
261
+
262
+
263
+ /*
264
+ * Copyright 2020 Adobe. All rights reserved.
265
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
266
+ * you may not use this file except in compliance with the License. You may obtain a copy
267
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
268
+ *
269
+ * Unless required by applicable law or agreed to in writing, software distributed under
270
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
271
+ * OF ANY KIND, either express or implied. See the License for the specific language
272
+ * governing permissions and limitations under the License.
273
+ */
274
+
275
+
276
+
277
+
278
+
279
+
280
+ // @private
281
+ function $b43bd559b476d0c4$var$FieldButton(props, ref) {
282
+ props = (0, $d7FTw$useSlotProps)(props, "button");
283
+ let { isQuiet: isQuiet , isDisabled: isDisabled , validationState: validationState , children: children , autoFocus: autoFocus , isActive: isActive , focusRingClass: focusRingClass , ...otherProps } = props;
284
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
285
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useButton)(props, domRef);
286
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
287
+ isDisabled: isDisabled
288
+ });
289
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
290
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
291
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring", focusRingClass),
292
+ autoFocus: autoFocus
293
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement("button", {
294
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
295
+ ref: domRef,
296
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-FieldButton", {
297
+ "spectrum-FieldButton--quiet": isQuiet,
298
+ "is-active": isActive || isPressed,
299
+ "is-disabled": isDisabled,
300
+ "spectrum-FieldButton--invalid": validationState === "invalid",
301
+ "is-hovered": isHovered
302
+ }, styleProps.className)
303
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$SlotProvider), {
304
+ slots: {
305
+ icon: {
306
+ size: "S",
307
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Icon")
308
+ }
309
+ }
310
+ }, children)));
311
+ }
312
+ let $b43bd559b476d0c4$export$47dc48f595b075da = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($b43bd559b476d0c4$var$FieldButton);
313
+
314
+
315
+ /*
316
+ * Copyright 2020 Adobe. All rights reserved.
317
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
318
+ * you may not use this file except in compliance with the License. You may obtain a copy
319
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
320
+ *
321
+ * Unless required by applicable law or agreed to in writing, software distributed under
322
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
323
+ * OF ANY KIND, either express or implied. See the License for the specific language
324
+ * governing permissions and limitations under the License.
325
+ */
326
+
327
+
328
+
329
+
330
+
331
+
332
+
333
+ function $45108e3c482ee88b$var$LogicButton(props, ref) {
334
+ props = (0, $d7FTw$useProviderProps)(props);
335
+ let { variant: variant , children: children , isDisabled: isDisabled , autoFocus: autoFocus , ...otherProps } = props;
336
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
337
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useButton)(props, domRef);
338
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
339
+ isDisabled: isDisabled
340
+ });
341
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
342
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
343
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring"),
344
+ autoFocus: autoFocus
345
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement("button", {
346
+ ...styleProps,
347
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
348
+ ref: domRef,
349
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-LogicButton", {
350
+ [`spectrum-LogicButton--${variant}`]: variant,
351
+ "is-disabled": isDisabled,
352
+ "is-active": isPressed,
353
+ "is-hovered": isHovered
354
+ }, styleProps.className)
355
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement("span", {
356
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button-label")
357
+ }, children)));
358
+ }
359
+ /**
360
+ * A LogicButton displays an operator within a boolean logic sequence.
361
+ */ let $45108e3c482ee88b$export$9b0b80fed00ba8b1 = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($45108e3c482ee88b$var$LogicButton);
362
+
363
+
364
+ /*
365
+ * Copyright 2020 Adobe. All rights reserved.
366
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
367
+ * you may not use this file except in compliance with the License. You may obtain a copy
368
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
369
+ *
370
+ * Unless required by applicable law or agreed to in writing, software distributed under
371
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
372
+ * OF ANY KIND, either express or implied. See the License for the specific language
373
+ * governing permissions and limitations under the License.
374
+ */
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+ function $dd24e555a16de2ae$var$ClearButton(props, ref) {
383
+ let { children: children = /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$spectrumiconsuiCrossSmall), {
384
+ UNSAFE_className: (0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports)))["spectrum-Icon"]
385
+ }) , focusClassName: focusClassName , variant: variant , autoFocus: autoFocus , isDisabled: isDisabled , preventFocus: preventFocus , elementType: elementType = preventFocus ? "div" : "button" , ...otherProps } = props;
386
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
387
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useButton)({
388
+ ...props,
389
+ elementType: elementType
390
+ }, domRef);
391
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
392
+ isDisabled: isDisabled
393
+ });
394
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
395
+ // For cases like the clear button in a search field, remove the tabIndex so
396
+ // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when
397
+ // moving the cursor over the clear button.
398
+ if (preventFocus) delete buttonProps.tabIndex;
399
+ let ElementType = elementType;
400
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
401
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring", focusClassName),
402
+ autoFocus: autoFocus
403
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement(ElementType, {
404
+ ...styleProps,
405
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
406
+ ref: domRef,
407
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ClearButton", {
408
+ [`spectrum-ClearButton--${variant}`]: variant,
409
+ "is-disabled": isDisabled,
410
+ "is-active": isPressed,
411
+ "is-hovered": isHovered
412
+ }, styleProps.className)
413
+ }, children));
414
+ }
415
+ let $dd24e555a16de2ae$export$13ec83e50bf04290 = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($dd24e555a16de2ae$var$ClearButton);
416
+
417
+
418
+ /*
419
+ * Copyright 2020 Adobe. All rights reserved.
420
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
421
+ * you may not use this file except in compliance with the License. You may obtain a copy
422
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
423
+ *
424
+ * Unless required by applicable law or agreed to in writing, software distributed under
425
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
426
+ * OF ANY KIND, either express or implied. See the License for the specific language
427
+ * governing permissions and limitations under the License.
428
+ */
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+ function $3979c7c23b0bd270$var$ToggleButton(props, ref) {
439
+ props = (0, $d7FTw$useProviderProps)(props);
440
+ let { isQuiet: isQuiet , isDisabled: isDisabled , isEmphasized: isEmphasized , staticColor: staticColor , children: children , autoFocus: autoFocus , ...otherProps } = props;
441
+ let domRef = (0, $d7FTw$useFocusableRef)(ref);
442
+ let state = (0, $d7FTw$useToggleState)(props);
443
+ let { buttonProps: buttonProps , isPressed: isPressed } = (0, $d7FTw$useToggleButton)(props, state, domRef);
444
+ let { hoverProps: hoverProps , isHovered: isHovered } = (0, $d7FTw$useHover)({
445
+ isDisabled: isDisabled
446
+ });
447
+ let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
448
+ let isTextOnly = (0, $d7FTw$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $d7FTw$react).isValidElement(c));
449
+ return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
450
+ focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring"),
451
+ autoFocus: autoFocus
452
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement("button", {
453
+ ...styleProps,
454
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
455
+ ref: domRef,
456
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ActionButton", {
457
+ "spectrum-ActionButton--quiet": isQuiet,
458
+ "spectrum-ActionButton--emphasized": isEmphasized,
459
+ "spectrum-ActionButton--staticColor": !!staticColor,
460
+ "spectrum-ActionButton--staticWhite": staticColor === "white",
461
+ "spectrum-ActionButton--staticBlack": staticColor === "black",
462
+ "is-active": isPressed,
463
+ "is-disabled": isDisabled,
464
+ "is-hovered": isHovered,
465
+ "is-selected": state.isSelected
466
+ }, styleProps.className)
467
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$SlotProvider), {
468
+ slots: {
469
+ icon: {
470
+ size: "S",
471
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Icon")
472
+ },
473
+ text: {
474
+ UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-ActionButton-label")
475
+ }
476
+ }
477
+ }, typeof children === "string" || isTextOnly ? /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$Text), null, children) : children)));
478
+ }
479
+ /**
480
+ * ToggleButtons allow users to toggle a selection on or off, for example
481
+ * switching between two states or modes.
482
+ */ let $3979c7c23b0bd270$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $d7FTw$react).forwardRef($3979c7c23b0bd270$var$ToggleButton);
483
+
484
+
485
+
486
+
487
+ export {$b865a6f0049e2d66$export$353f5b6fc5456de1 as Button, $042ad0b3a4a55b33$export$cfc7921d29ef7b80 as ActionButton, $b43bd559b476d0c4$export$47dc48f595b075da as FieldButton, $45108e3c482ee88b$export$9b0b80fed00ba8b1 as LogicButton, $dd24e555a16de2ae$export$13ec83e50bf04290 as ClearButton, $3979c7c23b0bd270$export$d2b052e7b4be1756 as ToggleButton};
488
+ //# sourceMappingURL=module.js.map