ngwr 12.1.0 → 12.2.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.
@@ -1,5 +1,13 @@
1
1
  @use '../../theme/styles' as theme;
2
2
 
3
+ // The label's own line box, and the header button's block padding. Both are
4
+ // declared once below and read back by the alignment arithmetic — the indicator
5
+ // centres on the label's FIRST LINE, and the connector centres on the indicator,
6
+ // so a literal repeated in three places is a defect waiting for someone to
7
+ // change one of them.
8
+ $label-line-height: 1.25rem;
9
+ $header-padding-block: 0.25rem;
10
+
3
11
  .wr-stepper {
4
12
  --wr-stepper-indicator-size: 1.75rem;
5
13
  --wr-stepper-connector: var(--wr-color-outline);
@@ -33,9 +41,19 @@
33
41
  flex-direction: column;
34
42
  }
35
43
 
44
+ // `flex-start`, not `center`: a step that carries a hint line
45
+ // (`description` / `optional`) is TALLER than its neighbours, and centring
46
+ // every button in the row it defines drops the short steps' circles by half
47
+ // the difference — the whole row reads as misaligned because of one step.
48
+ // Anchored at the block start, every button's first line sits at the same y,
49
+ // and the connector places itself against the indicator (see `&__connector`)
50
+ // instead of riding the row's centre.
51
+ //
52
+ // A row of same-height steps is unaffected: with equal heights `center` and
53
+ // `flex-start` resolve identically.
36
54
  &__header {
37
55
  display: flex;
38
- align-items: center;
56
+ align-items: flex-start;
39
57
  flex: 1 1 auto;
40
58
  gap: 0.75rem;
41
59
  min-width: 0;
@@ -59,13 +77,20 @@
59
77
  flex: 0 0 auto;
60
78
  }
61
79
 
80
+ // `flex-start` here for the same reason, one level in: the indicator is a
81
+ // fixed-size circle and the label is a column that grows a line whenever the
82
+ // step has a `description` or is `optional`. Centred against the whole block,
83
+ // the circle slides down as the label grows and stops belonging to the step's
84
+ // NAME. The label carries the compensating offset (see `&__label`) rather
85
+ // than the indicator carrying a negative one, so the circle stays inside the
86
+ // button's own box.
62
87
  &__header-button {
63
88
  appearance: none;
64
89
  background: transparent;
65
90
  border: 0;
66
- padding: 0.25rem 0;
91
+ padding: $header-padding-block 0;
67
92
  display: inline-flex;
68
- align-items: center;
93
+ align-items: flex-start;
69
94
  gap: 0.625rem;
70
95
  color: var(--wr-color-on-surface);
71
96
  cursor: pointer;
@@ -119,7 +144,15 @@
119
144
  gap: 0.0625rem;
120
145
  font-size: var(--wr-text-sm);
121
146
  font-weight: 500;
122
- line-height: 1.25rem;
147
+ line-height: $label-line-height;
148
+ // Centre the label's FIRST LINE on the indicator, now that both are anchored
149
+ // to the button's block start. Half the difference between the circle and one
150
+ // line box — derived, not typed, because `--wr-stepper-indicator-size` is a
151
+ // public custom property a consumer can retune. At the shipped 1.75rem this
152
+ // is 0.25rem, which is exactly where `align-items: center` used to put a
153
+ // single-line label: the one-line step renders pixel-for-pixel as before and
154
+ // only the multi-line one moves.
155
+ margin-block-start: calc((var(--wr-stepper-indicator-size) - #{$label-line-height}) / 2);
123
156
  }
124
157
 
125
158
  &__header--active &__label {
@@ -145,7 +178,13 @@
145
178
  height: 1.5px;
146
179
  background: var(--wr-stepper-connector);
147
180
  min-width: 1rem;
148
- margin: 0 0.5rem;
181
+ // The row aligns its children to the block start now, so the line has to
182
+ // place itself on the indicator's centre instead of inheriting the row's.
183
+ // Button padding, plus half a circle, less half the line's own thickness.
184
+ // Same y the centred version produced for a row of equal-height steps — and
185
+ // unlike it, the same y when one step grows a hint line.
186
+ margin-block-start: calc(#{$header-padding-block} + var(--wr-stepper-indicator-size) / 2 - 0.75px);
187
+ margin-inline: 0.5rem;
149
188
  }
150
189
 
151
190
  &--vertical &__connector {
@@ -43,6 +43,16 @@
43
43
  /// }
44
44
  /// ```
45
45
  ///
46
+ /// The reset has to sit on the element the mixin ran on. `corner-shape`
47
+ /// does not inherit, so a component whose modifier is on the HOST while
48
+ /// `smooth-br` is on a child needs to target that child — otherwise the
49
+ /// declaration lands on an element that never had a squircle to undo,
50
+ /// and, since `round` is the property's initial value, changes nothing
51
+ /// at all. `wr-select` shipped that way: `.wr-select--rounded` set it on
52
+ /// the host, the trigger kept `squircle` at the pill radius, and the
53
+ /// control painted a near-rectangle — 2px of corner where a stadium
54
+ /// wants 18.
55
+ ///
46
56
  /// @example scss
47
57
  /// .thing {
48
58
  /// @include smooth-br(0.625rem);
@@ -270,7 +270,10 @@
270
270
  // Roomier on the label side, tighter where the remove (×) sits.
271
271
  padding-block: 0.125rem;
272
272
  padding-inline: 0.5rem 0.25rem;
273
- border-radius: 999px;
273
+ // Not a pill: a chip is a shape nested INSIDE the trigger, so it repeats the
274
+ // trigger's own corner instead of deciding one for itself — and an override
275
+ // of `--wr-tree-trigger-radius` carries the chips with it.
276
+ border-radius: var(--wr-tree-trigger-radius);
274
277
  background: var(--wr-color-primary-soft);
275
278
  // The chip wraps a label, so this paints text on the chip's own tint.
276
279
  color: var(--wr-color-primary-ink);
@@ -292,7 +295,12 @@
292
295
  justify-content: center;
293
296
  width: 1rem;
294
297
  height: 1rem;
295
- border-radius: 999px;
298
+ // Concentric with the chip: inset from the chip's edge by its 2px block
299
+ // padding, and an inner corner only nests cleanly when it is the outer
300
+ // corner minus that inset. `max()` keeps the value legal for a consumer who
301
+ // sets `--wr-tree-trigger-radius: 0` — a negative radius invalidates the
302
+ // whole declaration.
303
+ border-radius: max(0px, calc(var(--wr-tree-trigger-radius) - 2px));
296
304
  cursor: pointer;
297
305
  transition: background 0.12s ease;
298
306
 
@@ -444,8 +444,18 @@ declare class WrSelect implements FormValueControl<unknown>, WrSelectContext {
444
444
  /** Tag-mode draft (text currently typed in the inline input). @internal */
445
445
  protected readonly draft: _angular_core.WritableSignal<string>;
446
446
  /**
447
- * Show a clear-all (×) button at the end of the chip row when at
448
- * least one option is selected (multi mode only). @default true
447
+ * Show a clear (×) button once at least one option is selected.
448
+ *
449
+ * NOT multi-only, which this said for a long time and which the template
450
+ * refutes: only the button trigger gates on `isMulti()`, so the chips trigger
451
+ * AND a single `mode="search"` / `[searchable]` select carry it too. The
452
+ * wording mattered little while the default was `true`; it decides what a
453
+ * reader expects to lose now that it is not.
454
+ *
455
+ * The default changed from `true` to `false`: the affordance is opt-in, so a
456
+ * trigger that grew an × on its own no longer does — pass `clearable` to keep
457
+ * it. In `search` mode this also gates Backspace-to-clear on an empty field,
458
+ * since that key is the keyboard twin of this button. @default false
449
459
  */
450
460
  readonly clearable: _angular_core.InputSignalWithTransform<boolean, any>;
451
461
  /**
@@ -16,7 +16,7 @@ import { InjectionToken } from '@angular/core';
16
16
  * Distinct from `Version` exported by `@angular/core`, which reports the
17
17
  * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.
18
18
  */
19
- declare const NGWR_VERSION = "12.1.0";
19
+ declare const NGWR_VERSION = "12.2.0";
20
20
 
21
21
  /**
22
22
  * @license