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
@@ -0,0 +1,50 @@
1
+ module Coco
2
+ class ButtonTo < Coco::Component
3
+ include Concerns::WrapsComponent
4
+ include Concerns::AcceptsOptions
5
+
6
+ accepts_option :fit, from: [:auto, :full]
7
+
8
+ wraps_component :button do |args|
9
+ Coco::Button.new(
10
+ type: :submit,
11
+ fit: get_option_value(:fit) || :auto,
12
+ **args
13
+ )
14
+ end
15
+
16
+ %i[confirmation].each do |slot_name|
17
+ renders_one slot_name, ->(**kwargs, &block) do
18
+ button.send("with_#{slot_name}".to_sym, **kwargs, &block)
19
+ end
20
+ end
21
+
22
+ attr_reader :method, :turbo
23
+
24
+ def initialize(form: nil, params: nil, method: :post, action: nil, href: nil, turbo: false, **kwargs)
25
+ @form_args = form.to_h
26
+ @action = action || href
27
+ @method = method
28
+ @params = params.to_h
29
+ @turbo = turbo
30
+ end
31
+
32
+ def params
33
+ to_form_params(@params)
34
+ end
35
+
36
+ def form_args
37
+ {
38
+ url: action,
39
+ method: method,
40
+ data: {
41
+ turbo: ("false" if !turbo)
42
+ }
43
+ }.deep_merge(@form_args)
44
+ end
45
+
46
+ def action
47
+ @action.is_a?(String) ? @action : helpers.url_for(@action)
48
+ end
49
+ end
50
+ end
@@ -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("dropdown", () => {
4
4
  return {};
@@ -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("icon", () => {
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("imageUploader", ({ click, drop }) => {
4
4
  return {
@@ -1,5 +1,5 @@
1
- import { CocoComponent } from "@js/coco";
2
- import { hideAll } from "@libs/tippy";
1
+ import { CocoComponent } from "@assets/js/shared/coco";
2
+ import { hideAll } from "@assets/js/libs/tippy";
3
3
  import { navigateTo } from "@helpers/location";
4
4
 
5
5
  export default CocoComponent("modal", () => {
@@ -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("modalDialog", () => {
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("modalLightbox", () => {
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("pollController", () => {
4
4
  return {
@@ -13,25 +13,6 @@ module Coco
13
13
  render(link, &block)
14
14
  end
15
15
 
16
- def coco_button(*args, **kwargs, &block)
17
- href, content = if block
18
- [args.first, nil]
19
- else
20
- (args.size == 1) ? [nil, args.first] : args[0..2].reverse!
21
- end
22
-
23
- button = if kwargs.key?(:action) || kwargs.key?(:method) || kwargs.key?(:params)
24
- "ButtonTo"
25
- else
26
- "Button"
27
- end
28
-
29
- component = "Coco::App::Elements::#{button}".constantize.new(href: href, **kwargs)
30
- component = component.with_content(content) if !block && content.present?
31
-
32
- render(component, &block)
33
- end
34
-
35
16
  def coco_menu_button(**, &block)
36
17
  render Coco::App::Elements::MenuButton.new(**), &block
37
18
  end
@@ -56,10 +37,6 @@ module Coco
56
37
  render Coco::App::Elements::DropdownButton.new(**), &block
57
38
  end
58
39
 
59
- def coco_button_group(**, &block)
60
- render Coco::App::Elements::ButtonGroup.new(**), &block
61
- end
62
-
63
40
  def coco_toolbar(**, &block)
64
41
  render Coco::App::Elements::Toolbar.new(**), &block
65
42
  end
@@ -1,6 +1,6 @@
1
1
  module Coco
2
2
  module ComponentHelper
3
- include Coco::BaseHelper
3
+ include Coco::SharedHelper
4
4
  include Coco::BookHelper
5
5
  include Coco::AppHelper
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Coco
2
- module BaseHelper
2
+ module SharedHelper
3
3
  def coco_tag(*, **, &block)
4
4
  render Coco::Tag.new(*, **), &block
5
5
  end
@@ -33,6 +33,29 @@ module Coco
33
33
  render Coco::Placeholder.new(text_content:, **), &block
34
34
  end
35
35
 
36
+ def coco_button(*args, **kwargs, &block)
37
+ href, content = if block
38
+ [args.first, nil]
39
+ else
40
+ (args.size == 1) ? [nil, args.first] : args[0..2].reverse!
41
+ end
42
+
43
+ button = if kwargs.key?(:action) || kwargs.key?(:method) || kwargs.key?(:params)
44
+ "Coco::ButtonTo"
45
+ else
46
+ "Coco::Button"
47
+ end
48
+
49
+ component = button.constantize.new(href: href, **kwargs)
50
+ component = component.with_content(content) if !block && content.present?
51
+
52
+ render(component, &block)
53
+ end
54
+
55
+ def coco_button_group(**, &block)
56
+ render Coco::ButtonGroup.new(**), &block
57
+ end
58
+
36
59
  def coco_modal(name = "default", **, &block)
37
60
  render(Coco::Modal.new(name: name, **), &block)
38
61
  end
@@ -22,7 +22,7 @@ module Coco
22
22
  html_options ||= {}
23
23
  html_options.symbolize_keys!
24
24
 
25
- button = Coco::App::Elements::ButtonTo.new(action: options, type: :submit, **html_options)
25
+ button = Coco::ButtonTo.new(action: options, type: :submit, **html_options)
26
26
  button = button.with_content(name) unless block
27
27
  render(button, &block)
28
28
  end
data/lib/coco/engine.rb CHANGED
@@ -6,7 +6,7 @@ module Coco
6
6
  class Engine < ::Rails::Engine
7
7
  isolate_namespace Coco
8
8
 
9
- COLLAPSE_DIRS = %w[base]
9
+ COLLAPSE_DIRS = %w[shared]
10
10
 
11
11
  config.autoload_paths += %W[
12
12
  #{root}/app/components
@@ -21,7 +21,7 @@ module Coco
21
21
  autoloader.collapse("#{coco_dir}/#{path}")
22
22
  end
23
23
 
24
- Dir.glob("#{coco_dir}/base/**/*.rb").each do |path|
24
+ Dir.glob("#{coco_dir}/shared/**/*.rb").each do |path|
25
25
  autoloader.collapse(File.dirname(path))
26
26
  end
27
27
 
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1.beta.0"
3
3
  end
@@ -83,7 +83,7 @@ class CocoGenerator < Rails::Generators::NamedBase
83
83
  end
84
84
 
85
85
  def component_ref
86
- parts = class_name.delete_prefix("Base::").underscore.dasherize.downcase.split("/")
86
+ parts = class_name.delete_prefix("Shared::").underscore.dasherize.downcase.split("/")
87
87
  parts.many? ? [parts.first, parts.last].join("-") : parts.first
88
88
  end
89
89
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveragebook_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-24 00:00:00.000000000 Z
11
+ date: 2023-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1416,17 +1416,14 @@ files:
1416
1416
  - app/assets/css/app.css
1417
1417
  - app/assets/css/app/config.css
1418
1418
  - app/assets/css/app/tippy.css
1419
- - app/assets/css/app/utilities.css
1420
- - app/assets/css/base/base.css
1421
- - app/assets/css/base/components/coco.css
1422
- - app/assets/css/base/components/dropdown.css
1423
- - app/assets/css/base/components/tooltip.css
1424
- - app/assets/css/base/utils/colors.css
1425
- - app/assets/css/base/utils/icons.css
1426
- - app/assets/css/base/utils/text.css
1419
+ - app/assets/css/app/utils.css
1420
+ - app/assets/css/base.css
1427
1421
  - app/assets/css/book.css
1428
1422
  - app/assets/css/book/config.css
1429
- - app/assets/css/libs/tippy.css
1423
+ - app/assets/css/shared/tippy.css
1424
+ - app/assets/css/shared/utils/colors.css
1425
+ - app/assets/css/shared/utils/icons.css
1426
+ - app/assets/css/shared/utils/text.css
1430
1427
  - app/assets/custom_icons/other/eye-off-red.svg
1431
1428
  - app/assets/custom_icons/other/google-sso.svg
1432
1429
  - app/assets/custom_icons/other/layout-overlay.svg
@@ -1449,10 +1446,8 @@ files:
1449
1446
  - app/assets/js/app.js
1450
1447
  - app/assets/js/app/components.js
1451
1448
  - app/assets/js/app/setup.js
1452
- - app/assets/js/base/components.js
1453
1449
  - app/assets/js/book.js
1454
1450
  - app/assets/js/book/components.js
1455
- - app/assets/js/coco.js
1456
1451
  - app/assets/js/helpers/alpine.js
1457
1452
  - app/assets/js/helpers/color.js
1458
1453
  - app/assets/js/helpers/dom.js
@@ -1473,6 +1468,8 @@ files:
1473
1468
  - app/assets/js/libs/alpine/utils/tippy_modifiers.js
1474
1469
  - app/assets/js/libs/tippy/index.js
1475
1470
  - app/assets/js/libs/tippy/plugins/hide_on_esc.js
1471
+ - app/assets/js/shared/coco.js
1472
+ - app/assets/js/shared/components.js
1476
1473
  - app/components/coco/app/blocks/header/header.css
1477
1474
  - app/components/coco/app/blocks/header/header.html.erb
1478
1475
  - app/components/coco/app/blocks/header/header.js
@@ -1501,15 +1498,6 @@ files:
1501
1498
  - app/components/coco/app/elements/alert/alert.html.erb
1502
1499
  - app/components/coco/app/elements/alert/alert.js
1503
1500
  - app/components/coco/app/elements/alert/alert.rb
1504
- - app/components/coco/app/elements/button/button.css
1505
- - app/components/coco/app/elements/button/button.rb
1506
- - app/components/coco/app/elements/button_group/button_group.css
1507
- - app/components/coco/app/elements/button_group/button_group.html.erb
1508
- - app/components/coco/app/elements/button_group/button_group.js
1509
- - app/components/coco/app/elements/button_group/button_group.rb
1510
- - app/components/coco/app/elements/button_to/button_to.css
1511
- - app/components/coco/app/elements/button_to/button_to.html.erb
1512
- - app/components/coco/app/elements/button_to/button_to.rb
1513
1501
  - app/components/coco/app/elements/color_picker/color_picker.css
1514
1502
  - app/components/coco/app/elements/color_picker/color_picker.html.erb
1515
1503
  - app/components/coco/app/elements/color_picker/color_picker.js
@@ -1614,60 +1602,6 @@ files:
1614
1602
  - app/components/coco/app/layouts/page/page.html.erb
1615
1603
  - app/components/coco/app/layouts/page/page.js
1616
1604
  - app/components/coco/app/layouts/page/page.rb
1617
- - app/components/coco/base/avatar/avatar.css
1618
- - app/components/coco/base/avatar/avatar.rb
1619
- - app/components/coco/base/button/button.css
1620
- - app/components/coco/base/button/button.html.erb
1621
- - app/components/coco/base/button/button.js
1622
- - app/components/coco/base/button/button.rb
1623
- - app/components/coco/base/button/button_dropdown.js
1624
- - app/components/coco/base/content/content.rb
1625
- - app/components/coco/base/dropdown/dropdown.css
1626
- - app/components/coco/base/dropdown/dropdown.html.erb
1627
- - app/components/coco/base/dropdown/dropdown.js
1628
- - app/components/coco/base/dropdown/dropdown.rb
1629
- - app/components/coco/base/embeds/youtube/youtube.css
1630
- - app/components/coco/base/embeds/youtube/youtube.html.erb
1631
- - app/components/coco/base/embeds/youtube/youtube.rb
1632
- - app/components/coco/base/icon/icon.css
1633
- - app/components/coco/base/icon/icon.html.erb
1634
- - app/components/coco/base/icon/icon.js
1635
- - app/components/coco/base/icon/icon.rb
1636
- - app/components/coco/base/image/image.css
1637
- - app/components/coco/base/image/image.rb
1638
- - app/components/coco/base/image_uploader/image_uploader.css
1639
- - app/components/coco/base/image_uploader/image_uploader.html.erb
1640
- - app/components/coco/base/image_uploader/image_uploader.js
1641
- - app/components/coco/base/image_uploader/image_uploader.rb
1642
- - app/components/coco/base/link/link.css
1643
- - app/components/coco/base/link/link.rb
1644
- - app/components/coco/base/modal/modal.css
1645
- - app/components/coco/base/modal/modal.html.erb
1646
- - app/components/coco/base/modal/modal.js
1647
- - app/components/coco/base/modal/modal.rb
1648
- - app/components/coco/base/modal_dialog/modal_dialog.css
1649
- - app/components/coco/base/modal_dialog/modal_dialog.html.erb
1650
- - app/components/coco/base/modal_dialog/modal_dialog.js
1651
- - app/components/coco/base/modal_dialog/modal_dialog.rb
1652
- - app/components/coco/base/modal_lightbox/modal_lightbox.css
1653
- - app/components/coco/base/modal_lightbox/modal_lightbox.html.erb
1654
- - app/components/coco/base/modal_lightbox/modal_lightbox.js
1655
- - app/components/coco/base/modal_lightbox/modal_lightbox.rb
1656
- - app/components/coco/base/pager_link/pager_link.css
1657
- - app/components/coco/base/pager_link/pager_link.html.erb
1658
- - app/components/coco/base/pager_link/pager_link.rb
1659
- - app/components/coco/base/panel/panel.css
1660
- - app/components/coco/base/panel/panel.html.erb
1661
- - app/components/coco/base/panel/panel.rb
1662
- - app/components/coco/base/placeholder/placeholder.css
1663
- - app/components/coco/base/placeholder/placeholder.html.erb
1664
- - app/components/coco/base/placeholder/placeholder.rb
1665
- - app/components/coco/base/poll_controller/poll_controller.css
1666
- - app/components/coco/base/poll_controller/poll_controller.html.erb
1667
- - app/components/coco/base/poll_controller/poll_controller.js
1668
- - app/components/coco/base/poll_controller/poll_controller.rb
1669
- - app/components/coco/base/svg/svg.html.erb
1670
- - app/components/coco/base/svg/svg.rb
1671
1605
  - app/components/coco/book/blocks/slides/editable_slide/editable_slide.css
1672
1606
  - app/components/coco/book/blocks/slides/editable_slide/editable_slide.html.erb
1673
1607
  - app/components/coco/book/blocks/slides/editable_slide/editable_slide.rb
@@ -1692,15 +1626,76 @@ files:
1692
1626
  - app/components/coco/concerns/with_tooltip.rb
1693
1627
  - app/components/coco/concerns/wraps_component.rb
1694
1628
  - app/components/coco/presented_component.rb
1629
+ - app/components/coco/shared/avatar/avatar.css
1630
+ - app/components/coco/shared/avatar/avatar.rb
1631
+ - app/components/coco/shared/button/button.css
1632
+ - app/components/coco/shared/button/button.html.erb
1633
+ - app/components/coco/shared/button/button.js
1634
+ - app/components/coco/shared/button/button.rb
1635
+ - app/components/coco/shared/button/button_dropdown.js
1636
+ - app/components/coco/shared/button_group/button_group.css
1637
+ - app/components/coco/shared/button_group/button_group.html.erb
1638
+ - app/components/coco/shared/button_group/button_group.js
1639
+ - app/components/coco/shared/button_group/button_group.rb
1640
+ - app/components/coco/shared/button_to/button_to.css
1641
+ - app/components/coco/shared/button_to/button_to.html.erb
1642
+ - app/components/coco/shared/button_to/button_to.rb
1643
+ - app/components/coco/shared/content/content.rb
1644
+ - app/components/coco/shared/dropdown/dropdown.css
1645
+ - app/components/coco/shared/dropdown/dropdown.html.erb
1646
+ - app/components/coco/shared/dropdown/dropdown.js
1647
+ - app/components/coco/shared/dropdown/dropdown.rb
1648
+ - app/components/coco/shared/embeds/youtube/youtube.css
1649
+ - app/components/coco/shared/embeds/youtube/youtube.html.erb
1650
+ - app/components/coco/shared/embeds/youtube/youtube.rb
1651
+ - app/components/coco/shared/icon/icon.css
1652
+ - app/components/coco/shared/icon/icon.html.erb
1653
+ - app/components/coco/shared/icon/icon.js
1654
+ - app/components/coco/shared/icon/icon.rb
1655
+ - app/components/coco/shared/image/image.css
1656
+ - app/components/coco/shared/image/image.rb
1657
+ - app/components/coco/shared/image_uploader/image_uploader.css
1658
+ - app/components/coco/shared/image_uploader/image_uploader.html.erb
1659
+ - app/components/coco/shared/image_uploader/image_uploader.js
1660
+ - app/components/coco/shared/image_uploader/image_uploader.rb
1661
+ - app/components/coco/shared/link/link.css
1662
+ - app/components/coco/shared/link/link.rb
1663
+ - app/components/coco/shared/modal/modal.css
1664
+ - app/components/coco/shared/modal/modal.html.erb
1665
+ - app/components/coco/shared/modal/modal.js
1666
+ - app/components/coco/shared/modal/modal.rb
1667
+ - app/components/coco/shared/modal_dialog/modal_dialog.css
1668
+ - app/components/coco/shared/modal_dialog/modal_dialog.html.erb
1669
+ - app/components/coco/shared/modal_dialog/modal_dialog.js
1670
+ - app/components/coco/shared/modal_dialog/modal_dialog.rb
1671
+ - app/components/coco/shared/modal_lightbox/modal_lightbox.css
1672
+ - app/components/coco/shared/modal_lightbox/modal_lightbox.html.erb
1673
+ - app/components/coco/shared/modal_lightbox/modal_lightbox.js
1674
+ - app/components/coco/shared/modal_lightbox/modal_lightbox.rb
1675
+ - app/components/coco/shared/pager_link/pager_link.css
1676
+ - app/components/coco/shared/pager_link/pager_link.html.erb
1677
+ - app/components/coco/shared/pager_link/pager_link.rb
1678
+ - app/components/coco/shared/panel/panel.css
1679
+ - app/components/coco/shared/panel/panel.html.erb
1680
+ - app/components/coco/shared/panel/panel.rb
1681
+ - app/components/coco/shared/placeholder/placeholder.css
1682
+ - app/components/coco/shared/placeholder/placeholder.html.erb
1683
+ - app/components/coco/shared/placeholder/placeholder.rb
1684
+ - app/components/coco/shared/poll_controller/poll_controller.css
1685
+ - app/components/coco/shared/poll_controller/poll_controller.html.erb
1686
+ - app/components/coco/shared/poll_controller/poll_controller.js
1687
+ - app/components/coco/shared/poll_controller/poll_controller.rb
1688
+ - app/components/coco/shared/svg/svg.html.erb
1689
+ - app/components/coco/shared/svg/svg.rb
1695
1690
  - app/components/coco/tag.rb
1696
1691
  - app/helpers/coco/alpine_helper.rb
1697
1692
  - app/helpers/coco/app_helper.rb
1698
- - app/helpers/coco/base_helper.rb
1699
1693
  - app/helpers/coco/book_helper.rb
1700
1694
  - app/helpers/coco/component_helper.rb
1701
1695
  - app/helpers/coco/format_helper.rb
1702
1696
  - app/helpers/coco/helpers.rb
1703
1697
  - app/helpers/coco/integration_helper.rb
1698
+ - app/helpers/coco/shared_helper.rb
1704
1699
  - app/helpers/coco/tag_helper.rb
1705
1700
  - app/helpers/coco/url_helper.rb
1706
1701
  - config/icons.json
@@ -1750,9 +1745,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1750
1745
  version: 3.2.0
1751
1746
  required_rubygems_version: !ruby/object:Gem::Requirement
1752
1747
  requirements:
1753
- - - ">="
1748
+ - - ">"
1754
1749
  - !ruby/object:Gem::Version
1755
- version: '0'
1750
+ version: 1.3.1
1756
1751
  requirements: []
1757
1752
  rubygems_version: 3.4.19
1758
1753
  signing_key:
@@ -1,5 +0,0 @@
1
- @layer components {
2
- [data-coco] {
3
- @apply text-content-dark-1 font-body;
4
- }
5
- }
@@ -1,7 +0,0 @@
1
- @layer components {
2
- [x-dropdown] {
3
- [x-dropdown\:content] {
4
- @apply hidden;
5
- }
6
- }
7
- }
@@ -1,19 +0,0 @@
1
- @layer components {
2
- /* Tooltip theme */
3
- .tippy-box[data-theme~="coco-tooltip"] {
4
- @apply bg-background-dark-2 text-white text-label-sm rounded-lg shadow-xl;
5
-
6
- .tippy-content {
7
- @apply px-3 py-2 truncate max-w-[240px];
8
- }
9
-
10
- /* arrow background */
11
- .tippy-svg-arrow > svg:first-child {
12
- @apply hidden;
13
- }
14
-
15
- .tippy-svg-arrow > svg:last-child {
16
- @apply fill-gray-900;
17
- }
18
- }
19
- }
@@ -1,79 +0,0 @@
1
- @layer utilities {
2
- .coco-heading-1 {
3
- @apply font-body text-heading-1;
4
- }
5
-
6
- .coco-heading-2 {
7
- @apply font-body text-heading-2;
8
- }
9
-
10
- .coco-heading-3 {
11
- @apply font-body text-heading-3;
12
- }
13
-
14
- .coco-heading-4 {
15
- @apply font-body text-heading-4;
16
- }
17
-
18
- .coco-heading-5 {
19
- @apply font-body text-heading-5;
20
- }
21
-
22
- .coco-heading-6 {
23
- @apply font-body text-heading-6;
24
- }
25
-
26
- .coco-display-1 {
27
- @apply font-display text-display-1;
28
- }
29
-
30
- .coco-display-2 {
31
- @apply font-display text-display-2;
32
- }
33
-
34
- .coco-display-3 {
35
- @apply font-display text-display-3;
36
- }
37
-
38
- .coco-display-4 {
39
- @apply font-display text-display-4;
40
- }
41
-
42
- /* branded */
43
-
44
- .coco-branded-heading-1 {
45
- @apply font-branded text-heading-1;
46
- }
47
-
48
- .coco-branded-heading-2 {
49
- @apply font-branded text-heading-2;
50
- }
51
-
52
- .coco-branded-heading-3 {
53
- @apply font-branded text-heading-3;
54
- }
55
-
56
- .coco-branded-heading-4 {
57
- @apply font-branded text-heading-4;
58
- }
59
-
60
- .coco-branded-heading-5 {
61
- @apply font-branded text-heading-5;
62
- }
63
-
64
- .coco-branded-display-1 {
65
- @apply font-branded text-relaxed-display-1;
66
- }
67
-
68
- .coco-branded-display-2 {
69
- @apply font-branded text-relaxed-display-2;
70
- }
71
-
72
- .coco-branded-display-3 {
73
- @apply font-branded text-relaxed-display-3;
74
- }
75
-
76
- .coco-branded-display-4 {
77
- @apply font-branded text-relaxed-display-4;
78
- }
79
- }
@@ -1,4 +0,0 @@
1
- import { registerComponents } from "@helpers/alpine";
2
- import baseComponents from "@baseComponents/**/*.js";
3
-
4
- export default registerComponents(baseComponents);
@@ -1,87 +0,0 @@
1
- module Coco
2
- module App
3
- module Elements
4
- class Button < Coco::Button
5
- SIZES = [:xs, :sm, :md, :lg, nil]
6
-
7
- SIZE_ALIASES = {
8
- default: [:sm, {xl: :md}]
9
- }
10
-
11
- THEMES = [
12
- "primary",
13
- "text-primary",
14
- "secondary",
15
- "text-secondary",
16
- "positive",
17
- "text-positive",
18
- "negative",
19
- "text-negative",
20
- "warning",
21
- "text-warning",
22
- "info",
23
- "text-info",
24
- "toolbar",
25
- "toolbar-floating",
26
- "text-toolbar",
27
- "neutral-dark",
28
- "neutral-light",
29
- "text-neutral-light",
30
- "text-neutral-dark",
31
- "blank",
32
- nil
33
- ]
34
-
35
- DEFAULT_THEME = "primary"
36
-
37
- accepts_option :size, from: SIZES, default: :md
38
- accepts_option :theme, from: THEMES, default: DEFAULT_THEME
39
- accepts_option :variant
40
-
41
- renders_one :dropdown, types: {
42
- content: ->(&block) { block.call },
43
-
44
- confirmation: ->(**kwargs) do
45
- set_option_value(:confirm, true)
46
- Coco::App::Elements::ConfirmPanel.new(**kwargs)
47
- end
48
- }
49
-
50
- before_initialize do |kwargs|
51
- if kwargs.key?(:modal)
52
- modal_name = (kwargs[:modal] == true) ? "default" : kwargs[:modal]
53
- kwargs[:data] = kwargs.fetch(:data, {}).merge(coco_modal_data_attributes(modal_name))
54
- kwargs.delete(:modal)
55
- end
56
- if kwargs.key?(:frame)
57
- turbo_data = {turbo: true, turbo_frame: kwargs[:frame]}
58
- kwargs[:data] = kwargs.fetch(:data, {}).merge(turbo_data)
59
- kwargs.delete(:frame)
60
- end
61
- kwargs
62
- end
63
-
64
- before_render do
65
- if confirm? && !dropdown?
66
- with_confirmation do |confirm|
67
- confirm.with_text { "Are you sure?" }
68
- confirm.with_button { "Yes, continue" }
69
- end
70
- end
71
- end
72
-
73
- def with_dropdown(...)
74
- with_dropdown_content(...)
75
- end
76
-
77
- def with_confirmation(...)
78
- with_dropdown_confirmation(...)
79
- end
80
-
81
- class << self
82
- include Coco::BaseHelper
83
- end
84
- end
85
- end
86
- end
87
- end