ngwr 12.2.0 → 13.0.1

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 (208) hide show
  1. package/README.md +11 -1
  2. package/border-glow/border-glow.scss +1 -1
  3. package/border-glow/styles/_index.scss +15 -233
  4. package/border-glow/styles/_rules.scss +228 -0
  5. package/breadcrumbs/breadcrumbs.scss +1 -1
  6. package/breadcrumbs/styles/_index.scss +15 -78
  7. package/breadcrumbs/styles/_rules.scss +84 -0
  8. package/card/card.scss +1 -1
  9. package/card/styles/_index.scss +15 -96
  10. package/card/styles/_rules.scss +96 -0
  11. package/cascader/cascader.scss +1 -1
  12. package/cascader/styles/_index.scss +15 -244
  13. package/cascader/styles/_rules.scss +261 -0
  14. package/checkbox/styles/_index.scss +7 -0
  15. package/circular-text/circular-text.scss +1 -1
  16. package/circular-text/styles/_index.scss +15 -63
  17. package/circular-text/styles/_rules.scss +58 -0
  18. package/color-picker/styles/_index.scss +8 -0
  19. package/drag-drop/sortable-list.scss +1 -1
  20. package/drag-drop/styles/_index.scss +14 -143
  21. package/drag-drop/styles/_rules.scss +151 -0
  22. package/falling-text/falling-text.scss +1 -1
  23. package/falling-text/styles/_index.scss +15 -36
  24. package/falling-text/styles/_rules.scss +31 -0
  25. package/fesm2022/ngwr-border-glow.mjs +14 -5
  26. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  27. package/fesm2022/ngwr-breadcrumbs.mjs +15 -4
  28. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  29. package/fesm2022/ngwr-card.mjs +2 -2
  30. package/fesm2022/ngwr-card.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader.mjs +27 -9
  32. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  33. package/fesm2022/ngwr-checkbox.mjs +86 -8
  34. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  35. package/fesm2022/ngwr-circular-text.mjs +2 -2
  36. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +57 -7
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-context-menu.mjs +6 -2
  40. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  41. package/fesm2022/ngwr-date-picker.mjs +8 -0
  42. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  43. package/fesm2022/ngwr-dialog.mjs +22 -16
  44. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  45. package/fesm2022/ngwr-directives.mjs +5 -2
  46. package/fesm2022/ngwr-directives.mjs.map +1 -1
  47. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  48. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  49. package/fesm2022/ngwr-drawer.mjs +24 -18
  50. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  51. package/fesm2022/ngwr-dropdown.mjs +6 -2
  52. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  53. package/fesm2022/ngwr-falling-text.mjs +2 -2
  54. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  55. package/fesm2022/ngwr-file-upload.mjs +29 -8
  56. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  57. package/fesm2022/ngwr-form.mjs +48 -1
  58. package/fesm2022/ngwr-form.mjs.map +1 -1
  59. package/fesm2022/ngwr-fuzzy-text.mjs +21 -4
  60. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  61. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  62. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  63. package/fesm2022/ngwr-gradient-text.mjs +11 -4
  64. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  65. package/fesm2022/ngwr-icon-adapters-feather.mjs +11 -0
  66. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  67. package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
  68. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  69. package/fesm2022/ngwr-icon.mjs +474 -37
  70. package/fesm2022/ngwr-icon.mjs.map +1 -1
  71. package/fesm2022/ngwr-input-otp.mjs +41 -3
  72. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  73. package/fesm2022/ngwr-knob.mjs +17 -2
  74. package/fesm2022/ngwr-knob.mjs.map +1 -1
  75. package/fesm2022/ngwr-lightbox.mjs +2 -2
  76. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  77. package/fesm2022/ngwr-list.mjs +2 -2
  78. package/fesm2022/ngwr-list.mjs.map +1 -1
  79. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  80. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  81. package/fesm2022/ngwr-markdown.mjs +63 -11
  82. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  83. package/fesm2022/ngwr-marquee.mjs +2 -2
  84. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  85. package/fesm2022/ngwr-overlay.mjs +36 -7
  86. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  87. package/fesm2022/ngwr-pagination.mjs +1 -1
  88. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  89. package/fesm2022/ngwr-qr.mjs +38 -1
  90. package/fesm2022/ngwr-qr.mjs.map +1 -1
  91. package/fesm2022/ngwr-radio.mjs +63 -8
  92. package/fesm2022/ngwr-radio.mjs.map +1 -1
  93. package/fesm2022/ngwr-rating.mjs +17 -2
  94. package/fesm2022/ngwr-rating.mjs.map +1 -1
  95. package/fesm2022/ngwr-segmented.mjs +22 -3
  96. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  97. package/fesm2022/ngwr-select.mjs +46 -12
  98. package/fesm2022/ngwr-select.mjs.map +1 -1
  99. package/fesm2022/ngwr-shiny-text.mjs +12 -5
  100. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  101. package/fesm2022/ngwr-slider.mjs +21 -6
  102. package/fesm2022/ngwr-slider.mjs.map +1 -1
  103. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  104. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  105. package/fesm2022/ngwr-star-border.mjs +2 -2
  106. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  107. package/fesm2022/ngwr-switch.mjs +44 -4
  108. package/fesm2022/ngwr-switch.mjs.map +1 -1
  109. package/fesm2022/ngwr-table.mjs +1 -1
  110. package/fesm2022/ngwr-table.mjs.map +1 -1
  111. package/fesm2022/ngwr-tabs.mjs +6 -2
  112. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  113. package/fesm2022/ngwr-textarea.mjs +5 -2
  114. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  115. package/fesm2022/ngwr-theme.mjs +41 -1
  116. package/fesm2022/ngwr-theme.mjs.map +1 -1
  117. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  118. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  119. package/fesm2022/ngwr-transfer.mjs +38 -6
  120. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  121. package/fesm2022/ngwr-tree.mjs +33 -7
  122. package/fesm2022/ngwr-tree.mjs.map +1 -1
  123. package/fesm2022/ngwr-typewriter.mjs +2 -2
  124. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  125. package/fesm2022/ngwr-utils.mjs +107 -1
  126. package/fesm2022/ngwr-utils.mjs.map +1 -1
  127. package/fesm2022/ngwr-version.mjs +1 -1
  128. package/fesm2022/ngwr-version.mjs.map +1 -1
  129. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  130. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  131. package/fesm2022/ngwr-waves.mjs +2 -2
  132. package/fesm2022/ngwr-waves.mjs.map +1 -1
  133. package/file-upload/styles/_index.scss +6 -0
  134. package/glitch-text/glitch-text.scss +1 -1
  135. package/glitch-text/styles/_index.scss +14 -164
  136. package/glitch-text/styles/_rules.scss +160 -0
  137. package/gradient-text/gradient-text.scss +1 -1
  138. package/gradient-text/styles/_index.scss +15 -118
  139. package/gradient-text/styles/_rules.scss +113 -0
  140. package/input/styles/_index.scss +13 -0
  141. package/input-otp/styles/_index.scss +8 -0
  142. package/lightbox/lightbox.scss +1 -1
  143. package/lightbox/styles/_index.scss +15 -191
  144. package/lightbox/styles/_rules.scss +198 -0
  145. package/list/list.scss +1 -1
  146. package/list/styles/_index.scss +15 -101
  147. package/list/styles/_rules.scss +108 -0
  148. package/llms-full.txt +4 -4
  149. package/loading-bar/loading-bar.scss +1 -1
  150. package/loading-bar/styles/_index.scss +15 -33
  151. package/loading-bar/styles/_rules.scss +28 -0
  152. package/marquee/marquee.scss +1 -1
  153. package/marquee/styles/_index.scss +15 -155
  154. package/marquee/styles/_rules.scss +150 -0
  155. package/package.json +3 -3
  156. package/segmented/styles/_index.scss +8 -0
  157. package/select/styles/_index.scss +17 -1
  158. package/shiny-text/shiny-text.scss +1 -1
  159. package/shiny-text/styles/_index.scss +14 -105
  160. package/shiny-text/styles/_rules.scss +101 -0
  161. package/slider/styles/_index.scss +8 -0
  162. package/spotlight-card/spotlight-card.scss +1 -1
  163. package/spotlight-card/styles/_index.scss +15 -52
  164. package/spotlight-card/styles/_rules.scss +47 -0
  165. package/star-border/star-border.scss +1 -1
  166. package/star-border/styles/_index.scss +15 -125
  167. package/star-border/styles/_rules.scss +120 -0
  168. package/switch/styles/_index.scss +7 -0
  169. package/theme/styles/_dark.scss +81 -4
  170. package/theme/styles/_index.scss +1 -0
  171. package/theme/styles/_motion.scss +94 -0
  172. package/tilt-card/styles/_index.scss +15 -45
  173. package/tilt-card/styles/_rules.scss +40 -0
  174. package/tilt-card/tilt-card.scss +1 -1
  175. package/tree/styles/_index.scss +15 -1
  176. package/types/ngwr-breadcrumbs.d.ts +1 -0
  177. package/types/ngwr-cascader.d.ts +17 -1
  178. package/types/ngwr-checkbox.d.ts +51 -3
  179. package/types/ngwr-color-picker.d.ts +19 -1
  180. package/types/ngwr-file-upload.d.ts +18 -1
  181. package/types/ngwr-form.d.ts +51 -2
  182. package/types/ngwr-fuzzy-text.d.ts +5 -0
  183. package/types/ngwr-icon-adapters-feather.d.ts +11 -0
  184. package/types/ngwr-icon.d.ts +42 -1
  185. package/types/ngwr-input-otp.d.ts +23 -1
  186. package/types/ngwr-knob.d.ts +14 -0
  187. package/types/ngwr-radio.d.ts +37 -2
  188. package/types/ngwr-rating.d.ts +14 -0
  189. package/types/ngwr-segmented.d.ts +18 -1
  190. package/types/ngwr-select.d.ts +17 -1
  191. package/types/ngwr-shiny-text.d.ts +1 -0
  192. package/types/ngwr-slider.d.ts +14 -1
  193. package/types/ngwr-switch.d.ts +26 -2
  194. package/types/ngwr-textarea.d.ts +3 -0
  195. package/types/ngwr-theme.d.ts +24 -0
  196. package/types/ngwr-transfer.d.ts +17 -1
  197. package/types/ngwr-tree.d.ts +21 -1
  198. package/types/ngwr-utils.d.ts +47 -1
  199. package/types/ngwr-version.d.ts +1 -1
  200. package/typewriter/styles/_index.scss +15 -38
  201. package/typewriter/styles/_rules.scss +33 -0
  202. package/typewriter/typewriter.scss +1 -1
  203. package/virtual-scroll/styles/_index.scss +15 -32
  204. package/virtual-scroll/styles/_rules.scss +27 -0
  205. package/virtual-scroll/virtual-scroll.scss +1 -1
  206. package/waves/styles/_index.scss +15 -50
  207. package/waves/styles/_rules.scss +45 -0
  208. package/waves/waves.scss +1 -1
@@ -158,6 +158,52 @@ declare function round(value: number, decimals?: number): number;
158
158
  */
159
159
  declare const numAttr: (fallback: number) => (value: unknown) => number;
160
160
 
161
+ /**
162
+ * @license
163
+ *
164
+ * Use of this source code is governed by an MIT-style license that can be
165
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
166
+ */
167
+ /**
168
+ * Answers whether a value can be composed **into** a larger CSS expression
169
+ * without escaping the slot it was given — a colour inside a `linear-gradient()`
170
+ * the component builds, an entry the component joins into a custom property a
171
+ * stylesheet then substitutes.
172
+ *
173
+ * It is a containment check, not a colour parser. It says the value cannot
174
+ * terminate the construct the library wrapped around it; it says nothing about
175
+ * whether the value is a colour a browser will accept, and a rejected value
176
+ * should fall back to the component's own default rather than be repaired.
177
+ *
178
+ * **A value bound straight to `[style.background]` needs none of this.** There
179
+ * is nothing to break out of there, and Angular applies style values through
180
+ * CSSOM by design — validating those would amount to refusing style values in a
181
+ * style binding.
182
+ *
183
+ * Rejected, and each one is a way out of the slot:
184
+ *
185
+ * - a `)` the value never opened — `red), url(…), linear-gradient(red` is the
186
+ * shape that turns a colour into an extra background layer the browser fetches;
187
+ * - a top-level `,` — a `<color>` is one value, so a comma at depth 0 means the
188
+ * payload has reached the slot next to the one it was handed;
189
+ * - `;` `{` `}` a quote, a backslash, `!`, or a CSS comment delimiter;
190
+ * - any function outside {@link ALLOWED_FUNCTIONS} — `url()` above all.
191
+ *
192
+ * Top-level whitespace is allowed: `red 20%` is a legitimate gradient stop, and
193
+ * without a comma or a bare `)` it cannot reach anything.
194
+ *
195
+ * @example
196
+ * ```ts
197
+ * isSafeCssValue('var(--wr-color-primary)'); // true
198
+ * isSafeCssValue('color-mix(in srgb, red 50%, blue)'); // true
199
+ * isSafeCssValue('red), url("https://x.test/beacon"), linear-gradient(red'); // false
200
+ * ```
201
+ *
202
+ * @param value Raw value handed to the component.
203
+ * @returns `true` when the value stays inside its slot.
204
+ */
205
+ declare function isSafeCssValue(value: string): boolean;
206
+
161
207
  /**
162
208
  * @license
163
209
  *
@@ -446,5 +492,5 @@ declare function isPrintableKey(event: KeyboardEvent): boolean;
446
492
  */
447
493
  declare function badgeLog(badgeText: string, color: string, message: unknown): void;
448
494
 
449
- export { KEYS, badgeLog, clamp, debounce, getFocusableElements, getRootFontSize, hasModifier, isDefined, isNonEmptyArray, isObservable, isPrintableKey, noop, numAttr, randomId, resolveCssSize, round, throttle, trapFocus };
495
+ export { KEYS, badgeLog, clamp, debounce, getFocusableElements, getRootFontSize, hasModifier, isDefined, isNonEmptyArray, isObservable, isPrintableKey, isSafeCssValue, noop, numAttr, randomId, resolveCssSize, round, throttle, trapFocus };
450
496
  export type { Maybe, ResolveCssSizeOptions, ResolvedCssSize, SafeAny, WrDebouncedFn, WrKey, WrThrottledFn };
@@ -16,7 +16,7 @@ import { InjectionToken } from '@angular/core';
16
16
  * Distinct from `Version` exported by `@angular/core`, which reports the
17
17
  * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.
18
18
  */
19
- declare const NGWR_VERSION = "12.2.0";
19
+ declare const NGWR_VERSION = "13.0.1";
20
20
 
21
21
  /**
22
22
  * @license
@@ -1,38 +1,15 @@
1
- // Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
2
- // design token this stylesheet references. Sass deduplicates `@use` per
3
- // compilation, so the umbrella sheet still emits the theme only once.
4
- @use '../../theme/styles' as theme;
5
-
6
- .wr-typewriter {
7
- --wr-typewriter-cursor-blink: 0.5s;
8
-
9
- display: inline-flex;
10
- align-items: baseline;
11
-
12
- &__content {
13
- white-space: pre;
14
- }
15
-
16
- &__cursor {
17
- display: inline-block;
18
- margin-inline-start: 1px;
19
- animation: wr-typewriter-blink var(--wr-typewriter-cursor-blink) ease-in-out infinite alternate;
20
- }
21
- }
22
-
23
- @keyframes wr-typewriter-blink {
24
- from {
25
- opacity: 1;
26
- }
27
- to {
28
- opacity: 0;
29
- }
30
- }
31
-
32
- // Reduced motion: solid cursor — the blink is decorative.
33
- @media (prefers-reduced-motion: reduce) {
34
- .wr-typewriter__cursor {
35
- animation: none;
36
- opacity: 1;
37
- }
38
- }
1
+ // Public Sass entry for `@use 'ngwr/typewriter'`.
2
+ //
3
+ // Pulls the whole theme so a standalone import still brings in every design
4
+ // token these rules reference, then loads the rules themselves from `_rules`.
5
+ //
6
+ // The split is what keeps the token layer out of the JavaScript bundle.
7
+ // `typewriter.scss` is the component's `styleUrl`, and a component stylesheet is
8
+ // its OWN Sass compilation — `@use` only deduplicates within one. So while the
9
+ // umbrella sheet emits the theme once, forwarding it from here would inline a
10
+ // second, byte-identical copy of `:root`, `[data-theme='dark']` and the
11
+ // box-sizing reset into the compiled component styles, which ng-packagr then
12
+ // embeds in the FESM bundle as a string. `typewriter.scss` forwards `_rules`
13
+ // instead, so it carries this component's own CSS and nothing else.
14
+ @use '../../theme/styles';
15
+ @forward 'rules';
@@ -0,0 +1,33 @@
1
+ .wr-typewriter {
2
+ --wr-typewriter-cursor-blink: 0.5s;
3
+
4
+ display: inline-flex;
5
+ align-items: baseline;
6
+
7
+ &__content {
8
+ white-space: pre;
9
+ }
10
+
11
+ &__cursor {
12
+ display: inline-block;
13
+ margin-inline-start: 1px;
14
+ animation: wr-typewriter-blink var(--wr-typewriter-cursor-blink) ease-in-out infinite alternate;
15
+ }
16
+ }
17
+
18
+ @keyframes wr-typewriter-blink {
19
+ from {
20
+ opacity: 1;
21
+ }
22
+ to {
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ // Reduced motion: solid cursor — the blink is decorative.
28
+ @media (prefers-reduced-motion: reduce) {
29
+ .wr-typewriter__cursor {
30
+ animation: none;
31
+ opacity: 1;
32
+ }
33
+ }
@@ -1 +1 @@
1
- @forward './styles';
1
+ @forward './styles/rules';
@@ -1,32 +1,15 @@
1
- // Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
2
- // design token this stylesheet references. Sass deduplicates `@use` per
3
- // compilation, so the umbrella sheet still emits the theme only once.
4
- @use '../../theme/styles' as theme;
5
-
6
- // Fixed-size virtual scroll wrapper. Most of the layout work is done by
7
- // CDK's `<cdk-virtual-scroll-viewport>`; this stylesheet just makes the
8
- // host a block-level container and tames default overflow behaviour.
9
-
10
- .wr-virtual-scroll {
11
- display: block;
12
- width: 100%;
13
- overflow: hidden;
14
-
15
- &__viewport {
16
- width: 100%;
17
- height: 100%;
18
- // CDK already sets `overflow: auto`; just add a discreet scrollbar
19
- // skin via the platform defaults — a discreet custom thumb that still matches the
20
- // host application's chrome.
21
- scrollbar-width: thin;
22
-
23
- &::-webkit-scrollbar {
24
- width: 0.5rem;
25
- height: 0.5rem;
26
- }
27
- &::-webkit-scrollbar-thumb {
28
- background: rgba(var(--wr-color-on-surface-rgb), 0.2);
29
- border-radius: 999px;
30
- }
31
- }
32
- }
1
+ // Public Sass entry for `@use 'ngwr/virtual-scroll'`.
2
+ //
3
+ // Pulls the whole theme so a standalone import still brings in every design
4
+ // token these rules reference, then loads the rules themselves from `_rules`.
5
+ //
6
+ // The split is what keeps the token layer out of the JavaScript bundle.
7
+ // `virtual-scroll.scss` is the component's `styleUrl`, and a component stylesheet is
8
+ // its OWN Sass compilation — `@use` only deduplicates within one. So while the
9
+ // umbrella sheet emits the theme once, forwarding it from here would inline a
10
+ // second, byte-identical copy of `:root`, `[data-theme='dark']` and the
11
+ // box-sizing reset into the compiled component styles, which ng-packagr then
12
+ // embeds in the FESM bundle as a string. `virtual-scroll.scss` forwards `_rules`
13
+ // instead, so it carries this component's own CSS and nothing else.
14
+ @use '../../theme/styles';
15
+ @forward 'rules';
@@ -0,0 +1,27 @@
1
+ // Fixed-size virtual scroll wrapper. Most of the layout work is done by
2
+ // CDK's `<cdk-virtual-scroll-viewport>`; this stylesheet just makes the
3
+ // host a block-level container and tames default overflow behaviour.
4
+
5
+ .wr-virtual-scroll {
6
+ display: block;
7
+ width: 100%;
8
+ overflow: hidden;
9
+
10
+ &__viewport {
11
+ width: 100%;
12
+ height: 100%;
13
+ // CDK already sets `overflow: auto`; just add a discreet scrollbar
14
+ // skin via the platform defaults — a discreet custom thumb that still matches the
15
+ // host application's chrome.
16
+ scrollbar-width: thin;
17
+
18
+ &::-webkit-scrollbar {
19
+ width: 0.5rem;
20
+ height: 0.5rem;
21
+ }
22
+ &::-webkit-scrollbar-thumb {
23
+ background: rgba(var(--wr-color-on-surface-rgb), 0.2);
24
+ border-radius: 999px;
25
+ }
26
+ }
27
+ }
@@ -1 +1 @@
1
- @forward './styles';
1
+ @forward './styles/rules';
@@ -1,50 +1,15 @@
1
- // Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
2
- // design token this stylesheet references. Sass deduplicates `@use` per
3
- // compilation, so the umbrella sheet still emits the theme only once.
4
- @use '../../theme/styles' as theme;
5
-
6
- // Wave-field background (reactbits port). The host fills its nearest
7
- // positioned ancestor; the line colour is theme-aware via
8
- // `--wr-waves-line-color` unless `[lineColor]` overrides it.
9
-
10
- .wr-waves {
11
- --wr-waves-line-color: rgba(var(--wr-color-on-surface-rgb), 0.12);
12
- // Mirrors the `xGap` input; the component publishes it so the stand-in below
13
- // lands on the same pitch as the real grid.
14
- --wr-waves-x-gap: 10px;
15
-
16
- position: absolute;
17
- inset: 0;
18
- display: block;
19
- margin: 0;
20
- padding: 0;
21
- overflow: hidden;
22
-
23
- // Stand-in grid, shown until the canvas has painted.
24
- //
25
- // A canvas cannot be prerendered, so on an SSR'd or prerendered page this
26
- // element is blank until the JS bundle has loaded and hydrated — measured at
27
- // ~2.8s on ngwr.dev's own home page, where it reads as the background hanging
28
- // and then popping in. These are straight lines rather than the drifting
29
- // curves, at the same colour and pitch, so the handover reads as the grid
30
- // coming alive rather than as content appearing.
31
- background-image: repeating-linear-gradient(
32
- to right,
33
- var(--wr-waves-line-color) 0 1px,
34
- transparent 1px var(--wr-waves-x-gap)
35
- );
36
-
37
- &--painted {
38
- background-image: none;
39
- }
40
-
41
- &__canvas {
42
- display: block;
43
- width: 100%;
44
- height: 100%;
45
- }
46
- }
47
-
48
- [data-theme='dark'] .wr-waves {
49
- --wr-waves-line-color: rgb(255 255 255 / 14%);
50
- }
1
+ // Public Sass entry for `@use 'ngwr/waves'`.
2
+ //
3
+ // Pulls the whole theme so a standalone import still brings in every design
4
+ // token these rules reference, then loads the rules themselves from `_rules`.
5
+ //
6
+ // The split is what keeps the token layer out of the JavaScript bundle.
7
+ // `waves.scss` is the component's `styleUrl`, and a component stylesheet is
8
+ // its OWN Sass compilation — `@use` only deduplicates within one. So while the
9
+ // umbrella sheet emits the theme once, forwarding it from here would inline a
10
+ // second, byte-identical copy of `:root`, `[data-theme='dark']` and the
11
+ // box-sizing reset into the compiled component styles, which ng-packagr then
12
+ // embeds in the FESM bundle as a string. `waves.scss` forwards `_rules`
13
+ // instead, so it carries this component's own CSS and nothing else.
14
+ @use '../../theme/styles';
15
+ @forward 'rules';
@@ -0,0 +1,45 @@
1
+ // Wave-field background (reactbits port). The host fills its nearest
2
+ // positioned ancestor; the line colour is theme-aware via
3
+ // `--wr-waves-line-color` unless `[lineColor]` overrides it.
4
+
5
+ .wr-waves {
6
+ --wr-waves-line-color: rgba(var(--wr-color-on-surface-rgb), 0.12);
7
+ // Mirrors the `xGap` input; the component publishes it so the stand-in below
8
+ // lands on the same pitch as the real grid.
9
+ --wr-waves-x-gap: 10px;
10
+
11
+ position: absolute;
12
+ inset: 0;
13
+ display: block;
14
+ margin: 0;
15
+ padding: 0;
16
+ overflow: hidden;
17
+
18
+ // Stand-in grid, shown until the canvas has painted.
19
+ //
20
+ // A canvas cannot be prerendered, so on an SSR'd or prerendered page this
21
+ // element is blank until the JS bundle has loaded and hydrated — measured at
22
+ // ~2.8s on ngwr.dev's own home page, where it reads as the background hanging
23
+ // and then popping in. These are straight lines rather than the drifting
24
+ // curves, at the same colour and pitch, so the handover reads as the grid
25
+ // coming alive rather than as content appearing.
26
+ background-image: repeating-linear-gradient(
27
+ to right,
28
+ var(--wr-waves-line-color) 0 1px,
29
+ transparent 1px var(--wr-waves-x-gap)
30
+ );
31
+
32
+ &--painted {
33
+ background-image: none;
34
+ }
35
+
36
+ &__canvas {
37
+ display: block;
38
+ width: 100%;
39
+ height: 100%;
40
+ }
41
+ }
42
+
43
+ [data-theme='dark'] .wr-waves {
44
+ --wr-waves-line-color: rgb(255 255 255 / 14%);
45
+ }
package/waves/waves.scss CHANGED
@@ -1 +1 @@
1
- @forward './styles';
1
+ @forward './styles/rules';