coveragebook_components 0.9.1 → 0.10.1.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +4433 -3098
- data/app/assets/build/coco/app.js +125 -109
- data/app/assets/build/coco/book.css +1492 -99
- data/app/assets/build/coco/book.js +279 -18
- data/app/assets/css/app/tippy.css +1 -1
- data/app/assets/css/app.css +3 -3
- data/app/assets/css/{base/base.css → base.css} +14 -6
- data/app/assets/css/book.css +2 -2
- data/app/assets/css/{libs → shared}/tippy.css +20 -1
- data/app/assets/css/shared/utils/text.css +143 -0
- data/app/assets/js/app.js +2 -2
- data/app/assets/js/book.js +2 -2
- data/app/assets/js/libs/alpine/directives/dropdown.js +1 -1
- data/app/assets/js/libs/alpine/directives/tooltip.js +1 -1
- data/app/assets/js/shared/components.js +4 -0
- data/app/components/coco/app/blocks/header/header.js +1 -1
- data/app/components/coco/app/blocks/header/header.rb +2 -2
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.css +4 -0
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.js +1 -1
- data/app/components/coco/app/blocks/sidebar_nav/item/item.css +3 -3
- data/app/components/coco/app/blocks/sidebar_nav/item/item.js +2 -2
- data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +3 -3
- data/app/components/coco/app/blocks/sidebar_nav/menu/menu.js +1 -1
- data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.js +1 -1
- data/app/components/coco/app/blocks/slide_editor/slide_editor.js +1 -1
- data/app/components/coco/app/elements/alert/alert.css +18 -50
- data/app/components/coco/app/elements/alert/alert.html.erb +2 -2
- data/app/components/coco/app/elements/alert/alert.js +1 -1
- data/app/components/coco/app/elements/alert/alert.rb +11 -16
- data/app/components/coco/app/elements/color_picker/color_picker.css +2 -2
- data/app/components/coco/app/elements/color_picker/color_picker.js +1 -1
- data/app/components/coco/app/elements/color_picker_button/color_picker_button.js +1 -1
- data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +3 -3
- data/app/components/coco/app/elements/confirm_panel/confirm_panel.css +1 -1
- data/app/components/coco/app/elements/confirm_panel/confirm_panel.js +1 -1
- data/app/components/coco/app/elements/image_picker/image_picker.css +4 -4
- data/app/components/coco/app/elements/image_picker/image_picker.js +1 -1
- data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +1 -1
- data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +3 -3
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +1 -1
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +3 -3
- data/app/components/coco/app/elements/link/link.rb +1 -1
- data/app/components/coco/app/elements/menu/menu.css +5 -5
- data/app/components/coco/app/elements/menu_button/menu_button.js +1 -1
- data/app/components/coco/app/elements/menu_button/menu_button.rb +3 -3
- data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
- data/app/components/coco/app/elements/notice/notice.js +1 -1
- data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.js +1 -1
- data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
- data/app/components/coco/app/elements/snackbar/snackbar.js +1 -1
- data/app/components/coco/app/elements/stamp/stamp.css +103 -0
- data/app/components/coco/app/elements/stamp/stamp.html.erb +3 -0
- data/app/components/coco/app/elements/stamp/stamp.rb +29 -0
- data/app/components/coco/app/elements/system_banner/system_banner.js +1 -1
- data/app/components/coco/app/elements/toast/toast.js +1 -1
- data/app/components/coco/app/elements/toolbar/toolbar.js +1 -1
- data/app/components/coco/app/elements/toolbar/toolbar.rb +1 -1
- data/app/components/coco/app/fields/button_component.rb +1 -1
- data/app/components/coco/app/fields/submit_component.rb +1 -0
- data/app/components/coco/app/layouts/application/application.css +1 -1
- data/app/components/coco/app/layouts/application/application.js +1 -1
- data/app/components/coco/app/layouts/page/page.css +4 -0
- data/app/components/coco/app/layouts/page/page.html.erb +5 -0
- data/app/components/coco/app/layouts/page/page.js +1 -1
- data/app/components/coco/app/layouts/page/page.rb +4 -0
- data/app/components/coco/{app/elements → shared}/button/button.css +104 -32
- data/app/components/coco/shared/button/button.html.erb +83 -0
- data/app/components/coco/{base → shared}/button/button.js +2 -1
- data/app/components/coco/{base → shared}/button/button.rb +107 -42
- data/app/components/coco/{base → shared}/button/button_dropdown.js +11 -2
- data/app/components/coco/{app/elements → shared}/button_group/button_group.css +1 -1
- data/app/components/coco/{app/elements → shared}/button_group/button_group.js +12 -4
- data/app/components/coco/shared/button_group/button_group.rb +40 -0
- data/app/components/coco/{app/elements → shared}/button_to/button_to.css +1 -1
- data/app/components/coco/shared/button_to/button_to.rb +50 -0
- data/app/components/coco/{base → shared}/dropdown/dropdown.js +1 -1
- data/app/components/coco/{base → shared}/icon/icon.js +1 -1
- data/app/components/coco/{base → shared}/image_uploader/image_uploader.js +1 -1
- data/app/components/coco/{base → shared}/modal/modal.html.erb +2 -2
- data/app/components/coco/{base → shared}/modal/modal.js +3 -3
- data/app/components/coco/{base → shared}/modal/modal.rb +6 -4
- data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.js +1 -1
- data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.js +1 -1
- data/app/components/coco/{base → shared}/placeholder/placeholder.html.erb +1 -1
- data/app/components/coco/{base → shared}/placeholder/placeholder.rb +6 -0
- data/app/components/coco/{base → shared}/poll_controller/poll_controller.js +1 -1
- data/app/helpers/coco/app_helper.rb +17 -23
- data/app/helpers/coco/component_helper.rb +1 -1
- data/app/helpers/coco/{base_helper.rb → shared_helper.rb} +26 -3
- data/app/helpers/coco/url_helper.rb +1 -1
- data/config/tailwind.app.config.cjs +1 -1
- data/config/tailwind.book.config.cjs +1 -0
- data/config/tokens.cjs +9 -4
- data/lib/coco/engine.rb +6 -4
- data/lib/coco.rb +1 -1
- data/lib/generators/coco/coco_generator.rb +1 -1
- metadata +77 -80
- data/app/assets/css/base/components/coco.css +0 -14
- data/app/assets/css/base/components/dropdown.css +0 -7
- data/app/assets/css/base/components/tooltip.css +0 -19
- data/app/assets/js/base/components.js +0 -4
- data/app/components/coco/app/blocks/slat/slat.css +0 -9
- data/app/components/coco/app/blocks/slat/slat.rb +0 -13
- data/app/components/coco/app/elements/button/button.rb +0 -87
- data/app/components/coco/app/elements/button_group/button_group.rb +0 -42
- data/app/components/coco/app/elements/button_to/button_to.rb +0 -54
- data/app/components/coco/base/button/button.css +0 -75
- data/app/components/coco/base/button/button.html.erb +0 -71
- /data/app/assets/css/app/{utilities.css → utils.css} +0 -0
- /data/app/assets/css/{base → shared}/utils/colors.css +0 -0
- /data/app/assets/css/{base → shared}/utils/icons.css +0 -0
- /data/app/assets/js/{coco.js → shared/coco.js} +0 -0
- /data/app/components/coco/{base → shared}/avatar/avatar.css +0 -0
- /data/app/components/coco/{base → shared}/avatar/avatar.rb +0 -0
- /data/app/components/coco/{app/elements → shared}/button_group/button_group.html.erb +0 -0
- /data/app/components/coco/{app/elements → shared}/button_to/button_to.html.erb +0 -0
- /data/app/components/coco/{base → shared}/content/content.rb +0 -0
- /data/app/components/coco/{base → shared}/dropdown/dropdown.css +0 -0
- /data/app/components/coco/{base → shared}/dropdown/dropdown.html.erb +0 -0
- /data/app/components/coco/{base → shared}/dropdown/dropdown.rb +0 -0
- /data/app/components/coco/{base → shared}/embeds/youtube/youtube.css +0 -0
- /data/app/components/coco/{base → shared}/embeds/youtube/youtube.html.erb +0 -0
- /data/app/components/coco/{base → shared}/embeds/youtube/youtube.rb +0 -0
- /data/app/components/coco/{base → shared}/icon/icon.css +0 -0
- /data/app/components/coco/{base → shared}/icon/icon.html.erb +0 -0
- /data/app/components/coco/{base → shared}/icon/icon.rb +0 -0
- /data/app/components/coco/{base → shared}/image/image.css +0 -0
- /data/app/components/coco/{base → shared}/image/image.rb +0 -0
- /data/app/components/coco/{base → shared}/image_uploader/image_uploader.css +0 -0
- /data/app/components/coco/{base → shared}/image_uploader/image_uploader.html.erb +0 -0
- /data/app/components/coco/{base → shared}/image_uploader/image_uploader.rb +0 -0
- /data/app/components/coco/{base → shared}/link/link.css +0 -0
- /data/app/components/coco/{base → shared}/link/link.rb +0 -0
- /data/app/components/coco/{base → shared}/modal/modal.css +0 -0
- /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.css +0 -0
- /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.html.erb +0 -0
- /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.rb +0 -0
- /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.css +0 -0
- /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.html.erb +0 -0
- /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.rb +0 -0
- /data/app/components/coco/{base → shared}/pager_link/pager_link.css +0 -0
- /data/app/components/coco/{base → shared}/pager_link/pager_link.html.erb +0 -0
- /data/app/components/coco/{base → shared}/pager_link/pager_link.rb +0 -0
- /data/app/components/coco/{base → shared}/panel/panel.css +0 -0
- /data/app/components/coco/{base → shared}/panel/panel.html.erb +0 -0
- /data/app/components/coco/{base → shared}/panel/panel.rb +0 -0
- /data/app/components/coco/{base → shared}/placeholder/placeholder.css +0 -0
- /data/app/components/coco/{base → shared}/poll_controller/poll_controller.css +0 -0
- /data/app/components/coco/{base → shared}/poll_controller/poll_controller.html.erb +0 -0
- /data/app/components/coco/{base → shared}/poll_controller/poll_controller.rb +0 -0
- /data/app/components/coco/{base → shared}/svg/svg.html.erb +0 -0
- /data/app/components/coco/{base → shared}/svg/svg.rb +0 -0
@@ -3,7 +3,7 @@ module Coco
|
|
3
3
|
module Blocks
|
4
4
|
class Header < Coco::Component
|
5
5
|
renders_one :primary_nav, ->(**kwargs) do
|
6
|
-
Coco::
|
6
|
+
Coco::ButtonGroup.new(
|
7
7
|
theme: :text_neutral_light,
|
8
8
|
collapsible: false,
|
9
9
|
size: :xs,
|
@@ -12,7 +12,7 @@ module Coco
|
|
12
12
|
end
|
13
13
|
|
14
14
|
renders_one :secondary_nav, ->(**kwargs) do
|
15
|
-
Coco::
|
15
|
+
Coco::ButtonGroup.new(
|
16
16
|
theme: :text_neutral_light,
|
17
17
|
collapsible: false,
|
18
18
|
size: :xs,
|
@@ -42,7 +42,7 @@
|
|
42
42
|
@layer utilities {
|
43
43
|
.app-sidebar-nav-horizontal-item {
|
44
44
|
.nav-item-label {
|
45
|
-
@apply
|
45
|
+
@apply coco-label-xxs mt-0.5;
|
46
46
|
}
|
47
47
|
|
48
48
|
.nav-item-icon .coco-icon {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
@apply py-4;
|
82
82
|
|
83
83
|
.nav-item-label {
|
84
|
-
@apply
|
84
|
+
@apply coco-label-xxs mt-1;
|
85
85
|
}
|
86
86
|
|
87
87
|
.nav-item-icon .coco-icon {
|
@@ -102,7 +102,7 @@
|
|
102
102
|
@apply py-5;
|
103
103
|
|
104
104
|
.nav-item-label {
|
105
|
-
@apply
|
105
|
+
@apply coco-label-xs mt-1.5;
|
106
106
|
}
|
107
107
|
|
108
108
|
.nav-item-icon .coco-icon {
|
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
|
24
24
|
.menu-item-qualifier {
|
25
|
-
@apply ml-auto
|
25
|
+
@apply ml-auto coco-label-sm flex-none pl-4;
|
26
26
|
}
|
27
27
|
|
28
28
|
.menu-item-select {
|
@@ -47,12 +47,12 @@
|
|
47
47
|
}
|
48
48
|
|
49
49
|
h4 {
|
50
|
-
@apply text-content-light-1 font-bold
|
50
|
+
@apply text-content-light-1 font-bold coco-heading-6;
|
51
51
|
grid-area: title;
|
52
52
|
}
|
53
53
|
|
54
54
|
div {
|
55
|
-
@apply
|
55
|
+
@apply coco-para-sm;
|
56
56
|
grid-area: text;
|
57
57
|
}
|
58
58
|
}
|
@@ -5,14 +5,14 @@
|
|
5
5
|
.alert-container {
|
6
6
|
@apply flex items-start px-4 py-2 relative;
|
7
7
|
}
|
8
|
-
|
8
|
+
/*
|
9
9
|
.alert-icon {
|
10
10
|
@apply flex items-center p-2 rounded-full;
|
11
11
|
|
12
12
|
.coco-icon {
|
13
13
|
@apply w-5 h-5;
|
14
14
|
}
|
15
|
-
}
|
15
|
+
} */
|
16
16
|
|
17
17
|
.alert-body {
|
18
18
|
@apply pl-4 pr-2;
|
@@ -23,11 +23,11 @@
|
|
23
23
|
}
|
24
24
|
|
25
25
|
.alert-title {
|
26
|
-
@apply
|
26
|
+
@apply coco-heading-6 font-bold;
|
27
27
|
}
|
28
28
|
|
29
29
|
.alert-message {
|
30
|
-
@apply
|
30
|
+
@apply coco-para-md;
|
31
31
|
|
32
32
|
a {
|
33
33
|
@apply text-current;
|
@@ -58,6 +58,14 @@
|
|
58
58
|
.alert-body {
|
59
59
|
@apply @[1000px]:w-auto;
|
60
60
|
}
|
61
|
+
|
62
|
+
.alert-stamp .coco-icon {
|
63
|
+
@apply text-content-light-1;
|
64
|
+
}
|
65
|
+
|
66
|
+
&[data-theme="warning-vivid"] .alert-stamp .coco-icon {
|
67
|
+
@apply text-content-dark-1;
|
68
|
+
}
|
61
69
|
}
|
62
70
|
|
63
71
|
/* Dismissable */
|
@@ -80,20 +88,16 @@
|
|
80
88
|
@apply py-1.5;
|
81
89
|
}
|
82
90
|
|
83
|
-
.alert-icon {
|
84
|
-
@apply p-0 !bg-transparent;
|
85
|
-
}
|
86
|
-
|
87
91
|
.alert-body {
|
88
92
|
@apply pl-3;
|
89
93
|
}
|
90
94
|
|
91
95
|
.alert-title {
|
92
|
-
@apply
|
96
|
+
@apply coco-para-md sm:coco-para-sm xl:coco-para-md;
|
93
97
|
}
|
94
98
|
|
95
99
|
.alert-message {
|
96
|
-
@apply
|
100
|
+
@apply coco-para-md sm:coco-para-sm xl:coco-para-md;
|
97
101
|
}
|
98
102
|
}
|
99
103
|
|
@@ -122,10 +126,6 @@
|
|
122
126
|
@apply text-content-light-1;
|
123
127
|
}
|
124
128
|
|
125
|
-
.alert-icon {
|
126
|
-
@apply text-content-light-1;
|
127
|
-
}
|
128
|
-
|
129
129
|
.coco_link:not([data-theme]) {
|
130
130
|
@apply app-link-neutral-light;
|
131
131
|
}
|
@@ -133,26 +133,14 @@
|
|
133
133
|
|
134
134
|
&[data-theme="positive"] {
|
135
135
|
@apply bg-background-positive-light border-positive-300 hover:border-positive-400;
|
136
|
-
|
137
|
-
.alert-icon {
|
138
|
-
@apply text-content-positive bg-positive-200;
|
139
|
-
}
|
140
136
|
}
|
141
137
|
|
142
138
|
&[data-theme="positive-vivid"] {
|
143
139
|
@apply bg-background-positive;
|
144
|
-
|
145
|
-
.alert-icon {
|
146
|
-
@apply bg-positive-700;
|
147
|
-
}
|
148
140
|
}
|
149
141
|
|
150
142
|
&[data-theme="warning"] {
|
151
143
|
@apply bg-background-warning-light border-warning-300 hover:border-warning-400;
|
152
|
-
|
153
|
-
.alert-icon {
|
154
|
-
@apply text-content-warning bg-warning-100;
|
155
|
-
}
|
156
144
|
}
|
157
145
|
|
158
146
|
&[data-theme="warning-vivid"] {
|
@@ -162,10 +150,6 @@
|
|
162
150
|
@apply text-content-dark-1;
|
163
151
|
}
|
164
152
|
|
165
|
-
.alert-icon {
|
166
|
-
@apply bg-warning-600;
|
167
|
-
}
|
168
|
-
|
169
153
|
.coco-link:not([data-theme]) {
|
170
154
|
@apply app-link-neutral-dark;
|
171
155
|
}
|
@@ -173,34 +157,18 @@
|
|
173
157
|
|
174
158
|
&[data-theme="negative"] {
|
175
159
|
@apply bg-background-negative-light border-negative-300 hover:border-negative-400;
|
176
|
-
|
177
|
-
.alert-icon {
|
178
|
-
@apply text-content-negative bg-negative-200;
|
179
|
-
}
|
180
160
|
}
|
181
161
|
|
182
162
|
&[data-theme="negative-vivid"] {
|
183
163
|
@apply bg-background-negative;
|
184
|
-
|
185
|
-
.alert-icon {
|
186
|
-
@apply bg-negative-700;
|
187
|
-
}
|
188
164
|
}
|
189
165
|
|
190
166
|
&[data-theme="info"] {
|
191
167
|
@apply bg-background-info-light border-info-300 hover:border-info-400;
|
192
|
-
|
193
|
-
.alert-icon {
|
194
|
-
@apply text-content-info bg-info-200;
|
195
|
-
}
|
196
168
|
}
|
197
169
|
|
198
170
|
&[data-theme="info-vivid"] {
|
199
171
|
@apply bg-background-info;
|
200
|
-
|
201
|
-
.alert-icon {
|
202
|
-
@apply bg-info-700;
|
203
|
-
}
|
204
172
|
}
|
205
173
|
}
|
206
174
|
}
|
@@ -224,7 +192,7 @@
|
|
224
192
|
@apply py-3;
|
225
193
|
}
|
226
194
|
|
227
|
-
.coco-
|
195
|
+
.coco-stamp {
|
228
196
|
@apply mt-1.5;
|
229
197
|
}
|
230
198
|
|
@@ -249,7 +217,7 @@
|
|
249
217
|
@apply items-center;
|
250
218
|
}
|
251
219
|
|
252
|
-
.alert-
|
220
|
+
.alert-stamp {
|
253
221
|
@apply self-center;
|
254
222
|
}
|
255
223
|
|
@@ -267,7 +235,7 @@
|
|
267
235
|
@apply items-center py-2.5;
|
268
236
|
}
|
269
237
|
|
270
|
-
.alert-
|
238
|
+
.alert-stamp {
|
271
239
|
@apply self-center;
|
272
240
|
}
|
273
241
|
|
@@ -292,7 +260,7 @@
|
|
292
260
|
@apply py-2;
|
293
261
|
}
|
294
262
|
|
295
|
-
.coco-
|
263
|
+
.coco-stamp {
|
296
264
|
@apply mt-0;
|
297
265
|
}
|
298
266
|
|
@@ -2,22 +2,11 @@ module Coco
|
|
2
2
|
module App
|
3
3
|
module Elements
|
4
4
|
class Alert < Coco::Component
|
5
|
-
include Concerns::
|
5
|
+
include Concerns::AcceptsOptions
|
6
6
|
include Concerns::AcceptsTheme
|
7
7
|
|
8
8
|
THEMES = %W[positive warning negative info positive-vivid warning-vivid negative-vivid info-vivid]
|
9
9
|
|
10
|
-
THEME_ICONS = {
|
11
|
-
positive: :check_circle,
|
12
|
-
positive_vivid: :check_circle,
|
13
|
-
warning: :alert_triangle,
|
14
|
-
warning_vivid: :alert_triangle,
|
15
|
-
negative: :alert_circle,
|
16
|
-
negative_vivid: :alert_circle,
|
17
|
-
info: :info,
|
18
|
-
info_vivid: :info
|
19
|
-
}.freeze
|
20
|
-
|
21
10
|
accepts_option :dismissable, from: [true, false], default: false
|
22
11
|
accepts_option :dismiss_after_action, from: [true, false], default: true
|
23
12
|
accepts_option :banner, from: [true, false], default: false
|
@@ -45,13 +34,9 @@ module Coco
|
|
45
34
|
end
|
46
35
|
|
47
36
|
before_render do
|
48
|
-
theme = get_option_value(:theme)
|
49
|
-
|
50
37
|
unless tag_attr?(:id)
|
51
38
|
set_tag_attr(:id, "alert-#{rand(1000)}")
|
52
39
|
end
|
53
|
-
|
54
|
-
icon(name: THEME_ICONS[theme.tr("-", "_").to_sym])
|
55
40
|
end
|
56
41
|
|
57
42
|
def dismissable?
|
@@ -78,6 +63,16 @@ module Coco
|
|
78
63
|
def button_size
|
79
64
|
get_option_value(:condensed) ? :xs : :sm
|
80
65
|
end
|
66
|
+
|
67
|
+
def stamp
|
68
|
+
type = unvividify(get_option_value(:theme))&.to_sym
|
69
|
+
style = if get_option_value(:banner)
|
70
|
+
:compact
|
71
|
+
else
|
72
|
+
vivid? ? :inverse : :subtle
|
73
|
+
end
|
74
|
+
coco_stamp(type, style:)
|
75
|
+
end
|
81
76
|
end
|
82
77
|
end
|
83
78
|
end
|
@@ -110,7 +110,7 @@
|
|
110
110
|
}
|
111
111
|
|
112
112
|
.picker-display-input {
|
113
|
-
@apply
|
113
|
+
@apply coco-para-sm h-9;
|
114
114
|
}
|
115
115
|
|
116
116
|
.picker-display-color {
|
@@ -143,7 +143,7 @@
|
|
143
143
|
}
|
144
144
|
|
145
145
|
.picker-display-input {
|
146
|
-
@apply
|
146
|
+
@apply coco-para-md h-11;
|
147
147
|
}
|
148
148
|
|
149
149
|
.picker-display-color {
|
@@ -7,7 +7,7 @@ module Coco
|
|
7
7
|
include Coco::AppHelper
|
8
8
|
|
9
9
|
wraps_component :button do |args|
|
10
|
-
Coco::
|
10
|
+
Coco::Button.new(**args)
|
11
11
|
end
|
12
12
|
|
13
13
|
renders_one :text, Coco::Content
|
@@ -44,8 +44,8 @@ module Coco
|
|
44
44
|
@selected = selected
|
45
45
|
|
46
46
|
@size = kwargs.fetch(:size, :default)&.to_sym
|
47
|
-
if @size.in?(Coco::
|
48
|
-
@size, @resize = Coco::
|
47
|
+
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
48
|
+
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -72,12 +72,12 @@
|
|
72
72
|
}
|
73
73
|
|
74
74
|
.picker-placeholder-text {
|
75
|
-
@apply
|
75
|
+
@apply coco-para-sm;
|
76
76
|
width: 148px;
|
77
77
|
}
|
78
78
|
|
79
79
|
.picker-file-name {
|
80
|
-
@apply
|
80
|
+
@apply coco-label-sm;
|
81
81
|
}
|
82
82
|
|
83
83
|
.picker-actions {
|
@@ -94,12 +94,12 @@
|
|
94
94
|
}
|
95
95
|
|
96
96
|
.picker-placeholder-text {
|
97
|
-
@apply
|
97
|
+
@apply coco-para-md;
|
98
98
|
width: 172px;
|
99
99
|
}
|
100
100
|
|
101
101
|
.picker-file-name {
|
102
|
-
@apply
|
102
|
+
@apply coco-label-md;
|
103
103
|
}
|
104
104
|
|
105
105
|
.picker-actions {
|
@@ -7,7 +7,7 @@ module Coco
|
|
7
7
|
include Coco::AppHelper
|
8
8
|
|
9
9
|
wraps_component :button do |args|
|
10
|
-
Coco::
|
10
|
+
Coco::Button.new(icon: :image_plus, **args)
|
11
11
|
end
|
12
12
|
|
13
13
|
renders_one :text, Coco::Content
|
@@ -35,8 +35,8 @@ module Coco
|
|
35
35
|
@src = src
|
36
36
|
|
37
37
|
@size = kwargs.fetch(:size, :default)&.to_sym
|
38
|
-
if @size.in?(Coco::
|
39
|
-
@size, @resize = Coco::
|
38
|
+
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
39
|
+
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -9,7 +9,7 @@ module Coco
|
|
9
9
|
|
10
10
|
wraps_component :button do |args|
|
11
11
|
args[:class] = [args[:class], "layout-picker-trigger"]
|
12
|
-
Coco::
|
12
|
+
Coco::Button.new(**args)
|
13
13
|
end
|
14
14
|
|
15
15
|
renders_many :layouts, ->(name:, thumbnail:, **layout_options) do
|
@@ -24,8 +24,8 @@ module Coco
|
|
24
24
|
@resize = {}
|
25
25
|
|
26
26
|
@size = kwargs.fetch(:size, :default)&.to_sym
|
27
|
-
if @size.in?(Coco::
|
28
|
-
@size, @resize = Coco::
|
27
|
+
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
28
|
+
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
}
|
10
10
|
|
11
11
|
> .coco-button-wrapper > .coco-button,
|
12
|
-
> [data-component="
|
12
|
+
> [data-component="button-to"] .coco-button,
|
13
13
|
> [data-component="app-menu-button"]
|
14
14
|
> .coco-button-wrapper
|
15
15
|
> .coco-button {
|
@@ -34,8 +34,8 @@
|
|
34
34
|
@apply py-1.5;
|
35
35
|
|
36
36
|
.menu-item {
|
37
|
-
[data-component="
|
38
|
-
@apply px-4 py-2
|
37
|
+
[data-component="button"] {
|
38
|
+
@apply px-4 py-2 coco-label-sm;
|
39
39
|
|
40
40
|
.button-inner {
|
41
41
|
@apply gap-2;
|
@@ -52,8 +52,8 @@
|
|
52
52
|
@apply py-2;
|
53
53
|
|
54
54
|
.menu-item {
|
55
|
-
[data-component="
|
56
|
-
@apply px-5 py-2.5
|
55
|
+
[data-component="button"] {
|
56
|
+
@apply px-5 py-2.5 coco-label-md;
|
57
57
|
|
58
58
|
.button-inner {
|
59
59
|
@apply gap-2;
|
@@ -9,11 +9,11 @@ module Coco
|
|
9
9
|
|
10
10
|
wraps_component :button do |kwargs|
|
11
11
|
@size = kwargs.fetch(:size, :default)&.to_sym
|
12
|
-
if @size.in?(Coco::
|
13
|
-
@size, @resize = Coco::
|
12
|
+
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
13
|
+
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
14
14
|
end
|
15
15
|
|
16
|
-
Coco::
|
16
|
+
Coco::Button.new(toggle: :vertical, fit: get_option_value(:fit) || :auto, **kwargs)
|
17
17
|
end
|
18
18
|
|
19
19
|
accepts_option :fit, from: [:auto, :full]
|