Skip to content

Commit c96642a

Browse files
authored
Add verify_components.yml workflow (#238)
* Add verify_components.yml workflow Verify_components.yml workflow ensures components are properly generated ruby-ui/ruby_ui#289 should be merged first Button, Checkbox, Link, Separator, TableFooter, TableRow components were out of sync with ruby_ui. * add endline
1 parent 9ebc4e2 commit c96642a

File tree

11 files changed

+61
-33
lines changed

11 files changed

+61
-33
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Verify components
2+
3+
push:
4+
branches: "main"
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Build
14+
run: rails g ruby_ui:component:all
15+
16+
- uses: CatChen/check-git-status-action@v1
17+
with:
18+
fail-if-not-clean: true
19+
push-if-not-clean: false
20+
request-changes-if-not-clean: false
21+
targets: 'app' #optional

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gem "rails", "8.0.2"
88
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
99
gem "propshaft", "1.1.0"
1010
# Use sqlite3 as the database for Active Record
11-
gem "sqlite3", ">= 1.4"
11+
gem "sqlite3", "2.6.0"
1212
# Use the Puma web server [https://github.com/puma/puma]
1313
gem "puma", "6.6.0"
1414
# Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GIT
1414

1515
GIT
1616
remote: https://github.com/ruby-ui/ruby_ui.git
17-
revision: 6e6b50ef39f08ec25db2db58a80d5b461e44837f
17+
revision: f5a275f191c32bd50d8ab2876a32586cf9435866
1818
branch: main
1919
specs:
2020
ruby_ui (1.0.1)
@@ -337,7 +337,7 @@ DEPENDENCIES
337337
rouge (~> 4.5)
338338
ruby_ui!
339339
selenium-webdriver
340-
sqlite3 (>= 1.4)
340+
sqlite3 (= 2.6.0)
341341
standard
342342
stimulus-rails (= 1.3.4)
343343
tailwind_merge (~> 1.2.0)

app/components/ruby_ui/button/button.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ def destructive_classes
7272
[
7373
BASE_CLASSES,
7474
size_classes,
75-
"bg-destructive text-destructive-foreground shadow-sm",
76-
"hover:bg-destructive/90"
75+
"bg-destructive text-white shadow-sm",
76+
"[a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20",
77+
"dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"
7778
]
7879
end
7980

app/components/ruby_ui/checkbox/checkbox.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ def default_attrs
1616
ruby_ui__checkbox_group_target: "checkbox",
1717
action: "change->ruby-ui--checkbox-group#onChange change->ruby-ui--form-field#onInput invalid->ruby-ui--form-field#onInvalid"
1818
},
19-
class: "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 accent-primary"
19+
class: [
20+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background accent-primary",
21+
"disabled:cursor-not-allowed disabled:opacity-50",
22+
"aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none",
23+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
24+
]
2025
}
2126
end
2227
end

app/components/ruby_ui/link/link.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ def destructive_classes
7272
[
7373
BASE_CLASSES,
7474
size_classes,
75-
"bg-destructive text-destructive-foreground shadow-sm",
76-
"hover:bg-destructive/90"
75+
"bg-destructive text-white shadow-sm",
76+
"[a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20",
77+
"dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"
7778
]
7879
end
7980

app/components/ruby_ui/separator/separator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Separator < Base
77
def initialize(as: :div, orientation: :horizontal, decorative: true, **attrs)
88
raise ArgumentError, "Invalid orientation: #{orientation}" unless ORIENTATIONS.include?(orientation.to_sym)
99

10-
@as = as.to_sym
10+
@as = as
1111
@orientation = orientation.to_sym
1212
@decorative = decorative
1313
super(**attrs)

app/components/ruby_ui/table/table_footer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "border-t bg-muted bg-opacity-50 font-medium[& amp;>tr]:last:border-b-0"
13+
class: "border-t bg-muted/50 font-medium[& amp;>tr]:last:border-b-0"
1414
}
1515
end
1616
end

app/components/ruby_ui/table/table_row.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def view_template(&)
1010

1111
def default_attrs
1212
{
13-
class: "border-b transition-colors hover:bg-muted hover:bg-opacity-50 data-[state=selected]:bg-muted"
13+
class: "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
1414
}
1515
end
1616
end

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
"name": "app",
33
"private": true,
44
"dependencies": {
5-
"@floating-ui/dom": "^1.7.0",
5+
"@floating-ui/dom": "1.7.0",
66
"@hotwired/stimulus": "3.2.2",
77
"@hotwired/turbo-rails": "8.0.13",
8-
"@tailwindcss/forms": "^0.5.10",
9-
"@tailwindcss/typography": "^0.5.16",
8+
"@tailwindcss/forms": "0.5.10",
9+
"@tailwindcss/typography": "0.5.16",
1010
"autoprefixer": "10.4.21",
11-
"chart.js": "^4.4.9",
11+
"chart.js": "4.4.9",
1212
"class-variance-authority": "0.7.1",
1313
"clsx": "2.1.1",
14-
"embla-carousel": "^8.5.2",
14+
"embla-carousel": "8.6.0",
1515
"esbuild": "0.25.4",
16-
"fuse.js": "^7.1.0",
17-
"maska": "^3.1.1",
18-
"motion": "^12.10.5",
19-
"mustache": "^4.2.0",
16+
"fuse.js": "7.1.0",
17+
"maska": "3.1.1",
18+
"motion": "12.10.5",
19+
"mustache": "4.2.0",
2020
"tailwindcss": "4.1.6",
21-
"tippy.js": "^6.3.7",
22-
"tw-animate-css": "^1.2.9"
21+
"tippy.js": "6.3.7",
22+
"tw-animate-css": "1.2.9"
2323
},
2424
"scripts": {
2525
"build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets",

0 commit comments

Comments
 (0)