@greghowe79/the-lib 0.3.3 → 0.3.5

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,18 @@
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 CloseIcon = qwik.component$(() => {
6
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "0 0 32 32",
9
+ "aria-hidden": "true",
10
+ role: "presentation",
11
+ focusable: "false",
12
+ style: "display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 3; overflow: visible;",
13
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", {
14
+ d: "m6 6 20 20M26 6 6 26"
15
+ })
16
+ });
17
+ });
18
+ exports.CloseIcon = CloseIcon;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$ } from "@builder.io/qwik";
3
+ const CloseIcon = component$(() => {
4
+ return /* @__PURE__ */ jsx("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ viewBox: "0 0 32 32",
7
+ "aria-hidden": "true",
8
+ role: "presentation",
9
+ focusable: "false",
10
+ style: "display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 3; overflow: visible;",
11
+ children: /* @__PURE__ */ jsx("path", {
12
+ d: "m6 6 20 20M26 6 6 26"
13
+ })
14
+ });
15
+ });
16
+ export {
17
+ CloseIcon
18
+ };
@@ -0,0 +1,63 @@
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
+ const closeIcon = require("../icons/closeIcon.qwik.cjs");
8
+ require("@fontsource/roboto-condensed");
9
+ const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
10
+ qwik.useStylesScoped$(styles);
11
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
12
+ id: "modal",
13
+ class: "modal-overlay",
14
+ "aria-hidden": !open.value,
15
+ role: "dialog",
16
+ "aria-modal": "true",
17
+ "aria-labelledby": "modal-title",
18
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
19
+ class: "modal",
20
+ tabIndex: -1,
21
+ children: [
22
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
23
+ class: "modal-header",
24
+ children: [
25
+ /* @__PURE__ */ jsxRuntime.jsx("h2", {
26
+ id: "modal-title",
27
+ children: title
28
+ }),
29
+ /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
30
+ id: "close-button",
31
+ ariaLabel: "Chiudi modale",
32
+ onClick$: () => open.value = false,
33
+ icon: /* @__PURE__ */ jsxRuntime.jsx(closeIcon.CloseIcon, {}),
34
+ variant: "icon"
35
+ })
36
+ ]
37
+ }),
38
+ /* @__PURE__ */ jsxRuntime.jsx("div", {
39
+ class: "modal-body",
40
+ tabIndex: 0,
41
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
42
+ }),
43
+ /* @__PURE__ */ jsxRuntime.jsxs("div", {
44
+ class: "modal-footer",
45
+ children: [
46
+ secondaryButtonLabel && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
47
+ id: "cancel-button",
48
+ label: secondaryButtonLabel,
49
+ onClick$: secondaryAction,
50
+ variant: "tertiary"
51
+ }),
52
+ primaryButtonLabel && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
53
+ id: "confirm-button",
54
+ label: primaryButtonLabel,
55
+ onClick$: primaryAction
56
+ })
57
+ ]
58
+ })
59
+ ]
60
+ })
61
+ });
62
+ });
63
+ exports.Modal = Modal;
@@ -0,0 +1,63 @@
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 { CloseIcon } from "../icons/closeIcon.qwik.mjs";
6
+ import "@fontsource/roboto-condensed";
7
+ const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
8
+ useStylesScoped$(styles);
9
+ return /* @__PURE__ */ jsx("div", {
10
+ id: "modal",
11
+ class: "modal-overlay",
12
+ "aria-hidden": !open.value,
13
+ role: "dialog",
14
+ "aria-modal": "true",
15
+ "aria-labelledby": "modal-title",
16
+ children: /* @__PURE__ */ jsxs("div", {
17
+ class: "modal",
18
+ tabIndex: -1,
19
+ children: [
20
+ /* @__PURE__ */ jsxs("div", {
21
+ class: "modal-header",
22
+ children: [
23
+ /* @__PURE__ */ jsx("h2", {
24
+ id: "modal-title",
25
+ children: title
26
+ }),
27
+ /* @__PURE__ */ jsx(Button, {
28
+ id: "close-button",
29
+ ariaLabel: "Chiudi modale",
30
+ onClick$: () => open.value = false,
31
+ icon: /* @__PURE__ */ jsx(CloseIcon, {}),
32
+ variant: "icon"
33
+ })
34
+ ]
35
+ }),
36
+ /* @__PURE__ */ jsx("div", {
37
+ class: "modal-body",
38
+ tabIndex: 0,
39
+ children: /* @__PURE__ */ jsx(Slot, {})
40
+ }),
41
+ /* @__PURE__ */ jsxs("div", {
42
+ class: "modal-footer",
43
+ children: [
44
+ secondaryButtonLabel && /* @__PURE__ */ jsx(Button, {
45
+ id: "cancel-button",
46
+ label: secondaryButtonLabel,
47
+ onClick$: secondaryAction,
48
+ variant: "tertiary"
49
+ }),
50
+ primaryButtonLabel && /* @__PURE__ */ jsx(Button, {
51
+ id: "confirm-button",
52
+ label: primaryButtonLabel,
53
+ onClick$: primaryAction
54
+ })
55
+ ]
56
+ })
57
+ ]
58
+ })
59
+ });
60
+ });
61
+ export {
62
+ Modal
63
+ };
@@ -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,11 +1,11 @@
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;
@@ -0,0 +1 @@
1
+ export declare const CloseIcon: import("@builder.io/qwik").Component<unknown>;
@@ -0,0 +1,11 @@
1
+ import { QRL, Signal } from '@builder.io/qwik';
2
+ import '@fontsource/roboto-condensed';
3
+ export interface ModalProps {
4
+ title?: string;
5
+ open: Signal<boolean>;
6
+ primaryButtonLabel?: string;
7
+ secondaryButtonLabel?: string;
8
+ primaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
9
+ secondaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
10
+ }
11
+ export declare const Modal: import("@builder.io/qwik").Component<ModalProps>;
@@ -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.3",
3
+ "version": "0.3.5",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",