coveragebook_components 0.18.8 → 0.19.0

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: 3a51adb34f4dc39457d366fbbc14b9e2abbd2fff64af693cb117911d3268edb1
4
- data.tar.gz: 2778a57ba70462d2fd13d789808f07c5c04fb3706da3a137528b783cd19e733e
3
+ metadata.gz: eb5049eeec9c70081fd0cc9fec4723e35da58b39e02597077cc1a20625370b8f
4
+ data.tar.gz: c99db45370f570dd98fb3c67016925f7a1d6c950bbe1b446b3be253a6023ebe2
5
5
  SHA512:
6
- metadata.gz: ed9dfd6d27da7988a058de1a47e5a8ab28d8705f8bab863e9c06af7b853cf258c4eae4d141a1e1fcbe140903df52088ad3868a98270edfd8fe3377364c3bcea7
7
- data.tar.gz: 1133b75a1f2d5c687aa80ba08d4badc01bd763d107a1aada465f2ea94217c1505a59005d04218f99cf587dbd125a7e8deb1f06a9c08224adaf5a434b02e902d0
6
+ metadata.gz: '09a1eb6b7ec6f403018617a0f2a9ae3a6a3947673756714a314a3372e20443ce1bea81eb9f8dd755b91fb401fdc3ee034a74280639d9fe15cfb8d0101e6f41a3'
7
+ data.tar.gz: 805735413da217fedda4b939504d1b0f627effce246aea20fee7aa13ee65870b581060e5513c0a8f19938b089a064a08a83b58bf037a5037092628928a1cd497
@@ -5032,6 +5032,48 @@ select{
5032
5032
  margin-right: -0.25rem
5033
5033
  }
5034
5034
 
5035
+ [data-coco][data-component="tabs"]{
5036
+ border-bottom-width: 1px;
5037
+ border-color: rgba(0, 12, 39, 0.18)
5038
+ }
5039
+
5040
+ [data-coco][data-component="tabs"] [role="tablist"] {
5041
+ display: flex;
5042
+ position: relative;
5043
+ width: 100%;
5044
+ }
5045
+
5046
+ [data-coco][data-component="tabs"] [role="tab"]{
5047
+ border-bottom-width: 2px;
5048
+ border-color: transparent;
5049
+ position: relative;
5050
+ bottom: -1px
5051
+ }
5052
+
5053
+ [data-coco][data-component="tabs"] [role="tab"] .coco-button{
5054
+ --tw-text-opacity: 1;
5055
+ color: rgb(156 163 175 / var(--tw-text-opacity))
5056
+ }
5057
+
5058
+ [data-coco][data-component="tabs"] [role="tab"] .coco-button:hover{
5059
+ --tw-text-opacity: 1;
5060
+ color: rgb(31 41 55 / var(--tw-text-opacity))
5061
+ }
5062
+
5063
+ [data-coco][data-component="tabs"] [role="tab"].active{
5064
+ --tw-border-opacity: 1;
5065
+ border-color: rgb(17 24 39 / var(--tw-border-opacity))
5066
+ }
5067
+
5068
+ [data-coco][data-component="tabs"] [role="tab"].active .coco-button{
5069
+ --tw-text-opacity: 1;
5070
+ color: rgb(17 24 39 / var(--tw-text-opacity))
5071
+ }
5072
+
5073
+ [data-coco][data-component="tabs"][data-fit="full"] [role="tab"] {
5074
+ width: 100%;
5075
+ }
5076
+
5035
5077
  [data-coco][data-component="color-picker"]{
5036
5078
  --tw-bg-opacity: 1;
5037
5079
  background-color: rgb(249 250 251 / var(--tw-bg-opacity))
@@ -15296,7 +15296,7 @@ var alpine_default = import_alpinejs.default;
15296
15296
  // ../../../package.json
15297
15297
  var package_default = {
15298
15298
  name: "coveragebook-components",
15299
- version: "0.18.8",
15299
+ version: "0.19.0",
15300
15300
  repository: "git@github.com:coveragebook/coco.git",
15301
15301
  license: "NO LICENSE",
15302
15302
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -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.8"
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.8
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