@ngrok/mantle 0.0.26 → 0.0.27
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.
|
@@ -4,8 +4,8 @@ import type { VariantProps } from "../../types/src/variant-props";
|
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
5
|
appearance?: "link" | "filled" | "ghost" | "outlined" | null | undefined;
|
|
6
6
|
iconPlacement?: "end" | "start" | null | undefined;
|
|
7
|
+
isLoading?: boolean | null | undefined;
|
|
7
8
|
priority?: "danger" | "default" | "neutral" | null | undefined;
|
|
8
|
-
state?: "idle" | "pending" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
11
11
|
/**
|
|
@@ -29,8 +29,8 @@ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild
|
|
|
29
29
|
declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & Partial<import("../..").DeepNonNullable<import("class-variance-authority").VariantProps<(props?: ({
|
|
30
30
|
appearance?: "link" | "filled" | "ghost" | "outlined" | null | undefined;
|
|
31
31
|
iconPlacement?: "end" | "start" | null | undefined;
|
|
32
|
+
isLoading?: boolean | null | undefined;
|
|
32
33
|
priority?: "danger" | "default" | "neutral" | null | undefined;
|
|
33
|
-
state?: "idle" | "pending" | null | undefined;
|
|
34
34
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string>>> & {
|
|
35
35
|
/**
|
|
36
36
|
* An icon to render inside the button. If the `state` is `"pending"`, then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../components/button/src/button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAQN,SAAS,EACT,KAAK,oBAAoB,EACzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,QAAA,MAAM,cAAc;;;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../components/button/src/button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAQN,SAAS,EACT,KAAK,oBAAoB,EACzB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,QAAA,MAAM,cAAc;;;;;8EAiGnB,CAAC;AAEF,KAAK,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAChE,WAAW,GACX,cAAc,GAAG;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEH;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM;;;;;;IAfV;;;OAGG;WACI,SAAS;qDAmFjB,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -148,6 +148,14 @@ const $c2638d7be6bdca12$export$dca1ee5a936bb312 = (0, $hLlzK$cva)("items-center
|
|
|
148
148
|
end: "pe-2.5",
|
|
149
149
|
start: "ps-2.5"
|
|
150
150
|
},
|
|
151
|
+
/**
|
|
152
|
+
* Whether or not the button is in a loading state, default `false`. Setting `isLoading` will
|
|
153
|
+
* replace any `icon` with a spinner, or add one if an icon wasn't given.
|
|
154
|
+
* It will also disable user interaction with the button and set `aria-disabled`.
|
|
155
|
+
*/ isLoading: {
|
|
156
|
+
false: "",
|
|
157
|
+
true: "opacity-50"
|
|
158
|
+
},
|
|
151
159
|
/**
|
|
152
160
|
* Indicates the importance or impact level of the button, affecting its
|
|
153
161
|
* color and styling to communicate its purpose to the user
|
|
@@ -155,21 +163,12 @@ const $c2638d7be6bdca12$export$dca1ee5a936bb312 = (0, $hLlzK$cva)("items-center
|
|
|
155
163
|
danger: "",
|
|
156
164
|
default: "",
|
|
157
165
|
neutral: ""
|
|
158
|
-
},
|
|
159
|
-
/**
|
|
160
|
-
* The state of the button, default `"idle"`. If the button should present
|
|
161
|
-
* a "loading state", use `"pending"`. Setting the state to `"pending"` will
|
|
162
|
-
* replace any `icon` with a spinner, or add one if an icon wasn't given.
|
|
163
|
-
* It will also disable user interaction with the button and set `aria-disabled`.
|
|
164
|
-
*/ state: {
|
|
165
|
-
idle: "",
|
|
166
|
-
pending: "opacity-50"
|
|
167
166
|
}
|
|
168
167
|
},
|
|
169
168
|
defaultVariants: {
|
|
170
169
|
appearance: "outlined",
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
isLoading: false,
|
|
171
|
+
priority: "default"
|
|
173
172
|
},
|
|
174
173
|
compoundVariants: [
|
|
175
174
|
{
|
|
@@ -221,20 +220,20 @@ const $c2638d7be6bdca12$export$dca1ee5a936bb312 = (0, $hLlzK$cva)("items-center
|
|
|
221
220
|
* as submitting a form or opening a dialog.
|
|
222
221
|
*
|
|
223
222
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
|
|
224
|
-
*/ const $c2638d7be6bdca12$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hLlzK$forwardRef)(({ appearance: appearance = "outlined", asChild: asChild = false, children: children, className: propClassName, icon: propIcon, iconPlacement: iconPlacement = "start",
|
|
225
|
-
const ariaDisabled = _ariaDisabled !== null && _ariaDisabled !== void 0 ? _ariaDisabled :
|
|
226
|
-
const icon =
|
|
223
|
+
*/ const $c2638d7be6bdca12$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $hLlzK$forwardRef)(({ "aria-disabled": _ariaDisabled, appearance: appearance = "outlined", asChild: asChild = false, children: children, className: propClassName, icon: propIcon, iconPlacement: iconPlacement = "start", isLoading: isLoading = false, priority: priority = "default", ...props }, ref)=>{
|
|
224
|
+
const ariaDisabled = _ariaDisabled !== null && _ariaDisabled !== void 0 ? _ariaDisabled : isLoading;
|
|
225
|
+
const icon = isLoading ? /*#__PURE__*/ (0, $hLlzK$jsx)((0, $hLlzK$CircleNotch), {
|
|
227
226
|
className: "animate-spin"
|
|
228
227
|
}) : propIcon;
|
|
229
228
|
const className = (0, $a4274013049f8f7f$export$a274e22fb40f762e)($c2638d7be6bdca12$export$dca1ee5a936bb312({
|
|
230
229
|
appearance: appearance,
|
|
231
230
|
priority: priority,
|
|
232
|
-
|
|
231
|
+
isLoading: isLoading,
|
|
233
232
|
iconPlacement: icon ? iconPlacement : undefined
|
|
234
233
|
}), propClassName);
|
|
235
234
|
const onClickCapture = (event)=>{
|
|
236
235
|
var _props_onClickCapture;
|
|
237
|
-
if (
|
|
236
|
+
if (isLoading) {
|
|
238
237
|
event.preventDefault();
|
|
239
238
|
event.stopPropagation();
|
|
240
239
|
}
|
|
@@ -249,7 +248,7 @@ const $c2638d7be6bdca12$export$dca1ee5a936bb312 = (0, $hLlzK$cva)("items-center
|
|
|
249
248
|
return /*#__PURE__*/ (0, $hLlzK$jsx)((0, $hLlzK$Slot), {
|
|
250
249
|
"aria-disabled": ariaDisabled,
|
|
251
250
|
className: className,
|
|
252
|
-
"data-
|
|
251
|
+
"data-loading": isLoading,
|
|
253
252
|
onClickCapture: onClickCapture,
|
|
254
253
|
ref: ref,
|
|
255
254
|
...props,
|
|
@@ -264,7 +263,7 @@ const $c2638d7be6bdca12$export$dca1ee5a936bb312 = (0, $hLlzK$cva)("items-center
|
|
|
264
263
|
return /*#__PURE__*/ (0, $hLlzK$jsx)("button", {
|
|
265
264
|
"aria-disabled": ariaDisabled,
|
|
266
265
|
className: className,
|
|
267
|
-
"data-
|
|
266
|
+
"data-loading": isLoading,
|
|
268
267
|
onClickCapture: onClickCapture,
|
|
269
268
|
ref: ref,
|
|
270
269
|
...props,
|