@greghowe79/the-lib 0.3.2 → 0.3.4

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.
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 12rem;\r\n}\r\n.button__icon {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.button__text {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n";
2
+ const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 12rem;\r\n}\r\n.button__icon {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.button__text {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n padding: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.button-tertiary {\r\n background: transparent;\r\n font-weight: 500;\r\n border: 2px solid #333;\r\n outline: none;\r\n cursor: pointer;\r\n color: #333;\r\n}\r\n";
3
3
  module.exports = styles;
@@ -1,4 +1,4 @@
1
- const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 12rem;\r\n}\r\n.button__icon {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.button__text {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n";
1
+ const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 0.313rem;\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n max-width: 12rem;\r\n}\r\n.button__icon {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.button__text {\r\n font-family: 'Roboto Condensed', sans-serif;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n padding: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.button-tertiary {\r\n background: transparent;\r\n font-weight: 500;\r\n border: 2px solid #333;\r\n outline: none;\r\n cursor: pointer;\r\n color: #333;\r\n}\r\n";
2
2
  export {
3
3
  styles as default
4
4
  };
@@ -0,0 +1,62 @@
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 button = require("../button/button.qwik.cjs");
7
+ require("@fontsource/roboto-condensed");
8
+ const Modal = qwik.component$(({ title, open, icon, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
9
+ qwik.useStylesScoped$(styles);
10
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
11
+ id: "modal",
12
+ class: "modal-overlay",
13
+ "aria-hidden": !open.value,
14
+ role: "dialog",
15
+ "aria-modal": "true",
16
+ "aria-labelledby": "modal-title",
17
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
18
+ class: "modal",
19
+ tabIndex: -1,
20
+ children: [
21
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
22
+ class: "modal-header",
23
+ children: [
24
+ /* @__PURE__ */ jsxRuntime.jsx("h2", {
25
+ id: "modal-title",
26
+ children: title
27
+ }),
28
+ /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
29
+ id: "close-button",
30
+ ariaLabel: "Chiudi modale",
31
+ onClick$: () => open.value = false,
32
+ icon,
33
+ variant: "icon"
34
+ })
35
+ ]
36
+ }),
37
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
38
+ class: "modal-body",
39
+ tabIndex: 0,
40
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
41
+ }),
42
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
43
+ class: "modal-footer",
44
+ children: [
45
+ secondaryButtonLabel && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
46
+ id: "cancel-button",
47
+ label: secondaryButtonLabel,
48
+ onClick$: secondaryAction,
49
+ variant: "tertiary"
50
+ }),
51
+ primaryButtonLabel && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
52
+ id: "confirm-button",
53
+ label: primaryButtonLabel,
54
+ onClick$: primaryAction
55
+ })
56
+ ]
57
+ })
58
+ ]
59
+ })
60
+ });
61
+ });
62
+ exports.Modal = Modal;
@@ -0,0 +1,62 @@
1
+ import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$, useStylesScoped$, Slot } from "@builder.io/qwik";
3
+ import styles from "./styles.css.qwik.mjs";
4
+ import { Button } from "../button/button.qwik.mjs";
5
+ import "@fontsource/roboto-condensed";
6
+ const Modal = component$(({ title, open, icon, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
7
+ useStylesScoped$(styles);
8
+ return /* @__PURE__ */ jsx("div", {
9
+ id: "modal",
10
+ class: "modal-overlay",
11
+ "aria-hidden": !open.value,
12
+ role: "dialog",
13
+ "aria-modal": "true",
14
+ "aria-labelledby": "modal-title",
15
+ children: /* @__PURE__ */ jsxs("div", {
16
+ class: "modal",
17
+ tabIndex: -1,
18
+ children: [
19
+ /* @__PURE__ */ jsxs("div", {
20
+ class: "modal-header",
21
+ children: [
22
+ /* @__PURE__ */ jsx("h2", {
23
+ id: "modal-title",
24
+ children: title
25
+ }),
26
+ /* @__PURE__ */ jsx(Button, {
27
+ id: "close-button",
28
+ ariaLabel: "Chiudi modale",
29
+ onClick$: () => open.value = false,
30
+ icon,
31
+ variant: "icon"
32
+ })
33
+ ]
34
+ }),
35
+ /* @__PURE__ */ jsx("div", {
36
+ class: "modal-body",
37
+ tabIndex: 0,
38
+ children: /* @__PURE__ */ jsx(Slot, {})
39
+ }),
40
+ /* @__PURE__ */ jsxs("div", {
41
+ class: "modal-footer",
42
+ children: [
43
+ secondaryButtonLabel && /* @__PURE__ */ jsx(Button, {
44
+ id: "cancel-button",
45
+ label: secondaryButtonLabel,
46
+ onClick$: secondaryAction,
47
+ variant: "tertiary"
48
+ }),
49
+ primaryButtonLabel && /* @__PURE__ */ jsx(Button, {
50
+ id: "confirm-button",
51
+ label: primaryButtonLabel,
52
+ onClick$: primaryAction
53
+ })
54
+ ]
55
+ })
56
+ ]
57
+ })
58
+ });
59
+ });
60
+ export {
61
+ Modal
62
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const styles = ".modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 1000;\r\n}\r\n\r\n.modal {\r\n background: white;\r\n border-radius: 8px;\r\n width: 90%;\r\n max-width: 800px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);\r\n outline: none;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n color: #333;\r\n}\r\n\r\n.modal-header {\r\n padding: 16px 24px;\r\n border-bottom: 1px solid #e0e0e0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.modal-header h2 {\r\n margin: 0;\r\n font-size: 1.25rem;\r\n}\r\n\r\n.modal-body {\r\n padding: 24px;\r\n max-height: 60vh;\r\n overflow-y: auto;\r\n font-weight: 400;\r\n}\r\n\r\n.modal-footer {\r\n padding: 16px 24px;\r\n border-top: 1px solid #e0e0e0;\r\n display: flex;\r\n justify-content: flex-end;\r\n gap: 12px;\r\n}\r\n\r\n.close-button {\r\n background: none;\r\n border: none;\r\n font-size: 1.5rem;\r\n cursor: pointer;\r\n padding: 4px;\r\n}\r\n\r\n[aria-hidden='true'] {\r\n display: none;\r\n}\r\n\r\nbutton:focus,\r\n[tabindex='0']:focus {\r\n outline: 2px solid #005fcc;\r\n outline-offset: 2px;\r\n}\r\n";
3
+ module.exports = styles;
@@ -0,0 +1,4 @@
1
+ const styles = ".modal-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 1000;\r\n}\r\n\r\n.modal {\r\n background: white;\r\n border-radius: 8px;\r\n width: 90%;\r\n max-width: 800px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);\r\n outline: none;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n color: #333;\r\n}\r\n\r\n.modal-header {\r\n padding: 16px 24px;\r\n border-bottom: 1px solid #e0e0e0;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.modal-header h2 {\r\n margin: 0;\r\n font-size: 1.25rem;\r\n}\r\n\r\n.modal-body {\r\n padding: 24px;\r\n max-height: 60vh;\r\n overflow-y: auto;\r\n font-weight: 400;\r\n}\r\n\r\n.modal-footer {\r\n padding: 16px 24px;\r\n border-top: 1px solid #e0e0e0;\r\n display: flex;\r\n justify-content: flex-end;\r\n gap: 12px;\r\n}\r\n\r\n.close-button {\r\n background: none;\r\n border: none;\r\n font-size: 1.5rem;\r\n cursor: pointer;\r\n padding: 4px;\r\n}\r\n\r\n[aria-hidden='true'] {\r\n display: none;\r\n}\r\n\r\nbutton:focus,\r\n[tabindex='0']:focus {\r\n outline: 2px solid #005fcc;\r\n outline-offset: 2px;\r\n}\r\n";
2
+ export {
3
+ styles as default
4
+ };
@@ -4,7 +4,9 @@ const logo = require("./components/logo/logo.qwik.cjs");
4
4
  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
+ const modal = require("./components/modal/modal.qwik.cjs");
7
8
  exports.Logo = logo.Logo;
8
9
  exports.Counter = counter.Counter;
9
10
  exports.Button = button.Button;
10
11
  exports.NavigationMenu = NavigationMenu.NavigationMenu;
12
+ exports.Modal = modal.Modal;
@@ -2,9 +2,11 @@ import { Logo } from "./components/logo/logo.qwik.mjs";
2
2
  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
+ import { Modal } from "./components/modal/modal.qwik.mjs";
5
6
  export {
6
7
  Button,
7
8
  Counter,
8
9
  Logo,
10
+ Modal,
9
11
  NavigationMenu
10
12
  };
@@ -1,17 +1,17 @@
1
1
  import { Component, JSXOutput, QRL } from '@builder.io/qwik';
2
2
  import '@fontsource/roboto-condensed/500.css';
3
- export type ButtonVariant = 'primary' | 'secondary' | 'danger';
3
+ export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'icon' | 'tertiary';
4
4
  export type ButtonType = 'button' | 'submit' | 'reset';
5
5
  export type ButtonSize = 'sm' | 'md' | 'lg';
6
6
  export interface ButtonProps {
7
7
  id: string;
8
- label: string;
8
+ label?: string;
9
9
  variant?: ButtonVariant;
10
10
  icon?: JSXOutput | Component<unknown>;
11
11
  disabled?: boolean;
12
12
  ariaLabel?: string;
13
13
  type?: ButtonType;
14
14
  size?: ButtonSize;
15
- onClick$?: QRL<() => void> | QRL<() => boolean>;
15
+ onClick$?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
16
16
  }
17
17
  export declare const Button: Component<ButtonProps>;
@@ -0,0 +1,12 @@
1
+ import { Component, JSXOutput, QRL, Signal } from '@builder.io/qwik';
2
+ import '@fontsource/roboto-condensed';
3
+ export interface ModalProps {
4
+ title?: string;
5
+ open: Signal<boolean>;
6
+ icon?: JSXOutput | Component<unknown>;
7
+ primaryButtonLabel?: string;
8
+ secondaryButtonLabel?: string;
9
+ primaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
10
+ secondaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
11
+ }
12
+ export declare const Modal: Component<ModalProps>;
@@ -10,7 +10,7 @@ export interface NavigationMenuProps {
10
10
  actions?: Array<{
11
11
  id: string;
12
12
  label?: string;
13
- onClick$?: QRL<() => void> | QRL<() => boolean>;
13
+ onClick$?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
14
14
  icon?: JSXOutput | Component<unknown>;
15
15
  }>;
16
16
  }
@@ -2,3 +2,4 @@ export { Logo } from './components/logo/logo';
2
2
  export { Counter } from './components/counter/counter';
3
3
  export { Button } from './components/button/button';
4
4
  export { NavigationMenu } from './components/navigationmenu/NavigationMenu';
5
+ export { Modal } from './components/modal/modal';
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from 'storybook-framework-qwik';
2
+ import { type ModalProps } from '../components/modal/modal';
3
+ declare const meta: Meta<ModalProps>;
4
+ export default meta;
5
+ type Story = StoryObj<ModalProps>;
6
+ export declare const Default: Story;
7
+ export declare const WithoutTitle: Story;
8
+ export declare const LongContent: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",