Skip to content

Commit 5ad9e4f

Browse files
committed
feat: add base structure for leaf zero
1 parent 66b88ba commit 5ad9e4f

File tree

11 files changed

+1012
-17
lines changed

11 files changed

+1012
-17
lines changed

.vitepress/config/sidebar.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,23 @@ const sidebar = [
142142
{ text: 'Tailwind CSS', link: '/docs/frontend/tailwind' },
143143
{ text: 'Inertia JS', link: '/docs/frontend/inertia' },
144144
// { text: 'Leaf UI', link: '/docs/frontend/leaf-ui' },
145-
// {
146-
// text: 'Leaf Zero',
147-
// collapsible: true,
148-
// collapsed: true,
149-
// items: [
150-
// { text: 'Introduction', link: '/docs/frontend/zero/' },
151-
// { text: 'Layouts', link: '/docs/frontend/zero/layouts' },
152-
// { text: 'Forms', link: '/docs/frontend/zero/forms' },
153-
// { text: 'Modals', link: '/docs/frontend/zero/modals' },
154-
// { text: 'Alerts', link: '/docs/frontend/zero/alerts' },
155-
// { text: 'Loading', link: '/docs/frontend/zero/loading' },
156-
// { text: 'Icons', link: '/docs/frontend/zero/icons' },
157-
// { text: 'Forms', link: '/docs/frontend/zero/forms' },
158-
// { text: 'Merketing Sections', link: '/docs/frontend/zero/marketing' },
159-
// { text: 'Dashboard Sections', link: '/docs/frontend/zero/dashboard' },
160-
// ],
161-
// },
145+
{
146+
text: 'Leaf Zero',
147+
collapsible: true,
148+
collapsed: true,
149+
items: [
150+
{ text: 'Introduction', link: '/docs/frontend/zero/' },
151+
// { text: 'Layouts', link: '/docs/frontend/zero/layouts' },
152+
{ text: 'Forms', link: '/docs/frontend/zero/forms' },
153+
// { text: 'Modals', link: '/docs/frontend/zero/modals' },
154+
// { text: 'Alerts', link: '/docs/frontend/zero/alerts' },
155+
// { text: 'Loading', link: '/docs/frontend/zero/loading' },
156+
{ text: 'Icons', link: '/docs/frontend/zero/icons' },
157+
// { text: 'Forms', link: '/docs/frontend/zero/forms' },
158+
{ text: 'Merketing Sections', link: '/docs/frontend/zero/marketing' },
159+
// { text: 'Dashboard Sections', link: '/docs/frontend/zero/dashboard' },
160+
],
161+
},
162162
],
163163
},
164164
{

src/docs/frontend/zero/alerts.md

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

src/docs/frontend/zero/dashboard.md

Lines changed: 79 additions & 0 deletions
Large diffs are not rendered by default.

src/docs/frontend/zero/form-components.md

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

src/docs/frontend/zero/forms.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
aside: false
3+
---
4+
5+
# Form sections & components
6+
7+
<!-- markdownlint-disable no-inline-html -->
8+
<script setup>
9+
import PreviewCode from '@theme/components/shared/PreviewCode.vue';
10+
import TutorialNumber from '@theme/components/shared/TutorialNumber.vue';
11+
</script>
12+
13+
Login, signup, contact forms, and more are essential parts of any web application. Leaf Zero provides a set of example forms that you can use to build forms quickly and easily.
14+
15+
## Auth Forms
16+
17+
Drop in replacements for Leaf MVC auth layouts and auth forms.
18+
19+
::: details Auth Centred <img src="https://github.com/user-attachments/assets/b1397a2e-d1ab-4b35-b2a3-d055cc8918d0" class="w-full h-full rounded-lg" lazy />
20+
21+
::: code-group
22+
23+
```blade [Blade]
24+
something
25+
```
26+
27+
```jsx [React]
28+
something
29+
```
30+
31+
```vue [Vue]
32+
something
33+
```
34+
35+
```svelte [Svelte]
36+
something
37+
```
38+
39+
:::
40+
41+
::: details Form right half <img src="https://github.com/user-attachments/assets/b1397a2e-d1ab-4b35-b2a3-d055cc8918d0" class="w-full h-full rounded-lg" lazy />
42+
43+
::: code-group
44+
45+
```blade [Blade]
46+
something
47+
```
48+
49+
```jsx [React]
50+
something
51+
```
52+
53+
```vue [Vue]
54+
something
55+
```
56+
57+
```svelte [Svelte]
58+
something
59+
```
60+
61+
:::
62+
63+
## Form Components
64+
65+
Form components for use in all kinds of applications.
66+
67+
::: details Input Component <img src="https://github.com/user-attachments/assets/b1397a2e-d1ab-4b35-b2a3-d055cc8918d0" class="w-full h-full rounded-lg" lazy />
68+
69+
::: code-group
70+
71+
```blade [Blade]
72+
something
73+
```
74+
75+
```jsx [React]
76+
something
77+
```
78+
79+
```vue [Vue]
80+
something
81+
```
82+
83+
```svelte [Svelte]
84+
something
85+
```
86+
87+
:::
88+
89+
::: details Button Component <img src="https://github.com/user-attachments/assets/b1397a2e-d1ab-4b35-b2a3-d055cc8918d0" class="w-full h-full rounded-lg" lazy />
90+
91+
::: code-group
92+
93+
```blade [Blade]
94+
something
95+
```
96+
97+
```jsx [React]
98+
something
99+
```
100+
101+
```vue [Vue]
102+
something
103+
```
104+
105+
```svelte [Svelte]
106+
something
107+
```
108+
109+
:::

src/docs/frontend/zero/icons.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
aside: false
3+
---
4+
5+
<!-- markdownlint-disable no-inline-html -->
6+
7+
# Icons for Blade <Badge type="warning">Blade Only</Badge>
8+
9+
Zero provides a wrapper around [HeroIcons](https://heroicons.com/) which allows you to use every HeroIcon right in your Blade component. To get started, you need to install Zero through composer:
10+
11+
::: code-group
12+
13+
```bash:no-line-numbers [Leaf CLI]
14+
leaf install zero
15+
```
16+
17+
```bash:no-line-numbers [Composer]
18+
composer require leafs/zero
19+
```
20+
21+
:::
22+
23+
## Usage
24+
25+
You can use the `@icon` directive to render an icon in your Blade component. The `icon` method accepts the name of the icon you want to render. You can find the name of the icon you want to render on the [HeroIcons website](https://heroicons.com/).
26+
27+
```blade:no-line-numbers
28+
@icon('academic-cap')
29+
```
30+
31+
You can also pass extra options like a class or style to the icon:
32+
33+
```blade:no-line-numbers
34+
@icon('academic-cap', ['class' => 'text-red-500', 'style' => 'font-size: 2rem;'])
35+
```
36+
37+
If you need to render an icon as text, so you can use it in JavaScript, you can use the `@iconText` directive:
38+
39+
```blade:no-line-numbers
40+
@iconText('academic-cap')
41+
```

src/docs/frontend/zero/index.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
outline: 'deep'
3+
---
4+
5+
<!-- markdownlint-disable no-inline-html -->
6+
7+
# Leaf Zero <Badge>NEW</Badge>
8+
9+
<script setup>
10+
import TutorialNumber from '@theme/components/shared/TutorialNumber.vue';
11+
</script>
12+
13+
A free collection of pre-built components, page sections, and templates designed to help you build faster. With Tailwind for styling, Alpine.js/React/Vue/Svelte for interactivity, and ready-to-use Blade and PHP snippets, you can skip the boilerplate and focus on shipping. Just copy, paste, and customize—whether you're building a landing page or a full app, Leaf Zero gives you the building blocks to move fast.
14+
15+
::: info Zero UI Support
16+
17+
We try to provide support for Alpine, React, Vue and Svelte on every component, however, some things like Modals, Toasts and Icons are currently Blade/Alpine only. We will add support for React, Vue and Svelte later, but for now Shadcn UI has a ton of components you can use with React, Vue and Svelte.
18+
19+
:::
20+
21+
## Page Sections
22+
23+
Find page sections like headers, footers, features, pricing, and more. Each section is a standalone component that you can mix and match to create your own custom pages.
24+
25+
- [Marketing page Sections](/docs/frontend/zero/marketing)
26+
<!-- - [Dashboard Sections](/docs/frontend/zero/dashboard)
27+
- [Form sections](/docs/frontend/zero/forms)
28+
- [Application Layouts](/docs/frontend/zero/layouts) -->
29+
30+
## Components & Examples
31+
32+
Zero also includes everyday components to help you build faster and easier.
33+
34+
- [Form components](/docs/frontend/zero/forms)
35+
- [Icons](/docs/frontend/zero/icons)
36+
<!-- - [Toasts](/docs/frontend/zero/toasts)
37+
- [Pagination](/docs/frontend/zero/pagination)
38+
- [Modals](/docs/frontend/zero/modals)
39+
- [Application states](/docs/frontend/zero/loading) -->
40+
41+
<!-- ## Pre-release UI Snippets
42+
43+
We are working on more sections, components and UI snippets which we will add here over the next few weeks, however, you can get all of these plus some full-page templates by purchasing [Paperplane](https://paperplane.leafphp.dev) -->

0 commit comments

Comments
 (0)