coveragebook_components 0.8.0.beta.2 → 0.8.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +13 -6
- data/app/assets/build/coco/app.js +1 -1
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.css +2 -0
- data/app/components/coco/app/blocks/sidebar_nav/sidebar_nav.html.erb +1 -1
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.css +2 -2
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.html.erb +6 -4
- data/app/components/coco/app/blocks/sidebar_nav_item/sidebar_nav_item.rb +12 -2
- data/app/components/coco/app/elements/button/button.css +8 -4
- data/lib/coco.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd091a2e16041e7c228e055e43093de5a7b7fefb7747872059c313681993c774
|
4
|
+
data.tar.gz: 9161c4c85b14f3b1bcee2b57472fc0596d74b2543a36ddb714d9582abf897699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9820183b0356270f175fa9b55a4627053b00c495caf31c7e9b1e3cd220f56d7ddbfa0e50486031eab376c373760102964d37d2d494d346377a45dd3ffda617
|
7
|
+
data.tar.gz: a799d7ed6d316ec0fad9d46d94b09c513833d80ab8e77777fa6d2664814d4a97f2511b865374a685c0162af51c2993a9d103a7dd9ab298c343cf26b4b438b17b
|
@@ -1395,6 +1395,8 @@ select{
|
|
1395
1395
|
width: 100%;
|
1396
1396
|
grid-template-rows: repeat(1, minmax(0, 1fr));
|
1397
1397
|
grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1fr)}
|
1398
|
+
[data-coco][data-component="app-sidebar-nav"] .nav-action{
|
1399
|
+
cursor: pointer}
|
1398
1400
|
[data-coco][data-component="app-sidebar-nav"] .nav-action .nav-item-label{
|
1399
1401
|
display: none;
|
1400
1402
|
--tw-text-opacity: 1 !important;
|
@@ -1514,6 +1516,7 @@ select{
|
|
1514
1516
|
}
|
1515
1517
|
[data-coco][data-component="app-sidebar-nav-item"]{
|
1516
1518
|
flex: none;
|
1519
|
+
cursor: pointer;
|
1517
1520
|
--tw-bg-opacity: 1;
|
1518
1521
|
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
|
1519
1522
|
text-align: center;
|
@@ -1545,6 +1548,7 @@ select{
|
|
1545
1548
|
[data-coco][data-component="app-sidebar-nav-item"] .nav-item-label{
|
1546
1549
|
margin-top: 0.125rem;
|
1547
1550
|
display: block;
|
1551
|
+
cursor: pointer;
|
1548
1552
|
font-size: 10px;
|
1549
1553
|
line-height: 12px;
|
1550
1554
|
font-weight: 600;
|
@@ -2686,26 +2690,29 @@ select{
|
|
2686
2690
|
--tw-bg-opacity: 1;
|
2687
2691
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity))}
|
2688
2692
|
[data-coco][data-component="app-button"][data-theme="neutral-light"]{
|
2693
|
+
border-width: 1px;
|
2694
|
+
border-color: transparent}
|
2695
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"] .button-element{
|
2689
2696
|
--tw-bg-opacity: 1;
|
2690
2697
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
2691
2698
|
--tw-text-opacity: 1;
|
2692
2699
|
color: rgb(17 24 39 / var(--tw-text-opacity))}
|
2693
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"]:hover{
|
2700
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"] .button-element:hover{
|
2694
2701
|
--tw-bg-opacity: 1;
|
2695
2702
|
background-color: rgb(249 250 251 / var(--tw-bg-opacity))}
|
2696
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"]:active{
|
2703
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"] .button-element:active{
|
2697
2704
|
--tw-bg-opacity: 1;
|
2698
2705
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity))}
|
2699
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-state="loading"]{
|
2706
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-state="loading"] .button-element{
|
2700
2707
|
--tw-bg-opacity: 1;
|
2701
2708
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))}
|
2702
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-state="active"]{
|
2709
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-state="active"] .button-element{
|
2703
2710
|
--tw-bg-opacity: 1;
|
2704
2711
|
background-color: rgb(243 244 246 / var(--tw-bg-opacity))}
|
2705
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-disabled="true"]{
|
2712
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-disabled="true"] .button-element{
|
2706
2713
|
--tw-bg-opacity: 1;
|
2707
2714
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))}
|
2708
|
-
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-disabled="true"] .button-inner{
|
2715
|
+
[data-coco][data-component="app-button"][data-theme="neutral-light"][data-disabled="true"] .button-element .button-inner{
|
2709
2716
|
opacity: 0.4}
|
2710
2717
|
[data-coco][data-component="app-button"][data-theme="text-neutral-light"]{
|
2711
2718
|
background-color: transparent;
|
@@ -14038,7 +14038,7 @@
|
|
14038
14038
|
var package_default = {
|
14039
14039
|
name: "coveragebook-components",
|
14040
14040
|
type: "module",
|
14041
|
-
version: "0.8.0-beta.
|
14041
|
+
version: "0.8.0-beta.3",
|
14042
14042
|
main: "index.js",
|
14043
14043
|
repository: "git@github.com:coveragebook/coco.git",
|
14044
14044
|
author: "Mark Perkins <mark@coveragebook.com>",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@layer components {
|
2
2
|
[data-coco][data-component="app-sidebar-nav-item"] {
|
3
|
-
@apply bg-background-dark-2 text-content-dark-muted text-center no-underline transition-colors flex-none;
|
3
|
+
@apply bg-background-dark-2 text-content-dark-muted text-center no-underline transition-colors flex-none cursor-pointer;
|
4
4
|
@apply flex items-center justify-center px-4 w-full flex-col;
|
5
5
|
|
6
6
|
&[href] {
|
@@ -13,7 +13,7 @@
|
|
13
13
|
}
|
14
14
|
|
15
15
|
.nav-item-label {
|
16
|
-
@apply block font-semibold text-label-xxs transition-colors mt-0.5;
|
16
|
+
@apply block font-semibold text-label-xxs transition-colors mt-0.5 cursor-pointer;
|
17
17
|
}
|
18
18
|
|
19
19
|
&.emphasised {
|
@@ -12,8 +12,10 @@
|
|
12
12
|
<%= label %>
|
13
13
|
</label>
|
14
14
|
<% if menu? || menu_items? %>
|
15
|
-
|
16
|
-
|
15
|
+
<%= tag.template id: menu_template_id, "x-ref": "menu" do %>
|
16
|
+
<%= tag.div id: menu_id,
|
17
|
+
class: "sidebar-nav-menu",
|
18
|
+
"x-cloak": "" do %>
|
17
19
|
<% if menu? %>
|
18
20
|
<%= menu %>
|
19
21
|
<% else %>
|
@@ -37,7 +39,7 @@
|
|
37
39
|
|
38
40
|
<%= menu_action %>
|
39
41
|
<% end %>
|
40
|
-
|
41
|
-
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
42
44
|
<% end %>
|
43
45
|
<% end %>
|
@@ -25,6 +25,7 @@ module Coco
|
|
25
25
|
end
|
26
26
|
|
27
27
|
before_render do
|
28
|
+
set_tag_attr(:id, item_id)
|
28
29
|
if @icon && !icon?
|
29
30
|
with_icon do
|
30
31
|
tag.span(class: "nav-item-icon") do
|
@@ -34,9 +35,10 @@ module Coco
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
attr_reader :label, :tooltip, :dropdown_menu_items, :max_menu_items
|
38
|
+
attr_reader :label, :tooltip, :dropdown_menu_items, :max_menu_items, :item_id
|
38
39
|
|
39
|
-
def initialize(label:, icon: nil, emphasise: false, active: false, tooltip: nil, menu_select_placeholder: nil, max_menu_items: 6, **)
|
40
|
+
def initialize(label:, id: nil, icon: nil, emphasise: false, active: false, tooltip: nil, menu_select_placeholder: nil, max_menu_items: 6, **)
|
41
|
+
@item_id = id
|
40
42
|
@label = label
|
41
43
|
@icon = icon
|
42
44
|
@emphasise = emphasise
|
@@ -63,6 +65,14 @@ module Coco
|
|
63
65
|
@menu_select_placeholder || "More items..."
|
64
66
|
end
|
65
67
|
|
68
|
+
def menu_id
|
69
|
+
"#{item_id}-menu" if item_id.present?
|
70
|
+
end
|
71
|
+
|
72
|
+
def menu_template_id
|
73
|
+
"#{menu_id}-template" if menu_id.present?
|
74
|
+
end
|
75
|
+
|
66
76
|
class SidebarNavMenuItem < Coco::Component
|
67
77
|
attr_reader :icon, :href, :modal
|
68
78
|
|
@@ -241,17 +241,21 @@
|
|
241
241
|
}
|
242
242
|
|
243
243
|
&[data-theme="neutral-light"] {
|
244
|
-
@apply
|
244
|
+
@apply border border-transparent;
|
245
245
|
|
246
|
-
|
246
|
+
.button-element {
|
247
|
+
@apply bg-background-light-1 text-content-dark-1 hover:bg-background-light-2 active:bg-background-light-3;
|
248
|
+
}
|
249
|
+
|
250
|
+
&[data-state="loading"] .button-element {
|
247
251
|
@apply bg-background-light-1;
|
248
252
|
}
|
249
253
|
|
250
|
-
&[data-state="active"] {
|
254
|
+
&[data-state="active"] .button-element {
|
251
255
|
@apply bg-background-light-3;
|
252
256
|
}
|
253
257
|
|
254
|
-
&[data-disabled="true"] {
|
258
|
+
&[data-disabled="true"] .button-element {
|
255
259
|
@apply bg-background-light-1;
|
256
260
|
|
257
261
|
.button-inner {
|
data/lib/coco.rb
CHANGED