@mbao01/next 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,36 @@
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@mbao01/next",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "type": "module",
6
+ "author": "Ayomide Bakare",
7
+ "license": "MIT",
8
+ "description": "A fully ready-to-consume Next.js component and utility library",
9
+ "keywords": [
10
+ "react",
11
+ "components",
12
+ "ui",
13
+ "library",
14
+ "nextjs"
15
+ ],
16
+ "main": "./src/index.ts",
17
+ "types": "dist/types/index.d.ts",
18
+ "files": [
19
+ "src",
20
+ "plugin.js",
21
+ "plugin.d.ts",
22
+ "dist/types"
23
+ ],
24
+ "bugs": "https://github.com/mbao01/mbao01/issues",
25
+ "homepage": "https://next.ayomidebakare.site",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/mbao01/mbao01.git"
29
+ },
30
+ "sideEffects": [
31
+ "*.css"
32
+ ],
33
+ "dependencies": {
34
+ "clsx": "^2.1.0",
35
+ "daisyui": "^4.6.2",
36
+ "@mbao01/common": "^0.0.1"
37
+ },
38
+ "devDependencies": {
39
+ "@heroicons/react": "^2.1.1",
40
+ "@storybook/addon-essentials": "^7.6.14",
41
+ "@storybook/addon-interactions": "^7.6.14",
42
+ "@storybook/addon-links": "^7.6.14",
43
+ "@storybook/addon-onboarding": "^1.0.11",
44
+ "@storybook/addon-themes": "^7.6.14",
45
+ "@storybook/blocks": "^7.6.14",
46
+ "@storybook/nextjs": "^7.6.14",
47
+ "@storybook/react": "^7.6.14",
48
+ "@storybook/test": "^7.6.14",
49
+ "@testing-library/jest-dom": "^6.4.2",
50
+ "@testing-library/react": "^14.2.1",
51
+ "@testing-library/user-event": "^14.5.2",
52
+ "@types/node": "^20.11.17",
53
+ "@types/react": "^18.2.55",
54
+ "@types/react-dom": "^18.2.19",
55
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
56
+ "@typescript-eslint/parser": "^6.21.0",
57
+ "@vitejs/plugin-react": "^4.2.1",
58
+ "@vitest/coverage-v8": "^1.2.2",
59
+ "@vitest/ui": "^1.2.2",
60
+ "autoprefixer": "^10.4.17",
61
+ "eslint": "^8.56.0",
62
+ "eslint-config-next": "14.1.0",
63
+ "eslint-plugin-jsx-a11y": "^6.8.0",
64
+ "eslint-plugin-react": "^7.33.2",
65
+ "eslint-plugin-react-hooks": "^4.6.0",
66
+ "eslint-plugin-react-refresh": "^0.4.5",
67
+ "eslint-plugin-storybook": "^0.6.15",
68
+ "jsdom": "^23.2.0",
69
+ "next": "^14.1.0",
70
+ "path": "^0.12.7",
71
+ "postcss": "^8.4.35",
72
+ "react": "^18.2.0",
73
+ "react-dom": "^18.2.0",
74
+ "react-router-dom": "^6.22.0",
75
+ "storybook": "^7.6.14",
76
+ "tailwindcss": "^3.4.1",
77
+ "typescript": "^5.3.3",
78
+ "vite": "^5.1.1",
79
+ "vite-plugin-dts": "^3.7.2",
80
+ "vitest": "^1.2.2"
81
+ },
82
+ "peerDependencies": {
83
+ "@heroicons/react": "^2.1.1",
84
+ "next": "^14.1.0",
85
+ "react": "^18.2.0",
86
+ "react-dom": "^18.2.0",
87
+ "typescript": "^5.2.2"
88
+ },
89
+ "scripts": {
90
+ "dev": "storybook dev -p 6006",
91
+ "build": "next build",
92
+ "build-storybook": "storybook build",
93
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
94
+ "preview": "next dev",
95
+ "start": "next start",
96
+ "test": "vitest run",
97
+ "test:ui": "vitest --ui",
98
+ "test:watch": "vitest",
99
+ "test:coverage": "vitest run --coverage"
100
+ }
101
+ }
package/plugin.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { Config } from "tailwindcss";
2
+
3
+ declare const plugin: { handler: () => void; config?: Config };
4
+ export = plugin;
package/plugin.js ADDED
@@ -0,0 +1,3 @@
1
+ const daisyui = require("daisyui");
2
+
3
+ module.exports = daisyui;
Binary file
@@ -0,0 +1,22 @@
1
+ import type { Metadata } from "next";
2
+ import { Inter } from "next/font/google";
3
+ import "../tailwind.css";
4
+
5
+ const inter = Inter({ subsets: ["latin"] });
6
+
7
+ export const metadata: Metadata = {
8
+ title: "Create Next App",
9
+ description: "Generated by create next app",
10
+ };
11
+
12
+ export default function RootLayout({
13
+ children,
14
+ }: Readonly<{
15
+ children: React.ReactNode;
16
+ }>) {
17
+ return (
18
+ <html lang="en">
19
+ <body className={inter.className}>{children}</body>
20
+ </html>
21
+ );
22
+ }
@@ -0,0 +1,3 @@
1
+ export default function Home() {
2
+ return <main>hey 👋</main>;
3
+ }
@@ -0,0 +1,29 @@
1
+ import c from "clsx";
2
+ import { getBadgeClasses } from "./constants";
3
+ import { type BadgeProps } from "./types";
4
+ import "../../tailwind.css"; // replace with the name of your tailwind css file
5
+
6
+ export const Badge = ({
7
+ size,
8
+ outline,
9
+ variant = "ghost",
10
+ children,
11
+ className,
12
+ ...props
13
+ }: BadgeProps) => {
14
+ return (
15
+ <span
16
+ {...props}
17
+ className={c(
18
+ getBadgeClasses({ size, variant }),
19
+ {
20
+ "badge-outline": outline,
21
+ "text-base-200": !["ghost", "neutral"].includes(variant),
22
+ },
23
+ className
24
+ )}
25
+ >
26
+ {children}
27
+ </span>
28
+ );
29
+ };
@@ -0,0 +1,31 @@
1
+ import c from "clsx";
2
+ import type { BadgeSize, BadgeVariant } from "./types";
3
+
4
+ const BADGE_SIZE = {
5
+ xs: c("badge-xs"),
6
+ sm: c("badge-sm"),
7
+ md: c("badge-md"),
8
+ lg: c("badge-lg"),
9
+ } satisfies Record<BadgeSize, string>;
10
+
11
+ const BADGE_VARIANTS = {
12
+ accent: c("badge-accent"),
13
+ error: c("badge-error"),
14
+ ghost: c("badge-ghost"),
15
+ info: c("badge-info"),
16
+ neutral: c("badge-neutral"),
17
+ primary: c("badge-primary"),
18
+ secondary: c("badge-secondary"),
19
+ success: c("badge-success"),
20
+ warning: c("badge-warning"),
21
+ } satisfies Record<BadgeVariant, string>;
22
+
23
+ export const getBadgeClasses = ({
24
+ size,
25
+ variant,
26
+ }: {
27
+ size?: BadgeSize;
28
+ variant?: BadgeVariant;
29
+ }) => {
30
+ return c("badge", BADGE_VARIANTS[variant!], BADGE_SIZE[size!]);
31
+ };
@@ -0,0 +1 @@
1
+ export { Badge } from './Badge';
@@ -0,0 +1,18 @@
1
+ export type BadgeSize = "xs" | "sm" | "md" | "lg";
2
+
3
+ export type BadgeVariant =
4
+ | "neutral"
5
+ | "primary"
6
+ | "secondary"
7
+ | "accent"
8
+ | "ghost"
9
+ | "info"
10
+ | "success"
11
+ | "warning"
12
+ | "error";
13
+
14
+ export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
15
+ size?: BadgeSize;
16
+ outline?: boolean;
17
+ variant?: BadgeVariant;
18
+ };
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./components/Badge";