coveragebook_components 0.10.0 → 0.10.1.beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +4339 -3025
  3. data/app/assets/build/coco/app.js +116 -104
  4. data/app/assets/build/coco/book.css +1492 -92
  5. data/app/assets/build/coco/book.js +278 -17
  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 -7
  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 +4 -4
  28. data/app/components/coco/app/elements/alert/alert.js +1 -1
  29. data/app/components/coco/app/elements/color_picker/color_picker.css +2 -2
  30. data/app/components/coco/app/elements/color_picker/color_picker.js +1 -1
  31. data/app/components/coco/app/elements/color_picker_button/color_picker_button.js +1 -1
  32. data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +3 -3
  33. data/app/components/coco/app/elements/confirm_panel/confirm_panel.css +1 -1
  34. data/app/components/coco/app/elements/confirm_panel/confirm_panel.js +1 -1
  35. data/app/components/coco/app/elements/image_picker/image_picker.css +4 -4
  36. data/app/components/coco/app/elements/image_picker/image_picker.js +1 -1
  37. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +1 -1
  38. data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +3 -3
  39. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +1 -1
  40. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +3 -3
  41. data/app/components/coco/app/elements/link/link.rb +1 -1
  42. data/app/components/coco/app/elements/menu/menu.css +5 -5
  43. data/app/components/coco/app/elements/menu_button/menu_button.js +1 -1
  44. data/app/components/coco/app/elements/menu_button/menu_button.rb +3 -3
  45. data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
  46. data/app/components/coco/app/elements/notice/notice.js +1 -1
  47. data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.js +1 -1
  48. data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
  49. data/app/components/coco/app/elements/snackbar/snackbar.js +1 -1
  50. data/app/components/coco/app/elements/system_banner/system_banner.js +1 -1
  51. data/app/components/coco/app/elements/toast/toast.js +1 -1
  52. data/app/components/coco/app/elements/toolbar/toolbar.js +1 -1
  53. data/app/components/coco/app/elements/toolbar/toolbar.rb +1 -1
  54. data/app/components/coco/app/fields/button_component.rb +1 -1
  55. data/app/components/coco/app/fields/submit_component.rb +1 -0
  56. data/app/components/coco/app/layouts/application/application.js +1 -1
  57. data/app/components/coco/app/layouts/page/page.js +1 -1
  58. data/app/components/coco/{app/elements → shared}/button/button.css +104 -32
  59. data/app/components/coco/shared/button/button.html.erb +83 -0
  60. data/app/components/coco/{base → shared}/button/button.js +2 -1
  61. data/app/components/coco/{base → shared}/button/button.rb +107 -42
  62. data/app/components/coco/{base → shared}/button/button_dropdown.js +11 -2
  63. data/app/components/coco/{app/elements → shared}/button_group/button_group.css +1 -1
  64. data/app/components/coco/{app/elements → shared}/button_group/button_group.js +12 -4
  65. data/app/components/coco/shared/button_group/button_group.rb +40 -0
  66. data/app/components/coco/{app/elements → shared}/button_to/button_to.css +1 -1
  67. data/app/components/coco/shared/button_to/button_to.rb +50 -0
  68. data/app/components/coco/{base → shared}/dropdown/dropdown.js +1 -1
  69. data/app/components/coco/{base → shared}/icon/icon.js +1 -1
  70. data/app/components/coco/{base → shared}/image_uploader/image_uploader.js +1 -1
  71. data/app/components/coco/{base → shared}/modal/modal.js +2 -2
  72. data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.js +1 -1
  73. data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.js +1 -1
  74. data/app/components/coco/{base → shared}/poll_controller/poll_controller.js +1 -1
  75. data/app/helpers/coco/app_helper.rb +0 -23
  76. data/app/helpers/coco/component_helper.rb +1 -1
  77. data/app/helpers/coco/{base_helper.rb → shared_helper.rb} +24 -1
  78. data/app/helpers/coco/url_helper.rb +1 -1
  79. data/lib/coco/engine.rb +2 -2
  80. data/lib/coco.rb +1 -1
  81. data/lib/generators/coco/coco_generator.rb +1 -1
  82. metadata +74 -79
  83. data/app/assets/css/base/components/coco.css +0 -5
  84. data/app/assets/css/base/components/dropdown.css +0 -7
  85. data/app/assets/css/base/components/tooltip.css +0 -19
  86. data/app/assets/css/base/utils/text.css +0 -79
  87. data/app/assets/js/base/components.js +0 -4
  88. data/app/components/coco/app/elements/button/button.rb +0 -87
  89. data/app/components/coco/app/elements/button_group/button_group.rb +0 -42
  90. data/app/components/coco/app/elements/button_to/button_to.rb +0 -54
  91. data/app/components/coco/base/button/button.css +0 -75
  92. data/app/components/coco/base/button/button.html.erb +0 -71
  93. /data/app/assets/css/app/{utilities.css → utils.css} +0 -0
  94. /data/app/assets/css/{base → shared}/utils/colors.css +0 -0
  95. /data/app/assets/css/{base → shared}/utils/icons.css +0 -0
  96. /data/app/assets/js/{coco.js → shared/coco.js} +0 -0
  97. /data/app/components/coco/{base → shared}/avatar/avatar.css +0 -0
  98. /data/app/components/coco/{base → shared}/avatar/avatar.rb +0 -0
  99. /data/app/components/coco/{app/elements → shared}/button_group/button_group.html.erb +0 -0
  100. /data/app/components/coco/{app/elements → shared}/button_to/button_to.html.erb +0 -0
  101. /data/app/components/coco/{base → shared}/content/content.rb +0 -0
  102. /data/app/components/coco/{base → shared}/dropdown/dropdown.css +0 -0
  103. /data/app/components/coco/{base → shared}/dropdown/dropdown.html.erb +0 -0
  104. /data/app/components/coco/{base → shared}/dropdown/dropdown.rb +0 -0
  105. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.css +0 -0
  106. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.html.erb +0 -0
  107. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.rb +0 -0
  108. /data/app/components/coco/{base → shared}/icon/icon.css +0 -0
  109. /data/app/components/coco/{base → shared}/icon/icon.html.erb +0 -0
  110. /data/app/components/coco/{base → shared}/icon/icon.rb +0 -0
  111. /data/app/components/coco/{base → shared}/image/image.css +0 -0
  112. /data/app/components/coco/{base → shared}/image/image.rb +0 -0
  113. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.css +0 -0
  114. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.html.erb +0 -0
  115. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.rb +0 -0
  116. /data/app/components/coco/{base → shared}/link/link.css +0 -0
  117. /data/app/components/coco/{base → shared}/link/link.rb +0 -0
  118. /data/app/components/coco/{base → shared}/modal/modal.css +0 -0
  119. /data/app/components/coco/{base → shared}/modal/modal.html.erb +0 -0
  120. /data/app/components/coco/{base → shared}/modal/modal.rb +0 -0
  121. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.css +0 -0
  122. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.html.erb +0 -0
  123. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.rb +0 -0
  124. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.css +0 -0
  125. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.html.erb +0 -0
  126. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.rb +0 -0
  127. /data/app/components/coco/{base → shared}/pager_link/pager_link.css +0 -0
  128. /data/app/components/coco/{base → shared}/pager_link/pager_link.html.erb +0 -0
  129. /data/app/components/coco/{base → shared}/pager_link/pager_link.rb +0 -0
  130. /data/app/components/coco/{base → shared}/panel/panel.css +0 -0
  131. /data/app/components/coco/{base → shared}/panel/panel.html.erb +0 -0
  132. /data/app/components/coco/{base → shared}/panel/panel.rb +0 -0
  133. /data/app/components/coco/{base → shared}/placeholder/placeholder.css +0 -0
  134. /data/app/components/coco/{base → shared}/placeholder/placeholder.html.erb +0 -0
  135. /data/app/components/coco/{base → shared}/placeholder/placeholder.rb +0 -0
  136. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.css +0 -0
  137. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.html.erb +0 -0
  138. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.rb +0 -0
  139. /data/app/components/coco/{base → shared}/svg/svg.html.erb +0 -0
  140. /data/app/components/coco/{base → shared}/svg/svg.rb +0 -0
@@ -1,42 +0,0 @@
1
- module Coco
2
- module App
3
- module Elements
4
- class ButtonGroup < Coco::Component
5
- include Concerns::ActsAsButtonGroup
6
- include Concerns::AcceptsOptions
7
-
8
- accepts_option :size, default: :default, private: true
9
- accepts_option :theme, default: :primary, private: true
10
- accepts_option :segmented, from: [true, false], default: false
11
- accepts_option :floating, from: [true, false], default: false
12
- accepts_option :collapsible, from: [true, false, nil]
13
-
14
- before_initialize do |kwargs|
15
- if kwargs[:floating] == true
16
- kwargs[:segmented] = true
17
- kwargs[:theme] = :toolbar_floating
18
- end
19
- kwargs
20
- end
21
-
22
- def button_kwargs(kwargs, type = nil)
23
- args = {
24
- theme: get_option_value(:theme),
25
- size: get_option_value(:size),
26
- **kwargs
27
- }
28
-
29
- if component_args.key?(:resize)
30
- args[:resize] = component_args[:resize]
31
- end
32
-
33
- if get_option_value(:collapsible) == false
34
- args[:collapsible] = false
35
- end
36
-
37
- args
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,54 +0,0 @@
1
- module Coco
2
- module App
3
- module Elements
4
- class ButtonTo < Coco::Component
5
- include Concerns::WrapsComponent
6
- include Concerns::AcceptsOptions
7
-
8
- accepts_option :fit, from: [:auto, :full]
9
-
10
- wraps_component :button do |args|
11
- Coco::App::Elements::Button.new(
12
- type: :submit,
13
- fit: get_option_value(:fit) || :auto,
14
- **args
15
- )
16
- end
17
-
18
- %i[confirmation].each do |slot_name|
19
- renders_one slot_name, ->(**kwargs, &block) do
20
- button.send("with_#{slot_name}".to_sym, **kwargs, &block)
21
- end
22
- end
23
-
24
- attr_reader :method, :turbo
25
-
26
- def initialize(form: nil, params: nil, method: :post, action: nil, href: nil, turbo: false, **kwargs)
27
- @form_args = form.to_h
28
- @action = action || href
29
- @method = method
30
- @params = params.to_h
31
- @turbo = turbo
32
- end
33
-
34
- def params
35
- to_form_params(@params)
36
- end
37
-
38
- def form_args
39
- {
40
- url: action,
41
- method: method,
42
- data: {
43
- turbo: ("false" if !turbo)
44
- }
45
- }.deep_merge(@form_args)
46
- end
47
-
48
- def action
49
- @action.is_a?(String) ? @action : helpers.url_for(@action)
50
- end
51
- end
52
- end
53
- end
54
- end
@@ -1,75 +0,0 @@
1
- @layer components {
2
- .coco-button-wrapper {
3
- @apply !contents;
4
- }
5
-
6
- [data-coco].coco-button {
7
- @apply flex transition-colors w-auto bg-transparent text-current border border-transparent select-none flex-none no-underline outline-none focus-visible:outline-0;
8
- width: min-content;
9
-
10
- .button-inner {
11
- @apply inline-flex items-center text-center mx-auto gap-2;
12
- width: fit-content;
13
- }
14
-
15
- .button-content {
16
- @apply whitespace-nowrap relative leading-none inline-flex items-center order-2;
17
- }
18
-
19
- .button-state-content {
20
- @apply contents;
21
- }
22
-
23
- .button-icon {
24
- @apply inline-flex items-center order-1;
25
- }
26
-
27
- .button-dropdown {
28
- @apply contents rounded-md;
29
- }
30
-
31
- .button-toggle {
32
- @apply order-3;
33
- }
34
-
35
- /* disabled */
36
-
37
- &[data-disabled="true"] {
38
- @apply cursor-not-allowed pointer-events-none;
39
- }
40
-
41
- /* loading */
42
-
43
- &[data-state="loading"] .button-icon {
44
- @apply animate-spin;
45
- }
46
-
47
- /* Fit */
48
-
49
- &[data-fit="full"] {
50
- @apply w-full;
51
- }
52
-
53
- /* Icons */
54
-
55
- &[data-icon-position="end"] {
56
- .button-content {
57
- @apply order-1;
58
- }
59
-
60
- .button-icon {
61
- @apply order-2;
62
- }
63
-
64
- .button-toggle {
65
- @apply order-3;
66
- }
67
- }
68
-
69
- &.with-icon[data-collapsed="true"] {
70
- .button-content {
71
- display: none;
72
- }
73
- }
74
- }
75
- }
@@ -1,71 +0,0 @@
1
- <%= coco_tag(:div, class: "coco-button-wrapper", x: alpine_wrapper_attrs || {}) do %>
2
- <%= render component_tag(button_tag,
3
- class: {
4
- "coco-button": true,
5
- "icon-only": icon_only?,
6
- "with-icon": (icon? && !icon_only?)
7
- },
8
- x: {
9
- data: x_data("button", alpine_data),
10
- bind: "root",
11
- ":disabled": "disabled",
12
- "dropdown:trigger": (true if dropdown?),
13
- "dropdown:anchor": (true if dropdown?),
14
- "@click": ("#{"checkConfirmation($event);" if confirm?} #{on_click}" if confirm? || on_click.present?)
15
- }
16
- ) do %>
17
- <span class="button-inner">
18
- <% states.each do |name, props| %>
19
- <% if props[:icon].present? %>
20
- <% if states.many? %>
21
- <span
22
- class="button-icon"
23
- x-ref="<%= name %>Icon"
24
- x-show="showIcon('<%= name %>')"
25
- <%= "x-cloak" unless name.to_sym == :default %>>
26
- <%= props[:icon] %>
27
- </span>
28
- <% else %>
29
- <span class="button-icon" x-ref="defaultIcon">
30
- <%= props[:icon] %>
31
- </span>
32
- <% end %>
33
- <% end %>
34
- <% end %>
35
-
36
- <% unless icon_only? %>
37
- <% states.each do |name, props| %>
38
- <% if states.many? %>
39
- <span
40
- class="button-content"
41
- x-ref="<%= name %>Content"
42
- x-show="showContent('<%= name %>')"
43
- <%= "x-cloak" unless name.to_sym == :default %>>
44
- <%= props[:text] %>
45
- </span>
46
- <% else %>
47
- <span class="button-content" x-ref="defaultContent">
48
- <%= props[:text] %>
49
- </span>
50
- <% end %>
51
- <% end %>
52
- <% end %>
53
-
54
- <% if toggle? %>
55
- <% if toggle_direction == :horizontal %>
56
- <%= coco_icon(:chevron_right, class: "button-toggle") %>
57
- <% else %>
58
- <%= coco_icon(:chevron_down, class: "button-toggle") %>
59
- <% end %>
60
- <% end %>
61
- </span>
62
- <% end %>
63
-
64
- <% if dropdown? %>
65
- <div x-dropdown:content>
66
- <div class="button-dropdown">
67
- <%= dropdown %>
68
- </div>
69
- </div>
70
- <% end %>
71
- <% end %>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes