Skip to content

Commit 3d5dff8

Browse files
authored
Merge pull request #23 from substancelab/site
Create a site
2 parents 37809f2 + e296f04 commit 3d5dff8

File tree

12 files changed

+256
-21
lines changed

12 files changed

+256
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
/tmp/
99

1010
/demo/app/assets/builds
11+
/demo/build
1112
/demo/storage/*.sqlite3
1213
/demo/tmp/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Add Flowbite to your Tailwind CSS configuration. In your `app/assets/tailwind/ap
5252
```css
5353
@import "flowbite/src/themes/default";
5454
@plugin "flowbite/plugin";
55-
@import "../builds/tailwind/flowbite-components";
55+
@import "../builds/tailwind/flowbite_components";
5656
```
5757

5858
## Usage examples
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Parklife
2+
3+
on:
4+
# Run on every push.
5+
push:
6+
# Allow manually triggering a build.
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
bundler-cache: true
22+
- uses: actions/configure-pages@v5
23+
id: pages
24+
25+
# Build with Parklife and use its GitHub Pages URL (either its custom
26+
# domain or username.github.io/repository).
27+
- run: bin/static-build --base "${{ steps.pages.outputs.base_url }}"
28+
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v3
31+
if: github.ref == 'refs/heads/main' # Only upload on main branch.
32+
with:
33+
path: build/
34+
35+
deploy:
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
runs-on: ubuntu-latest
40+
needs: build
41+
if: github.ref == 'refs/heads/main' # Only deploy on main branch.
42+
concurrency:
43+
group: deploy
44+
cancel-in-progress: true
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

demo/Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ gem "puma", ">= 5.0"
1313
gem "tzinfo-data", platforms: %i[windows jruby]
1414

1515
gem "flowbite-components", path: "../.." # Load the gem files from the parent directory
16-
gem "tailwindcss-rails", "~> 4.0.0"
16+
gem "tailwindcss-rails", "~> 4.3"
17+
18+
gem "parklife"
1719

1820
group :development, :test do
1921
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem

demo/Gemfile.lock

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ GEM
9494
irb (~> 1.10)
9595
reline (>= 0.3.8)
9696
drb (2.2.3)
97+
erb (5.0.2)
9798
erubi (1.13.1)
9899
ffi (1.17.2-aarch64-linux-gnu)
99100
ffi (1.17.2-aarch64-linux-musl)
@@ -109,7 +110,7 @@ GEM
109110
htmlentities (4.3.4)
110111
i18n (1.14.7)
111112
concurrent-ruby (~> 1.0)
112-
io-console (0.8.0)
113+
io-console (0.8.1)
113114
irb (1.15.2)
114115
pp (>= 0.6.0)
115116
rdoc (>= 4.0.0)
@@ -167,6 +168,10 @@ GEM
167168
racc (~> 1.4)
168169
nokogiri (1.18.9-x86_64-linux-musl)
169170
racc (~> 1.4)
171+
parklife (0.7.0)
172+
nokogiri
173+
rack-test
174+
thor
170175
pp (0.6.2)
171176
prettyprint
172177
prettyprint (0.2.0)
@@ -175,7 +180,7 @@ GEM
175180
activesupport (>= 7.0.0)
176181
rack
177182
railties (>= 7.0.0)
178-
psych (5.2.3)
183+
psych (5.2.6)
179184
date
180185
stringio
181186
public_suffix (6.0.2)
@@ -219,14 +224,15 @@ GEM
219224
rake (>= 12.2)
220225
thor (~> 1.0, >= 1.2.2)
221226
zeitwerk (~> 2.6)
222-
rake (13.2.1)
227+
rake (13.3.0)
223228
rb-fsevent (0.11.2)
224229
rb-inotify (0.11.1)
225230
ffi (~> 1.0)
226-
rdoc (6.13.1)
231+
rdoc (6.14.2)
232+
erb
227233
psych (>= 4.0.0)
228234
redcarpet (3.6.1)
229-
reline (0.6.1)
235+
reline (0.6.2)
230236
io-console (~> 0.5)
231237
rouge (4.5.2)
232238
securerandom (0.4.1)
@@ -239,31 +245,31 @@ GEM
239245
sqlite3 (2.6.0-x86_64-linux-gnu)
240246
sqlite3 (2.6.0-x86_64-linux-musl)
241247
stringio (3.1.7)
242-
tailwindcss-rails (4.0.0)
248+
tailwindcss-rails (4.3.0)
243249
railties (>= 7.0.0)
244250
tailwindcss-ruby (~> 4.0)
245-
tailwindcss-ruby (4.1.10)
246-
tailwindcss-ruby (4.1.10-aarch64-linux-gnu)
247-
tailwindcss-ruby (4.1.10-aarch64-linux-musl)
248-
tailwindcss-ruby (4.1.10-arm64-darwin)
249-
tailwindcss-ruby (4.1.10-x86_64-darwin)
250-
tailwindcss-ruby (4.1.10-x86_64-linux-gnu)
251-
tailwindcss-ruby (4.1.10-x86_64-linux-musl)
251+
tailwindcss-ruby (4.1.11)
252+
tailwindcss-ruby (4.1.11-aarch64-linux-gnu)
253+
tailwindcss-ruby (4.1.11-aarch64-linux-musl)
254+
tailwindcss-ruby (4.1.11-arm64-darwin)
255+
tailwindcss-ruby (4.1.11-x86_64-darwin)
256+
tailwindcss-ruby (4.1.11-x86_64-linux-gnu)
257+
tailwindcss-ruby (4.1.11-x86_64-linux-musl)
252258
thor (1.4.0)
253259
timeout (0.4.3)
254260
tzinfo (2.0.6)
255261
concurrent-ruby (~> 1.0)
256262
uri (1.0.3)
257263
useragent (0.16.11)
258-
view_component (4.0.1)
264+
view_component (4.0.2)
259265
activesupport (>= 7.1.0, < 8.1)
260266
concurrent-ruby (~> 1)
261267
websocket-driver (0.7.7)
262268
base64
263269
websocket-extensions (>= 0.1.0)
264270
websocket-extensions (0.1.5)
265271
yard (0.9.37)
266-
zeitwerk (2.7.2)
272+
zeitwerk (2.7.3)
267273

268274
PLATFORMS
269275
aarch64-linux
@@ -282,11 +288,12 @@ DEPENDENCIES
282288
flowbite-components!
283289
listen
284290
lookbook (>= 2.3.11)
291+
parklife
285292
propshaft
286293
puma (>= 5.0)
287294
rails (~> 8.0.2)
288295
sqlite3 (>= 2.1)
289-
tailwindcss-rails (~> 4.0.0)
296+
tailwindcss-rails (~> 4.3)
290297
tzinfo-data
291298

292299
BUNDLED WITH

demo/Parkfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'parklife/rails'
2+
require_relative 'config/environment'
3+
4+
Parklife.application.configure do |config|
5+
# Serve trailing slash-less URLs from GitHub Pages.
6+
config.nested_index = false
7+
8+
# See configuration options here:
9+
# https://github.com/benpickles/parklife#configuration
10+
end
11+
12+
Parklife.application.routes do
13+
root crawl: true
14+
15+
# Add further paths not discovered by crawling from the root - Parklife's
16+
# Rails integration lets you use the app's route helpers:
17+
#
18+
# get hidden_pages_path, crawl: true
19+
# get feed_path(format: :atom)
20+
21+
# Services typically allow a custom 404 page.
22+
# get '/404.html'
23+
end

demo/app/assets/tailwind/application.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
@plugin "flowbite/plugin";
66

77
/* Include CSS classes used by the components in the final CSS */
8-
@source "../../../../app/components/flowbite";
8+
@import "../builds/tailwind/flowbite_components";
9+
10+
footer a {
11+
@apply font-medium text-blue-600 dark:text-blue-500 hover:underline;
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class PagesController < ApplicationController
2+
def index
3+
end
4+
end

demo/app/views/layouts/application.html.erb

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,57 @@
2222
</head>
2323

2424
<body>
25+
<header>
26+
<nav class="bg-white border-gray-200 dark:bg-gray-900">
27+
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
28+
<%= link_to(root_path, class: "flex items-center space-x-3 rtl:space-x-reverse") do %>
29+
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">flowbite-components</span>
30+
<% end %>
31+
<% if @menu_toggle_implemented %>
32+
<button data-collapse-toggle="navbar-default" type="button" class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="navbar-default" aria-expanded="false">
33+
<span class="sr-only">Open main menu</span>
34+
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
35+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/>
36+
</svg>
37+
</button>
38+
<% end %>
39+
<div class="hidden w-full md:block md:w-auto" id="navbar-default">
40+
<ul class="font-medium flex flex-col p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700">
41+
<li>
42+
<%= link_to("Home", root_url, class: "block py-2 px-3 text-gray-900 rounded-sm hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent") %>
43+
</li>
44+
<li>
45+
<%= link_to("GitHub", "https://github.com/substancelab/flowbite-components", class: "block py-2 px-3 text-gray-900 rounded-sm hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent") %>
46+
</li>
47+
</ul>
48+
</div>
49+
</div>
50+
</nav>
51+
</header>
52+
2553
<main class="container mx-auto mt-28 px-5 flex">
26-
<%= yield %>
54+
<article>
55+
<%= yield %>
56+
</article>
2757
</main>
58+
59+
<footer class="mt-28 px-5 py-5 flex border-t-2 border-gray-200 dark:border-gray-70">
60+
<div class="space-y-5">
61+
<div class="flex space-x-5">
62+
<%= link_to("GitHub", "https://github.com/substancelab/flowbite-components") %>
63+
<%= link_to("RubyGems", "https://rubygems.org/gems/flowbite-components") %>
64+
<%= link_to("RubyDoc documentation", "https://www.rubydoc.info/gems/flowbite-components/") %>
65+
</div>
66+
67+
<div>
68+
Licensed under the <%= link_to("MIT License", "https://github.com/substancelab/flowbite-components/blob/main/LICENSE") %>, except where otherwise stated
69+
</div>
70+
71+
<div>
72+
The Flowbite name and logos are trademarks of <%= link_to("Bergside Inc", "https://flowbite.com/brand/") %>.
73+
The Tailwind name and logos are trademarks of <%= link_to("Tailwind Labs Inc", "https://tailwindcss.com/brand") %>.
74+
</div>
75+
</div>
76+
</footer>
2877
</body>
2978
</html>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<section class="bg-white dark:bg-gray-900">
2+
<div class="py-8 px-4 mx-auto max-w-screen-xl text-center lg:py-16">
3+
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-gray-900 md:text-5xl lg:text-6xl dark:text-white">Rails meets Flowbite</h1>
4+
<p class="mb-8 text-lg font-normal text-gray-500 lg:text-xl sm:px-16 lg:px-48 dark:text-gray-400">UI component library for Rails, built using ViewComponents, Flowbite, and Tailwind CSS.</p>
5+
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
6+
<%= link_to("https://github.com/substancelab/flowbite-components?tab=readme-ov-file#installation", class: Flowbite::Button.classes(size: :lg) + ["inline-flex", "justify-center", "items-center"]) do %>
7+
Get started
8+
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
9+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
10+
</svg>
11+
<% end %>
12+
<%= link_to(lookbook_path, class: Flowbite::Button.classes(size: :lg, style: :alternative)) do %>
13+
View components
14+
<% end %>
15+
</div>
16+
</div>
17+
</section>
18+
19+
<div class="flex flex-col gap-6 sm:flex-row">
20+
<div class="p-6 bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 sm:flex-1">
21+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-7 text-gray-500 dark:text-gray-400 mb-3">
22+
<path fill-rule="evenodd" d="M20.599 1.5c-.376 0-.743.111-1.055.32l-5.08 3.385a18.747 18.747 0 0 0-3.471 2.987 10.04 10.04 0 0 1 4.815 4.815 18.748 18.748 0 0 0 2.987-3.472l3.386-5.079A1.902 1.902 0 0 0 20.599 1.5Zm-8.3 14.025a18.76 18.76 0 0 0 1.896-1.207 8.026 8.026 0 0 0-4.513-4.513A18.75 18.75 0 0 0 8.475 11.7l-.278.5a5.26 5.26 0 0 1 3.601 3.602l.502-.278ZM6.75 13.5A3.75 3.75 0 0 0 3 17.25a1.5 1.5 0 0 1-1.601 1.497.75.75 0 0 0-.7 1.123 5.25 5.25 0 0 0 9.8-2.62 3.75 3.75 0 0 0-3.75-3.75Z" clip-rule="evenodd" />
23+
</svg>
24+
<%= link_to("https://flowbite.com/") do %>
25+
<h2 class="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">Designed by Flowbite</h2>
26+
<% end %>
27+
<p class="mb-3 font-normal text-gray-500 dark:text-gray-400">Open-source library of over 600+ UI components, sections, and pages.</p>
28+
<%= link_to("https://flowbite.com/", class: "inline-flex font-medium items-center text-blue-600 hover:underline") do %>
29+
Flowbite documentation
30+
<svg class="w-3 h-3 ms-2.5 rtl:rotate-[270deg]" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
31+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778"/></svg>
32+
<% end %>
33+
</div>
34+
35+
<div class="p-6 bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 sm:flex-1">
36+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-7 text-gray-500 dark:text-gray-400 mb-3">
37+
<path d="m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z" />
38+
</svg>
39+
<%= link_to("https://tailwindcss.com") do %>
40+
<h2 class="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">Powered by Tailwind CSS</h2>
41+
<% end %>
42+
<p class="mb-3 font-normal text-gray-500 dark:text-gray-400">Utility-first CSS framework that can be composed to build any design, directly in your markup.</p>
43+
<%= link_to("https://tailwindcss.com", class: "inline-flex font-medium items-center text-blue-600 hover:underline") do %>
44+
Tailwind CSS documentation
45+
<svg class="w-3 h-3 ms-2.5 rtl:rotate-[270deg]" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
46+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778"/>
47+
</svg>
48+
<% end %>
49+
</div>
50+
51+
<div class="p-6 bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 sm:flex-1">
52+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-7 text-gray-500 dark:text-gray-400 mb-3">
53+
<path fill-rule="evenodd" d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z" clip-rule="evenodd" />
54+
<path d="m10.076 8.64-2.201-2.2V4.874a.75.75 0 0 0-.364-.643l-3.75-2.25a.75.75 0 0 0-.916.113l-.75.75a.75.75 0 0 0-.113.916l2.25 3.75a.75.75 0 0 0 .643.364h1.564l2.062 2.062 1.575-1.297Z" />
55+
<path fill-rule="evenodd" d="m12.556 17.329 4.183 4.182a3.375 3.375 0 0 0 4.773-4.773l-3.306-3.305a6.803 6.803 0 0 1-1.53.043c-.394-.034-.682-.006-.867.042a.589.589 0 0 0-.167.063l-3.086 3.748Zm3.414-1.36a.75.75 0 0 1 1.06 0l1.875 1.876a.75.75 0 1 1-1.06 1.06L15.97 17.03a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" />
56+
</svg>
57+
<%= link_to("https://viewcomponent.org") do %>
58+
<h2 class="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">Built on ViewComponent</h2>
59+
<% end %>
60+
<p class="mb-3 font-normal text-gray-500 dark:text-gray-400">Reusable, testable & encapsulated view components for Ruby on Rails.</p>
61+
<%= link_to("https://viewcomponent.org", class: "inline-flex font-medium items-center text-blue-600 hover:underline") do %>
62+
ViewComponent documentation
63+
<svg class="w-3 h-3 ms-2.5 rtl:rotate-[270deg]" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
64+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778"/>
65+
</svg>
66+
<% end %>
67+
</div>
68+
</div>

0 commit comments

Comments
 (0)