Skip to content

Commit 9ced03e

Browse files
committed
Merge branch '4-dev' into avo-976-adjust-text-input-design
2 parents 7621444 + 0270c01 commit 9ced03e

File tree

73 files changed

+489
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+489
-263
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
avo (4.0.44.alpha)
4+
avo (4.0.47.alpha)
55
actionview (>= 6.1)
66
active_link_to
77
activerecord (>= 6.1)

Procfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
web: bin/rails server -p 3030
1+
web: bin/rails server
22
js: yarn build:js --watch
33
css: yarn build:css --watch
44
cjs: yarn build:custom-js --watch

app/assets/stylesheets/application.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@
6868
@custom-variant floating-controls (&:where(.floating-controls *));
6969
@custom-variant shift-pressed (&:where(.shift-pressed *));
7070

71+
/* Used to determine if the filters buttons is displayed. */
72+
@custom-variant index-missing-resources (&:where(.index-missing-resources *));
73+
7174
/* https://tailwindcss.com/docs/upgrade-guide#hover-styles-on-mobile */
7275
/* needed to fix hover on system tests we need to find a better solution */
7376
/* I discovered that the Tailwind v4 `hover` change is affecting the test browser. As a temporary fix, I forced a custom variant to preserve the Tailwind v3 `hover` behavior, since it resolves the failing tests. However, we’ll need to find a more robust long-term solution. This one was tricky to pinpoint. */
7477
@custom-variant hover (&:hover);
7578

79+
@import "./css/components/ui/checkbox.css";
80+
7681
@layer components {
7782
@import "./../../../node_modules/easymde/dist/easymde.min.css";
7883
@import "./../../../node_modules/tippy.js/dist/tippy.css";
@@ -115,7 +120,6 @@
115120
@import "./css/components/ui/file_upload_input.css";
116121
@import "./css/components/ui/file_upload_item.css";
117122
@import "./css/components/ui/dropdown.css";
118-
@import "./css/components/ui/checkbox.css";
119123
@import "./css/components/ui/radio_button.css";
120124
@import "./css/components/input.css";
121125

@@ -207,6 +211,10 @@
207211
@apply ms-0 col-start-2;
208212
}
209213
}
214+
215+
select {
216+
@apply text-foreground bg-background border-tertiary;
217+
}
210218
}
211219

212220
.loading-spinner {

app/assets/stylesheets/css/components/ui/card.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,23 @@
3535
.card__header {
3636
@apply flex flex-col items-start self-stretch py-3 px-4;
3737

38+
&:has(select),
39+
&:has(.button) {
40+
@apply pe-0;
41+
}
42+
3843
/* `sm` size buttons make the header too tall. This will compensate for it. */
3944
.button {
4045
@apply -my-1;
4146
}
4247
}
4348

49+
.card--compact-header {
50+
.card__header {
51+
@apply py-1 px-2;
52+
}
53+
}
54+
4455
/* Card title - Copy/14/500 from Figma */
4556
.card__title {
4657
@apply text-content font-medium leading-6 text-sm;
Lines changed: 36 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,37 @@
1-
/* Checkbox Component - Based on Figma Design System */
2-
/* BEM Methodology: .checkbox (block), .checkbox__input (element), .checkbox--modifier (modifiers) */
3-
4-
/* ==========================================================================
5-
Base Styles
6-
========================================================================== */
7-
8-
.checkbox__input {
9-
@apply size-4 mx-3 cursor-pointer rounded-sm border-1 border-tertiary bg-primary;
10-
box-shadow: var(--box-shadow);
11-
}
12-
13-
/* ==========================================================================
14-
State: Checked & Indeterminate
15-
========================================================================== */
16-
17-
.checkbox__input:checked,
18-
.checkbox__input:indeterminate {
19-
@apply bg-accent-content border-accent-content;
20-
}
21-
22-
/* ==========================================================================
23-
State: Focus & Hover
24-
========================================================================== */
25-
26-
.checkbox__input:focus-visible,
27-
.checkbox__input:hover:not(:disabled) {
28-
@apply ring-2 ring-offset-2 ring-accent-content outline-none;
29-
}
30-
31-
/* Maintain checked/indeterminate appearance on focus/hover */
32-
.checkbox__input:checked:focus-visible,
33-
.checkbox__input:checked:hover:not(:disabled),
34-
.checkbox__input:indeterminate:focus-visible,
35-
.checkbox__input:indeterminate:hover:not(:disabled) {
36-
@apply bg-accent-content border-accent-content;
37-
}
38-
39-
/* ==========================================================================
40-
State: Disabled
41-
========================================================================== */
42-
43-
.checkbox__input:disabled {
44-
@apply cursor-not-allowed opacity-60;
45-
}
46-
47-
/* ==========================================================================
48-
Modifier: Floating (row selector behavior)
49-
========================================================================== */
50-
51-
.checkbox__input--floating {
52-
@apply absolute start-0 top-0 mt-3 z-10 hidden;
53-
}
54-
55-
.checkbox__input--floating:checked,
56-
.group:hover .checkbox__input--floating {
57-
@apply block;
1+
@layer base {
2+
input[type=checkbox] {
3+
@apply size-4 cursor-pointer rounded-sm border-1 border-tertiary bg-primary;
4+
box-shadow: var(--box-shadow);
5+
}
6+
7+
input[type=checkbox]:checked {
8+
background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%228%22%20viewBox%3D%220%200%2012%208%22%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M10.1953%200.195262C10.4556%20-0.0650874%2010.8776%20-0.0650874%2011.138%200.195262C11.3983%200.455612%2011.3983%200.877621%2011.138%201.13797L4.4713%207.80464C4.21095%208.06499%203.78895%208.06499%203.5286%207.80464L0.195262%204.4713C-0.0650874%204.21095%20-0.0650874%203.78894%200.195262%203.5286C0.455612%203.26825%200.877621%203.26825%201.13797%203.5286L3.99995%206.39057L10.1953%200.195262Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);
9+
background-size: 70%;
10+
}
11+
12+
input[type=checkbox]:indeterminate {
13+
background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2211%22%20height%3D%222%22%20viewBox%3D%220%200%2011%202%22%20fill%3D%22white%22%3E%3Cpath%20d%3D%22M10%200C10.3682%200%2010.6667%200.298477%2010.6667%200.666667C10.6667%201.03486%2010.3682%201.33333%2010%201.33333H0.666667C0.298477%201.33333%200%201.03486%200%200.666667C0%200.298477%200.298477%200%200.666667%200H10Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);
14+
background-size: 70%;
15+
}
16+
17+
input[type=checkbox]:checked,
18+
input[type=checkbox]:indeterminate {
19+
@apply bg-accent-content border-accent-content;
20+
}
21+
22+
input[type=checkbox]:focus-visible,
23+
input[type=checkbox]:hover:not(:disabled) {
24+
@apply ring-2 ring-offset-2 ring-accent-content outline-none;
25+
}
26+
27+
input[type=checkbox]:checked:focus-visible,
28+
input[type=checkbox]:checked:hover:not(:disabled),
29+
input[type=checkbox]:indeterminate:focus-visible,
30+
input[type=checkbox]:indeterminate:hover:not(:disabled) {
31+
@apply bg-accent-content border-accent-content;
32+
}
33+
34+
input[type=checkbox]:disabled {
35+
@apply cursor-not-allowed opacity-60;
36+
}
5837
}

app/assets/stylesheets/css/components/ui/panel_header.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.header {
2-
@apply flex flex-col gap-2 items-start justify-center pe-0 py-0 px-1;
2+
@apply flex flex-col gap-2 items-start justify-center pe-0 py-0;
33
}
44

55
.header__main {

app/assets/stylesheets/css/layout.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.main {
1212
--sidebar-width: --spacing(64);
1313
--sidebar-offset-size: 0rem;
14-
--content-width: calc(100% - var(--sidebar-offset-size) - var(--spacing)*2);
14+
--content-width: calc(100% - var(--sidebar-offset-size) - var(--spacing) * 2);
1515

1616
@media (min-width: theme(--breakpoint-lg)) {
1717
&.sidebar-open {
@@ -29,7 +29,7 @@
2929
height: calc(100dvh - var(--spacing) - var(--top-navbar-height));
3030

3131
.scrollable-wrapper {
32-
@apply overflow-y-auto h-full flex-1 flex flex-col;
32+
@apply overflow-y-auto h-full flex-1 flex flex-col px-2;
3333
}
3434
.avo-container {
3535
@apply flex flex-1 flex-col justify-between;

app/components/avo/actions_component.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
class="actions-dropdown relative flex w-full flex-col sm:w-auto"
33
data-component-name="<%= self.class.to_s.underscore %>"
44
data-controller="toggle actions-picker"
5-
data-actions-picker-enabled-class="text-black hover:bg-primary-500 hover:text-white"
6-
data-actions-picker-disabled-class="cursor-wait text-gray-500"
5+
data-actions-picker-enabled-class="text-content hover:bg-secondary"
6+
data-actions-picker-disabled-class="cursor-wait text-content/60"
77
data-resource-name="<%= @resource.class.to_s %>"
88
<% if @resource.record.present? %>
99
data-record-id="<%= @resource.record_param %>"

app/components/avo/actions_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def render_item(action)
7676
render_action_link(action.action, icon: action.icon)
7777
when defined?(Avo::Advanced::Resources::Controls::LinkTo) && Avo::Advanced::Resources::Controls::LinkTo
7878
link_to action.args[:path],
79-
class: action.args.delete(:class) || "flex items-center px-4 py-3 w-full text-black font-semibold text-sm hover:bg-primary-100",
79+
class: action.args.delete(:class),
8080
**action.args.except(:path, :label, :icon) do
8181
raw("#{icon(action.args[:icon])} #{action.args[:label]}")
8282
end
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
<% if @add_background %>
2-
<div class="bg-white rounded-sm shadow-panel">
3-
<% end %>
4-
<div class="relative flex-1 flex flex-col items-center justify-center space-y-12 py-24">
5-
<%= helpers.svg view_type_svg, class: 'h-[250px]' %>
6-
<div class="text-gray-500 text-center">
1+
<div class="relative flex-1 flex flex-col items-center justify-center space-y-2 py-6 border border-dashed border-content-secondary rounded-lg">
2+
<div class="text-content-secondary text-center">
73
<%= text %>
84
</div>
95
</div>
10-
<% if @add_background %>
11-
</div>
12-
<% end %>

0 commit comments

Comments
 (0)