{source}+
diff --git a/playground/astro/astro.config.js b/playground/astro/astro.config.js
index 3b48877..3db05ec 100644
--- a/playground/astro/astro.config.js
+++ b/playground/astro/astro.config.js
@@ -17,7 +17,7 @@ export default defineConfig({
plugins: [
inspect(),
whyframe({
- defaultSrc: '/frames/basic',
+ defaultSrc: '/frames/default',
components: [{ name: 'Story', showSource: true }]
}),
whyframeAstro({
diff --git a/playground/astro/package.json b/playground/astro/package.json
index 4f597b4..1c157bd 100644
--- a/playground/astro/package.json
+++ b/playground/astro/package.json
@@ -28,7 +28,6 @@
"@whyframe/svelte": "^0.1.5",
"@whyframe/vue": "^0.1.3",
"astro": "^1.6.3",
- "preact-render-to-string": "^5.2.6",
"svelte": "^3.52.0",
"vite-plugin-inspect": "^0.7.7"
}
diff --git a/playground/astro/public/astro.svg b/playground/astro/public/astro.svg
new file mode 100644
index 0000000..d798789
--- /dev/null
+++ b/playground/astro/public/astro.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/playground/astro/src/assets/whyframe.svg b/playground/astro/src/assets/whyframe.svg
new file mode 100644
index 0000000..f12447b
--- /dev/null
+++ b/playground/astro/src/assets/whyframe.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/playground/astro/src/components/Counter.module.css b/playground/astro/src/components/Counter.module.css
deleted file mode 100644
index 81333c3..0000000
--- a/playground/astro/src/components/Counter.module.css
+++ /dev/null
@@ -1,21 +0,0 @@
-.counter {
- border-radius: 8px;
- border: 1px solid transparent;
- padding: 0.6em 1.2em;
- font-size: 1em;
- font-weight: 500;
- font-family: inherit;
- background-color: #f9f9f9;
- cursor: pointer;
- transition: background-color 0.2s, border-color 0.25s;
-}
-
-.counter:hover {
- background-color: #ced1ff;
- border-color: #646cff;
-}
-
-.counter:focus,
-.counter:focus-visible {
- outline: 4px auto -webkit-focus-ring-color;
-}
diff --git a/playground/astro/src/components/Counter.svelte b/playground/astro/src/components/Counter.svelte
deleted file mode 100644
index d714e7e..0000000
--- a/playground/astro/src/components/Counter.svelte
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
diff --git a/playground/astro/src/components/Counter.vue b/playground/astro/src/components/Counter.vue
deleted file mode 100644
index 5c65009..0000000
--- a/playground/astro/src/components/Counter.vue
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
diff --git a/playground/astro/src/components/CounterPreact.jsx b/playground/astro/src/components/CounterPreact.jsx
deleted file mode 100644
index ae8ed44..0000000
--- a/playground/astro/src/components/CounterPreact.jsx
+++ /dev/null
@@ -1,23 +0,0 @@
-/** @jsxImportSource preact */
-import { useState } from 'preact/hooks'
-import { counter } from './Counter.module.css'
-
-export function Counter({ max = 0, onMax }) {
- const [count, setCount] = useState(0)
-
- const increment = () => {
- if (max !== 0 && count >= max) {
- onMax?.()
- document.body.style.backgroundColor = 'pink'
- alert('🚨 YOU HAVE BEEN WARNED 🚨')
- return
- }
- setCount(count + 1)
- }
-
- return (
-
- )
-}
diff --git a/playground/astro/src/components/CounterReact.jsx b/playground/astro/src/components/CounterReact.jsx
deleted file mode 100644
index 08d82ba..0000000
--- a/playground/astro/src/components/CounterReact.jsx
+++ /dev/null
@@ -1,23 +0,0 @@
-/** @jsxImportSource react */
-import { useState } from 'react'
-import { counter } from './Counter.module.css'
-
-export function Counter({ max = 0, onMax }) {
- const [count, setCount] = useState(0)
-
- const increment = () => {
- if (max !== 0 && count >= max) {
- onMax?.()
- document.body.style.backgroundColor = 'pink'
- alert('🚨 YOU HAVE BEEN WARNED 🚨')
- return
- }
- setCount(count + 1)
- }
-
- return (
-
- )
-}
diff --git a/playground/astro/src/components/CounterSolid.jsx b/playground/astro/src/components/CounterSolid.jsx
deleted file mode 100644
index 34067d6..0000000
--- a/playground/astro/src/components/CounterSolid.jsx
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @jsxImportSource solid-js */
-import { createSignal } from 'solid-js'
-import { counter } from './Counter.module.css'
-
-export function Counter(props) {
- const [count, setCount] = createSignal(0)
-
- const increment = () => {
- const newCount = count() + 1
- if (newCount > (props.max ?? Infinity)) {
- props.onMax?.()
- document.body.style.backgroundColor = 'pink'
- alert('🚨 YOU HAVE BEEN WARNED 🚨')
- return
- }
- setCount(newCount)
- }
-
- return (
-
- )
-}
diff --git a/playground/astro/src/components/Popup.module.css b/playground/astro/src/components/Popup.module.css
new file mode 100644
index 0000000..cb3fce9
--- /dev/null
+++ b/playground/astro/src/components/Popup.module.css
@@ -0,0 +1,44 @@
+.activator {
+ display: block;
+ border-radius: 8px;
+ border: 1px solid transparent;
+ padding: 0.5em 1em;
+ font-size: 0.9em;
+ font-weight: 500;
+ font-family: inherit;
+ color: #efefef;
+ background-color: #1e1e1e;
+ cursor: pointer;
+ transition: border-color 0.25s;
+}
+
+.activator:hover {
+ border-color: #ffed24;
+}
+
+.activator:focus,
+.activator:focus-visible {
+ outline: 4px auto -webkit-focus-ring-color;
+}
+
+.background {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+ background-color: #090909;
+ color: #efefef;
+ font-size: 1.5rem;
+ opacity: 0.8;
+ z-index: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.background:focus,
+.background:focus-visible {
+ border: 4px solid #ffed24;
+}
diff --git a/playground/astro/src/components/Popup.svelte b/playground/astro/src/components/Popup.svelte
new file mode 100644
index 0000000..add1c49
--- /dev/null
+++ b/playground/astro/src/components/Popup.svelte
@@ -0,0 +1,67 @@
+
+
+
+
+{#if open}
+
+{/if}
+
+
diff --git a/playground/astro/src/components/Popup.vue b/playground/astro/src/components/Popup.vue
new file mode 100644
index 0000000..7f21bb9
--- /dev/null
+++ b/playground/astro/src/components/Popup.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
diff --git a/playground/astro/src/components/PopupPreact.jsx b/playground/astro/src/components/PopupPreact.jsx
new file mode 100644
index 0000000..c7caee7
--- /dev/null
+++ b/playground/astro/src/components/PopupPreact.jsx
@@ -0,0 +1,27 @@
+import { useState } from 'preact/hooks'
+import style from './Popup.module.css'
+
+/**
+ * @param {{ content: string, children: any }} props
+ */
+export default function Popup({ content, children }) {
+ const [open, setOpen] = useState(false)
+
+ return (
+ <>
+
+
+ {open && (
+
+ )}
+ >
+ )
+}
diff --git a/playground/astro/src/components/PopupReact.jsx b/playground/astro/src/components/PopupReact.jsx
new file mode 100644
index 0000000..7c5865e
--- /dev/null
+++ b/playground/astro/src/components/PopupReact.jsx
@@ -0,0 +1,27 @@
+import { useState } from 'react'
+import style from './Popup.module.css'
+
+/**
+ * @param {{ content: string, children: any }} props
+ */
+export default function Popup({ content, children }) {
+ const [open, setOpen] = useState(false)
+
+ return (
+ <>
+
+
+ {open && (
+
+ )}
+ >
+ )
+}
diff --git a/playground/astro/src/components/PopupSolid.jsx b/playground/astro/src/components/PopupSolid.jsx
new file mode 100644
index 0000000..cb4a217
--- /dev/null
+++ b/playground/astro/src/components/PopupSolid.jsx
@@ -0,0 +1,27 @@
+import { createSignal, Show } from 'solid-js'
+import style from './Popup.module.css'
+
+/**
+ * @param {{ content: string, children: any }} props
+ */
+export default function Popup(props) {
+ const [open, setOpen] = createSignal(false)
+
+ return (
+ <>
+
+
+
- This is a story of {Astro.props.title}: -
- - -{source}+
+ Check out the examples below to see component isolation in action!
+
+ You can view the source code at src/pages/index.astro
.
+
+ Click on the logos above to learn more.
+
This is a Story component
+This is a Story component
+This is a Story component
+This is a Story component
+Click to increment!
-Do not go over {max}
-This is a Story component
+