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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +4433 -3098
  3. data/app/assets/build/coco/app.js +125 -109
  4. data/app/assets/build/coco/book.css +1492 -99
  5. data/app/assets/build/coco/book.js +279 -18
  6. data/app/assets/css/app/tippy.css +1 -1
  7. data/app/assets/css/app.css +3 -3
  8. data/app/assets/css/{base/base.css → base.css} +14 -6
  9. data/app/assets/css/book.css +2 -2
  10. data/app/assets/css/{libs → shared}/tippy.css +20 -1
  11. data/app/assets/css/shared/utils/text.css +143 -0
  12. data/app/assets/js/app.js +2 -2
  13. data/app/assets/js/book.js +2 -2
  14. data/app/assets/js/libs/alpine/directives/dropdown.js +1 -1
  15. data/app/assets/js/libs/alpine/directives/tooltip.js +1 -1
  16. data/app/assets/js/shared/components.js +4 -0
  17. data/app/components/coco/app/blocks/header/header.js +1 -1
  18. data/app/components/coco/app/blocks/header/header.rb +2 -2
  19. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.css +4 -0
  20. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.js +1 -1
  21. data/app/components/coco/app/blocks/sidebar_nav/item/item.css +3 -3
  22. data/app/components/coco/app/blocks/sidebar_nav/item/item.js +2 -2
  23. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +3 -3
  24. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.js +1 -1
  25. data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.js +1 -1
  26. data/app/components/coco/app/blocks/slide_editor/slide_editor.js +1 -1
  27. data/app/components/coco/app/elements/alert/alert.css +18 -50
  28. data/app/components/coco/app/elements/alert/alert.html.erb +2 -2
  29. data/app/components/coco/app/elements/alert/alert.js +1 -1
  30. data/app/components/coco/app/elements/alert/alert.rb +11 -16
  31. data/app/components/coco/app/elements/color_picker/color_picker.css +2 -2
  32. data/app/components/coco/app/elements/color_picker/color_picker.js +1 -1
  33. data/app/components/coco/app/elements/color_picker_button/color_picker_button.js +1 -1
  34. data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +3 -3
  35. data/app/components/coco/app/elements/confirm_panel/confirm_panel.css +1 -1
  36. data/app/components/coco/app/elements/confirm_panel/confirm_panel.js +1 -1
  37. data/app/components/coco/app/elements/image_picker/image_picker.css +4 -4
  38. data/app/components/coco/app/elements/image_picker/image_picker.js +1 -1
  39. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +1 -1
  40. data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +3 -3
  41. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +1 -1
  42. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +3 -3
  43. data/app/components/coco/app/elements/link/link.rb +1 -1
  44. data/app/components/coco/app/elements/menu/menu.css +5 -5
  45. data/app/components/coco/app/elements/menu_button/menu_button.js +1 -1
  46. data/app/components/coco/app/elements/menu_button/menu_button.rb +3 -3
  47. data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
  48. data/app/components/coco/app/elements/notice/notice.js +1 -1
  49. data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.js +1 -1
  50. data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
  51. data/app/components/coco/app/elements/snackbar/snackbar.js +1 -1
  52. data/app/components/coco/app/elements/stamp/stamp.css +103 -0
  53. data/app/components/coco/app/elements/stamp/stamp.html.erb +3 -0
  54. data/app/components/coco/app/elements/stamp/stamp.rb +29 -0
  55. data/app/components/coco/app/elements/system_banner/system_banner.js +1 -1
  56. data/app/components/coco/app/elements/toast/toast.js +1 -1
  57. data/app/components/coco/app/elements/toolbar/toolbar.js +1 -1
  58. data/app/components/coco/app/elements/toolbar/toolbar.rb +1 -1
  59. data/app/components/coco/app/fields/button_component.rb +1 -1
  60. data/app/components/coco/app/fields/submit_component.rb +1 -0
  61. data/app/components/coco/app/layouts/application/application.css +1 -1
  62. data/app/components/coco/app/layouts/application/application.js +1 -1
  63. data/app/components/coco/app/layouts/page/page.css +4 -0
  64. data/app/components/coco/app/layouts/page/page.html.erb +5 -0
  65. data/app/components/coco/app/layouts/page/page.js +1 -1
  66. data/app/components/coco/app/layouts/page/page.rb +4 -0
  67. data/app/components/coco/{app/elements → shared}/button/button.css +104 -32
  68. data/app/components/coco/shared/button/button.html.erb +83 -0
  69. data/app/components/coco/{base → shared}/button/button.js +2 -1
  70. data/app/components/coco/{base → shared}/button/button.rb +107 -42
  71. data/app/components/coco/{base → shared}/button/button_dropdown.js +11 -2
  72. data/app/components/coco/{app/elements → shared}/button_group/button_group.css +1 -1
  73. data/app/components/coco/{app/elements → shared}/button_group/button_group.js +12 -4
  74. data/app/components/coco/shared/button_group/button_group.rb +40 -0
  75. data/app/components/coco/{app/elements → shared}/button_to/button_to.css +1 -1
  76. data/app/components/coco/shared/button_to/button_to.rb +50 -0
  77. data/app/components/coco/{base → shared}/dropdown/dropdown.js +1 -1
  78. data/app/components/coco/{base → shared}/icon/icon.js +1 -1
  79. data/app/components/coco/{base → shared}/image_uploader/image_uploader.js +1 -1
  80. data/app/components/coco/{base → shared}/modal/modal.html.erb +2 -2
  81. data/app/components/coco/{base → shared}/modal/modal.js +3 -3
  82. data/app/components/coco/{base → shared}/modal/modal.rb +6 -4
  83. data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.js +1 -1
  84. data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.js +1 -1
  85. data/app/components/coco/{base → shared}/placeholder/placeholder.html.erb +1 -1
  86. data/app/components/coco/{base → shared}/placeholder/placeholder.rb +6 -0
  87. data/app/components/coco/{base → shared}/poll_controller/poll_controller.js +1 -1
  88. data/app/helpers/coco/app_helper.rb +17 -23
  89. data/app/helpers/coco/component_helper.rb +1 -1
  90. data/app/helpers/coco/{base_helper.rb → shared_helper.rb} +26 -3
  91. data/app/helpers/coco/url_helper.rb +1 -1
  92. data/config/tailwind.app.config.cjs +1 -1
  93. data/config/tailwind.book.config.cjs +1 -0
  94. data/config/tokens.cjs +9 -4
  95. data/lib/coco/engine.rb +6 -4
  96. data/lib/coco.rb +1 -1
  97. data/lib/generators/coco/coco_generator.rb +1 -1
  98. metadata +77 -80
  99. data/app/assets/css/base/components/coco.css +0 -14
  100. data/app/assets/css/base/components/dropdown.css +0 -7
  101. data/app/assets/css/base/components/tooltip.css +0 -19
  102. data/app/assets/js/base/components.js +0 -4
  103. data/app/components/coco/app/blocks/slat/slat.css +0 -9
  104. data/app/components/coco/app/blocks/slat/slat.rb +0 -13
  105. data/app/components/coco/app/elements/button/button.rb +0 -87
  106. data/app/components/coco/app/elements/button_group/button_group.rb +0 -42
  107. data/app/components/coco/app/elements/button_to/button_to.rb +0 -54
  108. data/app/components/coco/base/button/button.css +0 -75
  109. data/app/components/coco/base/button/button.html.erb +0 -71
  110. /data/app/assets/css/app/{utilities.css → utils.css} +0 -0
  111. /data/app/assets/css/{base → shared}/utils/colors.css +0 -0
  112. /data/app/assets/css/{base → shared}/utils/icons.css +0 -0
  113. /data/app/assets/js/{coco.js → shared/coco.js} +0 -0
  114. /data/app/components/coco/{base → shared}/avatar/avatar.css +0 -0
  115. /data/app/components/coco/{base → shared}/avatar/avatar.rb +0 -0
  116. /data/app/components/coco/{app/elements → shared}/button_group/button_group.html.erb +0 -0
  117. /data/app/components/coco/{app/elements → shared}/button_to/button_to.html.erb +0 -0
  118. /data/app/components/coco/{base → shared}/content/content.rb +0 -0
  119. /data/app/components/coco/{base → shared}/dropdown/dropdown.css +0 -0
  120. /data/app/components/coco/{base → shared}/dropdown/dropdown.html.erb +0 -0
  121. /data/app/components/coco/{base → shared}/dropdown/dropdown.rb +0 -0
  122. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.css +0 -0
  123. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.html.erb +0 -0
  124. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.rb +0 -0
  125. /data/app/components/coco/{base → shared}/icon/icon.css +0 -0
  126. /data/app/components/coco/{base → shared}/icon/icon.html.erb +0 -0
  127. /data/app/components/coco/{base → shared}/icon/icon.rb +0 -0
  128. /data/app/components/coco/{base → shared}/image/image.css +0 -0
  129. /data/app/components/coco/{base → shared}/image/image.rb +0 -0
  130. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.css +0 -0
  131. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.html.erb +0 -0
  132. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.rb +0 -0
  133. /data/app/components/coco/{base → shared}/link/link.css +0 -0
  134. /data/app/components/coco/{base → shared}/link/link.rb +0 -0
  135. /data/app/components/coco/{base → shared}/modal/modal.css +0 -0
  136. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.css +0 -0
  137. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.html.erb +0 -0
  138. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.rb +0 -0
  139. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.css +0 -0
  140. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.html.erb +0 -0
  141. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.rb +0 -0
  142. /data/app/components/coco/{base → shared}/pager_link/pager_link.css +0 -0
  143. /data/app/components/coco/{base → shared}/pager_link/pager_link.html.erb +0 -0
  144. /data/app/components/coco/{base → shared}/pager_link/pager_link.rb +0 -0
  145. /data/app/components/coco/{base → shared}/panel/panel.css +0 -0
  146. /data/app/components/coco/{base → shared}/panel/panel.html.erb +0 -0
  147. /data/app/components/coco/{base → shared}/panel/panel.rb +0 -0
  148. /data/app/components/coco/{base → shared}/placeholder/placeholder.css +0 -0
  149. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.css +0 -0
  150. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.html.erb +0 -0
  151. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.rb +0 -0
  152. /data/app/components/coco/{base → shared}/svg/svg.html.erb +0 -0
  153. /data/app/components/coco/{base → shared}/svg/svg.rb +0 -0
@@ -1,4 +1,4 @@
1
- import tippy from "@libs/tippy";
1
+ import tippy from "@assets/js/libs/tippy";
2
2
  import buildConfig from "../utils/tippy_modifiers";
3
3
  import { setData } from "@helpers/alpine";
4
4
 
@@ -0,0 +1,4 @@
1
+ import { registerComponents } from "@helpers/alpine";
2
+ import sharedComponents from "@sharedComponents/**/*.js";
3
+
4
+ export default registerComponents(sharedComponents);
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
 
3
3
  export default CocoComponent("appHeader", () => {
4
4
  return {
@@ -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::App::Elements::ButtonGroup.new(
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::App::Elements::ButtonGroup.new(
15
+ Coco::ButtonGroup.new(
16
16
  theme: :text_neutral_light,
17
17
  collapsible: false,
18
18
  size: :xs,
@@ -24,6 +24,10 @@
24
24
  .button-inner {
25
25
  @apply mx-0 px-4 py-3;
26
26
  }
27
+
28
+ .button-label {
29
+ @apply font-normal;
30
+ }
27
31
  }
28
32
 
29
33
  .nav-drawer-heading {
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
 
3
3
  export default CocoComponent("appNavDrawer", () => {
4
4
  return {
@@ -42,7 +42,7 @@
42
42
  @layer utilities {
43
43
  .app-sidebar-nav-horizontal-item {
44
44
  .nav-item-label {
45
- @apply text-label-xxs mt-0.5;
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 text-label-xxs mt-1;
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 text-label-xs mt-1.5;
105
+ @apply coco-label-xs mt-1.5;
106
106
  }
107
107
 
108
108
  .nav-item-icon .coco-icon {
@@ -1,5 +1,5 @@
1
- import tippy from "@libs/tippy";
2
- import { CocoComponent } from "@js/coco";
1
+ import tippy from "@assets/js/libs/tippy";
2
+ import { CocoComponent } from "@assets/js/shared/coco";
3
3
 
4
4
  export default CocoComponent("appSidebarNavItem", () => {
5
5
  return {
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  .menu-item-qualifier {
25
- @apply ml-auto text-label-sm flex-none pl-4;
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 text-heading-6;
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 text-para-sm;
55
+ @apply coco-para-sm;
56
56
  grid-area: text;
57
57
  }
58
58
  }
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { navigateTo } from "@helpers/location";
3
3
 
4
4
  export default CocoComponent("appSidebarNavMenu", () => {
@@ -1,5 +1,5 @@
1
1
  import tokens from "@config/tokens.cjs";
2
- import { CocoComponent } from "@js/coco";
2
+ import { CocoComponent } from "@assets/js/shared/coco";
3
3
 
4
4
  const mobileMaxWidth = parseInt(tokens.app.screens.sm, 10);
5
5
 
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getData } from "@helpers/alpine";
3
3
  import { captureElementScreenshot } from "@helpers/screenshot";
4
4
  import { isDark } from "@helpers/color";
@@ -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 text-heading-6 font-bold;
26
+ @apply coco-heading-6 font-bold;
27
27
  }
28
28
 
29
29
  .alert-message {
30
- @apply text-para-md;
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 text-para-md sm:text-para-sm xl:text-para-md;
96
+ @apply coco-para-md sm:coco-para-sm xl:coco-para-md;
93
97
  }
94
98
 
95
99
  .alert-message {
96
- @apply text-para-md sm:text-para-sm xl:text-para-md;
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-icon {
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-icon {
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-icon {
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-icon {
263
+ .coco-stamp {
296
264
  @apply mt-0;
297
265
  }
298
266
 
@@ -9,8 +9,8 @@
9
9
  "vivid": vivid?
10
10
  }) do %>
11
11
  <div class="alert-container">
12
- <div class="alert-icon" data-role="icon">
13
- <%= icon %>
12
+ <div class="alert-stamp" data-role="icon">
13
+ <%= stamp %>
14
14
  </div>
15
15
 
16
16
  <div class="alert-body">
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
 
3
3
  export default CocoComponent("appAlert", () => {
4
4
  return {
@@ -2,22 +2,11 @@ module Coco
2
2
  module App
3
3
  module Elements
4
4
  class Alert < Coco::Component
5
- include Concerns::WithIcon
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 text-para-sm h-9;
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 text-para-md h-11;
146
+ @apply coco-para-md h-11;
147
147
  }
148
148
 
149
149
  .picker-display-color {
@@ -1,5 +1,5 @@
1
1
  import iro from "@jaames/iro";
2
- import { CocoComponent } from "@js/coco";
2
+ import { CocoComponent } from "@assets/js/shared/coco";
3
3
  import { isValidHex, formatHex } from "@helpers/color";
4
4
  import { getComponent } from "@helpers/alpine";
5
5
 
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getData } from "@helpers/alpine";
3
3
 
4
4
  export default CocoComponent("appColorPickerButton", ({ selected }) => {
@@ -7,7 +7,7 @@ module Coco
7
7
  include Coco::AppHelper
8
8
 
9
9
  wraps_component :button do |args|
10
- Coco::App::Elements::Button.new(**args)
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::App::Elements::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
48
- @size, @resize = Coco::App::Elements::Button::SIZE_ALIASES.fetch(@size)
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
 
@@ -4,7 +4,7 @@
4
4
  @apply px-5 py-4 text-center max-w-[200px] space-y-4;
5
5
 
6
6
  .confirm-text {
7
- @apply text-label-sm font-semibold;
7
+ @apply coco-label-sm font-semibold;
8
8
  }
9
9
  }
10
10
  }
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco.js";
1
+ import { CocoComponent } from "@assets/js/shared/coco.js";
2
2
 
3
3
  export default CocoComponent("appConfirmPanel", () => {
4
4
  return {
@@ -72,12 +72,12 @@
72
72
  }
73
73
 
74
74
  .picker-placeholder-text {
75
- @apply text-para-sm;
75
+ @apply coco-para-sm;
76
76
  width: 148px;
77
77
  }
78
78
 
79
79
  .picker-file-name {
80
- @apply text-label-sm;
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 text-para-md;
97
+ @apply coco-para-md;
98
98
  width: 172px;
99
99
  }
100
100
 
101
101
  .picker-file-name {
102
- @apply text-label-md;
102
+ @apply coco-label-md;
103
103
  }
104
104
 
105
105
  .picker-actions {
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getComponent } from "@helpers/alpine";
3
3
  import { basename } from "@helpers/path";
4
4
 
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getData } from "@helpers/alpine";
3
3
  import { basename } from "@helpers/path";
4
4
 
@@ -7,7 +7,7 @@ module Coco
7
7
  include Coco::AppHelper
8
8
 
9
9
  wraps_component :button do |args|
10
- Coco::App::Elements::Button.new(icon: :image_plus, **args)
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::App::Elements::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
39
- @size, @resize = Coco::App::Elements::Button::SIZE_ALIASES.fetch(@size)
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
 
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getData } from "@helpers/alpine";
3
3
 
4
4
  export default CocoComponent("appLayoutPickerButton", ({ selected }) => {
@@ -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::App::Elements::Button.new(**args)
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::App::Elements::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
28
- @size, @resize = Coco::App::Elements::Button::SIZE_ALIASES.fetch(@size)
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
 
@@ -25,7 +25,7 @@ module Coco
25
25
  end
26
26
 
27
27
  class << self
28
- include Coco::BaseHelper
28
+ include Coco::SharedHelper
29
29
  end
30
30
  end
31
31
  end
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  > .coco-button-wrapper > .coco-button,
12
- > [data-component="app-button-to"] .coco-button,
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="app-button"] {
38
- @apply px-4 py-2 text-label-sm;
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="app-button"] {
56
- @apply px-5 py-2.5 text-label-md;
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;
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
  import { getComponent } from "@helpers/alpine";
3
3
 
4
4
  export default CocoComponent("appMenuButton", () => {
@@ -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::App::Elements::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
13
- @size, @resize = Coco::App::Elements::Button::SIZE_ALIASES.fetch(@size)
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::App::Elements::Button.new(toggle: :vertical, fit: get_option_value(:fit) || :auto, **kwargs)
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]
@@ -16,7 +16,7 @@
16
16
  }
17
17
 
18
18
  .user-profile-email {
19
- @apply text-gray-500 text-label-sm italic truncate;
19
+ @apply text-gray-500 coco-label-sm italic truncate;
20
20
  }
21
21
  }
22
22
  }
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
 
3
3
  export default CocoComponent("appNotice", () => {
4
4
  return {};
@@ -1,4 +1,4 @@
1
- import { CocoComponent } from "@js/coco";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
2
 
3
3
  export default CocoComponent("appSeamlessTextarea", () => {
4
4
  return {
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  .snackbar-content {
25
- @apply text-label-md text-content-light-1 font-semibold flex-grow mr-2 my-2;
25
+ @apply coco-label-md text-content-light-1 font-semibold flex-grow mr-2 my-2;
26
26
  }
27
27
 
28
28
  .coco-button {