@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9

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.
Files changed (69) hide show
  1. package/card/README.md +2 -1
  2. package/command/README.md +29 -0
  3. package/data/README.md +15 -3
  4. package/dialog/README.md +23 -1
  5. package/fesm2022/cngx-common-a11y.mjs +517 -184
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +62 -17
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-card.mjs +301 -46
  10. package/fesm2022/cngx-common-card.mjs.map +1 -1
  11. package/fesm2022/cngx-common-chart.mjs +1221 -479
  12. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  13. package/fesm2022/cngx-common-command.mjs +97 -16
  14. package/fesm2022/cngx-common-command.mjs.map +1 -1
  15. package/fesm2022/cngx-common-data.mjs +1496 -499
  16. package/fesm2022/cngx-common-data.mjs.map +1 -1
  17. package/fesm2022/cngx-common-dialog.mjs +236 -61
  18. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  19. package/fesm2022/cngx-common-display.mjs +364 -93
  20. package/fesm2022/cngx-common-display.mjs.map +1 -1
  21. package/fesm2022/cngx-common-interactive.mjs +2040 -1046
  22. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  23. package/fesm2022/cngx-common-layout.mjs +955 -125
  24. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  25. package/fesm2022/cngx-common-popover.mjs +1293 -89
  26. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  27. package/fesm2022/cngx-common-stepper.mjs +997 -453
  28. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  29. package/fesm2022/cngx-common-tabs.mjs +1794 -1265
  30. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  31. package/fesm2022/cngx-common-timeline.mjs +151 -61
  32. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  33. package/fesm2022/cngx-common.mjs +1 -1
  34. package/interactive/README.md +15 -4
  35. package/layout/README.md +37 -1
  36. package/package.json +20 -7
  37. package/popover/README.md +58 -2
  38. package/schematics/collection.json +9 -0
  39. package/schematics/ng-add/index.js +9 -0
  40. package/schematics/ng-add/schema.json +91 -0
  41. package/schematics/package.json +3 -0
  42. package/stepper/README.md +11 -8
  43. package/theming/components/cngx-accordion.css +1 -1
  44. package/theming/components/cngx-backdrop.css +12 -0
  45. package/theming/components/cngx-button-toggle.css +29 -3
  46. package/theming/components/cngx-data-grid.css +168 -1
  47. package/theming/components/cngx-dialog.css +13 -0
  48. package/theming/components/cngx-listbox.css +21 -12
  49. package/theming/components/cngx-menu.css +56 -16
  50. package/theming/components/cngx-popover-sheet.css +402 -0
  51. package/theming/components/cngx-popover.css +28 -0
  52. package/theming/components/cngx-recycler-placeholder.css +196 -0
  53. package/theming/components/cngx-ripple.css +1 -1
  54. package/theming/components/cngx-slider.css +32 -1
  55. package/theming/components/cngx-tooltip.css +12 -0
  56. package/timeline/README.md +155 -0
  57. package/types/cngx-common-a11y.d.ts +205 -28
  58. package/types/cngx-common-card.d.ts +201 -17
  59. package/types/cngx-common-chart.d.ts +345 -48
  60. package/types/cngx-common-command.d.ts +50 -10
  61. package/types/cngx-common-data.d.ts +743 -92
  62. package/types/cngx-common-dialog.d.ts +161 -10
  63. package/types/cngx-common-display.d.ts +356 -142
  64. package/types/cngx-common-interactive.d.ts +910 -226
  65. package/types/cngx-common-layout.d.ts +603 -32
  66. package/types/cngx-common-popover.d.ts +612 -49
  67. package/types/cngx-common-stepper.d.ts +526 -237
  68. package/types/cngx-common-tabs.d.ts +358 -75
  69. package/types/cngx-common-timeline.d.ts +108 -22
package/popover/README.md CHANGED
@@ -12,6 +12,7 @@ Signal-driven popover, tooltip, and popover panel components built on the native
12
12
  - WCAG 1.4.13 compliant tooltips (dismissable, hoverable, persistent)
13
13
  - Material theme SCSS with M3 tokens
14
14
  - Exclusive mode (one popover at a time by default)
15
+ - Dismissal defaults: `mode` is `'manual'` (you control open/close; `'auto'` enables native light-dismiss), `[closeOnEscape]` is `true`, and `[closeOnOutsideClick]` (outside-pointer dismiss) is `false` - opt in when you want click-away to close
15
16
 
16
17
  ## Quick Start
17
18
 
@@ -45,6 +46,19 @@ import {
45
46
  </div>
46
47
  ```
47
48
 
49
+ ### Anchoring to another element
50
+
51
+ When the focusable trigger is not the visible box the panel should hang under (an input inside a bordered field row), put `[cngxPopoverAnchor]` on the box. The trigger keeps `aria-expanded`, `aria-controls` and `aria-haspopup` but yields its `anchor-name`; CSS Anchor Positioning and the Floating UI fallback both measure the anchor.
52
+
53
+ ```html
54
+ <div class="field" [cngxPopoverAnchor]="pop">
55
+ <input [cngxPopoverTrigger]="pop" (focus)="pop.show()" aria-label="City" />
56
+ </div>
57
+ <div cngxPopover #pop="cngxPopover" placement="bottom-start">...</div>
58
+ ```
59
+
60
+ The explicit anchor wins over the trigger. When the anchor unmounts, the trigger becomes the anchor again. Pointerdowns on the trigger still count as inside for `[closeOnOutsideClick]`.
61
+
48
62
  ### Controlled Popover
49
63
 
50
64
  ```html
@@ -123,6 +137,46 @@ import { CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive
123
137
  </cngx-popover-panel>
124
138
  ```
125
139
 
140
+ ## Mobile sheet
141
+
142
+ Add `cngxPopoverSheet` to a `[cngxPopover]` and the popover opens as a modal bottom sheet on coarse, narrow screens (`(pointer: coarse) and (max-width: 48rem)`, written once in `cngx-popover-sheet.css`) and stays anchored everywhere else.
143
+
144
+ ```html
145
+ <button type="button" [cngxPopoverTrigger]="pop" (click)="pop.show()">Choose city</button>
146
+ <div cngxPopover #pop="cngxPopover" cngxPopoverSheet #sheet="cngxPopoverSheet">
147
+ <header cngxPopoverSheetHeader cngxSwipeDismiss="down">
148
+ <span cngxPopoverSheetHandle></span>
149
+ <h2 cngxPopoverSheetTitle>City</h2>
150
+ <cngx-close-button label="Close" (click)="sheet.requestClose('close')" />
151
+ </header>
152
+ <ul>...</ul>
153
+ </div>
154
+ ```
155
+
156
+ | Input / output | Purpose |
157
+ |-|-|
158
+ | `[cngxPopoverSheet]` | `'auto'` (default) follows the breakpoint; `'anchored'`, `'sheet'`, `'fullscreen'` force a presentation |
159
+ | `[autoPresentation]` | What `'auto'` resolves to on a phone: `'sheet'` (content-sized, default) or `'fullscreen'` (for panels led by a text input) |
160
+ | `[labelledBy]` | Id that names the dialog; wins over `cngxPopoverSheetTitle` |
161
+ | `[closeOnRequest]` | `false` turns close requests into notifications only |
162
+ | `[restoreFocus]` / `[restoreTarget]` | Focus return on close (default: the element focused before open) |
163
+ | `(closeRequested)` | `'swipe'`, `'backdrop'`, `'back'` or `'close'` |
164
+ | `(closing)` | Synchronous, inside `hide()`, with the page already live; move focus here when you restore it yourself |
165
+
166
+ **Parts.** `cngxPopoverSheetHeader` stays fixed while the rest of the panel scrolls; with `cngxSwipeDismiss="down"` a downward swipe requests a close. `cngxPopoverSheetTitle` names the dialog (put it on the heading, not on the header that also holds buttons). `cngxPopoverSheetHandle` is decorative and always `aria-hidden`; screen-reader users close through the close control because their swipes drive navigation. `cngxPopoverSheetInitialFocus` marks the element that receives focus on open; with several marks the first enabled one in document order wins, and `[cngxPopoverSheetInitialFocus]="false"` takes a mark out of the next open.
167
+
168
+ **Modality.** Sheet and fullscreen are both modal: `role="dialog"` + `aria-modal="true"`, a focus trap, `inert` on every page sibling (live regions stay live), and a pinned scroll lock (`createPinnedScrollLock`). VoiceOver and TalkBack both read content behind a top-layer popover by touch exploration, so `aria-modal` alone does not contain them; `inert` does.
169
+
170
+ **Focus.** Focus moves into the panel inside `show()`, in the same call stack as the tap that opened it, so a tap-opened fullscreen search keeps the iOS keyboard. A programmatic `open()` outside a user gesture moves focus but cannot raise the iOS keyboard. On close, the page is live again and focus is back on the opener before the close transition starts.
171
+
172
+ **Close vectors.** A swipe on the header, a tap outside the panel and the Android back gesture (through `CloseWatcher`) arrive as `closeRequested`. Escape closes through `[closeOnEscape]` on `CngxPopover`. The tap outside does not reach the element underneath it. If your own code also closes the popover on outside clicks, disable that path while the sheet is not anchored, so one tap has one close path. Under VoiceOver a double tap activates the element under the VoiceOver cursor, which stays inside the sheet, so a double tap on the dimmed area does not close it: give every sheet a close control.
173
+
174
+ **Announcements.** While the sheet is modal, announce through `sheet.announce(message, politeness)`. The message is spoken from a live region inside the panel; VoiceOver ignores body-level regions under `aria-modal` and reads them late, after the sheet closes. A message still pending when the sheet closes is handed to `CngxLiveAnnouncer`.
175
+
176
+ **Platform limits.** iOS Safari has no `CloseWatcher`: the edge back-swipe navigates back with the sheet open. For edge-to-edge landscape on notched iPhones, the app opts into `viewport-fit=cover` in its viewport meta tag; the sheet pads with the safe-area insets either way.
177
+
178
+ **Styling.** Tokens are `--cngx-popover-sheet-*` (block size, radius, padding, header gap, handle, surface, colour, shadow, backdrop, duration, easing), documented in `cngx-popover-sheet.css`; the Material bridge is `@cngx/themes/material/popover-sheet-theme`. The sheet rules live in the `cngx.components` layer, so unlayered app CSS on the popover host (padding, border, radius) wins over them; scope such rules to `:not([data-cngx-presentation='sheet'])`.
179
+
126
180
  ## Configuration
127
181
 
128
182
  ### Global Defaults
@@ -180,13 +234,15 @@ npm install @floating-ui/dom
180
234
  ```
181
235
 
182
236
  ```typescript
183
- import { computePosition, flip, offset, shift } from '@floating-ui/dom';
237
+ import { computePosition, flip, shift } from '@floating-ui/dom';
184
238
  import { provideFloatingFallback } from '@cngx/common/popover';
185
239
 
186
240
  providers: [
187
- provideFloatingFallback(computePosition, [offset(8), flip(), shift()]),
241
+ provideFloatingFallback(computePosition, [flip(), shift()]),
188
242
  ]
189
243
  ```
190
244
 
245
+ Leave `offset()` out: the popover prepends its own offset middleware from its `offset` input, so a second one doubles the gap.
246
+
191
247
  The library never imports `@floating-ui/dom` directly. When not provided, positioning falls back to browser defaults. Zero bundle impact for modern browsers.
192
248
 
@@ -0,0 +1,9 @@
1
+ {
2
+ "schematics": {
3
+ "ng-add": {
4
+ "description": "Adds the cngx libraries to an Angular application. Delegates to @cngx/core.",
5
+ "factory": "./ng-add/index#ngAdd",
6
+ "schema": "./ng-add/schema.json"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";var ce=Object.create;var y=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var ye=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),xe=(n,e)=>{for(var r in e)y(n,r,{get:e[r],enumerable:!0})},M=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fe(e))!me.call(n,o)&&o!==r&&y(n,o,{get:()=>e[o],enumerable:!(t=ue(e,o))||t.enumerable});return n};var be=(n,e,r)=>(r=n!=null?ce(ge(n)):{},M(e||!n||!n.__esModule?y(r,"default",{value:n,enumerable:!0}):r,n)),he=n=>M(y({},"__esModule",{value:!0}),n);var oe=ye((cn,B)=>{"use strict";var O=process||{},re=O.argv||[],C=O.env||{},Fe=!(C.NO_COLOR||re.includes("--no-color"))&&(!!C.FORCE_COLOR||re.includes("--color")||O.platform==="win32"||(O.stdout||{}).isTTY&&C.TERM!=="dumb"||!!C.CI),Be=(n,e,r=n)=>t=>{let o=""+t,i=o.indexOf(e,n.length);return~i?n+_e(o,e,r,i)+e:n+o+e},_e=(n,e,r,t)=>{let o="",i=0;do o+=n.substring(i,t)+r,i=t+e.length,t=n.indexOf(e,i);while(~t);return o+n.substring(i)},te=(n=Fe)=>{let e=n?Be:()=>String;return{isColorSupported:n,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};B.exports=te();B.exports.createColors=te});var Xe={};xe(Xe,{ngAdd:()=>I});module.exports=he(Xe);var R=require("@schematics/angular/utility");var U=require("@angular-devkit/schematics"),H=require("@schematics/angular/utility");function P(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function V(n){return n instanceof Error?n.message:String(n)}function G(n){return n.includes(`\r
2
+ `)?`\r
3
+ `:`
4
+ `}var g="package.json";function x(...n){return e=>{let r=e.exists(g)?e.readText(g):void 0;return(0,U.chain)([(0,H.addDependency)(...n),t=>{if(r===void 0||!t.exists(g))return;let o=t.readText(g),i=G(r),s=r.endsWith(`
5
+ `)&&!o.endsWith(`
6
+ `)?`${o}
7
+ `:o,d=i===`
8
+ `?s:s.replace(/\r?\n/g,i);d!==o&&t.overwrite(g,d)}])}}var w=require("node:fs"),Y=require("node:path"),v=require("@angular-devkit/schematics");function N(n){return P(n)?Object.fromEntries(Object.entries(n).filter(e=>typeof e[1]=="string")):{}}function Re(n){try{return JSON.parse(n)}catch(e){let r=e instanceof Error?e.message:String(e);throw new v.SchematicsException(`package.json is not valid JSON: ${r.replace(/\.$/,"")}.`)}}function f(n){let e=Re(n);if(!P(e))throw new v.SchematicsException("package.json is not a JSON object.");return{name:typeof e.name=="string"?e.name:void 0,version:typeof e.version=="string"?e.version:void 0,dependencies:N(e.dependencies),devDependencies:N(e.devDependencies),peerDependencies:N(e.peerDependencies)}}function q(n){let{version:e}=f((0,w.readFileSync)(b(n),"utf8"));if(e===void 0)throw new Error(`No version in ${b(n)}.`);return e}function W(n){let{name:e}=f((0,w.readFileSync)(b(n),"utf8"));if(e===void 0)throw new Error(`No name in ${b(n)}.`);return e}function b(n){return(0,Y.join)(n,"..","..","package.json")}function m(n,e){return n.dependencies[e]??n.devDependencies[e]}var Se=/^[\s^~<>=v]*(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?/;function J(n){let e=Se.exec(n??"");if(e===null)return;let[,r,t="0",o="0",i]=e;return{major:Number(r),minor:Number(t),patch:Number(o),prerelease:i===void 0?[]:i.split(".").map(s=>/^\d+$/.test(s)?Number(s):s)}}function Ee(n,e){return typeof n=="number"&&typeof e=="number"?n-e:typeof n=="number"?-1:typeof e=="number"?1:n===e?0:n<e?-1:1}function X(n,e){let r=J(n),t=J(e);if(r===void 0||t===void 0)return;let o=r.major-t.major||r.minor-t.minor||r.patch-t.patch;if(o!==0)return o;if(r.prerelease.length===0||t.prerelease.length===0)return t.prerelease.length-r.prerelease.length;let i=Math.max(r.prerelease.length,t.prerelease.length);for(let s=0;s<i;s++){let d=r.prerelease[s],p=t.prerelease[s];if(d===void 0||p===void 0)return d===void 0?-1:1;let u=Ee(d,p);if(u!==0)return u}return 0}function h(n,e){let r=n.read(`node_modules/${e}/package.json`);if(r!==null)try{return f(r.toString("utf8")).version}catch{return}}var Te="package.json",Ce=/^[\s\d.^~<>=|xX*v-]+$/;function Oe(n,e){if(n!==void 0&&Ce.test(n)&&/\d/.test(n))return n;let r=/^(\d+)\.(\d+)\.\d+(-.+)?/.exec(e??"");if(r!==null)return r[3]===void 0?`^${r[1]}.${r[2]}.0`:`^${e}`}function Q(n,e){return(r,t)=>{let o=e??t.logger,i=f(r.readText(Te));if(m(i,n)!==void 0)return;let s=Oe(m(i,"@angular/core"),h(r,"@angular/core"));if(s===void 0){o.info(`Add ${n} matching your @angular/core yourself; cngx cannot read an Angular version to match it to.`);return}return o.info(`Adding ${n}@${s} to match @angular/core, so the install does not pick the ${n} of a newer Angular.`),x(n,s,{install:R.InstallBehavior.None,existing:R.ExistingBehavior.Skip})}}var S=require("@schematics/angular/utility"),Z=require("@schematics/angular/utility/json-file");var K="package.json";function L(n,e,r=!1){return(t,o)=>{let i=m(f(t.readText(K)),n);if(i!==void 0&&i!==e){r&&o.logger.info(`Replacing ${n}@${i} with ${e} so every @cngx package stays on one version.`);let s=new Z.JSONFile(t,K);s.remove(["dependencies",n]),s.remove(["devDependencies",n])}return x(n,e,{install:S.InstallBehavior.None,existing:S.ExistingBehavior.Replace})}}var Ae=["minimal","recommended","full"],E=["utils","core","common","interop","forms","data-display","ui"],Pe=["cngx","material","none"],Ne=["en","de"],we=["claude","cursor","vscode"];function T(n,e){return n.some(r=>r===e)}function ve(n,e){return Array.isArray(e)&&e.every(r=>T(n,r))}function Le(n){return typeof n=="boolean"}function k(n){return`--${n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`}function $e(n,e){let r=e.length===1?"is":"are";return new Error(`"${e.join('", "')}" ${r} given more than once for ${k(n)}.`)}function ke(n,e){let r=k(n);return new Error(`${r} has an empty entry. Separate the values with single commas, for example ${r} ${e.slice(0,2).join(",")}.`)}function F(n,e,r){return new Error(`"${e.join('", "')}" is not a valid answer for ${k(n)}. Expected one of: ${r.join(", ")}.`)}var z=["true","false"];function ee(n,e,r){if(r===void 0)return;let t=typeof r=="string"?r.split(",").map(i=>i.trim()):r;if(t.length===0)return;if(t.includes(""))throw ke(n,e);if(!ve(e,t))throw F(n,t.filter(i=>!T(e,i)),e);let o=t.filter((i,s)=>t.indexOf(i)!==s);if(o.length>0)throw $e(n,[...new Set(o)]);return t}function $(n,e,r){if(r!==void 0){if(!T(e,r))throw F(n,[r],e);return r}}function c(n,e){if(e===void 0||Le(e))return e;if(!T(z,e))throw F(n,[e],z);return e==="true"}function ne(n){return{project:n.project,preset:$("preset",Ae,n.preset),libs:ee("libs",E,n.libs),theme:$("theme",Pe,n.theme),i18n:$("i18n",Ne,n.i18n),runtimeSwitch:c("runtimeSwitch",n.runtimeSwitch),lint:c("lint",n.lint),a11yPreferences:c("a11yPreferences",n.a11yPreferences),feedback:c("feedback",n.feedback),floatingFallback:c("floatingFallback",n.floatingFallback),starter:c("starter",n.starter),aiTools:ee("aiTools",we,n.aiTools),yes:c("yes",n.yes),prompts:c("prompts",n.prompts),quiet:c("quiet",n.quiet)}}var l=require("@angular-devkit/schematics"),A=require("@angular-devkit/schematics/tasks");var ie=be(oe());function Ie(n,e){if(n.NO_COLOR!==void 0&&n.NO_COLOR!=="")return!1;let r=n.FORCE_COLOR;return r!==void 0?r!=="0"&&r!=="false":e}function se(n,e){let r=Ie(n,e),t=(0,ie.createColors)(r);return{enabled:r,bold:t.bold,dim:t.dim,green:t.green,yellow:t.yellow,red:t.red}}function ae(n){let e=n?.toLowerCase();return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:void 0}function je(n){return ae(n.CI)===!0}function De(n,e){return ae(n.NG_FORCE_TTY)??(e.isTTY===!0&&!je(n))}function de(n,e,r,t){let o=De(n,e);return{isTTY:o,color:se(n,o),quiet:t,logger:r,terminal:o?Me(e):void 0}}function Me(n){if(n.write===void 0)return;let e=r=>{n.write?.(`${r}
9
+ `)};return{info:e,warn:e,error:e}}var Ve=["0.0.0","PLACEHOLDER"].join("-");function le(n){return n===Ve}var a="@cngx/core",Ge="@angular/cdk";function Ue(n){return n!=="@cngx/utils"}function He(n){return n instanceof Error&&n.constructor.name==="CollectionCannotBeResolvedException"}function _(n){try{n.engine.createCollection(a)}catch(e){let r=He(e)?"it cannot be resolved":V(e);throw new l.SchematicsException(`${a} is installed but its ng-add collection failed to load: ${r}`)}}function Je(n){return E.find(e=>`@cngx/${e}`===n)}function Ye(n,e){let r=Je(e),t=ne({libs:n.libs}).libs;if(t===void 0||r===void 0)return n;let o=new Set([...t,r]);return{...n,libs:E.filter(i=>o.has(i))}}function qe(n){let e=de(process.env,process.stdout,n.logger,!1);return e.terminal??e.logger}function We(n,e,r,t){return n===void 0?`${a} is not installed yet; installing it before its ng-add runs.`:e===void 0?`${a} ${n} is installed with a version cngx cannot read; installing ${t} before its ng-add runs.`:`${a} ${n} is installed, older than ${r} ${t}; installing ${t} before its ng-add runs.`}function I(n,e=__dirname){return(r,t)=>{let o=q(e),i=W(e),s=Ye(n,i),d=qe(t),p=h(r,a),u=p===void 0?void 0:X(p,o);if(le(o)){if(p===void 0)throw new l.SchematicsException(`${i} is an unstamped local build (${o}) and ${a} is not installed; pack the libs with node scripts/pack-libs.mjs and install the tarballs.`);return d.info(`${i} is an unstamped local build (${o}); pinning nothing and following the installed ${a} ${p}.`),_(t),(0,l.externalSchematic)(a,"ng-add",s)}if(u!==void 0&&u>0)return d.info(`${a} ${p} is installed, newer than ${i} ${o}; following the installed core.`),_(t),(0,l.externalSchematic)(a,"ng-add",s);let j=(0,l.chain)([L(a,o,!0),L(i,o,!0)]);return u===0?(_(t),(0,l.chain)([j,(0,l.externalSchematic)(a,"ng-add",s)])):(d.info(We(p,u,i,o)),(0,l.chain)([j,...Ue(i)?[Q(Ge,d)]:[],(Qe,D)=>{let pe=D.addTask(new A.NodePackageInstallTask);D.addTask(new A.RunSchematicTask(a,"ng-add",{...s}),[pe])}]))}}0&&(module.exports={ngAdd});
@@ -0,0 +1,91 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "CngxNgAdd",
4
+ "title": "cngx ng-add",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The project to add cngx to.",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ },
14
+ "preset": {
15
+ "type": "string",
16
+ "description": "How much of the onboarding to apply. Asked first when a terminal is attached, after the preflight checklist; default recommended.",
17
+ "enum": ["minimal", "recommended", "full"]
18
+ },
19
+ "libs": {
20
+ "description": "The @cngx packages to install, comma-separated (--libs core,forms); their @cngx peers follow. Asked when a terminal is attached, otherwise every package.",
21
+ "oneOf": [
22
+ { "type": "string" },
23
+ {
24
+ "type": "array",
25
+ "items": { "type": "string", "enum": ["utils", "core", "common", "interop", "forms", "data-display", "ui"] },
26
+ "uniqueItems": true
27
+ }
28
+ ]
29
+ },
30
+ "theme": {
31
+ "type": "string",
32
+ "description": "The generated theme file: the cngx default, the Angular Material bridge, or none.",
33
+ "enum": ["cngx", "material", "none"]
34
+ },
35
+ "i18n": {
36
+ "type": "string",
37
+ "description": "The built-in copy: English only, or the German pack as well.",
38
+ "enum": ["en", "de"]
39
+ },
40
+ "runtimeSwitch": {
41
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
42
+ "description": "Wire the language pack for switching at runtime instead of a fixed language."
43
+ },
44
+ "lint": {
45
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
46
+ "description": "Add @cngx/eslint-plugin to the eslint flat config when one exists."
47
+ },
48
+ "a11yPreferences": {
49
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
50
+ "description": "Provide the accessibility preference axes (density, text scale, motion, contrast) with persistence."
51
+ },
52
+ "feedback": {
53
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
54
+ "description": "Provide toasts, alerts and banners at the root when @cngx/ui is installed."
55
+ },
56
+ "floatingFallback": {
57
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
58
+ "description": "Install @floating-ui/dom and provide the popover positioning fallback for browsers without CSS anchor positioning."
59
+ },
60
+ "starter": {
61
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
62
+ "description": "Replace the Angular welcome page of an untouched ng new standalone app with a cngx starter page that shows what was installed. Default true for --preset=full, false otherwise; --no-starter keeps the welcome page."
63
+ },
64
+ "aiTools": {
65
+ "description": "The editors to set up the cngx MCP server for, comma-separated (--ai-tools claude,vscode): the server entry in their project MCP config, a marked cngx block in the agent instructions (AGENTS.md, or CLAUDE.md for Claude Code) and .cngx/README.md. Asked when a terminal is attached. --preset=full preselects the detected editors (CLAUDE.md or .claude, .cursorrules or .cursor, .vscode) and sets them up without a terminal too; the other presets preselect none.",
66
+ "oneOf": [
67
+ { "type": "string" },
68
+ {
69
+ "type": "array",
70
+ "items": { "type": "string", "enum": ["claude", "cursor", "vscode"] },
71
+ "uniqueItems": true
72
+ }
73
+ ]
74
+ },
75
+ "yes": {
76
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
77
+ "description": "Apply the plan to an existing app without asking for confirmation first."
78
+ },
79
+ "prompts": {
80
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
81
+ "description": "Ask the detection-dependent questions when a terminal is attached. Pass false in CI runs under a pseudo-terminal; flags, the recorded answers of a re-run and the preset defaults answer instead.",
82
+ "default": true
83
+ },
84
+ "quiet": {
85
+ "oneOf": [{ "type": "boolean" }, { "type": "string", "enum": ["true", "false"] }],
86
+ "description": "Print only the summary, not the planned changes.",
87
+ "default": false
88
+ }
89
+ },
90
+ "required": []
91
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/stepper/README.md CHANGED
@@ -29,8 +29,8 @@ The presenter is a pure-derivation host directive - every visible piece of state
29
29
  | `CNGX_STEP_GROUP_HOST` | Group-scoped variant of the host contract. `CngxStep` injects this with optional fallback to `CNGX_STEPPER_HOST` so steps can register against a parent group OR the root presenter. |
30
30
  | `CNGX_STEP_PANEL_HOST` | Rendering-surface contract for organisms. Provides `flatSteps` / `activeStepIndex` / `activeStepId` Signals plus `labelTemplateFor(id)` / `contentTemplateFor(id)` template lookups. |
31
31
  | `CNGX_STEPPER_CONFIG` | App-wide stepper configuration token (defaults, ARIA labels, fallback labels, router-sync mode). |
32
- | `CNGX_STEPPER_I18N` | I18n bundle token (default English; consumers override via `provideStepperI18n`). |
33
- | `CNGX_STEPPER_COMMIT_HANDLER_FACTORY` | Pluggable async-commit handler factory. Default: `createStepperCommitHandler`. Override for telemetry / retry / offline-queue without forking. |
32
+ | `CNGX_STEPPER_I18N` | I18n bundle token, a `Signal` (default English; consumers override via `provideStepperI18n`). |
33
+ | `CNGX_STEPPER_COMMIT_HANDLER_FACTORY` | Pluggable async-commit handler factory. Default: `createStepperCommitHandler`. Override for telemetry / retry / offline-queue without forking. A handler calls `onResolve('accepted' \| 'refused' \| 'failed')`: `true` accepts, `false` refuses, a throw / rejection / error fails. |
34
34
 
35
35
  ### Configuration cascade
36
36
 
@@ -50,17 +50,20 @@ Resolution priority: per-instance Input → `viewProviders` → root provider
50
50
 
51
51
  ### I18n
52
52
 
53
+ To translate the whole app, set a language pack with `provideCngxI18n(withPack(...))` from `@cngx/core/i18n` (see the localisation guide); the exports below override single keys on top of the `stepper` section.
54
+
53
55
  | Export | Description |
54
56
  |-|-|
55
57
  | `provideStepperI18n(bundle)` | Provide a localised i18n bundle (defaults are English). |
56
- | `injectStepperI18n()` | Read the resolved i18n bundle in directives / components. |
57
- | `CngxStepperI18n` | The bundle interface (`stepperLabel`, `selectedStep(label, idx, count)`, `stepCompleted`, `stepErrored`, …). |
58
+ | `injectStepperI18n()` | Read the resolved i18n bundle as a `Signal` in directives / components; call it inside a `computed()` or template so a language switch reaches the label. |
59
+ | `CngxStepperI18n` | The bundle interface (`stepperLabel`, `selectedStep(label, idx, count)`, `statusLabels`, …). |
58
60
 
59
61
  ### Utilities
60
62
 
61
63
  | Export | Description |
62
64
  |-|-|
63
- | `createStepperCommitHandler({ controller })` | Factory for the async-commit state-machine adapter. Default `CNGX_STEPPER_COMMIT_HANDLER_FACTORY`. |
65
+ | `createStepperCommitHandler({ controller })` | Factory for the async-commit state-machine adapter. Default `CNGX_STEPPER_COMMIT_HANDLER_FACTORY`. Routes a `false` answer to the controller's refusal path, so the commit state goes `'idle'` and keeps its data. |
66
+ | `CngxStepperCommitResolution` | `'accepted' \| 'refused' \| 'failed'`, the outcome a commit handler reports. |
64
67
 
65
68
  ## Usage
66
69
 
@@ -93,10 +96,10 @@ class WizardCmp {
93
96
  | Feature | Purpose |
94
97
  |-|-|
95
98
  | `withStepperSkin(name)` | Select the visual skin for `<cngx-stepper>`: `'classic'` (default) / `'linear-minimal'` / `'stripe-status-rich'` / `'path-chevron'` / `'pill-segment'`. Thematic only - structure, slots, ARIA, and keyboard behaviour are identical across skins. The Material twin `<cngx-mat-stepper>` ignores this setting. |
96
- | `withStepperMobileCollapse(mode)` | Choose the auto-collapse target for narrow viewports (`max-width: 480px`): `'text'` (default, renders `<cngx-text-stepper>`) / `'dots'` (renders `<cngx-dot-stepper>`) / `'off'` (keep the classic strip on every viewport). The Material twin ignores this setting. |
99
+ | `withStepperMobileCollapse(mode)` | Choose the auto-collapse target for a narrow **container** (below `30rem` of the stepper's own width, not the viewport): `'text'` (default, renders `<cngx-text-stepper>`) / `'dots'` (renders `<cngx-dot-stepper>`) / `'off'` (keep the classic strip at every width). The threshold itself is a `@container` rule in `stepper-base.css`, overridable in consumer CSS - see the `@cngx/ui/stepper` README. The Material twin ignores this setting. |
97
100
  | `withStepperHeaderNavigation(mode)` | Set the header-navigation policy: `'none'` (inert label headers, footer-only navigation) / `'visited'` (default - focusable header buttons gated by `linear`). Per-instance `[headerNavigation]` wins. |
98
101
  | `withStepErrorTemplate(tpl)` | App-wide default for the `*cngxStepError` slot - the per-step validation message rendered in a row below the strip. Per-instance `*cngxStepError` directive wins. |
99
- | `withStepperI18nLabels({ statusLabels })` | Override the per-state pill labels surfaced by the `stripe-status-rich` skin: `{ done, inProgress, upNext, errored }`. Partial overrides keep unset keys at the English default. |
102
+ | `withStepperI18nLabels({ statusLabels })` | Override the per-state status words: `{ done, inProgress, upNext, errored, refused }`. The first four are the pill labels of the `stripe-status-rich` skin; `refused` names a refused step in its accessible name and in the minimal skins' error line. Partial overrides keep unset keys at the English default. |
100
103
  | `withStepperI18nLabels({ textStepperFormat })` | Override the short format used by `CngxProgressBarStepper`'s caption and by `CngxTextStepper`. Signature: `(current: number, total: number) => string`; default `(c, t) => 'Step ' + c + ' of ' + t`. |
101
104
 
102
105
  ```ts
@@ -145,6 +148,6 @@ bootstrapApplication(AppComponent, {
145
148
  A step carries an error through two independent channels:
146
149
 
147
150
  - **Validation** - a direct `[error]` input on `cngxStep` (`true` or a message string), or an `[errorAggregator]` for genuine multi-source forms. Both fold into the step's `state` (`'error'`) with no async machine. The state shows on every skin via the indicator / badge; the reason text surfaces in a row below the strip via the `*cngxStepError` slot (or the aggregate line on the text / dot / progress variants), but only for a real message - a bare `[error]="true"` shows state only. `[error]="'message'"` wins over the first aggregator label, which wins over the i18n `errored` word.
148
- - **Commit / async** - a `commitAction` that rejects sets `lastFailedIndex`; the rolled-back step decorates via `*cngxStepRejection` and announces through the `CngxToastOn` / `CngxBannerOn` bridges.
151
+ - **Commit / async** - a `commitAction` that answers `false` refuses the step change, one that throws, rejects or errors fails it. Both roll the step back, set `lastFailedIndex` and decorate the step via `*cngxStepRejection` (its context carries `reason: 'refused' | 'failed'`); `lastOutcome()` tells them apart. A failure leaves `commitState` at `'error'` and reaches the `CngxToastOn` / `CngxBannerOn` bridges. A refusal is not a failure: `commitState` goes `'idle'` and keeps its data, the bridges stay silent, and the stepper speaks `commitRefused` once. An app that wants a toast for a refusal shows it from its own `commitAction` (for example `severity: 'warning'`) before it returns `false`. The stepper keeps only the outcome of the most recent commit, not a history: `lastOutcome()` and the rejection marker describe the latest attempt, and the next attempt replaces them. When that attempt lands or refuses, the commit state leaves `'error'`, so the earlier error and its `CngxBannerOn` banner clear as well; when it fails, the new failure takes their place. `reset()` clears the outcome, `clearLastFailed()` clears only the marker. A state that must stay on a step until it is fixed is a validation error (`[error]` or an `[errorAggregator]`), which every step holds independently.
149
152
 
150
153
  The two never collide: validation owns `*cngxStepError`, commit owns `*cngxStepRejection`. The `[error]` input replaces the old `<fieldset cngxErrorAggregator><input cngxErrorSource>` boilerplate for the common "this step is invalid" case; the aggregator stays the power path. See `@cngx/ui/stepper` for the per-skin text-surface table.
@@ -147,7 +147,7 @@
147
147
  border-inline-end: 2px solid currentcolor;
148
148
  border-block-end: 2px solid currentcolor;
149
149
  rotate: 45deg;
150
- transition: rotate 0.15s ease;
150
+ transition: rotate var(--cngx-duration-fast, 150ms) ease;
151
151
  }
152
152
 
153
153
  [cngxAccordionPanel][aria-expanded='true']::after {
@@ -37,13 +37,25 @@
37
37
  /**
38
38
  * Duration of the opacity fade between hidden and visible states.
39
39
  * Falls back to `--cngx-duration-base`.
40
+ *
41
+ * Derives from the `--cngx-duration-base` rung of the motion scale; a
42
+ * `--cngx-duration-*` brand override re-times it library-wide.
40
43
  * @group Motion
44
+ * @relatedTo provideMotion, CngxMotionScope, injectMotion
41
45
  */
42
46
  @property --cngx-backdrop-transition-duration {
43
47
  syntax: '<time>';
44
48
  inherits: false;
45
49
  initial-value: 200ms;
46
50
  }
51
+
52
+ /* Derive from the motion scale. The registered initial-value wins over the
53
+ * read-site var() fallback, so the token must be SET from the scale for a
54
+ * --cngx-duration-* brand override to reach the fade. Host SET (read is on
55
+ * :scope); layer cngx.tokens keeps the Material bridge winning. */
56
+ :where(.cngx-backdrop) {
57
+ --cngx-backdrop-transition-duration: var(--cngx-duration-base);
58
+ }
47
59
  }
48
60
 
49
61
  @layer cngx.components {
@@ -10,7 +10,9 @@
10
10
  * **State modifiers**
11
11
  *
12
12
  * - `--checked` - primary fill, on-primary text, primary border
13
- * - `--disabled` - opacity 0.5, `cursor: not-allowed`
13
+ * - `--disabled` - `cursor: not-allowed`; 38% text on a faint text tint,
14
+ * a checked segment fills with the disabled colour; GrayText under
15
+ * forced colors
14
16
  * - `:hover:not(--disabled):not(--checked)` - 8% primary tint over the surface
15
17
  * - `--checked:hover:not(--disabled)` - primary fill darkened for feedback,
16
18
  * keeping the on-primary text contrast (an unguarded plain hover would drop
@@ -75,7 +77,7 @@
75
77
  font: inherit;
76
78
  font-size: var(--cngx-font-size-sm, 0.8125rem);
77
79
  cursor: pointer;
78
- transition: background-color 0.12s, border-color 0.12s, color 0.12s;
80
+ transition: background-color var(--cngx-duration-fast, 150ms), border-color var(--cngx-duration-fast, 150ms), color var(--cngx-duration-fast, 150ms);
79
81
  }
80
82
 
81
83
  /* Segmented-control geometry: collapse adjacent borders inside the
@@ -119,10 +121,20 @@
119
121
  border-color: color-mix(in oklch, var(--cngx-color-primary, oklch(0.66 0.19 50)) 88%, black);
120
122
  }
121
123
 
124
+ /* Disabled by colour, never opacity (the field recipe): 38% text on a
125
+ * faint text tint; a checked segment fills with the disabled colour and
126
+ * keeps a surface label. */
122
127
  :scope.cngx-button-toggle--disabled {
123
- opacity: 0.5;
128
+ background: color-mix(in oklab, var(--cngx-color-text, oklch(0.2 0.01 250)) 4%, var(--cngx-color-surface, oklch(1 0 0)));
129
+ color: color-mix(in oklab, var(--cngx-color-text, oklch(0.2 0.01 250)) 38%, transparent);
124
130
  cursor: not-allowed;
125
131
  }
132
+
133
+ :scope.cngx-button-toggle--disabled.cngx-button-toggle--checked {
134
+ background: color-mix(in oklab, var(--cngx-color-text, oklch(0.2 0.01 250)) 38%, transparent);
135
+ color: var(--cngx-color-surface, oklch(1 0 0));
136
+ border-color: transparent;
137
+ }
126
138
  }
127
139
  }
128
140
 
@@ -144,4 +156,18 @@
144
156
  color: HighlightText !important;
145
157
  border-color: Highlight !important;
146
158
  }
159
+ /* Disabled is painted by colour. A native :disabled button gets GrayText from
160
+ * the UA, an aria-disabled one does not, so restate it; a checked disabled
161
+ * segment fills with GrayText (the repeated classes beat the Highlight rule). */
162
+ .cngx-button-toggle.cngx-button-toggle--disabled {
163
+ forced-color-adjust: none;
164
+ background: ButtonFace;
165
+ color: GrayText;
166
+ border-color: GrayText;
167
+ }
168
+ .cngx-button-toggle.cngx-button-toggle--disabled.cngx-button-toggle--checked {
169
+ background: GrayText !important;
170
+ color: ButtonFace !important;
171
+ border-color: GrayText !important;
172
+ }
147
173
  }
@@ -9,7 +9,10 @@
9
9
  * Registration matters because the column template, gaps, and paddings are set
10
10
  * on the group host and read by descendant summaries. `@property` with
11
11
  * `inherits: true` keeps that host -> descendant cascade alive; `inherits: false`
12
- * would silently pin descendants to the initial value. Every token here inherits.
12
+ * would silently pin descendants to the initial value. Every token here inherits,
13
+ * except the two measured band sizes (`--cngx-dga-head-block-size` /
14
+ * `--cngx-dga-foot-block-size`) and the private fade carriers, which only the host
15
+ * itself reads.
13
16
  *
14
17
  * Density: the pixel `initial-value` of each spacing token is only the un-set
15
18
  * fallback. The organism's default rule and each skin SET `--cngx-dga-row-py` /
@@ -216,4 +219,168 @@
216
219
  syntax: '*';
217
220
  inherits: true;
218
221
  }
222
+
223
+ /**
224
+ * Optional override for the block-start scroll padding that keeps keyboard focus
225
+ * below the pinned column head (WCAG 2.4.11). Unset, the host uses the measured
226
+ * `--cngx-dga-head-block-size`. Universal syntax with NO initial-value, so an unset
227
+ * override falls through to the measured value; a registered initial would never be
228
+ * "unset", so the use-site fallback would never fire.
229
+ * @group Grid
230
+ */
231
+ @property --cngx-dga-head-scroll-pad {
232
+ syntax: '*';
233
+ inherits: true;
234
+ }
235
+
236
+ /**
237
+ * Optional override for the block-end scroll padding that keeps keyboard focus above
238
+ * the pinned footer (WCAG 2.4.11). Unset, the host uses the measured
239
+ * `--cngx-dga-foot-block-size`. No initial-value, for the same reason as the head pad.
240
+ * @group Grid
241
+ */
242
+ @property --cngx-dga-foot-scroll-pad {
243
+ syntax: '*';
244
+ inherits: true;
245
+ }
246
+
247
+ /**
248
+ * Measured border-box block size of the projected column head, bound by the host from
249
+ * a resize observer. Host-only: `inherits: false`, so a nested headerless grid never
250
+ * picks up an outer grid's band and a head resize never restyles the subtree. Only the
251
+ * host's own `scroll-padding-block` reads it, never a descendant. No initial-value, so
252
+ * an unmeasured head falls back to `0px` at the use site.
253
+ * @group Grid
254
+ */
255
+ @property --cngx-dga-head-block-size {
256
+ syntax: '*';
257
+ inherits: false;
258
+ }
259
+
260
+ /**
261
+ * Measured border-box block size of the projected footer, the foot counterpart of
262
+ * `--cngx-dga-head-block-size` (host-only, no initial-value).
263
+ * @group Grid
264
+ */
265
+ @property --cngx-dga-foot-block-size {
266
+ syntax: '*';
267
+ inherits: false;
268
+ }
269
+
270
+ /**
271
+ * Extra room the scroll padding adds beyond the pinned bands so the focus ring, which
272
+ * paints outside the focused element, is never clipped by a band. The use-site default
273
+ * `4px` is the worst case: the 2px ring of `--cngx-dga-focus-ring` plus the 2px outward
274
+ * offset of the sort header. A consumer widening the ring raises this too.
275
+ * @group Grid
276
+ */
277
+ @property --cngx-dga-focus-clearance {
278
+ syntax: '*';
279
+ inherits: true;
280
+ }
281
+
282
+ /**
283
+ * Shadow cast by the pinned column head while rows are scrolled away above it
284
+ * (bounded mode only). This is only the default look: set it to `none` to turn
285
+ * it off, or key your own visual (a line that appears, a tonal head) on the
286
+ * public `data-scroll-block-start` host attribute. Universal syntax with NO
287
+ * initial-value, so the adaptive default at the use site (derived from
288
+ * `--cngx-color-text`) stays live; a fixed colour initial would defeat it.
289
+ * @group Surface
290
+ */
291
+ @property --cngx-dga-head-shadow {
292
+ syntax: '*';
293
+ inherits: true;
294
+ }
295
+
296
+ /**
297
+ * Shadow cast by the pinned footer while rows remain below it (bounded mode only).
298
+ * A swappable default like the head shadow: `none` turns it off, and the public
299
+ * `data-scroll-block-end` host attribute keys any replacement. No initial-value,
300
+ * for the same reason as the head shadow.
301
+ * @group Surface
302
+ */
303
+ @property --cngx-dga-foot-shadow {
304
+ syntax: '*';
305
+ inherits: true;
306
+ }
307
+
308
+ /**
309
+ * Width of the inline edge fade shown while columns are hidden sideways. Also sets
310
+ * how far the inline scroll padding keeps a focused cell away from the edge. The
311
+ * fade is a default look keyed on the public `data-scroll-inline-start` /
312
+ * `data-scroll-inline-end` host attributes.
313
+ * @group Grid
314
+ */
315
+ @property --cngx-dga-edge-fade-size {
316
+ syntax: '<length>';
317
+ inherits: true;
318
+ initial-value: 24px;
319
+ }
320
+
321
+ /**
322
+ * Mask opacity at the very edge of the inline fade. The fade never reaches full
323
+ * transparency, so overlay scrollbars and edge content stay visible.
324
+ * @group Grid
325
+ */
326
+ @property --cngx-dga-edge-fade-min {
327
+ syntax: '<number>';
328
+ inherits: true;
329
+ initial-value: 0.35;
330
+ }
331
+
332
+ /**
333
+ * Private transition carrier: the current inline-start fade width. Set and read on
334
+ * the host only; registered so the length eases instead of popping.
335
+ * @group Grid
336
+ */
337
+ @property --_cngx-dga-fade-inline-start {
338
+ syntax: '<length>';
339
+ inherits: false;
340
+ initial-value: 0px;
341
+ }
342
+
343
+ /**
344
+ * Private transition carrier: the current inline-end fade width (host only).
345
+ * @group Grid
346
+ */
347
+ @property --_cngx-dga-fade-inline-end {
348
+ syntax: '<length>';
349
+ inherits: false;
350
+ initial-value: 0px;
351
+ }
352
+
353
+ /**
354
+ * Private transition carrier: the mask opacity at the inline-start edge, `1` (no
355
+ * fade) until that side hides columns. Host only, so a nested grid never inherits
356
+ * an outer grid's fade state.
357
+ * @group Grid
358
+ */
359
+ @property --_cngx-dga-fade-alpha-start {
360
+ syntax: '<number>';
361
+ inherits: false;
362
+ initial-value: 1;
363
+ }
364
+
365
+ /**
366
+ * Private transition carrier: the mask opacity at the inline-end edge (host only).
367
+ * @group Grid
368
+ */
369
+ @property --_cngx-dga-fade-alpha-end {
370
+ syntax: '<number>';
371
+ inherits: false;
372
+ initial-value: 1;
373
+ }
374
+
375
+ /**
376
+ * Private carrier: the physical direction of the inline fade gradient, `to right`
377
+ * unless the host itself resolves to RTL. Host only, so an LTR grid nested in an
378
+ * RTL one keeps its own direction.
379
+ * @group Grid
380
+ */
381
+ @property --_cngx-dga-fade-dir {
382
+ syntax: '*';
383
+ inherits: false;
384
+ initial-value: to right;
385
+ }
219
386
  }
@@ -199,7 +199,11 @@
199
199
 
200
200
  /**
201
201
  * Duration of the open / close transition.
202
+ *
203
+ * Derives from the `--cngx-duration-base` rung of the motion scale; a
204
+ * `--cngx-duration-*` brand override re-times it library-wide.
202
205
  * @group Motion
206
+ * @relatedTo provideMotion, CngxMotionScope, injectMotion
203
207
  */
204
208
  @property --cngx-dialog-transition-duration {
205
209
  syntax: '<time>';
@@ -207,6 +211,15 @@
207
211
  initial-value: 200ms;
208
212
  }
209
213
 
214
+ /* Derive from the motion scale. The registered initial-value above wins
215
+ * over the read-site var() fallback, so a --cngx-duration-* brand override
216
+ * only reaches the transition once the token is SET from the scale here.
217
+ * Host SET (read is on :scope); layer cngx.tokens keeps the Material bridge
218
+ * (layer cngx.components) winning for the Material path. */
219
+ :where(dialog[cngxDialog]) {
220
+ --cngx-dialog-transition-duration: var(--cngx-duration-base);
221
+ }
222
+
210
223
  /**
211
224
  * Easing curve of the open / close transition.
212
225
  * @group Motion