coveragebook_components 0.7.9 → 0.8.0.beta.1
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 +1134 -165
- data/app/assets/build/coco/app.js +307 -49
- data/app/assets/build/coco/book.css +55 -9
- data/app/assets/build/coco/book.js +24 -2
- data/app/assets/css/app/tippy.css +4 -0
- data/app/assets/css/base/base.css +12 -0
- data/app/assets/css/base/components/coco.css +0 -3
- data/app/assets/js/app/setup.js +22 -0
- data/app/assets/js/app.js +2 -0
- data/app/assets/js/helpers/location.js +9 -0
- data/app/assets/js/libs/tippy/index.js +7 -2
- data/app/components/coco/app/blocks/header/header.css +43 -0
- data/app/components/coco/app/blocks/header/header.html.erb +30 -0
- data/app/components/coco/app/blocks/header/header.js +11 -0
- data/app/components/coco/app/blocks/header/header.rb +35 -0
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.css +48 -3
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.html.erb +14 -6
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.js +18 -1
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.rb +26 -1
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.css +104 -0
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.html.erb +42 -0
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.js +28 -0
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.rb +28 -0
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.css +165 -0
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.html.erb +43 -0
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.js +41 -0
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.rb +98 -0
- data/app/components/coco/app/elements/alert/alert.css +65 -18
- data/app/components/coco/app/elements/alert/alert.html.erb +20 -5
- data/app/components/coco/app/elements/alert/alert.js +4 -3
- data/app/components/coco/app/elements/alert/alert.rb +16 -6
- data/app/components/coco/app/elements/button/button.css +87 -5
- data/app/components/coco/app/elements/button/button.rb +3 -1
- data/app/components/coco/app/elements/button_group/button_group.rb +4 -0
- data/app/components/coco/app/elements/button_to/button_to.css +5 -1
- data/app/components/coco/app/elements/button_to/button_to.rb +8 -1
- data/app/components/coco/app/elements/color_picker/color_picker.rb +1 -1
- data/app/components/coco/app/elements/menu/menu.css +5 -0
- data/app/components/coco/app/elements/menu/menu.html.erb +1 -1
- data/app/components/coco/app/elements/menu/menu.rb +2 -1
- data/app/components/coco/app/elements/menu_button/menu_button.html.erb +6 -0
- data/app/components/coco/app/elements/menu_button/menu_button.rb +8 -9
- data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +22 -0
- data/app/components/coco/app/elements/menu_items/user_profile/user_profile.html.erb +17 -0
- data/app/components/coco/app/elements/menu_items/user_profile/user_profile.rb +20 -0
- data/app/components/coco/app/elements/notice/notice.css +4 -0
- data/app/components/coco/app/elements/notice/notice.rb +2 -2
- data/app/components/coco/app/elements/snackbar/snackbar.css +8 -1
- data/app/components/coco/app/elements/snackbar/snackbar.rb +2 -2
- data/app/components/coco/app/elements/system_banner/system_banner.html.erb +2 -1
- data/app/components/coco/app/elements/system_banner/system_banner.js +35 -2
- data/app/components/coco/app/elements/system_banner/system_banner.rb +47 -3
- data/app/components/coco/app/layouts/application/application.css +104 -4
- data/app/components/coco/app/layouts/application/application.html.erb +28 -7
- data/app/components/coco/app/layouts/application/application.js +16 -0
- data/app/components/coco/app/layouts/application/application.rb +11 -3
- data/app/components/coco/base/avatar/avatar.css +25 -0
- data/app/components/coco/base/avatar/avatar.rb +20 -0
- data/app/components/coco/base/icon/icon.css +6 -2
- data/app/components/coco/base/icon/icon.rb +1 -1
- data/app/components/coco/base/modal/modal.css +2 -1
- data/app/components/coco/base/modal/modal.html.erb +1 -1
- data/app/components/coco/base/modal/modal.js +2 -0
- data/app/components/coco/base/modal_lightbox/modal_lightbox.js +2 -2
- data/app/components/coco/base/placeholder/placeholder.css +15 -1
- data/app/components/coco/base/placeholder/placeholder.rb +2 -0
- data/app/components/coco/concerns/accepts_tag_attributes.rb +6 -2
- data/app/components/coco/concerns/acts_as_button_group.rb +30 -12
- data/app/helpers/coco/app_helper.rb +26 -2
- data/app/helpers/coco/base_helper.rb +6 -0
- data/app/helpers/coco/url_helper.rb +5 -1
- data/config/tailwind.base.config.cjs +3 -0
- data/config/tokens.cjs +6 -0
- data/lib/coco.rb +1 -1
- metadata +24 -10
- data/app/components/coco/app/blocks/banner/banner.css +0 -5
- data/app/components/coco/app/blocks/banner/banner.rb +0 -8
- data/app/components/coco/app/blocks/nav_bar/nav_bar.css +0 -51
- data/app/components/coco/app/blocks/nav_bar/nav_bar.html.erb +0 -23
- data/app/components/coco/app/blocks/nav_bar/nav_bar.js +0 -31
- data/app/components/coco/app/blocks/nav_bar/nav_bar.rb +0 -19
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
<%= render component_tag
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<%= render component_tag(
|
|
2
|
+
x: {
|
|
3
|
+
data: x_data("appLayout", banner: banner? && banner_content?),
|
|
4
|
+
":class": "{'with-banner': banner}"
|
|
5
|
+
},
|
|
6
|
+
class: {
|
|
7
|
+
"with-sidebar-nav": sidebar_nav?,
|
|
8
|
+
"with-banner": banner? && banner_content?,
|
|
9
|
+
"with-header": header?
|
|
10
|
+
}) do %>
|
|
11
|
+
<% if banner? && banner_content? %>
|
|
12
|
+
<div class="layout-banner" data-role="app-banner" role="banner" @banner:dismiss="hideBanner">
|
|
13
|
+
<%= banner %>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% if header? %>
|
|
17
|
+
<div class="layout-header" data-role="app-header">
|
|
18
|
+
<%= header %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% if sidebar_nav? %>
|
|
22
|
+
<div class="layout-sidebar-nav" data-role="app-sidebar-nav">
|
|
23
|
+
<%= sidebar_nav %>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
<div class="layout-body" data-role="app-body">
|
|
7
27
|
<%= content %>
|
|
8
|
-
</
|
|
28
|
+
</div>
|
|
29
|
+
<%= flashes %>
|
|
9
30
|
<% end %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CocoComponent } from "@js/coco";
|
|
2
|
+
|
|
3
|
+
export default CocoComponent("appLayout", (opts) => {
|
|
4
|
+
return {
|
|
5
|
+
banner: false,
|
|
6
|
+
|
|
7
|
+
init() {
|
|
8
|
+
this.banner = opts.banner;
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
hideBanner() {
|
|
12
|
+
this.banner = false;
|
|
13
|
+
this.$el.remove();
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -2,10 +2,18 @@ module Coco
|
|
|
2
2
|
module App
|
|
3
3
|
module Layouts
|
|
4
4
|
class Application < Coco::Component
|
|
5
|
-
|
|
6
|
-
renders_one :navbar, Blocks::NavBar
|
|
5
|
+
include Concerns::AcceptsOptions
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
renders_one :flashes
|
|
8
|
+
renders_one :banner
|
|
9
|
+
renders_one :header
|
|
10
|
+
renders_one :sidebar_nav
|
|
11
|
+
|
|
12
|
+
component_name :application_layout
|
|
13
|
+
|
|
14
|
+
def banner_content?
|
|
15
|
+
banner.to_s.strip != ""
|
|
16
|
+
end
|
|
9
17
|
end
|
|
10
18
|
end
|
|
11
19
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
[data-coco][data-component="avatar"] {
|
|
3
|
+
@apply block rounded-full overflow-hidden flex-none;
|
|
4
|
+
|
|
5
|
+
img {
|
|
6
|
+
@apply w-full rounded-full;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&[data-size="sm"] {
|
|
10
|
+
@apply w-5 h-5;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&[data-size="md"] {
|
|
14
|
+
@apply w-6 h-6;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&[data-size="lg"] {
|
|
18
|
+
@apply w-7 h-7;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-size="xl"] {
|
|
22
|
+
@apply w-8 h-8;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Coco
|
|
2
|
+
class Avatar < Coco::Component
|
|
3
|
+
include Concerns::AcceptsOptions
|
|
4
|
+
|
|
5
|
+
accepts_option :size, from: %i[sm md lg xl], default: :md
|
|
6
|
+
|
|
7
|
+
attr_reader :src, :name
|
|
8
|
+
|
|
9
|
+
def initialize(src:, name: nil, **)
|
|
10
|
+
@src = src
|
|
11
|
+
@name = name
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def call
|
|
15
|
+
render component_tag do
|
|
16
|
+
tag.img src: src, alt: name
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -6,7 +6,7 @@ module Coco
|
|
|
6
6
|
|
|
7
7
|
InvalidIconError = Class.new(StandardError)
|
|
8
8
|
|
|
9
|
-
accepts_option :size, from: %i[xs sm md lg xl xxl]
|
|
9
|
+
accepts_option :size, from: %i[xs sm md lg xl xxl full]
|
|
10
10
|
accepts_option :spin, from: [true, false]
|
|
11
11
|
accepts_option :style, from: [:line, :fill, :custom]
|
|
12
12
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
) do %>
|
|
14
14
|
<div class="modal-overlay" x-bind="overlay"></div>
|
|
15
|
-
<div class="modal-container"
|
|
15
|
+
<div class="modal-container" x-bind="container" x-ref="container">
|
|
16
16
|
<div class="modal-content" x-trap.noscroll.inert.noreturn="open">
|
|
17
17
|
<%= modal_content %>
|
|
18
18
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CocoComponent } from "@js/coco";
|
|
2
|
+
import { hideAll } from "@libs/tippy";
|
|
2
3
|
|
|
3
4
|
export default CocoComponent("modal", () => {
|
|
4
5
|
return {
|
|
@@ -19,6 +20,7 @@ export default CocoComponent("modal", () => {
|
|
|
19
20
|
|
|
20
21
|
show() {
|
|
21
22
|
this.open = true;
|
|
23
|
+
hideAll();
|
|
22
24
|
setTimeout(() => {
|
|
23
25
|
this.$dispatch("modal:shown");
|
|
24
26
|
}, 400);
|
|
@@ -16,12 +16,12 @@ export default CocoComponent("modalLightbox", () => {
|
|
|
16
16
|
|
|
17
17
|
imageLoaded() {
|
|
18
18
|
this.loaded = true;
|
|
19
|
-
|
|
19
|
+
setTimeout(() => {
|
|
20
20
|
const scrollTop = parseInt(this.img.dataset.scrollTop, 10);
|
|
21
21
|
if (!isNaN(scrollTop) && scrollTop !== 0) {
|
|
22
22
|
this.modal.scrollTo(scrollTop);
|
|
23
23
|
}
|
|
24
|
-
});
|
|
24
|
+
}, 200);
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
get img() {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
[data-coco][data-component="placeholder"] {
|
|
3
|
-
@apply
|
|
3
|
+
@apply p-4;
|
|
4
|
+
|
|
5
|
+
&[data-boxed="true"] {
|
|
6
|
+
@apply border border-dashed border-gray-400 bg-gray-50;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&[data-prose="true"] {
|
|
10
|
+
.placeholder-content {
|
|
11
|
+
@apply space-y-3;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&[data-prose="false"] {
|
|
16
|
+
@apply text-center;
|
|
17
|
+
}
|
|
4
18
|
|
|
5
19
|
&[data-size="full"] {
|
|
6
20
|
@apply w-full h-full;
|
|
@@ -11,8 +11,8 @@ module Coco
|
|
|
11
11
|
@_tag_name
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def tag_attr(*
|
|
15
|
-
tag_attr_names.push(*
|
|
14
|
+
def tag_attr(*)
|
|
15
|
+
tag_attr_names.push(*)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def tag_attr_names
|
|
@@ -48,6 +48,10 @@ module Coco
|
|
|
48
48
|
tag_attrs.key?(attr_name)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def tag_attr(attr_name, fallback = nil)
|
|
52
|
+
tag_attrs.fetch(attr_name, fallback)
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
private
|
|
52
56
|
|
|
53
57
|
def process_tag_attrs(args)
|
|
@@ -4,24 +4,42 @@ module Coco
|
|
|
4
4
|
extend ActiveSupport::Concern
|
|
5
5
|
include Coco::AppHelper
|
|
6
6
|
|
|
7
|
+
BUTTON_TYPES = {
|
|
8
|
+
menu: "Coco::App::Elements::MenuButton",
|
|
9
|
+
color_picker: "Coco::App::Elements::ColorPickerButton",
|
|
10
|
+
layout_picker: "Coco::App::Elements::LayoutPickerButton",
|
|
11
|
+
image_picker: "Coco::App::Elements::ImagePickerButton",
|
|
12
|
+
dropdown: "Coco::App::Elements::DropdownButton"
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
included do
|
|
8
16
|
renders_many :items, types: {
|
|
17
|
+
noop: -> {},
|
|
9
18
|
divider: ->(**kwargs) { tag.div(class: "divider") },
|
|
10
|
-
button: ->(**kwargs) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
menu_button: ->(**kwargs) { App::Elements::MenuButton.new(**button_kwargs(kwargs, :menu)) },
|
|
18
|
-
color_picker_button: ->(**kwargs) { App::Elements::ColorPickerButton.new(**button_kwargs(kwargs, :color_picker)) },
|
|
19
|
-
layout_picker_button: ->(**kwargs) { App::Elements::LayoutPickerButton.new(**button_kwargs(kwargs, :layout_picker)) },
|
|
20
|
-
image_picker_button: ->(**kwargs) { App::Elements::ImagePickerButton.new(**button_kwargs(kwargs, :image_picker)) },
|
|
21
|
-
dropdown_button: ->(**kwargs) { App::Elements::DropdownButton.new(**button_kwargs(kwargs, :dropdown)) }
|
|
19
|
+
button: ->(*args, **kwargs, &block) { coco_button(*args, **button_kwargs(kwargs, :button), &block) },
|
|
20
|
+
menu_button: ->(*args, **kwargs, &block) { instantiate_button(:menu, *args, **kwargs, &block) },
|
|
21
|
+
dropdown_button: ->(*args, **kwargs, &block) { instantiate_button(:dropdown, *args, **kwargs, &block) },
|
|
22
|
+
color_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:color_picker, *args, **kwargs, &block) },
|
|
23
|
+
image_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:image_picker, *args, **kwargs, &block) },
|
|
24
|
+
layout_picker_button: ->(*args, **kwargs, &block) { instantiate_button(:layout_picker, *args, **kwargs, &block) }
|
|
22
25
|
}
|
|
23
26
|
end
|
|
24
27
|
|
|
28
|
+
def instantiate_button(type, *args, **kwargs, &block)
|
|
29
|
+
href, content = if block
|
|
30
|
+
[args.first, nil]
|
|
31
|
+
else
|
|
32
|
+
(args.size == 1) ? [nil, args.first] : args[0..2].reverse!
|
|
33
|
+
end
|
|
34
|
+
component = BUTTON_TYPES[type].constantize.new(href: href, **button_kwargs(kwargs, type))
|
|
35
|
+
component.with_content(content) if !block && content.present?
|
|
36
|
+
component
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def init_button_group
|
|
40
|
+
with_item_noop
|
|
41
|
+
end
|
|
42
|
+
|
|
25
43
|
def with_divider(...)
|
|
26
44
|
with_item_divider(...)
|
|
27
45
|
end
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
module Coco
|
|
2
2
|
module AppHelper
|
|
3
3
|
def coco_link(*args, **, &block)
|
|
4
|
-
href, content =
|
|
4
|
+
href, content = if block
|
|
5
|
+
[args.first, nil]
|
|
6
|
+
else
|
|
7
|
+
(args.size == 1) ? [nil, args.first] : args[0..2].reverse!
|
|
8
|
+
end
|
|
5
9
|
|
|
6
10
|
link = Coco::App::Elements::Link.new(href: href, **)
|
|
7
11
|
link = link.with_content(content) if !block && content.present?
|
|
@@ -10,7 +14,11 @@ module Coco
|
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
def coco_button(*args, **kwargs, &block)
|
|
13
|
-
href, content =
|
|
17
|
+
href, content = if block
|
|
18
|
+
[args.first, nil]
|
|
19
|
+
else
|
|
20
|
+
(args.size == 1) ? [nil, args.first] : args[0..2].reverse!
|
|
21
|
+
end
|
|
14
22
|
|
|
15
23
|
button = if kwargs.key?(:action) || kwargs.key?(:method) || kwargs.key?(:params)
|
|
16
24
|
"ButtonTo"
|
|
@@ -87,5 +95,21 @@ module Coco
|
|
|
87
95
|
def coco_fields(**, &block)
|
|
88
96
|
fields(**, builder: Coco::AppFormBuilder, &block)
|
|
89
97
|
end
|
|
98
|
+
|
|
99
|
+
def coco_layout(name, **, &block)
|
|
100
|
+
render coco_component("app/layouts/#{name}", **), &block
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def coco_app_header(*, **, &block)
|
|
104
|
+
render Coco::App::Blocks::Header.new(*, **), &block
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def coco_sidebar_nav(*, **, &block)
|
|
108
|
+
render Coco::App::Blocks::SidebarNav.new(*, **), &block
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def coco_menu_item(type, **, &block)
|
|
112
|
+
render coco_component("app/elements/menu_items/#{type}", **), &block
|
|
113
|
+
end
|
|
90
114
|
end
|
|
91
115
|
end
|
|
@@ -12,6 +12,10 @@ module Coco
|
|
|
12
12
|
render Coco::Image.new(src: src, **)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
def coco_avatar(src, name = nil, **)
|
|
16
|
+
render Coco::Avatar.new(src: src, name: name, **)
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
def coco_icon(icon_name = nil, **, &block)
|
|
16
20
|
render Coco::Icon.new(name: icon_name, **), &block
|
|
17
21
|
end
|
|
@@ -56,6 +60,8 @@ module Coco
|
|
|
56
60
|
end
|
|
57
61
|
|
|
58
62
|
def coco_modal_data_attributes(name = "default")
|
|
63
|
+
return {} if name.nil?
|
|
64
|
+
|
|
59
65
|
{
|
|
60
66
|
turbo: true,
|
|
61
67
|
turbo_frame: coco_modal_frame_id(name)
|
|
@@ -9,7 +9,11 @@ module Coco
|
|
|
9
9
|
|
|
10
10
|
href = Coco::ActionViewHelper.url_target(name, options)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
if block
|
|
13
|
+
coco_link(href, **html_options.symbolize_keys!, &block)
|
|
14
|
+
else
|
|
15
|
+
coco_link(name, href, **html_options.symbolize_keys!)
|
|
16
|
+
end
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
def coco_button_to(name = nil, options = nil, html_options = nil, &block)
|
data/config/tokens.cjs
CHANGED
|
@@ -90,6 +90,9 @@ const colorAliases = {
|
|
|
90
90
|
...colors.blue,
|
|
91
91
|
},
|
|
92
92
|
background: {
|
|
93
|
+
header: {
|
|
94
|
+
DEFAULT: "#427484",
|
|
95
|
+
},
|
|
93
96
|
light: {
|
|
94
97
|
1: colors.white,
|
|
95
98
|
2: colors.gray[50],
|
|
@@ -136,6 +139,7 @@ const colorAliases = {
|
|
|
136
139
|
DEFAULT: colors.green[500],
|
|
137
140
|
dark: colors.green[600],
|
|
138
141
|
inverse: colors.green[300],
|
|
142
|
+
"inverse-vivid": "#009979",
|
|
139
143
|
},
|
|
140
144
|
negative: {
|
|
141
145
|
DEFAULT: colors.red[600],
|
|
@@ -168,6 +172,7 @@ const screens = {
|
|
|
168
172
|
xl: "1200px",
|
|
169
173
|
"2xl": "1400px",
|
|
170
174
|
max: "1800px",
|
|
175
|
+
letterbox: { raw: "(max-height: 760px) and (min-width: 576px)" },
|
|
171
176
|
print: { raw: "print" }, // Note: PDFs are rendered at a viewport width of 1280px
|
|
172
177
|
};
|
|
173
178
|
|
|
@@ -177,6 +182,7 @@ const fontSize = {
|
|
|
177
182
|
"para-md": ["16px", "24px"],
|
|
178
183
|
"para-lg": ["18px", "27px"],
|
|
179
184
|
|
|
185
|
+
"label-xxs": ["10px", "12px"],
|
|
180
186
|
"label-xs": ["12px", "14px"],
|
|
181
187
|
"label-sm": ["14px", "16px"],
|
|
182
188
|
"label-md": ["16px", "20px"],
|
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.
|
|
4
|
+
version: 0.8.0.beta.1
|
|
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-10-
|
|
11
|
+
date: 2023-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -1323,6 +1323,7 @@ files:
|
|
|
1323
1323
|
- app/assets/img/test/slides/slide-foreground-portrait.jpg
|
|
1324
1324
|
- app/assets/js/app.js
|
|
1325
1325
|
- app/assets/js/app/components.js
|
|
1326
|
+
- app/assets/js/app/setup.js
|
|
1326
1327
|
- app/assets/js/base/components.js
|
|
1327
1328
|
- app/assets/js/book.js
|
|
1328
1329
|
- app/assets/js/book/components.js
|
|
@@ -1332,6 +1333,7 @@ files:
|
|
|
1332
1333
|
- app/assets/js/helpers/dom.js
|
|
1333
1334
|
- app/assets/js/helpers/file.js
|
|
1334
1335
|
- app/assets/js/helpers/lang.js
|
|
1336
|
+
- app/assets/js/helpers/location.js
|
|
1335
1337
|
- app/assets/js/helpers/path.js
|
|
1336
1338
|
- app/assets/js/helpers/screenshot.js
|
|
1337
1339
|
- app/assets/js/helpers/turbo_events.js
|
|
@@ -1346,16 +1348,22 @@ files:
|
|
|
1346
1348
|
- app/assets/js/libs/alpine/utils/tippy_modifiers.js
|
|
1347
1349
|
- app/assets/js/libs/tippy/index.js
|
|
1348
1350
|
- app/assets/js/libs/tippy/plugins/hide_on_esc.js
|
|
1349
|
-
- app/components/coco/app/blocks/
|
|
1350
|
-
- app/components/coco/app/blocks/
|
|
1351
|
-
- app/components/coco/app/blocks/
|
|
1352
|
-
- app/components/coco/app/blocks/
|
|
1353
|
-
- app/components/coco/app/blocks/nav_bar/nav_bar.js
|
|
1354
|
-
- app/components/coco/app/blocks/nav_bar/nav_bar.rb
|
|
1351
|
+
- app/components/coco/app/blocks/header/header.css
|
|
1352
|
+
- app/components/coco/app/blocks/header/header.html.erb
|
|
1353
|
+
- app/components/coco/app/blocks/header/header.js
|
|
1354
|
+
- app/components/coco/app/blocks/header/header.rb
|
|
1355
1355
|
- app/components/coco/app/blocks/nav_drawer/nav_drawer.css
|
|
1356
1356
|
- app/components/coco/app/blocks/nav_drawer/nav_drawer.html.erb
|
|
1357
1357
|
- app/components/coco/app/blocks/nav_drawer/nav_drawer.js
|
|
1358
1358
|
- app/components/coco/app/blocks/nav_drawer/nav_drawer.rb
|
|
1359
|
+
- app/components/coco/app/blocks/sidebar_nav/sidebar_nav.css
|
|
1360
|
+
- app/components/coco/app/blocks/sidebar_nav/sidebar_nav.html.erb
|
|
1361
|
+
- app/components/coco/app/blocks/sidebar_nav/sidebar_nav.js
|
|
1362
|
+
- app/components/coco/app/blocks/sidebar_nav/sidebar_nav.rb
|
|
1363
|
+
- app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.css
|
|
1364
|
+
- app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.html.erb
|
|
1365
|
+
- app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.js
|
|
1366
|
+
- app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.rb
|
|
1359
1367
|
- app/components/coco/app/blocks/slat/slat.css
|
|
1360
1368
|
- app/components/coco/app/blocks/slat/slat.rb
|
|
1361
1369
|
- app/components/coco/app/blocks/slide_editor/slide_editor.css
|
|
@@ -1408,6 +1416,9 @@ files:
|
|
|
1408
1416
|
- app/components/coco/app/elements/menu_button/menu_button.html.erb
|
|
1409
1417
|
- app/components/coco/app/elements/menu_button/menu_button.js
|
|
1410
1418
|
- app/components/coco/app/elements/menu_button/menu_button.rb
|
|
1419
|
+
- app/components/coco/app/elements/menu_items/user_profile/user_profile.css
|
|
1420
|
+
- app/components/coco/app/elements/menu_items/user_profile/user_profile.html.erb
|
|
1421
|
+
- app/components/coco/app/elements/menu_items/user_profile/user_profile.rb
|
|
1411
1422
|
- app/components/coco/app/elements/notice/notice.css
|
|
1412
1423
|
- app/components/coco/app/elements/notice/notice.html.erb
|
|
1413
1424
|
- app/components/coco/app/elements/notice/notice.js
|
|
@@ -1467,7 +1478,10 @@ files:
|
|
|
1467
1478
|
- app/components/coco/app/fields/weekday_select_component.rb
|
|
1468
1479
|
- app/components/coco/app/layouts/application/application.css
|
|
1469
1480
|
- app/components/coco/app/layouts/application/application.html.erb
|
|
1481
|
+
- app/components/coco/app/layouts/application/application.js
|
|
1470
1482
|
- app/components/coco/app/layouts/application/application.rb
|
|
1483
|
+
- app/components/coco/base/avatar/avatar.css
|
|
1484
|
+
- app/components/coco/base/avatar/avatar.rb
|
|
1471
1485
|
- app/components/coco/base/button/button.css
|
|
1472
1486
|
- app/components/coco/base/button/button.html.erb
|
|
1473
1487
|
- app/components/coco/base/button/button.js
|
|
@@ -1591,9 +1605,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1591
1605
|
version: 3.2.0
|
|
1592
1606
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1593
1607
|
requirements:
|
|
1594
|
-
- - "
|
|
1608
|
+
- - ">"
|
|
1595
1609
|
- !ruby/object:Gem::Version
|
|
1596
|
-
version:
|
|
1610
|
+
version: 1.3.1
|
|
1597
1611
|
requirements: []
|
|
1598
1612
|
rubygems_version: 3.4.19
|
|
1599
1613
|
signing_key:
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
[data-coco][data-component="app-navbar"] {
|
|
3
|
-
@apply @container;
|
|
4
|
-
|
|
5
|
-
.nav-content {
|
|
6
|
-
@apply h-11 @lg:h-14 flex items-center bg-teal-700 px-app;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.nav-logo {
|
|
10
|
-
@apply flex-none mr-8;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.nav-logo-small {
|
|
14
|
-
@apply h-6 @lg:hidden;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.nav-logo-full {
|
|
18
|
-
@apply hidden @lg:block h-7;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.nav-links {
|
|
22
|
-
@apply flex items-center w-full overflow-hidden;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.nav-link-group {
|
|
26
|
-
@apply flex items-center gap-x-6;
|
|
27
|
-
|
|
28
|
-
.nav-button {
|
|
29
|
-
> .button-inner {
|
|
30
|
-
@apply whitespace-nowrap text-white gap-2 text-label-sm @5xl:text-label-md py-2;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[data-component="icon"] {
|
|
34
|
-
@apply w-4 h-4;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.nav-secondary {
|
|
40
|
-
@apply ml-auto;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.nav-mobile-controls {
|
|
44
|
-
@apply flex items-center ml-auto text-white -mr-2;
|
|
45
|
-
|
|
46
|
-
[data-component="app-button"] {
|
|
47
|
-
@apply p-2;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<%= render component_tag(x: {data: "appNavBar"}) do %>
|
|
2
|
-
<div class="nav-content">
|
|
3
|
-
<div class="nav-logo">
|
|
4
|
-
<%= image_tag asset_url("coco/img/coveragebook-logomark-white.svg"),
|
|
5
|
-
alt: "CoverageBook logomark",
|
|
6
|
-
class: "nav-logo-small" %>
|
|
7
|
-
<%= image_tag asset_url("coco/img/coveragebook-landscape-white.svg"),
|
|
8
|
-
alt: "CoverageBook full logo",
|
|
9
|
-
class: "nav-logo-full" %>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="nav-links" x-ref="links">
|
|
12
|
-
<div class="nav-link-group nav-primary" x-ref="primaryLinks" x-show="!mobile" x-cloak>
|
|
13
|
-
<%= safe_join(primary_buttons) %>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="nav-link-group nav-secondary" x-ref="secondaryLinks" x-show="!mobile" x-cloak>
|
|
16
|
-
<%= safe_join(secondary_buttons) %>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="nav-mobile-controls" x-show="mobile" x-cloak>
|
|
19
|
-
<%= coco_button(icon: :menu, theme: nil) %>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<% end %>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CocoComponent } from "@js/coco";
|
|
2
|
-
import { getHiddenElementDimensions as getSize } from "@helpers/dom";
|
|
3
|
-
import tokens from "@config/tokens.cjs";
|
|
4
|
-
|
|
5
|
-
export default CocoComponent("appNavBar", () => {
|
|
6
|
-
const mobileMaxWidth = parseInt(tokens.app.screens.md, 10);
|
|
7
|
-
return {
|
|
8
|
-
mobile: true,
|
|
9
|
-
init() {
|
|
10
|
-
const sizeObserver = new ResizeObserver(
|
|
11
|
-
Alpine.throttle((entries) => {
|
|
12
|
-
this.$nextTick(() => {
|
|
13
|
-
const navWidth = entries[0].contentRect.width;
|
|
14
|
-
const linksWidth = this.$refs.links.offsetWidth;
|
|
15
|
-
const primaryWidth = getSize(this.$refs.primaryLinks, "flex").width;
|
|
16
|
-
const secondaryWidth = getSize(
|
|
17
|
-
this.$refs.secondaryLinks,
|
|
18
|
-
"flex"
|
|
19
|
-
).width;
|
|
20
|
-
const difference = linksWidth - primaryWidth - secondaryWidth;
|
|
21
|
-
|
|
22
|
-
this.mobile =
|
|
23
|
-
navWidth < mobileMaxWidth || this.mobudifference <= 50;
|
|
24
|
-
});
|
|
25
|
-
}, 20)
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
sizeObserver.observe(this.$root);
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
});
|