relay_ui 0.1.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 +7 -0
- data/Rakefile +64 -0
- data/app/assets/javascripts/relay_ui/index.js +5 -0
- data/app/assets/stylesheets/relay_ui/application.css +1 -0
- data/app/components/badges/base.rb +5 -0
- data/app/components/badges/blue.rb +5 -0
- data/app/components/badges/gray.rb +5 -0
- data/app/components/badges/green.rb +5 -0
- data/app/components/badges/purple.rb +5 -0
- data/app/components/badges/red.rb +5 -0
- data/app/components/badges/yellow.rb +5 -0
- data/app/components/base.rb +15 -0
- data/app/components/buttons/base.rb +30 -0
- data/app/components/buttons/destructive.rb +5 -0
- data/app/components/buttons/ghost.rb +5 -0
- data/app/components/buttons/link.rb +9 -0
- data/app/components/buttons/outline.rb +5 -0
- data/app/components/buttons/primary.rb +5 -0
- data/app/components/buttons/secondary.rb +5 -0
- data/app/components/code_block.rb +13 -0
- data/app/components/headings.rb +37 -0
- data/app/components/icon.rb +9 -0
- data/app/components/lists/base.rb +13 -0
- data/app/components/lists/ordered.rb +5 -0
- data/app/components/lists/unordered.rb +5 -0
- data/app/components/navigation.rb +49 -0
- data/app/components/slideout.rb +20 -0
- data/app/components/text.rb +19 -0
- data/lib/relay_ui/engine.rb +19 -0
- data/lib/relay_ui/version.rb +5 -0
- data/lib/relay_ui.rb +9 -0
- data/package.json +16 -0
- data/tailwind.config.js +10 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 810abe5f7ea49a12bd4c1adfb1ae77895648ac78a7c9ec462980d60adf2364a9
|
4
|
+
data.tar.gz: b8f3b86b3079cfa79265d5d70bd9e05bd3a6dee1a25b40021a5c63243a71fa9f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bb3fee20245f10d29113a71e4b3ad94b0e24ebf3a31363f49172b9b74b68bffa8daf08e5d56febfa0c7d14742892c8864a03555f1d4a0ea72e9cce03c5124836
|
7
|
+
data.tar.gz: 5156fc61323221af3512d46c4c10113fa13b36cbee5eba7abb184b8f690e74544192138334f5d92b67f67b9e928a9888e727074fcc792acd657de82a9d0a0279
|
data/Rakefile
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
require "rubocop/rake_task"
|
9
|
+
|
10
|
+
RuboCop::RakeTask.new
|
11
|
+
|
12
|
+
task default: %i[spec rubocop]
|
13
|
+
|
14
|
+
namespace :build do
|
15
|
+
desc "Build JavaScript"
|
16
|
+
task :js do
|
17
|
+
sh "npm run build:js"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Build CSS"
|
21
|
+
task :css do
|
22
|
+
sh "npm run build:css"
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Build all assets"
|
26
|
+
task :assets => [:js, :css]
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :watch do
|
30
|
+
desc "Watch JavaScript files and rebuild on changes"
|
31
|
+
task :js do
|
32
|
+
sh "npm run watch:js"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Watch CSS files and rebuild on changes"
|
36
|
+
task :css do
|
37
|
+
sh "npm run watch:css"
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Watch all assets and rebuild on changes"
|
41
|
+
task :assets do
|
42
|
+
puts "Starting asset watchers for both JS and CSS..."
|
43
|
+
puts "Press Ctrl-C to stop watching"
|
44
|
+
|
45
|
+
# Run both watchers in parallel using a basic approach that works across platforms
|
46
|
+
trap("INT") { exit }
|
47
|
+
|
48
|
+
# Fork processes for each watcher
|
49
|
+
pid1 = Process.fork { sh "npm run watch:js" }
|
50
|
+
pid2 = Process.fork { sh "npm run watch:css" }
|
51
|
+
|
52
|
+
# Wait for any process to exit
|
53
|
+
Process.wait(pid1)
|
54
|
+
Process.wait(pid2)
|
55
|
+
rescue Interrupt
|
56
|
+
puts "\nShutting down watchers..."
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
task :build => ["build:assets"]
|
61
|
+
task :watch => ["watch:assets"]
|
62
|
+
task :default => ["build"]
|
63
|
+
|
64
|
+
CLEAN.include("vendor")
|
@@ -0,0 +1 @@
|
|
1
|
+
@import 'tailwindcss';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RelayUi::Base < Phlex::HTML
|
4
|
+
include Components
|
5
|
+
include Phlex::Rails::Helpers::Routes
|
6
|
+
|
7
|
+
register_value_helper :request
|
8
|
+
|
9
|
+
if Rails.env.development?
|
10
|
+
def before_template
|
11
|
+
comment { "Before #{self.class.name}" }
|
12
|
+
super
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class RelayUi::Buttons::Base < RelayUi::Base
|
2
|
+
def initialize(data: {}, href: "#", icon: nil)
|
3
|
+
@data = data
|
4
|
+
@href = href
|
5
|
+
@icon = icon
|
6
|
+
end
|
7
|
+
|
8
|
+
def view_template
|
9
|
+
div do
|
10
|
+
a(href: @href, class: classes, data: @data) do
|
11
|
+
div(class: "flex flex-row items-center gap-2") do
|
12
|
+
if @icon
|
13
|
+
div(class: "size-4 my-1") do
|
14
|
+
render RelayUi::Icon.new(@icon)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
span { yield } if block_given?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def classes
|
26
|
+
"#{base_classes} #{variant_classes}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def base_classes = "inline-block px-3 py-1 hover:cursor-pointer rounded transition duration-200 ease-in-out"
|
30
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module RelayUi::Headings
|
2
|
+
class H1 < RelayUi::Base
|
3
|
+
def view_template
|
4
|
+
h1(class: "text-5xl font-bold") { yield }
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class H2 < RelayUi::Base
|
9
|
+
def view_template
|
10
|
+
h2(class: "text-4xl font-bold") { yield }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class H3 < RelayUi::Base
|
15
|
+
def view_template
|
16
|
+
h3(class: "text-3xl font-bold") { yield }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class H4 < RelayUi::Base
|
21
|
+
def view_template
|
22
|
+
h4(class: "text-2xl font-bold") { yield }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class H5 < RelayUi::Base
|
27
|
+
def view_template
|
28
|
+
h5(class: "text-xl font-bold") { yield }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class H6 < RelayUi::Base
|
33
|
+
def view_template
|
34
|
+
h6(class: "text-lg font-bold") { yield }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class RelayUi::Navigation < RelayUi::Base
|
2
|
+
def view_template
|
3
|
+
div(class: "flex flex-col sticky top-0 max-h-screen overflow-y-auto mx-10 py-10") do
|
4
|
+
yield
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
def section_heading
|
9
|
+
p(class: "pt-8 pb-4 mt-6 text-sm font-semibold uppercase text-zinc-400 border-t border-zinc-200") do
|
10
|
+
yield
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def icon_link(href:, icon:)
|
15
|
+
if request.path == href
|
16
|
+
state_classes = "border-blue-700 text-zinc-700 **:[svg]:stroke-blue-700"
|
17
|
+
else
|
18
|
+
state_classes = "border-transparent text-zinc-400 hover:border-zinc-200 hover:text-zinc-700 **:[svg]:stroke-zinc-300 hover:**:[svg]:stroke-zinc-700"
|
19
|
+
end
|
20
|
+
|
21
|
+
a(href:, class: "inline-flex items-center gap-2 py-1 #{state_classes}") do
|
22
|
+
div(class: "size-4") do
|
23
|
+
render RelayUi::Icon.new(icon)
|
24
|
+
end
|
25
|
+
span { yield }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def text_link(href)
|
30
|
+
if request.path == href
|
31
|
+
state_classes = "border-blue-700 text-zinc-700"
|
32
|
+
else
|
33
|
+
state_classes = "border-transparent text-zinc-400 hover:border-zinc-200 hover:text-zinc-700"
|
34
|
+
end
|
35
|
+
|
36
|
+
a(href:, class: "text-zinc-400 px-5 py-1 border-l-3 #{state_classes}") do
|
37
|
+
span { yield }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def coming_soon
|
42
|
+
div(class: "flex flex-row items-center") do
|
43
|
+
span(class: "text-zinc-400 px-5 py-1 border-l-3 border-transparent") do
|
44
|
+
yield
|
45
|
+
end
|
46
|
+
render RelayUi::Badges::Gray.new { "Coming Soon" }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class RelayUi::Slideout < RelayUi::Base
|
2
|
+
include Phlex::Rails::Helpers::TurboFrameTag
|
3
|
+
|
4
|
+
def view_template
|
5
|
+
turbo_frame_tag "slideout" do
|
6
|
+
div(class: "absolute inset-0 z-50", data: {controller: "slideout"}) do
|
7
|
+
a(href: "#", class: "cursor-default", data: { action: "slideout#hide" }) do
|
8
|
+
div(id: "modal-curtain", class: "w-screen h-screen bg-black transition-opacity opacity-75")
|
9
|
+
end
|
10
|
+
div(class: "right-0 fixed inset-y-0 flex max-w-1/2 pointer-events-none") do
|
11
|
+
div(class: "w-screen pointer-events-auto", data: { slideout_target: "slideout" }) do
|
12
|
+
div(class: "w-full h-full bg-white shadow") do
|
13
|
+
yield
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module RelayUi::Text
|
2
|
+
class Large < RelayUi::Base
|
3
|
+
def view_template
|
4
|
+
p(class: "text-lg text-zinc-700") { yield }
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class Medium < RelayUi::Base
|
9
|
+
def view_template
|
10
|
+
p(class: "text-base text-zinc-700") { yield }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Small < RelayUi::Base
|
15
|
+
def view_template
|
16
|
+
p(class: "text-sm text-zinc-700") { yield }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RelayUi
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
isolate_namespace RelayUi
|
6
|
+
|
7
|
+
initializer "relay_ui.assets.precompile" do |app|
|
8
|
+
app.config.assets.paths << root.join("vendor", "assets", "stylesheets")
|
9
|
+
app.config.assets.paths << root.join("vendor", "assets", "javascripts")
|
10
|
+
end
|
11
|
+
|
12
|
+
initializer "relay_ui.autoload.components" do
|
13
|
+
Rails.autoloaders.main.push_dir(
|
14
|
+
"#{Gem::Specification.find_by_name('relay_ui').gem_dir}/app/components",
|
15
|
+
namespace: RelayUi
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/relay_ui.rb
ADDED
data/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"dependencies": {
|
3
|
+
"@hotwired/stimulus": "^3.0.0",
|
4
|
+
"@tailwindcss/cli": "^4.0.9",
|
5
|
+
"tailwindcss": "^4.0.9"
|
6
|
+
},
|
7
|
+
"devDependencies": {
|
8
|
+
"esbuild": "^0.25.0"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"build:js": "esbuild app/assets/javascripts/relay_ui/index.js --bundle --outfile=vendor/javascript/relay_ui/dist/relay_ui.js",
|
12
|
+
"build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/relay_ui/application.css -o ./vendor/assets/stylesheets/relay_ui/relay_ui.css",
|
13
|
+
"watch:js": "esbuild app/assets/javascripts/relay_ui/index.js --bundle --outfile=vendor/javascript/relay_ui/dist/relay_ui.js --watch",
|
14
|
+
"watch:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/relay_ui/application.css -o ./vendor/assets/stylesheets/relay_ui/relay_ui.css --watch"
|
15
|
+
}
|
16
|
+
}
|
data/tailwind.config.js
ADDED
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: relay_ui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- logicrelay
|
8
|
+
bindir: bin
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: phlex
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: 2.1.0
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 2.1.0
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: tabler_icons_ruby
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.11.0
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 3.11.0
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: rake
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: guard
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: guard-livereload
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: base64
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
description: 'RelayUI is an opinionated UI kit for Rails applications, leveraging
|
97
|
+
Phlex and TailwindCSS to provide a robust and cohesive design system, particularly
|
98
|
+
suited for B2B backend interfaces.
|
99
|
+
|
100
|
+
'
|
101
|
+
email:
|
102
|
+
- hello@logicrelay.com
|
103
|
+
executables: []
|
104
|
+
extensions: []
|
105
|
+
extra_rdoc_files: []
|
106
|
+
files:
|
107
|
+
- Rakefile
|
108
|
+
- app/assets/javascripts/relay_ui/index.js
|
109
|
+
- app/assets/stylesheets/relay_ui/application.css
|
110
|
+
- app/components/badges/base.rb
|
111
|
+
- app/components/badges/blue.rb
|
112
|
+
- app/components/badges/gray.rb
|
113
|
+
- app/components/badges/green.rb
|
114
|
+
- app/components/badges/purple.rb
|
115
|
+
- app/components/badges/red.rb
|
116
|
+
- app/components/badges/yellow.rb
|
117
|
+
- app/components/base.rb
|
118
|
+
- app/components/buttons/base.rb
|
119
|
+
- app/components/buttons/destructive.rb
|
120
|
+
- app/components/buttons/ghost.rb
|
121
|
+
- app/components/buttons/link.rb
|
122
|
+
- app/components/buttons/outline.rb
|
123
|
+
- app/components/buttons/primary.rb
|
124
|
+
- app/components/buttons/secondary.rb
|
125
|
+
- app/components/code_block.rb
|
126
|
+
- app/components/headings.rb
|
127
|
+
- app/components/icon.rb
|
128
|
+
- app/components/lists/base.rb
|
129
|
+
- app/components/lists/ordered.rb
|
130
|
+
- app/components/lists/unordered.rb
|
131
|
+
- app/components/navigation.rb
|
132
|
+
- app/components/slideout.rb
|
133
|
+
- app/components/text.rb
|
134
|
+
- lib/relay_ui.rb
|
135
|
+
- lib/relay_ui/engine.rb
|
136
|
+
- lib/relay_ui/version.rb
|
137
|
+
- package.json
|
138
|
+
- tailwind.config.js
|
139
|
+
homepage: https://www.relayui.com
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata:
|
143
|
+
homepage_uri: https://www.relayui.com
|
144
|
+
source_code_uri: https://github.com/logicrelay/relay_ui
|
145
|
+
changelog_uri: https://github.com/logicrelay/relay_ui/blob/main/CHANGELOG.md
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 3.0.0
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
requirements: []
|
160
|
+
rubygems_version: 3.6.2
|
161
|
+
specification_version: 4
|
162
|
+
summary: A delightfully opinionated UI kit for Rails apps.
|
163
|
+
test_files: []
|