vitrail 0.1.1 → 0.2.1
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/README.md +0 -1
- data/app/assets/stylesheets/vitrail/vitrail.css +154 -4
- data/app/components/vitrail/base_component.rb +2 -5
- data/app/components/vitrail/card.html.erb +12 -0
- data/app/components/vitrail/card.rb +18 -0
- data/app/components/vitrail/table/division.html.erb +9 -0
- data/app/components/vitrail/table/division.rb +24 -0
- data/app/components/vitrail/table/header.rb +19 -0
- data/app/components/vitrail/table/row.rb +27 -0
- data/app/components/vitrail/table.html.erb +19 -0
- data/app/components/vitrail/table.rb +8 -0
- data/app/views/layouts/vitrail/component_preview.html.erb +1 -0
- data/lib/vitrail/engine.rb +0 -11
- data/lib/vitrail/version.rb +1 -1
- metadata +10 -22
- data/app/controllers/vitrail/application_controller.rb +0 -4
- data/app/jobs/vitrail/application_job.rb +0 -4
- data/app/mailers/vitrail/application_mailer.rb +0 -6
- data/app/models/vitrail/application_record.rb +0 -5
- data/app/views/layouts/vitrail/application.html.erb +0 -15
- data/config/routes.rb +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f651fb5fbab1ebe0ce61ecf4750b8fc7ed68dd428ca9cc7b5d750d8c9a0855e9
|
|
4
|
+
data.tar.gz: 3d748cea3dd9a264f698ecd44b9cc12ef1b75976a74d7ed76575d4dcc76aefa0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46db3d0d523cda1da9ccb83c8608dd32cca0d3966997fcfabaf0639095860196630dd5e4142c1166b82765ad20ae972aedcbedd73132c72edef7668e7eabcba2
|
|
7
|
+
data.tar.gz: 734477fc361a7d59057314cf129db1b923550a86b10c09273fb41723cd8a56692ad0347822b20efacb5604e510ae99c8fe60223bb6d1e584f3c56222debfb3a0
|
data/README.md
CHANGED
|
@@ -700,8 +700,127 @@ select {
|
|
|
700
700
|
--tw-backdrop-sepia: ;
|
|
701
701
|
}
|
|
702
702
|
|
|
703
|
-
.
|
|
704
|
-
|
|
703
|
+
.sticky {
|
|
704
|
+
position: sticky;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.top-0 {
|
|
708
|
+
top: 0px;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.-mx-3 {
|
|
712
|
+
margin-left: -0.75rem;
|
|
713
|
+
margin-right: -0.75rem;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.-my-4 {
|
|
717
|
+
margin-top: -1rem;
|
|
718
|
+
margin-bottom: -1rem;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.mb-2 {
|
|
722
|
+
margin-bottom: 0.5rem;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.ml-2 {
|
|
726
|
+
margin-left: 0.5rem;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.block {
|
|
730
|
+
display: block;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.inline-block {
|
|
734
|
+
display: inline-block;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.flex {
|
|
738
|
+
display: flex;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.table {
|
|
742
|
+
display: table;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.flow-root {
|
|
746
|
+
display: flow-root;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.min-w-full {
|
|
750
|
+
min-width: 100%;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.table-auto {
|
|
754
|
+
table-layout: auto;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.items-center {
|
|
758
|
+
align-items: center;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.justify-between {
|
|
762
|
+
justify-content: space-between;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
|
766
|
+
--tw-divide-y-reverse: 0;
|
|
767
|
+
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
768
|
+
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
|
|
772
|
+
--tw-divide-opacity: 1;
|
|
773
|
+
border-color: rgb(229 231 235 / var(--tw-divide-opacity));
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.divide-gray-300 > :not([hidden]) ~ :not([hidden]) {
|
|
777
|
+
--tw-divide-opacity: 1;
|
|
778
|
+
border-color: rgb(209 213 219 / var(--tw-divide-opacity));
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.overflow-x-auto {
|
|
782
|
+
overflow-x: auto;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.truncate {
|
|
786
|
+
overflow: hidden;
|
|
787
|
+
text-overflow: ellipsis;
|
|
788
|
+
white-space: nowrap;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.border-red-400 {
|
|
792
|
+
--tw-border-opacity: 1;
|
|
793
|
+
border-color: rgb(248 113 113 / var(--tw-border-opacity));
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.border-red-200 {
|
|
797
|
+
--tw-border-opacity: 1;
|
|
798
|
+
border-color: rgb(254 202 202 / var(--tw-border-opacity));
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.bg-white {
|
|
802
|
+
--tw-bg-opacity: 1;
|
|
803
|
+
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.bg-red-500 {
|
|
807
|
+
--tw-bg-opacity: 1;
|
|
808
|
+
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.bg-red-200 {
|
|
812
|
+
--tw-bg-opacity: 1;
|
|
813
|
+
background-color: rgb(254 202 202 / var(--tw-bg-opacity));
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.bg-red-100 {
|
|
817
|
+
--tw-bg-opacity: 1;
|
|
818
|
+
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.px-3 {
|
|
822
|
+
padding-left: 0.75rem;
|
|
823
|
+
padding-right: 0.75rem;
|
|
705
824
|
}
|
|
706
825
|
|
|
707
826
|
.px-8 {
|
|
@@ -714,9 +833,40 @@ select {
|
|
|
714
833
|
padding-bottom: 1rem;
|
|
715
834
|
}
|
|
716
835
|
|
|
717
|
-
.text-
|
|
836
|
+
.text-right {
|
|
837
|
+
text-align: right;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.align-middle {
|
|
841
|
+
vertical-align: middle;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.text-sm {
|
|
845
|
+
font-size: 0.875rem;
|
|
846
|
+
line-height: 1.25rem;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.font-medium {
|
|
850
|
+
font-weight: 500;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.uppercase {
|
|
854
|
+
text-transform: uppercase;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.text-slate-500 {
|
|
858
|
+
--tw-text-opacity: 1;
|
|
859
|
+
color: rgb(100 116 139 / var(--tw-text-opacity));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.text-slate-600 {
|
|
863
|
+
--tw-text-opacity: 1;
|
|
864
|
+
color: rgb(71 85 105 / var(--tw-text-opacity));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.text-red-800 {
|
|
718
868
|
--tw-text-opacity: 1;
|
|
719
|
-
color: rgb(
|
|
869
|
+
color: rgb(153 27 27 / var(--tw-text-opacity));
|
|
720
870
|
}
|
|
721
871
|
|
|
722
872
|
/*
|
|
@@ -13,13 +13,10 @@ module Vitrail
|
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
-
def local_classes
|
|
17
|
-
""
|
|
18
|
-
end
|
|
16
|
+
def local_classes = ""
|
|
19
17
|
|
|
20
18
|
def html_attributes
|
|
21
|
-
|
|
22
|
-
attributes(html_options)
|
|
19
|
+
tag.attributes(html_options)
|
|
23
20
|
end
|
|
24
21
|
|
|
25
22
|
def html_classes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="<%= html_classes %>" <%= html_attributes %>>
|
|
2
|
+
<% if header? %>
|
|
3
|
+
<header>
|
|
4
|
+
<div class="flex justify-between items-center mb-2">
|
|
5
|
+
<h3 class="truncate text-sm font-medium text-slate-500">
|
|
6
|
+
<%= title %>
|
|
7
|
+
</h3>
|
|
8
|
+
<i class="fa-light text-slate-600 ml-2 fa-<%= icon %>" aria-hidden="true"></i>
|
|
9
|
+
</header>
|
|
10
|
+
<% end %>
|
|
11
|
+
<%= content %>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Vitrail
|
|
4
|
+
class Card < BaseComponent
|
|
5
|
+
LOCAL_CLASSES = "border border-slate-200 rounded px-4 py-2 bg-white shadow-sm"
|
|
6
|
+
|
|
7
|
+
private attr_reader :title, :icon
|
|
8
|
+
|
|
9
|
+
def initialize(title: nil, icon: nil, **html_options)
|
|
10
|
+
super(**html_options)
|
|
11
|
+
@title = title
|
|
12
|
+
@icon = icon
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def local_classes = LOCAL_CLASSES
|
|
16
|
+
def header? = title || icon
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<td class="<%= html_classes %>" <%= html_attributes %>>
|
|
2
|
+
<% if link_to? %>
|
|
3
|
+
<%= link_to link_path, class: "block -mx-3 px-3 -my-4 py-4" do %>
|
|
4
|
+
<%= content || " ".html_safe %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% else %>
|
|
7
|
+
<%= content || " ".html_safe %>
|
|
8
|
+
<% end %>
|
|
9
|
+
</td>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Vitrail
|
|
4
|
+
class Table
|
|
5
|
+
class Division < BaseComponent
|
|
6
|
+
LOCAL_CLASSES = "whitespace-nowrap px-3 py-4 text-sm text-gray-500"
|
|
7
|
+
|
|
8
|
+
private attr_reader :link_path
|
|
9
|
+
|
|
10
|
+
def initialize(link_to: nil, **html_options)
|
|
11
|
+
super(**html_options)
|
|
12
|
+
@link_path = link_to
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def link_to? = link_path.present?
|
|
18
|
+
|
|
19
|
+
def local_classes
|
|
20
|
+
LOCAL_CLASSES + (" group-hover:bg-gray-50" if link_to?).to_s
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Vitrail
|
|
4
|
+
class Table
|
|
5
|
+
class Header < BaseComponent
|
|
6
|
+
erb_template <<~ERB.squish
|
|
7
|
+
<th class="<%= html_classes %> scope="col" <%= html_attributes %>>
|
|
8
|
+
<%= content %>
|
|
9
|
+
</th>
|
|
10
|
+
ERB
|
|
11
|
+
|
|
12
|
+
LOCAL_CLASSES = "px-3 py-4 text-left text-sm font-semibold text-gray-900"
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def local_classes = LOCAL_CLASSES
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Vitrail
|
|
4
|
+
class Table
|
|
5
|
+
class Row < BaseComponent
|
|
6
|
+
erb_template <<~ERB.squish
|
|
7
|
+
<tr class="group" <%= html_attributes %>>
|
|
8
|
+
<% divisions.each do |division| %>
|
|
9
|
+
<%= division %>
|
|
10
|
+
<% end %>
|
|
11
|
+
</tr>
|
|
12
|
+
ERB
|
|
13
|
+
|
|
14
|
+
renders_many :divisions, ->(link_to: nil, **html_options) do
|
|
15
|
+
Division.new(link_to: link_path, **html_options.merge(td_options))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private attr_reader :link_path, :td_options
|
|
19
|
+
|
|
20
|
+
def initialize(link_to: nil, td: {}, **html_options)
|
|
21
|
+
super(**html_options)
|
|
22
|
+
@link_path = link_to
|
|
23
|
+
@td_options = td
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="flow-root" <%= html_attributes %>>
|
|
2
|
+
<div class="overflow-x-auto">
|
|
3
|
+
<div class="inline-block min-w-full align-middle">
|
|
4
|
+
<table class="table-auto min-w-full divide-y divide-gray-300">
|
|
5
|
+
<thead class="sticky top-0 bg-white">
|
|
6
|
+
<tr>
|
|
7
|
+
<% headers.each do |header| %>
|
|
8
|
+
<%= header %>
|
|
9
|
+
<% end %>
|
|
10
|
+
</tr>
|
|
11
|
+
<tbody class="divide-y divide-gray-200">
|
|
12
|
+
<% rows.each do |row| %>
|
|
13
|
+
<%= row %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</tbody>
|
|
16
|
+
</table>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
|
10
10
|
<%= stylesheet_link_tag "vitrail/application" %>
|
|
11
|
+
<script src="https://kit.fontawesome.com/910f22a437.js" crossorigin="anonymous"></script>
|
|
11
12
|
</head>
|
|
12
13
|
<body class="px-8 py-4 margin-x-auto">
|
|
13
14
|
<%= yield %>
|
data/lib/vitrail/engine.rb
CHANGED
|
@@ -5,16 +5,5 @@ module Vitrail
|
|
|
5
5
|
initializer "vitrail.precompile" do |app|
|
|
6
6
|
app.config.assets.precompile += %w[vitrail_manifest]
|
|
7
7
|
end
|
|
8
|
-
|
|
9
|
-
initializer "vitrail.lookbook" do |app|
|
|
10
|
-
app.config.lookbook.preview_paths << Vitrail::Engine.root.join("test/components/previews")
|
|
11
|
-
app.config.lookbook.preview_layout = "vitrail/component_preview"
|
|
12
|
-
app.config.lookbook.project_name = "Vitrail"
|
|
13
|
-
app.config.lookbook.project_logo = false
|
|
14
|
-
app.config.lookbook.ui_favicon = false
|
|
15
|
-
app.config.lookbook.preview_collection_label = "Components"
|
|
16
|
-
app.config.lookbook.ui_theme = "zinc"
|
|
17
|
-
app.config.lookbook.preview_inspector.drawer_panels = [:source]
|
|
18
|
-
end
|
|
19
8
|
end
|
|
20
9
|
end
|
data/lib/vitrail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vitrail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guillaume CABANEL
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-11-
|
|
11
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -52,20 +52,6 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '2'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: lookbook
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '2'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '2'
|
|
69
55
|
description: Kuartz design system view components
|
|
70
56
|
email:
|
|
71
57
|
- guillaume@kuartz.fr
|
|
@@ -81,15 +67,17 @@ files:
|
|
|
81
67
|
- app/assets/stylesheets/vitrail/application.css
|
|
82
68
|
- app/assets/stylesheets/vitrail/vitrail.css
|
|
83
69
|
- app/components/vitrail/base_component.rb
|
|
70
|
+
- app/components/vitrail/card.html.erb
|
|
71
|
+
- app/components/vitrail/card.rb
|
|
72
|
+
- app/components/vitrail/table.html.erb
|
|
73
|
+
- app/components/vitrail/table.rb
|
|
74
|
+
- app/components/vitrail/table/division.html.erb
|
|
75
|
+
- app/components/vitrail/table/division.rb
|
|
76
|
+
- app/components/vitrail/table/header.rb
|
|
77
|
+
- app/components/vitrail/table/row.rb
|
|
84
78
|
- app/components/vitrail/title.rb
|
|
85
|
-
- app/controllers/vitrail/application_controller.rb
|
|
86
79
|
- app/helpers/vitrail/application_helper.rb
|
|
87
|
-
- app/jobs/vitrail/application_job.rb
|
|
88
|
-
- app/mailers/vitrail/application_mailer.rb
|
|
89
|
-
- app/models/vitrail/application_record.rb
|
|
90
|
-
- app/views/layouts/vitrail/application.html.erb
|
|
91
80
|
- app/views/layouts/vitrail/component_preview.html.erb
|
|
92
|
-
- config/routes.rb
|
|
93
81
|
- config/tailwind.config.js
|
|
94
82
|
- lib/tasks/vitrail_tasks.rake
|
|
95
83
|
- lib/vitrail.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Vitrail</title>
|
|
5
|
-
<%= csrf_meta_tags %>
|
|
6
|
-
<%= csp_meta_tag %>
|
|
7
|
-
|
|
8
|
-
<%= stylesheet_link_tag "vitrail", "data-turbo-track": "reload" %>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<main class="p-20">
|
|
12
|
-
<%= yield %>
|
|
13
|
-
</main>
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|
data/config/routes.rb
DELETED