@dereekb/dbx-web 13.20.0 → 13.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.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-web/eslint",
3
- "version": "13.20.0",
3
+ "version": "13.21.0",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.20.0",
5
+ "@dereekb/util": "13.21.0",
6
6
  "@typescript-eslint/utils": "8.59.3"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@angular/core": "21.2.11",
10
- "@dereekb/dbx-core": "13.20.0",
11
- "@dereekb/rxjs": "13.20.0",
10
+ "@dereekb/dbx-core": "13.21.0",
11
+ "@dereekb/rxjs": "13.21.0",
12
12
  "@typescript-eslint/parser": "8.59.3",
13
13
  "eslint": "10.4.0",
14
14
  "rxjs": "^7.8.2"
@@ -31,6 +31,14 @@ $list-item-padded-min-height: 42px;
31
31
  --dbx-list-item-selected-color: var(--mat-sys-primary-container);
32
32
  --dbx-list-item-selected-on-color: var(--mat-sys-on-primary-container);
33
33
 
34
+ // Active route (nav/value list `dbx-anchor-active`) row tone. A `dbx-anchor` row marks the active
35
+ // route with its own `dbx-anchor-active` class rather than Material's `.mdc-list-item--activated`, so
36
+ // it carries its own tone token here. Defaults to the selected/activated tone above (so an active
37
+ // route reads the same as a selected row out of the box), but can be retargeted independently — e.g.
38
+ // set `--dbx-list-item-active-color` on the list host — to give active routes a distinct color.
39
+ --dbx-list-item-active-color: var(--dbx-list-item-selected-color);
40
+ --dbx-list-item-active-on-color: var(--dbx-list-item-selected-on-color);
41
+
34
42
  // Rows are square by default; their corners round per-position / per-state below.
35
43
  --mat-list-active-indicator-shape: 0;
36
44
  --mat-list-list-item-container-shape: 0;
@@ -98,14 +106,22 @@ $list-item-padded-min-height: 42px;
98
106
  --mat-list-list-item-container-shape: var(--dbx-list-item-radius-resolved);
99
107
  }
100
108
 
101
- // Any hovered / focused / selected / activated row rounds all four corners (wins over the
102
- // per-position rules above via source order at equal specificity, and the :hover/--selected
103
- // selectors out-specify the bare position rules).
104
- .dbx-list-view .mat-mdc-list-item:hover,
105
- .dbx-list-view .mat-mdc-list-item:focus,
106
- .dbx-list-view .mat-mdc-list-item.mdc-list-item--selected,
107
- .dbx-list-view .mat-mdc-list-item.mdc-list-item--activated,
108
- .dbx-list-view .mat-mdc-list-item[aria-selected='true'] {
109
+ // Any hovered / focused / selected / activated / active-route row rounds all four corners. These must
110
+ // out-specify the per-position first/last/only rules above and the value-list ones
111
+ // (`.dbx-list-view-group-content > dbx-anchor:first-of-type .dbx-list-view-item`) carry an element +
112
+ // pseudo-class, landing at (0,3,1). A bare `.dbx-list-view .mat-mdc-list-item` state selector is only
113
+ // (0,3,0), so it would LOSE and leave the outer corner square — e.g. the active first row keeping a
114
+ // square bottom. Qualifying each row with `.dbx-list-view-item` raises these to (0,4,0) so the
115
+ // all-corners shape wins (every `.dbx-list-view` row — value-list `<a mat-list-item>` and selection
116
+ // `<mat-list-option>` alike — carries that class). `.dbx-anchor-active` covers nav/value-list rows
117
+ // whose active route is signaled by `dbx-anchor` — it never adds Material's `.mdc-list-item--activated`,
118
+ // so without this the active (un-hovered) row would otherwise fall back to the square per-position shape.
119
+ .dbx-list-view .dbx-list-view-item.mat-mdc-list-item:hover,
120
+ .dbx-list-view .dbx-list-view-item.mat-mdc-list-item:focus,
121
+ .dbx-list-view .dbx-anchor-active .dbx-list-view-item.mat-mdc-list-item,
122
+ .dbx-list-view .dbx-list-view-item.mat-mdc-list-item.mdc-list-item--selected,
123
+ .dbx-list-view .dbx-list-view-item.mat-mdc-list-item.mdc-list-item--activated,
124
+ .dbx-list-view .dbx-list-view-item.mat-mdc-list-item[aria-selected='true'] {
109
125
  --mat-list-list-item-container-shape: var(--dbx-list-item-radius-resolved);
110
126
  }
111
127
 
@@ -125,6 +141,12 @@ $list-item-padded-min-height: 42px;
125
141
  --mat-list-list-item-container-color: var(--dbx-list-item-selected-color);
126
142
  color: var(--dbx-list-item-selected-on-color);
127
143
  }
144
+
145
+ // Active-route row tone (a `dbx-anchor` row whose route is active) is painted in `_anchorlist.scss`,
146
+ // which targets both `.dbx-anchor-list` and `.dbx-list-view` nav lists via the
147
+ // `--dbx-anchor-list-item-active-color` token. That token defaults to `--dbx-list-item-active-color`
148
+ // (defined above), so a value list's active route matches its selected tone out of the box; the
149
+ // sidenav overrides the token for its accent treatment. Only the corner shape is handled here (above).
128
150
  }
129
151
 
130
152
  // dbx-anchor-list (nav) rows default to an M3 medium corner via their OWN
@@ -140,13 +162,18 @@ $list-item-padded-min-height: 42px;
140
162
  }
141
163
  }
142
164
 
143
- // The sidenav anchor list rows sit flush against the left screen edge, so only the RIGHT corners round —
144
- // the radius is composed into a `0 r r 0` shorthand (top-left / top-right / bottom-right / bottom-left),
165
+ // Sidenav anchor-list rows sit flush against the left drawer edge, so only the RIGHT corners round — the
166
+ // radius is composed into a `0 r r 0` shorthand (top-left / top-right / bottom-right / bottom-left),
145
167
  // leaving the left corners square. The "how round" radius defaults to the regular anchor-list radius
146
168
  // (`--dbx-anchor-list-item-border-radius`) so the sidenav tracks the `anchor-list-corner-*` lever by default,
147
- // but `--dbx-sidenav-anchor-list-item-border-radius` overrides it for sidenav-specific tuning. Higher
148
- // specificity than `.dbx-anchor-list`, so it wins for the inner nav-list inside a sidenav host.
149
- .dbx-sidenav-anchor-list .dbx-anchor-list {
169
+ // but `--dbx-sidenav-anchor-list-item-border-radius` overrides it for sidenav-specific tuning.
170
+ //
171
+ // Scoped to EVERY anchor list inside a sidenav drawer (`.dbx-sidenav .mat-drawer .dbx-anchor-list`), not
172
+ // just the `[anchors]` list (`.dbx-sidenav-anchor-list`): a separate `<dbx-anchor-list>` dropped into a
173
+ // `[top]` / `[bottom]` content slot must round the same way, otherwise it falls back to the generic
174
+ // all-corners `.dbx-anchor-list` radius and reads as floating full-radius pills beside the flush main
175
+ // rows. Higher specificity than `.dbx-anchor-list`, so it wins for any inner nav-list inside a sidenav.
176
+ .dbx-sidenav .mat-drawer .dbx-anchor-list {
150
177
  --mat-list-active-indicator-shape: 0 var(--dbx-sidenav-anchor-list-item-border-radius, var(--dbx-anchor-list-item-border-radius, var(--mat-sys-corner-medium, 12px))) var(--dbx-sidenav-anchor-list-item-border-radius, var(--dbx-anchor-list-item-border-radius, var(--mat-sys-corner-medium, 12px))) 0;
151
178
  --mat-list-list-item-container-shape: 0 var(--dbx-sidenav-anchor-list-item-border-radius, var(--dbx-anchor-list-item-border-radius, var(--mat-sys-corner-medium, 12px))) var(--dbx-sidenav-anchor-list-item-border-radius, var(--dbx-anchor-list-item-border-radius, var(--mat-sys-corner-medium, 12px))) 0;
152
179
  }
@@ -463,8 +490,48 @@ $list-item-padded-min-height: 42px;
463
490
  position: unset; // do not touch the divider in dbx-list
464
491
  }
465
492
 
493
+ // Accordion list view renders as a card with a rounded TOP. The rounded frame lives on the scroll
494
+ // VIEWPORT (`.dbx-list-content`) so it clips the scrolling content — including panels that scroll BEHIND a
495
+ // sticky group header — which stops them bleeding through the rounded corner. (A rounded ancestor can't
496
+ // clip a composited `position: sticky` element in Chrome, so each group header additionally rounds its OWN
497
+ // top corners below.) Only the top corners are rounded — the bottom stays square so the last panel's
498
+ // elevation shadow isn't clipped by a rounded bottom edge. Scoped with `:has()` so only accordion lists
499
+ // get framed.
500
+ .dbx-list-content:has(.dbx-list-accordion-view) {
501
+ border-top-left-radius: var(--dbx-list-accordion-view-border-radius, var(--mat-sys-corner-medium, 12px));
502
+ border-top-right-radius: var(--dbx-list-accordion-view-border-radius, var(--mat-sys-corner-medium, 12px));
503
+ }
504
+
466
505
  .dbx-list-accordion-view {
506
+ // Breathing-room margin (`--dbx-list-accordion-view-margin`, default `--dbx-padding-1` / 2px) so the
507
+ // card sits inset from its container and its walls stay visible — flush against the container the card's
508
+ // edges read as cut off. `padding-bottom` leaves room below the last panel so its elevation shadow shows
509
+ // instead of being clipped at the scroll edge.
510
+ display: block;
511
+ margin: var(--dbx-list-accordion-view-margin, var(--dbx-padding-1));
512
+ padding-bottom: var(--dbx-list-accordion-view-bottom-space, var(--dbx-padding-2));
513
+ --dbx-list-accordion-view-radius-resolved: var(--dbx-list-accordion-view-border-radius, var(--mat-sys-corner-medium, 12px));
467
514
  --mat-expansion-container-shape: 0px;
515
+
516
+ // Round the top corners of the first entry (the very top of the card) AND of every group header. Group
517
+ // headers are sticky — when one pins at the rounded top corner, the scroll frame's clip would otherwise
518
+ // shave that header's square corner (and its border) flat, so each header rounds its OWN top corners to
519
+ // follow the curve. `overflow: hidden` clips the header's content/border to those corners.
520
+ mat-accordion > :first-child,
521
+ .dbx-list-view-group-header {
522
+ border-top-left-radius: var(--dbx-list-accordion-view-radius-resolved);
523
+ border-top-right-radius: var(--dbx-list-accordion-view-radius-resolved);
524
+ overflow: hidden;
525
+ }
526
+
527
+ // Box every group header with the same hairline the two-column view uses (`1px solid
528
+ // var(--dbx-divider-color)`) rather than the heavier/darker `--mat-divider-*`; the shorthand overrides
529
+ // the bottom divider on the base `.dbx-list-view-group-header` rule so all four sides match. The `-1px`
530
+ // margin pulls the header out so its border overlaps the adjacent panel edges (no doubled hairline / gap).
531
+ .dbx-list-view-group-header {
532
+ margin: -1px;
533
+ border: 1px solid var(--dbx-divider-color);
534
+ }
468
535
  }
469
536
 
470
537
  .dbx-list-view-group-header {
@@ -56,6 +56,16 @@ $default-mdc-list-list-item-leading-icon-size: 24px;
56
56
  .dbx-list-view .mat-mdc-nav-list {
57
57
  --mat-divider-color: color-mix(in srgb, var(--mat-sys-outline-variant) 15%, transparent);
58
58
 
59
+ // Active/selected route rows default to the shared dbx list tone so anchor lists match value lists
60
+ // out of the box, instead of a bare on-surface overlay. A standalone `.dbx-anchor-list` isn't
61
+ // necessarily inside a `.dbx-list`, so fall back to the M3 container tones directly when the
62
+ // `--dbx-list-item-*-color` knobs aren't inherited. Override the `--dbx-anchor-list-item-*` tokens to
63
+ // give a list its own active/selected treatment (the sidenav does, for its accent tint + border).
64
+ --dbx-anchor-list-item-selected-color: var(--dbx-list-item-selected-color, var(--mat-sys-primary-container));
65
+ --dbx-anchor-list-item-selected-on-color: var(--dbx-list-item-selected-on-color, var(--mat-sys-on-primary-container));
66
+ --dbx-anchor-list-item-active-color: var(--dbx-list-item-active-color, var(--dbx-anchor-list-item-selected-color));
67
+ --dbx-anchor-list-item-active-on-color: var(--dbx-list-item-active-on-color, var(--dbx-anchor-list-item-selected-on-color));
68
+
59
69
  // MARK: Muting
60
70
  // items that are not active are muted
61
71
  .mat-mdc-list-item {
@@ -77,11 +87,32 @@ $default-mdc-list-list-item-leading-icon-size: 24px;
77
87
  }
78
88
  }
79
89
 
90
+ // MARK: Anchor Tree
91
+ // Nested child rows get a subtle depth-shading background. This is the BASE tone for a child row, so
92
+ // it is declared BEFORE the selected / active-route rules below: those match the same row at equal
93
+ // specificity (0,4,0), so source order decides — keeping this first lets an active or selected child
94
+ // row layer its own tone on top instead of being masked by the depth shading (which left an active
95
+ // child reading as un-selected: grey background, only the text recolored).
96
+ //
97
+ // The tone is an override point: set `--dbx-anchor-list-item-child-background` (e.g. to `transparent`)
98
+ // to flatten the depth-shade so nested children read like top-level root rows. Because the
99
+ // active/selected rules below win by source order, overriding the token never clears an active child's
100
+ // accent — only the inactive depth-shade. The `.dbx-sidenav-flat` modifier uses this.
101
+
102
+ /// Background tone applied to nested (depth > 0) anchor-list child rows to set them apart from
103
+ /// top-level root rows. Override to `transparent` to flatten the nesting depth-shade.
104
+ /// @role color
105
+ /// @intent nested child row background, anchor list depth shade, flatten nested rows
106
+ .dbx-anchor-list-child .mat-mdc-list-item {
107
+ background: var(--dbx-anchor-list-item-child-background, color-mix(in srgb, var(--mat-sys-on-surface) 14%, transparent));
108
+ }
109
+
80
110
  // selected
81
111
  .dbx-anchor-selected {
82
112
  .mat-mdc-list-item {
83
113
  opacity: #{$anchor-list-item-active-opacity};
84
- background: color-mix(in srgb, var(--mat-sys-on-surface) 8%, transparent);
114
+ background: var(--dbx-anchor-list-item-selected-color);
115
+ color: var(--dbx-anchor-list-item-selected-on-color);
85
116
  }
86
117
  }
87
118
 
@@ -89,14 +120,10 @@ $default-mdc-list-list-item-leading-icon-size: 24px;
89
120
  .dbx-anchor-active-eq {
90
121
  .mat-mdc-list-item {
91
122
  opacity: #{$anchor-list-item-active-opacity};
92
- background: color-mix(in srgb, var(--mat-sys-on-surface) 14%, transparent);
123
+ background: var(--dbx-anchor-list-item-active-color);
124
+ color: var(--dbx-anchor-list-item-active-on-color);
93
125
  }
94
126
  }
95
-
96
- // MARK: Anchor Tree
97
- .dbx-anchor-list-child .mat-mdc-list-item {
98
- background: color-mix(in srgb, var(--mat-sys-on-surface) 14%, transparent);
99
- }
100
127
  }
101
128
  }
102
129
 
@@ -24,6 +24,17 @@ $active-background-transparent-color: 0.93;
24
24
  border-top-right-radius: var(--dbx-sidenav-top-corner-radius, var(--mat-sys-corner-extra-large, 24px));
25
25
  border-bottom-right-radius: var(--dbx-sidenav-bottom-corner-radius, var(--mat-sys-corner-extra-large, 24px));
26
26
 
27
+ // Uniform nav items (default). A sidenav is typically assembled from differently-created nav
28
+ // elements — top-level root anchors and nested child anchors in the `[anchors]` tree, plus separate
29
+ // `<dbx-anchor-list>` lists dropped into the `[top]` / `[bottom]` content slots. Left to the generic
30
+ // anchor-list styling these would NOT match up (a separate list rounds all four corners as floating
31
+ // pills, and nested child rows carry a depth-shade). The sidenav normalizes them so every element
32
+ // reads as one consistent nav: nested children drop the depth-shade here (the active/selected rules
33
+ // override this token by source order, so the active route still keeps its accent), the right-only
34
+ // flush-left corner shape is applied to all drawer anchor lists in `_list.scss`, and child content is
35
+ // aligned with root rows below. Apps can restore the depth-shade per list via the token if desired.
36
+ --dbx-anchor-list-item-child-background: transparent;
37
+
27
38
  .mat-drawer-inner-container {
28
39
  display: flex;
29
40
  flex-direction: column;
@@ -40,6 +51,12 @@ $active-background-transparent-color: 0.93;
40
51
  }
41
52
  }
42
53
 
54
+ // Align nested child content with root rows (cancel the small left nudge `_anchorlist.scss` adds
55
+ // to child rows) so a nested child reads like a top-level root item.
56
+ .dbx-anchor-list-child .mat-mdc-list-item .mdc-list-item__content {
57
+ padding-left: 0;
58
+ }
59
+
43
60
  // directly active links have a side border indicator
44
61
  .dbx-anchor-active-eq,
45
62
  .dbx-anchor-list-child .dbx-anchor-active {
@@ -165,6 +182,17 @@ $active-background-transparent-color: 0.93;
165
182
  .dbx-anchor-list.mat-mdc-nav-list {
166
183
  --dbx-sidenav-active-accent: color-mix(in srgb, var(--dbx-accent-color) 65%, var(--mat-sys-surface));
167
184
 
185
+ // The sidenav opts out of the default solid list tone (which anchor lists now inherit from
186
+ // `--dbx-list-item-active-color`) in favor of its subtle accent overlay + side-border treatment.
187
+ // Define the anchor-list active/selected override tokens here so the base `_anchorlist.scss` rows
188
+ // pick up the accent tint, and pin the on-color to the drawer text color so the active label is
189
+ // not recolored to the list's on-primary-container tone. The explicit root/child background +
190
+ // border rules below still apply on top (they distinguish root vs child and add the indicator).
191
+ --dbx-anchor-list-item-active-color: var(--dbx-sidenav-active-item-background, color-mix(in srgb, var(--dbx-sidenav-active-accent) 12%, transparent));
192
+ --dbx-anchor-list-item-active-on-color: var(--dbx-sidenav-text-color, var(--dbx-color-current, var(--mat-sys-on-surface)));
193
+ --dbx-anchor-list-item-selected-color: var(--dbx-anchor-list-item-active-color);
194
+ --dbx-anchor-list-item-selected-on-color: var(--dbx-anchor-list-item-active-on-color);
195
+
168
196
  .dbx-anchor-active {
169
197
  .mat-mdc-list-item {
170
198
  .mat-mdc-list-item-icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-web",
3
- "version": "13.20.0",
3
+ "version": "13.21.0",
4
4
  "sideEffects": [
5
5
  "*.scss",
6
6
  "*.css"
@@ -13,12 +13,12 @@
13
13
  "@angular/material": "^21.2.9",
14
14
  "@angular/platform-browser": "21.2.11",
15
15
  "@cantoo/pdf-lib": "^2.6.5",
16
- "@dereekb/browser": "13.20.0",
17
- "@dereekb/date": "13.20.0",
18
- "@dereekb/dbx-core": "13.20.0",
19
- "@dereekb/rxjs": "13.20.0",
20
- "@dereekb/util": "13.20.0",
21
- "@dereekb/vitest": "13.20.0",
16
+ "@dereekb/browser": "13.21.0",
17
+ "@dereekb/date": "13.21.0",
18
+ "@dereekb/dbx-core": "13.21.0",
19
+ "@dereekb/rxjs": "13.21.0",
20
+ "@dereekb/util": "13.21.0",
21
+ "@dereekb/vitest": "13.21.0",
22
22
  "@ngbracket/ngx-layout": "^21.0.0",
23
23
  "@ngrx/component-store": "^21.1.0",
24
24
  "@ngrx/effects": "^21.1.0",