@greghowe79/the-lib 2.4.8 → 2.5.0
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 qwikCity = require("@builder.io/qwik-city");
|
|
6
6
|
const styles = require("./styles.css.qwik.cjs");
|
|
7
7
|
const button = require("../button/button.qwik.cjs");
|
|
8
|
-
const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, actions, locale }) => {
|
|
8
|
+
const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, actions, locale, isLoading }) => {
|
|
9
9
|
const location = qwikCity.useLocation();
|
|
10
10
|
const isOpen = qwik.useSignal(false);
|
|
11
11
|
qwik.useStyles$(styles);
|
|
@@ -75,7 +75,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
75
75
|
actions && actions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("li", {
|
|
76
76
|
class: "mobile-only",
|
|
77
77
|
children: actions.map((action) => {
|
|
78
|
-
const { id, label, onClick$, variant, ariaLabel: ariaLabel2, icon, customColors
|
|
78
|
+
const { id, label, onClick$, variant, ariaLabel: ariaLabel2, icon, customColors } = action;
|
|
79
79
|
return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
|
|
80
80
|
id,
|
|
81
81
|
label: label ?? "",
|
|
@@ -87,8 +87,8 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
87
87
|
variant,
|
|
88
88
|
ariaLabel: ariaLabel2,
|
|
89
89
|
customColors,
|
|
90
|
-
isLoading,
|
|
91
|
-
disabled
|
|
90
|
+
isLoading: isLoading && !!label,
|
|
91
|
+
disabled: isLoading && !!label
|
|
92
92
|
}, id);
|
|
93
93
|
})
|
|
94
94
|
})
|
|
@@ -107,8 +107,8 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
107
107
|
variant: action.variant,
|
|
108
108
|
ariaLabel: action.ariaLabel,
|
|
109
109
|
customColors: action.customColors,
|
|
110
|
-
isLoading: action.
|
|
111
|
-
disabled: action.
|
|
110
|
+
isLoading: isLoading && !!action.label,
|
|
111
|
+
disabled: isLoading && !!action.label
|
|
112
112
|
}, action.id);
|
|
113
113
|
})
|
|
114
114
|
})
|
|
@@ -3,7 +3,7 @@ import { component$, useSignal, useStyles$, useOnWindow, $ } from "@builder.io/q
|
|
|
3
3
|
import { useLocation, Link } from "@builder.io/qwik-city";
|
|
4
4
|
import styles from "./styles.css.qwik.mjs";
|
|
5
5
|
import { Button } from "../button/button.qwik.mjs";
|
|
6
|
-
const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, actions, locale }) => {
|
|
6
|
+
const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, actions, locale, isLoading }) => {
|
|
7
7
|
const location = useLocation();
|
|
8
8
|
const isOpen = useSignal(false);
|
|
9
9
|
useStyles$(styles);
|
|
@@ -73,7 +73,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
73
73
|
actions && actions.length > 0 && /* @__PURE__ */ jsx("li", {
|
|
74
74
|
class: "mobile-only",
|
|
75
75
|
children: actions.map((action) => {
|
|
76
|
-
const { id, label, onClick$, variant, ariaLabel: ariaLabel2, icon, customColors
|
|
76
|
+
const { id, label, onClick$, variant, ariaLabel: ariaLabel2, icon, customColors } = action;
|
|
77
77
|
return /* @__PURE__ */ jsx(Button, {
|
|
78
78
|
id,
|
|
79
79
|
label: label ?? "",
|
|
@@ -85,8 +85,8 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
85
85
|
variant,
|
|
86
86
|
ariaLabel: ariaLabel2,
|
|
87
87
|
customColors,
|
|
88
|
-
isLoading,
|
|
89
|
-
disabled
|
|
88
|
+
isLoading: isLoading && !!label,
|
|
89
|
+
disabled: isLoading && !!label
|
|
90
90
|
}, id);
|
|
91
91
|
})
|
|
92
92
|
})
|
|
@@ -105,8 +105,8 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
105
105
|
variant: action.variant,
|
|
106
106
|
ariaLabel: action.ariaLabel,
|
|
107
107
|
customColors: action.customColors,
|
|
108
|
-
isLoading: action.
|
|
109
|
-
disabled: action.
|
|
108
|
+
isLoading: isLoading && !!action.label,
|
|
109
|
+
disabled: isLoading && !!action.label
|
|
110
110
|
}, action.id);
|
|
111
111
|
})
|
|
112
112
|
})
|
|
@@ -11,6 +11,7 @@ export interface NavigationMenuProps {
|
|
|
11
11
|
logoComponent?: Component<unknown>;
|
|
12
12
|
listItems?: NavItem[];
|
|
13
13
|
locale?: string;
|
|
14
|
+
isLoading?: boolean;
|
|
14
15
|
actions?: Array<{
|
|
15
16
|
id: string;
|
|
16
17
|
label?: string;
|
|
@@ -19,8 +20,6 @@ export interface NavigationMenuProps {
|
|
|
19
20
|
variant?: ButtonVariant;
|
|
20
21
|
ariaLabel?: string;
|
|
21
22
|
customColors?: CustomColors;
|
|
22
|
-
isLoading?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
23
|
}>;
|
|
25
24
|
}
|
|
26
25
|
export declare const NavigationMenu: Component<NavigationMenuProps>;
|