css-zero 0.0.46 → 0.0.48

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: e7ffebd97b488ac4e393dc73e07f275f26eb725047c9eaa38ae5d8e4b2b1f269
4
- data.tar.gz: dbf4888048ff67654e774494e939769966039ebbb9b3d81a1d528f1e9300c710
3
+ metadata.gz: 2c2fa4f9172129b3e90a0a4cdcb7870f5467d8cbee3fd8d9d621eebd65212912
4
+ data.tar.gz: 0ddf2089702a14920122e9ce9d421dc8017e6a2c3fe9aa42284b83700b83a357
5
5
  SHA512:
6
- metadata.gz: fdd78709eb65d56e40ba410ef5696658498cf0bd8038472b491c671bacf64d5566ad673b1489946b87f3aca0276f1dc2acfab6166db1227bb771f8d7cca3ed26
7
- data.tar.gz: 28b8fafdafc09e8ec66815b0a1c5461bca0d5209d35528d3ede1b0fdfc7818c518a0a73928c6841da64d60711f9b42e8152380ebab5314eac5c98b50ab9edcc4
6
+ metadata.gz: a98928f94335f61b029d53858d524919c940f14012bdaa9af96b22c924f03d6bff5b79c1aa774caebb4d7b494de2a9392f4e6315dc7445c9734244f09e88313f
7
+ data.tar.gz: d682b0a2a721c13c04e250ca332eaf1bd531b173b96552b60fd1f93f8cb94813a139b4926fdb718c423412d9151be3b18242235d0e51cc21886411ad28ab2a93
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.46"
2
+ VERSION = "0.0.48"
3
3
  end
@@ -69,7 +69,7 @@
69
69
  .btn--plain {
70
70
  --btn-background: transparent;
71
71
  --btn-border-color: transparent;
72
- --btn-hover-lightness: 100%;
72
+ --btn-hover-lightness: l;
73
73
  --btn-padding: 0;
74
74
  }
75
75
 
@@ -42,10 +42,15 @@
42
42
  .command__item {
43
43
  --btn-border-color: transparent;
44
44
  --btn-font-weight: var(--font-normal);
45
+ --btn-hover-lightness: l;
45
46
  --btn-justify-content: start;
46
47
  --btn-outline-size: 0;
47
48
  --btn-padding: var(--size-1_5) var(--size-2);
48
49
 
50
+ &:hover {
51
+ --btn-background: var(--color-secondary);
52
+ }
53
+
49
54
  &:focus-visible {
50
55
  --btn-background: var(--color-secondary);
51
56
  }
@@ -57,8 +62,11 @@
57
62
  margin-inline-start: auto;
58
63
  }
59
64
 
65
+ .command__list--filtering:not(:has(.selected)) {
66
+ .command__empty { display: flex; }
67
+ }
68
+
60
69
  .command__list--filtering {
61
- &:not(:has(.selected)) > .command__empty { display: flex; }
62
70
  .command__group { display: none; }
63
71
  .command__group:has(.selected) { display: flex; }
64
72
  .command__item { display: none; }
@@ -54,6 +54,10 @@
54
54
  border: 0; inline-size: 100%; outline: 0;
55
55
  }
56
56
 
57
+ img:not([class]) {
58
+ filter: var(--input-icon-color, var(--color-filter-text));
59
+ }
60
+
57
61
  &:focus-within {
58
62
  outline: var(--input-outline-size, 2px) solid var(--color-selected-dark);
59
63
  outline-offset: var(--border-2);
@@ -63,7 +67,7 @@
63
67
  /* Checkbox, radio, and range */
64
68
  .checkbox, .radio {
65
69
  accent-color: var(--color-primary);
66
- block-size: 18px; inline-size: 18px;
70
+ block-size: 16px; inline-size: 18px;
67
71
  }
68
72
 
69
73
  .range {
@@ -23,11 +23,16 @@
23
23
  .menu__item {
24
24
  --btn-border-color: transparent;
25
25
  --btn-font-weight: var(--font-normal);
26
+ --btn-hover-lightness: l;
26
27
  --btn-justify-content: start;
27
28
  --btn-outline-size: 0;
28
29
  --btn-padding: var(--size-1_5) var(--size-2);
29
30
 
30
- &:focus {
31
+ &:hover {
32
+ --btn-background: var(--color-secondary);
33
+ }
34
+
35
+ &:focus-visible {
31
36
  --btn-background: var(--color-secondary);
32
37
  }
33
38
  }
@@ -11,7 +11,7 @@
11
11
  .btn--tab {
12
12
  --btn-background: transparent;
13
13
  --btn-border-color: transparent;
14
- --btn-hover-lightness: 100%;
14
+ --btn-hover-lightness: l;
15
15
  --btn-inline-size: var(--size-full);
16
16
 
17
17
  &[aria-selected=true] {
@@ -2,11 +2,10 @@ import { Controller } from "@hotwired/stimulus"
2
2
 
3
3
  export default class extends Controller {
4
4
  static targets = [ "item" ]
5
- static values = { index: { type: Number, default: -1 } }
5
+ static values = { index: Number }
6
6
 
7
- indexValueChanged(index) {
8
- this.#removeTabstops()
9
- this.#focusCurrentItem(index !== -1)
7
+ indexValueChanged(index, previousIndex) {
8
+ this.#updateTabstops(previousIndex !== undefined)
10
9
  }
11
10
 
12
11
  prev() {
@@ -14,23 +13,20 @@ export default class extends Controller {
14
13
  }
15
14
 
16
15
  next() {
17
- this.indexValue < this.#lastIndex && this.indexValue++
16
+ this.indexValue < this.itemTargets.length -1 && this.indexValue++
18
17
  }
19
18
 
20
19
  reset() {
21
- this.indexValue = -1
20
+ this.indexValue = 0
22
21
  }
23
22
 
24
- #removeTabstops() {
25
- this.itemTargets.forEach(item => item.tabIndex = -1)
26
- }
27
-
28
- #focusCurrentItem(shouldFocus) {
29
- if (shouldFocus) this.itemTargets[this.indexValue].tabIndex = 0
30
- if (shouldFocus) this.itemTargets[this.indexValue].focus()
31
- }
23
+ #updateTabstops(shouldFocus) {
24
+ this.itemTargets.forEach((element, index) => {
25
+ element.tabIndex = index == this.indexValue ? 0 : -1
26
+ })
32
27
 
33
- get #lastIndex() {
34
- return this.itemTargets.length -1
28
+ if (shouldFocus) {
29
+ this.itemTargets[this.indexValue].focus()
30
+ }
35
31
  }
36
32
  }
@@ -6,10 +6,7 @@ export default class extends Controller {
6
6
  static targets = [ "button", "menu" ]
7
7
  static classes = [ "flip" ]
8
8
 
9
- #closeTimer
10
-
11
9
  show() {
12
- this.#resetTimer()
13
10
  this.menuTarget.show()
14
11
  this.#updateExpanded()
15
12
  this.#orient()
@@ -20,10 +17,6 @@ export default class extends Controller {
20
17
  this.#updateExpanded()
21
18
  }
22
19
 
23
- closeLater() {
24
- this.#closeTimer = setTimeout(() => this.close(), 300)
25
- }
26
-
27
20
  toggle() {
28
21
  this.menuTarget.open ? this.close() : this.show()
29
22
  }
@@ -32,10 +25,6 @@ export default class extends Controller {
32
25
  !this.element.contains(target) && this.close()
33
26
  }
34
27
 
35
- #resetTimer() {
36
- clearTimeout(this.#closeTimer)
37
- }
38
-
39
28
  #orient() {
40
29
  this.menuTarget.classList.toggle(this.flipClass, this.#distanceToBottom < BOTTOM_THRESHOLD)
41
30
  }
@@ -5,8 +5,7 @@ export default class extends Controller {
5
5
  static values = { index: Number }
6
6
 
7
7
  indexValueChanged(index, previousIndex) {
8
- this.#showCurrentTab()
9
- this.#focusCurrentButton(previousIndex !== undefined)
8
+ this.#showCurrentTab(previousIndex !== undefined)
10
9
  }
11
10
 
12
11
  select({ target }) {
@@ -18,25 +17,21 @@ export default class extends Controller {
18
17
  }
19
18
 
20
19
  next() {
21
- this.indexValue < this.#lastIndex && this.indexValue++
20
+ this.indexValue < this.tabTargets.length -1 && this.indexValue++
22
21
  }
23
22
 
24
- #showCurrentTab() {
25
- this.buttonTargets.forEach((button, index) => {
26
- button.ariaSelected = index == this.indexValue
27
- button.tabIndex = index == this.indexValue ? 0 : -1
23
+ #showCurrentTab(shouldFocus) {
24
+ this.buttonTargets.forEach((element, index) => {
25
+ element.ariaSelected = index == this.indexValue
26
+ element.tabIndex = index == this.indexValue ? 0 : -1
28
27
  })
29
28
 
30
- this.tabTargets.forEach((tab, index) => {
31
- tab.hidden = index !== this.indexValue
29
+ this.tabTargets.forEach((element, index) => {
30
+ element.hidden = index !== this.indexValue
32
31
  })
33
- }
34
-
35
- #focusCurrentButton(shouldFocus) {
36
- shouldFocus && this.buttonTargets[this.indexValue].focus()
37
- }
38
32
 
39
- get #lastIndex() {
40
- return this.tabTargets.length -1
33
+ if (shouldFocus) {
34
+ this.buttonTargets[this.indexValue].focus()
35
+ }
41
36
  }
42
37
  }
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.46
4
+ version: 0.0.48
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-14 00:00:00.000000000 Z
11
+ date: 2024-10-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com