coveragebook_components 0.18.7 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,37 @@
1
+ @layer components {
2
+ [data-coco][data-component="tabs"] {
3
+ @apply border-b border-gray-transparent-200;
4
+
5
+ [role="tablist"] {
6
+ display: flex;
7
+ position: relative;
8
+ width: 100%;
9
+ }
10
+
11
+ [role="tab"] {
12
+ @apply border-b-2 border-transparent;
13
+ position: relative;
14
+ bottom: -1px;
15
+
16
+ .coco-button {
17
+ @apply text-content-dark-muted;
18
+
19
+ &:hover {
20
+ @apply text-content-dark-2;
21
+ }
22
+ }
23
+
24
+ &.active {
25
+ @apply border-background-dark-1;
26
+
27
+ .coco-button {
28
+ @apply text-content-dark-1;
29
+ }
30
+ }
31
+ }
32
+
33
+ &[data-fit="full"] [role="tab"] {
34
+ width: 100%;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,5 @@
1
+ <%= render component_tag(:nav) do %>
2
+ <ul role="tablist">
3
+ <%= safe_join(tabs) %>
4
+ </ul>
5
+ <% end %>
@@ -0,0 +1,13 @@
1
+ module Coco
2
+ class Tabs < Coco::Component
3
+ include Concerns::AcceptsOptions
4
+
5
+ accepts_option :fit, from: [:auto, :full], default: :auto
6
+
7
+ renders_many :tabs, ->(*args, active: false, **kwargs, &block) do
8
+ tag.li(class: {active:}, role: "tab") do
9
+ coco_button(*args, **kwargs, theme: :blank, fit: get_option_value(:fit), &block)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -236,6 +236,10 @@ module Coco
236
236
  render(Coco::PagerButton.new(direction:, **), &)
237
237
  end
238
238
 
239
+ def coco_tabs(**, &)
240
+ render(Coco::Tabs.new(**), &)
241
+ end
242
+
239
243
  # Typography
240
244
 
241
245
  def coco_prose(**, &)
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.18.7"
2
+ VERSION = "0.19.0"
3
3
  end
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.18.7
4
+ version: 0.19.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: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1685,6 +1685,9 @@ files:
1685
1685
  - app/components/coco/navigation/pager_button/pager_button.css
1686
1686
  - app/components/coco/navigation/pager_button/pager_button.html.erb
1687
1687
  - app/components/coco/navigation/pager_button/pager_button.rb
1688
+ - app/components/coco/navigation/tabs/tabs.css
1689
+ - app/components/coco/navigation/tabs/tabs.html.erb
1690
+ - app/components/coco/navigation/tabs/tabs.rb
1688
1691
  - app/components/coco/pickers/color_picker/color_picker.css
1689
1692
  - app/components/coco/pickers/color_picker/color_picker.html.erb
1690
1693
  - app/components/coco/pickers/color_picker/color_picker.js