vitrail 0.4.0 → 1.0.0
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 +16 -30
- data/app/components/vitrail/badge.rb +7 -7
- data/app/components/vitrail/button_tag/component.rb +74 -0
- data/app/components/vitrail/card/component.html.erb +18 -0
- data/app/components/vitrail/card/component.rb +9 -0
- data/app/components/vitrail/link_to/component.rb +64 -0
- data/app/components/vitrail/notice.html.erb +5 -5
- data/app/components/vitrail/notice.rb +6 -6
- data/app/components/vitrail/table/component.html.erb +15 -0
- data/app/components/vitrail/table/component.rb +10 -0
- data/app/components/vitrail/table/division.html.erb +1 -1
- data/app/components/vitrail/table/division.rb +3 -3
- data/app/components/vitrail/table/header.rb +3 -3
- data/app/components/vitrail/table/row.rb +2 -2
- data/app/components/vitrail/title/component.rb +34 -0
- data/lib/generators/vitrail/install/install_generator.rb +50 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/button_tag.css.tt +36 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/card.css.tt +20 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/config.css.tt +23 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/index.css.tt +8 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/link_to.css.tt +36 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/primitives.css.tt +24 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/table.css.tt +37 -0
- data/lib/generators/vitrail/install/templates/stylesheets/vitrail/title.css.tt +21 -0
- data/lib/generators/vitrail/install/templates/vitrail_preset.js.tt +41 -0
- data/lib/vitrail/engine.rb +18 -2
- data/lib/vitrail/helper.rb +9 -0
- data/lib/vitrail/tasks/install.rake +8 -0
- data/lib/vitrail/version.rb +1 -1
- data/lib/vitrail.rb +2 -0
- metadata +25 -19
- data/Rakefile +0 -8
- data/app/assets/config/vitrail_manifest.js +0 -1
- data/app/assets/stylesheets/vitrail/application.css +0 -15
- data/app/assets/stylesheets/vitrail/vitrail.css +0 -891
- data/app/assets/stylesheets/vitrail.tailwind.css +0 -13
- data/app/components/vitrail/card.html.erb +0 -12
- data/app/components/vitrail/card.rb +0 -18
- data/app/components/vitrail/link_to.rb +0 -40
- data/app/components/vitrail/table.html.erb +0 -19
- data/app/components/vitrail/table.rb +0 -10
- data/app/components/vitrail/title.rb +0 -29
- data/app/views/layouts/vitrail/component_preview.html.erb +0 -16
- data/config/tailwind.config.js +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72d49e1b6feb0572fa3fccdf0a7bf11f83c27f615faef3702ac08f605bf94118
|
4
|
+
data.tar.gz: e9fec78decdd9b1d335bb2cc51d495035807d7cebd7c71d27895d13f75abbc36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2719ce8a1550ee9b23df2e922813de0a204b13f23f915f7be3b13ebfcd4ea3d76689a5f54a39104461e13934182cdaf12de8118bc6a02fbfb96d45edd5c963d5
|
7
|
+
data.tar.gz: 7c452bf6037c3c03f21ea81dc8bd7eb8a8c2da9a67e902fcb07a2faac10514aa5467c02ba2569cb39a1ef65ff1026bff2202621689cf66b9ac2d30e3464a5768
|
data/README.md
CHANGED
@@ -1,45 +1,31 @@
|
|
1
1
|
# Vitrail
|
2
2
|
Kuartz's Design system view components.
|
3
3
|
|
4
|
+
## Prerequisites
|
5
|
+
- Ruby v3
|
6
|
+
- Rails v7
|
7
|
+
- ViewComponent v3
|
8
|
+
- tailwindcss-rails (the gem) v2
|
9
|
+
|
4
10
|
## Installation
|
5
|
-
Add this line to your application's Gemfile:
|
6
11
|
|
12
|
+
In your Gemfile, add this line:
|
7
13
|
```ruby
|
8
|
-
gem "vitrail"
|
14
|
+
gem "vitrail", "~> 1.0"
|
9
15
|
```
|
10
16
|
|
11
|
-
|
12
|
-
```bash
|
13
|
-
$ bundle
|
14
|
-
```
|
17
|
+
Then, run `bundle install`.
|
15
18
|
|
16
|
-
|
19
|
+
Finally, run the following command to install Vitrail's assets and configuration files in your project:
|
17
20
|
```bash
|
18
|
-
|
21
|
+
rails vitrail:install
|
19
22
|
```
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
-
|
24
|
-
|
25
|
-
|
26
|
-
const output = execSync('bundle show vitrail', { encoding: 'utf-8' })
|
27
|
-
```
|
28
|
-
|
29
|
-
- add as last item of `content`:
|
30
|
-
```js
|
31
|
-
content: [
|
32
|
-
// ...
|
33
|
-
output.trim() + '/app/components/**/*.{erb,haml,html,rb}'
|
34
|
-
],
|
35
|
-
```
|
36
|
-
|
37
|
-
## Development
|
38
|
-
|
39
|
-
watch tailwindcss changes with:
|
40
|
-
```bash
|
41
|
-
tailwindcss_watch
|
42
|
-
```
|
24
|
+
This will:
|
25
|
+
- Add default styles to the available Vitrail classes in `lib/assets/stylesheets/vitrail`
|
26
|
+
- Add the Tailwind preset file in `lib/assets/vitrail_preset.js`
|
27
|
+
- Load the Vitrail styles in your `application.tailwind.css` file
|
28
|
+
- Add config to your `tailwind.config.js` file
|
43
29
|
|
44
30
|
## License
|
45
31
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -17,14 +17,14 @@ module Vitrail
|
|
17
17
|
|
18
18
|
attr_reader :level
|
19
19
|
|
20
|
-
LOCAL_CLASSES = "
|
20
|
+
LOCAL_CLASSES = "vt-badge--container"
|
21
21
|
LEVEL_CLASSES = {
|
22
|
-
default: "
|
23
|
-
info: "
|
24
|
-
positive: "
|
25
|
-
negative: "
|
26
|
-
warning: "
|
27
|
-
urgent: "
|
22
|
+
default: "vt-badge--level-default",
|
23
|
+
info: "vt-badge--level-info",
|
24
|
+
positive: "vt-badge--level-positive",
|
25
|
+
negative: "vt-badge--level-negative",
|
26
|
+
warning: "vt-badge--level-warning",
|
27
|
+
urgent: "vt-badge--level-urgent"
|
28
28
|
}.freeze
|
29
29
|
private_constant :LEVEL_CLASSES
|
30
30
|
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module Vitrail
|
2
|
+
module ButtonTag
|
3
|
+
class Component < BaseComponent
|
4
|
+
def initialize(content_or_options = {}, options = {})
|
5
|
+
@content_or_options = content_or_options
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
|
9
|
+
def call
|
10
|
+
if content.present?
|
11
|
+
@variant = content_or_options.delete(:variant) || :default
|
12
|
+
@size = content_or_options.delete(:size) || :default
|
13
|
+
|
14
|
+
@options = {
|
15
|
+
"name" => "button",
|
16
|
+
"type" => "submit"
|
17
|
+
}.merge!(options.stringify_keys)
|
18
|
+
|
19
|
+
options["class"] = [
|
20
|
+
"button",
|
21
|
+
variant,
|
22
|
+
size,
|
23
|
+
options["class"],
|
24
|
+
].compact.join(" ")
|
25
|
+
|
26
|
+
content_tag(:button, options) { content }
|
27
|
+
else
|
28
|
+
@variant = options.delete(:variant) || :default
|
29
|
+
@size = options.delete(:size) || :default
|
30
|
+
|
31
|
+
@options = {
|
32
|
+
"name" => "button",
|
33
|
+
"type" => "submit"
|
34
|
+
}.merge!(options.stringify_keys)
|
35
|
+
|
36
|
+
options["class"] = [
|
37
|
+
"button",
|
38
|
+
variant,
|
39
|
+
size,
|
40
|
+
options["class"],
|
41
|
+
].compact.join(" ")
|
42
|
+
|
43
|
+
content_tag :button, content_or_options || "Button", options
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
attr_reader :options, :content_or_options
|
50
|
+
|
51
|
+
VARIANTS = %i[
|
52
|
+
default
|
53
|
+
destructive
|
54
|
+
outline
|
55
|
+
secondary
|
56
|
+
ghost
|
57
|
+
link
|
58
|
+
].freeze
|
59
|
+
def variant
|
60
|
+
@variant.in?(VARIANTS) ? "button--variant-#{@variant}" : "button--variant-default"
|
61
|
+
end
|
62
|
+
|
63
|
+
SIZES = %i[
|
64
|
+
default
|
65
|
+
sm
|
66
|
+
lg
|
67
|
+
icon
|
68
|
+
].freeze
|
69
|
+
def size
|
70
|
+
@size.in?(SIZES) ? "button--size-#{@size}" : "button--size-default"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<article class="vt-card">
|
2
|
+
<% if title? || description? %>
|
3
|
+
<header>
|
4
|
+
<% if title? %>
|
5
|
+
<div class="vt-card--title"><%= title %></div>
|
6
|
+
<% end %>
|
7
|
+
<% if description? %>
|
8
|
+
<p class="vt-card--description"><%= description %></p>
|
9
|
+
<% end %>
|
10
|
+
</header>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= content %>
|
14
|
+
|
15
|
+
<% if footer? %>
|
16
|
+
<footer><%= footer %></footer>
|
17
|
+
<% end %>
|
18
|
+
</article>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Vitrail
|
2
|
+
module LinkTo
|
3
|
+
class Component < BaseComponent
|
4
|
+
def initialize(name_or_options = nil, options = {}, html_options = {})
|
5
|
+
@name_or_options = name_or_options
|
6
|
+
@options = options
|
7
|
+
@html_options = html_options
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
if content.present?
|
12
|
+
@variant = options.delete(:variant) || :default
|
13
|
+
@size = options.delete(:size) || :default
|
14
|
+
|
15
|
+
options["class"] = [
|
16
|
+
"vt-link",
|
17
|
+
variant,
|
18
|
+
size,
|
19
|
+
options["class"],
|
20
|
+
].compact.join(" ")
|
21
|
+
|
22
|
+
link_to(name_or_options, options) { content }
|
23
|
+
else
|
24
|
+
@variant = html_options.delete(:variant) || :default
|
25
|
+
@size = html_options.delete(:size) || :default
|
26
|
+
|
27
|
+
html_options["class"] = [
|
28
|
+
"vt-link",
|
29
|
+
variant,
|
30
|
+
size,
|
31
|
+
html_options["class"],
|
32
|
+
].compact.join(" ")
|
33
|
+
|
34
|
+
link_to name_or_options, options, html_options
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
attr_reader :name_or_options, :options, :html_options
|
41
|
+
|
42
|
+
VARIANTS = %i[
|
43
|
+
default
|
44
|
+
primary
|
45
|
+
outline
|
46
|
+
secondary
|
47
|
+
ghost
|
48
|
+
].freeze
|
49
|
+
def variant
|
50
|
+
@variant.in?(VARIANTS) ? "vt-link--variant-#{@variant}" : "vt-link--variant-default"
|
51
|
+
end
|
52
|
+
|
53
|
+
SIZES = %i[
|
54
|
+
default
|
55
|
+
sm
|
56
|
+
lg
|
57
|
+
icon
|
58
|
+
].freeze
|
59
|
+
def size
|
60
|
+
@size.in?(SIZES) ? "vt-link--size-#{@size}" : "vt-link--size-default"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<%= render Vitrail::Card.new(class: level_background) do %>
|
2
|
-
<div class="
|
3
|
-
<div class="
|
2
|
+
<div class="vt-notice--container">
|
3
|
+
<div class="vt-notice--icon-container">
|
4
4
|
<i class="<%= level_icon %>"></i>
|
5
5
|
</div>
|
6
|
-
<div class="
|
7
|
-
<h4 class="
|
6
|
+
<div class="vt-notice--title-container">
|
7
|
+
<h4 class="vt-notice--title">
|
8
8
|
<%= title %>
|
9
9
|
</h4>
|
10
|
-
<div class="
|
10
|
+
<div class="vt-notice--content-container">
|
11
11
|
<%= content %>
|
12
12
|
</div>
|
13
13
|
</div>
|
@@ -13,17 +13,17 @@ module Vitrail
|
|
13
13
|
attr_reader :title, :level
|
14
14
|
|
15
15
|
LEVEL_BACKGROUNDS = {
|
16
|
-
default: "
|
17
|
-
caution: "
|
18
|
-
critical: "
|
16
|
+
default: "vt-notice--level-bg-default",
|
17
|
+
caution: "vt-notice--level-bg-caution",
|
18
|
+
critical: "vt-notice--level-bg-critical"
|
19
19
|
}.freeze
|
20
20
|
private_constant :LEVEL_BACKGROUNDS
|
21
21
|
def level_background = LEVEL_BACKGROUNDS[level]
|
22
22
|
|
23
23
|
LEVEL_ICONS = {
|
24
|
-
default: "fa-solid fa-square-info
|
25
|
-
caution: "fa-solid fa-square-info
|
26
|
-
critical: "fa-solid fa-triangle-exclamation
|
24
|
+
default: "vt-notice--level-icon-default fa-solid fa-square-info",
|
25
|
+
caution: "vt-notice--level-icon-caution fa-solid fa-square-info",
|
26
|
+
critical: "vt-notice--level-icon-critical fa-solid fa-triangle-exclamation"
|
27
27
|
}.freeze
|
28
28
|
private_constant :LEVEL_ICONS
|
29
29
|
def level_icon = LEVEL_ICONS[level]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="vt-table--container">
|
2
|
+
<table class="vt-table">
|
3
|
+
<thead class="vt-table--head">
|
4
|
+
<tr>
|
5
|
+
<% headers.each do |header| %>
|
6
|
+
<%= header %>
|
7
|
+
<% end %>
|
8
|
+
</tr>
|
9
|
+
<tbody class="vt-table--body">
|
10
|
+
<% rows.each do |row| %>
|
11
|
+
<%= row %>
|
12
|
+
<% end %>
|
13
|
+
</tbody>
|
14
|
+
</table>
|
15
|
+
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<td class="<%= html_classes %>" <%= html_attributes %>>
|
2
2
|
<% if link_to? %>
|
3
|
-
<%= link_to link_path, class: "
|
3
|
+
<%= link_to link_path, class: "vt-table--division-link-to" do %>
|
4
4
|
<%= content || " ".html_safe %>
|
5
5
|
<% end %>
|
6
6
|
<% else %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Vitrail
|
4
|
-
|
4
|
+
module Table
|
5
5
|
class Division < BaseComponent
|
6
|
-
LOCAL_CLASSES = "
|
6
|
+
LOCAL_CLASSES = "vt-table--division"
|
7
7
|
|
8
8
|
private attr_reader :link_path
|
9
9
|
|
@@ -17,7 +17,7 @@ module Vitrail
|
|
17
17
|
def link_to? = link_path.present?
|
18
18
|
|
19
19
|
def local_classes
|
20
|
-
LOCAL_CLASSES + ("
|
20
|
+
LOCAL_CLASSES + (" vt-table--division-link-to-container" if link_to?).to_s
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Vitrail
|
4
|
-
|
4
|
+
module Table
|
5
5
|
class Header < BaseComponent
|
6
6
|
erb_template <<~ERB.squish
|
7
|
-
<th class="<%= html_classes %> scope="col" <%= html_attributes %>>
|
7
|
+
<th class="<%= html_classes %>" scope="col" <%= html_attributes %>>
|
8
8
|
<%= content %>
|
9
9
|
</th>
|
10
10
|
ERB
|
11
11
|
|
12
|
-
LOCAL_CLASSES = "
|
12
|
+
LOCAL_CLASSES = "vt-table--header"
|
13
13
|
|
14
14
|
private
|
15
15
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Vitrail
|
4
|
-
|
4
|
+
module Table
|
5
5
|
class Row < BaseComponent
|
6
6
|
erb_template <<~ERB.squish
|
7
|
-
<tr class="group" <%= html_attributes %>>
|
7
|
+
<tr class="vt-table--row group" <%= html_attributes %>>
|
8
8
|
<% divisions.each do |division| %>
|
9
9
|
<%= division %>
|
10
10
|
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vitrail
|
4
|
+
module Title
|
5
|
+
class Component < BaseComponent
|
6
|
+
erb_template <<~ERB.squish
|
7
|
+
<h<%= level %> class="<%= html_classes %>" <%= html_attributes %>>
|
8
|
+
<%= content %>
|
9
|
+
</h<%= level %>>
|
10
|
+
ERB
|
11
|
+
|
12
|
+
def initialize(html_options = {})
|
13
|
+
@level = html_options.delete(:level) || 1
|
14
|
+
super(**html_options)
|
15
|
+
|
16
|
+
raise ArgumentError, "Invalid level: #{level}" unless LEVEL_CLASSES[level]
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_reader :level
|
22
|
+
|
23
|
+
LEVEL_CLASSES = {
|
24
|
+
1 => "vt-title--level1",
|
25
|
+
2 => "vt-title--level2",
|
26
|
+
3 => "vt-title--level3",
|
27
|
+
4 => "vt-title--level4",
|
28
|
+
}.freeze
|
29
|
+
private_constant :LEVEL_CLASSES
|
30
|
+
|
31
|
+
def local_classes = "vt-title #{LEVEL_CLASSES[level]}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vitrail
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
source_root File.expand_path("templates", __dir__)
|
7
|
+
|
8
|
+
def copy_stylesheets
|
9
|
+
directory "stylesheets", "lib/assets/stylesheets"
|
10
|
+
end
|
11
|
+
|
12
|
+
def copy_preset
|
13
|
+
template "vitrail_preset.js", "lib/assets/vitrail_preset.js"
|
14
|
+
end
|
15
|
+
|
16
|
+
# In `app/assets/stylesheets/application.tailwind.css`, makes these changes:
|
17
|
+
# ```diff
|
18
|
+
# - @tailwind base;
|
19
|
+
# - @tailwind components;
|
20
|
+
# - @tailwind utilities;
|
21
|
+
# + @import "tailwindcss/base";
|
22
|
+
# + @import "tailwindcss/components";
|
23
|
+
# + @import "tailwindcss/utilities";
|
24
|
+
# + @import "../../../lib/assets/stylesheets/vitrail/index.css";
|
25
|
+
# ```
|
26
|
+
def load_stylesheets
|
27
|
+
gsub_file "app/assets/stylesheets/application.tailwind.css", /@tailwind base;/, '@import "tailwindcss/base";'
|
28
|
+
gsub_file "app/assets/stylesheets/application.tailwind.css", /@tailwind components;/, '@import "tailwindcss/components";'
|
29
|
+
gsub_file "app/assets/stylesheets/application.tailwind.css", /@tailwind utilities;/, '@import "tailwindcss/utilities";'
|
30
|
+
inject_into_file "app/assets/stylesheets/application.tailwind.css", after: "@import \"tailwindcss/utilities\";\n" do
|
31
|
+
"@import \"../../../lib/assets/stylesheets/vitrail/index.css\";\n"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def config_tailwind
|
36
|
+
inject_into_file "config/tailwind.config.js", after: "module.exports = {\n" do
|
37
|
+
<<-JS
|
38
|
+
presets: [
|
39
|
+
require('../lib/assets/vitrail_preset.js')
|
40
|
+
],
|
41
|
+
JS
|
42
|
+
end
|
43
|
+
|
44
|
+
inject_into_file "config/tailwind.config.js", after: "content: [\n" do
|
45
|
+
" './lib/assets/stylesheets/vitrail/*.css',\n"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@layer components {
|
2
|
+
.button {
|
3
|
+
@apply inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50;
|
4
|
+
}
|
5
|
+
.button--variant-default {
|
6
|
+
@apply bg-primary text-primary-foreground hover:bg-primary/90;
|
7
|
+
}
|
8
|
+
.button--variant-destructive {
|
9
|
+
@apply bg-destructive text-destructive-foreground hover:bg-destructive/90;
|
10
|
+
}
|
11
|
+
.button--variant-outline {
|
12
|
+
@apply border border-input bg-background hover:bg-accent hover:text-accent-foreground;
|
13
|
+
}
|
14
|
+
.button--variant-secondary {
|
15
|
+
@apply bg-secondary text-secondary-foreground hover:bg-secondary/80;
|
16
|
+
}
|
17
|
+
.button--variant-ghost {
|
18
|
+
@apply hover:bg-accent hover:text-accent-foreground;
|
19
|
+
}
|
20
|
+
.button--variant-link {
|
21
|
+
@apply text-primary underline-offset-4 hover:underline;
|
22
|
+
}
|
23
|
+
|
24
|
+
.button--size-default {
|
25
|
+
@apply h-10 px-4 py-2;
|
26
|
+
}
|
27
|
+
.button--size-sm {
|
28
|
+
@apply h-9 rounded-md px-3;
|
29
|
+
}
|
30
|
+
.button--size-lg {
|
31
|
+
@apply h-11 rounded-md px-8;
|
32
|
+
}
|
33
|
+
.button--size-icon {
|
34
|
+
@apply h-10 w-10;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@layer components {
|
2
|
+
.vt-card {
|
3
|
+
@apply rounded-lg border shadow-sm bg-card text-card-foreground p-6 space-y-4 min-w-fit;
|
4
|
+
}
|
5
|
+
.vt-card > header {
|
6
|
+
@apply flex flex-col space-y-1.5;
|
7
|
+
}
|
8
|
+
|
9
|
+
.vt-card > header > .vt-card--title {
|
10
|
+
@apply text-2xl font-semibold leading-none tracking-tight flex justify-between items-center;
|
11
|
+
}
|
12
|
+
|
13
|
+
.vt-card > header > .vt-card--description {
|
14
|
+
@apply text-sm text-muted-foreground;
|
15
|
+
}
|
16
|
+
|
17
|
+
.vt-card > footer {
|
18
|
+
@apply flex justify-between items-center;
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@layer base {
|
2
|
+
:root {
|
3
|
+
--border: var(--hsl-zinc-200);
|
4
|
+
--input: var(--hsl-zinc-200);
|
5
|
+
--ring: var(--hsl-zinc-400);
|
6
|
+
--background: var(--hsl-white);
|
7
|
+
--foreground: var(--hsl-zinc-950);
|
8
|
+
--primary: var(--hsl-zinc-900);
|
9
|
+
--primary-foreground: var(--hsl-zinc-50);
|
10
|
+
--secondary: var(--hsl-zinc-100);
|
11
|
+
--secondary-foreground: var(--hsl-zinc-900);
|
12
|
+
--destructive: var(--hsl-red-600);
|
13
|
+
--destructive-foreground: var(--hsl-zinc-50);
|
14
|
+
--muted: var(--hsl-zinc-100);
|
15
|
+
--muted-foreground: var(--hsl-zinc-500);
|
16
|
+
--accent: var(--hsl-zinc-100);
|
17
|
+
--accent-foreground: var(--hsl-zinc-900);
|
18
|
+
--popover: var(--hsl-white);
|
19
|
+
--popover-foreground: var(--hsl-zinc-950);
|
20
|
+
--card: var(--hsl-white);
|
21
|
+
--card-foreground: var(--hsl-zinc-950);
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@layer components {
|
2
|
+
.vt-link {
|
3
|
+
@apply inline-flex items-center justify-center whitespace-nowrap rounded-md;
|
4
|
+
@apply text-sm font-medium ring-offset-background transition-colors;
|
5
|
+
@apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
|
6
|
+
@apply disabled:pointer-events-none disabled:opacity-50;
|
7
|
+
}
|
8
|
+
.vt-link--variant-primary {
|
9
|
+
@apply bg-primary text-primary-foreground hover:bg-primary/90;
|
10
|
+
}
|
11
|
+
.vt-link--variant-outline {
|
12
|
+
@apply border border-input bg-background hover:bg-accent hover:text-accent-foreground;
|
13
|
+
}
|
14
|
+
.vt-link--variant-secondary {
|
15
|
+
@apply bg-secondary text-secondary-foreground hover:bg-secondary/70;
|
16
|
+
}
|
17
|
+
.vt-link--variant-ghost {
|
18
|
+
@apply hover:bg-accent hover:text-accent-foreground;
|
19
|
+
}
|
20
|
+
.vt-link--variant-default {
|
21
|
+
@apply text-primary underline-offset-4 hover:underline;
|
22
|
+
}
|
23
|
+
|
24
|
+
.vt-link--size-default {
|
25
|
+
@apply h-10 px-4 py-2;
|
26
|
+
}
|
27
|
+
.vt-link--size-sm {
|
28
|
+
@apply h-9 rounded-md px-3;
|
29
|
+
}
|
30
|
+
.vt-link--size-lg {
|
31
|
+
@apply h-11 rounded-md px-8;
|
32
|
+
}
|
33
|
+
.vt-link--size-icon {
|
34
|
+
@apply h-10 w-10;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/* HSL Values from https://tailscan.com/colors */
|
2
|
+
@layer base {
|
3
|
+
:root {
|
4
|
+
--hsl-white: 0deg 0% 100%;
|
5
|
+
|
6
|
+
--hsl-zinc-50: 0deg 0% 98%;
|
7
|
+
--hsl-zinc-100: 240deg 5% 96%;
|
8
|
+
--hsl-zinc-200: 240deg 6% 90%;
|
9
|
+
--hsl-zinc-400: 240deg 5% 65%;
|
10
|
+
--hsl-zinc-500: 240deg 4% 46%;
|
11
|
+
--hsl-zinc-900: 240deg 6% 10%;
|
12
|
+
--hsl-zinc-950: 240deg 10% 4%;
|
13
|
+
|
14
|
+
--hsl-slate-50: 210deg 40% 98%;
|
15
|
+
--hsl-slate-100: 210deg 40% 96%;
|
16
|
+
--hsl-slate-200: 214deg 32% 91%;
|
17
|
+
--hsl-slate-400: 215deg 20% 65%;
|
18
|
+
--hsl-slate-500: 215deg 16% 47%;
|
19
|
+
--hsl-slate-900: 222deg 47% 11%;
|
20
|
+
--hsl-slate-950: 229deg 84% 5%;
|
21
|
+
|
22
|
+
--hsl-red-600: 0deg 72% 51%;
|
23
|
+
}
|
24
|
+
}
|