m9sh 0.2.1 → 0.2.2
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.
- checksums.yaml +4 -4
- data/.idea/hotcdn.iml +30 -0
- data/.mise.toml +2 -2
- data/app/assets/config/manifest.js +4 -0
- data/app/assets/images/icons/activity.svg +3 -0
- data/app/assets/images/icons/bell.svg +4 -0
- data/app/assets/images/icons/book.svg +4 -0
- data/app/assets/images/icons/chevron-down.svg +3 -0
- data/app/assets/images/icons/chevron-left.svg +3 -0
- data/app/assets/images/icons/chevron-right.svg +3 -0
- data/app/assets/images/icons/credit-card.svg +4 -0
- data/app/assets/images/icons/dollar-sign.svg +3 -0
- data/app/assets/images/icons/edit.svg +4 -0
- data/app/assets/images/icons/github.svg +3 -0
- data/app/assets/images/icons/home.svg +4 -0
- data/app/assets/images/icons/info.svg +5 -0
- data/app/assets/images/icons/layout.svg +6 -0
- data/app/assets/images/icons/logout.svg +5 -0
- data/app/assets/images/icons/menu.svg +5 -0
- data/app/assets/images/icons/moon.svg +3 -0
- data/app/assets/images/icons/paintbrush.svg +6 -0
- data/app/assets/images/icons/search.svg +4 -0
- data/app/assets/images/icons/settings.svg +4 -0
- data/app/assets/images/icons/sun.svg +11 -0
- data/app/assets/images/icons/user.svg +4 -0
- data/app/assets/images/icons/users.svg +5 -0
- data/app/assets/stylesheets/tailwind.css +1180 -0
- data/app/components/backdrop_component.rb +103 -0
- data/app/components/docs/code_block_component.rb +56 -0
- data/app/components/docs/component_api_component.rb +16 -0
- data/app/components/docs/component_examples_component.rb +16 -0
- data/app/components/docs/component_header_component.html.erb +8 -0
- data/app/components/docs/component_header_component.rb +14 -0
- data/app/components/docs/component_installation_component.html.erb +15 -0
- data/app/components/docs/component_installation_component.rb +13 -0
- data/app/components/docs/component_page_component.html.erb +9 -0
- data/app/components/docs/component_page_component.rb +19 -0
- data/app/components/docs/component_preview_component.rb +318 -0
- data/app/components/docs/component_usage_component.rb +18 -0
- data/app/components/docs/prop_table_component.rb +64 -0
- data/app/controllers/application_controller.rb +3 -0
- data/app/controllers/blocks_controller.rb +51 -0
- data/app/controllers/docs_controller.rb +162 -0
- data/app/controllers/showcase_controller.rb +42 -0
- data/app/helpers/blocks_helper.rb +343 -0
- data/app/helpers/docs_helper.rb +3807 -0
- data/app/helpers/m9sh/toast_helper.rb +46 -0
- data/app/helpers/m9sh_helper.rb +343 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/backdrop_controller.js +137 -0
- data/app/javascript/controllers/color_customizer_controller.js +569 -0
- data/app/javascript/controllers/color_theme_controller.js +120 -0
- data/app/javascript/controllers/docs/component_preview_controller.js +149 -0
- data/app/javascript/controllers/docs/copy_button_controller.js +20 -0
- data/app/javascript/controllers/index.js +6 -0
- data/app/javascript/controllers/theme_controller.js +23 -0
- data/app/views/blocks/_sidebar.html.erb +31 -0
- data/app/views/blocks/_toc.html.erb +29 -0
- data/app/views/blocks/examples/dashboard-01.html.erb +180 -0
- data/app/views/blocks/examples/dashboard-02.html.erb +190 -0
- data/app/views/blocks/examples/dashboard-03.html.erb +210 -0
- data/app/views/blocks/examples/settings-01.html.erb +220 -0
- data/app/views/blocks/examples/settings-02.html.erb +231 -0
- data/app/views/blocks/examples/settings-03.html.erb +340 -0
- data/app/views/blocks/index.html.erb +65 -0
- data/app/views/docs/_sidebar.html.erb +47 -0
- data/app/views/docs/_toc.html.erb +19 -0
- data/app/views/docs/about.html.erb +68 -0
- data/app/views/docs/components/accordion.html.erb +196 -0
- data/app/views/docs/components/alert.html.erb +272 -0
- data/app/views/docs/components/alert_dialog.html.erb +232 -0
- data/app/views/docs/components/avatar.html.erb +207 -0
- data/app/views/docs/components/badge.html.erb +145 -0
- data/app/views/docs/components/breadcrumb.html.erb +264 -0
- data/app/views/docs/components/button.html.erb +229 -0
- data/app/views/docs/components/card.html.erb +378 -0
- data/app/views/docs/components/checkbox.html.erb +212 -0
- data/app/views/docs/components/collapsible.html.erb +252 -0
- data/app/views/docs/components/dialog.html.erb +323 -0
- data/app/views/docs/components/dropdown_menu.html.erb +289 -0
- data/app/views/docs/components/hover_card.html.erb +220 -0
- data/app/views/docs/components/input.html.erb +254 -0
- data/app/views/docs/components/label.html.erb +128 -0
- data/app/views/docs/components/main.html.erb +352 -0
- data/app/views/docs/components/navbar.html.erb +394 -0
- data/app/views/docs/components/navigation_menu.html.erb +226 -0
- data/app/views/docs/components/popover.html.erb +267 -0
- data/app/views/docs/components/progress.html.erb +107 -0
- data/app/views/docs/components/radio_group.html.erb +209 -0
- data/app/views/docs/components/select.html.erb +260 -0
- data/app/views/docs/components/separator.html.erb +162 -0
- data/app/views/docs/components/sheet.html.erb +270 -0
- data/app/views/docs/components/sidebar.html.erb +597 -0
- data/app/views/docs/components/skeleton.html.erb +150 -0
- data/app/views/docs/components/slider.html.erb +218 -0
- data/app/views/docs/components/spinner.html.erb +132 -0
- data/app/views/docs/components/switch.html.erb +148 -0
- data/app/views/docs/components/table.html.erb +259 -0
- data/app/views/docs/components/tabs.html.erb +225 -0
- data/app/views/docs/components/textarea.html.erb +239 -0
- data/app/views/docs/components/theme_toggle.html.erb +135 -0
- data/app/views/docs/components/toast.html.erb +205 -0
- data/app/views/docs/components/toaster.html.erb +227 -0
- data/app/views/docs/components/toggle.html.erb +154 -0
- data/app/views/docs/components/tooltip.html.erb +216 -0
- data/app/views/docs/components/typography.html.erb +180 -0
- data/app/views/docs/index.html.erb +143 -0
- data/app/views/docs/installation.html.erb +155 -0
- data/app/views/docs/simple_test.html.erb +13 -0
- data/app/views/docs/test_accordion.html.erb +14 -0
- data/app/views/docs/usage.html.erb +272 -0
- data/app/views/layouts/application.html.erb +107 -0
- data/app/views/layouts/backdrop.html.erb +77 -0
- data/app/views/shared/_app_navbar.html.erb +240 -0
- data/app/views/shared/_navbar.html.erb +69 -0
- data/app/views/showcase/v2/_components_grid.html.erb +38 -0
- data/app/views/showcase/v2/_features.html.erb +59 -0
- data/app/views/showcase/v2/_forms.html.erb +195 -0
- data/app/views/showcase/v2/_hero.html.erb +55 -0
- data/app/views/showcase/v2/_metrics.html.erb +107 -0
- data/app/views/showcase/v2.html.erb +18 -0
- data/lib/m9sh/version.rb +1 -1
- data/m9sh.gemspec +1 -1
- metadata +120 -1
@@ -0,0 +1,352 @@
|
|
1
|
+
<%= render Docs::ComponentPageComponent.new(title: "Main") do |page| %>
|
2
|
+
<% page.with_header(
|
3
|
+
name: "Main",
|
4
|
+
description: "A container component that creates a rounded, elevated content area with shadow effects. Perfect for creating modern, card-like layouts within sidebar applications."
|
5
|
+
) %>
|
6
|
+
|
7
|
+
<% page.with_installation(component_name: "main") %>
|
8
|
+
|
9
|
+
<% page.with_usage do %>
|
10
|
+
<%= render Docs::CodeBlockComponent.new(
|
11
|
+
code: main_usage_code,
|
12
|
+
language: "erb"
|
13
|
+
) %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% page.with_examples do %>
|
17
|
+
<!-- Basic Main Example -->
|
18
|
+
<% basic_main_html = capture do %>
|
19
|
+
<div class="h-[400px] w-full bg-sidebar flex">
|
20
|
+
<%= render M9sh::MainComponent.new do %>
|
21
|
+
<header class="flex h-14 shrink-0 items-center gap-2 px-4 border-b">
|
22
|
+
<h1 class="text-base font-semibold">Page Title</h1>
|
23
|
+
</header>
|
24
|
+
<div class="flex-1 overflow-auto p-6">
|
25
|
+
<p class="text-sm text-muted-foreground">
|
26
|
+
The Main component creates a rounded, elevated container with shadow effects.
|
27
|
+
It's designed to be used within sidebar layouts to create visual separation
|
28
|
+
between the sidebar and main content.
|
29
|
+
</p>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<%= render Docs::ComponentPreviewComponent.new(
|
36
|
+
title: "Basic Main",
|
37
|
+
preview_content: basic_main_html,
|
38
|
+
code: main_usage_code,
|
39
|
+
ai_command: main_usage_code
|
40
|
+
) %>
|
41
|
+
|
42
|
+
<!-- Main with Content Cards -->
|
43
|
+
<% main_with_cards_html = capture do %>
|
44
|
+
<div class="h-[600px] w-full bg-sidebar flex">
|
45
|
+
<%= render M9sh::MainComponent.new do %>
|
46
|
+
<header class="flex h-14 shrink-0 items-center gap-2 px-4 border-b">
|
47
|
+
<h1 class="text-base font-semibold">Dashboard</h1>
|
48
|
+
</header>
|
49
|
+
<div class="flex-1 overflow-auto p-6">
|
50
|
+
<div class="space-y-6">
|
51
|
+
<div class="rounded-3xl bg-card border border-border/50 p-8 shadow-xl">
|
52
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-3">Total Revenue</h3>
|
53
|
+
<p class="text-4xl font-bold mb-2">$1,250.00</p>
|
54
|
+
<p class="text-sm text-muted-foreground">+20.1% from last month</p>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div class="rounded-3xl bg-card border border-border/50 p-8 shadow-xl">
|
58
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-3">Active Users</h3>
|
59
|
+
<p class="text-4xl font-bold mb-2">2,350</p>
|
60
|
+
<p class="text-sm text-muted-foreground">+180.1% from last month</p>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="rounded-3xl bg-card border border-border/50 p-8 shadow-xl">
|
64
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-3">Conversion Rate</h3>
|
65
|
+
<p class="text-4xl font-bold mb-2">24.5%</p>
|
66
|
+
<p class="text-sm text-muted-foreground">+4.2% from last month</p>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
<% end %>
|
71
|
+
</div>
|
72
|
+
<% end %>
|
73
|
+
|
74
|
+
<%= render Docs::ComponentPreviewComponent.new(
|
75
|
+
title: "With Content Cards",
|
76
|
+
preview_content: main_with_cards_html,
|
77
|
+
code: main_with_cards_code,
|
78
|
+
ai_command: main_with_cards_code
|
79
|
+
) %>
|
80
|
+
|
81
|
+
<!-- Main with Sidebar Layout -->
|
82
|
+
<% main_with_sidebar_html = capture do %>
|
83
|
+
<div class="h-[600px] w-full">
|
84
|
+
<%= render M9sh::SidebarProviderComponent.new(background: :sidebar) do %>
|
85
|
+
<%= render M9sh::SidebarComponent.new(collapsible: :none, show_border: false, class: "w-64") do |sidebar| %>
|
86
|
+
<% sidebar.with_header do %>
|
87
|
+
<div class="flex items-center gap-2">
|
88
|
+
<div class="h-8 w-8 rounded-md bg-primary text-primary-foreground flex items-center justify-center font-bold">
|
89
|
+
M
|
90
|
+
</div>
|
91
|
+
<span class="font-semibold">My App</span>
|
92
|
+
</div>
|
93
|
+
<% end %>
|
94
|
+
<% sidebar.with_sidebar_content do %>
|
95
|
+
<div class="px-2 py-2">
|
96
|
+
<div class="space-y-1">
|
97
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg bg-sidebar-accent">
|
98
|
+
Dashboard
|
99
|
+
</a>
|
100
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
101
|
+
Projects
|
102
|
+
</a>
|
103
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
104
|
+
Settings
|
105
|
+
</a>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<% end %>
|
109
|
+
<% end %>
|
110
|
+
<%= render M9sh::SidebarInsetComponent.new do %>
|
111
|
+
<%= render M9sh::MainComponent.new do %>
|
112
|
+
<header class="flex h-14 shrink-0 items-center gap-2 px-4 border-b">
|
113
|
+
<h1 class="text-base font-semibold">Welcome</h1>
|
114
|
+
</header>
|
115
|
+
<div class="flex-1 overflow-auto p-6">
|
116
|
+
<div class="rounded-3xl bg-card border border-border/50 p-8 shadow-xl">
|
117
|
+
<h2 class="text-2xl font-bold mb-4">Getting Started</h2>
|
118
|
+
<p class="text-sm text-muted-foreground">
|
119
|
+
The Main component works perfectly with the Sidebar component to create
|
120
|
+
modern application layouts with visual depth and separation.
|
121
|
+
</p>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
<% end %>
|
125
|
+
<% end %>
|
126
|
+
<% end %>
|
127
|
+
</div>
|
128
|
+
<% end %>
|
129
|
+
|
130
|
+
<%= render Docs::ComponentPreviewComponent.new(
|
131
|
+
title: "With Sidebar Layout",
|
132
|
+
preview_content: main_with_sidebar_html,
|
133
|
+
code: main_with_sidebar_code,
|
134
|
+
ai_command: main_with_sidebar_code
|
135
|
+
) %>
|
136
|
+
|
137
|
+
<!-- Main with Top Navbar and Sidebar -->
|
138
|
+
<% main_with_navbar_html = capture do %>
|
139
|
+
<div class="h-[700px] w-full flex flex-col bg-sidebar">
|
140
|
+
<!-- Top Navbar -->
|
141
|
+
<header class="h-14 bg-sidebar flex items-center justify-between px-4">
|
142
|
+
<div class="flex items-center gap-4">
|
143
|
+
<div class="h-8 w-8 rounded-lg bg-sidebar-primary text-sidebar-primary-foreground flex items-center justify-center font-bold text-base">
|
144
|
+
A
|
145
|
+
</div>
|
146
|
+
<span class="text-base font-semibold text-sidebar-foreground">Acme Inc.</span>
|
147
|
+
</div>
|
148
|
+
<div class="flex items-center gap-2">
|
149
|
+
<button class="p-2 rounded-lg hover:bg-sidebar-accent transition-colors text-sidebar-foreground">
|
150
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
151
|
+
<circle cx="11" cy="11" r="8"/>
|
152
|
+
<path d="m21 21-4.35-4.35"/>
|
153
|
+
</svg>
|
154
|
+
</button>
|
155
|
+
<button class="p-2 rounded-lg hover:bg-sidebar-accent transition-colors text-sidebar-foreground">
|
156
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
157
|
+
<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/>
|
158
|
+
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>
|
159
|
+
</svg>
|
160
|
+
</button>
|
161
|
+
<button class="flex items-center gap-2 p-2 rounded-lg hover:bg-sidebar-accent transition-colors text-sidebar-foreground">
|
162
|
+
<img src="https://github.com/shadcn.png" alt="User" class="h-7 w-7 rounded-lg object-cover" />
|
163
|
+
</button>
|
164
|
+
</div>
|
165
|
+
</header>
|
166
|
+
|
167
|
+
<!-- Content Area with Sidebar -->
|
168
|
+
<div class="flex-1 flex overflow-hidden">
|
169
|
+
<%= render M9sh::SidebarProviderComponent.new(background: :sidebar) do %>
|
170
|
+
<%= render M9sh::SidebarComponent.new(collapsible: :none, show_border: false, class: "w-64") do |sidebar| %>
|
171
|
+
<% sidebar.with_sidebar_content do %>
|
172
|
+
<div class="px-2 py-2">
|
173
|
+
<div class="space-y-1">
|
174
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg bg-sidebar-accent transition-colors">
|
175
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
176
|
+
<rect width="7" height="9" x="3" y="3" rx="1"/>
|
177
|
+
<rect width="7" height="5" x="14" y="3" rx="1"/>
|
178
|
+
<rect width="7" height="9" x="14" y="12" rx="1"/>
|
179
|
+
<rect width="7" height="5" x="3" y="16" rx="1"/>
|
180
|
+
</svg>
|
181
|
+
<span>Dashboard</span>
|
182
|
+
</a>
|
183
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
184
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
185
|
+
<path d="M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z"/>
|
186
|
+
<path d="m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9"/>
|
187
|
+
<path d="M12 3v6"/>
|
188
|
+
</svg>
|
189
|
+
<span>Projects</span>
|
190
|
+
</a>
|
191
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
192
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
193
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/>
|
194
|
+
<circle cx="9" cy="7" r="4"/>
|
195
|
+
<path d="M22 21v-2a4 4 0 0 0-3-3.87"/>
|
196
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
197
|
+
</svg>
|
198
|
+
<span>Team</span>
|
199
|
+
</a>
|
200
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
201
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
202
|
+
<path d="M3 3v18h18"/>
|
203
|
+
<path d="m19 9-5 5-4-4-3 3"/>
|
204
|
+
</svg>
|
205
|
+
<span>Analytics</span>
|
206
|
+
</a>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="px-2 py-2 mt-4">
|
211
|
+
<h4 class="px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2">Resources</h4>
|
212
|
+
<div class="space-y-1">
|
213
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
214
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
215
|
+
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/>
|
216
|
+
<polyline points="14 2 14 8 20 8"/>
|
217
|
+
</svg>
|
218
|
+
<span>Documents</span>
|
219
|
+
</a>
|
220
|
+
<a href="#" class="flex items-center gap-3 px-3 py-2 text-sm font-medium rounded-lg hover:bg-sidebar-accent transition-colors">
|
221
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
222
|
+
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
|
223
|
+
<circle cx="12" cy="12" r="3"/>
|
224
|
+
</svg>
|
225
|
+
<span>Settings</span>
|
226
|
+
</a>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
<% end %>
|
230
|
+
<% end %>
|
231
|
+
<%= render M9sh::SidebarInsetComponent.new do %>
|
232
|
+
<%= render M9sh::MainComponent.new do %>
|
233
|
+
<header class="flex h-14 shrink-0 items-center gap-2 px-4 border-b">
|
234
|
+
<h1 class="text-lg font-semibold">Dashboard Overview</h1>
|
235
|
+
</header>
|
236
|
+
<div class="flex-1 overflow-auto p-6">
|
237
|
+
<div class="space-y-6">
|
238
|
+
<!-- Stats Grid -->
|
239
|
+
<div class="grid gap-4 md:grid-cols-3">
|
240
|
+
<div class="rounded-2xl bg-card border border-border/50 p-6 shadow-lg">
|
241
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-2">Total Revenue</h3>
|
242
|
+
<p class="text-3xl font-bold">$45,231</p>
|
243
|
+
<p class="text-xs text-muted-foreground mt-2">+20.1% from last month</p>
|
244
|
+
</div>
|
245
|
+
<div class="rounded-2xl bg-card border border-border/50 p-6 shadow-lg">
|
246
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-2">Active Users</h3>
|
247
|
+
<p class="text-3xl font-bold">2,350</p>
|
248
|
+
<p class="text-xs text-muted-foreground mt-2">+180.1% from last month</p>
|
249
|
+
</div>
|
250
|
+
<div class="rounded-2xl bg-card border border-border/50 p-6 shadow-lg">
|
251
|
+
<h3 class="text-sm font-medium text-muted-foreground mb-2">Sales</h3>
|
252
|
+
<p class="text-3xl font-bold">+12,234</p>
|
253
|
+
<p class="text-xs text-muted-foreground mt-2">+19% from last month</p>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<!-- Recent Activity -->
|
258
|
+
<div class="rounded-2xl bg-card border border-border/50 p-6 shadow-lg">
|
259
|
+
<h3 class="text-lg font-semibold mb-4">Recent Activity</h3>
|
260
|
+
<div class="space-y-4">
|
261
|
+
<div class="flex items-start gap-4">
|
262
|
+
<div class="h-2 w-2 rounded-full bg-primary mt-2"></div>
|
263
|
+
<div class="flex-1">
|
264
|
+
<p class="text-sm font-medium">New project created</p>
|
265
|
+
<p class="text-xs text-muted-foreground">2 minutes ago</p>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
<div class="flex items-start gap-4">
|
269
|
+
<div class="h-2 w-2 rounded-full bg-primary mt-2"></div>
|
270
|
+
<div class="flex-1">
|
271
|
+
<p class="text-sm font-medium">User invitation sent</p>
|
272
|
+
<p class="text-xs text-muted-foreground">1 hour ago</p>
|
273
|
+
</div>
|
274
|
+
</div>
|
275
|
+
<div class="flex items-start gap-4">
|
276
|
+
<div class="h-2 w-2 rounded-full bg-primary mt-2"></div>
|
277
|
+
<div class="flex-1">
|
278
|
+
<p class="text-sm font-medium">Report generated</p>
|
279
|
+
<p class="text-xs text-muted-foreground">3 hours ago</p>
|
280
|
+
</div>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
</div>
|
286
|
+
<% end %>
|
287
|
+
<% end %>
|
288
|
+
<% end %>
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
<% end %>
|
292
|
+
|
293
|
+
<%= render Docs::ComponentPreviewComponent.new(
|
294
|
+
title: "With Top Navbar and Sidebar",
|
295
|
+
preview_content: main_with_navbar_html,
|
296
|
+
code: main_with_navbar_code,
|
297
|
+
ai_command: main_with_navbar_code
|
298
|
+
) %>
|
299
|
+
<% end %>
|
300
|
+
|
301
|
+
<% page.with_api do %>
|
302
|
+
<h3 class="text-lg font-semibold">Main Component</h3>
|
303
|
+
<p class="text-sm text-muted-foreground mb-4">
|
304
|
+
The Main component is a simple container that wraps your content with styling for rounded corners,
|
305
|
+
shadows, and proper spacing. It accepts all standard HTML attributes.
|
306
|
+
</p>
|
307
|
+
|
308
|
+
<%= render Docs::PropTableComponent.new(
|
309
|
+
props: [
|
310
|
+
{
|
311
|
+
name: "class",
|
312
|
+
type: "String",
|
313
|
+
default: "nil",
|
314
|
+
description: "Additional CSS classes to apply to the component"
|
315
|
+
}
|
316
|
+
]
|
317
|
+
) %>
|
318
|
+
|
319
|
+
<div class="mt-6 space-y-2">
|
320
|
+
<h3 class="text-lg font-semibold">Styling Details</h3>
|
321
|
+
<ul class="list-disc list-inside text-sm text-muted-foreground space-y-1">
|
322
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">rounded-3xl</code> - Very pronounced rounded corners for modern aesthetic</li>
|
323
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">shadow-2xl</code> - Strong shadow for depth and elevation</li>
|
324
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">m-4</code> - Margin spacing to separate from adjacent content</li>
|
325
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">bg-background</code> - Uses theme background color</li>
|
326
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">border border-border</code> - Subtle border for definition</li>
|
327
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">overflow-hidden</code> - Clips content within rounded corners</li>
|
328
|
+
<li><code class="text-xs bg-muted px-1 py-0.5 rounded">flex-1 flex flex-col</code> - Flexbox layout for proper content flow</li>
|
329
|
+
</ul>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
<div class="mt-6 space-y-2">
|
333
|
+
<h3 class="text-lg font-semibold">Usage Notes</h3>
|
334
|
+
<ul class="list-disc list-inside text-sm text-muted-foreground space-y-1">
|
335
|
+
<li>Designed to work seamlessly with the Sidebar component for modern app layouts</li>
|
336
|
+
<li>Best used within a SidebarInsetComponent when building sidebar layouts</li>
|
337
|
+
<li>The parent container should have a contrasting background (like <code class="text-xs bg-muted px-1 py-0.5 rounded">bg-sidebar</code>) for proper depth effect</li>
|
338
|
+
<li>Works well with theme switching - all colors respond to dark/light mode</li>
|
339
|
+
<li>The component automatically handles overflow scrolling for long content</li>
|
340
|
+
<li>Combine with header/footer sections for complete page layouts</li>
|
341
|
+
</ul>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
<div class="mt-6 space-y-2">
|
345
|
+
<h3 class="text-lg font-semibold">Related Components</h3>
|
346
|
+
<ul class="list-disc list-inside text-sm text-muted-foreground space-y-1">
|
347
|
+
<li><a href="/docs/sidebar" class="text-primary hover:underline">Sidebar</a> - Navigation sidebar component</li>
|
348
|
+
<li><a href="/docs/card" class="text-primary hover:underline">Card</a> - Content card component</li>
|
349
|
+
</ul>
|
350
|
+
</div>
|
351
|
+
<% end %>
|
352
|
+
<% end %>
|