@greghowe79/the-lib 0.2.3 → 0.2.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.
@@ -7,6 +7,7 @@ const styles = require("./styles.css.qwik.cjs");
7
7
  const button = require("../button/button.qwik.cjs");
8
8
  require("@fontsource/roboto-condensed/500.css");
9
9
  const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, actions }) => {
10
+ const location = qwikCity.useLocation();
10
11
  qwik.useStyles$(styles);
11
12
  return /* @__PURE__ */ jsxRuntime.jsx("nav", {
12
13
  class: "menu",
@@ -28,7 +29,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
28
29
  return /* @__PURE__ */ jsxRuntime.jsx("li", {
29
30
  children: /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
30
31
  href: item.href,
31
- class: "menu-link",
32
+ class: `${location.url.pathname === item.href ? "active" : "menu-link"}`,
32
33
  children: item.label
33
34
  })
34
35
  }, item.label);
@@ -1,10 +1,11 @@
1
1
  import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useStyles$ } from "@builder.io/qwik";
3
- import { Link } from "@builder.io/qwik-city";
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
6
  import "@fontsource/roboto-condensed/500.css";
7
7
  const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, actions }) => {
8
+ const location = useLocation();
8
9
  useStyles$(styles);
9
10
  return /* @__PURE__ */ jsx("nav", {
10
11
  class: "menu",
@@ -26,7 +27,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
26
27
  return /* @__PURE__ */ jsx("li", {
27
28
  children: /* @__PURE__ */ jsx(Link, {
28
29
  href: item.href,
29
- class: "menu-link",
30
+ class: `${location.url.pathname === item.href ? "active" : "menu-link"}`,
30
31
  children: item.label
31
32
  })
32
33
  }, item.label);
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const styles = ".menu {\r\n background-color: #fff;\r\n padding: 1rem;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\r\n}\r\n.menu-container {\r\n max-width: 75rem;\r\n margin: 0 auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.menu-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 2rem;\r\n}\r\n.menu-list {\r\n display: flex;\r\n list-style: none;\r\n gap: 1.5rem;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.menu-link {\r\n display: inline-block;\r\n padding: 0.5rem 1rem;\r\n color: #333;\r\n text-decoration: none;\r\n border-radius: 4px;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n transition:\r\n background-color 0.2s,\r\n color 0.2s;\r\n}\r\n\r\n.menu-link:hover {\r\n background-color: #f0f0f0;\r\n color: #333;\r\n}\r\n\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
2
+ const styles = ".menu {\r\n background-color: #fff;\r\n padding: 1rem;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\r\n}\r\n.menu-container {\r\n max-width: 75rem;\r\n margin: 0 auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.menu-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 2rem;\r\n}\r\n.menu-list {\r\n display: flex;\r\n list-style: none;\r\n gap: 1.5rem;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.menu-link {\r\n display: inline-block;\r\n padding: 0.5rem 1rem;\r\n color: #333;\r\n text-decoration: none;\r\n border-radius: 4px;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n transition:\r\n background-color 0.2s,\r\n color 0.2s;\r\n}\r\n\r\n.menu-link:hover,\r\n.menu-link.active {\r\n background-color: #f0f0f0;\r\n color: #333;\r\n}\r\n\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
3
3
  module.exports = styles;
@@ -1,4 +1,4 @@
1
- const styles = ".menu {\r\n background-color: #fff;\r\n padding: 1rem;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\r\n}\r\n.menu-container {\r\n max-width: 75rem;\r\n margin: 0 auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.menu-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 2rem;\r\n}\r\n.menu-list {\r\n display: flex;\r\n list-style: none;\r\n gap: 1.5rem;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.menu-link {\r\n display: inline-block;\r\n padding: 0.5rem 1rem;\r\n color: #333;\r\n text-decoration: none;\r\n border-radius: 4px;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n transition:\r\n background-color 0.2s,\r\n color 0.2s;\r\n}\r\n\r\n.menu-link:hover {\r\n background-color: #f0f0f0;\r\n color: #333;\r\n}\r\n\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
1
+ const styles = ".menu {\r\n background-color: #fff;\r\n padding: 1rem;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\r\n}\r\n.menu-container {\r\n max-width: 75rem;\r\n margin: 0 auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.menu-left {\r\n display: flex;\r\n align-items: center;\r\n gap: 2rem;\r\n}\r\n.menu-list {\r\n display: flex;\r\n list-style: none;\r\n gap: 1.5rem;\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\n.menu-link {\r\n display: inline-block;\r\n padding: 0.5rem 1rem;\r\n color: #333;\r\n text-decoration: none;\r\n border-radius: 4px;\r\n font-family: 'Roboto Condensed', sans-serif;\r\n transition:\r\n background-color 0.2s,\r\n color 0.2s;\r\n}\r\n\r\n.menu-link:hover,\r\n.menu-link.active {\r\n background-color: #f0f0f0;\r\n color: #333;\r\n}\r\n\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
2
2
  export {
3
3
  styles as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",