@nxgt/material 3.20.0 → 3.21.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @nxgt/material
2
2
 
3
+ ## 3.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1602](https://github.com/softistx/nxgt-material/pull/1602) [`800051d`](https://github.com/softistx/nxgt-material/commit/800051ddb782564801354793fe59c3a2bf9589c3) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `DateField` / `DateFormField` / `DateRangeField` keep a value outside `minDate`, `maxDate`, `disablePast` or `disableFuture` (one set from the form or typed) instead of moving it onto the bound's day with its time of day, which turned a moment after midnight into one 24 hours earlier and let a form rule pass; the form refuses it and the calendar still keeps the day unpickable. The `Chip` dismiss ✕ has its own 24x24 box (44x44 on a coarse pointer), so axe `target-size` passes; the glyph and the chip height are unchanged. Fixes [#1583](https://github.com/softistx/nxgt-material/issues/1583). Fixes [#1584](https://github.com/softistx/nxgt-material/issues/1584).
8
+
9
+ Migration: a typed date outside `minDate`/`maxDate`/`disablePast`/`disableFuture` is no longer moved to the nearest allowed day on blur. It is kept, and the form refuses it. If your schema has no min/max rule, add one (see date-and-time.md).
10
+
3
11
  ## 3.20.0
4
12
 
5
13
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  /* Chip: focus, the dismiss button (drawn
2
- * small, a 24x24 target through ::after, its own ring), disabled, the dashed
2
+ * small in a 24x24 box, 44x44 on a coarse pointer, its own ring), disabled, the dashed
3
3
  * "add" chip and the tones. */
4
4
  @layer components {
5
5
  /* Focus: the chip's ring (2px primary-text, 2px away); the ✕ its own. */
@@ -8,54 +8,41 @@
8
8
  outline-color: var(--primary-text);
9
9
  outline-width: 2px;
10
10
  }
11
+ /* The ✕ is drawn small (--chip-x), but its own box is the target (#1584):
12
+ * axe's `target-size` reads the bounding box, never a pseudo-element. The
13
+ * box is 24x24 (44x44 on a coarse pointer, #1067, #1102); the padding with
14
+ * `background-clip: content-box` keeps the hover disc and the focus ring at
15
+ * the drawn size, and the negative margin takes the extra back, so the chip
16
+ * and the glyph are unchanged. */
11
17
  .nxgt-chip > [data-slot="chip-dismiss"] {
18
+ --chip-hit: 24px;
19
+ --chip-pad: calc((var(--chip-hit) - var(--chip-x)) / 2);
12
20
  position: relative;
13
21
  display: inline-grid;
14
22
  place-items: center;
15
23
  flex: none;
16
- width: var(--chip-x);
17
- height: var(--chip-x);
18
- padding: 0;
24
+ box-sizing: border-box;
25
+ width: var(--chip-hit);
26
+ height: var(--chip-hit);
27
+ margin: calc(-1 * var(--chip-pad));
28
+ padding: var(--chip-pad);
19
29
  border: 0;
20
30
  border-radius: 9999px;
21
31
  background: transparent;
32
+ background-clip: content-box;
22
33
  color: color-mix(in oklab, var(--foreground) 62%, transparent);
23
34
  cursor: pointer;
24
35
  /* Width 0 at rest: forced colours would paint a transparent outline. */
25
36
  outline: 0 solid transparent;
26
- outline-offset: 1px;
37
+ outline-offset: calc(1px - var(--chip-pad));
27
38
  transition:
28
39
  background-color 120ms ease-out,
29
40
  color 120ms ease-out,
30
41
  outline-color 120ms ease-out;
31
42
  }
32
- .nxgt-chip > [data-slot="chip-dismiss"]::after {
33
- content: "";
34
- position: absolute;
35
- inset: calc((var(--chip-x) - 24px) / 2);
36
- border-radius: 9999px;
37
- }
38
- /* Touch (#1067, #1102): on a coarse pointer the ✕ is a real 44x44 box,
39
- * not a pseudo-element, which a tap-target check and axe do not measure.
40
- * The negative margin takes the extra back, so the chip is unchanged, and
41
- * the padding with `background-clip: content-box` keeps the hover disc
42
- * and the focus ring at the drawn size (the outline is pulled in by the
43
- * padding). */
44
43
  @media (pointer: coarse) {
45
44
  .nxgt-chip > [data-slot="chip-dismiss"] {
46
- --chip-pad: calc((44px - var(--chip-x)) / 2);
47
- box-sizing: border-box;
48
- width: 44px;
49
- height: 44px;
50
- margin: calc(-1 * var(--chip-pad));
51
- padding: var(--chip-pad);
52
- background-clip: content-box;
53
- outline-offset: calc(1px - var(--chip-pad));
54
- }
55
- /* The box is the target now: the 24px pseudo-element would reach
56
- * past it. */
57
- .nxgt-chip > [data-slot="chip-dismiss"]::after {
58
- inset: 0;
45
+ --chip-hit: 44px;
59
46
  }
60
47
  }
61
48
  .nxgt-chip > [data-slot="chip-dismiss"] > svg {