ngwr 13.0.0 → 14.0.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.
Files changed (200) hide show
  1. package/README.md +13 -6
  2. package/color-picker/styles/_index.scss +43 -5
  3. package/fesm2022/ngwr-alert.mjs +5 -5
  4. package/fesm2022/ngwr-alert.mjs.map +1 -1
  5. package/fesm2022/ngwr-back-top.mjs +11 -1
  6. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  7. package/fesm2022/ngwr-blur-text.mjs +13 -2
  8. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  9. package/fesm2022/ngwr-border-glow.mjs +12 -3
  10. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  11. package/fesm2022/ngwr-breadcrumbs.mjs +14 -3
  12. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  13. package/fesm2022/ngwr-button.mjs +4 -4
  14. package/fesm2022/ngwr-button.mjs.map +1 -1
  15. package/fesm2022/ngwr-calendar-testing.mjs +15 -0
  16. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  17. package/fesm2022/ngwr-calendar.mjs +51 -5
  18. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  19. package/fesm2022/ngwr-circular-text.mjs +20 -1
  20. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  21. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  22. package/fesm2022/ngwr-color-picker-testing.mjs +23 -7
  23. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  24. package/fesm2022/ngwr-color-picker.mjs +89 -10
  25. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  26. package/fesm2022/ngwr-command-palette.mjs +27 -3
  27. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  28. package/fesm2022/ngwr-context-menu.mjs +13 -3
  29. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  30. package/fesm2022/ngwr-date-adapters-fns.mjs +101 -33
  31. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  32. package/fesm2022/ngwr-date-picker-testing.mjs +10 -2
  33. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  34. package/fesm2022/ngwr-date-picker.mjs +103 -13
  35. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  36. package/fesm2022/ngwr-date.mjs +480 -79
  37. package/fesm2022/ngwr-date.mjs.map +1 -1
  38. package/fesm2022/ngwr-dialog.mjs +22 -16
  39. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  40. package/fesm2022/ngwr-directives.mjs +5 -2
  41. package/fesm2022/ngwr-directives.mjs.map +1 -1
  42. package/fesm2022/ngwr-drag-drop.mjs +30 -2
  43. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  44. package/fesm2022/ngwr-drawer.mjs +24 -18
  45. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  46. package/fesm2022/ngwr-dropdown.mjs +8 -3
  47. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  48. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-event-calendar.mjs +1 -1
  50. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  51. package/fesm2022/ngwr-file-upload.mjs +52 -12
  52. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  53. package/fesm2022/ngwr-fuzzy-text.mjs +21 -4
  54. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  55. package/fesm2022/ngwr-gradient-text.mjs +9 -2
  56. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  57. package/fesm2022/ngwr-i18n-en.mjs +63 -1
  58. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  59. package/fesm2022/ngwr-i18n-ru.mjs +28 -1
  60. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  61. package/fesm2022/ngwr-i18n.mjs +150 -22
  62. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  63. package/fesm2022/ngwr-icon-adapters-feather.mjs +11 -0
  64. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  65. package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
  66. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  67. package/fesm2022/ngwr-icon.mjs +474 -37
  68. package/fesm2022/ngwr-icon.mjs.map +1 -1
  69. package/fesm2022/ngwr-input-number.mjs +3 -3
  70. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  71. package/fesm2022/ngwr-input-otp.mjs +21 -3
  72. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  73. package/fesm2022/ngwr-input.mjs +14 -7
  74. package/fesm2022/ngwr-input.mjs.map +1 -1
  75. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-knob.mjs +20 -2
  77. package/fesm2022/ngwr-knob.mjs.map +1 -1
  78. package/fesm2022/ngwr-loading-bar-router.mjs +73 -0
  79. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -0
  80. package/fesm2022/ngwr-loading-bar.mjs +21 -32
  81. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  82. package/fesm2022/ngwr-markdown.mjs +63 -11
  83. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  84. package/fesm2022/ngwr-mention.mjs +104 -14
  85. package/fesm2022/ngwr-mention.mjs.map +1 -1
  86. package/fesm2022/ngwr-overlay.mjs +36 -7
  87. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  88. package/fesm2022/ngwr-pagination-testing.mjs +11 -10
  89. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  90. package/fesm2022/ngwr-pagination.mjs +65 -30
  91. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  92. package/fesm2022/ngwr-popconfirm.mjs +3 -2
  93. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  94. package/fesm2022/ngwr-popover.mjs +2 -1
  95. package/fesm2022/ngwr-popover.mjs.map +1 -1
  96. package/fesm2022/ngwr-qr.mjs +38 -1
  97. package/fesm2022/ngwr-qr.mjs.map +1 -1
  98. package/fesm2022/ngwr-select.mjs +93 -34
  99. package/fesm2022/ngwr-select.mjs.map +1 -1
  100. package/fesm2022/ngwr-shiny-text.mjs +10 -3
  101. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  102. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  103. package/fesm2022/ngwr-squircle.mjs +2 -1
  104. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  105. package/fesm2022/ngwr-statistic.mjs +35 -4
  106. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  107. package/fesm2022/ngwr-table.mjs +35 -12
  108. package/fesm2022/ngwr-table.mjs.map +1 -1
  109. package/fesm2022/ngwr-tabs-router.mjs +158 -0
  110. package/fesm2022/ngwr-tabs-router.mjs.map +1 -0
  111. package/fesm2022/ngwr-tabs-testing.mjs +13 -11
  112. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  113. package/fesm2022/ngwr-tabs.mjs +104 -12
  114. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  115. package/fesm2022/ngwr-textarea.mjs +20 -1
  116. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  117. package/fesm2022/ngwr-tour.mjs +1 -1
  118. package/fesm2022/ngwr-tour.mjs.map +1 -1
  119. package/fesm2022/ngwr-transfer.mjs +2 -2
  120. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  121. package/fesm2022/ngwr-tree.mjs +18 -2
  122. package/fesm2022/ngwr-tree.mjs.map +1 -1
  123. package/fesm2022/ngwr-utils.mjs +143 -1
  124. package/fesm2022/ngwr-utils.mjs.map +1 -1
  125. package/fesm2022/ngwr-version.mjs +1 -1
  126. package/fesm2022/ngwr-version.mjs.map +1 -1
  127. package/fesm2022/ngwr-window-testing.mjs +10 -2
  128. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  129. package/fesm2022/ngwr-window.mjs +4 -4
  130. package/fesm2022/ngwr-window.mjs.map +1 -1
  131. package/i18n/en.json +33 -6
  132. package/i18n/ru.json +33 -6
  133. package/llms-full.txt +20 -11
  134. package/llms.txt +47 -16
  135. package/mcp/catalog.js +3 -3
  136. package/mcp/providers.js +11 -0
  137. package/package.json +11 -3
  138. package/schematics/migrations/v13/index.js +101 -0
  139. package/schematics/migrations/v14/index.js +422 -0
  140. package/schematics/migrations.json +10 -0
  141. package/schematics/page/templates.js +1 -1
  142. package/schematics/use/symbol-map.json +1 -0
  143. package/skills/ngwr/SKILL.md +4 -1
  144. package/skills/ngwr/references/catalog.md +2 -0
  145. package/skills/ngwr/references/setup.md +4 -0
  146. package/stepper/styles/_index.scss +19 -1
  147. package/textarea/styles/_index.scss +14 -6
  148. package/toast/styles/_index.scss +12 -4
  149. package/types/ngwr-alert.d.ts +3 -3
  150. package/types/ngwr-blur-text.d.ts +8 -0
  151. package/types/ngwr-breadcrumbs.d.ts +1 -0
  152. package/types/ngwr-button.d.ts +2 -2
  153. package/types/ngwr-calendar-testing.d.ts +21 -4
  154. package/types/ngwr-calendar.d.ts +37 -0
  155. package/types/ngwr-circular-text.d.ts +9 -0
  156. package/types/ngwr-collapse.d.ts +19 -15
  157. package/types/ngwr-color-picker-testing.d.ts +10 -4
  158. package/types/ngwr-color-picker.d.ts +70 -2
  159. package/types/ngwr-command-palette.d.ts +14 -0
  160. package/types/ngwr-context-menu.d.ts +1 -1
  161. package/types/ngwr-date-adapters-fns.d.ts +71 -29
  162. package/types/ngwr-date-picker-testing.d.ts +206 -185
  163. package/types/ngwr-date-picker.d.ts +7 -0
  164. package/types/ngwr-date.d.ts +143 -13
  165. package/types/ngwr-drag-drop.d.ts +19 -0
  166. package/types/ngwr-dropdown.d.ts +1 -1
  167. package/types/ngwr-event-calendar-testing.d.ts +12 -9
  168. package/types/ngwr-file-upload.d.ts +31 -3
  169. package/types/ngwr-fuzzy-text.d.ts +5 -0
  170. package/types/ngwr-i18n.d.ts +89 -7
  171. package/types/ngwr-icon-adapters-feather.d.ts +11 -0
  172. package/types/ngwr-icon.d.ts +42 -1
  173. package/types/ngwr-input-number.d.ts +1 -1
  174. package/types/ngwr-input-otp.d.ts +3 -0
  175. package/types/ngwr-input.d.ts +11 -4
  176. package/types/ngwr-knob-testing.d.ts +8 -4
  177. package/types/ngwr-knob.d.ts +18 -0
  178. package/types/ngwr-loading-bar-router.d.ts +35 -0
  179. package/types/ngwr-loading-bar.d.ts +19 -9
  180. package/types/ngwr-mention.d.ts +13 -0
  181. package/types/ngwr-pagination-testing.d.ts +11 -10
  182. package/types/ngwr-pagination.d.ts +39 -10
  183. package/types/ngwr-popconfirm.d.ts +1 -1
  184. package/types/ngwr-popover.d.ts +1 -1
  185. package/types/ngwr-select.d.ts +65 -10
  186. package/types/ngwr-shiny-text.d.ts +1 -0
  187. package/types/ngwr-splitter-testing.d.ts +9 -4
  188. package/types/ngwr-squircle.d.ts +1 -1
  189. package/types/ngwr-statistic.d.ts +22 -2
  190. package/types/ngwr-table.d.ts +24 -5
  191. package/types/ngwr-tabs-router.d.ts +67 -0
  192. package/types/ngwr-tabs-testing.d.ts +12 -10
  193. package/types/ngwr-tabs.d.ts +103 -6
  194. package/types/ngwr-textarea.d.ts +9 -0
  195. package/types/ngwr-tree.d.ts +7 -0
  196. package/types/ngwr-utils.d.ts +79 -1
  197. package/types/ngwr-version.d.ts +1 -1
  198. package/types/ngwr-window-testing.d.ts +11 -3
  199. package/types/ngwr-window.d.ts +11 -4
  200. package/window/styles/_index.scss +1 -1
@@ -1,7 +1,7 @@
1
1
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
3
  import { input, computed, ViewEncapsulation, Component, Directive } from '@angular/core';
4
- import { numAttr } from 'ngwr/utils';
4
+ import { numAttr, isSafeCssValue } from 'ngwr/utils';
5
5
 
6
6
  /**
7
7
  * @license
@@ -66,11 +66,18 @@ class WrShinyText {
66
66
  totalDuration = computed(() => this.speed() + this.delay(), /* @ts-ignore */
67
67
  ...(ngDevMode ? [{ debugName: "totalDuration" }] : /* istanbul ignore next */ []));
68
68
  gradient = computed(() => {
69
- const base = this.color() ?? 'var(--wr-shiny-text-base)';
70
- const shine = this.shineColor() ?? 'var(--wr-shiny-text-shine)';
69
+ // Both colours are CONCATENATED into the gradient below, so a value that
70
+ // balances the surrounding parens escapes its stop and adds a `url()` layer
71
+ // the browser then fetches. Anything that would not stay in its slot falls
72
+ // back to the theme token — see `isSafeCssValue`.
73
+ const base = this.slot(this.color(), 'var(--wr-shiny-text-base)');
74
+ const shine = this.slot(this.shineColor(), 'var(--wr-shiny-text-shine)');
71
75
  return `linear-gradient(${this.spread()}deg, ${base} 0%, ${base} 35%, ${shine} 50%, ${base} 65%, ${base} 100%)`;
72
76
  }, /* @ts-ignore */
73
77
  ...(ngDevMode ? [{ debugName: "gradient" }] : /* istanbul ignore next */ []));
78
+ slot(value, fallback) {
79
+ return value !== null && isSafeCssValue(value) ? value : fallback;
80
+ }
74
81
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrShinyText, deps: [], target: i0.ɵɵFactoryTarget.Component });
75
82
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.4", type: WrShinyText, isStandalone: true, selector: "wr-shiny-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shineColor: { classPropertyName: "shineColor", publicName: "shineColor", isSignal: true, isRequired: false, transformFunction: null }, spread: { classPropertyName: "spread", publicName: "spread", isSignal: true, isRequired: false, transformFunction: null }, yoyo: { classPropertyName: "yoyo", publicName: "yoyo", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-shiny-text--paused": "disabled()", "class.wr-shiny-text--pause-on-hover": "pauseOnHover()", "class.wr-shiny-text--yoyo": "yoyo()", "class.wr-shiny-text--reverse": "direction() === 'right'", "style.background-image": "gradient()", "style.animation-duration": "totalDuration() + 's'" }, classAttribute: "wr-shiny-text" }, ngImport: i0, template: '{{ text() }}', isInline: true, styles: [".wr-shiny-text{--wr-shiny-text-base: var(--wr-color-on-surface-muted, #8594a4);--wr-shiny-text-shine: var(--wr-color-on-surface, #0f172a);display:inline-block;background-size:200% auto;background-position:150% center;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation-name:wr-shiny-text-sweep;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:normal;animation-fill-mode:both;animation-play-state:running}.wr-shiny-text--reverse{animation-direction:reverse}.wr-shiny-text--yoyo{animation-direction:alternate}.wr-shiny-text--yoyo.wr-shiny-text--reverse{animation-direction:alternate-reverse}.wr-shiny-text--paused,.wr-shiny-text--pause-on-hover:hover{animation-play-state:paused}@keyframes wr-shiny-text-sweep{0%{background-position:150% center}50%{background-position:-50% center}to{background-position:-50% center}}@media(prefers-reduced-motion:reduce){.wr-shiny-text{animation:none!important}}@keyframes wr-shimmer{to{background-position-x:-200%}}.wr-shimmer{background:linear-gradient(110deg,var(--wr-color-on-surface) 30%,rgba(var(--wr-color-primary-rgb),.9) 50%,var(--wr-color-on-surface) 70%);background-size:200% 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:wr-shimmer 2.5s linear infinite}@media(prefers-reduced-motion:reduce){.wr-shimmer{animation:none}}[data-theme=dark] .wr-shiny-text{--wr-shiny-text-base: #b5b5b5;--wr-shiny-text-shine: #ffffff}\n"], encapsulation: i0.ViewEncapsulation.None });
76
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-shiny-text.mjs","sources":["../../../projects/lib/shiny-text/shiny-text.ts","../../../projects/lib/shiny-text/shimmer.ts","../../../projects/lib/shiny-text/ngwr-shiny-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the ShinyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/shiny-text\n *\n * The reactbits version uses `motion/react` to drive `background-position`\n * via rAF. This port is pure CSS — the same effect via a keyframe that\n * sweeps `background-position`, parameterised by `[speed]` / `[delay]` /\n * `[yoyo]` / `[direction]`.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\n/**\n * Animated shimmer-over-text effect. A bright stripe sweeps across the\n * text using `background-clip: text` + an animated `background-position`.\n *\n * @example\n * ```html\n * <wr-shiny-text text=\"Premium\" />\n * <wr-shiny-text\n * text=\"Custom\"\n * color=\"#444\"\n * shineColor=\"#a0e0ff\"\n * [speed]=\"3\"\n * [delay]=\"0.5\"\n * [yoyo]=\"true\"\n * [pauseOnHover]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/shiny-text\n */\n@Component({\n selector: 'wr-shiny-text',\n template: '{{ text() }}',\n styleUrl: './shiny-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-shiny-text',\n '[class.wr-shiny-text--paused]': 'disabled()',\n '[class.wr-shiny-text--pause-on-hover]': 'pauseOnHover()',\n '[class.wr-shiny-text--yoyo]': 'yoyo()',\n '[class.wr-shiny-text--reverse]': \"direction() === 'right'\",\n '[style.background-image]': 'gradient()',\n '[style.animation-duration]': \"totalDuration() + 's'\",\n },\n})\nexport class WrShinyText {\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Pause the animation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Time for the bright stripe to traverse the text, in seconds. @default 2 */\n readonly speed = input(2, { transform: numAttr(2) });\n\n /** Base text colour outside the bright stripe. Unset falls back to `--wr-shiny-text-base`. */\n readonly color = input<string | null>(null);\n\n /** Sweep highlight colour. Unset falls back to the theme token. */\n readonly shineColor = input<string | null>(null);\n\n /** Gradient angle in degrees. @default 120 */\n readonly spread = input(120, { transform: numAttr(120) });\n\n /** Bounce the stripe back-and-forth instead of restarting. @default false */\n readonly yoyo = input(false, { transform: coerceBooleanProperty });\n\n /** Pause the animation while hovered. @default false */\n readonly pauseOnHover = input(false, { transform: coerceBooleanProperty });\n\n /** Sweep direction. @default 'left' */\n readonly direction = input<'left' | 'right'>('left');\n\n /** Pause between sweeps in seconds. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Total animation cycle (speed + delay) in seconds. */\n protected readonly totalDuration = computed(() => this.speed() + this.delay());\n\n protected readonly gradient = computed(() => {\n const base = this.color() ?? 'var(--wr-shiny-text-base)';\n const shine = this.shineColor() ?? 'var(--wr-shiny-text-shine)';\n return `linear-gradient(${this.spread()}deg, ${base} 0%, ${base} 35%, ${shine} 50%, ${base} 65%, ${base} 100%)`;\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Gradient sweep over text. Applies a `background-clip: text` gradient\n * with a moving highlight — gives any text a subtle shimmer.\n *\n * The directive only adds the `wr-shimmer` host class. Pair with the styles\n * in `ngwr/shiny-text` (`@use 'ngwr/shiny-text'`), which carry the\n * `.wr-shimmer` rule and its keyframes; the umbrella `@use 'ngwr'` forwards\n * the same sheet.\n *\n * @example\n * ```html\n * <h1 wrShimmer>Premium</h1>\n * ```\n */\n@Directive({\n selector: '[wrShimmer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H;;;;;AAKG;AAIH;;;;;;;;;;;;;AAaG;MAKU,SAAS,CAAA;uGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAJrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;AAC9B,iBAAA;;;AC1BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-shiny-text.mjs","sources":["../../../projects/lib/shiny-text/shiny-text.ts","../../../projects/lib/shiny-text/shimmer.ts","../../../projects/lib/shiny-text/ngwr-shiny-text.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Angular adaptation of the ShinyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/shiny-text\n *\n * The reactbits version uses `motion/react` to drive `background-position`\n * via rAF. This port is pure CSS — the same effect via a keyframe that\n * sweeps `background-position`, parameterised by `[speed]` / `[delay]` /\n * `[yoyo]` / `[direction]`.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { isSafeCssValue, numAttr } from 'ngwr/utils';\n\n/**\n * Animated shimmer-over-text effect. A bright stripe sweeps across the\n * text using `background-clip: text` + an animated `background-position`.\n *\n * @example\n * ```html\n * <wr-shiny-text text=\"Premium\" />\n * <wr-shiny-text\n * text=\"Custom\"\n * color=\"#444\"\n * shineColor=\"#a0e0ff\"\n * [speed]=\"3\"\n * [delay]=\"0.5\"\n * [yoyo]=\"true\"\n * [pauseOnHover]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/shiny-text\n */\n@Component({\n selector: 'wr-shiny-text',\n template: '{{ text() }}',\n styleUrl: './shiny-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-shiny-text',\n '[class.wr-shiny-text--paused]': 'disabled()',\n '[class.wr-shiny-text--pause-on-hover]': 'pauseOnHover()',\n '[class.wr-shiny-text--yoyo]': 'yoyo()',\n '[class.wr-shiny-text--reverse]': \"direction() === 'right'\",\n '[style.background-image]': 'gradient()',\n '[style.animation-duration]': \"totalDuration() + 's'\",\n },\n})\nexport class WrShinyText {\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Pause the animation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Time for the bright stripe to traverse the text, in seconds. @default 2 */\n readonly speed = input(2, { transform: numAttr(2) });\n\n /** Base text colour outside the bright stripe. Unset falls back to `--wr-shiny-text-base`. */\n readonly color = input<string | null>(null);\n\n /** Sweep highlight colour. Unset falls back to the theme token. */\n readonly shineColor = input<string | null>(null);\n\n /** Gradient angle in degrees. @default 120 */\n readonly spread = input(120, { transform: numAttr(120) });\n\n /** Bounce the stripe back-and-forth instead of restarting. @default false */\n readonly yoyo = input(false, { transform: coerceBooleanProperty });\n\n /** Pause the animation while hovered. @default false */\n readonly pauseOnHover = input(false, { transform: coerceBooleanProperty });\n\n /** Sweep direction. @default 'left' */\n readonly direction = input<'left' | 'right'>('left');\n\n /** Pause between sweeps in seconds. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Total animation cycle (speed + delay) in seconds. */\n protected readonly totalDuration = computed(() => this.speed() + this.delay());\n\n protected readonly gradient = computed(() => {\n // Both colours are CONCATENATED into the gradient below, so a value that\n // balances the surrounding parens escapes its stop and adds a `url()` layer\n // the browser then fetches. Anything that would not stay in its slot falls\n // back to the theme token — see `isSafeCssValue`.\n const base = this.slot(this.color(), 'var(--wr-shiny-text-base)');\n const shine = this.slot(this.shineColor(), 'var(--wr-shiny-text-shine)');\n return `linear-gradient(${this.spread()}deg, ${base} 0%, ${base} 35%, ${shine} 50%, ${base} 65%, ${base} 100%)`;\n });\n\n private slot(value: string | null, fallback: string): string {\n return value !== null && isSafeCssValue(value) ? value : fallback;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Gradient sweep over text. Applies a `background-clip: text` gradient\n * with a moving highlight — gives any text a subtle shimmer.\n *\n * The directive only adds the `wr-shimmer` host class. Pair with the styles\n * in `ngwr/shiny-text` (`@use 'ngwr/shiny-text'`), which carry the\n * `.wr-shimmer` rule and its keyframes; the umbrella `@use 'ngwr'` forwards\n * the same sheet.\n *\n * @example\n * ```html\n * <h1 wrShimmer>Premium</h1>\n * ```\n */\n@Directive({\n selector: '[wrShimmer]',\n host: { class: 'wr-shimmer' },\n})\nexport class WrShimmer {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;AAaG;AAOH;;;;;;;;;;;;;;;;;;;AAmBG;MAgBU,WAAW,CAAA;;IAEb,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;IAG/B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;AAG7D,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,KAAK,GAAG,KAAK,CAAgB,IAAI;8EAAC;;IAGlC,UAAU,GAAG,KA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SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;AAC9B,iBAAA;;;AC1BD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-splitter-testing.mjs","sources":["../../../projects/lib/splitter/testing/wr-splitter-harness.ts","../../../projects/lib/splitter/testing/ngwr-splitter-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrSplitterHarnessFilters, WrSplitterPaneSizes } from './interfaces';\n\n/** The four arrow keys, by the direction a user would say out loud. */\ntype Arrow = 'left' | 'right' | 'up' | 'down';\n\nconst ARROWS: Record<Arrow, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for `<wr-splitter>` — two panes and the divider between them.\n *\n * **Everything here is the keyboard, and that is not a workaround.** The divider is\n * dragged with a pointer in a browser, but the drag reads\n * `getBoundingClientRect()` and turns a client coordinate into a percentage; jsdom\n * lays nothing out, so every rect is 0×0 and a synthetic drag writes `NaN` into the\n * position. The arrow keys reach the same state, are the accessible path anyway, and\n * are what the WAI-ARIA separator pattern is judged on.\n *\n * **Two words for the axis, and they are opposites.** The component's\n * `orientation=\"horizontal\"` means the panes sit side by side, which needs a\n * VERTICAL divider — so that is what `aria-orientation` says. {@link getOrientation}\n * answers the component's word and {@link getDividerOrientation} the divider's; both\n * are here because a spec that conflated them would look right and assert nothing.\n *\n * **Arrows follow the VISUAL axis.** Under `dir=\"rtl\"` the start pane is the one on\n * the right, so ArrowRight SHRINKS the position. {@link pressArrow} takes the key a\n * user presses rather than a semantic direction, which is the only way a spec can\n * pin that mirroring; {@link setPosition} walks with whichever key currently grows\n * the number, and reports where it landed.\n *\n * @example\n * ```ts\n * const splitter = await loader.getHarness(WrSplitterHarness);\n *\n * expect(await splitter.getPosition()).toBe(50);\n * await splitter.setPosition(70);\n * expect(await splitter.getPaneSizes()).toEqual({ start: 70, end: 30 });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSplitterHarness extends ComponentHarness {\n static hostSelector = 'wr-splitter';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSplitterHarnessFilters = {}): HarnessPredicate<WrSplitterHarness> {\n return new HarnessPredicate(WrSplitterHarness, options)\n .addOption(\n 'orientation',\n options.orientation,\n async (harness, orientation) => (await harness.getOrientation()) === orientation\n )\n .addOption('dividerLabel', options.dividerLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getDividerLabel(), label)\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly divider = this.locatorFor('.wr-splitter__divider');\n\n /**\n * The splitter's own axis: `horizontal` when the panes sit side by side.\n *\n * Read from the host modifier rather than from `aria-orientation`, which says the\n * opposite thing about the same layout — see {@link getDividerOrientation}.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.host()).hasClass('wr-splitter--vertical')) ? 'vertical' : 'horizontal';\n }\n\n /**\n * What the divider announces — the INVERSE of {@link getOrientation}, and correct:\n * a separator's orientation is the line it draws, not the axis it travels along.\n */\n async getDividerOrientation(): Promise<string | null> {\n return (await this.divider()).getAttribute('aria-orientation');\n }\n\n /** The divider's position as a percentage, from `aria-valuenow`. */\n async getPosition(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /** The lowest position the divider will accept, from `aria-valuemin`. */\n async getMinPosition(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /** The highest position the divider will accept, from `aria-valuemax`. */\n async getMaxPosition(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /**\n * What each pane is asking for, in percent, from the `flex-basis` the component\n * writes inline.\n *\n * This is the only evidence a spec without layout has that the panes followed the\n * divider — a measured width is zero for both. They should always sum to 100:\n * the end pane is `100 - position`, so a pair that does not is a component bug\n * rather than a rounding artefact.\n */\n async getPaneSizes(): Promise<WrSplitterPaneSizes> {\n const start = await this.locatorFor('.wr-splitter__pane--start')();\n const end = await this.locatorFor('.wr-splitter__pane--end')();\n\n return {\n start: Number.parseFloat(await start.getCssValue('flex-basis')),\n end: Number.parseFloat(await end.getCssValue('flex-basis')),\n };\n }\n\n /** The start pane's projected text, trimmed. */\n async getStartText(): Promise<string> {\n return (await this.locatorFor('.wr-splitter__pane--start')()).text();\n }\n\n /** The end pane's projected text, trimmed. */\n async getEndText(): Promise<string> {\n return (await this.locatorFor('.wr-splitter__pane--end')()).text();\n }\n\n /** The divider's accessible name — a focusable separator is a widget and needs one. */\n async getDividerLabel(): Promise<string | null> {\n return (await this.divider()).getAttribute('aria-label');\n }\n\n /**\n * Whether the splitter refuses to resize.\n *\n * From the divider's `aria-disabled`, which is the half a screen reader acts on.\n * The component also drops the divider out of the tab order and paints a modifier\n * on the host, and {@link isDividerFocusable} answers the first of those — worth\n * asking separately, because a divider that is announced as disabled and still a\n * tab stop is a control the keyboard can reach and not use.\n */\n async isDisabled(): Promise<boolean> {\n return (await (await this.divider()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the divider is a tab stop (`tabindex=\"0\"`). */\n async isDividerFocusable(): Promise<boolean> {\n return (await (await this.divider()).getAttribute('tabindex')) === '0';\n }\n\n /** Move keyboard focus to the divider. */\n async focusDivider(): Promise<void> {\n return (await this.divider()).focus();\n }\n\n /** Whether the divider currently holds focus. */\n async isDividerFocused(): Promise<boolean> {\n return (await this.divider()).isFocused();\n }\n\n /**\n * Press one arrow key on the divider.\n *\n * The key rather than a direction, deliberately: which way the position moves is a\n * function of the key AND the reading direction, and a `grow()` / `shrink()` pair\n * would hide exactly the behaviour worth asserting. An arrow off the splitter's own\n * axis does nothing at all — the horizontal splitter ignores Up and Down.\n *\n * `shift` is the coarse step: 10 instead of 1.\n */\n async pressArrow(arrow: Arrow, options: { shift?: boolean } = {}): Promise<void> {\n const divider = await this.divider();\n await (options.shift ? divider.sendKeys({ shift: true }, ARROWS[arrow]) : divider.sendKeys(ARROWS[arrow]));\n }\n\n /** Press Home — jumping to `minPosition`, whatever the reading direction. */\n async pressHome(): Promise<void> {\n return (await this.divider()).sendKeys(TestKey.HOME);\n }\n\n /** Press End — jumping to `maxPosition`. Semantic, so it never mirrors under RTL. */\n async pressEnd(): Promise<void> {\n return (await this.divider()).sendKeys(TestKey.END);\n }\n\n /**\n * Walk the divider to a position with the keyboard, and assert it landed there.\n *\n * Ten-unit hops first, then single steps — the same two strides a user has. It\n * walks rather than assigning, because assigning would prove the harness can write\n * a signal and nothing about the component: the clamp, the min / max and the\n * mirroring all live on this path.\n *\n * Throws rather than half-arriving. A target outside `[min, max]` is unreachable by\n * construction, and so is any target the walk cannot hit exactly — the position is a\n * float that a previous drag may have left mid-step, and whole-unit keys cannot get\n * off a fractional offset. Both say so, with where it actually stopped.\n */\n async setPosition(target: number): Promise<void> {\n const [min, max] = [await this.getMinPosition(), await this.getMaxPosition()];\n if (target < min || target > max) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): out of range — this splitter accepts ${min}–${max}. ` +\n 'The component clamps, so the walk would stop at the bound and never reach the number asked for.'\n );\n }\n\n if (target === min) return this.pressHome();\n if (target === max) return this.pressEnd();\n\n await this.focusDivider();\n // The block axis never mirrors, so only the horizontal splitter needs the probe.\n const vertical = (await this.getOrientation()) === 'vertical';\n const [grow, shrink]: [Arrow, Arrow] = vertical\n ? ['down', 'up']\n : (await this.growsWithRight())\n ? ['right', 'left']\n : ['left', 'right'];\n\n for (const shift of [true, false]) {\n const step = shift ? 10 : 1;\n // Recomputed each pass: the coarse hops clamp at the bounds, so the remaining\n // distance is not what simple arithmetic on the starting point would predict.\n let delta = target - (await this.getPosition());\n\n while (Math.abs(delta) >= step) {\n const before = await this.getPosition();\n await this.pressArrow(delta > 0 ? grow : shrink, { shift });\n const now = await this.getPosition();\n\n if (now === before) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): the divider stopped moving at ${now}. A disabled ` +\n 'splitter ignores its arrows, which is the usual reason this happens.'\n );\n }\n delta = target - now;\n }\n }\n\n const landed = await this.getPosition();\n if (landed !== target) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): the walk stopped at ${landed}. The arrows move in whole ` +\n 'units, so a position left on a fraction by a drag cannot be walked onto a whole number.'\n );\n }\n }\n\n /**\n * Whether ArrowRight is currently the key that GROWS the position — true in LTR,\n * false in RTL, where the start pane is the one on the right.\n *\n * Probed rather than read off `Directionality`, which a harness has no access to:\n * press, look, and put it back. At the top of the range a growing press is clamped\n * and would prove nothing, so the probe presses the other way there instead. The\n * undo is conditional — a press that moved nothing has nothing to undo, and undoing\n * it anyway would move the divider by one in the direction the probe was testing.\n */\n private async growsWithRight(): Promise<boolean> {\n const before = await this.getPosition();\n const atCeiling = before >= (await this.getMaxPosition());\n const [probe, undo]: [Arrow, Arrow] = atCeiling ? ['left', 'right'] : ['right', 'left'];\n\n await this.pressArrow(probe);\n const after = await this.getPosition();\n if (after !== before) await this.pressArrow(undo);\n\n return atCeiling ? after < before : after > before;\n }\n\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.divider()).getAttribute(attribute);\n return raw === null ? Number.NaN : Number(raw);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AASH,MAAM,MAAM,GAA2B;IACrC,IAAI,EAAE,OAAO,CAAC,UAAU;IACxB,KAAK,EAAE,OAAO,CAAC,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC,QAAQ;IACpB,IAAI,EAAE,OAAO,CAAC,UAAU;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,MAAM,KAAK,MAAM,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAA,uBAAA,EAA0B,MAAM,CAAA,2BAAA,CAA6B;AAClG,gBAAA,yFAAyF,CAC5F;QACH;IACF;AAEA;;;;;;;;;AASG;AACK,IAAA,MAAM,cAAc,GAAA;AAC1B,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE;QACvC,MAAM,SAAS,GAAG,MAAM,KAAK,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QACzD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAmB,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC;AAEvF,QAAA,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;AAC5B,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE;QACtC,IAAI,KAAK,KAAK,MAAM;AAAE,YAAA,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AAEjD,QAAA,OAAO,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM;IACpD;IAEQ,MAAM,OAAO,CAAC,SAAiB,EAAA;AACrC,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,SAAS,CAAC;AAChE,QAAA,OAAO,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAChD;;;AC1RF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-splitter-testing.mjs","sources":["../../../projects/lib/splitter/testing/wr-splitter-harness.ts","../../../projects/lib/splitter/testing/ngwr-splitter-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrSplitterArrowKey, WrSplitterHarnessFilters, WrSplitterPaneSizes } from './interfaces';\n\nconst ARROWS: Record<WrSplitterArrowKey, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/**\n * Test harness for `<wr-splitter>` — two panes and the divider between them.\n *\n * **Everything here is the keyboard, and that is not a workaround.** The divider is\n * dragged with a pointer in a browser, but the drag reads\n * `getBoundingClientRect()` and turns a client coordinate into a percentage; jsdom\n * lays nothing out, so every rect is 0×0 and a synthetic drag writes `NaN` into the\n * position. The arrow keys reach the same state, are the accessible path anyway, and\n * are what the WAI-ARIA separator pattern is judged on.\n *\n * **Two words for the axis, and they are opposites.** The component's\n * `orientation=\"horizontal\"` means the panes sit side by side, which needs a\n * VERTICAL divider — so that is what `aria-orientation` says. {@link getOrientation}\n * answers the component's word and {@link getDividerOrientation} the divider's; both\n * are here because a spec that conflated them would look right and assert nothing.\n *\n * **Arrows follow the VISUAL axis.** Under `dir=\"rtl\"` the start pane is the one on\n * the right, so ArrowRight SHRINKS the position. {@link pressArrow} takes the key a\n * user presses rather than a semantic direction, which is the only way a spec can\n * pin that mirroring; {@link setPosition} walks with whichever key currently grows\n * the number, and reports where it landed.\n *\n * @example\n * ```ts\n * const splitter = await loader.getHarness(WrSplitterHarness);\n *\n * expect(await splitter.getPosition()).toBe(50);\n * await splitter.setPosition(70);\n * expect(await splitter.getPaneSizes()).toEqual({ start: 70, end: 30 });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSplitterHarness extends ComponentHarness {\n static hostSelector = 'wr-splitter';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSplitterHarnessFilters = {}): HarnessPredicate<WrSplitterHarness> {\n return new HarnessPredicate(WrSplitterHarness, options)\n .addOption(\n 'orientation',\n options.orientation,\n async (harness, orientation) => (await harness.getOrientation()) === orientation\n )\n .addOption('dividerLabel', options.dividerLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getDividerLabel(), label)\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly divider = this.locatorFor('.wr-splitter__divider');\n\n /**\n * The splitter's own axis: `horizontal` when the panes sit side by side.\n *\n * Read from the host modifier rather than from `aria-orientation`, which says the\n * opposite thing about the same layout — see {@link getDividerOrientation}.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.host()).hasClass('wr-splitter--vertical')) ? 'vertical' : 'horizontal';\n }\n\n /**\n * What the divider announces — the INVERSE of {@link getOrientation}, and correct:\n * a separator's orientation is the line it draws, not the axis it travels along.\n */\n async getDividerOrientation(): Promise<string | null> {\n return (await this.divider()).getAttribute('aria-orientation');\n }\n\n /** The divider's position as a percentage, from `aria-valuenow`. */\n async getPosition(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /** The lowest position the divider will accept, from `aria-valuemin`. */\n async getMinPosition(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /** The highest position the divider will accept, from `aria-valuemax`. */\n async getMaxPosition(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /**\n * What each pane is asking for, in percent, from the `flex-basis` the component\n * writes inline.\n *\n * This is the only evidence a spec without layout has that the panes followed the\n * divider — a measured width is zero for both. They should always sum to 100:\n * the end pane is `100 - position`, so a pair that does not is a component bug\n * rather than a rounding artefact.\n */\n async getPaneSizes(): Promise<WrSplitterPaneSizes> {\n const start = await this.locatorFor('.wr-splitter__pane--start')();\n const end = await this.locatorFor('.wr-splitter__pane--end')();\n\n return {\n start: Number.parseFloat(await start.getCssValue('flex-basis')),\n end: Number.parseFloat(await end.getCssValue('flex-basis')),\n };\n }\n\n /** The start pane's projected text, trimmed. */\n async getStartText(): Promise<string> {\n return (await this.locatorFor('.wr-splitter__pane--start')()).text();\n }\n\n /** The end pane's projected text, trimmed. */\n async getEndText(): Promise<string> {\n return (await this.locatorFor('.wr-splitter__pane--end')()).text();\n }\n\n /** The divider's accessible name — a focusable separator is a widget and needs one. */\n async getDividerLabel(): Promise<string | null> {\n return (await this.divider()).getAttribute('aria-label');\n }\n\n /**\n * Whether the splitter refuses to resize.\n *\n * From the divider's `aria-disabled`, which is the half a screen reader acts on.\n * The component also drops the divider out of the tab order and paints a modifier\n * on the host, and {@link isDividerFocusable} answers the first of those — worth\n * asking separately, because a divider that is announced as disabled and still a\n * tab stop is a control the keyboard can reach and not use.\n */\n async isDisabled(): Promise<boolean> {\n return (await (await this.divider()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the divider is a tab stop (`tabindex=\"0\"`). */\n async isDividerFocusable(): Promise<boolean> {\n return (await (await this.divider()).getAttribute('tabindex')) === '0';\n }\n\n /** Move keyboard focus to the divider. */\n async focusDivider(): Promise<void> {\n return (await this.divider()).focus();\n }\n\n /** Whether the divider currently holds focus. */\n async isDividerFocused(): Promise<boolean> {\n return (await this.divider()).isFocused();\n }\n\n /**\n * Press one arrow key on the divider.\n *\n * The key rather than a direction, deliberately: which way the position moves is a\n * function of the key AND the reading direction, and a `grow()` / `shrink()` pair\n * would hide exactly the behaviour worth asserting. An arrow off the splitter's own\n * axis does nothing at all — the horizontal splitter ignores Up and Down.\n *\n * `shift` is the coarse step: 10 instead of 1.\n */\n async pressArrow(arrow: WrSplitterArrowKey, options: { shift?: boolean } = {}): Promise<void> {\n const divider = await this.divider();\n await (options.shift ? divider.sendKeys({ shift: true }, ARROWS[arrow]) : divider.sendKeys(ARROWS[arrow]));\n }\n\n /** Press Home — jumping to `minPosition`, whatever the reading direction. */\n async pressHome(): Promise<void> {\n return (await this.divider()).sendKeys(TestKey.HOME);\n }\n\n /** Press End — jumping to `maxPosition`. Semantic, so it never mirrors under RTL. */\n async pressEnd(): Promise<void> {\n return (await this.divider()).sendKeys(TestKey.END);\n }\n\n /**\n * Walk the divider to a position with the keyboard, and assert it landed there.\n *\n * Ten-unit hops first, then single steps — the same two strides a user has. It\n * walks rather than assigning, because assigning would prove the harness can write\n * a signal and nothing about the component: the clamp, the min / max and the\n * mirroring all live on this path.\n *\n * Throws rather than half-arriving. A target outside `[min, max]` is unreachable by\n * construction, and so is any target the walk cannot hit exactly — the position is a\n * float that a previous drag may have left mid-step, and whole-unit keys cannot get\n * off a fractional offset. Both say so, with where it actually stopped.\n */\n async setPosition(target: number): Promise<void> {\n const [min, max] = [await this.getMinPosition(), await this.getMaxPosition()];\n if (target < min || target > max) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): out of range — this splitter accepts ${min}–${max}. ` +\n 'The component clamps, so the walk would stop at the bound and never reach the number asked for.'\n );\n }\n\n if (target === min) return this.pressHome();\n if (target === max) return this.pressEnd();\n\n await this.focusDivider();\n // The block axis never mirrors, so only the horizontal splitter needs the probe.\n const vertical = (await this.getOrientation()) === 'vertical';\n const [grow, shrink]: [WrSplitterArrowKey, WrSplitterArrowKey] = vertical\n ? ['down', 'up']\n : (await this.growsWithRight())\n ? ['right', 'left']\n : ['left', 'right'];\n\n for (const shift of [true, false]) {\n const step = shift ? 10 : 1;\n // Recomputed each pass: the coarse hops clamp at the bounds, so the remaining\n // distance is not what simple arithmetic on the starting point would predict.\n let delta = target - (await this.getPosition());\n\n while (Math.abs(delta) >= step) {\n const before = await this.getPosition();\n await this.pressArrow(delta > 0 ? grow : shrink, { shift });\n const now = await this.getPosition();\n\n if (now === before) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): the divider stopped moving at ${now}. A disabled ` +\n 'splitter ignores its arrows, which is the usual reason this happens.'\n );\n }\n delta = target - now;\n }\n }\n\n const landed = await this.getPosition();\n if (landed !== target) {\n throw new Error(\n `WrSplitterHarness.setPosition(${target}): the walk stopped at ${landed}. The arrows move in whole ` +\n 'units, so a position left on a fraction by a drag cannot be walked onto a whole number.'\n );\n }\n }\n\n /**\n * Whether ArrowRight is currently the key that GROWS the position — true in LTR,\n * false in RTL, where the start pane is the one on the right.\n *\n * Probed rather than read off `Directionality`, which a harness has no access to:\n * press, look, and put it back. At the top of the range a growing press is clamped\n * and would prove nothing, so the probe presses the other way there instead. The\n * undo is conditional — a press that moved nothing has nothing to undo, and undoing\n * it anyway would move the divider by one in the direction the probe was testing.\n */\n private async growsWithRight(): Promise<boolean> {\n const before = await this.getPosition();\n const atCeiling = before >= (await this.getMaxPosition());\n const [probe, undo]: [WrSplitterArrowKey, WrSplitterArrowKey] = atCeiling ? ['left', 'right'] : ['right', 'left'];\n\n await this.pressArrow(probe);\n const after = await this.getPosition();\n if (after !== before) await this.pressArrow(undo);\n\n return atCeiling ? after < before : after > before;\n }\n\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.divider()).getAttribute(attribute);\n return raw === null ? Number.NaN : Number(raw);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH,MAAM,MAAM,GAAwC;IAClD,IAAI,EAAE,OAAO,CAAC,UAAU;IACxB,KAAK,EAAE,OAAO,CAAC,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC,QAAQ;IACpB,IAAI,EAAE,OAAO,CAAC,UAAU;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACG,MAAO,iBAAkB,SAAQ,gBAAgB,CAAA;AACrD,IAAA,OAAO,YAAY,GAAG,aAAa;;AAGnC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAoC,EAAE,EAAA;AAChD,QAAA,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,OAAO;aACnD,SAAS,CACR,aAAa,EACb,OAAO,CAAC,WAAW,EACnB,OAAO,OAAO,EAAE,WAAW,KAAK,CAAC,MAAM,OAAO,CAAC,cAAc,EAAE,MAAM,WAAW;aAEjF,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,EAAE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A6C,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC;AAEjH,QAAA,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;AAC5B,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE;QACtC,IAAI,KAAK,KAAK,MAAM;AAAE,YAAA,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AAEjD,QAAA,OAAO,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM;IACpD;IAEQ,MAAM,OAAO,CAAC,SAAiB,EAAA;AACrC,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,SAAS,CAAC;AAChE,QAAA,OAAO,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAChD;;;ACvRF;;AAEG;;;;"}
@@ -268,12 +268,13 @@ class WrSquircle {
268
268
  host.style.removeProperty('--wr-squircle-border-color');
269
269
  }
270
270
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrSquircle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
271
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrSquircle, isStandalone: true, selector: "[wrSquircle]", inputs: { radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, smoothing: { classPropertyName: "smoothing", publicName: "smoothing", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, borderWidth: { classPropertyName: "borderWidth", publicName: "borderWidth", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, corners: { classPropertyName: "corners", publicName: "corners", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { enabled: "enabledChange", borderWidth: "borderWidthChange", borderColor: "borderColorChange", corners: "cornersChange" }, host: { properties: { "class.wr-squircle--bordered": "borderWidth() > 0 && enabled()" } }, ngImport: i0 });
271
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: WrSquircle, isStandalone: true, selector: "[wrSquircle]", inputs: { radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, smoothing: { classPropertyName: "smoothing", publicName: "smoothing", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, borderWidth: { classPropertyName: "borderWidth", publicName: "borderWidth", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, corners: { classPropertyName: "corners", publicName: "corners", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { enabled: "enabledChange", borderWidth: "borderWidthChange", borderColor: "borderColorChange", corners: "cornersChange" }, host: { properties: { "class.wr-squircle--bordered": "borderWidth() > 0 && enabled()" } }, exportAs: ["wrSquircle"], ngImport: i0 });
272
272
  }
273
273
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrSquircle, decorators: [{
274
274
  type: Directive,
275
275
  args: [{
276
276
  selector: '[wrSquircle]',
277
+ exportAs: 'wrSquircle',
277
278
  host: { '[class.wr-squircle--bordered]': 'borderWidth() > 0 && enabled()' },
278
279
  }]
279
280
  }], ctorParameters: () => [], propDecorators: { radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], smoothing: [{ type: i0.Input, args: [{ isSignal: true, alias: "smoothing", required: false }] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }, { type: i0.Output, args: ["enabledChange"] }], borderWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderWidth", required: false }] }, { type: i0.Output, args: ["borderWidthChange"] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }, { type: i0.Output, args: ["borderColorChange"] }], corners: [{ type: i0.Input, args: [{ isSignal: true, alias: "corners", required: false }] }, { type: i0.Output, args: ["cornersChange"] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-squircle.mjs","sources":["../../../projects/lib/squircle/compute-squircle-path.ts","../../../projects/lib/squircle/wr-squircle.ts","../../../projects/lib/squircle/wr-squircle-host.ts","../../../projects/lib/squircle/ngwr-squircle.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Squircle path computation — port of the algorithm from `figma-squircle`\n * (https://github.com/phamfoo/figma-squircle, MIT). Generates an SVG `d`\n * string for a smooth-corner rectangle.\n */\n\n/** Per-corner radii for the squircle. */\ninterface WrSquircleCorners {\n readonly topLeft: number;\n readonly topRight: number;\n readonly bottomRight: number;\n readonly bottomLeft: number;\n}\n\ninterface CornerParams {\n readonly a: number;\n readonly b: number;\n readonly c: number;\n readonly d: number;\n readonly p: number;\n readonly arcSectionLength: number;\n readonly cornerRadius: number;\n}\n\nfunction toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nfunction cornerParams(cornerRadius: number, cornerSmoothing: number, budget: number): CornerParams {\n if (cornerRadius <= 0) {\n return { a: 0, b: 0, c: 0, d: 0, p: 0, arcSectionLength: 0, cornerRadius: 0 };\n }\n let p = (1 + cornerSmoothing) * cornerRadius;\n // Cap smoothing so the corner fits within the available budget.\n let s = cornerSmoothing;\n const maxSmoothing = budget / cornerRadius - 1;\n if (maxSmoothing < s) {\n s = Math.max(0, maxSmoothing);\n p = (1 + s) * cornerRadius;\n }\n const arcMeasure = 90 * (1 - s);\n const arcSectionLength = Math.sin(toRadians(arcMeasure / 2)) * cornerRadius * Math.SQRT2;\n const angleAlpha = (90 - arcMeasure) / 2;\n const p3p4 = cornerRadius * Math.tan(toRadians(angleAlpha / 2));\n const angleBeta = 45 * s;\n const c = p3p4 * Math.cos(toRadians(angleBeta));\n const d = c * Math.tan(toRadians(angleBeta));\n const b = (p - arcSectionLength - c - d) / 3;\n const a = 2 * b;\n return { a, b, c, d, p, arcSectionLength, cornerRadius };\n}\n\n/** Cubic-bezier + arc commands for one corner — anchored at its `p` distance. */\nfunction drawCorner(c: CornerParams, rotation: 'tl' | 'tr' | 'br' | 'bl'): string {\n if (c.cornerRadius === 0) return '';\n const { a, b, c: cc, d, arcSectionLength, cornerRadius } = c;\n switch (rotation) {\n case 'tr':\n return `c ${a} 0 ${a + b} 0 ${a + b + cc} ${d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${arcSectionLength} c ${d} ${cc} ${d} ${b + cc} ${d} ${a + b + cc}`;\n case 'br':\n return `c 0 ${a} 0 ${a + b} ${-d} ${a + b + cc} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${arcSectionLength} c ${-cc} ${d} ${-(b + cc)} ${d} ${-(a + b + cc)} ${d}`;\n case 'bl':\n return `c ${-a} 0 ${-(a + b)} 0 ${-(a + b + cc)} ${-d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${-arcSectionLength} c ${-d} ${-cc} ${-d} ${-(b + cc)} ${-d} ${-(a + b + cc)}`;\n case 'tl':\n return `c 0 ${-a} 0 ${-(a + b)} ${d} ${-(a + b + cc)} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${-arcSectionLength} c ${cc} ${-d} ${b + cc} ${-d} ${a + b + cc} ${-d}`;\n }\n}\n\n/**\n * Generate an SVG `d` string for a squircle (smooth-corner rectangle).\n *\n * @param width Box width in user units.\n * @param height Box height in user units.\n * @param radius Either a single number applied to all four corners or a\n * `WrSquircleCorners` object with per-corner radii.\n * @param smoothing 0–1. `0` = standard rounded rectangle; `1` = full\n * iOS-style smooth corner. @default 1\n */\nfunction squirclePath(width: number, height: number, radius: number | WrSquircleCorners, smoothing = 1): string {\n const corners: WrSquircleCorners =\n typeof radius === 'number'\n ? { topLeft: radius, topRight: radius, bottomRight: radius, bottomLeft: radius }\n : radius;\n\n // Budget per corner = half of the shorter dimension.\n const budget = Math.min(width / 2, height / 2);\n\n const tl = cornerParams(Math.min(corners.topLeft, budget), smoothing, budget);\n const tr = cornerParams(Math.min(corners.topRight, budget), smoothing, budget);\n const br = cornerParams(Math.min(corners.bottomRight, budget), smoothing, budget);\n const bl = cornerParams(Math.min(corners.bottomLeft, budget), smoothing, budget);\n\n return [\n `M ${tl.p} 0`,\n `L ${width - tr.p} 0`,\n drawCorner(tr, 'tr'),\n `L ${width} ${height - br.p}`,\n drawCorner(br, 'br'),\n `L ${bl.p} ${height}`,\n drawCorner(bl, 'bl'),\n `L 0 ${tl.p}`,\n drawCorner(tl, 'tl'),\n 'Z',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport { squirclePath };\nexport type { WrSquircleCorners };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, PLATFORM_ID, effect, inject, input, model } from '@angular/core';\n\nimport { squirclePath, type WrSquircleCorners } from './compute-squircle-path';\nimport type { WrSquircleCornerMask } from './interfaces';\n\n/**\n * Which corners to squircle. `'all'` = standard four-corner squircle;\n * the side-named values squircle the two corners on that side and leave\n * the other two at 90°. Useful for tab-/segment-style controls where\n * only outer corners need smoothing.\n */\nfunction maskToRadii(mask: WrSquircleCornerMask, r: number): WrSquircleCorners {\n switch (mask) {\n case 'left':\n return { topLeft: r, topRight: 0, bottomRight: 0, bottomLeft: r };\n case 'right':\n return { topLeft: 0, topRight: r, bottomRight: r, bottomLeft: 0 };\n case 'top':\n return { topLeft: r, topRight: r, bottomRight: 0, bottomLeft: 0 };\n case 'bottom':\n return { topLeft: 0, topRight: 0, bottomRight: r, bottomLeft: r };\n case 'none':\n return { topLeft: 0, topRight: 0, bottomRight: 0, bottomLeft: 0 };\n case 'all':\n default:\n return { topLeft: r, topRight: r, bottomRight: r, bottomLeft: r };\n }\n}\n\n/**\n * Apply a Figma-style smooth-corner (\"squircle\") `clip-path` to the host\n * element. Re-computes the path whenever the element resizes.\n *\n * Borders: pass `[borderWidth]` (px) + `[borderColor]` and the directive\n * paints a `::before` pseudo with an *inset* squircle path on top of the\n * host. The visible border is the host's own background colour, so set\n * `background: <border-color>` on the host (or use the convenience\n * `[borderColor]` input which writes the host background for you).\n *\n * @example\n * ```html\n * <button wr-btn wrSquircle [radius]=\"16\">Save</button>\n * <wr-tag wrSquircle>v2.0</wr-tag>\n * <div wrSquircle [radius]=\"32\" [smoothing]=\"0.8\">…</div>\n * <div wrSquircle [borderWidth]=\"2\" borderColor=\"var(--wr-color-primary)\">…</div>\n * ```\n */\n@Directive({\n selector: '[wrSquircle]',\n host: { '[class.wr-squircle--bordered]': 'borderWidth() > 0 && enabled()' },\n})\nexport class WrSquircle {\n /** Corner radius in CSS pixels. Falls back to `--wr-border-radius-base` × 16. @default 12 */\n readonly radius = input(12, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 12)) });\n\n /** Smoothing factor — `0` = plain rounded rect; `1` = full smooth iOS corner. @default 1 */\n readonly smoothing = input(1, {\n transform: (v: unknown): number => Math.min(1, Math.max(0, coerceNumberProperty(v, 1))),\n });\n\n /**\n * Whether the squircle clip-path is applied. When `false`, the directive\n * stays inert (clip-path cleared).\n *\n * Modelled as `model()` so a parent component composing this directive\n * (`inject(WrSquircle, { self: true }).enabled.set(...)`) can flip the\n * state from outside without exposing an `enabled` input on its own API.\n *\n * @default true\n */\n readonly enabled = model(true);\n\n /**\n * Border thickness in CSS pixels. `0` disables the border ring entirely.\n * Modelled (not `input()`) so parent components composing this directive\n * can flip it imperatively — e.g. `WrButton` turning on a 1px ring when\n * `shape=\"squircle\" outlined` is active.\n * @default 0\n */\n readonly borderWidth = model(0);\n\n /**\n * Border colour — any CSS colour. Applied to the host's background so the\n * outer squircle reveals it. Defaults to `currentColor` so the consuming\n * element's text colour drives the ring.\n * @default 'currentColor'\n */\n readonly borderColor = model<string>('currentColor');\n\n /**\n * Which corners to squircle. `'all'` (default) is the standard four-\n * corner shape; `'left'` / `'right'` / `'top'` / `'bottom'` squircle\n * only the two corners on the named side and leave the other two at\n * 90°. `'none'` is equivalent to disabling the directive.\n *\n * Modelled so parent components composing the directive can flip the\n * value imperatively — used by `WrButtonGroup` to squircle only the\n * outer corners of the first / last child.\n *\n * @default 'all'\n */\n readonly corners = model<WrSquircleCornerMask>('all');\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly destroyRef = inject(DestroyRef);\n private observer: ResizeObserver | null = null;\n\n constructor() {\n if (!this.isBrowser) return;\n const host = this.el.nativeElement;\n // Reactively re-apply when inputs change.\n effect(() => {\n this.radius();\n this.smoothing();\n this.enabled();\n this.borderWidth();\n this.borderColor();\n this.corners();\n this.apply();\n });\n // Re-apply on resize.\n this.observer = new ResizeObserver(() => this.apply());\n this.observer.observe(host);\n this.destroyRef.onDestroy(() => {\n this.observer?.disconnect();\n this.clear();\n });\n }\n\n private apply(): void {\n const host = this.el.nativeElement;\n if (!this.enabled()) {\n this.clear();\n return;\n }\n const rect = host.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) return;\n\n const r = this.radius();\n const s = this.smoothing();\n const radii = maskToRadii(this.corners(), r);\n const outer = squirclePath(rect.width, rect.height, radii, s);\n const value = `path(\"${outer}\")`;\n host.style.clipPath = value;\n host.style.setProperty('-webkit-clip-path', value);\n\n // Border mode: paint an INNER squircle in a `::before` pseudo on top of\n // the host so the host's own bg only shows at the border-width perimeter.\n const bw = this.borderWidth();\n if (bw > 0) {\n const innerW = Math.max(0, rect.width - bw * 2);\n const innerH = Math.max(0, rect.height - bw * 2);\n const innerR = Math.max(0, r - bw);\n if (innerW > 0 && innerH > 0) {\n const innerRadii = maskToRadii(this.corners(), innerR);\n const inner = squirclePath(innerW, innerH, innerRadii, s);\n host.style.setProperty('--wr-squircle-inner-path', `path(\"${inner}\")`);\n }\n host.style.setProperty('--wr-squircle-border-width', `${bw}px`);\n // Only set the colour var inline when the consumer asked for a\n // specific colour. Leaving the default `'currentColor'` un-inlined\n // lets host CSS (e.g. WrButton's outlined-squircle rule) override\n // the var via SCSS without losing to inline-style specificity.\n const bc = this.borderColor();\n if (bc && bc !== 'currentColor') {\n host.style.setProperty('--wr-squircle-border-color', bc);\n } else {\n host.style.removeProperty('--wr-squircle-border-color');\n }\n } else {\n host.style.removeProperty('--wr-squircle-inner-path');\n host.style.removeProperty('--wr-squircle-border-width');\n host.style.removeProperty('--wr-squircle-border-color');\n }\n }\n\n private clear(): void {\n const host = this.el.nativeElement;\n host.style.removeProperty('clip-path');\n host.style.removeProperty('-webkit-clip-path');\n host.style.removeProperty('--wr-squircle-inner-path');\n host.style.removeProperty('--wr-squircle-border-width');\n host.style.removeProperty('--wr-squircle-border-color');\n }\n}\n\nexport type { WrSquircleCornerMask } from './interfaces';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation } from '@angular/core';\n\nimport { WrSquircle } from './wr-squircle';\n\n/**\n * Standalone squircle container. Equivalent to `<div wrSquircle>` but\n * named for ergonomics in templates.\n *\n * @example\n * ```html\n * <wr-squircle [radius]=\"24\" style=\"width: 160px; height: 160px; background: var(--wr-color-primary)\">\n * …\n * </wr-squircle>\n * ```\n *\n * @see https://ngwr.dev/reference/components/squircle\n */\n@Component({\n selector: 'wr-squircle',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-squircle' },\n hostDirectives: [{ directive: WrSquircle, inputs: ['radius', 'smoothing', 'borderWidth', 'borderColor'] }],\n})\nexport class WrSquircleHost {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;AASG;AAoBH,SAAS,SAAS,CAAC,GAAW,EAAA;IAC5B,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG;AAC9B;AAEA,SAAS,YAAY,CAAC,YAAoB,EAAE,eAAuB,EAAE,MAAc,EAAA;AACjF,IAAA,IAAI,YAAY,IAAI,CAAC,EAAE;AACrB,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;IAC/E;IACA,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,IAAI,YAAY;;IAE5C,IAAI,CAAC,GAAG,eAAe;AACvB,IAAA,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,CAAC;AAC9C,IAAA,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC;QAC7B,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,YAAY;IAC5B;IACA,MAAM,UAAU,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/B,IAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK;IACxF,MAAM,UAAU,GAAG,CAAC,EAAE,GAAG,UAAU,IAAI,CAAC;AACxC,IAAA,MAAM,I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AAc,CAAA;uGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,iRALf,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAKf,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAC9B,oBAAA,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC;AAC3G,iBAAA;;;AC9BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-squircle.mjs","sources":["../../../projects/lib/squircle/compute-squircle-path.ts","../../../projects/lib/squircle/wr-squircle.ts","../../../projects/lib/squircle/wr-squircle-host.ts","../../../projects/lib/squircle/ngwr-squircle.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * Squircle path computation — port of the algorithm from `figma-squircle`\n * (https://github.com/phamfoo/figma-squircle, MIT). Generates an SVG `d`\n * string for a smooth-corner rectangle.\n */\n\n/** Per-corner radii for the squircle. */\ninterface WrSquircleCorners {\n readonly topLeft: number;\n readonly topRight: number;\n readonly bottomRight: number;\n readonly bottomLeft: number;\n}\n\ninterface CornerParams {\n readonly a: number;\n readonly b: number;\n readonly c: number;\n readonly d: number;\n readonly p: number;\n readonly arcSectionLength: number;\n readonly cornerRadius: number;\n}\n\nfunction toRadians(deg: number): number {\n return (deg * Math.PI) / 180;\n}\n\nfunction cornerParams(cornerRadius: number, cornerSmoothing: number, budget: number): CornerParams {\n if (cornerRadius <= 0) {\n return { a: 0, b: 0, c: 0, d: 0, p: 0, arcSectionLength: 0, cornerRadius: 0 };\n }\n let p = (1 + cornerSmoothing) * cornerRadius;\n // Cap smoothing so the corner fits within the available budget.\n let s = cornerSmoothing;\n const maxSmoothing = budget / cornerRadius - 1;\n if (maxSmoothing < s) {\n s = Math.max(0, maxSmoothing);\n p = (1 + s) * cornerRadius;\n }\n const arcMeasure = 90 * (1 - s);\n const arcSectionLength = Math.sin(toRadians(arcMeasure / 2)) * cornerRadius * Math.SQRT2;\n const angleAlpha = (90 - arcMeasure) / 2;\n const p3p4 = cornerRadius * Math.tan(toRadians(angleAlpha / 2));\n const angleBeta = 45 * s;\n const c = p3p4 * Math.cos(toRadians(angleBeta));\n const d = c * Math.tan(toRadians(angleBeta));\n const b = (p - arcSectionLength - c - d) / 3;\n const a = 2 * b;\n return { a, b, c, d, p, arcSectionLength, cornerRadius };\n}\n\n/** Cubic-bezier + arc commands for one corner — anchored at its `p` distance. */\nfunction drawCorner(c: CornerParams, rotation: 'tl' | 'tr' | 'br' | 'bl'): string {\n if (c.cornerRadius === 0) return '';\n const { a, b, c: cc, d, arcSectionLength, cornerRadius } = c;\n switch (rotation) {\n case 'tr':\n return `c ${a} 0 ${a + b} 0 ${a + b + cc} ${d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${arcSectionLength} c ${d} ${cc} ${d} ${b + cc} ${d} ${a + b + cc}`;\n case 'br':\n return `c 0 ${a} 0 ${a + b} ${-d} ${a + b + cc} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${arcSectionLength} c ${-cc} ${d} ${-(b + cc)} ${d} ${-(a + b + cc)} ${d}`;\n case 'bl':\n return `c ${-a} 0 ${-(a + b)} 0 ${-(a + b + cc)} ${-d} a ${cornerRadius} ${cornerRadius} 0 0 1 ${-arcSectionLength} ${-arcSectionLength} c ${-d} ${-cc} ${-d} ${-(b + cc)} ${-d} ${-(a + b + cc)}`;\n case 'tl':\n return `c 0 ${-a} 0 ${-(a + b)} ${d} ${-(a + b + cc)} a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${-arcSectionLength} c ${cc} ${-d} ${b + cc} ${-d} ${a + b + cc} ${-d}`;\n }\n}\n\n/**\n * Generate an SVG `d` string for a squircle (smooth-corner rectangle).\n *\n * @param width Box width in user units.\n * @param height Box height in user units.\n * @param radius Either a single number applied to all four corners or a\n * `WrSquircleCorners` object with per-corner radii.\n * @param smoothing 0–1. `0` = standard rounded rectangle; `1` = full\n * iOS-style smooth corner. @default 1\n */\nfunction squirclePath(width: number, height: number, radius: number | WrSquircleCorners, smoothing = 1): string {\n const corners: WrSquircleCorners =\n typeof radius === 'number'\n ? { topLeft: radius, topRight: radius, bottomRight: radius, bottomLeft: radius }\n : radius;\n\n // Budget per corner = half of the shorter dimension.\n const budget = Math.min(width / 2, height / 2);\n\n const tl = cornerParams(Math.min(corners.topLeft, budget), smoothing, budget);\n const tr = cornerParams(Math.min(corners.topRight, budget), smoothing, budget);\n const br = cornerParams(Math.min(corners.bottomRight, budget), smoothing, budget);\n const bl = cornerParams(Math.min(corners.bottomLeft, budget), smoothing, budget);\n\n return [\n `M ${tl.p} 0`,\n `L ${width - tr.p} 0`,\n drawCorner(tr, 'tr'),\n `L ${width} ${height - br.p}`,\n drawCorner(br, 'br'),\n `L ${bl.p} ${height}`,\n drawCorner(bl, 'bl'),\n `L 0 ${tl.p}`,\n drawCorner(tl, 'tl'),\n 'Z',\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport { squirclePath };\nexport type { WrSquircleCorners };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, PLATFORM_ID, effect, inject, input, model } from '@angular/core';\n\nimport { squirclePath, type WrSquircleCorners } from './compute-squircle-path';\nimport type { WrSquircleCornerMask } from './interfaces';\n\n/**\n * Which corners to squircle. `'all'` = standard four-corner squircle;\n * the side-named values squircle the two corners on that side and leave\n * the other two at 90°. Useful for tab-/segment-style controls where\n * only outer corners need smoothing.\n */\nfunction maskToRadii(mask: WrSquircleCornerMask, r: number): WrSquircleCorners {\n switch (mask) {\n case 'left':\n return { topLeft: r, topRight: 0, bottomRight: 0, bottomLeft: r };\n case 'right':\n return { topLeft: 0, topRight: r, bottomRight: r, bottomLeft: 0 };\n case 'top':\n return { topLeft: r, topRight: r, bottomRight: 0, bottomLeft: 0 };\n case 'bottom':\n return { topLeft: 0, topRight: 0, bottomRight: r, bottomLeft: r };\n case 'none':\n return { topLeft: 0, topRight: 0, bottomRight: 0, bottomLeft: 0 };\n case 'all':\n default:\n return { topLeft: r, topRight: r, bottomRight: r, bottomLeft: r };\n }\n}\n\n/**\n * Apply a Figma-style smooth-corner (\"squircle\") `clip-path` to the host\n * element. Re-computes the path whenever the element resizes.\n *\n * Borders: pass `[borderWidth]` (px) + `[borderColor]` and the directive\n * paints a `::before` pseudo with an *inset* squircle path on top of the\n * host. The visible border is the host's own background colour, so set\n * `background: <border-color>` on the host (or use the convenience\n * `[borderColor]` input which writes the host background for you).\n *\n * @example\n * ```html\n * <button wr-btn wrSquircle [radius]=\"16\">Save</button>\n * <wr-tag wrSquircle>v2.0</wr-tag>\n * <div wrSquircle [radius]=\"32\" [smoothing]=\"0.8\">…</div>\n * <div wrSquircle [borderWidth]=\"2\" borderColor=\"var(--wr-color-primary)\">…</div>\n * ```\n */\n@Directive({\n selector: '[wrSquircle]',\n exportAs: 'wrSquircle',\n host: { '[class.wr-squircle--bordered]': 'borderWidth() > 0 && enabled()' },\n})\nexport class WrSquircle {\n /** Corner radius in CSS pixels. Falls back to `--wr-border-radius-base` × 16. @default 12 */\n readonly radius = input(12, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 12)) });\n\n /** Smoothing factor — `0` = plain rounded rect; `1` = full smooth iOS corner. @default 1 */\n readonly smoothing = input(1, {\n transform: (v: unknown): number => Math.min(1, Math.max(0, coerceNumberProperty(v, 1))),\n });\n\n /**\n * Whether the squircle clip-path is applied. When `false`, the directive\n * stays inert (clip-path cleared).\n *\n * Modelled as `model()` so a parent component composing this directive\n * (`inject(WrSquircle, { self: true }).enabled.set(...)`) can flip the\n * state from outside without exposing an `enabled` input on its own API.\n *\n * @default true\n */\n readonly enabled = model(true);\n\n /**\n * Border thickness in CSS pixels. `0` disables the border ring entirely.\n * Modelled (not `input()`) so parent components composing this directive\n * can flip it imperatively — e.g. `WrButton` turning on a 1px ring when\n * `shape=\"squircle\" outlined` is active.\n * @default 0\n */\n readonly borderWidth = model(0);\n\n /**\n * Border colour — any CSS colour. Applied to the host's background so the\n * outer squircle reveals it. Defaults to `currentColor` so the consuming\n * element's text colour drives the ring.\n * @default 'currentColor'\n */\n readonly borderColor = model<string>('currentColor');\n\n /**\n * Which corners to squircle. `'all'` (default) is the standard four-\n * corner shape; `'left'` / `'right'` / `'top'` / `'bottom'` squircle\n * only the two corners on the named side and leave the other two at\n * 90°. `'none'` is equivalent to disabling the directive.\n *\n * Modelled so parent components composing the directive can flip the\n * value imperatively — used by `WrButtonGroup` to squircle only the\n * outer corners of the first / last child.\n *\n * @default 'all'\n */\n readonly corners = model<WrSquircleCornerMask>('all');\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly destroyRef = inject(DestroyRef);\n private observer: ResizeObserver | null = null;\n\n constructor() {\n if (!this.isBrowser) return;\n const host = this.el.nativeElement;\n // Reactively re-apply when inputs change.\n effect(() => {\n this.radius();\n this.smoothing();\n this.enabled();\n this.borderWidth();\n this.borderColor();\n this.corners();\n this.apply();\n });\n // Re-apply on resize.\n this.observer = new ResizeObserver(() => this.apply());\n this.observer.observe(host);\n this.destroyRef.onDestroy(() => {\n this.observer?.disconnect();\n this.clear();\n });\n }\n\n private apply(): void {\n const host = this.el.nativeElement;\n if (!this.enabled()) {\n this.clear();\n return;\n }\n const rect = host.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) return;\n\n const r = this.radius();\n const s = this.smoothing();\n const radii = maskToRadii(this.corners(), r);\n const outer = squirclePath(rect.width, rect.height, radii, s);\n const value = `path(\"${outer}\")`;\n host.style.clipPath = value;\n host.style.setProperty('-webkit-clip-path', value);\n\n // Border mode: paint an INNER squircle in a `::before` pseudo on top of\n // the host so the host's own bg only shows at the border-width perimeter.\n const bw = this.borderWidth();\n if (bw > 0) {\n const innerW = Math.max(0, rect.width - bw * 2);\n const innerH = Math.max(0, rect.height - bw * 2);\n const innerR = Math.max(0, r - bw);\n if (innerW > 0 && innerH > 0) {\n const innerRadii = maskToRadii(this.corners(), innerR);\n const inner = squirclePath(innerW, innerH, innerRadii, s);\n host.style.setProperty('--wr-squircle-inner-path', `path(\"${inner}\")`);\n }\n host.style.setProperty('--wr-squircle-border-width', `${bw}px`);\n // Only set the colour var inline when the consumer asked for a\n // specific colour. Leaving the default `'currentColor'` un-inlined\n // lets host CSS (e.g. WrButton's outlined-squircle rule) override\n // the var via SCSS without losing to inline-style specificity.\n const bc = this.borderColor();\n if (bc && bc !== 'currentColor') {\n host.style.setProperty('--wr-squircle-border-color', bc);\n } else {\n host.style.removeProperty('--wr-squircle-border-color');\n }\n } else {\n host.style.removeProperty('--wr-squircle-inner-path');\n host.style.removeProperty('--wr-squircle-border-width');\n host.style.removeProperty('--wr-squircle-border-color');\n }\n }\n\n private clear(): void {\n const host = this.el.nativeElement;\n host.style.removeProperty('clip-path');\n host.style.removeProperty('-webkit-clip-path');\n host.style.removeProperty('--wr-squircle-inner-path');\n host.style.removeProperty('--wr-squircle-border-width');\n host.style.removeProperty('--wr-squircle-border-color');\n }\n}\n\nexport type { WrSquircleCornerMask } from './interfaces';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation } from '@angular/core';\n\nimport { WrSquircle } from './wr-squircle';\n\n/**\n * Standalone squircle container. Equivalent to `<div wrSquircle>` but\n * named for ergonomics in templates.\n *\n * @example\n * ```html\n * <wr-squircle [radius]=\"24\" style=\"width: 160px; height: 160px; background: var(--wr-color-primary)\">\n * …\n * </wr-squircle>\n * ```\n *\n * @see https://ngwr.dev/reference/components/squircle\n */\n@Component({\n selector: 'wr-squircle',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-squircle' },\n hostDirectives: [{ directive: WrSquircle, inputs: ['radius', 'smoothing', 'borderWidth', 'borderColor'] }],\n})\nexport class WrSquircleHost {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;AASG;AAoBH,SAAS,SAAS,CAAC,GAAW,EAAA;IAC5B,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG;AAC9B;AAEA,SAAS,YAAY,CAAC,YAAoB,EAAE,eAAuB,EAAE,MAAc,EAAA;AACjF,IAAA,IAAI,YAAY,IAAI,CAAC,EAAE;AACrB,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;IAC/E;IACA,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,IAAI,YAAY;;I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AE,UAAU,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,EAAE,CAAC;AAC3G,iBAAA;;;AC9BD;;AAEG;;;;"}
@@ -2,6 +2,7 @@ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coerci
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, LOCALE_ID, input, computed, signal, effect, untracked, ViewEncapsulation, Component, output, DestroyRef, PLATFORM_ID, afterNextRender } from '@angular/core';
4
4
  import { WrCountUp } from 'ngwr/counter';
5
+ import { useI18nText, useI18nFormatter } from 'ngwr/i18n';
5
6
  import { WrPlatform } from 'ngwr/platform';
6
7
  import { numAttr } from 'ngwr/utils';
7
8
  import { isPlatformBrowser } from '@angular/common';
@@ -115,8 +116,13 @@ class WrStatistic {
115
116
  const n = coerceNumberProperty(v, Number.NaN);
116
117
  return Number.isFinite(n) ? n : null;
117
118
  } });
118
- /** Unit appended to the delta value. @default '%' */
119
- deltaSuffix = input('%', /* @ts-ignore */
119
+ // The default moved from the literal `'%'` to `null` so the catalog gets a
120
+ // say. `%` is a string the LIBRARY owns and no locale could reach: a locale
121
+ // that writes it differently — or writes it as a word — had nowhere to put
122
+ // that but a per-instance binding on every `<wr-statistic>` on the page. A
123
+ // bound value still wins, exactly as before, which is what makes this safe.
124
+ /** Unit appended to the delta value. Falls back to `statistic.deltaSuffix`, then `'%'`. */
125
+ deltaSuffix = input(null, /* @ts-ignore */
120
126
  ...(ngDevMode ? [{ debugName: "deltaSuffix" }] : /* istanbul ignore next */ []));
121
127
  hasDelta = computed(() => this.delta() !== null, /* @ts-ignore */
122
128
  ...(ngDevMode ? [{ debugName: "hasDelta" }] : /* istanbul ignore next */ []));
@@ -127,12 +133,37 @@ class WrStatistic {
127
133
  return d > 0 ? 'up' : 'down';
128
134
  }, /* @ts-ignore */
129
135
  ...(ngDevMode ? [{ debugName: "deltaDirection" }] : /* istanbul ignore next */ []));
136
+ resolvedDeltaSuffix = useI18nText(this.deltaSuffix, 'statistic.deltaSuffix', '%');
137
+ /** `{{value}}{{suffix}}` — the join, so a locale owns the space before the unit. */
138
+ deltaFormat = useI18nFormatter('statistic.delta', '{{value}}{{suffix}}');
139
+ /**
140
+ * The delta chip, e.g. `+12.4%`.
141
+ *
142
+ * It was `` `${sign}${d}${suffix}` ``, printed one line under a value that
143
+ * goes through `Intl.NumberFormat` — so the two disagreed inside one
144
+ * component: ar-SA showed `١٬٢٣٤٬٥٦٧٫٨٩` above a Latin `12.4%`, and de-DE
145
+ * `1.234.567,89` above `+12.4%`. The sign comes from `signDisplay`, which also
146
+ * fixes the RTL half of it: `+` written by hand is a neutral character that
147
+ * the BiDi algorithm moves to the other end of the number.
148
+ *
149
+ * The digit count is taken from the number rather than from `precision()`,
150
+ * which describes the VALUE and not the delta — so what renders is the same
151
+ * digits as before, in the locale's own numerals. One exception, and it is an
152
+ * improvement rather than a regression: a magnitude JavaScript prints in
153
+ * exponent notation (`1e-7`, `1e+21`) used to reach the DOM that way and is
154
+ * now formatted as a number.
155
+ */
130
156
  deltaText = computed(() => {
131
157
  const d = this.delta();
132
158
  if (d === null)
133
159
  return '';
134
- const sign = d > 0 ? '+' : '';
135
- return `${sign}${d}${this.deltaSuffix()}`;
160
+ const decimals = Math.min(20, (String(Math.abs(d)).split('.')[1] ?? '').length);
161
+ const value = new Intl.NumberFormat(this.locale, {
162
+ signDisplay: 'exceptZero',
163
+ minimumFractionDigits: decimals,
164
+ maximumFractionDigits: decimals,
165
+ }).format(d);
166
+ return this.deltaFormat({ value, suffix: this.resolvedDeltaSuffix() });
136
167
  }, /* @ts-ignore */
137
168
  ...(ngDevMode ? [{ debugName: "deltaText" }] : /* istanbul ignore next */ []));
138
169
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: WrStatistic, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-statistic.mjs","sources":["../../../projects/lib/statistic/statistic.ts","../../../projects/lib/statistic/statistic.html","../../../projects/lib/statistic/statistic-countdown.ts","../../../projects/lib/statistic/statistic-countdown.html","../../../projects/lib/statistic/statistic-group.ts","../../../projects/lib/statistic/ngwr-statistic.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrCountUp } from 'ngwr/counter';\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\n/**\n * KPI card — label + big number + optional prefix/suffix + delta. Pair\n * with `<wr-statistic-group>` for a responsive dashboard grid.\n *\n * When `value` is numeric the number counts up (eased) from its previous\n * value to the new one on every change — see `animate`. String values and\n * `prefers-reduced-motion` render instantly.\n *\n * @example\n * ```html\n * <wr-statistic label=\"Active users\" [value]=\"12345\" suffix=\"users\" />\n * <wr-statistic label=\"Revenue\" [value]=\"9512\" prefix=\"$\" [delta]=\"12.4\" />\n * <wr-statistic label=\"Churn\" [value]=\"1.8\" suffix=\"%\" [precision]=\"1\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic',\n templateUrl: './statistic.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n imports: [WrCountUp],\n})\nexport class WrStatistic {\n private readonly platform = inject(WrPlatform);\n private readonly locale = inject(LOCALE_ID);\n\n readonly label = input<string>('');\n\n /** The number (or string) to display in the main slot. */\n readonly value = input<number | string | null>(null);\n\n /** Prefix glyph / symbol (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Suffix glyph / unit (e.g. `'%'`, `'kg'`). */\n readonly suffix = input<string>('');\n\n /** Fixed number of decimals applied to numeric values. @default 0 */\n readonly precision = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Count up to a new numeric `value` instead of swapping instantly. Always\n * off for string values or under `prefers-reduced-motion`. @default true\n */\n readonly animate = input(true, { transform: coerceBooleanProperty });\n\n /** Count-up duration (ms). @default 700 */\n readonly duration = input(700, { transform: numAttr(700) });\n\n /**\n * The current value coerced to a finite number, or `null` when `value` is\n * a non-numeric string / empty / nullish (rendered as-is).\n */\n protected readonly numericValue = computed<number | null>(() => {\n const raw = this.value();\n if (raw === null || raw === '') return null;\n const n = typeof raw === 'number' ? raw : coerceNumberProperty(raw, Number.NaN);\n return Number.isFinite(n) ? n : null;\n });\n\n /** Whether the value should count up (browser, numeric, opted-in, motion allowed). */\n protected readonly animated = computed<boolean>(\n () =>\n this.platform.isBrowser && this.animate() && !this.platform.prefersReducedMotion() && this.numericValue() !== null\n );\n\n /** Animation start — the previously-rendered numeric value (0 on first paint). */\n protected readonly animateFrom = signal(0);\n\n /** Bookkeeping: the last numeric value seen, fed back as the next `from`. */\n private readonly lastNumeric = signal(0);\n\n constructor() {\n // Whenever the numeric value changes, snapshot the prior value as the\n // count-up start, then remember the new one for the next transition.\n effect(() => {\n const next = this.numericValue();\n if (next === null) return;\n untracked(() => {\n this.animateFrom.set(this.lastNumeric());\n this.lastNumeric.set(next);\n });\n });\n }\n\n /**\n * Static (non-animated) display string. Numeric values honour `precision`\n * and locale grouping so they match the count-up output; everything else\n * renders verbatim with an em-dash fallback.\n */\n protected readonly displayValue = computed<string>(() => {\n const n = this.numericValue();\n if (n !== null) {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.precision(),\n maximumFractionDigits: this.precision(),\n }).format(n);\n }\n // `numericValue` above already reads `''` as \"no value\"; rendering it\n // verbatim put an empty card on screen instead of the placeholder.\n const raw = this.value();\n return raw === null || raw === undefined || raw === '' ? '—' : String(raw);\n });\n\n /**\n * Optional delta vs previous period — shown as `+x.x%` (or `-x.x%`).\n * Use `deltaSuffix` to change the trailing unit.\n */\n readonly delta = input<number | null>(null, {\n transform: (v: unknown): number | null => {\n if (v === null || v === undefined || v === '') return null;\n const n = coerceNumberProperty(v, Number.NaN);\n return Number.isFinite(n) ? n : null;\n },\n });\n\n /** Unit appended to the delta value. @default '%' */\n readonly deltaSuffix = input<string>('%');\n\n protected readonly hasDelta = computed(() => this.delta() !== null);\n\n protected readonly deltaDirection = computed<'up' | 'down' | 'flat'>(() => {\n const d = this.delta();\n if (d === null || d === 0) return 'flat';\n return d > 0 ? 'up' : 'down';\n });\n\n protected readonly deltaText = computed(() => {\n const d = this.delta();\n if (d === null) return '';\n const sign = d > 0 ? '+' : '';\n return `${sign}${d}${this.deltaSuffix()}`;\n });\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n @if (prefix()) {\n <span class=\"wr-statistic__prefix\">{{ prefix() }}</span>\n }\n @if (animated()) {\n <wr-count-up\n class=\"wr-statistic__number\"\n [from]=\"animateFrom()\"\n [to]=\"numericValue() ?? 0\"\n [decimals]=\"precision()\"\n [duration]=\"duration()\"\n />\n } @else {\n <span class=\"wr-statistic__number\">{{ displayValue() }}</span>\n }\n @if (suffix()) {\n <span class=\"wr-statistic__suffix\">{{ suffix() }}</span>\n }\n</div>\n@if (hasDelta()) {\n <div [class]=\"`wr-statistic__delta wr-statistic__delta--${deltaDirection()}`\">\n @if (deltaDirection() === 'up') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 1 L9 8 L1 8 Z\" fill=\"currentColor\" />\n </svg>\n } @else if (deltaDirection() === 'down') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 9 L9 2 L1 2 Z\" fill=\"currentColor\" />\n </svg>\n }\n <span>{{ deltaText() }}</span>\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\n// Helpers\n\nfunction toMs(value: Date | string | number): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'number') return value;\n return new Date(value).getTime();\n}\n\nfunction pad(n: number, width: number): string {\n return String(n).padStart(width, '0');\n}\n\nfunction formatRemaining(ms: number, fmt: string): string {\n const days = Math.floor(ms / 86_400_000);\n const hours = Math.floor((ms % 86_400_000) / 3_600_000);\n const minutes = Math.floor((ms % 3_600_000) / 60_000);\n const seconds = Math.floor((ms % 60_000) / 1000);\n const millis = ms % 1000;\n // Single-pass tokenizer so we never re-scan output for tokens. The\n // previous sequential `.replace()` chain leaked: e.g. `D days HH:mm:ss`\n // → `1 day42 11:59:42` because the `/s/g` step at the end re-matched\n // the literal `s` inside `days`. Longest-token-first ordering inside\n // the alternation handles `DD`>`D`, `HH`>`H`, `mm`>`m`, `SSS`>`ss`>`s`.\n return fmt.replace(/(?<![A-Za-z])(?:SSS|DD|HH|mm|ss|D|H|m|s)(?![A-Za-z])/g, token => {\n switch (token) {\n case 'DD':\n return pad(days, 2);\n case 'D':\n return String(days);\n case 'HH':\n return pad(hours, 2);\n case 'H':\n return String(hours);\n case 'mm':\n return pad(minutes, 2);\n case 'm':\n return String(minutes);\n case 'ss':\n return pad(seconds, 2);\n case 's':\n return String(seconds);\n case 'SSS':\n return pad(millis, 3);\n default:\n return token;\n }\n });\n}\n\n/**\n * Live-counting variant of `<wr-statistic>` that targets a future date\n * and ticks down to zero. The format string uses Day/Hour/Minute/Second\n * tokens (`D`, `H`, `m`, `s`, double for zero-padded, plus `SSS` for\n * milliseconds).\n *\n * @example\n * ```html\n * <wr-statistic-countdown\n * label=\"Launch in\"\n * [target]=\"launchDate\"\n * format=\"D days HH:mm:ss\"\n * (countdownEnd)=\"onLive()\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic-countdown',\n templateUrl: './statistic-countdown.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n})\nexport class WrStatisticCountdown {\n /** Target date / timestamp the countdown is running down to. */\n readonly target = input.required<Date | string | number>();\n\n /** Label rendered above the value. */\n readonly label = input<string>('');\n\n /**\n * Format string. Tokens: `D`/`DD` (days), `H`/`HH` (hours),\n * `m`/`mm` (minutes), `s`/`ss` (seconds), `SSS` (milliseconds).\n * Double-letter forms zero-pad to width 2. @default 'HH:mm:ss'\n */\n readonly format = input<string>('HH:mm:ss');\n\n /** Optional text shown once the countdown reaches zero. */\n readonly endText = input<string | null>(null);\n\n /**\n * Tick interval in ms. Drop to ~16 for `SSS` (millisecond display). Floored\n * at one frame — `0` (or an unparseable value) asked `setInterval` to run as\n * fast as the browser would allow, which is a busy loop, not a countdown.\n * @default 1000\n */\n readonly tickMs = input(1000, { transform: (v: unknown): number => Math.max(16, numAttr(1000)(v)) });\n\n /** Fires once when the countdown crosses zero. */\n readonly countdownEnd = output<void>();\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private readonly targetMs = computed(() => toMs(this.target()));\n\n /**\n * Milliseconds left, or `null` when `target` does not parse to a date at all.\n * `new Date('nope').getTime()` is `NaN`, and `NaN` propagated all the way to\n * the screen as `NaN:NaN:NaN` — and, worse, `tick` compared it to `0` and so\n * never fired `countdownEnd`, while a guard that only clamped the text would\n * have fired it immediately for a target that was never reached.\n */\n private remainingMs(): number | null {\n const target = this.targetMs();\n return Number.isFinite(target) ? Math.max(0, target - Date.now()) : null;\n }\n\n /** Remaining milliseconds (live signal). */\n protected readonly remaining = signal(0);\n protected readonly finished = signal(false);\n\n protected readonly display = computed(() => {\n if (this.finished() && this.endText() != null) return this.endText()!;\n return formatRemaining(this.remaining(), this.format());\n });\n\n constructor() {\n // Seed once synchronously so SSR / first paint shows a sane value.\n effect(() => {\n const ms = this.remainingMs();\n this.remaining.set(ms ?? 0);\n this.finished.set(ms === 0);\n });\n\n if (!this.isBrowser) return;\n\n afterNextRender(() => {\n const handle = setInterval(() => this.tick(), this.tickMs());\n this.destroyRef.onDestroy(() => clearInterval(handle));\n });\n }\n\n private tick(): void {\n const ms = this.remainingMs();\n if (ms === null) return;\n this.remaining.set(ms);\n if (ms === 0 && !this.finished()) {\n this.finished.set(true);\n this.countdownEnd.emit();\n }\n }\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n <span class=\"wr-statistic__number\">{{ display() }}</span>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, input } from '@angular/core';\n\n/**\n * Dashboard grid for `<wr-statistic>` cards. The column count follows the\n * group's OWN width — an intrinsic container-query grid sized by its box, not\n * a viewport media query — so it reflows correctly inside any column, card, or\n * split pane. Columns are never narrower than `min`; `columns` optionally caps\n * how many ever sit side by side on a wide container.\n *\n * @example\n * ```html\n * <wr-statistic-group [columns]=\"4\" min=\"11rem\">\n * <wr-statistic label=\"Active users\" [value]=\"12345\" />\n * <wr-statistic label=\"Revenue\" [value]=\"9512\" prefix=\"$\" [delta]=\"12.4\" />\n * <wr-statistic label=\"Churn\" [value]=\"1.8\" suffix=\"%\" [delta]=\"-0.4\" />\n * <wr-statistic label=\"Sessions\" [value]=\"48210\" />\n * </wr-statistic-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic-group',\n template: '<div class=\"wr-statistic-group__grid\"><ng-content /></div>',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-statistic-group',\n '[style.--wr-statistic-group-min]': 'min()',\n '[style.--wr-statistic-group-columns]': 'columns() || null',\n },\n})\nexport class WrStatisticGroup {\n /**\n * Minimum width of each column before the grid reflows to fewer columns.\n * Any CSS length — smaller packs more cards per row. @default '12rem'\n */\n readonly min = input<string>('12rem');\n\n /**\n * Cap on how many columns ever sit side by side on a wide container. `0`\n * (default) leaves it uncapped — fit as many `min`-wide columns as the\n * width allows. @default 0\n */\n readonly columns = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAmBH;;;;;;;;;;;;;;;;AAgBG;MAQU,WAAW,CAAA;AACL,IAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;AAC7B,IAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAElC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAGzB,KAAK,GAAG,KAAK,CAAyB,IAAI;8EAAC;;IAG3C,MAAM,GAAG,KAAK,CAAS,EAAE;+EAAC;;IAG1B,MAAM,GAAG,KAAK,CAAS,EAAE;+EAAC;;IAG1B,SAAS,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,WAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAA,CAAG;AAE7G;;;AAGG;IACM,OAAO,GAAG,KAAK,CAAC,IAAI,+EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;AAG3D,IAAA,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,U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A,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAA,CAAG;uGAZhG,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,gfARjB,4DAA4D,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQ3D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,4DAA4D;oBACtE,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,oBAAoB;AAC3B,wBAAA,kCAAkC,EAAE,OAAO;AAC3C,wBAAA,sCAAsC,EAAE,mBAAmB;AAC5D,qBAAA;AACF,iBAAA;;;ACtCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-statistic.mjs","sources":["../../../projects/lib/statistic/statistic.ts","../../../projects/lib/statistic/statistic.html","../../../projects/lib/statistic/statistic-countdown.ts","../../../projects/lib/statistic/statistic-countdown.html","../../../projects/lib/statistic/statistic-group.ts","../../../projects/lib/statistic/ngwr-statistic.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrCountUp } from 'ngwr/counter';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\n/**\n * KPI card — label + big number + optional prefix/suffix + delta. Pair\n * with `<wr-statistic-group>` for a responsive dashboard grid.\n *\n * When `value` is numeric the number counts up (eased) from its previous\n * value to the new one on every change — see `animate`. String values and\n * `prefers-reduced-motion` render instantly.\n *\n * @example\n * ```html\n * <wr-statistic label=\"Active users\" [value]=\"12345\" suffix=\"users\" />\n * <wr-statistic label=\"Revenue\" [value]=\"9512\" prefix=\"$\" [delta]=\"12.4\" />\n * <wr-statistic label=\"Churn\" [value]=\"1.8\" suffix=\"%\" [precision]=\"1\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic',\n templateUrl: './statistic.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n imports: [WrCountUp],\n})\nexport class WrStatistic {\n private readonly platform = inject(WrPlatform);\n private readonly locale = inject(LOCALE_ID);\n\n readonly label = input<string>('');\n\n /** The number (or string) to display in the main slot. */\n readonly value = input<number | string | null>(null);\n\n /** Prefix glyph / symbol (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Suffix glyph / unit (e.g. `'%'`, `'kg'`). */\n readonly suffix = input<string>('');\n\n /** Fixed number of decimals applied to numeric values. @default 0 */\n readonly precision = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /**\n * Count up to a new numeric `value` instead of swapping instantly. Always\n * off for string values or under `prefers-reduced-motion`. @default true\n */\n readonly animate = input(true, { transform: coerceBooleanProperty });\n\n /** Count-up duration (ms). @default 700 */\n readonly duration = input(700, { transform: numAttr(700) });\n\n /**\n * The current value coerced to a finite number, or `null` when `value` is\n * a non-numeric string / empty / nullish (rendered as-is).\n */\n protected readonly numericValue = computed<number | null>(() => {\n const raw = this.value();\n if (raw === null || raw === '') return null;\n const n = typeof raw === 'number' ? raw : coerceNumberProperty(raw, Number.NaN);\n return Number.isFinite(n) ? n : null;\n });\n\n /** Whether the value should count up (browser, numeric, opted-in, motion allowed). */\n protected readonly animated = computed<boolean>(\n () =>\n this.platform.isBrowser && this.animate() && !this.platform.prefersReducedMotion() && this.numericValue() !== null\n );\n\n /** Animation start — the previously-rendered numeric value (0 on first paint). */\n protected readonly animateFrom = signal(0);\n\n /** Bookkeeping: the last numeric value seen, fed back as the next `from`. */\n private readonly lastNumeric = signal(0);\n\n constructor() {\n // Whenever the numeric value changes, snapshot the prior value as the\n // count-up start, then remember the new one for the next transition.\n effect(() => {\n const next = this.numericValue();\n if (next === null) return;\n untracked(() => {\n this.animateFrom.set(this.lastNumeric());\n this.lastNumeric.set(next);\n });\n });\n }\n\n /**\n * Static (non-animated) display string. Numeric values honour `precision`\n * and locale grouping so they match the count-up output; everything else\n * renders verbatim with an em-dash fallback.\n */\n protected readonly displayValue = computed<string>(() => {\n const n = this.numericValue();\n if (n !== null) {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.precision(),\n maximumFractionDigits: this.precision(),\n }).format(n);\n }\n // `numericValue` above already reads `''` as \"no value\"; rendering it\n // verbatim put an empty card on screen instead of the placeholder.\n const raw = this.value();\n return raw === null || raw === undefined || raw === '' ? '—' : String(raw);\n });\n\n /**\n * Optional delta vs previous period — shown as `+x.x%` (or `-x.x%`).\n * Use `deltaSuffix` to change the trailing unit.\n */\n readonly delta = input<number | null>(null, {\n transform: (v: unknown): number | null => {\n if (v === null || v === undefined || v === '') return null;\n const n = coerceNumberProperty(v, Number.NaN);\n return Number.isFinite(n) ? n : null;\n },\n });\n\n // The default moved from the literal `'%'` to `null` so the catalog gets a\n // say. `%` is a string the LIBRARY owns and no locale could reach: a locale\n // that writes it differently — or writes it as a word — had nowhere to put\n // that but a per-instance binding on every `<wr-statistic>` on the page. A\n // bound value still wins, exactly as before, which is what makes this safe.\n /** Unit appended to the delta value. Falls back to `statistic.deltaSuffix`, then `'%'`. */\n readonly deltaSuffix = input<string | null>(null);\n\n protected readonly hasDelta = computed(() => this.delta() !== null);\n\n protected readonly deltaDirection = computed<'up' | 'down' | 'flat'>(() => {\n const d = this.delta();\n if (d === null || d === 0) return 'flat';\n return d > 0 ? 'up' : 'down';\n });\n\n protected readonly resolvedDeltaSuffix = useI18nText(this.deltaSuffix, 'statistic.deltaSuffix', '%');\n\n /** `{{value}}{{suffix}}` — the join, so a locale owns the space before the unit. */\n private readonly deltaFormat = useI18nFormatter('statistic.delta', '{{value}}{{suffix}}');\n\n /**\n * The delta chip, e.g. `+12.4%`.\n *\n * It was `` `${sign}${d}${suffix}` ``, printed one line under a value that\n * goes through `Intl.NumberFormat` — so the two disagreed inside one\n * component: ar-SA showed `١٬٢٣٤٬٥٦٧٫٨٩` above a Latin `12.4%`, and de-DE\n * `1.234.567,89` above `+12.4%`. The sign comes from `signDisplay`, which also\n * fixes the RTL half of it: `+` written by hand is a neutral character that\n * the BiDi algorithm moves to the other end of the number.\n *\n * The digit count is taken from the number rather than from `precision()`,\n * which describes the VALUE and not the delta — so what renders is the same\n * digits as before, in the locale's own numerals. One exception, and it is an\n * improvement rather than a regression: a magnitude JavaScript prints in\n * exponent notation (`1e-7`, `1e+21`) used to reach the DOM that way and is\n * now formatted as a number.\n */\n protected readonly deltaText = computed(() => {\n const d = this.delta();\n if (d === null) return '';\n const decimals = Math.min(20, (String(Math.abs(d)).split('.')[1] ?? '').length);\n const value = new Intl.NumberFormat(this.locale, {\n signDisplay: 'exceptZero',\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(d);\n return this.deltaFormat({ value, suffix: this.resolvedDeltaSuffix() });\n });\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n @if (prefix()) {\n <span class=\"wr-statistic__prefix\">{{ prefix() }}</span>\n }\n @if (animated()) {\n <wr-count-up\n class=\"wr-statistic__number\"\n [from]=\"animateFrom()\"\n [to]=\"numericValue() ?? 0\"\n [decimals]=\"precision()\"\n [duration]=\"duration()\"\n />\n } @else {\n <span class=\"wr-statistic__number\">{{ displayValue() }}</span>\n }\n @if (suffix()) {\n <span class=\"wr-statistic__suffix\">{{ suffix() }}</span>\n }\n</div>\n@if (hasDelta()) {\n <div [class]=\"`wr-statistic__delta wr-statistic__delta--${deltaDirection()}`\">\n @if (deltaDirection() === 'up') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 1 L9 8 L1 8 Z\" fill=\"currentColor\" />\n </svg>\n } @else if (deltaDirection() === 'down') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M5 9 L9 2 L1 2 Z\" fill=\"currentColor\" />\n </svg>\n }\n <span>{{ deltaText() }}</span>\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\n// Helpers\n\nfunction toMs(value: Date | string | number): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'number') return value;\n return new Date(value).getTime();\n}\n\nfunction pad(n: number, width: number): string {\n return String(n).padStart(width, '0');\n}\n\nfunction formatRemaining(ms: number, fmt: string): string {\n const days = Math.floor(ms / 86_400_000);\n const hours = Math.floor((ms % 86_400_000) / 3_600_000);\n const minutes = Math.floor((ms % 3_600_000) / 60_000);\n const seconds = Math.floor((ms % 60_000) / 1000);\n const millis = ms % 1000;\n // Single-pass tokenizer so we never re-scan output for tokens. The\n // previous sequential `.replace()` chain leaked: e.g. `D days HH:mm:ss`\n // → `1 day42 11:59:42` because the `/s/g` step at the end re-matched\n // the literal `s` inside `days`. Longest-token-first ordering inside\n // the alternation handles `DD`>`D`, `HH`>`H`, `mm`>`m`, `SSS`>`ss`>`s`.\n return fmt.replace(/(?<![A-Za-z])(?:SSS|DD|HH|mm|ss|D|H|m|s)(?![A-Za-z])/g, token => {\n switch (token) {\n case 'DD':\n return pad(days, 2);\n case 'D':\n return String(days);\n case 'HH':\n return pad(hours, 2);\n case 'H':\n return String(hours);\n case 'mm':\n return pad(minutes, 2);\n case 'm':\n return String(minutes);\n case 'ss':\n return pad(seconds, 2);\n case 's':\n return String(seconds);\n case 'SSS':\n return pad(millis, 3);\n default:\n return token;\n }\n });\n}\n\n/**\n * Live-counting variant of `<wr-statistic>` that targets a future date\n * and ticks down to zero. The format string uses Day/Hour/Minute/Second\n * tokens (`D`, `H`, `m`, `s`, double for zero-padded, plus `SSS` for\n * milliseconds).\n *\n * @example\n * ```html\n * <wr-statistic-countdown\n * label=\"Launch in\"\n * [target]=\"launchDate\"\n * format=\"D days HH:mm:ss\"\n * (countdownEnd)=\"onLive()\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic-countdown',\n templateUrl: './statistic-countdown.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-statistic' },\n})\nexport class WrStatisticCountdown {\n /** Target date / timestamp the countdown is running down to. */\n readonly target = input.required<Date | string | number>();\n\n /** Label rendered above the value. */\n readonly label = input<string>('');\n\n /**\n * Format string. Tokens: `D`/`DD` (days), `H`/`HH` (hours),\n * `m`/`mm` (minutes), `s`/`ss` (seconds), `SSS` (milliseconds).\n * Double-letter forms zero-pad to width 2. @default 'HH:mm:ss'\n */\n readonly format = input<string>('HH:mm:ss');\n\n /** Optional text shown once the countdown reaches zero. */\n readonly endText = input<string | null>(null);\n\n /**\n * Tick interval in ms. Drop to ~16 for `SSS` (millisecond display). Floored\n * at one frame — `0` (or an unparseable value) asked `setInterval` to run as\n * fast as the browser would allow, which is a busy loop, not a countdown.\n * @default 1000\n */\n readonly tickMs = input(1000, { transform: (v: unknown): number => Math.max(16, numAttr(1000)(v)) });\n\n /** Fires once when the countdown crosses zero. */\n readonly countdownEnd = output<void>();\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private readonly targetMs = computed(() => toMs(this.target()));\n\n /**\n * Milliseconds left, or `null` when `target` does not parse to a date at all.\n * `new Date('nope').getTime()` is `NaN`, and `NaN` propagated all the way to\n * the screen as `NaN:NaN:NaN` — and, worse, `tick` compared it to `0` and so\n * never fired `countdownEnd`, while a guard that only clamped the text would\n * have fired it immediately for a target that was never reached.\n */\n private remainingMs(): number | null {\n const target = this.targetMs();\n return Number.isFinite(target) ? Math.max(0, target - Date.now()) : null;\n }\n\n /** Remaining milliseconds (live signal). */\n protected readonly remaining = signal(0);\n protected readonly finished = signal(false);\n\n protected readonly display = computed(() => {\n if (this.finished() && this.endText() != null) return this.endText()!;\n return formatRemaining(this.remaining(), this.format());\n });\n\n constructor() {\n // Seed once synchronously so SSR / first paint shows a sane value.\n effect(() => {\n const ms = this.remainingMs();\n this.remaining.set(ms ?? 0);\n this.finished.set(ms === 0);\n });\n\n if (!this.isBrowser) return;\n\n afterNextRender(() => {\n const handle = setInterval(() => this.tick(), this.tickMs());\n this.destroyRef.onDestroy(() => clearInterval(handle));\n });\n }\n\n private tick(): void {\n const ms = this.remainingMs();\n if (ms === null) return;\n this.remaining.set(ms);\n if (ms === 0 && !this.finished()) {\n this.finished.set(true);\n this.countdownEnd.emit();\n }\n }\n}\n","@if (label()) {\n <div class=\"wr-statistic__label\">{{ label() }}</div>\n}\n<div class=\"wr-statistic__value\">\n <span class=\"wr-statistic__number\">{{ display() }}</span>\n</div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, input } from '@angular/core';\n\n/**\n * Dashboard grid for `<wr-statistic>` cards. The column count follows the\n * group's OWN width — an intrinsic container-query grid sized by its box, not\n * a viewport media query — so it reflows correctly inside any column, card, or\n * split pane. Columns are never narrower than `min`; `columns` optionally caps\n * how many ever sit side by side on a wide container.\n *\n * @example\n * ```html\n * <wr-statistic-group [columns]=\"4\" min=\"11rem\">\n * <wr-statistic label=\"Active users\" [value]=\"12345\" />\n * <wr-statistic label=\"Revenue\" [value]=\"9512\" prefix=\"$\" [delta]=\"12.4\" />\n * <wr-statistic label=\"Churn\" [value]=\"1.8\" suffix=\"%\" [delta]=\"-0.4\" />\n * <wr-statistic label=\"Sessions\" [value]=\"48210\" />\n * </wr-statistic-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/statistic\n */\n@Component({\n selector: 'wr-statistic-group',\n template: '<div class=\"wr-statistic-group__grid\"><ng-content /></div>',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-statistic-group',\n '[style.--wr-statistic-group-min]': 'min()',\n '[style.--wr-statistic-group-columns]': 'columns() || null',\n },\n})\nexport class WrStatisticGroup {\n /**\n * Minimum width of each column before the grid reflows to fewer columns.\n * Any CSS length — smaller packs more cards per row. @default '12rem'\n */\n readonly min = input<string>('12rem');\n\n /**\n * Cap on how many columns ever sit side by side on a wide container. `0`\n * (default) leaves it uncapped — fit as many `min`-wide columns as the\n * width allows. @default 0\n */\n readonly columns = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAoBH;;;;;;;;;;;;;;;;AAgBG;MAQU,WAAW,CAAA;AACL,IAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;AAC7B,IAAA,MAAM,GAAG,MAA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