css-zero 0.0.31 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d871257d5eb95aed27c17cdf296d2c950c773bca21f1f76630a0a271856bec9
4
- data.tar.gz: 73529a331bcfb94f4f1bb97ac0da3fd274c6e9d1eb38aea81eee5e7161214456
3
+ metadata.gz: b786d5d38b248a7289f4dcce1246ddcdffebc21deb4327dc8ac575c1466ba5b9
4
+ data.tar.gz: 4364538047fdcd11f323687ed346662b334651404bdabf2c125d822c3f96cc3f
5
5
  SHA512:
6
- metadata.gz: acae42abeba3c9688e42acb1cd164c0408ab904133cdfc5046b25e5e4d1b04fb024fa952537fa1ca0795b8bf249ab40b40abd1ec84149c1c31c655fb20545dc2
7
- data.tar.gz: 6a57d0f885bc79e2e0b6ab5f8ffda9fcd58b2b61ece7c21bdc3751e7a3b23ef78a33ce799a9499198b87df604f536fc0a1ff819491a14c895eef47632e403b12
6
+ metadata.gz: a9efa1df9e4643f47ef0dd2cf9d334a02ddfcbfcf1979819acdada8068aefe81c22347180d392151b6d8699ca6022253763cb7438bba59c20fec123f5d7ff0d8
7
+ data.tar.gz: fd75ca1525671ceb6ffcb24c3fd4291e0f044366999c2958c3fb33c84973fff0ca32e35c509cfce4b7e5ead3218706787fc29763096a1b30ad8c438d281a76ed
@@ -1,5 +1,9 @@
1
1
  module TabsHelper
2
- def tab_button(content = nil, value:, **, &)
3
- tag.button(content, data: { tabs_target: "button", action: "tabs#select", value: }, **, &)
2
+ def tab_button(content = nil, id:, value:, **, &)
3
+ tag.button(content, id:, class: "btn", role: "tab", aria: { controls: value }, data: { tabs_target: "button", action: "tabs#select", value: }, **, &)
4
+ end
5
+
6
+ def tab_panel(id, labelled_by:, **, &)
7
+ tag.div(id:, role: "tabpanel", aria: { labelledby: labelled_by }, data: { tabs_target: "tab" }, **, &)
4
8
  end
5
9
  end
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.31"
2
+ VERSION = "0.0.33"
3
3
  end
@@ -2,7 +2,7 @@
2
2
  background-color: var(--color-bg);
3
3
  border-inline-start-width: var(--border);
4
4
  box-shadow: var(--shadow-lg);
5
- block-size: 100%;
5
+ block-size: var(--size-full);
6
6
  color: var(--color-text);
7
7
  inline-size: var(--size-3-4);
8
8
  margin-inline: var(--sheet-margin);
@@ -19,7 +19,7 @@
19
19
  inline-size: var(--size-full);
20
20
  }
21
21
 
22
- button[data-selected=true] {
22
+ button[aria-selected=true] {
23
23
  background-color: var(--color-bg);
24
24
  color: var(--color-text);
25
25
  }
@@ -2,24 +2,24 @@ import { Controller } from "@hotwired/stimulus"
2
2
 
3
3
  export default class extends Controller {
4
4
  static targets = [ "button", "tab" ]
5
- static values = { selected: String }
5
+ static values = { selected: String }
6
6
 
7
7
  initialize() {
8
8
  this.#showSelectedTab()
9
9
  }
10
10
 
11
- select(event) {
12
- this.selectedValue = event.target.dataset.value
11
+ select({ target }) {
12
+ this.selectedValue = target.dataset.value
13
13
  this.#showSelectedTab()
14
14
  }
15
15
 
16
16
  #showSelectedTab() {
17
17
  this.buttonTargets.forEach(element => {
18
- element.dataset.selected = element.dataset.value === this.selectedValue
18
+ element.ariaSelected = element.dataset.value === this.selectedValue
19
19
  })
20
20
 
21
21
  this.tabTargets.forEach(element => {
22
- element.hidden = element.dataset.value !== this.selectedValue
22
+ element.hidden = element.id !== this.selectedValue
23
23
  })
24
24
  }
25
25
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-29 00:00:00.000000000 Z
11
+ date: 2024-08-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com