Skip to content

Commit 5810685

Browse files
authored
Merge pull request #1 from pheralb/next
🚀 v0.2.0
2 parents f6279a0 + cc8d3e2 commit 5810685

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2367
-369
lines changed

.changeset/config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": ["@pheralb/toast-website"]
10+
"ignore": [
11+
"@pheralb/toast-website",
12+
"@pheralb-toast/nextjs-example",
13+
"@pheralb-toast/astro-example"
14+
]
1115
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
# Astro
4+
.astro
5+
36
# Dependencies
47
node_modules
58
.pnp

examples/astro/astro.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'astro/config';
2+
3+
import react from "@astrojs/react";
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [react()]
8+
});

examples/astro/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@pheralb-toast/astro-example",
3+
"type": "module",
4+
"private": true,
5+
"version": "0.0.1",
6+
"scripts": {
7+
"dev": "astro dev",
8+
"start": "astro dev",
9+
"build": "astro check && astro build",
10+
"preview": "astro preview",
11+
"astro": "astro"
12+
},
13+
"dependencies": {
14+
"@pheralb/toast": "workspace:^",
15+
"@astrojs/check": "0.9.1",
16+
"@astrojs/react": "3.6.1",
17+
"@types/react": "18.3.3",
18+
"@types/react-dom": "18.3.0",
19+
"astro": "4.12.3",
20+
"react": "18.3.1",
21+
"react-dom": "18.3.1",
22+
"typescript": "5.5.4"
23+
}
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { toast } from '@pheralb/toast';
2+
3+
const ShowToast = () => {
4+
const handleClick = () => {
5+
toast.default({
6+
text: 'Hello, world!',
7+
});
8+
};
9+
10+
return (
11+
<button type="button" onClick={handleClick}>
12+
Show Toast
13+
</button>
14+
);
15+
};
16+
17+
export default ShowToast;

examples/astro/src/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="astro/client" />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
interface Props {
3+
title: string;
4+
}
5+
6+
import { Toaster } from '@pheralb/toast';
7+
8+
const { title } = Astro.props;
9+
---
10+
11+
<!doctype html>
12+
<html lang="en">
13+
<head>
14+
<meta charset="UTF-8" />
15+
<meta name="description" content="Astro description" />
16+
<meta name="viewport" content="width=device-width" />
17+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
18+
<meta name="generator" content={Astro.generator} />
19+
<title>{title}</title>
20+
</head>
21+
<body>
22+
<slot />
23+
<Toaster client:load theme="light" />
24+
</body>
25+
</html>

examples/astro/src/pages/index.astro

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import ShowToast from '../components/showToast';
4+
---
5+
6+
<Layout title="Welcome to Astro.">
7+
<main>
8+
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
9+
<ShowToast client:load />
10+
</main>
11+
</Layout>

examples/astro/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"compilerOptions": {
4+
"jsx": "react-jsx",
5+
"jsxImportSource": "react"
6+
}
7+
}

examples/nextjs/src/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export default function RootLayout({
2626
enableSystem
2727
disableTransitionOnChange
2828
>
29-
<ToastClientProvider>{children}</ToastClientProvider>
29+
<ToastClientProvider />
30+
{children}
3031
</ThemeProvider>
3132
</body>
3233
</html>

0 commit comments

Comments
 (0)