coveragebook_components 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +38 -3
- data/app/assets/build/coco/app.dev.css +5535 -0
- data/app/assets/build/coco/app.dev.js +27473 -0
- data/app/assets/build/coco/app.js +1 -1
- data/app/assets/build/coco/book.css +44 -2
- data/app/assets/build/coco/book.dev.css +2009 -0
- data/app/assets/build/coco/book.dev.js +15801 -0
- data/app/components/coco/base/modal/modal.css +12 -0
- data/app/components/coco/base/modal/modal.html.erb +11 -1
- data/app/components/coco/base/modal/modal.rb +4 -1
- data/app/components/coco/base/modal_dialog/modal_dialog.css +6 -2
- data/app/components/coco/base/panel/panel.css +19 -0
- data/app/components/coco/base/panel/panel.html.erb +5 -0
- data/app/components/coco/base/panel/panel.rb +4 -0
- data/app/helpers/coco/app_helper.rb +4 -0
- data/lib/coco.rb +1 -1
- metadata +9 -2
@@ -73,4 +73,16 @@
|
|
73
73
|
.modal-frame {
|
74
74
|
@apply contents;
|
75
75
|
}
|
76
|
+
|
77
|
+
/*
|
78
|
+
Limit the size of modal content when rendered in the
|
79
|
+
host page rather than displayed as a modal.
|
80
|
+
*/
|
81
|
+
[data-role="inline-modal-content"] {
|
82
|
+
@apply max-w-2xl mx-auto;
|
83
|
+
|
84
|
+
[data-component="modal-dialog"] {
|
85
|
+
@apply border border-gray-300 shadow-md rounded-xl;
|
86
|
+
}
|
87
|
+
}
|
76
88
|
}
|
@@ -22,5 +22,15 @@
|
|
22
22
|
<%= render_flash_messages %>
|
23
23
|
<% end %>
|
24
24
|
<% else %>
|
25
|
-
|
25
|
+
<div data-role="inline-modal-content">
|
26
|
+
<% if container_type == :dialog %>
|
27
|
+
<%= render Coco::ModalDialog.new(title: title.to_s, dismissable: false) do %>
|
28
|
+
<%= content %>
|
29
|
+
<% end %>
|
30
|
+
<% else %>
|
31
|
+
<%= coco_panel do %>
|
32
|
+
<%= content %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
</div>
|
26
36
|
<% end %>
|
@@ -11,10 +11,12 @@ module Coco
|
|
11
11
|
renders_one :container, types: {
|
12
12
|
dialog: ->(**kwargs, &block) do
|
13
13
|
@container_content = block
|
14
|
+
@container_type = :dialog
|
14
15
|
Coco::ModalDialog.new(dismissable: get_option_value(:dismissable), **kwargs)
|
15
16
|
end,
|
16
17
|
|
17
18
|
lightbox: ->(**kwargs, &block) do
|
19
|
+
@container_type = :lightbox
|
18
20
|
Coco::ModalLightbox.new(dismissable: get_option_value(:dismissable), **kwargs)
|
19
21
|
end
|
20
22
|
}
|
@@ -25,11 +27,12 @@ module Coco
|
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
28
|
-
attr_reader :name, :show
|
30
|
+
attr_reader :name, :show, :container_type
|
29
31
|
|
30
32
|
def initialize(name:, show: false, **kwargs)
|
31
33
|
@name = name
|
32
34
|
@show = show
|
35
|
+
@container_type = nil
|
33
36
|
title { kwargs[:title] } if kwargs[:title]
|
34
37
|
end
|
35
38
|
|
@@ -1,7 +1,11 @@
|
|
1
1
|
@layer components {
|
2
2
|
[data-coco][data-component="modal-dialog"] {
|
3
|
-
@apply
|
4
|
-
|
3
|
+
@apply rounded-xl w-full;
|
4
|
+
|
5
|
+
.modal-frame & {
|
6
|
+
@apply shadow-2xl;
|
7
|
+
@apply max-w-2xl; /* temp until sizes added */
|
8
|
+
}
|
5
9
|
|
6
10
|
.modal-dialog-header {
|
7
11
|
@apply relative flex items-center;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
@layer components {
|
2
|
+
[data-coco][data-component="panel"] {
|
3
|
+
@apply contents;
|
4
|
+
|
5
|
+
.panel-content {
|
6
|
+
@apply contents;
|
7
|
+
}
|
8
|
+
|
9
|
+
/* Only style Coco panels that are not rendered inside legacy panel components */
|
10
|
+
&:not([data-component="panel"] [data-component="panel"]) {
|
11
|
+
@apply block bg-content-light-1 border border-gray-300 shadow-md rounded-xl;
|
12
|
+
|
13
|
+
.panel-content {
|
14
|
+
@apply block;
|
15
|
+
padding: max(min(5%, 2rem), 1rem);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -84,6 +84,10 @@ module Coco
|
|
84
84
|
render Coco::App::Elements::SystemBanner.new(**), &block
|
85
85
|
end
|
86
86
|
|
87
|
+
def coco_panel(**, &block)
|
88
|
+
render Coco::Panel.new(**), &block
|
89
|
+
end
|
90
|
+
|
87
91
|
def coco_form_with(**, &block)
|
88
92
|
form_with(**, builder: Coco::AppFormBuilder, &block)
|
89
93
|
end
|
data/lib/coco.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.9
|
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-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -74,8 +74,12 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- app/assets/build/coco/app.css
|
77
|
+
- app/assets/build/coco/app.dev.css
|
78
|
+
- app/assets/build/coco/app.dev.js
|
77
79
|
- app/assets/build/coco/app.js
|
78
80
|
- app/assets/build/coco/book.css
|
81
|
+
- app/assets/build/coco/book.dev.css
|
82
|
+
- app/assets/build/coco/book.dev.js
|
79
83
|
- app/assets/build/coco/book.js
|
80
84
|
- app/assets/build/coco/icons/accessibility.svg
|
81
85
|
- app/assets/build/coco/icons/activity-square.svg
|
@@ -1653,6 +1657,9 @@ files:
|
|
1653
1657
|
- app/components/coco/base/pager_link/pager_link.css
|
1654
1658
|
- app/components/coco/base/pager_link/pager_link.html.erb
|
1655
1659
|
- app/components/coco/base/pager_link/pager_link.rb
|
1660
|
+
- app/components/coco/base/panel/panel.css
|
1661
|
+
- app/components/coco/base/panel/panel.html.erb
|
1662
|
+
- app/components/coco/base/panel/panel.rb
|
1656
1663
|
- app/components/coco/base/placeholder/placeholder.css
|
1657
1664
|
- app/components/coco/base/placeholder/placeholder.html.erb
|
1658
1665
|
- app/components/coco/base/placeholder/placeholder.rb
|