@greghowe79/the-lib 0.0.1

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/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Qwik Library ⚡️
2
+
3
+ - [Qwik Docs](https://qwik.dev/)
4
+ - [Discord](https://qwik.dev/chat)
5
+ - [Qwik on GitHub](https://github.com/QwikDev/qwik)
6
+ - [@QwikDev](https://twitter.com/QwikDev)
7
+ - [Vite](https://vitejs.dev/)
8
+ - [Partytown](https://partytown.builder.io/)
9
+ - [Mitosis](https://github.com/BuilderIO/mitosis)
10
+ - [Builder.io](https://www.builder.io/)
11
+
12
+ ---
13
+
14
+ ## Project Structure
15
+
16
+ Inside your project, you'll see the following directories and files:
17
+
18
+ ```
19
+ ├── public/
20
+ │ └── ...
21
+ └── src/
22
+ ├── components/
23
+ │ └── ...
24
+ └── index.ts
25
+ ```
26
+
27
+ - `src/components`: Recommended directory for components.
28
+
29
+ - `index.ts`: The entry point of your component library, make sure all the public components are exported from this file.
30
+
31
+ ## Development
32
+
33
+ Development mode uses [Vite's development server](https://vitejs.dev/). For Qwik during development, the `dev` command will also server-side render (SSR) the output. The client-side development modules are loaded by the browser.
34
+
35
+ ```
36
+ npm run dev
37
+ ```
38
+
39
+ > Note: during dev mode, Vite will request many JS files, which does not represent a Qwik production build.
40
+
41
+ ## Production
42
+
43
+ The production build should generate the production build of your component library in (./lib) and the typescript type definitions in (./lib-types).
44
+
45
+ ```
46
+ npm run build
47
+ ```
@@ -0,0 +1,24 @@
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 Counter = qwik.component$(() => {
6
+ const count = qwik.useSignal(0);
7
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
8
+ children: [
9
+ /* @__PURE__ */ jsxRuntime.jsxs("p", {
10
+ children: [
11
+ "Count: ",
12
+ count.value
13
+ ]
14
+ }),
15
+ /* @__PURE__ */ jsxRuntime.jsx("p", {
16
+ children: /* @__PURE__ */ jsxRuntime.jsx("button", {
17
+ onClick$: () => count.value++,
18
+ children: "Increment"
19
+ })
20
+ })
21
+ ]
22
+ });
23
+ });
24
+ exports.Counter = Counter;
@@ -0,0 +1,24 @@
1
+ import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$, useSignal } from "@builder.io/qwik";
3
+ const Counter = component$(() => {
4
+ const count = useSignal(0);
5
+ return /* @__PURE__ */ jsxs("div", {
6
+ children: [
7
+ /* @__PURE__ */ jsxs("p", {
8
+ children: [
9
+ "Count: ",
10
+ count.value
11
+ ]
12
+ }),
13
+ /* @__PURE__ */ jsx("p", {
14
+ children: /* @__PURE__ */ jsx("button", {
15
+ onClick$: () => count.value++,
16
+ children: "Increment"
17
+ })
18
+ })
19
+ ]
20
+ });
21
+ });
22
+ export {
23
+ Counter
24
+ };
@@ -0,0 +1,18 @@
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 Logo = qwik.component$(() => {
6
+ return /* @__PURE__ */ jsxRuntime.jsx("div", {
7
+ children: /* @__PURE__ */ jsxRuntime.jsx("a", {
8
+ href: "https://qwik.dev/",
9
+ children: /* @__PURE__ */ jsxRuntime.jsx("img", {
10
+ alt: "Qwik Logo",
11
+ width: 400,
12
+ height: 147,
13
+ src: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F667ab6c2283d4c4d878fb9083aacc10f"
14
+ })
15
+ })
16
+ });
17
+ });
18
+ exports.Logo = Logo;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$ } from "@builder.io/qwik";
3
+ const Logo = component$(() => {
4
+ return /* @__PURE__ */ jsx("div", {
5
+ children: /* @__PURE__ */ jsx("a", {
6
+ href: "https://qwik.dev/",
7
+ children: /* @__PURE__ */ jsx("img", {
8
+ alt: "Qwik Logo",
9
+ width: 400,
10
+ height: 147,
11
+ src: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F667ab6c2283d4c4d878fb9083aacc10f"
12
+ })
13
+ })
14
+ });
15
+ });
16
+ export {
17
+ Logo
18
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const logo = require("./components/logo/logo.qwik.cjs");
4
+ const counter = require("./components/counter/counter.qwik.cjs");
5
+ exports.Logo = logo.Logo;
6
+ exports.Counter = counter.Counter;
@@ -0,0 +1,6 @@
1
+ import { Logo } from "./components/logo/logo.qwik.mjs";
2
+ import { Counter } from "./components/counter/counter.qwik.mjs";
3
+ export {
4
+ Counter,
5
+ Logo
6
+ };
@@ -0,0 +1,16 @@
1
+ import { JSXNode, QRL } from '@builder.io/qwik';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'danger';
3
+ export type ButtonType = 'button' | 'submit' | 'reset';
4
+ export type ButtonSize = 'sm' | 'md' | 'lg';
5
+ export interface ButtonProps {
6
+ id: string;
7
+ label: string;
8
+ variant?: ButtonVariant;
9
+ icon?: JSXNode;
10
+ disabled?: boolean;
11
+ ariaLabel?: string;
12
+ type?: ButtonType;
13
+ size?: ButtonSize;
14
+ onClick$?: QRL<() => void>;
15
+ }
16
+ export declare const Button: import("@builder.io/qwik").Component<ButtonProps>;
@@ -0,0 +1,3 @@
1
+ export declare const buttonVariants: Record<"primary" | "secondary" | "danger", string>;
2
+ export declare const buttonSizeVariants: Record<"sm" | "md" | "lg", string>;
3
+ export declare const disabledStyle: string;
@@ -0,0 +1 @@
1
+ export declare const Counter: import("@builder.io/qwik").Component<unknown>;
@@ -0,0 +1 @@
1
+ export declare const Logo: import("@builder.io/qwik").Component<unknown>;
@@ -0,0 +1,2 @@
1
+ import { type RenderOptions } from "@builder.io/qwik";
2
+ export default function (opts: RenderOptions): Promise<import("@builder.io/qwik").RenderResult>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * SSR entry point, in all cases the application is rendered outside the browser, this
5
+ * entry point will be the common one.
6
+ *
7
+ * - Server (express, cloudflare...)
8
+ * - npm run start
9
+ * - npm run preview
10
+ * - npm run build
11
+ *
12
+ */
13
+ import { type RenderToStreamOptions } from "@builder.io/qwik/server";
14
+ export default function (opts: RenderToStreamOptions): Promise<import("@builder.io/qwik/server").RenderToStreamResult>;
@@ -0,0 +1,2 @@
1
+ export { Logo } from "./components/logo/logo";
2
+ export { Counter } from "./components/counter/counter";
@@ -0,0 +1,2 @@
1
+ declare const _default: () => import("@builder.io/qwik").JSXOutput;
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { styled } from 'styled-vanilla-extract/qwik';
2
+ export declare const header: string;
3
+ export declare const pride: string;
4
+ export declare const odd: string;
5
+ export declare const Host: ReturnType<typeof styled.div>;
6
+ export declare const Range: ReturnType<typeof styled.input>;
7
+ export declare const Square: ReturnType<typeof styled.div>;
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent } from "@builder.io/qwik";
2
+ import { DocumentHead } from "@builder.io/qwik-city";
3
+ import { Range } from "./flower.css";
4
+ type StoredInputProps<T, Cmp extends FunctionComponent, Name extends string = "value"> = Parameters<Cmp>[0] & {
5
+ store: {
6
+ [value in Name]?: T;
7
+ };
8
+ name?: Name;
9
+ };
10
+ export declare const RangeInput: <Name extends string = "value">({ store, name, ...props }: StoredInputProps<number, typeof Range, Name>) => import("@builder.io/qwik").JSXOutput;
11
+ declare const _default: import("@builder.io/qwik").Component<unknown>;
12
+ export default _default;
13
+ export declare const head: DocumentHead;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from 'storybook-framework-qwik';
2
+ import { type ButtonProps } from '../components/button/button';
3
+ declare const meta: Meta<ButtonProps>;
4
+ export default meta;
5
+ type Story = StoryObj<ButtonProps>;
6
+ export declare const Primary: Story;
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@greghowe79/the-lib",
3
+ "version": "0.0.1",
4
+ "description": "Collection of fast components for Qwik",
5
+ "main": "./lib/index.qwik.mjs",
6
+ "qwik": "./lib/index.qwik.mjs",
7
+ "types": "./lib-types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./lib/index.qwik.mjs",
11
+ "require": "./lib/index.qwik.cjs",
12
+ "types": "./lib-types/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "lib",
17
+ "lib-types"
18
+ ],
19
+ "engines": {
20
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
21
+ },
22
+ "private": false,
23
+ "type": "module",
24
+ "scripts": {
25
+ "build": "qwik build",
26
+ "build-storybook": "storybook build",
27
+ "build.lib": "vite build --mode lib",
28
+ "build.types": "tsc --emitDeclarationOnly",
29
+ "dev": "vite --mode ssr",
30
+ "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
31
+ "fmt": "prettier --write .",
32
+ "fmt.check": "prettier --check .",
33
+ "lint": "eslint \"src/**/*.ts*\"",
34
+ "release": "np",
35
+ "start": "vite --open --mode ssr",
36
+ "storybook": "storybook dev -p 6006",
37
+ "test": "echo \"No test specified\" && exit 0",
38
+ "qwik": "qwik"
39
+ },
40
+ "devDependencies": {
41
+ "@builder.io/qwik": "1.13.0",
42
+ "@storybook/addon-essentials": "^8.2.8",
43
+ "@storybook/addon-links": "^8.2.8",
44
+ "@storybook/blocks": "^8.2.8",
45
+ "@storybook/builder-vite": "^8.2.8",
46
+ "@storybook/html": "^8.2.8",
47
+ "@storybook/html-vite": "^8.2.8",
48
+ "@types/eslint": "8.56.10",
49
+ "@types/node": "20.14.11",
50
+ "@typescript-eslint/eslint-plugin": "7.16.1",
51
+ "@typescript-eslint/parser": "7.16.1",
52
+ "@vanilla-extract/css": "^1.12.0",
53
+ "eslint": "8.57.0",
54
+ "eslint-plugin-qwik": "1.13.0",
55
+ "np": "^8.0.4",
56
+ "prettier": "3.3.3",
57
+ "storybook": "^8.2.8",
58
+ "storybook-framework-qwik": "^0.4.0",
59
+ "styled-vanilla-extract": "^0.5.4",
60
+ "typescript": "5.4.5",
61
+ "undici": "*",
62
+ "vite": "5.3.5",
63
+ "vite-tsconfig-paths": "^4.2.1"
64
+ },
65
+ "dependencies": {
66
+ "@vanilla-extract/vite-plugin": "^5.0.1"
67
+ },
68
+ "publishConfig": {
69
+ "access": "public"
70
+ }
71
+ }