@greghowe79/the-lib 0.4.7 → 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.
@@ -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: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(loader.Loader, {}) : label
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: isLoading ? /* @__PURE__ */ jsx(Loader, {}) : label
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",