@greghowe79/the-lib 2.5.0 → 2.5.2
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/navigationmenu/NavigationMenu.qwik.cjs +4 -2
- package/lib/components/navigationmenu/NavigationMenu.qwik.mjs +4 -2
- package/lib-types/components/button/button.d.ts +1 -0
- 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, keepStyleWhenDisabled = false }) => {
|
|
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,7 +20,8 @@ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled
|
|
|
20
20
|
class: [
|
|
21
21
|
`button-${variant}`,
|
|
22
22
|
`button-${size}`,
|
|
23
|
-
disabled &&
|
|
23
|
+
// disabled && 'button-disabled',
|
|
24
|
+
disabled && !keepStyleWhenDisabled && "button-disabled",
|
|
24
25
|
active && "button-active"
|
|
25
26
|
].filter(Boolean).join(" "),
|
|
26
27
|
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, keepStyleWhenDisabled = false }) => {
|
|
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,7 +18,8 @@ const Button = component$(({ id, label, variant = "primary", icon, disabled = fa
|
|
|
18
18
|
class: [
|
|
19
19
|
`button-${variant}`,
|
|
20
20
|
`button-${size}`,
|
|
21
|
-
disabled &&
|
|
21
|
+
// disabled && 'button-disabled',
|
|
22
|
+
disabled && !keepStyleWhenDisabled && "button-disabled",
|
|
22
23
|
active && "button-active"
|
|
23
24
|
].filter(Boolean).join(" "),
|
|
24
25
|
disabled,
|
|
@@ -88,7 +88,8 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
88
88
|
ariaLabel: ariaLabel2,
|
|
89
89
|
customColors,
|
|
90
90
|
isLoading: isLoading && !!label,
|
|
91
|
-
disabled: isLoading
|
|
91
|
+
disabled: isLoading,
|
|
92
|
+
keepStyleWhenDisabled: !label
|
|
92
93
|
}, id);
|
|
93
94
|
})
|
|
94
95
|
})
|
|
@@ -108,7 +109,8 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
108
109
|
ariaLabel: action.ariaLabel,
|
|
109
110
|
customColors: action.customColors,
|
|
110
111
|
isLoading: isLoading && !!action.label,
|
|
111
|
-
disabled: isLoading
|
|
112
|
+
disabled: isLoading,
|
|
113
|
+
keepStyleWhenDisabled: !action.label
|
|
112
114
|
}, action.id);
|
|
113
115
|
})
|
|
114
116
|
})
|
|
@@ -86,7 +86,8 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
86
86
|
ariaLabel: ariaLabel2,
|
|
87
87
|
customColors,
|
|
88
88
|
isLoading: isLoading && !!label,
|
|
89
|
-
disabled: isLoading
|
|
89
|
+
disabled: isLoading,
|
|
90
|
+
keepStyleWhenDisabled: !label
|
|
90
91
|
}, id);
|
|
91
92
|
})
|
|
92
93
|
})
|
|
@@ -106,7 +107,8 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
106
107
|
ariaLabel: action.ariaLabel,
|
|
107
108
|
customColors: action.customColors,
|
|
108
109
|
isLoading: isLoading && !!action.label,
|
|
109
|
-
disabled: isLoading
|
|
110
|
+
disabled: isLoading,
|
|
111
|
+
keepStyleWhenDisabled: !action.label
|
|
110
112
|
}, action.id);
|
|
111
113
|
})
|
|
112
114
|
})
|