@greghowe79/the-lib 0.4.5 → 0.4.7

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,7 +4,8 @@ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
5
  const styles = require("./styles.css.qwik.cjs");
6
6
  require("@fontsource/roboto-condensed/500.css");
7
- const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$ }) => {
7
+ const loader = require("../loader/loader.qwik.cjs");
8
+ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading }) => {
8
9
  qwik.useStylesScoped$(styles);
9
10
  return /* @__PURE__ */ jsxRuntime.jsxs("button", {
10
11
  id,
@@ -27,7 +28,7 @@ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled
27
28
  }),
28
29
  /* @__PURE__ */ jsxRuntime.jsx("span", {
29
30
  class: "button__text",
30
- children: label
31
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(loader.Loader, {}) : label
31
32
  })
32
33
  ]
33
34
  });
@@ -2,7 +2,8 @@ import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useStylesScoped$ } from "@builder.io/qwik";
3
3
  import styles from "./styles.css.qwik.mjs";
4
4
  import "@fontsource/roboto-condensed/500.css";
5
- const Button = component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$ }) => {
5
+ import { Loader } from "../loader/loader.qwik.mjs";
6
+ const Button = component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading }) => {
6
7
  useStylesScoped$(styles);
7
8
  return /* @__PURE__ */ jsxs("button", {
8
9
  id,
@@ -25,7 +26,7 @@ const Button = component$(({ id, label, variant = "primary", icon, disabled = fa
25
26
  }),
26
27
  /* @__PURE__ */ jsx("span", {
27
28
  class: "button__text",
28
- children: label
29
+ children: isLoading ? /* @__PURE__ */ jsx(Loader, {}) : label
29
30
  })
30
31
  ]
31
32
  });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
+ const qwik = require("@builder.io/qwik");
5
+ const styles = require("./styles.css.qwik.cjs");
6
+ const Loader = qwik.component$(() => {
7
+ qwik.useStylesScoped$(styles);
8
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
9
+ class: "loader"
10
+ });
11
+ });
12
+ exports.Loader = Loader;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$, useStylesScoped$ } from "@builder.io/qwik";
3
+ import styles from "./styles.css.qwik.mjs";
4
+ const Loader = component$(() => {
5
+ useStylesScoped$(styles);
6
+ return /* @__PURE__ */ jsx("div", {
7
+ class: "loader"
8
+ });
9
+ });
10
+ export {
11
+ Loader
12
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const styles = '/* HTML: <div class="loader"></div> */\r\n.loader {\r\n width: 45px;\r\n aspect-ratio: 2;\r\n --_g: no-repeat radial-gradient(circle closest-side, white 80%, transparent);\r\n background:\r\n var(--_g) 0% 50%,\r\n var(--_g) 50% 50%,\r\n var(--_g) 100% 50%;\r\n background-size: calc(100% / 3) 50%;\r\n animation: l3 1s infinite linear;\r\n}\r\n@keyframes l3 {\r\n 20% {\r\n background-position:\r\n 0% 0%,\r\n 50% 50%,\r\n 100% 50%;\r\n }\r\n 40% {\r\n background-position:\r\n 0% 100%,\r\n 50% 0%,\r\n 100% 50%;\r\n }\r\n 60% {\r\n background-position:\r\n 0% 50%,\r\n 50% 100%,\r\n 100% 0%;\r\n }\r\n 80% {\r\n background-position:\r\n 0% 50%,\r\n 50% 50%,\r\n 100% 100%;\r\n }\r\n}\r\n';
3
+ module.exports = styles;
@@ -0,0 +1,4 @@
1
+ const styles = '/* HTML: <div class="loader"></div> */\r\n.loader {\r\n width: 45px;\r\n aspect-ratio: 2;\r\n --_g: no-repeat radial-gradient(circle closest-side, white 80%, transparent);\r\n background:\r\n var(--_g) 0% 50%,\r\n var(--_g) 50% 50%,\r\n var(--_g) 100% 50%;\r\n background-size: calc(100% / 3) 50%;\r\n animation: l3 1s infinite linear;\r\n}\r\n@keyframes l3 {\r\n 20% {\r\n background-position:\r\n 0% 0%,\r\n 50% 50%,\r\n 100% 50%;\r\n }\r\n 40% {\r\n background-position:\r\n 0% 100%,\r\n 50% 0%,\r\n 100% 50%;\r\n }\r\n 60% {\r\n background-position:\r\n 0% 50%,\r\n 50% 100%,\r\n 100% 0%;\r\n }\r\n 80% {\r\n background-position:\r\n 0% 50%,\r\n 50% 50%,\r\n 100% 100%;\r\n }\r\n}\r\n';
2
+ export {
3
+ styles as default
4
+ };
@@ -6,7 +6,7 @@ const styles = require("./styles.css.qwik.cjs");
6
6
  const button = require("../button/button.qwik.cjs");
7
7
  const closeIcon = require("../icons/closeIcon.qwik.cjs");
8
8
  require("@fontsource/roboto-condensed");
9
- const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true }) => {
9
+ const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true, isLoading }) => {
10
10
  qwik.useStylesScoped$(styles);
11
11
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
12
12
  id: "modal",
@@ -52,7 +52,8 @@ const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButto
52
52
  primaryButtonLabel && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
53
53
  id: "confirm-button",
54
54
  label: primaryButtonLabel,
55
- onClick$: primaryAction
55
+ onClick$: primaryAction,
56
+ isLoading: isLoading?.value
56
57
  })
57
58
  ]
58
59
  })
@@ -4,7 +4,7 @@ import styles from "./styles.css.qwik.mjs";
4
4
  import { Button } from "../button/button.qwik.mjs";
5
5
  import { CloseIcon } from "../icons/closeIcon.qwik.mjs";
6
6
  import "@fontsource/roboto-condensed";
7
- const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true }) => {
7
+ const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true, isLoading }) => {
8
8
  useStylesScoped$(styles);
9
9
  return /* @__PURE__ */ jsx("div", {
10
10
  id: "modal",
@@ -50,7 +50,8 @@ const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabe
50
50
  primaryButtonLabel && /* @__PURE__ */ jsx(Button, {
51
51
  id: "confirm-button",
52
52
  label: primaryButtonLabel,
53
- onClick$: primaryAction
53
+ onClick$: primaryAction,
54
+ isLoading: isLoading?.value
54
55
  })
55
56
  ]
56
57
  })
@@ -5,8 +5,10 @@ const counter = require("./components/counter/counter.qwik.cjs");
5
5
  const button = require("./components/button/button.qwik.cjs");
6
6
  const NavigationMenu = require("./components/navigationmenu/NavigationMenu.qwik.cjs");
7
7
  const modal = require("./components/modal/modal.qwik.cjs");
8
+ const loader = require("./components/loader/loader.qwik.cjs");
8
9
  exports.Logo = logo.Logo;
9
10
  exports.Counter = counter.Counter;
10
11
  exports.Button = button.Button;
11
12
  exports.NavigationMenu = NavigationMenu.NavigationMenu;
12
13
  exports.Modal = modal.Modal;
14
+ exports.Loader = loader.Loader;
@@ -3,9 +3,11 @@ import { Counter } from "./components/counter/counter.qwik.mjs";
3
3
  import { Button } from "./components/button/button.qwik.mjs";
4
4
  import { NavigationMenu } from "./components/navigationmenu/NavigationMenu.qwik.mjs";
5
5
  import { Modal } from "./components/modal/modal.qwik.mjs";
6
+ import { Loader } from "./components/loader/loader.qwik.mjs";
6
7
  export {
7
8
  Button,
8
9
  Counter,
10
+ Loader,
9
11
  Logo,
10
12
  Modal,
11
13
  NavigationMenu
@@ -13,5 +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
17
  }
17
18
  export declare const Button: Component<ButtonProps>;
@@ -0,0 +1 @@
1
+ export declare const Loader: import("@builder.io/qwik").Component<unknown>;
@@ -8,5 +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?: Signal<boolean>;
11
12
  }
12
13
  export declare const Modal: import("@builder.io/qwik").Component<ModalProps>;
@@ -3,3 +3,4 @@ export { Counter } from './components/counter/counter';
3
3
  export { Button } from './components/button/button';
4
4
  export { NavigationMenu } from './components/navigationmenu/NavigationMenu';
5
5
  export { Modal } from './components/modal/modal';
6
+ export { Loader } from './components/loader/loader';
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<ButtonProps>;
6
6
  export declare const Primary: Story;
7
7
  export declare const WithIcon: Story;
8
+ export declare const WithLoader: Story;
@@ -0,0 +1,5 @@
1
+ import type { Meta, StoryObj } from 'storybook-framework-qwik';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const WhiteLoader: Story;
@@ -7,3 +7,4 @@ export declare const Default: Story;
7
7
  export declare const WithoutTitle: Story;
8
8
  export declare const LongContent: Story;
9
9
  export declare const WithoutCloseButton: Story;
10
+ export declare const WithLoadingBtn: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",