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 +4 -4
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/button.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/command.css +9 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/input.css +5 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/menu.css +6 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/tabs.css +1 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/menu_controller.js +12 -16
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/popover_controller.js +0 -11
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js +11 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c2fa4f9172129b3e90a0a4cdcb7870f5467d8cbee3fd8d9d621eebd65212912
|
4
|
+
data.tar.gz: 0ddf2089702a14920122e9ce9d421dc8017e6a2c3fe9aa42284b83700b83a357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a98928f94335f61b029d53858d524919c940f14012bdaa9af96b22c924f03d6bff5b79c1aa774caebb4d7b494de2a9392f4e6315dc7445c9734244f09e88313f
|
7
|
+
data.tar.gz: d682b0a2a721c13c04e250ca332eaf1bd531b173b96552b60fd1f93f8cb94813a139b4926fdb718c423412d9151be3b18242235d0e51cc21886411ad28ab2a93
|
data/lib/css_zero/version.rb
CHANGED
@@ -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:
|
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
|
-
&:
|
31
|
+
&:hover {
|
32
|
+
--btn-background: var(--color-secondary);
|
33
|
+
}
|
34
|
+
|
35
|
+
&:focus-visible {
|
31
36
|
--btn-background: var(--color-secondary);
|
32
37
|
}
|
33
38
|
}
|
@@ -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:
|
5
|
+
static values = { index: Number }
|
6
6
|
|
7
|
-
indexValueChanged(index) {
|
8
|
-
this.#
|
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
|
16
|
+
this.indexValue < this.itemTargets.length -1 && this.indexValue++
|
18
17
|
}
|
19
18
|
|
20
19
|
reset() {
|
21
|
-
this.indexValue =
|
20
|
+
this.indexValue = 0
|
22
21
|
}
|
23
22
|
|
24
|
-
#
|
25
|
-
this.itemTargets.forEach(
|
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
|
-
|
34
|
-
|
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
|
20
|
+
this.indexValue < this.tabTargets.length -1 && this.indexValue++
|
22
21
|
}
|
23
22
|
|
24
|
-
#showCurrentTab() {
|
25
|
-
this.buttonTargets.forEach((
|
26
|
-
|
27
|
-
|
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((
|
31
|
-
|
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
|
-
|
40
|
-
|
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.
|
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-
|
11
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|