-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pheralb/next
🚀 v0.2.0
- Loading branch information
Showing
42 changed files
with
2,367 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
|
||
import react from "@astrojs/react"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [react()] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "@pheralb-toast/astro-example", | ||
"type": "module", | ||
"private": true, | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@pheralb/toast": "workspace:^", | ||
"@astrojs/check": "0.9.1", | ||
"@astrojs/react": "3.6.1", | ||
"@types/react": "18.3.3", | ||
"@types/react-dom": "18.3.0", | ||
"astro": "4.12.3", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"typescript": "5.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { toast } from '@pheralb/toast'; | ||
|
||
const ShowToast = () => { | ||
const handleClick = () => { | ||
toast.default({ | ||
text: 'Hello, world!', | ||
}); | ||
}; | ||
|
||
return ( | ||
<button type="button" onClick={handleClick}> | ||
Show Toast | ||
</button> | ||
); | ||
}; | ||
|
||
export default ShowToast; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="astro/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
interface Props { | ||
title: string; | ||
} | ||
import { Toaster } from '@pheralb/toast'; | ||
const { title } = Astro.props; | ||
--- | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="description" content="Astro description" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>{title}</title> | ||
</head> | ||
<body> | ||
<slot /> | ||
<Toaster client:load theme="light" /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import Layout from '../layouts/Layout.astro'; | ||
import ShowToast from '../components/showToast'; | ||
--- | ||
|
||
<Layout title="Welcome to Astro."> | ||
<main> | ||
<h1>Welcome to <span class="text-gradient">Astro</span></h1> | ||
<ShowToast client:load /> | ||
</main> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "react" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ToastPropsWithVariant } from '../types/toast.types'; | ||
import { openToast } from './toaster'; | ||
|
||
export const toast = { | ||
default: (data: ToastPropsWithVariant) => { | ||
openToast({ ...data }); | ||
}, | ||
success: (data: ToastPropsWithVariant) => { | ||
openToast({ ...data, variant: 'success' }); | ||
}, | ||
error: (data: ToastPropsWithVariant) => { | ||
openToast({ ...data, variant: 'error' }); | ||
}, | ||
warning: (data: ToastPropsWithVariant) => { | ||
openToast({ ...data, variant: 'warning' }); | ||
}, | ||
info: (data: ToastPropsWithVariant) => { | ||
openToast({ ...data, variant: 'info' }); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.