avo 4.0.0.beta.2 → 4.0.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/builds/avo/application.css +355 -51
- data/app/assets/builds/avo/application.js +166 -166
- data/app/assets/builds/avo/application.js.map +4 -4
- data/app/assets/stylesheets/application.css +2 -0
- data/app/assets/stylesheets/css/components/hotkey.css +50 -0
- data/app/assets/stylesheets/css/components/input.css +0 -6
- data/app/assets/stylesheets/css/components/ui/state.css +129 -0
- data/app/assets/stylesheets/css/layout.css +3 -4
- data/app/assets/stylesheets/css/pagination.css +12 -6
- data/app/assets/stylesheets/css/typography.css +18 -1
- data/app/assets/svgs/avo/circle-minus.svg +3 -0
- data/app/components/avo/alert_component.rb +4 -4
- data/app/components/avo/backtrace_alert_component.html.erb +1 -1
- data/app/components/avo/base_component.rb +9 -0
- data/app/components/avo/button_component.rb +2 -1
- data/app/components/avo/debug/status_component.html.erb +2 -2
- data/app/components/avo/empty_state_component.html.erb +15 -4
- data/app/components/avo/empty_state_component.rb +9 -0
- data/app/components/avo/fields/common/files/view_type/grid_item_component.html.erb +1 -1
- data/app/components/avo/fields/common/key_value_component.html.erb +1 -1
- data/app/components/avo/fields/common/stars_component.html.erb +1 -1
- data/app/components/avo/fields/common/status_viewer_component.html.erb +3 -3
- data/app/components/avo/fields/preview_field/index_component.rb +1 -1
- data/app/components/avo/fields/stars_field/edit_component.html.erb +1 -1
- data/app/components/avo/filters_component.html.erb +1 -1
- data/app/components/avo/items/switcher_component.html.erb +1 -1
- data/app/components/avo/keyboard_shortcuts_component.html.erb +29 -0
- data/app/components/avo/keyboard_shortcuts_component.rb +127 -0
- data/app/components/avo/media_library/item_details_component.html.erb +2 -2
- data/app/components/avo/media_library/list_component.html.erb +1 -1
- data/app/components/avo/media_library/list_item_component.html.erb +2 -2
- data/app/components/avo/modal_component.html.erb +39 -15
- data/app/components/avo/modal_component.rb +10 -0
- data/app/components/avo/paginator_component.html.erb +23 -17
- data/app/components/avo/paginator_component.rb +18 -0
- data/app/components/avo/resource_component.rb +14 -7
- data/app/components/avo/sidebar/group_component.html.erb +1 -1
- data/app/components/avo/sidebar/link_component.html.erb +13 -5
- data/app/components/avo/sidebar/link_component.rb +17 -0
- data/app/components/avo/sidebar/section_component.html.erb +1 -1
- data/app/components/avo/sidebar_component.html.erb +2 -2
- data/app/components/avo/sidebar_profile_component.html.erb +1 -1
- data/app/components/avo/u_i/search_input_component.html.erb +2 -2
- data/app/components/avo/views/resource_index_component.rb +1 -1
- data/app/javascript/application.js +12 -28
- data/app/javascript/js/controllers/base_modal_controller.js +65 -0
- data/app/javascript/js/controllers/confirm_dialog_controller.js +18 -0
- data/app/javascript/js/controllers/modal_controller.js +18 -26
- data/app/javascript/js/controllers/persistent_modal_controller.js +50 -0
- data/app/javascript/js/controllers/search_controller.js +0 -4
- data/app/javascript/js/controllers/sidebar_controller.js +22 -0
- data/app/javascript/js/controllers.js +4 -0
- data/app/javascript/js/global_hotkeys.js +77 -0
- data/app/javascript/js/helpers/toggle_hidden.js +7 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/base/_date_time_filter.html.erb +1 -1
- data/app/views/avo/base/preview.html.erb +1 -1
- data/app/views/avo/debug/_valid_indicator.html.erb +2 -2
- data/app/views/avo/home/failed_to_load.html.erb +40 -13
- data/app/views/avo/media_library/_form.html.erb +1 -1
- data/app/views/avo/partials/_color_scheme_switcher.html.erb +4 -4
- data/app/views/avo/partials/_confirm_dialog.html.erb +3 -3
- data/app/views/avo/partials/_custom_tools_alert.html.erb +3 -3
- data/app/views/avo/partials/_sortable_component.html.erb +3 -3
- data/app/views/avo/partials/_table_header.html.erb +1 -1
- data/app/views/avo/private/_links_and_buttons.html.erb +2 -2
- data/app/views/avo/private/design.html.erb +4 -4
- data/app/views/avo/sidebar/_license_warning.html.erb +2 -2
- data/app/views/layouts/avo/application.html.erb +1 -0
- data/lib/avo/resources/base.rb +1 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/resource_generator.rb +3 -3
- data/lib/generators/avo/templates/initializer/avo.tt +4 -4
- data/lib/generators/avo/templates/resource_tools/partial.tt +1 -1
- metadata +11 -15
- data/app/assets/svgs/avo/arrow-circle-right.svg +0 -1
- data/app/assets/svgs/avo/bell.svg +0 -3
- data/app/assets/svgs/avo/color-swatch.svg +0 -1
- data/app/assets/svgs/avo/dashboards.svg +0 -6
- data/app/assets/svgs/avo/exclamation.svg +0 -1
- data/app/assets/svgs/avo/filter.svg +0 -1
- data/app/assets/svgs/avo/logout.svg +0 -3
- data/app/assets/svgs/avo/resources.svg +0 -13
- data/app/assets/svgs/avo/save.svg +0 -8
- data/app/assets/svgs/avo/selector.svg +0 -1
- data/app/assets/svgs/avo/sort-ascending.svg +0 -1
- data/app/assets/svgs/avo/sort-descending.svg +0 -1
- data/app/assets/svgs/avo/times.svg +0 -3
- data/app/assets/svgs/avo/tools.svg +0 -3
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
@import "./css/components/ui/description_list.css";
|
|
136
136
|
@import "./css/components/ui/tabs.css";
|
|
137
137
|
@import "./css/components/ui/badge.css";
|
|
138
|
+
@import "./css/components/ui/state.css";
|
|
138
139
|
@import "./css/components/ui/file_upload_input.css";
|
|
139
140
|
@import "./css/components/ui/file_upload_item.css";
|
|
140
141
|
@import "./css/components/ui/dropdown.css";
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
@import "./css/components/grid.css";
|
|
149
150
|
@import "./css/components/color_scheme_switcher.css";
|
|
150
151
|
@import "./css/components/discreet_information.css";
|
|
152
|
+
@import "./css/components/hotkey.css";
|
|
151
153
|
@import "./css/components/tooltip.css";
|
|
152
154
|
@import "./css/components/modal.css";
|
|
153
155
|
@import "./css/css-animations.css";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.hotkey__grid {
|
|
2
|
+
@apply p-6;
|
|
3
|
+
|
|
4
|
+
columns: 1;
|
|
5
|
+
column-gap: theme(spacing.8);
|
|
6
|
+
|
|
7
|
+
@media (min-width: theme(screens.sm)) {
|
|
8
|
+
columns: 2;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.hotkey__section {
|
|
13
|
+
@apply min-w-0 mb-10;
|
|
14
|
+
|
|
15
|
+
break-inside: avoid;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.hotkey__section-title {
|
|
19
|
+
@apply text-xs text-content-secondary uppercase tracking-wide mb-4 font-bold;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.hotkey__section-body {
|
|
23
|
+
@apply m-0 w-full list-none flex flex-col gap-2 p-0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.hotkey__row {
|
|
27
|
+
@apply flex w-full items-start justify-between gap-4 border-b border-tertiary last:border-b-0 leading-6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.hotkey__action {
|
|
31
|
+
/* @apply min-w-0 flex-1 text-base leading-6 text-content; */
|
|
32
|
+
/* @apply text-base leading-6 text-content font-bold; */
|
|
33
|
+
@apply text-sm;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.hotkey__keys {
|
|
37
|
+
@apply flex shrink-0 flex-wrap items-center justify-end gap-x-1.5 gap-y-1.5 pt-0.5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.hotkey__or {
|
|
41
|
+
@apply px-1 text-base font-medium leading-6 text-content-secondary;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.hotkey__combo {
|
|
45
|
+
@apply inline-flex items-center gap-1.5;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.hotkey__key-separator {
|
|
49
|
+
@apply font-medium text-content-secondary;
|
|
50
|
+
}
|
|
@@ -290,12 +290,6 @@
|
|
|
290
290
|
padding-inline-end: var(--input-icon-offset);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
.search-input__shortcut {
|
|
294
|
-
@apply text-xs font-semibold py-px px-1 border border-secondary rounded-sm bg-secondary min-w-5 flex items-center justify-center;
|
|
295
|
-
|
|
296
|
-
line-height: var(--input-leading);
|
|
297
|
-
box-shadow: var(--box-shadow-search-input-shortcut);
|
|
298
|
-
}
|
|
299
293
|
|
|
300
294
|
/* ==========================================================================
|
|
301
295
|
Range Input
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* State Component - BEM: .state (block), .state__* (elements), .state--* (modifiers) */
|
|
2
|
+
|
|
3
|
+
/* Empty State Component */
|
|
4
|
+
|
|
5
|
+
.state {
|
|
6
|
+
@apply mx-auto flex w-full max-w-72 flex-col items-center justify-center gap-3 rounded-lg bg-background p-6 text-center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.state__illustration {
|
|
10
|
+
@apply relative h-36 w-60 flex items-center justify-center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.state__card {
|
|
14
|
+
@apply absolute flex h-11 w-44 items-center gap-1.5 rounded-lg border border-secondary p-2.5;
|
|
15
|
+
|
|
16
|
+
background: linear-gradient(194deg, var(--color-primary) 27%, var(--color-background) 65%);
|
|
17
|
+
box-shadow: var(--box-shadow-card);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.state__card--top {
|
|
21
|
+
@apply start-0 top-0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.state__card--middle {
|
|
25
|
+
@apply start-14 top-8;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.state__card--bottom {
|
|
29
|
+
@apply start-5 top-20;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.state__badge {
|
|
33
|
+
@apply flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-medium leading-none text-content;
|
|
34
|
+
|
|
35
|
+
background: color-mix(in oklab, var(--color-tertiary) 88%, var(--color-primary));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.state__body {
|
|
39
|
+
@apply flex min-w-0 flex-1 flex-col gap-1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.state__line {
|
|
43
|
+
@apply block h-1.5 rounded-full;
|
|
44
|
+
|
|
45
|
+
background: color-mix(in oklab, var(--color-tertiary) 78%, var(--color-primary));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.state__line--title {
|
|
49
|
+
@apply opacity-75;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.state__line--large {
|
|
53
|
+
@apply w-14;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.state__line--medium {
|
|
57
|
+
@apply w-12;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.state__line--small {
|
|
61
|
+
@apply w-11;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.state__line--content {
|
|
65
|
+
@apply w-full;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.state__message {
|
|
69
|
+
@apply text-base font-normal leading-6 text-content-secondary;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Frame Load Failed Component */
|
|
73
|
+
.state--frame-load-failed {
|
|
74
|
+
@apply max-w-96 gap-1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.state__document {
|
|
78
|
+
@apply absolute flex h-28 w-20 flex-col rounded-lg border border-secondary p-0.5;
|
|
79
|
+
|
|
80
|
+
background: linear-gradient(235deg, var(--color-primary) 27%, var(--color-background) 65%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.state__document--start {
|
|
84
|
+
@apply start-4 rotate-[-21deg];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.state__document--center {
|
|
88
|
+
@apply start-16 z-10;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.state__document--end {
|
|
92
|
+
@apply start-24 rotate-[21deg] z-0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.state__document-body {
|
|
96
|
+
@apply flex h-full w-full items-center rounded-lg p-2.5;
|
|
97
|
+
|
|
98
|
+
box-shadow: var(--box-shadow-card);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.state__document-lines {
|
|
102
|
+
@apply flex h-full w-full flex-col justify-between
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.state__document-line {
|
|
106
|
+
@apply block h-1 w-full rounded-full;
|
|
107
|
+
|
|
108
|
+
background: color-mix(in oklab, var(--color-tertiary) 78%, var(--color-primary));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.state__document-line--short {
|
|
112
|
+
@apply w-10;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.state__magnifier {
|
|
116
|
+
@apply absolute start-[30%] top-[30%] z-20 bg-none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.state__magnifier-icon {
|
|
120
|
+
@apply size-24 text-content-secondary opacity-20;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.state__note {
|
|
124
|
+
@apply text-center text-sm font-normal leading-5 text-content;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.state__link {
|
|
128
|
+
color: color-mix(in oklab, var(--color-info-content), var(--color-content) 10%);
|
|
129
|
+
}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
@apply overflow-y-auto h-full flex-1 flex flex-col px-2;
|
|
51
51
|
}
|
|
52
52
|
.avo-container {
|
|
53
|
-
@apply
|
|
53
|
+
@apply flex flex-1 flex-col justify-between;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
@media (min-width: theme(--breakpoint-lg)) {
|
|
61
61
|
margin-inline-start: calc(var(--sidebar-width) + var(--spacing));
|
|
62
62
|
width: var(--content-width);
|
|
63
|
-
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
}
|
|
@@ -91,11 +90,11 @@
|
|
|
91
90
|
@apply hidden;
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
button[data-sidebar-state=
|
|
93
|
+
button[data-sidebar-state="closed"] .sidebar-toggle-icon--open {
|
|
95
94
|
@apply hidden;
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
button[data-sidebar-state=
|
|
97
|
+
button[data-sidebar-state="closed"] .sidebar-toggle-icon--closed {
|
|
99
98
|
@apply inline-flex;
|
|
100
99
|
}
|
|
101
100
|
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
.pagination__controls, .pagination__info, .pagination__nav (elements) */
|
|
5
5
|
|
|
6
6
|
.pagination {
|
|
7
|
-
@apply flex w-full flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-end sm:gap-0;
|
|
7
|
+
@apply flex w-full flex-col items-stretch justify-between gap-2 sm:flex-row sm:flex-wrap sm:items-end sm:gap-0;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
/* === Per-page selector (left) === */
|
|
11
11
|
|
|
12
12
|
.pagination__per-page {
|
|
13
13
|
--pagination-per-page-width: 10rem; /* w-48 equivalent; use 165px for exact Figma match */
|
|
14
|
-
@apply flex items-center;
|
|
14
|
+
@apply flex shrink-0 items-center;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.pagination__per-page-input {
|
|
@@ -49,13 +49,19 @@
|
|
|
49
49
|
|
|
50
50
|
/* === Controls pill (right) === */
|
|
51
51
|
|
|
52
|
+
.pagination__controls-wrap {
|
|
53
|
+
@apply flex w-full min-w-0 sm:flex-[1_1_28rem] sm:min-w-[22rem] sm:justify-end;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
.pagination__controls {
|
|
53
|
-
@apply flex w-
|
|
57
|
+
@apply flex w-full min-w-0 max-w-full items-center gap-3 rounded-lg border border-tertiary bg-primary ps-3 pe-2 overflow-x-auto overflow-y-hidden overscroll-x-contain touch-pan-x sm:w-fit;
|
|
58
|
+
-webkit-overflow-scrolling: touch;
|
|
59
|
+
scrollbar-gutter: stable;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
/* Info text with right-border divider */
|
|
57
63
|
.pagination__info {
|
|
58
|
-
@apply flex items-center py-1 pe-3 border-e border-tertiary whitespace-nowrap
|
|
64
|
+
@apply shrink-0 flex items-center py-1 pe-3 border-e border-tertiary whitespace-nowrap text-sm text-content leading-5 font-normal;
|
|
59
65
|
|
|
60
66
|
&:last-child {
|
|
61
67
|
@apply border-e-0 pe-1;
|
|
@@ -68,12 +74,12 @@
|
|
|
68
74
|
|
|
69
75
|
/* Nav buttons wrapper */
|
|
70
76
|
.pagination__nav {
|
|
71
|
-
@apply flex items-center;
|
|
77
|
+
@apply shrink-0 flex items-center;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
/* === Pagy nav === */
|
|
75
81
|
.pagy.series-nav {
|
|
76
|
-
@apply flex items-center gap-0.5;
|
|
82
|
+
@apply flex min-w-max items-center gap-0.5 whitespace-nowrap;
|
|
77
83
|
|
|
78
84
|
a[role="separator"] {
|
|
79
85
|
@apply px-2 text-sm text-content-secondary;
|
|
@@ -18,13 +18,30 @@ h5 {
|
|
|
18
18
|
@apply text-lg;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
kbd {
|
|
22
|
+
@apply inline-flex min-w-5 items-center justify-center rounded-sm border border-secondary bg-secondary px-1 text-xs font-semibold text-content-secondary;
|
|
23
|
+
|
|
24
|
+
/* color: currentColor;
|
|
25
|
+
border: 1px solid currentColor;
|
|
26
|
+
background-color: color-mix(in srgb, currentColor 8%, transparent); */
|
|
27
|
+
box-shadow: var(--box-shadow-search-input-shortcut);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
kbd.kbd--called {
|
|
31
|
+
opacity: 0.4;
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
@layer base {
|
|
22
35
|
a {
|
|
23
36
|
color: var(--color-info-content);
|
|
24
37
|
|
|
25
38
|
&:active,
|
|
26
39
|
&:hover {
|
|
27
|
-
color: color-mix(
|
|
40
|
+
color: color-mix(
|
|
41
|
+
in oklab,
|
|
42
|
+
var(--color-info-content),
|
|
43
|
+
var(--color-content) 30%
|
|
44
|
+
);
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
&:focus-visible {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
2
|
+
<path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" />
|
|
3
|
+
</svg>
|
|
@@ -8,10 +8,10 @@ class Avo::AlertComponent < Avo::BaseComponent
|
|
|
8
8
|
prop :timeout
|
|
9
9
|
|
|
10
10
|
def icon
|
|
11
|
-
return "
|
|
12
|
-
return "
|
|
13
|
-
return "
|
|
14
|
-
return "
|
|
11
|
+
return "tabler/filled/alert-circle" if is_error?
|
|
12
|
+
return "tabler/filled/alert-triangle" if is_warning?
|
|
13
|
+
return "tabler/filled/alert-circle" if is_info?
|
|
14
|
+
return "tabler/filled/circle-check" if is_success?
|
|
15
15
|
|
|
16
16
|
"check-circle"
|
|
17
17
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="px-2">
|
|
7
7
|
<div class="flex h-full">
|
|
8
8
|
<div class="flex items-center min-h-full">
|
|
9
|
-
<%= helpers.svg "
|
|
9
|
+
<%= helpers.svg "tabler/filled/alert-circle", class: "h-6" %>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="ms-3 w-0 flex-1 pt-0.5">
|
|
12
12
|
<p class="text-sm leading-5 font-semibold">
|
|
@@ -15,6 +15,15 @@ class Avo::BaseComponent < ViewComponent::Base
|
|
|
15
15
|
|
|
16
16
|
def component_name = self.class.name.to_s.underscore
|
|
17
17
|
|
|
18
|
+
# Renders a <kbd> badge for a hotkey string.
|
|
19
|
+
# Skips modifier combos like "Meta+Enter" — only renders simple keys.
|
|
20
|
+
def hotkey_badge(hotkey, **html_options)
|
|
21
|
+
first_key = hotkey.to_s.split.first
|
|
22
|
+
return if first_key.blank? || first_key.include?("+")
|
|
23
|
+
|
|
24
|
+
tag.kbd(first_key.upcase, **html_options)
|
|
25
|
+
end
|
|
26
|
+
|
|
18
27
|
private
|
|
19
28
|
|
|
20
29
|
# Use the @parent_resource to fetch the field using the @reflection name.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# style: primary/outline/text
|
|
5
5
|
# size: :sm, :md, :lg
|
|
6
6
|
# color: nil, :primary, :accent, :gray, :red, :green, :blue, or any other tailwind color
|
|
7
|
-
# icon: "
|
|
7
|
+
# icon: "tabler/outline/paperclip" as specified in the docs (https://docs.avohq.io/3.0/icons.html)
|
|
8
8
|
class Avo::ButtonComponent < Avo::BaseComponent
|
|
9
9
|
prop :path, kind: :positional
|
|
10
10
|
prop :size, default: :md
|
|
@@ -79,5 +79,6 @@ class Avo::ButtonComponent < Avo::BaseComponent
|
|
|
79
79
|
def render_content
|
|
80
80
|
concat helpers.svg(@icon, class: class_names("button__icon", @icon_class)) if @icon.present?
|
|
81
81
|
concat content if content.present?
|
|
82
|
+
concat hotkey_badge(@args.dig(:data, :hotkey)) if @args.dig(:data, :hotkey)
|
|
82
83
|
end
|
|
83
84
|
end
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div>
|
|
11
11
|
<div class="text-xl font-semibold">
|
|
12
12
|
<span class="text-green-700 text-xl">
|
|
13
|
-
<%= helpers.svg "
|
|
13
|
+
<%= helpers.svg "tabler/outline/rosette-discount-check", class: "h-5 inline -mt-1 relative" %> <span>Community</span>
|
|
14
14
|
</span> license
|
|
15
15
|
</div>
|
|
16
16
|
<div class="mt-4">
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
style: :primary,
|
|
31
31
|
color: :blue,
|
|
32
32
|
target: '_blank',
|
|
33
|
-
icon: '
|
|
33
|
+
icon: 'tabler/outline/external-link' do %>
|
|
34
34
|
Get started!
|
|
35
35
|
<% end %>
|
|
36
36
|
</div>
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
<div class="
|
|
3
|
-
|
|
1
|
+
<%= content_tag :div, class: class_names("state", @classes) do %>
|
|
2
|
+
<div class="state__illustration" aria-hidden="true">
|
|
3
|
+
<% cards.each do |card| %>
|
|
4
|
+
<div class="<%= class_names("state__card", "state__card--#{card[:position]}") %>">
|
|
5
|
+
<div class="state__badge"><%= card[:number] %></div>
|
|
6
|
+
|
|
7
|
+
<div class="state__body">
|
|
8
|
+
<div class="<%= class_names("state__line", "state__line--title", "state__line--#{card[:title]}") %>"></div>
|
|
9
|
+
<div class="state__line state__line--content"></div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
4
13
|
</div>
|
|
5
|
-
|
|
14
|
+
|
|
15
|
+
<p class="state__message"><%= text %></p>
|
|
16
|
+
<% end %>
|
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
class Avo::EmptyStateComponent < Avo::BaseComponent
|
|
4
4
|
prop :message
|
|
5
5
|
prop :by_association, default: false
|
|
6
|
+
prop :classes
|
|
6
7
|
|
|
7
8
|
def text
|
|
8
9
|
@message || locale_message
|
|
9
10
|
end
|
|
10
11
|
|
|
12
|
+
def cards
|
|
13
|
+
[
|
|
14
|
+
{number: 1, position: :top, title: :large},
|
|
15
|
+
{number: 2, position: :middle, title: :large},
|
|
16
|
+
{number: 3, position: :bottom, title: :large}
|
|
17
|
+
]
|
|
18
|
+
end
|
|
19
|
+
|
|
11
20
|
private
|
|
12
21
|
|
|
13
22
|
def locale_message
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% else %>
|
|
10
10
|
<%= content_tag file.representable? ? :a : :div, **document_arguments do %>
|
|
11
11
|
<div class="flex flex-col justify-center items-center w-full">
|
|
12
|
-
<%= helpers.svg "
|
|
12
|
+
<%= helpers.svg "tabler/outline/file-text", class: 'h-10 text-gray-600 mb-2' %>
|
|
13
13
|
</div>
|
|
14
14
|
<% end %>
|
|
15
15
|
<% end %>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
data-action="click->key-value#addRow"
|
|
23
23
|
class="key-value__action-button <%= 'cursor-not-allowed' if @field.disable_adding_rows %>"
|
|
24
24
|
>
|
|
25
|
-
<%= helpers.svg "
|
|
25
|
+
<%= helpers.svg "tabler/outline/circle-plus", class: 'key-value__action-icon' %>
|
|
26
26
|
</a>
|
|
27
27
|
</div>
|
|
28
28
|
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="rating-group" data-component="<%= component_name %>">
|
|
2
2
|
<% (1..@max).each do |rating_value| %>
|
|
3
3
|
<%= helpers.svg(
|
|
4
|
-
'
|
|
4
|
+
'tabler/filled/star',
|
|
5
5
|
class: class_names("star inline-block me-0.5", filled: rating_value <= (@value || 0))
|
|
6
6
|
) %>
|
|
7
7
|
<% end %>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div class=" <%= class_names("flex shrink-0 items-center", "text-red-600": @status == 'failed', "text-green-600": @status == 'success', "text-gray-600": @status == 'neutral') %>">
|
|
2
2
|
<% if @status == 'success' %>
|
|
3
|
-
<%= helpers.svg '
|
|
3
|
+
<%= helpers.svg 'tabler/filled/circle-check', class: 'h-4' %>
|
|
4
4
|
<% elsif @status == 'failed' %>
|
|
5
|
-
<%= helpers.svg '
|
|
5
|
+
<%= helpers.svg 'tabler/filled/circle-x', class: 'h-4' %>
|
|
6
6
|
<% elsif @status == 'neutral' %>
|
|
7
|
-
<%= helpers.svg '
|
|
7
|
+
<%= helpers.svg 'avo/circle-minus', class: 'h-4' %>
|
|
8
8
|
<% elsif @status == 'loading' %>
|
|
9
9
|
<div class="spinner">
|
|
10
10
|
<div class="double-bounce1"></div>
|
|
@@ -4,7 +4,7 @@ class Avo::Fields::PreviewField::IndexComponent < Avo::Fields::IndexComponent
|
|
|
4
4
|
def render_preview
|
|
5
5
|
link_to resource_view_path, title: t("avo.view_item", item: @resource.name).humanize do
|
|
6
6
|
helpers.svg(
|
|
7
|
-
"
|
|
7
|
+
"tabler/outline/zoom-scan",
|
|
8
8
|
class: "block h-6 text-gray-600",
|
|
9
9
|
data: {
|
|
10
10
|
controller: "preview",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
data-max="<%= @field.max %>"
|
|
10
10
|
data-current-value="<%= @field.value || 0 %>">
|
|
11
11
|
<% (1..@field.max).each do |rating_value| %>
|
|
12
|
-
<%= helpers.svg('
|
|
12
|
+
<%= helpers.svg('tabler/filled/star',
|
|
13
13
|
class: class_names("star inline-block me-0.5", filled: rating_value <= (@value || 0)),
|
|
14
14
|
data: {
|
|
15
15
|
star_value: rating_value,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="relative w-full flex justify-between">
|
|
3
3
|
<%= a_button class: 'focus:outline-hidden',
|
|
4
4
|
style: :primary,
|
|
5
|
-
icon: "
|
|
5
|
+
icon: "tabler/outline/filter",
|
|
6
6
|
title: t('avo.click_to_reveal_filters'),
|
|
7
7
|
'data-button': 'resource-filters',
|
|
8
8
|
'data-action': 'click->toggle#togglePanel',
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<% end %>
|
|
28
28
|
<% end %>
|
|
29
29
|
<% elsif item.is_collaboration? %>
|
|
30
|
-
<%= render Avo::
|
|
30
|
+
<%= render Avo::Collaboration::TimelineComponent.new(resource: @resource) %>
|
|
31
31
|
<% elsif item.is_header? %>
|
|
32
32
|
<% if @resource.cover.present? && @resource.cover.visible_in_current_view? %>
|
|
33
33
|
<%= render Avo::CoverComponent.new cover: @resource.cover %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<%= render Avo::ModalComponent.new(
|
|
2
|
+
class: "hotkey",
|
|
3
|
+
title: "Keyboard shortcuts",
|
|
4
|
+
width: :xl,
|
|
5
|
+
hidden: true,
|
|
6
|
+
behavior: :persistent
|
|
7
|
+
) do %>
|
|
8
|
+
<div class="hotkey__grid">
|
|
9
|
+
<% sections.each do |section| %>
|
|
10
|
+
<section class="hotkey__section" aria-labelledby="<%= section[:id] %>">
|
|
11
|
+
<h3 class="hotkey__section-title" id="<%= section[:id] %>">
|
|
12
|
+
<%= section[:title] %>
|
|
13
|
+
</h3>
|
|
14
|
+
|
|
15
|
+
<ul class="hotkey__section-body">
|
|
16
|
+
<% section[:shortcuts].each do |shortcut| %>
|
|
17
|
+
<li class="hotkey__row">
|
|
18
|
+
<span class="hotkey__action"><%= shortcut[:action] %></span>
|
|
19
|
+
|
|
20
|
+
<%= tag.span class: "hotkey__keys", **(shortcut[:keys_aria_label].present? ? {aria: {label: shortcut[:keys_aria_label]}} : {}) do %>
|
|
21
|
+
<%= render_shortcut_keys(shortcut) %>
|
|
22
|
+
<% end %>
|
|
23
|
+
</li>
|
|
24
|
+
<% end %>
|
|
25
|
+
</ul>
|
|
26
|
+
</section>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
<% end %>
|