css-zero 0.0.45 → 0.0.46

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: fd059d67d4f761e329571d4e4eefac0325a6cf14224717ed3581a7ffe7acaf0e
4
- data.tar.gz: 13afe2beaba626b1925504904160f01ab1c5589eb87d3bbe2baa9009c3e04cc2
3
+ metadata.gz: e7ffebd97b488ac4e393dc73e07f275f26eb725047c9eaa38ae5d8e4b2b1f269
4
+ data.tar.gz: dbf4888048ff67654e774494e939769966039ebbb9b3d81a1d528f1e9300c710
5
5
  SHA512:
6
- metadata.gz: 5bfb100356389b839542aa74775abce26f05fc0f8816df589fabb91af96892b28fac6fe2179bb8aa11476595ae7457ce0a33b9faef7b91d771151ef2100f581b
7
- data.tar.gz: 340f487beff85601804945afe83121df0c2ac1cf42ddd8fa80261a746754f788e8a31f2264b159de654745a7ee56dfa8b89e37175bdcbcdd5d9ca37aa32ae436
6
+ metadata.gz: fdd78709eb65d56e40ba410ef5696658498cf0bd8038472b491c671bacf64d5566ad673b1489946b87f3aca0276f1dc2acfab6166db1227bb771f8d7cca3ed26
7
+ data.tar.gz: 28b8fafdafc09e8ec66815b0a1c5461bca0d5209d35528d3ede1b0fdfc7818c518a0a73928c6841da64d60711f9b42e8152380ebab5314eac5c98b50ab9edcc4
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.45"
2
+ VERSION = "0.0.46"
3
3
  end
@@ -27,7 +27,7 @@
27
27
  --btn-outline-size: 0;
28
28
  --btn-padding: var(--size-1_5) var(--size-2);
29
29
 
30
- .menu:not(:hover) &:focus {
30
+ &:focus {
31
31
  --btn-background: var(--color-secondary);
32
32
  }
33
33
  }
@@ -2,11 +2,11 @@ import { Controller } from "@hotwired/stimulus"
2
2
 
3
3
  export default class extends Controller {
4
4
  static targets = [ "item" ]
5
- static values = { index: Number }
5
+ static values = { index: { type: Number, default: -1 } }
6
6
 
7
- indexValueChanged() {
7
+ indexValueChanged(index) {
8
8
  this.#removeTabstops()
9
- this.#focusCurrentItem()
9
+ this.#focusCurrentItem(index !== -1)
10
10
  }
11
11
 
12
12
  prev() {
@@ -18,16 +18,16 @@ export default class extends Controller {
18
18
  }
19
19
 
20
20
  reset() {
21
- this.indexValue = 0
21
+ this.indexValue = -1
22
22
  }
23
23
 
24
24
  #removeTabstops() {
25
25
  this.itemTargets.forEach(item => item.tabIndex = -1)
26
26
  }
27
27
 
28
- #focusCurrentItem() {
29
- this.itemTargets[this.indexValue].tabIndex = 0
30
- this.itemTargets[this.indexValue].focus()
28
+ #focusCurrentItem(shouldFocus) {
29
+ if (shouldFocus) this.itemTargets[this.indexValue].tabIndex = 0
30
+ if (shouldFocus) this.itemTargets[this.indexValue].focus()
31
31
  }
32
32
 
33
33
  get #lastIndex() {
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.45
4
+ version: 0.0.46
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-10-13 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com