forked from ruby-ui/ruby_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add standardrb and apply standardization to lib/*
- Loading branch information
1 parent
f24761a
commit 47ec075
Showing
130 changed files
with
2,323 additions
and
2,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: StandardRB | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
standard: | ||
name: StandardRB Check Action | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2 | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
- run: bundle exec standardrb --format progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
parallel: true | ||
ruby_version: 3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
gemspec | ||
|
||
gem "standard", "~> 1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
phlex_ui (0.1.4) | ||
phlex (~> 1.7) | ||
rouge (~> 4.2.0) | ||
ruby-next (~> 1.0) | ||
zeitwerk (~> 2.6) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.2) | ||
cgi (0.4.1) | ||
concurrent-ruby (1.2.2) | ||
diff-lcs (1.5.0) | ||
erb (4.0.3) | ||
cgi (>= 0.3.3) | ||
json (2.7.1) | ||
language_server-protocol (3.17.0.3) | ||
lint_roller (1.1.0) | ||
paco (0.2.3) | ||
parallel (1.24.0) | ||
parser (3.2.2.4) | ||
ast (~> 2.4.1) | ||
racc | ||
phlex (1.9.0) | ||
concurrent-ruby (~> 1.2) | ||
erb (>= 4) | ||
zeitwerk (~> 2.6) | ||
racc (1.7.3) | ||
rainbow (3.1.1) | ||
rake (13.1.0) | ||
regexp_parser (2.8.3) | ||
require-hooks (0.2.2) | ||
rexml (3.2.6) | ||
rouge (4.2.0) | ||
rubocop (1.59.0) | ||
json (~> 2.3) | ||
language_server-protocol (>= 3.17.0) | ||
parallel (~> 1.10) | ||
parser (>= 3.2.2.4) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 1.8, < 3.0) | ||
rexml (>= 3.2.5, < 4.0) | ||
rubocop-ast (>= 1.30.0, < 2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 2.4.0, < 3.0) | ||
rubocop-ast (1.30.0) | ||
parser (>= 3.2.1.0) | ||
rubocop-performance (1.20.1) | ||
rubocop (>= 1.48.1, < 2.0) | ||
rubocop-ast (>= 1.30.0, < 2.0) | ||
ruby-next (1.0.0) | ||
paco (~> 0.2) | ||
require-hooks (~> 0.2) | ||
ruby-next-core (= 1.0.0) | ||
ruby-next-parser (>= 3.2.2.0) | ||
unparser (~> 0.6.0) | ||
ruby-next-core (1.0.0) | ||
ruby-next-parser (3.2.2.0) | ||
parser (>= 3.0.3.1) | ||
ruby-progressbar (1.13.0) | ||
standard (1.33.0) | ||
language_server-protocol (~> 3.17.0.2) | ||
lint_roller (~> 1.0) | ||
rubocop (~> 1.59.0) | ||
standard-custom (~> 1.0.0) | ||
standard-performance (~> 1.3) | ||
standard-custom (1.0.2) | ||
lint_roller (~> 1.0) | ||
rubocop (~> 1.50) | ||
standard-performance (1.3.0) | ||
lint_roller (~> 1.1) | ||
rubocop-performance (~> 1.20.1) | ||
unicode-display_width (2.5.0) | ||
unparser (0.6.10) | ||
diff-lcs (~> 1.3) | ||
parser (>= 3.2.2.4) | ||
zeitwerk (2.6.12) | ||
|
||
PLATFORMS | ||
arm64-darwin-23 | ||
ruby | ||
|
||
DEPENDENCIES | ||
phlex_ui! | ||
rake | ||
ruby-next (~> 1.0) | ||
standard (~> 1.0) | ||
|
||
BUNDLED WITH | ||
2.5.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# PhlexUI | ||
|
||
A UI component library, crafted precisely for Ruby devs who want to stay organized and build modern apps, fast. | ||
|
||
Visit [phlexui.com](https://phlexui.com) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "standard/rake" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
require 'phlex' | ||
require 'zeitwerk' | ||
require "ruby-next" | ||
|
||
require "ruby-next/language/setup" | ||
RubyNext::Language.setup_gem_load_path(transpile: true) | ||
|
||
require "phlex" | ||
require "zeitwerk" | ||
|
||
loader = Zeitwerk::Loader.for_gem | ||
loader.inflector.inflect( | ||
"phlex_ui" => "PhlexUI", | ||
"phlex_ui" => "PhlexUI" | ||
) | ||
loader.setup # ready! | ||
|
||
module PhlexUI | ||
end | ||
|
||
loader.eager_load | ||
loader.eager_load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module PhlexUI | ||
class Accordion < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
class Accordion < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
|
||
private | ||
private | ||
|
||
def default_attrs | ||
{ | ||
class: 'w-full' | ||
} | ||
end | ||
def default_attrs | ||
{ | ||
class: "w-full" | ||
} | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
module PhlexUI | ||
class Accordion::Builder < Base | ||
def template(&block) | ||
render PhlexUI::Accordion.new(**attrs) do | ||
block.call | ||
end | ||
end | ||
class Accordion::Builder < Base | ||
def template(&block) | ||
render PhlexUI::Accordion.new(**attrs) do | ||
block.call | ||
end | ||
end | ||
|
||
def add_item(title, content, open: false) | ||
render Accordion::Item.new(open: open) do | ||
render PhlexUI::Accordion::Trigger.new do | ||
render PhlexUI::Accordion::DefaultTrigger.new { title } | ||
end | ||
render PhlexUI::Accordion::Content.new do | ||
render PhlexUI::Accordion::DefaultContent.new { content } | ||
end | ||
end | ||
def add_item(title, content, open: false) | ||
render Accordion::Item.new(open: open) do | ||
render PhlexUI::Accordion::Trigger.new do | ||
render PhlexUI::Accordion::DefaultTrigger.new { title } | ||
end | ||
render PhlexUI::Accordion::Content.new do | ||
render PhlexUI::Accordion::DefaultContent.new { content } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module PhlexUI | ||
class Accordion::Content < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
class Accordion::Content < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
|
||
private | ||
private | ||
|
||
def default_attrs | ||
{ | ||
data: { | ||
accordion_target: "content" | ||
}, | ||
class: 'overflow-y-hidden', | ||
style: 'height: 0px;' | ||
} | ||
end | ||
def default_attrs | ||
{ | ||
data: { | ||
accordion_target: "content" | ||
}, | ||
class: "overflow-y-hidden", | ||
style: "height: 0px;" | ||
} | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module PhlexUI | ||
class Accordion::DefaultContent < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
class Accordion::DefaultContent < Base | ||
def template(&) | ||
div(**attrs, &) | ||
end | ||
|
||
private | ||
private | ||
|
||
def default_attrs | ||
{ | ||
class: 'pb-4 pt-0 text-sm' | ||
} | ||
end | ||
def default_attrs | ||
{ | ||
class: "pb-4 pt-0 text-sm" | ||
} | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module PhlexUI | ||
class Accordion::DefaultTrigger < Base | ||
def template(&) | ||
div(class: "flex items-center justify-between w-full") do | ||
p(&) | ||
render ::PhlexUI::Accordion::Icon.new | ||
end | ||
end | ||
class Accordion::DefaultTrigger < Base | ||
def template(&) | ||
div(class: "flex items-center justify-between w-full") do | ||
p(&) | ||
render ::PhlexUI::Accordion::Icon.new | ||
end | ||
end | ||
|
||
def default_attrs | ||
{ | ||
data: { action: "click->accordion#toggle" }, | ||
class: 'w-full flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline' | ||
} | ||
end | ||
def default_attrs | ||
{ | ||
data: {action: "click->accordion#toggle"}, | ||
class: "w-full flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline" | ||
} | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.