coveragebook_components 0.8.0.beta.2 → 0.8.0.beta.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b89e4f8770587065a0d3967f7f767ff9b420e36e30abf97c3dc72bcf3bc41d34
4
- data.tar.gz: 70662dbab01723243b282c24ea050f697f639044acf91157648945dfe52b9a1e
3
+ metadata.gz: fd091a2e16041e7c228e055e43093de5a7b7fefb7747872059c313681993c774
4
+ data.tar.gz: 9161c4c85b14f3b1bcee2b57472fc0596d74b2543a36ddb714d9582abf897699
5
5
  SHA512:
6
- metadata.gz: eb05436465f98461bbbb58148fe1519e7e0b4bf2981328d0d16aa4a05312aa2755ee24f07de5a4137d138fd42ba0fa002cc4320cae9a687f29421848b9d651f6
7
- data.tar.gz: 6dbc15f4ab52cf871137891789fed68a544ed90b824f11381b84559de0c4be3fb49129337a8a744f8c43d444fa23f0da2cba2b82605e29596640019aa698210b
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.2",
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>",
@@ -5,6 +5,8 @@
5
5
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1fr);
6
6
 
7
7
  .nav-action {
8
+ @apply cursor-pointer;
9
+
8
10
  .nav-item-label {
9
11
  @apply hidden !text-content-primary-inverse-vivid;
10
12
  }
@@ -8,7 +8,7 @@
8
8
  </span>
9
9
  <% end %>
10
10
 
11
- <% item.with_menu do %>
11
+ <% item.with_menu(id: "actions-nav-link") do %>
12
12
  <% actions_data.each do |action| %>
13
13
  <%= coco_link(action[:href],
14
14
  **action.except(:label, :description, :href, :icon),
@@ -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
- <template x-ref="menu">
16
- <div class="sidebar-nav-menu" x-cloak>
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
- </div>
41
- </template>
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 bg-background-light-1 text-content-dark-1 hover:bg-background-light-2 active:bg-background-light-3;
244
+ @apply border border-transparent;
245
245
 
246
- &[data-state="loading"] {
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
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.8.0.beta.2"
2
+ VERSION = "0.8.0.beta.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveragebook_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta.2
4
+ version: 0.8.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins