From 4b638b81ca8022debd79dde68af003f86ac1954e Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 11 May 2025 13:08:02 -0300 Subject: [PATCH 1/2] Add verify_components.yml workflow Verify_components.yml workflow ensures components are properly generated https://github.com/ruby-ui/ruby_ui/pull/289 should be merged first Button, Checkbox, Link, Separator, TableFooter, TableRow components were out of sync with ruby_ui. --- .github/workflows/verify_components.yml | 21 +++++++++++++++++++ Gemfile | 2 +- Gemfile.lock | 4 ++-- app/components/ruby_ui/button/button.rb | 5 +++-- app/components/ruby_ui/checkbox/checkbox.rb | 7 ++++++- app/components/ruby_ui/link/link.rb | 5 +++-- app/components/ruby_ui/separator/separator.rb | 2 +- app/components/ruby_ui/table/table_footer.rb | 2 +- app/components/ruby_ui/table/table_row.rb | 2 +- package.json | 2 +- pnpm-lock.yaml | 2 +- 11 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/verify_components.yml diff --git a/.github/workflows/verify_components.yml b/.github/workflows/verify_components.yml new file mode 100644 index 00000000..43377a1f --- /dev/null +++ b/.github/workflows/verify_components.yml @@ -0,0 +1,21 @@ +name: Verify components + +push: + branches: "main" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Build + run: rails g ruby_ui:component:all + + - uses: CatChen/check-git-status-action@v1 + with: + fail-if-not-clean: true + push-if-not-clean: false + request-changes-if-not-clean: false + targets: 'app' #optional \ No newline at end of file diff --git a/Gemfile b/Gemfile index d8932224..aa5377a3 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem "rails", "8.0.2" # The modern asset pipeline for Rails [https://github.com/rails/propshaft] gem "propshaft", "1.1.0" # Use sqlite3 as the database for Active Record -gem "sqlite3", ">= 1.4" +gem "sqlite3", "2.6.0" # Use the Puma web server [https://github.com/puma/puma] gem "puma", "6.6.0" # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails] diff --git a/Gemfile.lock b/Gemfile.lock index 6b827d9d..114e6434 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,7 +14,7 @@ GIT GIT remote: https://github.com/ruby-ui/ruby_ui.git - revision: 6e6b50ef39f08ec25db2db58a80d5b461e44837f + revision: f5a275f191c32bd50d8ab2876a32586cf9435866 branch: main specs: ruby_ui (1.0.1) @@ -337,7 +337,7 @@ DEPENDENCIES rouge (~> 4.5) ruby_ui! selenium-webdriver - sqlite3 (>= 1.4) + sqlite3 (= 2.6.0) standard stimulus-rails (= 1.3.4) tailwind_merge (~> 1.2.0) diff --git a/app/components/ruby_ui/button/button.rb b/app/components/ruby_ui/button/button.rb index 00750853..1eb92106 100644 --- a/app/components/ruby_ui/button/button.rb +++ b/app/components/ruby_ui/button/button.rb @@ -72,8 +72,9 @@ def destructive_classes [ BASE_CLASSES, size_classes, - "bg-destructive text-destructive-foreground shadow-sm", - "hover:bg-destructive/90" + "bg-destructive text-white shadow-sm", + "[a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20", + "dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" ] end diff --git a/app/components/ruby_ui/checkbox/checkbox.rb b/app/components/ruby_ui/checkbox/checkbox.rb index 391289d9..977bb9fe 100644 --- a/app/components/ruby_ui/checkbox/checkbox.rb +++ b/app/components/ruby_ui/checkbox/checkbox.rb @@ -16,7 +16,12 @@ def default_attrs ruby_ui__checkbox_group_target: "checkbox", action: "change->ruby-ui--checkbox-group#onChange change->ruby-ui--form-field#onInput invalid->ruby-ui--form-field#onInvalid" }, - 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" + class: [ + "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background accent-primary", + "disabled:cursor-not-allowed disabled:opacity-50", + "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none", + "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" + ] } end end diff --git a/app/components/ruby_ui/link/link.rb b/app/components/ruby_ui/link/link.rb index 424ab79e..be988767 100644 --- a/app/components/ruby_ui/link/link.rb +++ b/app/components/ruby_ui/link/link.rb @@ -72,8 +72,9 @@ def destructive_classes [ BASE_CLASSES, size_classes, - "bg-destructive text-destructive-foreground shadow-sm", - "hover:bg-destructive/90" + "bg-destructive text-white shadow-sm", + "[a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20", + "dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" ] end diff --git a/app/components/ruby_ui/separator/separator.rb b/app/components/ruby_ui/separator/separator.rb index 4c489647..92347347 100644 --- a/app/components/ruby_ui/separator/separator.rb +++ b/app/components/ruby_ui/separator/separator.rb @@ -7,7 +7,7 @@ class Separator < Base def initialize(as: :div, orientation: :horizontal, decorative: true, **attrs) raise ArgumentError, "Invalid orientation: #{orientation}" unless ORIENTATIONS.include?(orientation.to_sym) - @as = as.to_sym + @as = as @orientation = orientation.to_sym @decorative = decorative super(**attrs) diff --git a/app/components/ruby_ui/table/table_footer.rb b/app/components/ruby_ui/table/table_footer.rb index 156d7683..24bf71ac 100644 --- a/app/components/ruby_ui/table/table_footer.rb +++ b/app/components/ruby_ui/table/table_footer.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "border-t bg-muted bg-opacity-50 font-medium[& amp;>tr]:last:border-b-0" + class: "border-t bg-muted/50 font-medium[& amp;>tr]:last:border-b-0" } end end diff --git a/app/components/ruby_ui/table/table_row.rb b/app/components/ruby_ui/table/table_row.rb index 4b451df7..d1eeb2b4 100644 --- a/app/components/ruby_ui/table/table_row.rb +++ b/app/components/ruby_ui/table/table_row.rb @@ -10,7 +10,7 @@ def view_template(&) def default_attrs { - class: "border-b transition-colors hover:bg-muted hover:bg-opacity-50 data-[state=selected]:bg-muted" + class: "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted" } end end diff --git a/package.json b/package.json index 7444289f..d0ca43b3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "chart.js": "^4.4.9", "class-variance-authority": "0.7.1", "clsx": "2.1.1", - "embla-carousel": "^8.5.2", + "embla-carousel": "^8.6.0", "esbuild": "0.25.3", "fuse.js": "^7.1.0", "maska": "^3.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58f15a79..0bedf27e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,7 +36,7 @@ importers: specifier: 2.1.1 version: 2.1.1 embla-carousel: - specifier: ^8.5.2 + specifier: ^8.6.0 version: 8.6.0 esbuild: specifier: 0.25.3 From 4f40bf5808de17cd699f591b703bd420b51fa5e0 Mon Sep 17 00:00:00 2001 From: Cirdes Henrique Date: Sun, 11 May 2025 13:10:42 -0300 Subject: [PATCH 2/2] add endline --- .github/workflows/verify_components.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify_components.yml b/.github/workflows/verify_components.yml index 43377a1f..bb93a1f5 100644 --- a/.github/workflows/verify_components.yml +++ b/.github/workflows/verify_components.yml @@ -18,4 +18,4 @@ jobs: fail-if-not-clean: true push-if-not-clean: false request-changes-if-not-clean: false - targets: 'app' #optional \ No newline at end of file + targets: 'app' #optional