lycan_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/MIT-LICENSE +20 -0
- data/README.md +33 -0
- data/Rakefile +5 -0
- data/lib/generators/lycan_ui/add_generator.rb +109 -0
- data/lib/generators/lycan_ui/setup_generator.rb +76 -0
- data/lib/generators/lycan_ui/templates/components/accordion.rb +63 -0
- data/lib/generators/lycan_ui/templates/components/alert.rb +35 -0
- data/lib/generators/lycan_ui/templates/components/avatar.rb +38 -0
- data/lib/generators/lycan_ui/templates/components/badge.rb +29 -0
- data/lib/generators/lycan_ui/templates/components/button.rb +49 -0
- data/lib/generators/lycan_ui/templates/components/checkbox.rb +31 -0
- data/lib/generators/lycan_ui/templates/components/collapsible.rb +40 -0
- data/lib/generators/lycan_ui/templates/components/component.rb +72 -0
- data/lib/generators/lycan_ui/templates/components/dialog.rb +129 -0
- data/lib/generators/lycan_ui/templates/components/dropdown.rb +242 -0
- data/lib/generators/lycan_ui/templates/components/input.rb +26 -0
- data/lib/generators/lycan_ui/templates/components/label.rb +30 -0
- data/lib/generators/lycan_ui/templates/components/popover.rb +53 -0
- data/lib/generators/lycan_ui/templates/components/radio.rb +27 -0
- data/lib/generators/lycan_ui/templates/components/select.rb +38 -0
- data/lib/generators/lycan_ui/templates/components/switch.rb +26 -0
- data/lib/generators/lycan_ui/templates/components/textarea.rb +25 -0
- data/lib/generators/lycan_ui/templates/extras/form_builder.rb +90 -0
- data/lib/generators/lycan_ui/templates/javascript/accordion_controller.js +46 -0
- data/lib/generators/lycan_ui/templates/javascript/avatar_controller.js +34 -0
- data/lib/generators/lycan_ui/templates/javascript/collapsible_controller.js +23 -0
- data/lib/generators/lycan_ui/templates/javascript/dialog_controller.js +90 -0
- data/lib/generators/lycan_ui/templates/javascript/dropdown_controller.js +395 -0
- data/lib/generators/lycan_ui/templates/javascript/popover_controller.js +114 -0
- data/lib/generators/lycan_ui/templates/setup/application.tailwind.css +94 -0
- data/lib/generators/lycan_ui/templates/setup/lycan_ui_helper.rb +39 -0
- data/lib/lycan_ui/configuration.rb +32 -0
- data/lib/lycan_ui/railtie.rb +6 -0
- data/lib/lycan_ui/version.rb +3 -0
- data/lib/lycan_ui.rb +8 -0
- data/lib/tasks/lycan_ui_tasks.rake +6 -0
- metadata +107 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
4
|
+
@custom-variant hidden (&[hidden]:where(:not([hidden='until-found'])));
|
|
5
|
+
@custom-variant details (&::details-content);
|
|
6
|
+
@custom-variant details-open (&[open]::details-content);
|
|
7
|
+
|
|
8
|
+
@theme {
|
|
9
|
+
--color-on-background: var(--internal-on-background);
|
|
10
|
+
--color-on-surface: var(--internal-on-surface);
|
|
11
|
+
--color-on-primary: var(--internal-on-primary);
|
|
12
|
+
--color-on-secondary: var(--internal-on-secondary);
|
|
13
|
+
--color-on-accent: var(--internal-on-accent);
|
|
14
|
+
--color-on-danger: var(--internal-on-danger);
|
|
15
|
+
|
|
16
|
+
--color-background: var(--internal-background);
|
|
17
|
+
--color-surface: var(--internal-surface);
|
|
18
|
+
--color-primary: var(--internal-primary);
|
|
19
|
+
--color-secondary: var(--internal-secondary);
|
|
20
|
+
--color-accent: var(--internal-accent);
|
|
21
|
+
--color-danger: var(--internal-danger);
|
|
22
|
+
|
|
23
|
+
--shadow-switch: -1.25rem 0 0 0.125rem var(--color-surface) inset, 0 0 0 0.125rem var(--color-surface) inset;
|
|
24
|
+
--shadow-switch-checked: 1.25rem 0 0 0.125rem var(--color-accent) inset, 0 0 0 0.125rem var(--color-accent) inset
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@utility interpolate-keywords {
|
|
28
|
+
interpolate-size: allow-keywords;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@layer base {
|
|
32
|
+
:root {
|
|
33
|
+
color-scheme: light;
|
|
34
|
+
scrollbar-width: thin;
|
|
35
|
+
scrollbar-color: var(--color-surface) var(--color-background);
|
|
36
|
+
scrollbar-gutter: stable;
|
|
37
|
+
|
|
38
|
+
--internal-surface: var(--color-zinc-50);
|
|
39
|
+
--internal-on-surface: black;
|
|
40
|
+
|
|
41
|
+
--internal-surface: var(--color-zinc-200);
|
|
42
|
+
--internal-on-surface: black;
|
|
43
|
+
|
|
44
|
+
--internal-primary: var(--color-violet-500);
|
|
45
|
+
--internal-on-primary: white;
|
|
46
|
+
|
|
47
|
+
--internal-secondary: var(--color-sky-500);
|
|
48
|
+
--internal-on-secondary: white;
|
|
49
|
+
|
|
50
|
+
--internal-accent: var(--color-green-500);
|
|
51
|
+
--internal-on-accent: black;
|
|
52
|
+
|
|
53
|
+
--internal-danger: var(--color-rose-600);
|
|
54
|
+
--internal-on-danger: white;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
* {
|
|
58
|
+
scrollbar-width: thin;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
body {
|
|
62
|
+
@apply bg-background text-on-background font-sans;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dark {
|
|
66
|
+
color-scheme: dark;
|
|
67
|
+
|
|
68
|
+
--internal-surface: var(--color-zinc-800);
|
|
69
|
+
--internal-on-surface: white;
|
|
70
|
+
|
|
71
|
+
--internal-background: var(--color-zinc-950);
|
|
72
|
+
--internal-on-background: white;
|
|
73
|
+
|
|
74
|
+
--internal-primary: var(--color-violet-700);
|
|
75
|
+
--internal-on-primary: white;
|
|
76
|
+
|
|
77
|
+
--internal-secondary: var(--color-sky-600);
|
|
78
|
+
--internal-on-secondary: white;
|
|
79
|
+
|
|
80
|
+
--internal-accent: var(--color-emerald-600);
|
|
81
|
+
--internal-on-accent: black;
|
|
82
|
+
|
|
83
|
+
--internal-danger: var(--color-rose-800);
|
|
84
|
+
--internal-on-danger: white;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
button {
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
html:has(dialog[open]:modal) {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LycanUiHelper
|
|
4
|
+
COMPONENTS = Dir.glob(Rails.root.join("app/components/lycan_ui/*.rb"))
|
|
5
|
+
.map { |c| c.split("/").last.sub(".rb", "") }
|
|
6
|
+
.index_by(&:itself)
|
|
7
|
+
.transform_values { |c| "LycanUi::#{c.classify}".constantize }
|
|
8
|
+
.symbolize_keys
|
|
9
|
+
.freeze
|
|
10
|
+
|
|
11
|
+
class Builder
|
|
12
|
+
def initialize(view_context)
|
|
13
|
+
@view_context = view_context
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def respond_to_missing?(...)
|
|
17
|
+
true
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def method_missing(method, *args, **kwargs, &block)
|
|
21
|
+
component = COMPONENTS[method]
|
|
22
|
+
|
|
23
|
+
raise "Component LycanUi::#{method.to_s.classify} not found" if component.nil?
|
|
24
|
+
|
|
25
|
+
@view_context.render(component.new(*args, **kwargs), &block)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def ui
|
|
30
|
+
@ui ||= Builder.new(self)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def lycan_ui_id
|
|
34
|
+
@lycan_ui_id ||= 0
|
|
35
|
+
@lycan_ui_id += 1
|
|
36
|
+
|
|
37
|
+
"_l#{@lycan_ui_id}_"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LycanUi
|
|
4
|
+
class Configuration
|
|
5
|
+
DEFAULT_JAVASCRIPT_DIR = "app/javascript/controllers"
|
|
6
|
+
|
|
7
|
+
class << self
|
|
8
|
+
attr_accessor :stylesheet, :javascript_dir
|
|
9
|
+
|
|
10
|
+
def setup
|
|
11
|
+
json = {}
|
|
12
|
+
|
|
13
|
+
if File.exist?("#{Rails.root}/config/lycan_ui.json")
|
|
14
|
+
json = JSON.parse(File.read("#{Rails.root}/config/lycan_ui.json"))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
self.stylesheet = json["stylesheet"] || default_stylesheet
|
|
18
|
+
self.javascript_dir = json["javascript_dir"] || DEFAULT_JAVASCRIPT_DIR
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def default_stylesheet
|
|
24
|
+
if File.exist?("#{Rails.root}/app/assets/stylesheets/application.tailwind.css")
|
|
25
|
+
return "app/assets/stylesheets/application.tailwind.css"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
"app/assets/tailwind/application.css"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
data/lib/lycan_ui.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: lycan_ui
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Ethan Kircher
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 2025-05-26 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rails
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 7.1.3
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: 7.1.3
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: tty-prompt
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 0.23.1
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 0.23.1
|
|
40
|
+
description: View Component based UI framework for Rails.
|
|
41
|
+
email:
|
|
42
|
+
- ethanmichaelk@gmail.com
|
|
43
|
+
executables: []
|
|
44
|
+
extensions: []
|
|
45
|
+
extra_rdoc_files: []
|
|
46
|
+
files:
|
|
47
|
+
- MIT-LICENSE
|
|
48
|
+
- README.md
|
|
49
|
+
- Rakefile
|
|
50
|
+
- lib/generators/lycan_ui/add_generator.rb
|
|
51
|
+
- lib/generators/lycan_ui/setup_generator.rb
|
|
52
|
+
- lib/generators/lycan_ui/templates/components/accordion.rb
|
|
53
|
+
- lib/generators/lycan_ui/templates/components/alert.rb
|
|
54
|
+
- lib/generators/lycan_ui/templates/components/avatar.rb
|
|
55
|
+
- lib/generators/lycan_ui/templates/components/badge.rb
|
|
56
|
+
- lib/generators/lycan_ui/templates/components/button.rb
|
|
57
|
+
- lib/generators/lycan_ui/templates/components/checkbox.rb
|
|
58
|
+
- lib/generators/lycan_ui/templates/components/collapsible.rb
|
|
59
|
+
- lib/generators/lycan_ui/templates/components/component.rb
|
|
60
|
+
- lib/generators/lycan_ui/templates/components/dialog.rb
|
|
61
|
+
- lib/generators/lycan_ui/templates/components/dropdown.rb
|
|
62
|
+
- lib/generators/lycan_ui/templates/components/input.rb
|
|
63
|
+
- lib/generators/lycan_ui/templates/components/label.rb
|
|
64
|
+
- lib/generators/lycan_ui/templates/components/popover.rb
|
|
65
|
+
- lib/generators/lycan_ui/templates/components/radio.rb
|
|
66
|
+
- lib/generators/lycan_ui/templates/components/select.rb
|
|
67
|
+
- lib/generators/lycan_ui/templates/components/switch.rb
|
|
68
|
+
- lib/generators/lycan_ui/templates/components/textarea.rb
|
|
69
|
+
- lib/generators/lycan_ui/templates/extras/form_builder.rb
|
|
70
|
+
- lib/generators/lycan_ui/templates/javascript/accordion_controller.js
|
|
71
|
+
- lib/generators/lycan_ui/templates/javascript/avatar_controller.js
|
|
72
|
+
- lib/generators/lycan_ui/templates/javascript/collapsible_controller.js
|
|
73
|
+
- lib/generators/lycan_ui/templates/javascript/dialog_controller.js
|
|
74
|
+
- lib/generators/lycan_ui/templates/javascript/dropdown_controller.js
|
|
75
|
+
- lib/generators/lycan_ui/templates/javascript/popover_controller.js
|
|
76
|
+
- lib/generators/lycan_ui/templates/setup/application.tailwind.css
|
|
77
|
+
- lib/generators/lycan_ui/templates/setup/lycan_ui_helper.rb
|
|
78
|
+
- lib/lycan_ui.rb
|
|
79
|
+
- lib/lycan_ui/configuration.rb
|
|
80
|
+
- lib/lycan_ui/railtie.rb
|
|
81
|
+
- lib/lycan_ui/version.rb
|
|
82
|
+
- lib/tasks/lycan_ui_tasks.rake
|
|
83
|
+
homepage: https://github.com/MSILycanthropy/lycan_ui
|
|
84
|
+
licenses:
|
|
85
|
+
- MIT
|
|
86
|
+
metadata:
|
|
87
|
+
homepage_uri: https://github.com/MSILycanthropy/lycan_ui
|
|
88
|
+
source_code_uri: https://github.com/MSILycanthropy/lycan_ui
|
|
89
|
+
changelog_uri: https://github.com/MSILycanthropy/lycan_ui/blob/main/CHANGELOG.md
|
|
90
|
+
rdoc_options: []
|
|
91
|
+
require_paths:
|
|
92
|
+
- lib
|
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - ">="
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '0'
|
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
requirements: []
|
|
104
|
+
rubygems_version: 3.6.2
|
|
105
|
+
specification_version: 4
|
|
106
|
+
summary: View Component based UI framework for Rails.
|
|
107
|
+
test_files: []
|