showcase-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +49 -0
- data/Rakefile +8 -0
- data/app/assets/builds/showcase.css +958 -0
- data/app/assets/config/showcase_manifest.js +2 -0
- data/app/assets/javascripts/showcase.js +28 -0
- data/app/controllers/showcase/application_controller.rb +3 -0
- data/app/controllers/showcase/pages_controller.rb +8 -0
- data/app/models/showcase/page/options.rb +51 -0
- data/app/models/showcase/page/sample.rb +43 -0
- data/app/models/showcase/page.rb +45 -0
- data/app/models/showcase/path.rb +30 -0
- data/app/views/layouts/showcase.html.erb +14 -0
- data/app/views/showcase/_root.html.erb +13 -0
- data/app/views/showcase/pages/_options.html.erb +27 -0
- data/app/views/showcase/pages/_page.html.erb +26 -0
- data/app/views/showcase/pages/_sample.html.erb +37 -0
- data/app/views/showcase/pages/index.html.erb +33 -0
- data/app/views/showcase/pages/show.html.erb +1 -0
- data/app/views/showcase/path/_tree.html.erb +9 -0
- data/config/routes.rb +4 -0
- data/config/tailwind.config.js +22 -0
- data/lib/showcase/engine.rb +9 -0
- data/lib/showcase/version.rb +3 -0
- data/lib/showcase.rb +16 -0
- data/lib/tasks/showcase_tasks.rake +4 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 19b68b6f97120e74cc61013cf64de0b095a08290e46f26183861c28c45574693
|
4
|
+
data.tar.gz: b6e9fdc2cc45b1ed6354b60fe67ff254ce03ad08441e1b43c1418e3d6b115404
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 14fcf547ea4c0f3fb4f5f8c99947f41bfc2dbcbb8042ba13137a7347367ec2adb5da9dd60e8f8db62305e6ad0f2d2a26ad00afa6ff0abc8aaf0adf8213df00c2
|
7
|
+
data.tar.gz: 720b83d11a256def78cf22f1b87de100b5170b98e25d08c8c3d2531633accf6e352b12bbcfcb35a096394906612f707aa2d89029654e4b3af181507708dd84f4
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2022 Kasper Timm Hansen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Showcase
|
2
|
+
|
3
|
+
Showcase lets you build previews for partials, components, view helpers and Stimulus controllers.
|
4
|
+
|
5
|
+
Add a view template to `app/views/showcases` and it'll show up in Showcase's menu.
|
6
|
+
|
7
|
+
Here's how to showcase a standard button component:
|
8
|
+
|
9
|
+
```erb
|
10
|
+
<%# app/views/showcases/components/button.html.erb %>
|
11
|
+
<% showcase.description "This button component handles what we click on" %>
|
12
|
+
|
13
|
+
<% showcase.sample "Basic" do %>
|
14
|
+
<%= render "component/button", content: "Button content", mode: :small %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<% showcase.sample "Large" do %>
|
18
|
+
<%= render "component/button", content: "Button content", mode: :large %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<% showcase.options do |o| %>
|
22
|
+
<% o.required :content, String, "The content to output as the button text" %>
|
23
|
+
<% o.optional :mode, default: :small, values: %i[ small medium large ], description: "We support three modes" %>
|
24
|
+
<% end %>
|
25
|
+
```
|
26
|
+
|
27
|
+
## Installation
|
28
|
+
|
29
|
+
Add this line to your application's Gemfile:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
gem "showcase"
|
33
|
+
```
|
34
|
+
|
35
|
+
And then execute:
|
36
|
+
```bash
|
37
|
+
$ bundle
|
38
|
+
```
|
39
|
+
|
40
|
+
Or install it yourself as:
|
41
|
+
```bash
|
42
|
+
$ gem install showcase
|
43
|
+
```
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
Contribution directions go here.
|
47
|
+
|
48
|
+
## License
|
49
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|