@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.
@@ -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 && "button-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 && "button-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 && !!label
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 && !!action.label
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 && !!label
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 && !!action.label
110
+ disabled: isLoading,
111
+ keepStyleWhenDisabled: !action.label
110
112
  }, action.id);
111
113
  })
112
114
  })
@@ -25,5 +25,6 @@ export interface ButtonProps {
25
25
  isLoading?: boolean | Signal<boolean>;
26
26
  active?: boolean;
27
27
  customColors?: CustomColors;
28
+ keepStyleWhenDisabled?: boolean;
28
29
  }
29
30
  export declare const Button: Component<ButtonProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",