Skip to content

Commit

Permalink
Merge branch 'zinc-collective:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer authored Mar 4, 2024
2 parents da0601b + 6822ec8 commit 1ffbdd7
Show file tree
Hide file tree
Showing 64 changed files with 1,008 additions and 796 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ features/test_reports/*.png

coverage/

app/assets/builds/
app/assets/builds/*
!/app/assets/builds/.keep

/node_modules
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ gem "redcarpet", "~> 3.6"
gem "gretel", "~> 5.0"
# Better UI components
gem "lookbook", ">= 2.0.0.beta.4"
gem "view_component", "~> 3.10"
gem "view_component", "~> 3.11"
# QR Code Generation!
gem "rqrcode", "~> 2.2"

# Pagination!
gem "pagy", "~> 6.4"
gem "pagy", "~> 7.0"

# Database Layer
#
Expand Down Expand Up @@ -129,15 +129,15 @@ group :development, :test do

gem "rubocop-rails"
gem "rubocop-rspec"
gem "standard", "~> 1.33"
gem "standard", "~> 1.34"
end

group :development do
gem "better_errors"
gem "binding_of_caller"
# Outputs i18n lookup key debug logs
gem "i18n-debug"
gem "listen", "~> 3.8"
gem "listen", "~> 3.9"
gem "rails-erd"
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem "web-console", "~> 4.2"
Expand Down
60 changes: 29 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
apimatic_core (0.3.4)
apimatic_core (0.3.5)
apimatic_core_interfaces (~> 0.2.0)
certifi (~> 2018.1, >= 2018.01.18)
faraday-multipart (~> 1.0)
json-pointer
nokogiri (~> 1.10, >= 1.10.10)
apimatic_core_interfaces (0.2.0)
apimatic_faraday_client_adapter (0.1.4)
Expand Down Expand Up @@ -153,13 +152,13 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (0.4.6)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
css_parser (1.16.0)
addressable
cssbundling-rails (1.1.2)
cssbundling-rails (1.4.0)
railties (>= 6.0.0)
date (3.3.3)
debug_inspector (1.1.0)
Expand Down Expand Up @@ -230,12 +229,11 @@ GEM
jsbundling-rails (1.3.0)
railties (>= 6.0.0)
json (2.7.1)
json-pointer (0.0.1)
json-schema (4.1.1)
addressable (>= 2.8)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lockbox (1.3.3)
Expand Down Expand Up @@ -276,7 +274,7 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multipart-post (2.3.0)
multipart-post (2.4.0)
mutex_m (0.2.0)
net-http (0.4.1)
uri
Expand All @@ -295,12 +293,12 @@ GEM
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
pagy (6.4.3)
pagy (7.0.8)
parallel (1.24.0)
parser (3.3.0.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pg (1.5.4)
pg (1.5.6)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -315,7 +313,7 @@ GEM
pundit (2.3.1)
activesupport (>= 3.0.0)
racc (1.7.3)
rack (2.2.8)
rack (2.2.8.1)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
Expand Down Expand Up @@ -371,7 +369,7 @@ GEM
rdoc (6.6.2)
psych (>= 4.0.0)
redcarpet (3.6.0)
redis-client (0.19.1)
redis-client (0.20.0)
connection_pool
regexp_parser (2.9.0)
reline (0.4.2)
Expand Down Expand Up @@ -411,11 +409,11 @@ GEM
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rubocop (1.59.0)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand All @@ -428,7 +426,7 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.25.0)
rubocop (~> 1.33)
rubocop-performance (1.20.1)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
Expand All @@ -447,7 +445,7 @@ GEM
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.17.0)
selenium-webdriver (4.18.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand All @@ -459,7 +457,7 @@ GEM
concurrent-ruby (~> 1.0, >= 1.0.2)
shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
sidekiq (7.2.1)
sidekiq (7.2.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
Expand All @@ -478,41 +476,41 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
square.rb (35.0.1.20240118)
square.rb (36.0.0.20240222)
apimatic_core (~> 0.3.0)
apimatic_core_interfaces (~> 0.2.0)
apimatic_faraday_client_adapter (~> 0.1.0)
standard (1.33.0)
standard (1.34.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.59.0)
rubocop (~> 1.60)
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)
standard-performance (1.3.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.1)
rubocop-performance (~> 1.20.2)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
strip_attributes (1.13.0)
activemodel (>= 3.0, < 8.0)
stripe (10.8.0)
stripe (10.11.0)
strong_migrations (1.7.0)
activerecord (>= 5.2)
thor (1.3.0)
timeout (0.4.1)
turbo-rails (2.0.2)
turbo-rails (2.0.4)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uri (0.13.0)
view_component (3.10.0)
view_component (3.11.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand All @@ -521,7 +519,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.20.0)
webmock (3.23.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -532,7 +530,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.34)
yard (0.9.36)
zeitwerk (2.6.13)
zlib (2.1.1)

Expand Down Expand Up @@ -560,11 +558,11 @@ DEPENDENCIES
image_processing
jbuilder (~> 2.11)
jsbundling-rails
listen (~> 3.8)
listen (~> 3.9)
lockbox (= 1.3.3)
lookbook (>= 2.0.0.beta.4)
money-rails
pagy (~> 6.4)
pagy (~> 7.0)
pg (~> 1.5)
pry-byebug
puma (~> 6.4)
Expand Down Expand Up @@ -592,14 +590,14 @@ DEPENDENCIES
spring-watcher-listen!
sprockets-rails
square.rb
standard (~> 1.33)
standard (~> 1.34)
stimulus-rails
strip_attributes (~> 1.13)
stripe
strong_migrations (~> 1.7)
turbo-rails
tzinfo-data (~> 1.2021)
view_component (~> 3.10)
view_component (~> 3.11)
web-console (~> 4.2)
webmock

Expand Down
Empty file added app/assets/builds/.keep
Empty file.
36 changes: 36 additions & 0 deletions app/assets/stylesheets/actiontext.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
* the trix-editor content (whether displayed or under editing). Feel free to incorporate this
* inclusion directly in any other asset bundle and remove this file.
*
*= require trix
*/

/*
* We need to override trix.css’s image gallery styles to accommodate the
* <action-text-attachment> element we wrap around attachments. Otherwise,
* images in galleries will be squished by the max-width: 33%; rule.
*/
.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
flex: 1 0 33%;
padding: 0 0.5em;
max-width: 33%;
}

.trix-content
.attachment-gallery.attachment-gallery--2
> action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
.trix-content
.attachment-gallery.attachment-gallery--4
> action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
flex-basis: 50%;
max-width: 50%;
}

.trix-content action-text-attachment .attachment {
padding: 0 !important;
max-width: 100% !important;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/application.postcss.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Entry point for your PostCSS build */
@import "trix";

@import "./tailwind.scss";

Expand All @@ -7,3 +8,5 @@

@import "./utilities.scss";
@import "./components.scss";
@import "actiontext.css";
@import "./extensions/pagy.scss";
2 changes: 1 addition & 1 deletion app/assets/stylesheets/base/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

main {
@apply mx-2 flex-1 flex flex-col;
@apply flex-1 flex flex-col;
> :last-child {
@apply mb-2;
}
Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/extensions/pagy.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.pagy-nav {
@apply flex justify-between;

.page.active a,
.page.disabled a {
@apply no-underline;
}
}
16 changes: 11 additions & 5 deletions app/components/card_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<div <%==attributes(classes: "shadow rounded-lg bg-white group-hover:bg-slate-50 flex flex-col justify-between") %>>
<% if header? %>
<%= header%>
<%- end %>
<div <%==attributes(classes: "shadow rounded-lg bg-white group-hover:bg-slate-50 flex flex-col justify-between overflow-hidden") %>>
<%- if head_image.present? %>
<figure>
<%= image_tag head_image, class: "rounded-t-lg w-full" %>
<figcaption class="px-2 pt-4 sm:px-4">
<%= header %>
</figcaption>
</figure>
<%- else %>
<%= header %>
<%- end %>
<%#
NOTE: content? is not always working as described, and is returning a proc in some cases rather than a boolean
%>
Expand All @@ -10,7 +17,6 @@
<%= content %>
</div>
<% end %>

<% if footer? %>
<%= footer %>
<% end %>
Expand Down
17 changes: 16 additions & 1 deletion app/components/card_component.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
class CardComponent < ApplicationComponent
HEADER_VARIANTS = {default: "p-2 sm:p-4", no_padding: ""}
attr_accessor :media

def initialize(media: nil, **kwargs)
super(**kwargs)

self.media = media
end

HEADER_VARIANTS = {
default: "p-2 sm:p-4",
no_padding: ""
}
renders_one :header, ->(variant: :default, &block) {
content_tag(:header, class: HEADER_VARIANTS.fetch(variant), &block)
}
Expand All @@ -14,4 +25,8 @@ class CardComponent < ApplicationComponent
classes += " rounded-t-none" unless content? || header?
content_tag(:footer, class: classes, &block)
}

def head_image
media&.upload&.variant(resize_to_fill: Media::FULL_WIDTH_16_BY_9)
end
end
Loading

0 comments on commit 1ffbdd7

Please sign in to comment.