css-zero 4.2.1 → 4.2.3

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: 6298296dea48b78868ba56852488b697703c2a1be68a10768aaab252a1321eda
4
- data.tar.gz: 1cda78c2d7cd8504679718605a0a9ccfffb6105b3daf1aa03b07b9cc6bc592a1
3
+ metadata.gz: 4f9bdbed4f12a30f34164d4ce75833c380b42a75e70a5f999206fbfb0068d7a3
4
+ data.tar.gz: 2488b61d43b1c9595d5adcd2bb531715b16a2fa2a56c43ab9f3736b400a6e85c
5
5
  SHA512:
6
- metadata.gz: 075e587d07089304437824bd1da927abfde3c5c554c18e780169792e21c15c16812753bfe095b873b52c254e332d8e5278716b792661799d83ef63deaedf4e6b
7
- data.tar.gz: 409910412a03924964d6605187e9f8c4cf7c975c04b7b1cc94da30586744e45698747751cb0d053000a21052d7eefbe105c00c0527834316461cc51977b48b75
6
+ metadata.gz: 5d7371f499c12dda9f40d8c58bfbc30a91f60ed4463d938589134954c167d833505fcdafafa20fab300cc963f312c9419f0c5f60b47ad68a59a0fac151dc59f9
7
+ data.tar.gz: 56a0fa99d397354945887680cd2de0aa18c9d84122af17f47c694c25828d47ed7d026853119165d93c1e4b6e5b1ac69a3214a0823335701930f0de6fac09cc19
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 4.2.3 - 2026-09-07
2
+ - Prevent month header from wrapping in datepicker
3
+ - Refactor autosave
4
+ - Rebuild menu on top of roving-ux
5
+
6
+ ## 4.2.2 - 2026-08-29
7
+ - Use position-try shorthand in popover
8
+ - Adjust dialog transition durations
9
+ - Adjust flash animation easing
10
+ - Adjust tabs indicator easing
11
+ - Adjust combobox transition duration
12
+ - Adjust datepicker animation duration
13
+ - Adjust popover transition duration
14
+ - Adjust sheet transition and slide distance
15
+ - Simplify autosave
16
+
1
17
  ## 4.2.1 - 2026-08-26
2
18
  - Hide sidebar content when closed
3
19
  - Adjust sidebar menu current and focus styles
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "4.2.1"
2
+ VERSION = "4.2.3"
3
3
  end
@@ -30,7 +30,7 @@
30
30
 
31
31
  /* Setup transition */
32
32
  transition-behavior: allow-discrete;
33
- transition-duration: var(--time-100);
33
+ transition-duration: var(--time-150);
34
34
  transition-property: display, opacity, transform;
35
35
  transition-timing-function: var(--ease-out-3);
36
36
 
@@ -13,7 +13,7 @@
13
13
  inline-size: var(--datepicker-size);
14
14
 
15
15
  &.animate.open {
16
- animation: datepicker-in var(--time-100) var(--ease-out-3);
16
+ animation: datepicker-in var(--time-150) var(--ease-out-3);
17
17
  }
18
18
 
19
19
  .flatpickr-innerContainer {
@@ -40,6 +40,11 @@
40
40
  color: var(--color-text);
41
41
  }
42
42
 
43
+ .flatpickr-current-month {
44
+ inline-size: 85%;
45
+ padding-block-start: 6.48px;
46
+ }
47
+
43
48
  span.cur-month {
44
49
  font-size: var(--text-sm);
45
50
  font-weight: var(--font-medium);
@@ -13,13 +13,13 @@
13
13
 
14
14
  /* Setup transition */
15
15
  transition-behavior: allow-discrete;
16
- transition-duration: var(--time-100);
16
+ transition-duration: var(--time-200);
17
17
  transition-property: display, overlay, opacity, transform;
18
18
  transition-timing-function: var(--ease-out-3);
19
19
 
20
20
  &::backdrop {
21
21
  transition-behavior: allow-discrete;
22
- transition-duration: var(--time-100);
22
+ transition-duration: var(--time-150);
23
23
  transition-property: display, overlay, opacity;
24
24
  transition-timing-function: var(--ease-out-3);
25
25
  }
@@ -61,6 +61,6 @@
61
61
 
62
62
  .dialog__close {
63
63
  inset-block-start: var(--size-3);
64
- inset-inline-end: var(--size-3);
64
+ inset-inline-end: var(--size-3);
65
65
  position: absolute;
66
66
  }
@@ -1,6 +1,6 @@
1
1
  .flash {
2
2
  animation: flash-in-out 5s both;
3
- animation-timing-function: var(--ease-bounce-2);
3
+ animation-timing-function: var(--ease-out-3);
4
4
  background-color: var(--color-surface);
5
5
  border-radius: var(--rounded-lg);
6
6
  border-width: var(--border);
@@ -31,36 +31,28 @@
31
31
 
32
32
  @keyframes flash-in-out {
33
33
  0% {
34
- opacity: 0;
35
- transform: translateY(-100%);
34
+ opacity: 0; transform: translateY(-100%);
36
35
  }
37
36
 
38
37
  8%, 92% {
39
- opacity: 1;
40
- transform: translateY(0);
41
- animation-timing-function: ease-out;
38
+ opacity: 1; transform: translateY(0);
42
39
  }
43
40
 
44
- 100% {
45
- opacity: 0;
46
- transform: translateY(-100%);
41
+ 100% {
42
+ opacity: 0; transform: translateY(-100%);
47
43
  }
48
44
  }
49
45
 
50
46
  @keyframes flash-in-out-extended {
51
47
  0% {
52
- opacity: 0;
53
- transform: translateY(-100%);
48
+ opacity: 0; transform: translateY(-100%);
54
49
  }
55
50
 
56
51
  3.3%, 96.7% {
57
- opacity: 1;
58
- transform: translateY(0);
59
- animation-timing-function: ease-out;
52
+ opacity: 1; transform: translateY(0);
60
53
  }
61
54
 
62
55
  100% {
63
- opacity: 0;
64
- transform: translateY(-100%);
56
+ opacity: 0; transform: translateY(-100%);
65
57
  }
66
58
  }
@@ -13,8 +13,8 @@
13
13
 
14
14
  &:is([type="checkbox"], [type="radio"]) {
15
15
  accent-color: var(--input-accent-color, var(--color-primary));
16
- block-size: var(--input-check-size, var(--size-4));
17
- inline-size: var(--input-check-size, var(--size-4));
16
+ block-size: var(--input-check-size, var(--size-4));
17
+ inline-size: var(--input-check-size, var(--size-4));
18
18
  }
19
19
 
20
20
  &:is([type="range"]) {
@@ -32,6 +32,6 @@
32
32
 
33
33
  .lightbox__image {
34
34
  grid-area: 1/1;
35
- max-block-size: calc(100dvh - (var(--size-4) * 2));
35
+ max-block-size: calc(100dvh - (var(--size-4) * 2));
36
36
  max-inline-size: calc(100dvw - (var(--size-4) * 2));
37
37
  }
@@ -8,12 +8,12 @@
8
8
 
9
9
  /* Anchor position */
10
10
  position-area: var(--popover-position, block-end);
11
- position-try-fallbacks: var(--popover-position-try-fallbacks, flip-block);
11
+ position-try: var(--popover-position-try, flip-block);
12
12
  margin-block: var(--popover-margin-block, .25rem 0);
13
13
 
14
14
  /* Setup transition */
15
15
  transition-behavior: allow-discrete;
16
- transition-duration: var(--time-100);
16
+ transition-duration: var(--time-150);
17
17
  transition-property: display, opacity, overlay, transform;
18
18
  transition-timing-function: var(--ease-out-3);
19
19
 
@@ -39,7 +39,7 @@
39
39
 
40
40
  .popover--unanchored {
41
41
  --popover-position: none;
42
- --popover-position-try-fallbacks: none;
42
+ --popover-position-try: none;
43
43
  --popover-margin-block: 0;
44
44
  }
45
45
 
@@ -72,4 +72,3 @@
72
72
  --popover-position: block-start span-inline-start;
73
73
  --popover-margin-block: 0 .25rem;
74
74
  }
75
-
@@ -14,9 +14,9 @@
14
14
 
15
15
  /* Setup transition */
16
16
  transition-behavior: allow-discrete;
17
- transition-duration: var(--time-200);
17
+ transition-duration: var(--time-300);
18
18
  transition-property: display, overlay, opacity, transform;
19
- transition-timing-function: var(--ease-out-3);
19
+ transition-timing-function: var(--ease-out-4);
20
20
 
21
21
  &::backdrop {
22
22
  transition-behavior: allow-discrete;
@@ -51,13 +51,13 @@
51
51
  .sheet--left {
52
52
  --sheet-border: 0 1px;
53
53
  --sheet-margin-inline: 0 auto;
54
- --sheet-transform: translateX(-2.5rem);
54
+ --sheet-transform: translateX(-100%);
55
55
  }
56
56
 
57
57
  .sheet--right {
58
58
  --sheet-border: 1px 0;
59
59
  --sheet-margin-inline: auto 0;
60
- --sheet-transform: translateX(2.5rem);
60
+ --sheet-transform: translateX(100%);
61
61
  }
62
62
 
63
63
  .sheet__content {
@@ -66,6 +66,6 @@
66
66
 
67
67
  .sheet__close {
68
68
  inset-block-start: var(--size-3);
69
- inset-inline-end: var(--size-3);
69
+ inset-inline-end: var(--size-3);
70
70
  position: absolute;
71
71
  }
@@ -25,7 +25,7 @@
25
25
  position-anchor: --tabs-selected;
26
26
  transition-duration: var(--time-150);
27
27
  transition-property: inset;
28
- transition-timing-function: var(--ease-in-out-3);
28
+ transition-timing-function: var(--ease-in-out-4);
29
29
  }
30
30
  }
31
31
 
@@ -9,45 +9,52 @@ export default class extends Controller {
9
9
  #timer
10
10
 
11
11
  disconnect() {
12
- this.#submit()
12
+ this.#dirty && this.#save()
13
13
  }
14
14
 
15
15
  change() {
16
- !this.#dirty && this.#scheduleSaveAndUpdateAppearance(false)
17
- }
18
-
19
- async #submit() {
20
- this.#dirty && await this.#save()
16
+ !this.#dirty && this.#scheduleSave()
21
17
  }
22
18
 
23
- async #save() {
24
- this.#updateAppearance(true)
19
+ #save() {
25
20
  this.#resetTimer()
26
- await this.#submitForm(this.element)
27
- this.#updateAppearance(false)
21
+ this.#submit()
28
22
  }
29
23
 
30
- async #submitForm(form) {
31
- return await new FetchRequest(form.method, form.action, { body: new FormData(form) }).perform()
24
+ #scheduleSave() {
25
+ this.#timer = setTimeout(() => this.#save(), AUTOSAVE_INTERVAL)
32
26
  }
33
27
 
34
- #scheduleSaveAndUpdateAppearance(saving) {
35
- this.#scheduleSave()
36
- this.#updateAppearance(false)
28
+ #resetTimer() {
29
+ clearTimeout(this.#timer)
30
+ this.#timer = null
37
31
  }
38
32
 
39
- #scheduleSave() {
40
- this.#timer = setTimeout(() => this.#save(), AUTOSAVE_INTERVAL)
33
+ async #submit() {
34
+ this.#toggleSaving(true)
35
+ await this.#performRequest()
36
+ this.#toggleSaving(false)
41
37
  }
42
38
 
43
- #updateAppearance(saving) {
39
+ #toggleSaving(saving) {
44
40
  this.element.ariaBusy = saving
45
41
  this.submitTarget.disabled = saving
46
42
  }
47
43
 
48
- #resetTimer() {
49
- clearTimeout(this.#timer)
50
- this.#timer = null
44
+ #performRequest() {
45
+ return new FetchRequest(this.#method, this.#action, { body: this.#body }).perform()
46
+ }
47
+
48
+ get #method() {
49
+ return this.element.method
50
+ }
51
+
52
+ get #action() {
53
+ return this.element.action
54
+ }
55
+
56
+ get #body() {
57
+ return new FormData(this.element)
51
58
  }
52
59
 
53
60
  get #dirty() {
@@ -1,8 +1,8 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
+ import { rovingIndex } from "https://esm.sh/roving-ux@1.0.5?standalone"
2
3
 
3
4
  export default class extends Controller {
4
5
  static targets = [ "item" ]
5
- static values = { index: Number }
6
6
 
7
7
  #observer
8
8
 
@@ -18,85 +18,20 @@ export default class extends Controller {
18
18
  this.#observer.disconnect()
19
19
  }
20
20
 
21
- navigate(event) {
22
- switch (event.key) {
23
- case " ":
24
- case "Enter":
25
- this.#cancel(event)
26
- this.#activate(event.target)
27
- break
28
- case "ArrowUp":
29
- this.#cancel(event)
30
- this.#prev()
31
- break
32
- case "ArrowDown":
33
- this.#cancel(event)
34
- this.#next()
35
- break
36
- case "Home":
37
- this.#cancel(event)
38
- this.#first()
39
- break
40
- case "End":
41
- this.#cancel(event)
42
- this.#last()
43
- break
44
- }
45
- }
46
-
47
- #cancel(event) {
48
- event.stopPropagation()
49
- event.preventDefault()
50
- }
51
-
52
- #activate(menuItem) {
53
- menuItem.click()
54
- }
55
-
56
21
  #reset([ entry ]) {
57
- entry.isIntersecting && this.#first()
58
- }
59
-
60
- #prev() {
61
- if (this.indexValue > 0) {
62
- this.indexValue--
63
- this.#update()
64
- }
65
- }
66
-
67
- #next() {
68
- if (this.indexValue < this.#lastIndex) {
69
- this.indexValue++
70
- this.#update()
71
- }
72
- }
73
-
74
- #first() {
75
- this.indexValue = 0
76
- this.#update()
77
- }
78
-
79
- #last() {
80
- this.indexValue = this.#lastIndex
81
- this.#update()
82
- }
83
-
84
- #update() {
85
- this.#updateTabstops()
86
- this.#focusItemAtIndex()
22
+ entry.isIntersecting && this.#start()
87
23
  }
88
24
 
89
- #updateTabstops() {
90
- this.itemTargets.forEach((it, index) => {
91
- it.tabIndex = index === this.indexValue ? 0 : -1
92
- })
25
+ #start() {
26
+ this.#rovingIndex()
27
+ this.#focus()
93
28
  }
94
29
 
95
- #focusItemAtIndex() {
96
- this.itemTargets[this.indexValue].focus()
30
+ #rovingIndex() {
31
+ rovingIndex({ element: this.element, target: "[data-menu-target='item']" })
97
32
  }
98
33
 
99
- get #lastIndex() {
100
- return this.itemTargets.length -1
34
+ #focus() {
35
+ this.itemTargets[0].focus()
101
36
  }
102
37
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon