@greghowe79/the-lib 0.2.2 → 0.2.3

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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
4
  const qwik = require("@builder.io/qwik");
5
- const NavLink = require("./NavLink.qwik.cjs");
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
8
  require("@fontsource/roboto-condensed/500.css");
@@ -17,7 +17,7 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
17
17
  /* @__PURE__ */ jsxRuntime.jsxs("div", {
18
18
  class: "menu-left",
19
19
  children: [
20
- /* @__PURE__ */ jsxRuntime.jsx(NavLink.NavLink, {
20
+ /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
21
21
  href: "/",
22
22
  "aria-label": "Homepage",
23
23
  children: logoComponent && logoComponent({}, null, 0)
@@ -26,10 +26,9 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
26
26
  class: "menu-list",
27
27
  children: listItems?.map((item) => {
28
28
  return /* @__PURE__ */ jsxRuntime.jsx("li", {
29
- children: /* @__PURE__ */ jsxRuntime.jsx(NavLink.NavLink, {
29
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
30
30
  href: item.href,
31
31
  class: "menu-link",
32
- activeClass: "active-link",
33
32
  children: item.label
34
33
  })
35
34
  }, item.label);
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
2
2
  import { component$, useStyles$ } from "@builder.io/qwik";
3
- import { NavLink } from "./NavLink.qwik.mjs";
3
+ import { 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";
@@ -15,7 +15,7 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
15
15
  /* @__PURE__ */ jsxs("div", {
16
16
  class: "menu-left",
17
17
  children: [
18
- /* @__PURE__ */ jsx(NavLink, {
18
+ /* @__PURE__ */ jsx(Link, {
19
19
  href: "/",
20
20
  "aria-label": "Homepage",
21
21
  children: logoComponent && logoComponent({}, null, 0)
@@ -24,10 +24,9 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
24
24
  class: "menu-list",
25
25
  children: listItems?.map((item) => {
26
26
  return /* @__PURE__ */ jsx("li", {
27
- children: /* @__PURE__ */ jsx(NavLink, {
27
+ children: /* @__PURE__ */ jsx(Link, {
28
28
  href: item.href,
29
29
  class: "menu-link",
30
- activeClass: "active-link",
31
30
  children: item.label
32
31
  })
33
32
  }, 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.active-link {\r\n background-color: #f0f0f0;\r\n color: #333;\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 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.active-link {\r\n background-color: #f0f0f0;\r\n color: #333;\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 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.2",
3
+ "version": "0.2.3",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
- const qwik = require("@builder.io/qwik");
5
- const qwikCity = require("@builder.io/qwik-city");
6
- const NavLink = qwik.component$(({ activeClass, ...props }) => {
7
- const location = qwikCity.useLocation();
8
- const toPathname = props.href ?? "";
9
- const locationPathname = location.url.pathname;
10
- const startSlashPosition = toPathname !== "/" && toPathname.startsWith("/") ? toPathname.length - 1 : toPathname.length;
11
- const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
12
- const isActive = locationPathname === toPathname || locationPathname.endsWith(toPathname) && (locationPathname.charAt(endSlashPosition) === "/" || locationPathname.charAt(startSlashPosition) === "/");
13
- return /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
14
- ...props,
15
- class: [
16
- props.class,
17
- isActive && activeClass ? activeClass : ""
18
- ],
19
- children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
20
- });
21
- });
22
- exports.NavLink = NavLink;
@@ -1,22 +0,0 @@
1
- import { jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot } from "@builder.io/qwik";
3
- import { useLocation, Link } from "@builder.io/qwik-city";
4
- const NavLink = component$(({ activeClass, ...props }) => {
5
- const location = useLocation();
6
- const toPathname = props.href ?? "";
7
- const locationPathname = location.url.pathname;
8
- const startSlashPosition = toPathname !== "/" && toPathname.startsWith("/") ? toPathname.length - 1 : toPathname.length;
9
- const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
10
- const isActive = locationPathname === toPathname || locationPathname.endsWith(toPathname) && (locationPathname.charAt(endSlashPosition) === "/" || locationPathname.charAt(startSlashPosition) === "/");
11
- return /* @__PURE__ */ jsx(Link, {
12
- ...props,
13
- class: [
14
- props.class,
15
- isActive && activeClass ? activeClass : ""
16
- ],
17
- children: /* @__PURE__ */ jsx(Slot, {})
18
- });
19
- });
20
- export {
21
- NavLink
22
- };