solrengine-ui 0.2.0 → 0.2.2
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/app/components/solrengine/ui/collapse_component.html.erb +2 -2
- data/app/components/solrengine/ui/collapse_component.rb +2 -2
- data/app/components/solrengine/ui/token_icon_component.html.erb +1 -1
- data/app/components/solrengine/ui/token_icon_component.rb +5 -0
- data/lib/generators/solrengine/ui/install_generator.rb +21 -0
- data/lib/generators/solrengine/ui/templates/lookbook_preview.html.erb +12 -0
- data/lib/solrengine/ui/version.rb +1 -1
- data/previews/layouts/preview.html.erb +14 -0
- data/previews/solrengine/ui/collapse_component_preview.rb +4 -4
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3564aea452f55ee6744322d81aa5550d9317a16080123c3524008457dff6271e
|
|
4
|
+
data.tar.gz: f5af6ae7616484da6e824d1e394778dc9aeffa77679d0edbc096e272a7bd8761
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f41f46a12ef331346b04cb8dcff92827727d77a0589afd4c9026d522448f63d342d5d839ae39f1fdcdb79b96b37b8a8717506ccd35e57a64c2a4aabf9e076d34
|
|
7
|
+
data.tar.gz: cc02c2c5cd9bfb324195a96e89e5bab17b22e119251e7078a7d12658b48e9b5f3296c9b784daa6b8c4dff1cb0fc0acffe35367da643613f8c23f61ed77b81a18
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div data-controller="sui-collapse" data-sui-collapse-expanded-value="<%= expanded %>">
|
|
2
2
|
<button data-action="click->sui-collapse#toggle" class="w-full cursor-pointer">
|
|
3
|
-
<%=
|
|
3
|
+
<%= collapse_header %>
|
|
4
4
|
</button>
|
|
5
5
|
<div data-sui-collapse-target="content" class="<%= 'hidden' unless expanded %> overflow-hidden">
|
|
6
|
-
<%=
|
|
6
|
+
<%= collapse_body %>
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% if uri %>
|
|
2
|
-
<img src="<%= uri %>" alt="<%= symbol %>" class="<%= size_class %> rounded-full" loading="lazy" />
|
|
2
|
+
<img src="<%= uri %>" alt="<%= symbol %>" class="<%= size_class %> rounded-full object-cover shrink-0" style="<%= size_style %>" loading="lazy" />
|
|
3
3
|
<% else %>
|
|
4
4
|
<div class="<%= size_class %> rounded-full bg-purple-100 dark:bg-purple-900/50 text-purple-700 dark:text-purple-400 flex items-center justify-center text-sm font-bold">
|
|
5
5
|
<%= fallback_letter %>
|
|
@@ -42,6 +42,27 @@ module Solrengine
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def add_lookbook_preview_layout
|
|
46
|
+
layout_path = "app/views/layouts/lookbook_preview.html.erb"
|
|
47
|
+
return if File.exist?(layout_path)
|
|
48
|
+
|
|
49
|
+
copy_file "lookbook_preview.html.erb", layout_path
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def configure_lookbook_preview_layout
|
|
53
|
+
app_file = "config/application.rb"
|
|
54
|
+
content = File.read(app_file)
|
|
55
|
+
return if content.include?("lookbook.preview_layout")
|
|
56
|
+
|
|
57
|
+
inject_into_file app_file, before: /^ end/ do
|
|
58
|
+
<<~RUBY
|
|
59
|
+
|
|
60
|
+
# SolRengine UI Lookbook preview layout (loads Tailwind + dark mode)
|
|
61
|
+
config.lookbook.preview_layout = "lookbook_preview" if defined?(Lookbook)
|
|
62
|
+
RUBY
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
45
66
|
def show_post_install
|
|
46
67
|
say "\n SolRengine UI installed!", :green
|
|
47
68
|
say ""
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html class="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<%%= stylesheet_link_tag "application", data_turbo_track: "reload" %>
|
|
7
|
+
<%%= javascript_include_tag "application", data_turbo_track: "reload", defer: true %>
|
|
8
|
+
</head>
|
|
9
|
+
<body class="bg-gray-950 text-gray-100 p-6">
|
|
10
|
+
<%%= yield %>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
/* Inline base styles for Lookbook preview iframe */
|
|
3
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
4
|
+
body {
|
|
5
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
6
|
+
padding: 24px;
|
|
7
|
+
background: #111827;
|
|
8
|
+
color: #f3f4f6;
|
|
9
|
+
}
|
|
10
|
+
.dark { color-scheme: dark; }
|
|
11
|
+
</style>
|
|
12
|
+
<div class="dark">
|
|
13
|
+
<%= yield %>
|
|
14
|
+
</div>
|
|
@@ -4,16 +4,16 @@ class Solrengine::Ui::CollapseComponentPreview < Lookbook::Preview
|
|
|
4
4
|
# @label Collapsed
|
|
5
5
|
def collapsed
|
|
6
6
|
render(Solrengine::Ui::CollapseComponent.new) do |c|
|
|
7
|
-
c.
|
|
8
|
-
c.
|
|
7
|
+
c.with_collapse_header { "<div class='flex items-center justify-between py-2 text-gray-900 dark:text-white font-medium'>Transaction Details <span class='text-gray-400'>+</span></div>".html_safe }
|
|
8
|
+
c.with_collapse_body { "<div class='py-2 text-sm text-gray-600 dark:text-gray-300'>Signature: abc123...<br>Block: 12345678<br>Fee: 0.000005 SOL</div>".html_safe }
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
# @label Expanded
|
|
13
13
|
def expanded
|
|
14
14
|
render(Solrengine::Ui::CollapseComponent.new(expanded: true)) do |c|
|
|
15
|
-
c.
|
|
16
|
-
c.
|
|
15
|
+
c.with_collapse_header { "<div class='flex items-center justify-between py-2 text-gray-900 dark:text-white font-medium'>Transaction Details <span class='text-gray-400'>-</span></div>".html_safe }
|
|
16
|
+
c.with_collapse_body { "<div class='py-2 text-sm text-gray-600 dark:text-gray-300'>Signature: abc123...<br>Block: 12345678<br>Fee: 0.000005 SOL</div>".html_safe }
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solrengine-ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jose Ferrer
|
|
@@ -104,9 +104,11 @@ files:
|
|
|
104
104
|
- app/components/solrengine/ui/wallet_button_component.html.erb
|
|
105
105
|
- app/components/solrengine/ui/wallet_button_component.rb
|
|
106
106
|
- lib/generators/solrengine/ui/install_generator.rb
|
|
107
|
+
- lib/generators/solrengine/ui/templates/lookbook_preview.html.erb
|
|
107
108
|
- lib/solrengine/ui.rb
|
|
108
109
|
- lib/solrengine/ui/engine.rb
|
|
109
110
|
- lib/solrengine/ui/version.rb
|
|
111
|
+
- previews/layouts/preview.html.erb
|
|
110
112
|
- previews/solrengine/ui/address_component_preview.rb
|
|
111
113
|
- previews/solrengine/ui/airdrop_button_component_preview.rb
|
|
112
114
|
- previews/solrengine/ui/app_bar_component_preview.rb
|