@greghowe79/the-lib 2.5.3 → 2.5.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.
- package/lib/components/button/button.qwik.cjs +2 -3
- package/lib/components/button/button.qwik.mjs +2 -3
- package/lib/components/button/button.utils.qwik.cjs +5 -2
- package/lib/components/button/button.utils.qwik.mjs +5 -2
- package/lib/components/button/styles.css.qwik.cjs +1 -1
- package/lib/components/button/styles.css.qwik.mjs +1 -1
- package/lib/components/loader/styles.css.qwik.cjs +1 -1
- package/lib/components/loader/styles.css.qwik.mjs +1 -1
- package/lib/components/navigationmenu/NavigationMenu.qwik.cjs +2 -4
- package/lib/components/navigationmenu/NavigationMenu.qwik.mjs +2 -4
- package/lib-types/components/button/button.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const qwik = require("@builder.io/qwik");
|
|
|
5
5
|
const styles = require("./styles.css.qwik.cjs");
|
|
6
6
|
const loader = require("../loader/loader.qwik.cjs");
|
|
7
7
|
const button_utils = require("./button.utils.qwik.cjs");
|
|
8
|
-
const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading, active = false, customColors
|
|
8
|
+
const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading, active = false, customColors }) => {
|
|
9
9
|
qwik.useStylesScoped$(styles);
|
|
10
10
|
const loading = typeof isLoading === "object" && isLoading !== null && "value" in isLoading ? isLoading.value : isLoading;
|
|
11
11
|
const hasCustomStyles = customColors && (customColors.bg || customColors.text || customColors.border || customColors.padding || customColors.width);
|
|
@@ -20,8 +20,7 @@ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled
|
|
|
20
20
|
class: [
|
|
21
21
|
`button-${variant}`,
|
|
22
22
|
`button-${size}`,
|
|
23
|
-
|
|
24
|
-
disabled && !keepStyleWhenDisabled && "button-disabled",
|
|
23
|
+
disabled && "button-disabled",
|
|
25
24
|
active && "button-active"
|
|
26
25
|
].filter(Boolean).join(" "),
|
|
27
26
|
disabled,
|
|
@@ -3,7 +3,7 @@ import { component$, useStylesScoped$ } from "@builder.io/qwik";
|
|
|
3
3
|
import styles from "./styles.css.qwik.mjs";
|
|
4
4
|
import { Loader } from "../loader/loader.qwik.mjs";
|
|
5
5
|
import { generateCustomCSS } from "./button.utils.qwik.mjs";
|
|
6
|
-
const Button = component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading, active = false, customColors
|
|
6
|
+
const Button = component$(({ id, label, variant = "primary", icon, disabled = false, ariaLabel, type = "button", size = "md", onClick$, isLoading, active = false, customColors }) => {
|
|
7
7
|
useStylesScoped$(styles);
|
|
8
8
|
const loading = typeof isLoading === "object" && isLoading !== null && "value" in isLoading ? isLoading.value : isLoading;
|
|
9
9
|
const hasCustomStyles = customColors && (customColors.bg || customColors.text || customColors.border || customColors.padding || customColors.width);
|
|
@@ -18,8 +18,7 @@ const Button = component$(({ id, label, variant = "primary", icon, disabled = fa
|
|
|
18
18
|
class: [
|
|
19
19
|
`button-${variant}`,
|
|
20
20
|
`button-${size}`,
|
|
21
|
-
|
|
22
|
-
disabled && !keepStyleWhenDisabled && "button-disabled",
|
|
21
|
+
disabled && "button-disabled",
|
|
23
22
|
active && "button-active"
|
|
24
23
|
].filter(Boolean).join(" "),
|
|
25
24
|
disabled,
|
|
@@ -31,11 +31,14 @@ function generateCustomCSS(id, colors) {
|
|
|
31
31
|
cursor: default !important;
|
|
32
32
|
opacity: 0.6 !important;
|
|
33
33
|
`;
|
|
34
|
+
const disabledRules = colors.keepStyleWhenDisabled ? "" : `
|
|
35
|
+
#${id}:disabled, #${id}.button-disabled { ${disabledStyles} }
|
|
36
|
+
#${id}:disabled:hover, #${id}.button-disabled:hover { ${disabledStyles} }
|
|
37
|
+
`;
|
|
34
38
|
return `
|
|
35
39
|
#${id} { ${baseStyles} }
|
|
36
40
|
#${id}:not(:disabled):hover { ${hoverStyles} }
|
|
37
|
-
|
|
38
|
-
#${id}:disabled:hover, #${id}.button-disabled:hover { ${disabledStyles} }
|
|
41
|
+
${disabledRules}
|
|
39
42
|
`;
|
|
40
43
|
}
|
|
41
44
|
exports.generateCustomCSS = generateCustomCSS;
|
|
@@ -29,11 +29,14 @@ function generateCustomCSS(id, colors) {
|
|
|
29
29
|
cursor: default !important;
|
|
30
30
|
opacity: 0.6 !important;
|
|
31
31
|
`;
|
|
32
|
+
const disabledRules = colors.keepStyleWhenDisabled ? "" : `
|
|
33
|
+
#${id}:disabled, #${id}.button-disabled { ${disabledStyles} }
|
|
34
|
+
#${id}:disabled:hover, #${id}.button-disabled:hover { ${disabledStyles} }
|
|
35
|
+
`;
|
|
32
36
|
return `
|
|
33
37
|
#${id} { ${baseStyles} }
|
|
34
38
|
#${id}:not(:disabled):hover { ${hoverStyles} }
|
|
35
|
-
|
|
36
|
-
#${id}:disabled:hover, #${id}.button-disabled:hover { ${disabledStyles} }
|
|
39
|
+
${disabledRules}
|
|
37
40
|
`;
|
|
38
41
|
}
|
|
39
42
|
export {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const styles = ".button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 0s;\r\n background: #333;\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/* Stile hover del pulsante */\r\n.button-primary:not(:disabled):hover {\r\n background: #0095ae;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n border: 2px solid #0095ae;\r\n}\r\n\r\n/* Stile del pulsante secondario */\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante secondario */\r\n.button-secondary:not(:disabled):hover {\r\n /* background: linear-gradient(to right, #5a6268, #4e555b); */\r\n background: #000;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Stile del pulsante di pericolo */\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante di pericolo */\r\n.button-danger:not(:disabled):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/* Stile del pulsante disabilitato */\r\n.button-primary:disabled,\r\n.button-secondary:disabled,\r\n.button-danger:disabled,\r\n.button-disabled {\r\n background-color: #cccccc;\r\n color: #000000;\r\n cursor: default; /* Usa il cursore a freccia */\r\n opacity: 0.6;\r\n}\r\n\r\n/* Assicurati che l'hover non funzioni quando il pulsante è disabilitato */\r\n.button-primary:disabled:hover,\r\n.button-secondary:disabled:hover,\r\n.button-danger:disabled:hover,\r\n.button-disabled:hover {\r\n background-color: #cccccc;\r\n border: 2px solid transparent;\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 /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-primary.button-md,\r\n.button-secondary.button-md {\r\n width: 100%;\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 width: 100%;\r\n max-width: 12rem;\r\n}\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 white-space: nowrap;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.button-icon:not(:disabled):hover {\r\n background: #f0f0f0;\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\r\nbutton.button-tertiary:not(:disabled):hover {\r\n background: #f0f0f0;\r\n}\r\n\r\n/* NUOVO CODICE DA TESTARE */\r\n\r\n/* Variante Tab */\r\nbutton.button-tab {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding: 1rem 1.5rem;\r\n background: none;\r\n border: none;\r\n border-bottom: 3px solid transparent;\r\n color: #6b7280;\r\n font-size: 1rem;\r\n font-weight: 500;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n margin-bottom: -2px;\r\n border-radius: 0;\r\n height: auto;\r\n max-width: none;\r\n}\r\n\r\nbutton.button-tab:not(:disabled):not(.button-active):hover {\r\n color: #111827;\r\n border-bottom-color: #d1d5db;\r\n background: none;\r\n border-left: none;\r\n border-right: none;\r\n border-top: none;\r\n}\r\n\r\nbutton.button-tab.button-active {\r\n color: #06c;\r\n border-bottom-color: #06c;\r\n}\r\n\r\nbutton.button-tab .button__icon {\r\n width: 20px;\r\n height: 20px;\r\n}\r\n";
|
|
2
|
+
const styles = ".button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 0s;\r\n background: #333;\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/* Stile hover del pulsante */\r\n.button-primary:not(:disabled):hover {\r\n background: #0095ae;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n border: 2px solid #0095ae;\r\n}\r\n\r\n/* Stile del pulsante secondario */\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante secondario */\r\n.button-secondary:not(:disabled):hover {\r\n /* background: linear-gradient(to right, #5a6268, #4e555b); */\r\n background: #000;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Stile del pulsante di pericolo */\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante di pericolo */\r\n.button-danger:not(:disabled):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/* Stile del pulsante disabilitato */\r\n.button-primary:disabled,\r\n.button-secondary:disabled,\r\n.button-danger:disabled,\r\n.button-disabled {\r\n background-color: #cccccc;\r\n color: #000000;\r\n cursor: default; /* Usa il cursore a freccia */\r\n opacity: 0.6;\r\n}\r\n\r\n/* Assicurati che l'hover non funzioni quando il pulsante è disabilitato */\r\n.button-primary:disabled:hover,\r\n.button-secondary:disabled:hover,\r\n.button-danger:disabled:hover,\r\n.button-disabled:hover {\r\n background-color: #cccccc;\r\n border: 2px solid transparent;\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 /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-primary.button-md,\r\n.button-secondary.button-md {\r\n width: 100%;\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 width: 100%;\r\n max-width: 12rem;\r\n}\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 white-space: nowrap;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n min-width: 3rem;\r\n min-height: 3rem;\r\n}\r\n\r\nbutton.button-icon:not(:disabled):hover {\r\n background: #f0f0f0;\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\r\nbutton.button-tertiary:not(:disabled):hover {\r\n background: #f0f0f0;\r\n}\r\n\r\n/* NUOVO CODICE DA TESTARE */\r\n\r\n/* Variante Tab */\r\nbutton.button-tab {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding: 1rem 1.5rem;\r\n background: none;\r\n border: none;\r\n border-bottom: 3px solid transparent;\r\n color: #6b7280;\r\n font-size: 1rem;\r\n font-weight: 500;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n margin-bottom: -2px;\r\n border-radius: 0;\r\n height: auto;\r\n max-width: none;\r\n}\r\n\r\nbutton.button-tab:not(:disabled):not(.button-active):hover {\r\n color: #111827;\r\n border-bottom-color: #d1d5db;\r\n background: none;\r\n border-left: none;\r\n border-right: none;\r\n border-top: none;\r\n}\r\n\r\nbutton.button-tab.button-active {\r\n color: #06c;\r\n border-bottom-color: #06c;\r\n}\r\n\r\nbutton.button-tab .button__icon {\r\n width: 20px;\r\n height: 20px;\r\n}\r\n";
|
|
3
3
|
module.exports = styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = ".button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 0s;\r\n background: #333;\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/* Stile hover del pulsante */\r\n.button-primary:not(:disabled):hover {\r\n background: #0095ae;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n border: 2px solid #0095ae;\r\n}\r\n\r\n/* Stile del pulsante secondario */\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante secondario */\r\n.button-secondary:not(:disabled):hover {\r\n /* background: linear-gradient(to right, #5a6268, #4e555b); */\r\n background: #000;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Stile del pulsante di pericolo */\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante di pericolo */\r\n.button-danger:not(:disabled):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/* Stile del pulsante disabilitato */\r\n.button-primary:disabled,\r\n.button-secondary:disabled,\r\n.button-danger:disabled,\r\n.button-disabled {\r\n background-color: #cccccc;\r\n color: #000000;\r\n cursor: default; /* Usa il cursore a freccia */\r\n opacity: 0.6;\r\n}\r\n\r\n/* Assicurati che l'hover non funzioni quando il pulsante è disabilitato */\r\n.button-primary:disabled:hover,\r\n.button-secondary:disabled:hover,\r\n.button-danger:disabled:hover,\r\n.button-disabled:hover {\r\n background-color: #cccccc;\r\n border: 2px solid transparent;\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 /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-primary.button-md,\r\n.button-secondary.button-md {\r\n width: 100%;\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 width: 100%;\r\n max-width: 12rem;\r\n}\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 white-space: nowrap;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n}\r\n\r\nbutton.button-icon:not(:disabled):hover {\r\n background: #f0f0f0;\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\r\nbutton.button-tertiary:not(:disabled):hover {\r\n background: #f0f0f0;\r\n}\r\n\r\n/* NUOVO CODICE DA TESTARE */\r\n\r\n/* Variante Tab */\r\nbutton.button-tab {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding: 1rem 1.5rem;\r\n background: none;\r\n border: none;\r\n border-bottom: 3px solid transparent;\r\n color: #6b7280;\r\n font-size: 1rem;\r\n font-weight: 500;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n margin-bottom: -2px;\r\n border-radius: 0;\r\n height: auto;\r\n max-width: none;\r\n}\r\n\r\nbutton.button-tab:not(:disabled):not(.button-active):hover {\r\n color: #111827;\r\n border-bottom-color: #d1d5db;\r\n background: none;\r\n border-left: none;\r\n border-right: none;\r\n border-top: none;\r\n}\r\n\r\nbutton.button-tab.button-active {\r\n color: #06c;\r\n border-bottom-color: #06c;\r\n}\r\n\r\nbutton.button-tab .button__icon {\r\n width: 20px;\r\n height: 20px;\r\n}\r\n";
|
|
1
|
+
const styles = ".button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 0s;\r\n background: #333;\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/* Stile hover del pulsante */\r\n.button-primary:not(:disabled):hover {\r\n background: #0095ae;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n border: 2px solid #0095ae;\r\n}\r\n\r\n/* Stile del pulsante secondario */\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante secondario */\r\n.button-secondary:not(:disabled):hover {\r\n /* background: linear-gradient(to right, #5a6268, #4e555b); */\r\n background: #000;\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Stile del pulsante di pericolo */\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border: 2px solid transparent;\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 transition: background 0.1s ease-out 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/* Stile hover del pulsante di pericolo */\r\n.button-danger:not(:disabled):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/* Stile del pulsante disabilitato */\r\n.button-primary:disabled,\r\n.button-secondary:disabled,\r\n.button-danger:disabled,\r\n.button-disabled {\r\n background-color: #cccccc;\r\n color: #000000;\r\n cursor: default; /* Usa il cursore a freccia */\r\n opacity: 0.6;\r\n}\r\n\r\n/* Assicurati che l'hover non funzioni quando il pulsante è disabilitato */\r\n.button-primary:disabled:hover,\r\n.button-secondary:disabled:hover,\r\n.button-danger:disabled:hover,\r\n.button-disabled:hover {\r\n background-color: #cccccc;\r\n border: 2px solid transparent;\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 /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-primary.button-md,\r\n.button-secondary.button-md {\r\n width: 100%;\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 width: 100%;\r\n max-width: 12rem;\r\n}\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 white-space: nowrap;\r\n}\r\n\r\nbutton.button-icon {\r\n gap: 0;\r\n background: none;\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n min-width: 3rem;\r\n min-height: 3rem;\r\n}\r\n\r\nbutton.button-icon:not(:disabled):hover {\r\n background: #f0f0f0;\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\r\nbutton.button-tertiary:not(:disabled):hover {\r\n background: #f0f0f0;\r\n}\r\n\r\n/* NUOVO CODICE DA TESTARE */\r\n\r\n/* Variante Tab */\r\nbutton.button-tab {\r\n display: flex;\r\n align-items: center;\r\n gap: 0.5rem;\r\n padding: 1rem 1.5rem;\r\n background: none;\r\n border: none;\r\n border-bottom: 3px solid transparent;\r\n color: #6b7280;\r\n font-size: 1rem;\r\n font-weight: 500;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n margin-bottom: -2px;\r\n border-radius: 0;\r\n height: auto;\r\n max-width: none;\r\n}\r\n\r\nbutton.button-tab:not(:disabled):not(.button-active):hover {\r\n color: #111827;\r\n border-bottom-color: #d1d5db;\r\n background: none;\r\n border-left: none;\r\n border-right: none;\r\n border-top: none;\r\n}\r\n\r\nbutton.button-tab.button-active {\r\n color: #06c;\r\n border-bottom-color: #06c;\r\n}\r\n\r\nbutton.button-tab .button__icon {\r\n width: 20px;\r\n height: 20px;\r\n}\r\n";
|
|
2
2
|
export {
|
|
3
3
|
styles as default
|
|
4
4
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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,
|
|
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, currentColor 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
3
|
module.exports = styles;
|
|
@@ -1,4 +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,
|
|
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, currentColor 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
2
|
export {
|
|
3
3
|
styles as default
|
|
4
4
|
};
|
|
@@ -88,8 +88,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
88
88
|
ariaLabel: ariaLabel2,
|
|
89
89
|
customColors,
|
|
90
90
|
isLoading: isLoading && !!label,
|
|
91
|
-
disabled: isLoading
|
|
92
|
-
keepStyleWhenDisabled: isLoading
|
|
91
|
+
disabled: isLoading
|
|
93
92
|
}, id);
|
|
94
93
|
})
|
|
95
94
|
})
|
|
@@ -109,8 +108,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
109
108
|
ariaLabel: action.ariaLabel,
|
|
110
109
|
customColors: action.customColors,
|
|
111
110
|
isLoading: isLoading && !!action.label,
|
|
112
|
-
disabled: isLoading
|
|
113
|
-
keepStyleWhenDisabled: isLoading
|
|
111
|
+
disabled: isLoading
|
|
114
112
|
}, action.id);
|
|
115
113
|
})
|
|
116
114
|
})
|
|
@@ -86,8 +86,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
86
86
|
ariaLabel: ariaLabel2,
|
|
87
87
|
customColors,
|
|
88
88
|
isLoading: isLoading && !!label,
|
|
89
|
-
disabled: isLoading
|
|
90
|
-
keepStyleWhenDisabled: isLoading
|
|
89
|
+
disabled: isLoading
|
|
91
90
|
}, id);
|
|
92
91
|
})
|
|
93
92
|
})
|
|
@@ -107,8 +106,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
107
106
|
ariaLabel: action.ariaLabel,
|
|
108
107
|
customColors: action.customColors,
|
|
109
108
|
isLoading: isLoading && !!action.label,
|
|
110
|
-
disabled: isLoading
|
|
111
|
-
keepStyleWhenDisabled: isLoading
|
|
109
|
+
disabled: isLoading
|
|
112
110
|
}, action.id);
|
|
113
111
|
})
|
|
114
112
|
})
|
|
@@ -11,6 +11,7 @@ export interface CustomColors {
|
|
|
11
11
|
hoverBorder?: string;
|
|
12
12
|
padding?: string;
|
|
13
13
|
width?: string;
|
|
14
|
+
keepStyleWhenDisabled?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export interface ButtonProps {
|
|
16
17
|
id: string;
|
|
@@ -25,6 +26,5 @@ export interface ButtonProps {
|
|
|
25
26
|
isLoading?: boolean | Signal<boolean>;
|
|
26
27
|
active?: boolean;
|
|
27
28
|
customColors?: CustomColors;
|
|
28
|
-
keepStyleWhenDisabled?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export declare const Button: Component<ButtonProps>;
|