vitrail 0.3.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a21fd7a542ed8c1e4d3607925dbf30522b1dbcab267e62c332ea579eec8494f
4
- data.tar.gz: 5672e0d10c8dc43b25e305baa3378b2ac5af88ad82a8a0cc90e4754a56560a12
3
+ metadata.gz: 68d5cbdf415e8b3df84c6f976b534a571ef1f077364ef9d45cfd46bfc814bec9
4
+ data.tar.gz: 3210c5805ffd25755569647c446ed65ae078b8a16891a5781de775a7be8fa116
5
5
  SHA512:
6
- metadata.gz: ef007d0e9d8dea67411131415a44eaf79e9504bbcada06d08ba46dbcbddcc484a0b3046065402d9ece2fc96ba7cb3009e463dfcd71eed0461b7c186eebf041f8
7
- data.tar.gz: c50f4bdbdefd11a2ab94b3a3c4a928690912f8331a93bd0deb096e04ed18c740e94dbac1307ab6598367004149b682bd4cb8e4f52999ce70478d06a33d88657a
6
+ metadata.gz: 6aae77a5eaea665add13df350b5e08c0fff4c259078f9ff4a743e6067567ab079d7b681aeb12ee9772fd709e0dfc311791897188ea732fcdbc33a09e3554ba99
7
+ data.tar.gz: d980c78d3dab7c32d3b3ddda690408691daae24bdf034c784b2843f00b70994361a759ec690c551e092d90356a3af33b9b4ba59e00343576f6fa90bc0bc075a8
@@ -726,6 +726,10 @@ select {
726
726
  margin-left: 0.5rem;
727
727
  }
728
728
 
729
+ .ml-3 {
730
+ margin-left: 0.75rem;
731
+ }
732
+
729
733
  .block {
730
734
  display: block;
731
735
  }
@@ -746,10 +750,18 @@ select {
746
750
  display: flow-root;
747
751
  }
748
752
 
753
+ .max-h-\[28rem\] {
754
+ max-height: 28rem;
755
+ }
756
+
749
757
  .min-w-full {
750
758
  min-width: 100%;
751
759
  }
752
760
 
761
+ .flex-shrink-0 {
762
+ flex-shrink: 0;
763
+ }
764
+
753
765
  .table-auto {
754
766
  table-layout: auto;
755
767
  }
@@ -778,44 +790,34 @@ select {
778
790
  border-color: rgb(209 213 219 / var(--tw-divide-opacity));
779
791
  }
780
792
 
781
- .overflow-x-auto {
782
- overflow-x: auto;
783
- }
784
-
785
793
  .truncate {
786
794
  overflow: hidden;
787
795
  text-overflow: ellipsis;
788
796
  white-space: nowrap;
789
797
  }
790
798
 
791
- .border-red-400 {
792
- --tw-border-opacity: 1;
793
- border-color: rgb(248 113 113 / var(--tw-border-opacity));
799
+ .border {
800
+ border-width: 1px;
794
801
  }
795
802
 
796
- .border-red-200 {
797
- --tw-border-opacity: 1;
798
- border-color: rgb(254 202 202 / var(--tw-border-opacity));
803
+ .\!border-red-200 {
804
+ --tw-border-opacity: 1 !important;
805
+ border-color: rgb(254 202 202 / var(--tw-border-opacity)) !important;
799
806
  }
800
807
 
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));
808
+ .border-slate-200 {
809
+ --tw-border-opacity: 1;
810
+ border-color: rgb(226 232 240 / var(--tw-border-opacity));
809
811
  }
810
812
 
811
- .bg-red-200 {
812
- --tw-bg-opacity: 1;
813
- background-color: rgb(254 202 202 / var(--tw-bg-opacity));
813
+ .\!bg-red-100 {
814
+ --tw-bg-opacity: 1 !important;
815
+ background-color: rgb(254 226 226 / var(--tw-bg-opacity)) !important;
814
816
  }
815
817
 
816
- .bg-red-100 {
818
+ .bg-white {
817
819
  --tw-bg-opacity: 1;
818
- background-color: rgb(254 226 226 / var(--tw-bg-opacity));
820
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
819
821
  }
820
822
 
821
823
  .px-3 {
@@ -850,10 +852,19 @@ select {
850
852
  font-weight: 500;
851
853
  }
852
854
 
855
+ .font-semibold {
856
+ font-weight: 600;
857
+ }
858
+
853
859
  .uppercase {
854
860
  text-transform: uppercase;
855
861
  }
856
862
 
863
+ .text-red-800 {
864
+ --tw-text-opacity: 1;
865
+ color: rgb(153 27 27 / var(--tw-text-opacity));
866
+ }
867
+
857
868
  .text-slate-500 {
858
869
  --tw-text-opacity: 1;
859
870
  color: rgb(100 116 139 / var(--tw-text-opacity));
@@ -864,9 +875,9 @@ select {
864
875
  color: rgb(71 85 105 / var(--tw-text-opacity));
865
876
  }
866
877
 
867
- .text-red-800 {
878
+ .text-slate-900 {
868
879
  --tw-text-opacity: 1;
869
- color: rgb(153 27 27 / var(--tw-text-opacity));
880
+ color: rgb(15 23 42 / var(--tw-text-opacity));
870
881
  }
871
882
 
872
883
  /*
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vitrail
4
+ class Badge < BaseComponent
5
+ erb_template <<~ERB.squish
6
+ <span class="<%= html_classes %>" <%= html_attributes %>>
7
+ <%= content %>
8
+ </span>
9
+ ERB
10
+
11
+ def initialize(level: :default, **html_options)
12
+ super(**html_options)
13
+ @level = level
14
+ end
15
+
16
+ private
17
+
18
+ attr_reader :level
19
+
20
+ LOCAL_CLASSES = "inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset"
21
+ LEVEL_CLASSES = {
22
+ default: "bg-blue-50 text-blue-700 ring-blue-700/10",
23
+ info: "bg-blue-50 text-blue-700 ring-blue-700/10",
24
+ positive: "bg-green-50 text-green-700 ring-green-700/10",
25
+ negative: "bg-yellow-50 text-yellow-700 ring-yellow-700/10",
26
+ warning: "bg-red-50 text-red-700 ring-red-700/10",
27
+ urgent: "bg-red-700 text-white ring-red-700/10"
28
+ }.freeze
29
+ private_constant :LEVEL_CLASSES
30
+
31
+ def local_classes = [LOCAL_CLASSES, LEVEL_CLASSES[level]].join(" ")
32
+ end
33
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vitrail
4
+ class LinkTo < ViewComponent::Base
5
+ def initialize(level, options = nil, html_options = nil)
6
+ @level = level
7
+ @options = options
8
+ @html_options = html_options || {}
9
+ end
10
+
11
+ def call = link_to(options, decorated_html_options) { content }
12
+
13
+ private
14
+
15
+ attr_reader :level, :options, :html_options
16
+
17
+ GLOBAL_CLASSES = "font-semibold px-3 py-2".freeze
18
+ private_constant :GLOBAL_CLASSES
19
+
20
+ LEVEL_CLASSES = {
21
+ primary: <<~TXT.squish,
22
+ text-indigo-600 hover:text-indigo-500
23
+ focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2
24
+ focus-visible:outline-indigo-600
25
+ TXT
26
+ secondary: <<~TXT.squish,
27
+ text-slate-700 hover:text-slate-80
28
+ underline decoration-dashed underline-offset-4 decoration-slate-500
29
+ TXT
30
+ }.freeze
31
+ private_constant :LEVEL_CLASSES
32
+ def level_classes
33
+ LEVEL_CLASSES[level.to_sym]
34
+ end
35
+
36
+ def decorated_html_options
37
+ html_options&.merge(class: [GLOBAL_CLASSES, level_classes].join(" "))
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,15 @@
1
+ <%= render Vitrail::Card.new(class: level_background) do %>
2
+ <div class="flex">
3
+ <div class="flex-shrink-0">
4
+ <i class="<%= level_icon %>"></i>
5
+ </div>
6
+ <div class="ml-3">
7
+ <h4 class="font-semibold text-slate-900">
8
+ <%= title %>
9
+ </h4>
10
+ <div class="text-slate-600">
11
+ <%= content %>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <% end %>
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vitrail
4
+ class Notice < BaseComponent
5
+ def initialize(title:, level: :default, **html_options)
6
+ super(**html_options)
7
+ @title = title
8
+ @level = level
9
+ end
10
+
11
+ private
12
+
13
+ attr_reader :title, :level
14
+
15
+ LEVEL_BACKGROUNDS = {
16
+ default: "!bg-gray-50",
17
+ caution: "!bg-yellow-50",
18
+ critical: "!bg-red-50"
19
+ }.freeze
20
+ private_constant :LEVEL_BACKGROUNDS
21
+ def level_background = LEVEL_BACKGROUNDS[level]
22
+
23
+ LEVEL_ICONS = {
24
+ default: "fa-solid fa-square-info text-gray-500",
25
+ caution: "fa-solid fa-square-info text-yellow-600",
26
+ critical: "fa-solid fa-triangle-exclamation text-red-600"
27
+ }.freeze
28
+ private_constant :LEVEL_ICONS
29
+ def level_icon = LEVEL_ICONS[level]
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Vitrail
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,29 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vitrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume CABANEL
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '7'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '9'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
23
25
  requirements:
24
- - - "~>"
26
+ - - ">="
25
27
  - !ruby/object:Gem::Version
26
28
  version: '7'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '9'
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: view_component
29
34
  requirement: !ruby/object:Gem::Requirement
@@ -66,9 +71,13 @@ files:
66
71
  - app/assets/stylesheets/vitrail.tailwind.css
67
72
  - app/assets/stylesheets/vitrail/application.css
68
73
  - app/assets/stylesheets/vitrail/vitrail.css
74
+ - app/components/vitrail/badge.rb
69
75
  - app/components/vitrail/base_component.rb
70
76
  - app/components/vitrail/card.html.erb
71
77
  - app/components/vitrail/card.rb
78
+ - app/components/vitrail/link_to.rb
79
+ - app/components/vitrail/notice.html.erb
80
+ - app/components/vitrail/notice.rb
72
81
  - app/components/vitrail/table.html.erb
73
82
  - app/components/vitrail/table.rb
74
83
  - app/components/vitrail/table/division.html.erb
@@ -76,7 +85,6 @@ files:
76
85
  - app/components/vitrail/table/header.rb
77
86
  - app/components/vitrail/table/row.rb
78
87
  - app/components/vitrail/title.rb
79
- - app/helpers/vitrail/application_helper.rb
80
88
  - app/views/layouts/vitrail/component_preview.html.erb
81
89
  - config/tailwind.config.js
82
90
  - lib/tasks/vitrail_tasks.rake
@@ -91,7 +99,6 @@ metadata:
91
99
  homepage_uri: https://github.com/kuartz-org/vitrail
92
100
  source_code_uri: https://github.com/kuartz-org/vitrail
93
101
  changelog_uri: https://github.com/kuartz-org/vitrail/blob/main/CHANGELOG.md
94
- post_install_message:
95
102
  rdoc_options: []
96
103
  require_paths:
97
104
  - lib
@@ -106,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
113
  - !ruby/object:Gem::Version
107
114
  version: '0'
108
115
  requirements: []
109
- rubygems_version: 3.4.14
110
- signing_key:
116
+ rubygems_version: 4.0.6
111
117
  specification_version: 4
112
118
  summary: Kuartz design system
113
119
  test_files: []
@@ -1,4 +0,0 @@
1
- module Vitrail
2
- module ApplicationHelper
3
- end
4
- end