@greghowe79/the-lib 0.4.6 → 0.4.8
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/lib/components/button/button.qwik.cjs +2 -1
- package/lib/components/button/button.qwik.mjs +2 -1
- package/lib/components/modal/modal.qwik.cjs +1 -1
- package/lib/components/modal/modal.qwik.mjs +1 -1
- package/lib-types/components/button/button.d.ts +2 -2
- package/lib-types/components/modal/modal.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ require("@fontsource/roboto-condensed/500.css");
|
|
|
7
7
|
const loader = require("../loader/loader.qwik.cjs");
|
|
8
8
|
const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading }) => {
|
|
9
9
|
qwik.useStylesScoped$(styles);
|
|
10
|
+
const loading = typeof isLoading === "object" && isLoading !== null && "value" in isLoading ? isLoading.value : isLoading;
|
|
10
11
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
11
12
|
id,
|
|
12
13
|
type,
|
|
@@ -28,7 +29,7 @@ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled
|
|
|
28
29
|
}),
|
|
29
30
|
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
30
31
|
class: "button__text",
|
|
31
|
-
children:
|
|
32
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(loader.Loader, {}) : label
|
|
32
33
|
})
|
|
33
34
|
]
|
|
34
35
|
});
|
|
@@ -5,6 +5,7 @@ import "@fontsource/roboto-condensed/500.css";
|
|
|
5
5
|
import { Loader } from "../loader/loader.qwik.mjs";
|
|
6
6
|
const Button = component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading }) => {
|
|
7
7
|
useStylesScoped$(styles);
|
|
8
|
+
const loading = typeof isLoading === "object" && isLoading !== null && "value" in isLoading ? isLoading.value : isLoading;
|
|
8
9
|
return /* @__PURE__ */ jsxs("button", {
|
|
9
10
|
id,
|
|
10
11
|
type,
|
|
@@ -26,7 +27,7 @@ const Button = component$(({ id, label, variant = "primary", icon, disabled = fa
|
|
|
26
27
|
}),
|
|
27
28
|
/* @__PURE__ */ jsx("span", {
|
|
28
29
|
class: "button__text",
|
|
29
|
-
children:
|
|
30
|
+
children: loading ? /* @__PURE__ */ jsx(Loader, {}) : label
|
|
30
31
|
})
|
|
31
32
|
]
|
|
32
33
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, JSXOutput, QRL } from '@builder.io/qwik';
|
|
1
|
+
import { Component, JSXOutput, QRL, Signal } from '@builder.io/qwik';
|
|
2
2
|
import '@fontsource/roboto-condensed/500.css';
|
|
3
3
|
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'icon' | 'tertiary';
|
|
4
4
|
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
@@ -13,6 +13,6 @@ export interface ButtonProps {
|
|
|
13
13
|
type?: ButtonType;
|
|
14
14
|
size?: ButtonSize;
|
|
15
15
|
onClick$?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>> | QRL<(type: string | unknown) => Promise<void>>;
|
|
16
|
-
isLoading?: boolean
|
|
16
|
+
isLoading?: boolean | Signal<boolean>;
|
|
17
17
|
}
|
|
18
18
|
export declare const Button: Component<ButtonProps>;
|
|
@@ -8,6 +8,6 @@ export interface ModalProps {
|
|
|
8
8
|
secondaryButtonLabel?: string;
|
|
9
9
|
primaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>> | QRL<(type: string | unknown) => Promise<void>>;
|
|
10
10
|
secondaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
|
|
11
|
-
isLoading?: boolean
|
|
11
|
+
isLoading?: Signal<boolean>;
|
|
12
12
|
}
|
|
13
13
|
export declare const Modal: import("@builder.io/qwik").Component<ModalProps>;
|