@greghowe79/the-lib 0.1.0 → 0.1.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 +0 -1
- package/lib/components/button/button.qwik.mjs +0 -1
- package/lib/components/button/styles.css.qwik.cjs +1 -1
- package/lib/components/button/styles.css.qwik.mjs +1 -1
- package/lib/components/navigationmenu/NavigationMenu.qwik.cjs +51 -0
- package/lib/components/navigationmenu/NavigationMenu.qwik.mjs +51 -0
- package/lib/components/navigationmenu/styles.css.qwik.cjs +3 -0
- package/lib/components/navigationmenu/styles.css.qwik.mjs +4 -0
- package/lib/index.qwik.cjs +2 -0
- package/lib/index.qwik.mjs +3 -1
- package/lib-types/components/navigationmenu/NavigationMenu.d.ts +14 -0
- package/lib-types/index.d.ts +1 -0
- package/lib-types/stories/navigation-menu.stories.d.ts +8 -0
- package/package.json +3 -2
|
@@ -8,7 +8,6 @@ const Button = qwik.component$(({ id, label, variant = "primary", icon, disabled
|
|
|
8
8
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
9
9
|
id,
|
|
10
10
|
type,
|
|
11
|
-
// class={[buttonVariants[variant], buttonSizeVariants[size], disabled && disabledStyle]}
|
|
12
11
|
class: [
|
|
13
12
|
`button-${variant}`,
|
|
14
13
|
`button-${size}`,
|
|
@@ -6,7 +6,6 @@ const Button = component$(({ id, label, variant = "primary", icon, disabled = fa
|
|
|
6
6
|
return /* @__PURE__ */ jsxs("button", {
|
|
7
7
|
id,
|
|
8
8
|
type,
|
|
9
|
-
// class={[buttonVariants[variant], buttonSizeVariants[size], disabled && disabledStyle]}
|
|
10
9
|
class: [
|
|
11
10
|
`button-${variant}`,
|
|
12
11
|
`button-${size}`,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0,
|
|
2
|
+
const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n /* width: 100%; */\r\n max-width: 12rem;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n";
|
|
3
3
|
module.exports = styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0,
|
|
1
|
+
const styles = "/* Button variants */\r\n.button-primary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: rgb(0, 51, 153);\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-primary:hover {\r\n background: rgb(0, 101, 255);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: rgb(255, 255, 255);\r\n}\r\n\r\n.button-secondary {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(59, 65, 71), rgb(48, 54, 59));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-secondary:hover {\r\n background: linear-gradient(to right, #5a6268, #4e555b);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n.button-danger {\r\n display: inline-block;\r\n outline: none;\r\n border-width: 0px;\r\n border-radius: 3px;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n max-width: 100%;\r\n text-align: center;\r\n text-decoration: none;\r\n transition:\r\n background 0.1s ease-out 0s,\r\n box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38) 0s;\r\n background: linear-gradient(to right, rgb(153, 31, 43), rgb(130, 27, 37));\r\n cursor: pointer;\r\n height: 32px;\r\n line-height: 32px;\r\n padding: 0px 12px;\r\n vertical-align: middle;\r\n width: auto;\r\n font-size: 14px;\r\n color: white;\r\n}\r\n\r\n.button-danger:hover {\r\n background: linear-gradient(to right, #c82333, #bd2130);\r\n text-decoration: inherit;\r\n transition-duration: 0s, 0.15s;\r\n color: white;\r\n}\r\n\r\n/* Button sizes */\r\n.button-sm {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n width: 100%;\r\n}\r\n\r\n.button-md {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n /* width: 100%; */\r\n max-width: 8rem;\r\n}\r\n\r\n.button-lg {\r\n font-size: 1rem;\r\n height: 100%;\r\n line-height: 1.25rem;\r\n padding: 0.75rem 1.5rem;\r\n border-radius: 2rem;\r\n /* width: 100%; */\r\n max-width: 12rem;\r\n}\r\n\r\n/* Disabled state */\r\n.button-disabled {\r\n opacity: 0.6;\r\n cursor: not-allowed;\r\n}\r\n";
|
|
2
2
|
export {
|
|
3
3
|
styles as default
|
|
4
4
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 styles = require("./styles.css.qwik.cjs");
|
|
7
|
+
const button = require("../button/button.qwik.cjs");
|
|
8
|
+
const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, actions }) => {
|
|
9
|
+
qwik.useStyles$(styles);
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", {
|
|
11
|
+
class: "menu",
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
14
|
+
class: "menu-container",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
17
|
+
class: "menu-left",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
|
|
20
|
+
href: "/",
|
|
21
|
+
"aria-label": "Homepage",
|
|
22
|
+
children: logoComponent
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", {
|
|
25
|
+
class: "menu-list",
|
|
26
|
+
children: listItems?.map((item) => {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", {
|
|
28
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
|
|
29
|
+
href: item.href,
|
|
30
|
+
class: "menu-link",
|
|
31
|
+
children: item.label
|
|
32
|
+
})
|
|
33
|
+
}, item.label);
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
39
|
+
class: "menu-right",
|
|
40
|
+
children: actions?.map((action) => {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
|
|
42
|
+
id: action.id,
|
|
43
|
+
label: action.label
|
|
44
|
+
}, action.id);
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
exports.NavigationMenu = NavigationMenu;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useStyles$ } from "@builder.io/qwik";
|
|
3
|
+
import { Link } from "@builder.io/qwik-city";
|
|
4
|
+
import styles from "./styles.css.qwik.mjs";
|
|
5
|
+
import { Button } from "../button/button.qwik.mjs";
|
|
6
|
+
const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, actions }) => {
|
|
7
|
+
useStyles$(styles);
|
|
8
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
9
|
+
class: "menu",
|
|
10
|
+
"aria-label": ariaLabel,
|
|
11
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
class: "menu-container",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsxs("div", {
|
|
15
|
+
class: "menu-left",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Link, {
|
|
18
|
+
href: "/",
|
|
19
|
+
"aria-label": "Homepage",
|
|
20
|
+
children: logoComponent
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("ul", {
|
|
23
|
+
class: "menu-list",
|
|
24
|
+
children: listItems?.map((item) => {
|
|
25
|
+
return /* @__PURE__ */ jsx("li", {
|
|
26
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
27
|
+
href: item.href,
|
|
28
|
+
class: "menu-link",
|
|
29
|
+
children: item.label
|
|
30
|
+
})
|
|
31
|
+
}, item.label);
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsx("div", {
|
|
37
|
+
class: "menu-right",
|
|
38
|
+
children: actions?.map((action) => {
|
|
39
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
40
|
+
id: action.id,
|
|
41
|
+
label: action.label
|
|
42
|
+
}, action.id);
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
NavigationMenu
|
|
51
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const styles = ".navigation-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; /* Colore di default */\r\n text-decoration: none;\r\n border-radius: 4px;\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: #000;\r\n}\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
|
|
3
|
+
module.exports = styles;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const styles = ".navigation-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; /* Colore di default */\r\n text-decoration: none;\r\n border-radius: 4px;\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: #000;\r\n}\r\n.menu-right {\r\n display: flex;\r\n gap: 0.75rem;\r\n}\r\n";
|
|
2
|
+
export {
|
|
3
|
+
styles as default
|
|
4
|
+
};
|
package/lib/index.qwik.cjs
CHANGED
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const logo = require("./components/logo/logo.qwik.cjs");
|
|
4
4
|
const counter = require("./components/counter/counter.qwik.cjs");
|
|
5
5
|
const button = require("./components/button/button.qwik.cjs");
|
|
6
|
+
const NavigationMenu = require("./components/navigationmenu/NavigationMenu.qwik.cjs");
|
|
6
7
|
exports.Logo = logo.Logo;
|
|
7
8
|
exports.Counter = counter.Counter;
|
|
8
9
|
exports.Button = button.Button;
|
|
10
|
+
exports.NavigationMenu = NavigationMenu.NavigationMenu;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Logo } from "./components/logo/logo.qwik.mjs";
|
|
2
2
|
import { Counter } from "./components/counter/counter.qwik.mjs";
|
|
3
3
|
import { Button } from "./components/button/button.qwik.mjs";
|
|
4
|
+
import { NavigationMenu } from "./components/navigationmenu/NavigationMenu.qwik.mjs";
|
|
4
5
|
export {
|
|
5
6
|
Button,
|
|
6
7
|
Counter,
|
|
7
|
-
Logo
|
|
8
|
+
Logo,
|
|
9
|
+
NavigationMenu
|
|
8
10
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from '@builder.io/qwik';
|
|
2
|
+
export interface NavigationMenuProps {
|
|
3
|
+
ariaLabel?: string;
|
|
4
|
+
logoComponent?: Component<unknown>;
|
|
5
|
+
listItems?: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
}>;
|
|
9
|
+
actions?: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare const NavigationMenu: Component<NavigationMenuProps>;
|
package/lib-types/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from 'storybook-framework-qwik';
|
|
2
|
+
import { type NavigationMenuProps } from '../components/navigationmenu/NavigationMenu';
|
|
3
|
+
declare const meta: Meta<NavigationMenuProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<NavigationMenuProps>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const WithoutActions: Story;
|
|
8
|
+
export declare const Minimal: Story;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greghowe79/the-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Collection of fast components for Qwik",
|
|
5
5
|
"main": "./lib/index.qwik.mjs",
|
|
6
6
|
"qwik": "./lib/index.qwik.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"qwik": "qwik"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@builder.io/qwik": "1.13.0",
|
|
41
|
+
"@builder.io/qwik": "^1.13.0",
|
|
42
42
|
"@storybook/addon-essentials": "^8.2.8",
|
|
43
43
|
"@storybook/addon-links": "^8.2.8",
|
|
44
44
|
"@storybook/blocks": "^8.2.8",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"vite-tsconfig-paths": "^4.2.1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
+
"@builder.io/qwik-city": "^1.13.0",
|
|
66
67
|
"@vanilla-extract/vite-plugin": "^5.0.1"
|
|
67
68
|
},
|
|
68
69
|
"publishConfig": {
|