ngwr 12.1.0 → 13.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 (187) hide show
  1. package/README.md +11 -1
  2. package/alert/styles/_index.scss +11 -4
  3. package/badge/styles/_index.scss +30 -0
  4. package/badge/styles/_tag.scss +15 -1
  5. package/border-glow/border-glow.scss +1 -1
  6. package/border-glow/styles/_index.scss +15 -233
  7. package/border-glow/styles/_rules.scss +228 -0
  8. package/breadcrumbs/breadcrumbs.scss +1 -1
  9. package/breadcrumbs/styles/_index.scss +15 -78
  10. package/breadcrumbs/styles/_rules.scss +84 -0
  11. package/card/card.scss +1 -1
  12. package/card/styles/_index.scss +15 -96
  13. package/card/styles/_rules.scss +96 -0
  14. package/cascader/cascader.scss +1 -1
  15. package/cascader/styles/_index.scss +15 -244
  16. package/cascader/styles/_rules.scss +261 -0
  17. package/checkbox/styles/_index.scss +7 -0
  18. package/circular-text/circular-text.scss +1 -1
  19. package/circular-text/styles/_index.scss +15 -63
  20. package/circular-text/styles/_rules.scss +58 -0
  21. package/color-picker/styles/_index.scss +8 -0
  22. package/descriptions/styles/_index.scss +13 -3
  23. package/drag-drop/sortable-list.scss +1 -1
  24. package/drag-drop/styles/_index.scss +14 -143
  25. package/drag-drop/styles/_rules.scss +151 -0
  26. package/drawer/styles/_index.scss +95 -1
  27. package/falling-text/falling-text.scss +1 -1
  28. package/falling-text/styles/_index.scss +15 -36
  29. package/falling-text/styles/_rules.scss +31 -0
  30. package/fesm2022/ngwr-border-glow.mjs +2 -2
  31. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  32. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  33. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  34. package/fesm2022/ngwr-card.mjs +2 -2
  35. package/fesm2022/ngwr-card.mjs.map +1 -1
  36. package/fesm2022/ngwr-cascader.mjs +27 -9
  37. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  38. package/fesm2022/ngwr-checkbox.mjs +86 -8
  39. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  40. package/fesm2022/ngwr-circular-text.mjs +2 -2
  41. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  42. package/fesm2022/ngwr-color-picker.mjs +57 -7
  43. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  44. package/fesm2022/ngwr-date-picker.mjs +8 -0
  45. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  46. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  47. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  48. package/fesm2022/ngwr-drawer.mjs +6 -0
  49. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  50. package/fesm2022/ngwr-falling-text.mjs +2 -2
  51. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  52. package/fesm2022/ngwr-file-upload.mjs +29 -8
  53. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  54. package/fesm2022/ngwr-form.mjs +48 -1
  55. package/fesm2022/ngwr-form.mjs.map +1 -1
  56. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  57. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  58. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  59. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  60. package/fesm2022/ngwr-input-otp.mjs +41 -3
  61. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  62. package/fesm2022/ngwr-knob.mjs +17 -2
  63. package/fesm2022/ngwr-knob.mjs.map +1 -1
  64. package/fesm2022/ngwr-lightbox.mjs +2 -2
  65. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  66. package/fesm2022/ngwr-list.mjs +2 -2
  67. package/fesm2022/ngwr-list.mjs.map +1 -1
  68. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  69. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  70. package/fesm2022/ngwr-marquee.mjs +2 -2
  71. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  72. package/fesm2022/ngwr-pagination.mjs +1 -1
  73. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  74. package/fesm2022/ngwr-radio.mjs +63 -8
  75. package/fesm2022/ngwr-radio.mjs.map +1 -1
  76. package/fesm2022/ngwr-rating.mjs +17 -2
  77. package/fesm2022/ngwr-rating.mjs.map +1 -1
  78. package/fesm2022/ngwr-segmented.mjs +22 -3
  79. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  80. package/fesm2022/ngwr-select.mjs +59 -15
  81. package/fesm2022/ngwr-select.mjs.map +1 -1
  82. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  83. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  84. package/fesm2022/ngwr-slider.mjs +21 -6
  85. package/fesm2022/ngwr-slider.mjs.map +1 -1
  86. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  87. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  88. package/fesm2022/ngwr-star-border.mjs +2 -2
  89. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  90. package/fesm2022/ngwr-switch.mjs +44 -4
  91. package/fesm2022/ngwr-switch.mjs.map +1 -1
  92. package/fesm2022/ngwr-table.mjs +1 -1
  93. package/fesm2022/ngwr-table.mjs.map +1 -1
  94. package/fesm2022/ngwr-textarea.mjs +5 -2
  95. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  96. package/fesm2022/ngwr-theme.mjs +41 -1
  97. package/fesm2022/ngwr-theme.mjs.map +1 -1
  98. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  99. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  100. package/fesm2022/ngwr-transfer.mjs +38 -6
  101. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  102. package/fesm2022/ngwr-tree.mjs +33 -7
  103. package/fesm2022/ngwr-tree.mjs.map +1 -1
  104. package/fesm2022/ngwr-typewriter.mjs +2 -2
  105. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  106. package/fesm2022/ngwr-version.mjs +1 -1
  107. package/fesm2022/ngwr-version.mjs.map +1 -1
  108. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  109. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  110. package/fesm2022/ngwr-waves.mjs +2 -2
  111. package/fesm2022/ngwr-waves.mjs.map +1 -1
  112. package/file-upload/styles/_index.scss +6 -0
  113. package/glitch-text/glitch-text.scss +1 -1
  114. package/glitch-text/styles/_index.scss +14 -164
  115. package/glitch-text/styles/_rules.scss +160 -0
  116. package/gradient-text/gradient-text.scss +1 -1
  117. package/gradient-text/styles/_index.scss +15 -118
  118. package/gradient-text/styles/_rules.scss +113 -0
  119. package/input/styles/_index.scss +13 -0
  120. package/input-otp/styles/_index.scss +8 -0
  121. package/lightbox/lightbox.scss +1 -1
  122. package/lightbox/styles/_index.scss +15 -191
  123. package/lightbox/styles/_rules.scss +198 -0
  124. package/list/list.scss +1 -1
  125. package/list/styles/_index.scss +15 -101
  126. package/list/styles/_rules.scss +108 -0
  127. package/llms-full.txt +3 -3
  128. package/loading-bar/loading-bar.scss +1 -1
  129. package/loading-bar/styles/_index.scss +15 -33
  130. package/loading-bar/styles/_rules.scss +28 -0
  131. package/marquee/marquee.scss +1 -1
  132. package/marquee/styles/_index.scss +15 -155
  133. package/marquee/styles/_rules.scss +150 -0
  134. package/overlay/styles/_arrow.scss +243 -0
  135. package/package.json +1 -1
  136. package/popconfirm/styles/_index.scss +17 -0
  137. package/popover/styles/_index.scss +49 -207
  138. package/segmented/styles/_index.scss +8 -0
  139. package/select/styles/_index.scss +47 -5
  140. package/shiny-text/shiny-text.scss +1 -1
  141. package/shiny-text/styles/_index.scss +14 -105
  142. package/shiny-text/styles/_rules.scss +101 -0
  143. package/sidebar/styles/_index.scss +4 -1
  144. package/slider/styles/_index.scss +8 -0
  145. package/spotlight-card/spotlight-card.scss +1 -1
  146. package/spotlight-card/styles/_index.scss +15 -52
  147. package/spotlight-card/styles/_rules.scss +47 -0
  148. package/star-border/star-border.scss +1 -1
  149. package/star-border/styles/_index.scss +15 -125
  150. package/star-border/styles/_rules.scss +120 -0
  151. package/stepper/styles/_index.scss +44 -5
  152. package/switch/styles/_index.scss +7 -0
  153. package/theme/styles/_dark.scss +81 -4
  154. package/theme/styles/_index.scss +1 -0
  155. package/theme/styles/_mixins.scss +10 -0
  156. package/theme/styles/_motion.scss +94 -0
  157. package/tilt-card/styles/_index.scss +15 -45
  158. package/tilt-card/styles/_rules.scss +40 -0
  159. package/tilt-card/tilt-card.scss +1 -1
  160. package/tree/styles/_index.scss +25 -3
  161. package/types/ngwr-cascader.d.ts +17 -1
  162. package/types/ngwr-checkbox.d.ts +51 -3
  163. package/types/ngwr-color-picker.d.ts +19 -1
  164. package/types/ngwr-file-upload.d.ts +18 -1
  165. package/types/ngwr-form.d.ts +51 -2
  166. package/types/ngwr-input-otp.d.ts +23 -1
  167. package/types/ngwr-knob.d.ts +14 -0
  168. package/types/ngwr-radio.d.ts +37 -2
  169. package/types/ngwr-rating.d.ts +14 -0
  170. package/types/ngwr-segmented.d.ts +18 -1
  171. package/types/ngwr-select.d.ts +29 -3
  172. package/types/ngwr-slider.d.ts +14 -1
  173. package/types/ngwr-switch.d.ts +26 -2
  174. package/types/ngwr-textarea.d.ts +3 -0
  175. package/types/ngwr-theme.d.ts +24 -0
  176. package/types/ngwr-transfer.d.ts +17 -1
  177. package/types/ngwr-tree.d.ts +21 -1
  178. package/types/ngwr-version.d.ts +1 -1
  179. package/typewriter/styles/_index.scss +15 -38
  180. package/typewriter/styles/_rules.scss +33 -0
  181. package/typewriter/typewriter.scss +1 -1
  182. package/virtual-scroll/styles/_index.scss +15 -32
  183. package/virtual-scroll/styles/_rules.scss +27 -0
  184. package/virtual-scroll/virtual-scroll.scss +1 -1
  185. package/waves/styles/_index.scss +15 -50
  186. package/waves/styles/_rules.scss +45 -0
  187. package/waves/waves.scss +1 -1
@@ -1,196 +1,27 @@
1
- @use 'sass:list';
2
-
3
1
  @use '../../theme/styles' as theme;
4
2
  @use '../../overlay/styles'; // shared .wr-overlay-sheet / .wr-overlay-backdrop for responsive mode
5
-
6
- // --- Arrow -----------------------------------------------------------------
7
- //
8
- // A small square rotated 45°, half tucked under the panel so only the tip shows.
9
- // Tooltip and popover share the geometry; the popover additionally carries the
10
- // panel's border on the two outward faces so the outline reads as continuous.
11
- //
12
- // Placement is driven by the resolved position modifier the directive puts on the
13
- // overlay host (`--top` means the panel sits ABOVE the trigger, so the arrow hangs
14
- // off the panel's BOTTOM edge). All 12 positions are covered — the hand-written
15
- // tooltip rules this replaces only handled 8, so `top-start` / `top-end` /
16
- // `bottom-start` / `bottom-end` tooltips have been shipping with no arrow at all.
17
- $_arrow: 6px;
18
- $_arrow-half: 3px;
19
- $_arrow-inset: 0.625rem; // distance from the panel corner for the -start / -end variants
20
-
21
- // edge = which side of the panel the arrow hangs off; align = where along that side.
22
- $_arrow-placement: (
23
- top: (
24
- bottom,
25
- center,
26
- ),
27
- top-start: (
28
- bottom,
29
- start,
30
- ),
31
- top-end: (
32
- bottom,
33
- end,
34
- ),
35
- bottom: (
36
- top,
37
- center,
38
- ),
39
- bottom-start: (
40
- top,
41
- start,
42
- ),
43
- bottom-end: (
44
- top,
45
- end,
46
- ),
47
- left: (
48
- right,
49
- center,
50
- ),
51
- left-start: (
52
- right,
53
- start,
54
- ),
55
- left-end: (
56
- right,
57
- end,
58
- ),
59
- right: (
60
- left,
61
- center,
62
- ),
63
- right-start: (
64
- left,
65
- start,
66
- ),
67
- right-end: (
68
- left,
69
- end,
70
- ),
71
- );
72
-
73
- /// Positions the arrow against `$edge`, offset outwards by `$pull`.
74
- ///
75
- /// `left` / `right` name the panel edge in LTR terms only. Every side-anchored
76
- /// and `-start` / `-end` entry in `WR_POPOVER_POSITIONS` is expressed as CDK
77
- /// `originX: start | end` — plain `top` / `bottom` use `center`, which mirrors
78
- /// to itself — and CDK resolves start / end against `Directionality`. So under
79
- /// `dir="rtl"` the panel lands on the mirrored side of the trigger while the
80
- /// modifier class keeps its LTR name, and the arrow has to travel with the
81
- /// panel. Same for the `-start` / `-end` alignment along a horizontal edge.
82
- ///
83
- /// The class names the placement the panel ACTUALLY took, not the requested one:
84
- /// each entry in `WR_POPOVER_FALLBACKS` carries its own `panelClass`, so a flip
85
- /// swaps the modifier and this loop moves the arrow with it.
86
- @mixin _arrow-at($edge, $align, $pull) {
87
- @if $edge == left {
88
- inset-inline-start: -$pull;
89
- } @else if $edge == right {
90
- inset-inline-end: -$pull;
91
- } @else {
92
- #{$edge}: -$pull;
93
- }
94
-
95
- @if $edge == bottom or $edge == top {
96
- @if $align == center {
97
- // Both halves of the centring pair go logical together, so the arrow
98
- // stays on the midpoint whichever way the axis runs.
99
- inset-inline-start: 50%;
100
- margin-inline-start: -$_arrow-half;
101
- } @else if $align == start {
102
- inset-inline-start: $_arrow-inset;
103
- } @else {
104
- inset-inline-end: $_arrow-inset;
105
- }
106
- } @else {
107
- @if $align == center {
108
- top: 50%;
109
- margin-top: -$_arrow-half;
110
- } @else if $align == start {
111
- top: $_arrow-inset;
112
- } @else {
113
- bottom: $_arrow-inset;
114
- }
115
- }
116
- }
117
-
118
- /// The two faces of the rotated square that stay visible outside the panel.
119
- ///
120
- /// These stay physical, and it is not an oversight. Which two borders paint is
121
- /// decided by `transform: rotate(45deg)`, not by reading order: the rotation
122
- /// turns the right border into the down-right face and the bottom one into the
123
- /// down-left face, so `right + bottom` is what outlines a tip pointing DOWN.
124
- /// Swapping only the inline half would paint two faces that are tucked under
125
- /// the panel. A mirrored arrow needs the rotation mirrored as well — more than
126
- /// a property rewrite, so it is left for the RTL pass that owns the TS side.
127
- @mixin _arrow-border($edge) {
128
- @if $edge == bottom {
129
- // rtl-ok: down-right face of a 45°-rotated square — fixed by the rotation
130
- border-right: 1px solid var(--wr-color-outline);
131
- border-bottom: 1px solid var(--wr-color-outline);
132
- } @else if $edge == top {
133
- // rtl-ok: up-left face of a 45°-rotated square — fixed by the rotation
134
- border-left: 1px solid var(--wr-color-outline);
135
- border-top: 1px solid var(--wr-color-outline);
136
- } @else if $edge == right {
137
- border-top: 1px solid var(--wr-color-outline);
138
- // rtl-ok: down-right face of a 45°-rotated square — fixed by the rotation
139
- border-right: 1px solid var(--wr-color-outline);
140
- } @else {
141
- border-bottom: 1px solid var(--wr-color-outline);
142
- // rtl-ok: up-left face of a 45°-rotated square — fixed by the rotation
143
- border-left: 1px solid var(--wr-color-outline);
144
- }
145
- }
146
-
147
- .wr-popover-overlay {
148
- > * {
149
- // Containing block for the arrow below.
150
- position: relative;
151
- display: block;
152
- min-width: 8rem;
153
- max-width: 22rem;
154
- background: var(--wr-color-surface);
155
- border: 1px solid var(--wr-color-outline);
156
- @include theme.smooth-br(var(--wr-border-radius-base));
157
- box-shadow: var(--wr-shadow-overlay);
158
- font-family: var(--wr-font-family-base);
159
- color: var(--wr-color-on-surface);
160
- animation: wr-overlay-in var(--wr-overlay-duration) var(--wr-overlay-ease);
161
- // rtl-ok: scale-in growth corner — `transform-origin` takes no logical keywords
162
- transform-origin: top left;
163
-
164
- &::after {
165
- content: '';
166
- position: absolute;
167
- width: $_arrow;
168
- height: $_arrow;
169
- background: var(--wr-color-surface);
170
- transform: rotate(45deg);
171
- }
172
- }
173
-
174
- // Responsive bottom-sheet mode has no anchor to point at, so no arrow.
175
- &.wr-overlay-sheet > *::after {
176
- content: none;
177
- }
178
- }
179
-
180
- @each $position, $spec in $_arrow-placement {
181
- $edge: list.nth($spec, 1);
182
- $align: list.nth($spec, 2);
183
-
184
- // Pulled one extra pixel so the square's own border lines up flush with the
185
- // panel's, instead of leaving the panel border showing across the arrow's base.
186
- .wr-popover-overlay--#{$position} > *::after {
187
- @include _arrow-at($edge, $align, $_arrow-half + 1px);
188
- @include _arrow-border($edge);
189
- }
190
-
191
- .wr-tooltip-overlay--#{$position} .wr-tooltip::after {
192
- @include _arrow-at($edge, $align, $_arrow-half);
193
- }
3
+ @use '../../overlay/styles/arrow';
4
+
5
+ // The arrow — a rotated square tucked half under the panel — used to be written
6
+ // out here: geometry, a twelve-placement map and two mixins. `wr-popconfirm` is
7
+ // the same kind of anchored panel and had none of it, so rather than a second
8
+ // copy the whole thing moved to `overlay/styles/_arrow.scss` and both components
9
+ // call `arrow.anchored-arrow()`. The two calls at the foot of this file emit the
10
+ // rules that were here, for the same twelve placements.
11
+
12
+ .wr-popover-overlay > * {
13
+ display: block;
14
+ min-width: 8rem;
15
+ max-width: 22rem;
16
+ background: var(--wr-color-surface);
17
+ border: 1px solid var(--wr-color-outline);
18
+ @include theme.smooth-br(var(--wr-border-radius-base));
19
+ box-shadow: var(--wr-shadow-overlay);
20
+ font-family: var(--wr-font-family-base);
21
+ color: var(--wr-color-on-surface);
22
+ animation: wr-overlay-in var(--wr-overlay-duration) var(--wr-overlay-ease);
23
+ // rtl-ok: scale-in growth corner — `transform-origin` takes no logical keywords
24
+ transform-origin: top left;
194
25
  }
195
26
 
196
27
  //
@@ -235,24 +66,35 @@ $_arrow-placement: (
235
66
  // rtl-ok: scale-in growth corner — `transform-origin` takes no logical keywords
236
67
  transform-origin: top left;
237
68
 
238
- // Arrow — geometry from the shared placement loop at the top of this file.
239
- &::after {
240
- content: '';
241
- position: absolute;
242
- width: $_arrow;
243
- height: $_arrow;
244
- background: var(--wr-tooltip-bg);
245
- transform: rotate(45deg);
246
- // The one piece that stays inert: the arrow points AT the trigger and
247
- // overlaps it, so a hittable arrow would eat clicks meant for the control
248
- // the tooltip describes.
249
- pointer-events: none;
250
- }
69
+ // The arrow itself comes from `arrow.anchored-arrow()` below. `position:
70
+ // relative` is restated by that call and kept here too, so the class still
71
+ // stands on its own for anyone styling `.wr-tooltip` directly — it is public
72
+ // API, and the arrow is the pane's business rather than the chip's.
251
73
  }
252
74
 
253
- // Arrow placement for both modes is generated from `$_arrow-placement` at the top
254
- // of this file — the per-position rules that used to live here are emitted there,
255
- // byte-identical for the 8 positions they covered plus the 4 they missed.
75
+ // Arrow for both modes.
76
+ //
77
+ // Popover: the pane wraps whatever the author projected, so the panel selector
78
+ // is `> *`, and the square carries the panel's border on its two outward faces
79
+ // so the outline reads as continuous.
80
+ @include arrow.anchored-arrow(
81
+ $pane: '.wr-popover-overlay',
82
+ $panel: '> *',
83
+ $background: var(--wr-color-surface),
84
+ $border: var(--wr-color-outline)
85
+ );
86
+
87
+ // Tooltip: a known child, and no border faces — the chip's own border colour is
88
+ // overridable per instance through `--wr-tooltip-border`, so painting the faces
89
+ // from the token here would desync the moment anyone retints one. The arrow
90
+ // points AT the trigger and overlaps it, so it is the one inert piece: a
91
+ // hittable arrow would eat clicks meant for the control the tooltip describes.
92
+ @include arrow.anchored-arrow(
93
+ $pane: '.wr-tooltip-overlay',
94
+ $panel: '.wr-tooltip',
95
+ $background: var(--wr-tooltip-bg),
96
+ $inert: true
97
+ );
256
98
 
257
99
  @media (prefers-reduced-motion: reduce) {
258
100
  .wr-tooltip {
@@ -130,6 +130,14 @@
130
130
  line-height: var(--wr-segmented-line-height);
131
131
  }
132
132
 
133
+ // A read-only strip still takes focus and still shows which segment is
134
+ // pressed, so it keeps the visual and only stops inviting the click. This
135
+ // cursor is the only cue there is — see the `readonly` input for why nothing
136
+ // is mirrored into ARIA.
137
+ &--readonly &__option {
138
+ cursor: default;
139
+ }
140
+
133
141
  &--disabled {
134
142
  pointer-events: none;
135
143
  opacity: var(--wr-disabled-opacity);
@@ -10,6 +10,14 @@
10
10
  --wr-select-padding-x: var(--wr-control-padding-x-md);
11
11
  --wr-select-font-size: var(--wr-control-font-size-md);
12
12
  --wr-select-line-height: var(--wr-control-line-height-md);
13
+ // The floor that keeps a bare `<wr-select>` from collapsing to its
14
+ // placeholder. A hook rather than a literal because the floor is wrong as
15
+ // often as it is right: dropped into a `minmax(0, 1fr)` grid column the
16
+ // trigger holds 160px and overhangs its cell, and overriding
17
+ // `.wr-select__trigger` is reaching past the public contract for something
18
+ // the rest of the component already exposes. Set it to 0 to hand the width
19
+ // back to the layout.
20
+ --wr-select-min-width: 10rem;
13
21
 
14
22
  display: inline-flex;
15
23
  vertical-align: middle;
@@ -36,7 +44,15 @@
36
44
  &--rounded {
37
45
  --wr-select-radius: var(--wr-border-radius-pill);
38
46
  --wr-select-padding-x: 1rem;
39
- corner-shape: round; // override squircle from smooth-br for pills
47
+
48
+ // The squircle reset has to land on the element `smooth-br` ran on, and
49
+ // that is the trigger, not the host: `corner-shape` does not inherit, so a
50
+ // declaration here left the trigger drawing the inset curve the mixin's own
51
+ // gotcha warns about instead of a stadium. `wr-btn` / `wr-input` put their
52
+ // modifier and their `smooth-br` on one element, which is why they paint.
53
+ .wr-select__trigger {
54
+ corner-shape: round;
55
+ }
40
56
  }
41
57
 
42
58
  &--disabled {
@@ -44,12 +60,20 @@
44
60
  --wr-select-bg: var(--wr-color-fill);
45
61
  }
46
62
 
63
+ // A read-only select still takes focus and still shows what is selected, so it
64
+ // keeps the visual and only stops inviting the click that would open the
65
+ // panel. `not-allowed` would say something false about a control that works —
66
+ // the same call `.wr-select__tag-input:read-only` already makes.
67
+ &--readonly &__trigger {
68
+ cursor: default;
69
+ }
70
+
47
71
  &__trigger {
48
72
  display: inline-flex;
49
73
  align-items: center;
50
74
  gap: 0.5rem;
51
75
  width: 100%;
52
- min-width: 10rem;
76
+ min-width: var(--wr-select-min-width);
53
77
  appearance: none;
54
78
  background: var(--wr-select-bg);
55
79
  color: var(--wr-select-color);
@@ -128,7 +152,15 @@
128
152
  // Search-mode trigger: inline text input + chevron + clear
129
153
  &__trigger--search {
130
154
  cursor: text;
131
- padding: 0;
155
+ // The FIELD owns the padding here — it is the click target and has to be
156
+ // typable edge to edge — but the chevron and the × are siblings of it, not
157
+ // children, so a flat `padding: 0` left the chevron sitting on the border.
158
+ // Hand the TRAILING inset back to the trigger: the chevron is now inset by
159
+ // the same amount the placeholder is, and the field keeps the leading edge.
160
+ // Logical properties, so the inset moves to the left in `dir="rtl"` on its
161
+ // own — no physical side is named.
162
+ padding-block: 0;
163
+ padding-inline: 0 calc(var(--wr-select-padding-x) * var(--wr-density-x, 1));
132
164
 
133
165
  &:focus-within {
134
166
  border-color: var(--wr-color-primary);
@@ -218,7 +250,12 @@
218
250
  // Roomier on the label side, tighter where the remove (×) sits.
219
251
  padding-block: 0.125rem;
220
252
  padding-inline: 0.5rem 0.25rem;
221
- border-radius: 999px;
253
+ // Not a pill: a chip is a shape nested INSIDE the trigger, so it repeats the
254
+ // trigger's own corner and scales with `size` along with it (5 / 6 / 7px for
255
+ // sm / md / lg). `--rounded` sets `--wr-select-radius` to the pill token, so
256
+ // a pill select still gets pill chips — the shape follows the control rather
257
+ // than being decided twice.
258
+ border-radius: var(--wr-select-radius);
222
259
  background: var(--wr-color-primary-soft);
223
260
  // `-ink`, not the raw intent: the chip paints the hue on its own soft tint,
224
261
  // where the base lands at 4.17:1.
@@ -241,7 +278,12 @@
241
278
  justify-content: center;
242
279
  width: 1rem;
243
280
  height: 1rem;
244
- border-radius: 999px;
281
+ // Concentric with the chip: the remove is inset from the chip's edge by the
282
+ // chip's 2px block padding, and an inner corner only nests cleanly when it
283
+ // is the outer corner minus that inset. `max()` keeps the value legal for a
284
+ // consumer who sets `--wr-select-radius: 0` — a negative radius would
285
+ // invalidate the declaration outright.
286
+ border-radius: max(0px, calc(var(--wr-select-radius) - 2px));
245
287
  cursor: pointer;
246
288
  transition: background 0.12s ease;
247
289
 
@@ -1 +1 @@
1
- @forward './styles';
1
+ @forward './styles/rules';
@@ -1,106 +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
- // Shimmering text (reactbits port). Clips an animated linear gradient to
7
- // the text via `background-clip: text`.
1
+ // Public Sass entry for `@use 'ngwr/shiny-text'`.
8
2
  //
9
- // The keyframes are 0% → 50%, then hold at the end position. Inputs set
10
- // `animation-duration` to (speed + delay); the keyframe hits the end at
11
- // the 50%/totalDuration mark and rests for the rest, which collapses to
12
- // `speed` of motion + `delay` of pause — without needing two animations.
13
-
14
- .wr-shiny-text {
15
- // Theme-default sweep (overridden by `[color]` / `[shineColor]`):
16
- // gray base with a dark shine on light surfaces; dark theme restores
17
- // the reactbits gray-with-white-flash below.
18
- --wr-shiny-text-base: var(--wr-color-on-surface-muted, #8594a4);
19
- --wr-shiny-text-shine: var(--wr-color-on-surface, #0f172a);
20
-
21
- display: inline-block;
22
- background-size: 200% auto;
23
- background-position: 150% center;
24
- -webkit-background-clip: text;
25
- background-clip: text;
26
- -webkit-text-fill-color: transparent;
27
- animation-name: wr-shiny-text-sweep;
28
- animation-timing-function: linear;
29
- animation-iteration-count: infinite;
30
- animation-direction: normal;
31
- animation-fill-mode: both;
32
- animation-play-state: running;
33
-
34
- &--reverse {
35
- animation-direction: reverse;
36
- }
37
-
38
- &--yoyo {
39
- animation-direction: alternate;
40
-
41
- &.wr-shiny-text--reverse {
42
- animation-direction: alternate-reverse;
43
- }
44
- }
45
-
46
- &--paused {
47
- animation-play-state: paused;
48
- }
49
-
50
- &--pause-on-hover:hover {
51
- animation-play-state: paused;
52
- }
53
- }
54
-
55
- @keyframes wr-shiny-text-sweep {
56
- 0% {
57
- background-position: 150% center;
58
- }
59
- 50% {
60
- background-position: -50% center;
61
- }
62
- 100% {
63
- background-position: -50% center;
64
- }
65
- }
66
-
67
- // Reduced motion: freeze the sweep at its rest position — the gradient's
68
- // base color fills the text, so it stays readable with zero movement.
69
- @media (prefers-reduced-motion: reduce) {
70
- .wr-shiny-text {
71
- animation: none !important;
72
- }
73
- }
74
-
75
- // [wrShimmer] directive
76
- // Same package as <wr-shiny-text>. Lightweight host-class directive —
77
- // gradient sweep across text via `background-clip: text`.
78
- @keyframes wr-shimmer {
79
- 100% {
80
- background-position-x: -200%;
81
- }
82
- }
83
-
84
- .wr-shimmer {
85
- background: linear-gradient(
86
- 110deg,
87
- var(--wr-color-on-surface) 30%,
88
- rgba(var(--wr-color-primary-rgb), 0.9) 50%,
89
- var(--wr-color-on-surface) 70%
90
- );
91
- background-size: 200% 100%;
92
- background-clip: text;
93
- -webkit-background-clip: text;
94
- -webkit-text-fill-color: transparent;
95
- color: transparent;
96
- animation: wr-shimmer 2.5s linear infinite;
97
-
98
- @media (prefers-reduced-motion: reduce) {
99
- animation: none;
100
- }
101
- }
102
-
103
- [data-theme='dark'] .wr-shiny-text {
104
- --wr-shiny-text-base: #b5b5b5;
105
- --wr-shiny-text-shine: #ffffff;
106
- }
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
+ // `shiny-text.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. `shiny-text.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,101 @@
1
+ // Shimmering text (reactbits port). Clips an animated linear gradient to
2
+ // the text via `background-clip: text`.
3
+ //
4
+ // The keyframes are 0% → 50%, then hold at the end position. Inputs set
5
+ // `animation-duration` to (speed + delay); the keyframe hits the end at
6
+ // the 50%/totalDuration mark and rests for the rest, which collapses to
7
+ // `speed` of motion + `delay` of pause — without needing two animations.
8
+
9
+ .wr-shiny-text {
10
+ // Theme-default sweep (overridden by `[color]` / `[shineColor]`):
11
+ // gray base with a dark shine on light surfaces; dark theme restores
12
+ // the reactbits gray-with-white-flash below.
13
+ --wr-shiny-text-base: var(--wr-color-on-surface-muted, #8594a4);
14
+ --wr-shiny-text-shine: var(--wr-color-on-surface, #0f172a);
15
+
16
+ display: inline-block;
17
+ background-size: 200% auto;
18
+ background-position: 150% center;
19
+ -webkit-background-clip: text;
20
+ background-clip: text;
21
+ -webkit-text-fill-color: transparent;
22
+ animation-name: wr-shiny-text-sweep;
23
+ animation-timing-function: linear;
24
+ animation-iteration-count: infinite;
25
+ animation-direction: normal;
26
+ animation-fill-mode: both;
27
+ animation-play-state: running;
28
+
29
+ &--reverse {
30
+ animation-direction: reverse;
31
+ }
32
+
33
+ &--yoyo {
34
+ animation-direction: alternate;
35
+
36
+ &.wr-shiny-text--reverse {
37
+ animation-direction: alternate-reverse;
38
+ }
39
+ }
40
+
41
+ &--paused {
42
+ animation-play-state: paused;
43
+ }
44
+
45
+ &--pause-on-hover:hover {
46
+ animation-play-state: paused;
47
+ }
48
+ }
49
+
50
+ @keyframes wr-shiny-text-sweep {
51
+ 0% {
52
+ background-position: 150% center;
53
+ }
54
+ 50% {
55
+ background-position: -50% center;
56
+ }
57
+ 100% {
58
+ background-position: -50% center;
59
+ }
60
+ }
61
+
62
+ // Reduced motion: freeze the sweep at its rest position — the gradient's
63
+ // base color fills the text, so it stays readable with zero movement.
64
+ @media (prefers-reduced-motion: reduce) {
65
+ .wr-shiny-text {
66
+ animation: none !important;
67
+ }
68
+ }
69
+
70
+ // [wrShimmer] directive
71
+ // Same package as <wr-shiny-text>. Lightweight host-class directive —
72
+ // gradient sweep across text via `background-clip: text`.
73
+ @keyframes wr-shimmer {
74
+ 100% {
75
+ background-position-x: -200%;
76
+ }
77
+ }
78
+
79
+ .wr-shimmer {
80
+ background: linear-gradient(
81
+ 110deg,
82
+ var(--wr-color-on-surface) 30%,
83
+ rgba(var(--wr-color-primary-rgb), 0.9) 50%,
84
+ var(--wr-color-on-surface) 70%
85
+ );
86
+ background-size: 200% 100%;
87
+ background-clip: text;
88
+ -webkit-background-clip: text;
89
+ -webkit-text-fill-color: transparent;
90
+ color: transparent;
91
+ animation: wr-shimmer 2.5s linear infinite;
92
+
93
+ @media (prefers-reduced-motion: reduce) {
94
+ animation: none;
95
+ }
96
+ }
97
+
98
+ [data-theme='dark'] .wr-shiny-text {
99
+ --wr-shiny-text-base: #b5b5b5;
100
+ --wr-shiny-text-shine: #ffffff;
101
+ }
@@ -224,7 +224,10 @@
224
224
  &__badge {
225
225
  flex: 0 0 auto;
226
226
  padding: 0.0625rem 0.375rem;
227
- border-radius: var(--wr-border-radius-pill);
227
+ // The row's corner, not a pill: the badge sits inside `__entry` / `__item`,
228
+ // which both read `--wr-border-radius-sm`, and a stadium nested in a 6px row
229
+ // reads as a foreign shape rather than a part of it.
230
+ border-radius: var(--wr-border-radius-sm);
228
231
  background: var(--wr-color-fill-strong);
229
232
  color: var(--wr-color-on-surface-muted);
230
233
  font-size: var(--wr-text-xs);
@@ -85,6 +85,14 @@
85
85
  font-variant-numeric: tabular-nums;
86
86
  }
87
87
 
88
+ // A read-only slider still takes focus and still announces its value, so it
89
+ // keeps the visual and only stops inviting the drag — `grab` on something that
90
+ // cannot move is the part that looks broken. Matches `wr-knob--readonly`.
91
+ &--readonly &__track,
92
+ &--readonly &__thumb {
93
+ cursor: default;
94
+ }
95
+
88
96
  &--disabled {
89
97
  --wr-slider-thumb-border: var(--wr-color-on-surface-muted);
90
98
  --wr-slider-fill: var(--wr-color-on-surface-muted);
@@ -1 +1 @@
1
- @forward './styles';
1
+ @forward './styles/rules';