@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.
- package/lib/components/button/button.qwik.cjs +3 -2
- package/lib/components/button/button.qwik.mjs +3 -2
- package/lib/components/loader/loader.qwik.cjs +12 -0
- package/lib/components/loader/loader.qwik.mjs +12 -0
- package/lib/components/loader/styles.css.qwik.cjs +3 -0
- package/lib/components/loader/styles.css.qwik.mjs +4 -0
- package/lib/components/modal/modal.qwik.cjs +3 -2
- package/lib/components/modal/modal.qwik.mjs +3 -2
- package/lib/index.qwik.cjs +2 -0
- package/lib/index.qwik.mjs +2 -0
- package/lib-types/components/button/button.d.ts +1 -0
- package/lib-types/components/loader/loader.d.ts +1 -0
- package/lib-types/components/modal/modal.d.ts +1 -0
- package/lib-types/index.d.ts +1 -0
- package/lib-types/stories/button.stories.d.ts +1 -0
- package/lib-types/stories/loader.stories.d.ts +5 -0
- package/lib-types/stories/modal.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
|
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
|
-
|
|
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
|
})
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -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;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -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>;
|
package/lib-types/index.d.ts
CHANGED
|
@@ -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';
|