create-asterui 0.1.5 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-asterui",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Create a new AsterUI project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,23 +1,40 @@
1
- import { Navbar, ThemeController } from 'asterui'
1
+ import { Button, useTheme, ThemeController, Hero, Space } from 'asterui'
2
2
 
3
- function App() {
3
+ function Logo() {
4
+ const { colors } = useTheme()
4
5
  return (
5
- <>
6
- <Navbar
7
- className="bg-base-100 shadow-lg"
8
- start={<a className="text-xl font-bold">AsterUI App</a>}
9
- end={<ThemeController.Swap className="scale-75" />}
10
- />
6
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40" className="h-12 w-auto">
7
+ <text
8
+ x="100"
9
+ y="30"
10
+ textAnchor="middle"
11
+ fontFamily="system-ui, -apple-system, sans-serif"
12
+ fontSize="28"
13
+ fontWeight="700"
14
+ >
15
+ <tspan fill={colors.primary}>Aster</tspan>
16
+ <tspan fill={colors.foreground}>UI</tspan>
17
+ </text>
18
+ </svg>
19
+ )
20
+ }
11
21
 
12
- <div className="p-6">
13
- <div className="max-w-4xl mx-auto">
14
- <h1 className="text-4xl font-bold mb-4">Welcome to AsterUI</h1>
15
- <p className="text-base-content/70">
16
- Start building your app by editing <code className="bg-base-300 px-1 rounded">src/App.jsx</code>
17
- </p>
18
- </div>
22
+ function App() {
23
+ return (
24
+ <Hero className="min-h-screen bg-base-200 relative">
25
+ <div className="absolute top-4 right-4">
26
+ <ThemeController.Swap />
19
27
  </div>
20
- </>
28
+ <Space direction="vertical" size="lg" align="center">
29
+ <Logo />
30
+ <p className="text-base-content/70">
31
+ 100+ React components built with DaisyUI and Tailwind CSS
32
+ </p>
33
+ <Button color="primary" href="https://asterui.com">
34
+ View Documentation
35
+ </Button>
36
+ </Space>
37
+ </Hero>
21
38
  )
22
39
  }
23
40
 
@@ -1,10 +1,13 @@
1
1
  import { StrictMode } from 'react'
2
2
  import { createRoot } from 'react-dom/client'
3
+ import { ThemeProvider } from 'asterui'
3
4
  import './index.css'
4
5
  import App from './App'
5
6
 
6
7
  createRoot(document.getElementById('root')).render(
7
8
  <StrictMode>
8
- <App />
9
+ <ThemeProvider defaultTheme="system">
10
+ <App />
11
+ </ThemeProvider>
9
12
  </StrictMode>,
10
13
  )
@@ -1,23 +1,40 @@
1
- import { Navbar, ThemeController } from 'asterui'
1
+ import { Button, useTheme, ThemeController, Hero, Space } from 'asterui'
2
2
 
3
- function App() {
3
+ function Logo() {
4
+ const { colors } = useTheme()
4
5
  return (
5
- <>
6
- <Navbar
7
- className="bg-base-100 shadow-lg"
8
- start={<a className="text-xl font-bold">AsterUI App</a>}
9
- end={<ThemeController.Swap className="scale-75" />}
10
- />
6
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40" className="h-12 w-auto">
7
+ <text
8
+ x="100"
9
+ y="30"
10
+ textAnchor="middle"
11
+ fontFamily="system-ui, -apple-system, sans-serif"
12
+ fontSize="28"
13
+ fontWeight="700"
14
+ >
15
+ <tspan fill={colors.primary}>Aster</tspan>
16
+ <tspan fill={colors.foreground}>UI</tspan>
17
+ </text>
18
+ </svg>
19
+ )
20
+ }
11
21
 
12
- <div className="p-6">
13
- <div className="max-w-4xl mx-auto">
14
- <h1 className="text-4xl font-bold mb-4">Welcome to AsterUI</h1>
15
- <p className="text-base-content/70">
16
- Start building your app by editing <code className="bg-base-300 px-1 rounded">src/App.tsx</code>
17
- </p>
18
- </div>
22
+ function App() {
23
+ return (
24
+ <Hero className="min-h-screen bg-base-200 relative">
25
+ <div className="absolute top-4 right-4">
26
+ <ThemeController.Swap />
19
27
  </div>
20
- </>
28
+ <Space direction="vertical" size="lg" align="center">
29
+ <Logo />
30
+ <p className="text-base-content/70">
31
+ 100+ React components built with DaisyUI and Tailwind CSS
32
+ </p>
33
+ <Button color="primary" href="https://asterui.com">
34
+ View Documentation
35
+ </Button>
36
+ </Space>
37
+ </Hero>
21
38
  )
22
39
  }
23
40
 
@@ -1,10 +1,13 @@
1
1
  import { StrictMode } from 'react'
2
2
  import { createRoot } from 'react-dom/client'
3
+ import { ThemeProvider } from 'asterui'
3
4
  import './index.css'
4
5
  import App from './App'
5
6
 
6
7
  createRoot(document.getElementById('root')!).render(
7
8
  <StrictMode>
8
- <App />
9
+ <ThemeProvider defaultTheme="system">
10
+ <App />
11
+ </ThemeProvider>
9
12
  </StrictMode>,
10
13
  )