ngwr 16.3.0 → 16.4.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 (142) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  3. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  4. package/fesm2022/ngwr-carousel-testing.mjs +24 -1
  5. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  6. package/fesm2022/ngwr-carousel.mjs +67 -4
  7. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  8. package/fesm2022/ngwr-cascader.mjs +10 -23
  9. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  10. package/fesm2022/ngwr-context-menu.mjs +16 -1
  11. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  12. package/fesm2022/ngwr-dropdown.mjs +18 -4
  13. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  14. package/fesm2022/ngwr-file-upload.mjs +7 -3
  15. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  16. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  17. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  18. package/fesm2022/ngwr-graph.mjs +568 -7
  19. package/fesm2022/ngwr-graph.mjs.map +1 -1
  20. package/fesm2022/ngwr-i18n-ar.mjs +8 -4
  21. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  22. package/fesm2022/ngwr-i18n-cs.mjs +8 -4
  23. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  24. package/fesm2022/ngwr-i18n-de.mjs +8 -4
  25. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  26. package/fesm2022/ngwr-i18n-en.mjs +8 -4
  27. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-es.mjs +8 -4
  29. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-fr.mjs +8 -4
  31. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-he.mjs +8 -4
  33. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-hi.mjs +8 -4
  35. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-id.mjs +8 -4
  37. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-it.mjs +8 -4
  39. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-ja.mjs +8 -4
  41. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-ko.mjs +8 -4
  43. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-nl.mjs +8 -4
  45. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-pl.mjs +8 -4
  47. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-pt.mjs +8 -4
  49. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-ru.mjs +8 -4
  51. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-sv.mjs +8 -4
  53. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-tr.mjs +8 -4
  55. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-uk.mjs +8 -4
  57. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-vi.mjs +8 -4
  59. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  60. package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
  61. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  62. package/fesm2022/ngwr-i18n-zh.mjs +8 -4
  63. package/fesm2022/ngwr-i18n-zh.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-pagination.mjs +1 -0
  69. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  70. package/fesm2022/ngwr-schema-form.mjs +1 -0
  71. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  72. package/fesm2022/ngwr-select.mjs +100 -3
  73. package/fesm2022/ngwr-select.mjs.map +1 -1
  74. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  75. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  76. package/fesm2022/ngwr-table-testing.mjs +71 -3
  77. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  78. package/fesm2022/ngwr-table.mjs +171 -11
  79. package/fesm2022/ngwr-table.mjs.map +1 -1
  80. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  81. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  82. package/fesm2022/ngwr-tour.mjs +13 -9
  83. package/fesm2022/ngwr-tour.mjs.map +1 -1
  84. package/fesm2022/ngwr-tree.mjs +12 -1
  85. package/fesm2022/ngwr-tree.mjs.map +1 -1
  86. package/fesm2022/ngwr-utils.mjs +64 -1
  87. package/fesm2022/ngwr-utils.mjs.map +1 -1
  88. package/fesm2022/ngwr-version.mjs +1 -1
  89. package/fesm2022/ngwr-version.mjs.map +1 -1
  90. package/graph/styles/_index.scss +87 -0
  91. package/i18n/ar.json +8 -4
  92. package/i18n/cs.json +8 -4
  93. package/i18n/de.json +8 -4
  94. package/i18n/en.json +8 -4
  95. package/i18n/es.json +8 -4
  96. package/i18n/fr.json +8 -4
  97. package/i18n/he.json +8 -4
  98. package/i18n/hi.json +8 -4
  99. package/i18n/id.json +8 -4
  100. package/i18n/it.json +8 -4
  101. package/i18n/ja.json +8 -4
  102. package/i18n/ko.json +8 -4
  103. package/i18n/nl.json +8 -4
  104. package/i18n/pl.json +8 -4
  105. package/i18n/pt.json +8 -4
  106. package/i18n/ru.json +8 -4
  107. package/i18n/sv.json +8 -4
  108. package/i18n/tr.json +8 -4
  109. package/i18n/uk.json +8 -4
  110. package/i18n/vi.json +8 -4
  111. package/i18n/zh-TW.json +8 -4
  112. package/i18n/zh.json +8 -4
  113. package/llms-full.txt +4 -4
  114. package/llms.txt +57 -24
  115. package/package.json +1 -1
  116. package/schematics/collection.json +5 -0
  117. package/schematics/eject/index.js +158 -0
  118. package/schematics/eject/schema.js +8 -0
  119. package/schematics/eject/schema.json +24 -0
  120. package/schematics/eject/source.js +295 -0
  121. package/schematics/use/symbol-map.json +1 -0
  122. package/select/styles/_index.scss +13 -0
  123. package/skills/ngwr/SKILL.md +30 -3
  124. package/skills/ngwr/references/catalog.md +1 -1
  125. package/table/styles/_index.scss +24 -0
  126. package/theme/styles/_focus.scss +11 -1
  127. package/types/ngwr-carousel-testing.d.ts +27 -6
  128. package/types/ngwr-carousel.d.ts +42 -6
  129. package/types/ngwr-cascader.d.ts +3 -5
  130. package/types/ngwr-context-menu.d.ts +2 -0
  131. package/types/ngwr-dropdown.d.ts +2 -0
  132. package/types/ngwr-file-upload.d.ts +8 -2
  133. package/types/ngwr-graph-testing.d.ts +28 -0
  134. package/types/ngwr-graph.d.ts +247 -91
  135. package/types/ngwr-select.d.ts +37 -0
  136. package/types/ngwr-table-testing.d.ts +52 -1
  137. package/types/ngwr-table.d.ts +101 -9
  138. package/types/ngwr-tour-testing.d.ts +10 -0
  139. package/types/ngwr-tour.d.ts +11 -2
  140. package/types/ngwr-tree.d.ts +2 -0
  141. package/types/ngwr-utils.d.ts +79 -1
  142. package/types/ngwr-version.d.ts +1 -1
@@ -3,7 +3,10 @@
3
3
 
4
4
  .wr-carousel {
5
5
  --wr-carousel-font-family: var(--wr-font-family-base);
6
- --wr-carousel-dots-gap: var(--wr-space-sm);
6
+ // Between two dots. With the 0.5rem dot it puts neighbouring centres 24px
7
+ // apart, which is what WCAG 2.5.8 asks of a target under 24px: a smaller gap
8
+ // fails it.
9
+ --wr-carousel-dots-gap: var(--wr-space-lg);
7
10
  // The pill the active dot stretches into. The resting dot is a circle, which
8
11
  // is a percentage and off the radius scale.
9
12
  --wr-carousel-dot-active-radius: var(--wr-border-radius-pill);
@@ -118,6 +121,46 @@
118
121
  }
119
122
  }
120
123
 
124
+ // The pause button: the arrows' chrome, smaller, in the corner the dots and
125
+ // the arrows leave free.
126
+ &__toggle {
127
+ position: absolute;
128
+ z-index: 1;
129
+ inset-block-end: 0.5rem;
130
+ inset-inline-end: 0.75rem;
131
+ width: 1.75rem;
132
+ height: 1.75rem;
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ padding: 0;
137
+ border: 0;
138
+ border-radius: 50%;
139
+ background: color-mix(in srgb, var(--wr-color-surface) 85%, transparent);
140
+ color: var(--wr-color-on-surface);
141
+ cursor: pointer;
142
+ box-shadow: var(--wr-shadow-sm);
143
+ backdrop-filter: blur(4px);
144
+ transition: background var(--wr-transition-base);
145
+
146
+ &:hover {
147
+ background: var(--wr-color-surface);
148
+ }
149
+ }
150
+
151
+ // The live region: read out, never drawn.
152
+ &__live {
153
+ position: absolute;
154
+ width: 1px;
155
+ height: 1px;
156
+ padding: 0;
157
+ margin: -1px;
158
+ overflow: hidden;
159
+ clip: rect(0, 0, 0, 0);
160
+ white-space: nowrap;
161
+ border: 0;
162
+ }
163
+
121
164
  &__dots {
122
165
  position: absolute;
123
166
  bottom: 0.75rem;
@@ -129,6 +172,7 @@
129
172
  }
130
173
 
131
174
  &__dot {
175
+ position: relative;
132
176
  width: 0.5rem;
133
177
  height: 0.5rem;
134
178
  border: 0;
@@ -149,6 +193,14 @@
149
193
  background var(--wr-transition-base);
150
194
  padding: 0;
151
195
 
196
+ // The hit area: half the gap to each side and 24px tall, so a press beside
197
+ // the 8px dot still lands, and two neighbours' areas meet without overlapping.
198
+ &::after {
199
+ content: '';
200
+ position: absolute;
201
+ inset: -0.5rem calc(var(--wr-carousel-dots-gap) / -2);
202
+ }
203
+
152
204
  &--active {
153
205
  width: 1.25rem;
154
206
  border-radius: var(--wr-carousel-dot-active-radius);
@@ -55,7 +55,7 @@ var WrBreadcrumbs = class WrBreadcrumbs {
55
55
  },
56
56
  ngImport: i0,
57
57
  template: "<nav class=\"wr-breadcrumbs__nav\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <ol class=\"wr-breadcrumbs__list\">\n <ng-content />\n </ol>\n</nav>\n",
58
- styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tag__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-breadcrumbs{--wr-breadcrumbs-separator: \"/\";--wr-breadcrumbs-gap: var(--wr-space-sm);--wr-breadcrumbs-color: color-mix(in srgb, var(--wr-color-on-surface) 60%, transparent);--wr-breadcrumbs-current-color: var(--wr-color-on-surface);--wr-breadcrumbs-link-color: var(--wr-color-primary-ink);--wr-breadcrumbs-separator-color: color-mix(in srgb, var(--wr-color-on-surface) 30%, transparent);--wr-breadcrumbs-font-family: var(--wr-font-family-base);--wr-breadcrumbs-font-size: var(--wr-text-sm);--wr-breadcrumbs-link-gap: var(--wr-space-sm);--wr-breadcrumbs-link-radius: var(--wr-border-radius-sm);--wr-breadcrumbs-current-gap: var(--wr-space-sm);--wr-breadcrumbs-current-font-weight: var(--wr-font-weight-semibold);display:block;font-family:var(--wr-breadcrumbs-font-family);font-size:var(--wr-breadcrumbs-font-size);color:var(--wr-breadcrumbs-color)}.wr-breadcrumbs__nav{display:block}.wr-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wr-breadcrumbs-gap);margin:0;padding:0;list-style:none}.wr-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-gap)}.wr-breadcrumbs__item:not(:first-child):before{content:var(--wr-breadcrumbs-separator)/\"\";color:var(--wr-breadcrumbs-separator-color);-webkit-user-select:none;user-select:none}.wr-breadcrumbs__link{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-link-gap);color:var(--wr-breadcrumbs-link-color);text-decoration:none;border-radius:var(--wr-breadcrumbs-link-radius);transition:color .15s ease}.wr-breadcrumbs__link:hover{text-decoration:underline}.wr-breadcrumbs__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:2px}.wr-breadcrumbs__current{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-current-gap);color:var(--wr-breadcrumbs-current-color);font-weight:var(--wr-breadcrumbs-current-font-weight)}.wr-breadcrumbs__icon{--wr-icon-size: 1rem;flex:0 0 auto}\n"],
58
+ styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__toggle:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tag__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-graph__viewport:focus-visible,.wr-graph__control:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-breadcrumbs{--wr-breadcrumbs-separator: \"/\";--wr-breadcrumbs-gap: var(--wr-space-sm);--wr-breadcrumbs-color: color-mix(in srgb, var(--wr-color-on-surface) 60%, transparent);--wr-breadcrumbs-current-color: var(--wr-color-on-surface);--wr-breadcrumbs-link-color: var(--wr-color-primary-ink);--wr-breadcrumbs-separator-color: color-mix(in srgb, var(--wr-color-on-surface) 30%, transparent);--wr-breadcrumbs-font-family: var(--wr-font-family-base);--wr-breadcrumbs-font-size: var(--wr-text-sm);--wr-breadcrumbs-link-gap: var(--wr-space-sm);--wr-breadcrumbs-link-radius: var(--wr-border-radius-sm);--wr-breadcrumbs-current-gap: var(--wr-space-sm);--wr-breadcrumbs-current-font-weight: var(--wr-font-weight-semibold);display:block;font-family:var(--wr-breadcrumbs-font-family);font-size:var(--wr-breadcrumbs-font-size);color:var(--wr-breadcrumbs-color)}.wr-breadcrumbs__nav{display:block}.wr-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wr-breadcrumbs-gap);margin:0;padding:0;list-style:none}.wr-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-gap)}.wr-breadcrumbs__item:not(:first-child):before{content:var(--wr-breadcrumbs-separator)/\"\";color:var(--wr-breadcrumbs-separator-color);-webkit-user-select:none;user-select:none}.wr-breadcrumbs__link{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-link-gap);color:var(--wr-breadcrumbs-link-color);text-decoration:none;border-radius:var(--wr-breadcrumbs-link-radius);transition:color .15s ease}.wr-breadcrumbs__link:hover{text-decoration:underline}.wr-breadcrumbs__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:2px}.wr-breadcrumbs__current{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-current-gap);color:var(--wr-breadcrumbs-current-color);font-weight:var(--wr-breadcrumbs-current-font-weight)}.wr-breadcrumbs__icon{--wr-icon-size: 1rem;flex:0 0 auto}\n"],
59
59
  encapsulation: i0.ViewEncapsulation.None
60
60
  });
61
61
  };
@@ -74,7 +74,7 @@ i0.ɵɵngDeclareClassMetadata({
74
74
  "[style.--wr-breadcrumbs-separator]": "separatorValue()"
75
75
  },
76
76
  template: "<nav class=\"wr-breadcrumbs__nav\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <ol class=\"wr-breadcrumbs__list\">\n <ng-content />\n </ol>\n</nav>\n",
77
- styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tag__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-breadcrumbs{--wr-breadcrumbs-separator: \"/\";--wr-breadcrumbs-gap: var(--wr-space-sm);--wr-breadcrumbs-color: color-mix(in srgb, var(--wr-color-on-surface) 60%, transparent);--wr-breadcrumbs-current-color: var(--wr-color-on-surface);--wr-breadcrumbs-link-color: var(--wr-color-primary-ink);--wr-breadcrumbs-separator-color: color-mix(in srgb, var(--wr-color-on-surface) 30%, transparent);--wr-breadcrumbs-font-family: var(--wr-font-family-base);--wr-breadcrumbs-font-size: var(--wr-text-sm);--wr-breadcrumbs-link-gap: var(--wr-space-sm);--wr-breadcrumbs-link-radius: var(--wr-border-radius-sm);--wr-breadcrumbs-current-gap: var(--wr-space-sm);--wr-breadcrumbs-current-font-weight: var(--wr-font-weight-semibold);display:block;font-family:var(--wr-breadcrumbs-font-family);font-size:var(--wr-breadcrumbs-font-size);color:var(--wr-breadcrumbs-color)}.wr-breadcrumbs__nav{display:block}.wr-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wr-breadcrumbs-gap);margin:0;padding:0;list-style:none}.wr-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-gap)}.wr-breadcrumbs__item:not(:first-child):before{content:var(--wr-breadcrumbs-separator)/\"\";color:var(--wr-breadcrumbs-separator-color);-webkit-user-select:none;user-select:none}.wr-breadcrumbs__link{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-link-gap);color:var(--wr-breadcrumbs-link-color);text-decoration:none;border-radius:var(--wr-breadcrumbs-link-radius);transition:color .15s ease}.wr-breadcrumbs__link:hover{text-decoration:underline}.wr-breadcrumbs__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:2px}.wr-breadcrumbs__current{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-current-gap);color:var(--wr-breadcrumbs-current-color);font-weight:var(--wr-breadcrumbs-current-font-weight)}.wr-breadcrumbs__icon{--wr-icon-size: 1rem;flex:0 0 auto}\n"]
77
+ styles: [".wr-btn:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__sort-btn:focus-visible,.wr-table-filter__trigger:focus-visible,.wr-table__expand-btn:focus-visible,.wr-table__group-toggle:focus-visible,.wr-table__tree-toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table:has(>.wr-table__scroll:focus-visible){outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-table__scroll:focus-visible{outline:none}.wr-tabs__tab:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-tabs__panel:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-sidebar__row:focus-visible,.wr-sidebar__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-anchor__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-collapse__header:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-collapse--flat .wr-collapse__header:focus-visible{outline-offset:var(--wr-focus-ring-offset)}.wr-command-palette__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-mention-panel__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-segmented__option:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-back-top:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-carousel__nav:focus-visible,.wr-carousel__toggle:focus-visible,.wr-carousel__dot:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-speed-dial__trigger:focus-visible,.wr-speed-dial__action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-stepper__header-button:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-window__chrome-action:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-date-picker__trigger:focus-visible,.wr-time-picker__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-dropdown-item:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-alert__close:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tag__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-graph__viewport:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-chart-legend__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-pull-to-refresh:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-tree__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-color-picker__sv:focus-visible,.wr-color-picker__slider:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-input-group__toggle:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-input-number__step:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:-2px}.wr-file-upload__zone:focus-visible,.wr-file-upload__remove:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-event-calendar__more:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);position:relative;z-index:1}.wr-graph__viewport:focus-visible,.wr-graph__control:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo)}.wr-breadcrumbs{--wr-breadcrumbs-separator: \"/\";--wr-breadcrumbs-gap: var(--wr-space-sm);--wr-breadcrumbs-color: color-mix(in srgb, var(--wr-color-on-surface) 60%, transparent);--wr-breadcrumbs-current-color: var(--wr-color-on-surface);--wr-breadcrumbs-link-color: var(--wr-color-primary-ink);--wr-breadcrumbs-separator-color: color-mix(in srgb, var(--wr-color-on-surface) 30%, transparent);--wr-breadcrumbs-font-family: var(--wr-font-family-base);--wr-breadcrumbs-font-size: var(--wr-text-sm);--wr-breadcrumbs-link-gap: var(--wr-space-sm);--wr-breadcrumbs-link-radius: var(--wr-border-radius-sm);--wr-breadcrumbs-current-gap: var(--wr-space-sm);--wr-breadcrumbs-current-font-weight: var(--wr-font-weight-semibold);display:block;font-family:var(--wr-breadcrumbs-font-family);font-size:var(--wr-breadcrumbs-font-size);color:var(--wr-breadcrumbs-color)}.wr-breadcrumbs__nav{display:block}.wr-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;gap:var(--wr-breadcrumbs-gap);margin:0;padding:0;list-style:none}.wr-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-gap)}.wr-breadcrumbs__item:not(:first-child):before{content:var(--wr-breadcrumbs-separator)/\"\";color:var(--wr-breadcrumbs-separator-color);-webkit-user-select:none;user-select:none}.wr-breadcrumbs__link{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-link-gap);color:var(--wr-breadcrumbs-link-color);text-decoration:none;border-radius:var(--wr-breadcrumbs-link-radius);transition:color .15s ease}.wr-breadcrumbs__link:hover{text-decoration:underline}.wr-breadcrumbs__link:focus-visible{outline:var(--wr-focus-ring-width) solid var(--wr-focus-ring-color);outline-offset:var(--wr-focus-ring-offset);box-shadow:0 0 0 var(--wr-focus-ring-offset) var(--wr-focus-ring-halo);outline-offset:2px}.wr-breadcrumbs__current{display:inline-flex;align-items:center;gap:var(--wr-breadcrumbs-current-gap);color:var(--wr-breadcrumbs-current-color);font-weight:var(--wr-breadcrumbs-current-font-weight)}.wr-breadcrumbs__icon{--wr-icon-size: 1rem;flex:0 0 auto}\n"]
78
78
  }]
79
79
  }],
80
80
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-breadcrumbs.mjs","names":[],"sources":["../../../projects/lib/breadcrumbs/breadcrumbs.ts","../../../projects/lib/breadcrumbs/breadcrumbs.html","../../../projects/lib/breadcrumbs/breadcrumbs-item.ts","../../../projects/lib/breadcrumbs/breadcrumbs-item.html"],"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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\n\n/** Escape a string for use inside a double-quoted CSS `<string>`. */\nfunction cssString(value: string): string {\n return value.replace(/[\\\\\"]/g, '\\\\$&').replace(/[\\n\\r\\f]/g, char => `\\\\${char.codePointAt(0)!.toString(16)} `);\n}\n\n/**\n * Breadcrumb navigation. Project `<wr-breadcrumbs-item>` children — each keeps\n * its own element and takes `role=\"listitem\"` inside the `<ol>` rather than\n * rendering an `<li>`, separated by the configured glyph (default `/`). The\n * container exposes the `nav[aria-label]` landmark required by WCAG.\n *\n * @example\n * ```html\n * <wr-breadcrumbs>\n * <wr-breadcrumbs-item routerLink=\"/\">Home</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item routerLink=\"/docs\">Docs</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item>Current</wr-breadcrumbs-item>\n * </wr-breadcrumbs>\n *\n * <!-- Custom separator -->\n * <wr-breadcrumbs separator=\"›\">…</wr-breadcrumbs>\n * ```\n *\n * @see https://ngwr.dev/reference/components/breadcrumbs\n */\n@Component({\n selector: 'wr-breadcrumbs',\n templateUrl: './breadcrumbs.html',\n styleUrl: './breadcrumbs.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-breadcrumbs',\n '[style.--wr-breadcrumbs-separator]': 'separatorValue()',\n },\n})\nexport class WrBreadcrumbs {\n /** Separator glyph between items. Any short string. @default '/' */\n readonly separator = input('/');\n\n /**\n * Accessible label for the `nav` landmark. Falls back to `breadcrumbs.label`,\n * then `'Breadcrumbs'`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The English default used to live on the input itself, which made this the one\n // landmark in the library a catalog could not reach: `wr-anchor` and `wr-sidebar`\n // announced in Russian on the same page while this one stayed \"Breadcrumbs\", and\n // the only escape was restating `[ariaLabel]` on every trail.\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'breadcrumbs.label', 'Breadcrumbs');\n\n // The glyph is WRAPPED in quotes here and unwrapped by `content:` in the\n // stylesheet, so an unescaped `\"` inside it closes the library's own string\n // and the rest of the value is parsed as CSS — `/\" url(\"…\") \"` computes to\n // `content: \"/\" url(\"…\") \"\"`, an image the browser fetches. Escaping is the\n // whole fix, and it is lossless: a separator that IS a quote still renders.\n protected readonly separatorValue = computed(() => `\"${cssString(this.separator())}\"`);\n}\n","<nav class=\"wr-breadcrumbs__nav\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <ol class=\"wr-breadcrumbs__list\">\n <ng-content />\n </ol>\n</nav>\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 { NgTemplateOutlet } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { type Params, RouterLink } from '@angular/router';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * One row inside `<wr-breadcrumbs>`. The host itself is the row — a\n * `<wr-breadcrumbs-item role=\"listitem\" class=\"wr-breadcrumbs__item\">`\n * inside the parent's `<ol>` — and it contains either a real\n * `<a class=\"wr-breadcrumbs__link\">` (when `[href]` or `[routerLink]` is\n * set) or, for the current crumb, a non-interactive\n * `<a class=\"wr-breadcrumbs__current\" role=\"text\" tabindex=\"-1\"\n * aria-current=\"page\">` (when neither is set — typically the last crumb).\n *\n * @example\n * ```html\n * <wr-breadcrumbs-item icon=\"home\" routerLink=\"/\">Home</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item routerLink=\"/debts\" [queryParams]=\"{ date: day }\">Debts</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item href=\"https://ngwr.dev\">External</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item>Current page</wr-breadcrumbs-item>\n * ```\n */\n@Component({\n selector: 'wr-breadcrumbs-item',\n templateUrl: './breadcrumbs-item.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, RouterLink, WrIcon],\n host: { class: 'wr-breadcrumbs__item', role: 'listitem' },\n})\nexport class WrBreadcrumbsItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('breadcrumbs');\n }\n\n /** Plain anchor href. Overridden by `routerLink` when both are set. */\n readonly href = input<string | null>(null);\n\n /** Angular router target. Anything `RouterLink` accepts (string or `any[]`). */\n readonly routerLink = input<string | readonly unknown[] | null>(null);\n\n /**\n * Query parameters for a `routerLink` crumb, the way `RouterLink` takes them.\n * A `?` written into `routerLink` is part of the path, and the router escapes\n * it: `/debts?date=1` became `/debts%3Fdate%3D1`. Ignored without `routerLink`.\n *\n * @default null\n */\n readonly queryParams = input<Params | null>(null);\n\n /** Open external `href` in a new tab. Ignored when `routerLink` is set. @default false */\n readonly external = input(false);\n\n /** Optional leading icon rendered inline before the label. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n protected readonly isLink = computed(() => this.href() != null || this.routerLink() != null);\n protected readonly isRouter = computed(() => this.routerLink() != null);\n\n protected readonly rootClass = computed(() => (this.isLink() ? 'wr-breadcrumbs__link' : 'wr-breadcrumbs__current'));\n}\n","<!--\n The label lives in a template rather than inside each branch below. A default\n `<ng-content />` written into two `@if` branches fills only ONE of them — the\n last in static order — and the other renders empty, with no template error and\n nothing in the console. This component has been broken exactly that way\n before; stamping one template from either branch keeps two anchors and one\n projection.\n-->\n<ng-template #label>\n @if (icon(); as i) {\n <wr-icon class=\"wr-breadcrumbs__icon\" [name]=\"i\" />\n }\n <ng-content />\n</ng-template>\n\n@if (isRouter()) {\n <!--\n Only ROUTER crumbs get `RouterLink`. Applied unconditionally it owns the\n anchor's `href` and writes null into it whenever `routerLink` is null —\n which silently turned every `href`-based crumb, a documented input, into\n text that navigates nowhere.\n -->\n <a [class]=\"rootClass()\" [routerLink]=\"routerLink()\" [queryParams]=\"queryParams()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n </a>\n} @else {\n <a\n [class]=\"rootClass()\"\n [attr.href]=\"href()\"\n [attr.aria-current]=\"isLink() ? null : 'page'\"\n [attr.role]=\"isLink() ? null : 'text'\"\n [attr.tabindex]=\"isLink() ? null : -1\"\n [attr.target]=\"external() ? '_blank' : null\"\n [attr.rel]=\"external() ? 'noreferrer noopener' : null\"\n >\n <ng-container [ngTemplateOutlet]=\"label\" />\n </a>\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAS,UAAU,OAAa;CAC9B,OAAO,MAAM,QAAQ,UAAU,MAAM,CAAC,CAAC,QAAQ,cAAa,SAAQ,KAAK,KAAK,YAAY,CAAC,CAAE,CAAC,SAAS,EAAE,EAAC,EAAG;AAC/G;AAgCA,IAAa,gBAAb,MAAa,cAAa;CAEf,YAAY,MAAM,KAAI,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAMtB,YAAY,MAAqB,MAAK,GAAA,YAAA,CA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AAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,WAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UCtC9B;EAsCA,cAAA;GAAA;IAAA,MAAA;IAAA,MDHY;IAAgB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAM,UAAA;IAAA,QAAA,CAAA,MAAA;GAAA;EAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAGnC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA;EAP7B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAqB,eAEhB,kBAAkB;GAAI,SAC5B;IAAC;IAAkB;IAAY;GAAM;GAAC,MACzC;IAAE,OAAO;IAAwB,MAAM;GAAU;GAAE,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-breadcrumbs.mjs","names":[],"sources":["../../../projects/lib/breadcrumbs/breadcrumbs.ts","../../../projects/lib/breadcrumbs/breadcrumbs.html","../../../projects/lib/breadcrumbs/breadcrumbs-item.ts","../../../projects/lib/breadcrumbs/breadcrumbs-item.html"],"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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\n\n/** Escape a string for use inside a double-quoted CSS `<string>`. */\nfunction cssString(value: string): string {\n return value.replace(/[\\\\\"]/g, '\\\\$&').replace(/[\\n\\r\\f]/g, char => `\\\\${char.codePointAt(0)!.toString(16)} `);\n}\n\n/**\n * Breadcrumb navigation. Project `<wr-breadcrumbs-item>` children — each keeps\n * its own element and takes `role=\"listitem\"` inside the `<ol>` rather than\n * rendering an `<li>`, separated by the configured glyph (default `/`). The\n * container exposes the `nav[aria-label]` landmark required by WCAG.\n *\n * @example\n * ```html\n * <wr-breadcrumbs>\n * <wr-breadcrumbs-item routerLink=\"/\">Home</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item routerLink=\"/docs\">Docs</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item>Current</wr-breadcrumbs-item>\n * </wr-breadcrumbs>\n *\n * <!-- Custom separator -->\n * <wr-breadcrumbs separator=\"›\">…</wr-breadcrumbs>\n * ```\n *\n * @see https://ngwr.dev/reference/components/breadcrumbs\n */\n@Component({\n selector: 'wr-breadcrumbs',\n templateUrl: './breadcrumbs.html',\n styleUrl: './breadcrumbs.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-breadcrumbs',\n '[style.--wr-breadcrumbs-separator]': 'separatorValue()',\n },\n})\nexport class WrBreadcrumbs {\n /** Separator glyph between items. Any short string. @default '/' */\n readonly separator = input('/');\n\n /**\n * Accessible label for the `nav` landmark. Falls back to `breadcrumbs.label`,\n * then `'Breadcrumbs'`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n // The English default used to live on the input itself, which made this the one\n // landmark in the library a catalog could not reach: `wr-anchor` and `wr-sidebar`\n // announced in Russian on the same page while this one stayed \"Breadcrumbs\", and\n // the only escape was restating `[ariaLabel]` on every trail.\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'breadcrumbs.label', 'Breadcrumbs');\n\n // The glyph is WRAPPED in quotes here and unwrapped by `content:` in the\n // stylesheet, so an unescaped `\"` inside it closes the library's own string\n // and the rest of the value is parsed as CSS — `/\" url(\"…\") \"` computes to\n // `content: \"/\" url(\"…\") \"\"`, an image the browser fetches. Escaping is the\n // whole fix, and it is lossless: a separator that IS a quote still renders.\n protected readonly separatorValue = computed(() => `\"${cssString(this.separator())}\"`);\n}\n","<nav class=\"wr-breadcrumbs__nav\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <ol class=\"wr-breadcrumbs__list\">\n <ng-content />\n </ol>\n</nav>\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 { NgTemplateOutlet } from '@angular/common';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { type Params, RouterLink } from '@angular/router';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * One row inside `<wr-breadcrumbs>`. The host itself is the row — a\n * `<wr-breadcrumbs-item role=\"listitem\" class=\"wr-breadcrumbs__item\">`\n * inside the parent's `<ol>` — and it contains either a real\n * `<a class=\"wr-breadcrumbs__link\">` (when `[href]` or `[routerLink]` is\n * set) or, for the current crumb, a non-interactive\n * `<a class=\"wr-breadcrumbs__current\" role=\"text\" tabindex=\"-1\"\n * aria-current=\"page\">` (when neither is set — typically the last crumb).\n *\n * @example\n * ```html\n * <wr-breadcrumbs-item icon=\"home\" routerLink=\"/\">Home</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item routerLink=\"/debts\" [queryParams]=\"{ date: day }\">Debts</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item href=\"https://ngwr.dev\">External</wr-breadcrumbs-item>\n * <wr-breadcrumbs-item>Current page</wr-breadcrumbs-item>\n * ```\n */\n@Component({\n selector: 'wr-breadcrumbs-item',\n templateUrl: './breadcrumbs-item.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, RouterLink, WrIcon],\n host: { class: 'wr-breadcrumbs__item', role: 'listitem' },\n})\nexport class WrBreadcrumbsItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('breadcrumbs');\n }\n\n /** Plain anchor href. Overridden by `routerLink` when both are set. */\n readonly href = input<string | null>(null);\n\n /** Angular router target. Anything `RouterLink` accepts (string or `any[]`). */\n readonly routerLink = input<string | readonly unknown[] | null>(null);\n\n /**\n * Query parameters for a `routerLink` crumb, the way `RouterLink` takes them.\n * A `?` written into `routerLink` is part of the path, and the router escapes\n * it: `/debts?date=1` became `/debts%3Fdate%3D1`. Ignored without `routerLink`.\n *\n * @default null\n */\n readonly queryParams = input<Params | null>(null);\n\n /** Open external `href` in a new tab. Ignored when `routerLink` is set. @default false */\n readonly external = input(false);\n\n /** Optional leading icon rendered inline before the label. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n protected readonly isLink = computed(() => this.href() != null || this.routerLink() != null);\n protected readonly isRouter = computed(() => this.routerLink() != null);\n\n protected readonly rootClass = computed(() => (this.isLink() ? 'wr-breadcrumbs__link' : 'wr-breadcrumbs__current'));\n}\n","<!--\n The label lives in a template rather than inside each branch below. A default\n `<ng-content />` written into two `@if` branches fills only ONE of them — the\n last in static order — and the other renders empty, with no template error and\n nothing in the console. This component has been broken exactly that way\n before; stamping one template from either branch keeps two anchors and one\n projection.\n-->\n<ng-template #label>\n @if (icon(); as i) {\n <wr-icon class=\"wr-breadcrumbs__icon\" [name]=\"i\" />\n }\n <ng-content />\n</ng-template>\n\n@if (isRouter()) {\n <!--\n Only ROUTER crumbs get `RouterLink`. Applied unconditionally it owns the\n anchor's `href` and writes null into it whenever `routerLink` is null —\n which silently turned every `href`-based crumb, a documented input, into\n text that navigates nowhere.\n -->\n <a [class]=\"rootClass()\" [routerLink]=\"routerLink()\" [queryParams]=\"queryParams()\">\n <ng-container [ngTemplateOutlet]=\"label\" />\n </a>\n} @else {\n <a\n [class]=\"rootClass()\"\n [attr.href]=\"href()\"\n [attr.aria-current]=\"isLink() ? null : 'page'\"\n [attr.role]=\"isLink() ? null : 'text'\"\n [attr.tabind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B;IAAY;GAAM;GAAC,MACzC;IAAE,OAAO;IAAwB,MAAM;GAAU;GAAE,UAAA;EAAA,CAAA"}
@@ -89,6 +89,18 @@ var WrCarouselHarness = class WrCarouselHarness extends ComponentHarness {
89
89
  if (!Number.isInteger(index) || index < 0 || index >= dots.length) throw new Error(`WrCarouselHarness.goTo(${index}): out of range — this carousel has ${dots.length} slides, so the index must be a whole number between 0 and ${dots.length - 1}.`);
90
90
  return dots[index].click();
91
91
  }
92
+ async getAnnouncement() {
93
+ return (await (await this.locatorFor(".wr-carousel__live")()).text()).trim();
94
+ }
95
+ async getLivePoliteness() {
96
+ return (await this.locatorFor(".wr-carousel__live")()).getAttribute("aria-live");
97
+ }
98
+ async getAutoplayLabel() {
99
+ return (await this.autoplayButton("getAutoplayLabel")).getAttribute("aria-label");
100
+ }
101
+ async toggleAutoplay() {
102
+ return (await this.autoplayButton("toggleAutoplay")).click();
103
+ }
92
104
  async hover() {
93
105
  return (await this.host()).hover();
94
106
  }
@@ -121,7 +133,18 @@ var WrCarouselHarness = class WrCarouselHarness extends ComponentHarness {
121
133
  return this.locatorForAll(".wr-carousel__dot")();
122
134
  }
123
135
  async controls() {
124
- return [...await this.locatorForAll(".wr-carousel__nav")(), ...await this.dots()];
136
+ const toggle = await this.locatorForAll(".wr-carousel__toggle")();
137
+ const navs = await this.locatorForAll(".wr-carousel__nav")();
138
+ return [
139
+ ...toggle,
140
+ ...navs,
141
+ ...await this.dots()
142
+ ];
143
+ }
144
+ async autoplayButton(method) {
145
+ const button = await this.locatorForOptional(".wr-carousel__toggle")();
146
+ if (!button) throw new Error(`WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with [autoplay] on and two slides or more.`);
147
+ return button;
125
148
  }
126
149
  async nav(side, caller) {
127
150
  const button = await this.locatorForOptional(`.wr-carousel__nav--${side}`)();
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-carousel-testing.mjs","names":[],"sources":["../../../projects/lib/carousel/testing/wr-carousel-harness.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, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrCarouselHarnessFilters } from './types';\n\n/**\n * The settled percentage out of `translateX(-100%)`, and out of the mid-drag\n * `translateX(calc(-100% + 12px))` — the pixel half is the finger, not the slide.\n */\nconst TRACK_OFFSET = /translateX\\(\\s*(?:calc\\(\\s*)?(-?[\\d.]+)%/;\n\n/**\n * Test harness for `<wr-carousel>` — drive the strip the way someone on the page\n * drives it.\n *\n * Everything it reads is public API: the `.wr-carousel__*` elements, the dots'\n * `aria-current`, and the `aria-roledescription` the viewport and each slide\n * publish. Two things are worth knowing before writing an assertion against it:\n *\n * - **The slides do not say which one is showing.** A `<wr-carousel-slide>` carries\n * `role=\"group\"` and `aria-roledescription=\"slide\"` and nothing else — no\n * `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is\n * published in exactly two places, the dot carrying `aria-current=\"true\"` and the\n * track's own offset, and {@link getActiveIndex} reads them in that order. There\n * is likewise no live region: the component announces a move to nobody, so a\n * harness cannot report one.\n * - **It never drags.** The swipe the component supports is a touch gesture\n * measured against the viewport's own width, and jsdom has no layout — that width\n * is 0, so the \"20% of the viewport\" threshold is 0 too and EVERY drag clears it,\n * a 1px twitch included. The result says nothing about a real finger, and the spec\n * pins that artifact rather than pretending otherwise. Every move here goes\n * through the arrow buttons and the dots instead, which is the accessible path\n * anyway. `carousel.spec.ts` is where the gesture itself is pinned, by staging the\n * touch events and declaring an `offsetWidth`.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const gallery = await loader.getHarness(WrCarouselHarness.with({ ariaLabel: 'Gallery' }));\n *\n * expect(await gallery.getSlideCount()).toBe(3);\n * await gallery.next();\n * expect(await gallery.getActiveIndex()).toBe(1);\n *\n * await gallery.goTo(2);\n * expect(await gallery.getActiveSlideText()).toBe('Dunes');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCarouselHarness extends ComponentHarness {\n static hostSelector = 'wr-carousel';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCarouselHarnessFilters = {}): HarnessPredicate<WrCarouselHarness> {\n return new HarnessPredicate(WrCarouselHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('slideCount', options.slideCount, async (harness, count) => (await harness.getSlideCount()) === count)\n .addOption('slideText', options.slideText, async (harness, text) => {\n for (const slide of await harness.getSlideTexts()) {\n if (await HarnessPredicate.stringMatches(slide, text)) return true;\n }\n return false;\n });\n }\n\n // What the carousel announces\n\n /**\n * The role the strip announces — `group`, which is what lets\n * `aria-roledescription` mean anything.\n *\n * Read off the VIEWPORT rather than the host, and that is the whole point of the\n * pairing: `aria-roledescription` is dropped on an element with no semantic role,\n * and the host element (`<wr-carousel>`) has none.\n */\n async getRole(): Promise<string | null> {\n return (await this.viewport()).getAttribute('role');\n }\n\n /** How the strip describes itself to a screen reader — `carousel`. */\n async getRoleDescription(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-roledescription');\n }\n\n /**\n * The carousel's accessible name.\n *\n * The RESOLVED one, which is the only one the page has: the `ariaLabel` input\n * defaults to `null` and the component runs it through the `ngwr/i18n` catalog\n * (`carousel.label`, falling back to `'Carousel'`), so a consumer who passed\n * nothing still gets a named group and this still answers. Reporting the raw\n * input would say `null` about a carousel that announces itself perfectly well.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-label');\n }\n\n /** The accessible name of the previous-slide button. Throws when the arrows are not rendered. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.nav('prev', 'getPreviousLabel')).getAttribute('aria-label');\n }\n\n /** The accessible name of the next-slide button. Throws when the arrows are not rendered. */\n async getNextLabel(): Promise<string | null> {\n return (await this.nav('next', 'getNextLabel')).getAttribute('aria-label');\n }\n\n /**\n * The accessible name of the dot group — what names the row of dots as a set\n * rather than leaving a screen reader with N unexplained buttons.\n *\n * Throws when the dots are not rendered: there is no group to name then, and a\n * `null` would read like a group that lost its label.\n */\n async getPaginationLabel(): Promise<string | null> {\n const dots = await this.locatorForOptional('.wr-carousel__dots')();\n if (!dots) {\n throw new Error(\n 'WrCarouselHarness.getPaginationLabel(): this carousel renders no dot group — the dots are dropped ' +\n 'when [showDots] is false or when there are fewer than two slides.'\n );\n }\n return dots.getAttribute('aria-label');\n }\n\n /**\n * What each slide announces itself as — `slide`, on every one of them, in DOM\n * order.\n *\n * The one piece of ARIA the slides carry, and the reason it is worth asking: it\n * is set on the slide component's own host, so a slide reaching the page through\n * some other element would come back `null` here while the carousel kept working.\n */\n async getSlideRoleDescriptions(): Promise<(string | null)[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.getAttribute('aria-roledescription')));\n }\n\n // What the carousel is showing\n\n /** How many slides the carousel holds. */\n async getSlideCount(): Promise<number> {\n return (await this.slides()).length;\n }\n\n /** The text of every slide, in DOM order. */\n async getSlideTexts(): Promise<string[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.text()));\n }\n\n /**\n * Which slide is showing, as a zero-based index.\n *\n * Taken from the dot carrying `aria-current=\"true\"` whenever the dots are\n * rendered — that attribute is the only thing on the page that tells a screen\n * reader where in the strip it has got to, so it is the answer that matters —\n * and derived from the track's rendered offset when they are not, `[showDots]`\n * being off and a single-slide carousel both dropping the strip entirely.\n *\n * That fallback takes the MAGNITUDE of the offset on purpose. The transform is\n * physical while the slides sit on the inline axis, so a mirrored carousel paints\n * `translateX(100%)` for the very slide an LTR one paints `translateX(-100%)`\n * for; signed, this reported slide -1 for a perfectly healthy RTL carousel.\n *\n * Throws on a carousel with no slides at all — nothing is showing there, and `0`\n * would read like the first slide.\n */\n async getActiveIndex(): Promise<number> {\n const count = await this.getSlideCount();\n if (count === 0) {\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): this carousel has no <wr-carousel-slide> children, so no slide is ' +\n 'current — 0 would read like the first one.'\n );\n }\n\n const dots = await this.dots();\n if (dots.length) {\n for (let index = 0; index < dots.length; index++) {\n if ((await dots[index].getAttribute('aria-current')) === 'true') return index;\n }\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): the dots are rendered but none of them carries aria-current, so the ' +\n 'page tells a screen reader that no slide is current. The component clamps `active` into range, so look ' +\n 'for a lost aria-current binding rather than an out-of-range index — the `--active` class alone is paint.'\n );\n }\n\n return Math.round(Math.abs(await this.getTrackOffsetPercent()) / 100);\n }\n\n /** The text of the slide that is showing. Throws on a carousel with no slides. */\n async getActiveSlideText(): Promise<string> {\n const index = await this.getActiveIndex();\n return (await this.slides())[index].text();\n }\n\n /**\n * The track's rendered offset, as a percentage of one viewport: `-100` for the\n * second slide of an LTR carousel, `+100` for the second slide of a mirrored one.\n *\n * Read off the inline `style` attribute rather than through `getCssValue()`,\n * because the percentage only survives where the component wrote it. jsdom hands\n * a declared `transform` straight back through `getComputedStyle`, so\n * `getCssValue()` answers correctly HERE and would stop the moment the same\n * harness ran against a real browser, which resolves the property to a pixel\n * matrix — a green unit test would be hiding it. Mid-drag the component writes\n * `translateX(calc(-100% + 12px))` and this reports the settled `-100`: the pixel\n * half is the finger's own displacement, which is physical in both directions and\n * belongs to no slide.\n *\n * Worth asserting next to {@link getActiveIndex}: it is the same fact painted\n * instead of announced, and a carousel that lights the right dot while parking\n * the track in blank space is exactly the failure nobody sees in a spec.\n */\n async getTrackOffsetPercent(): Promise<number> {\n const style = (await (await this.track()).getAttribute('style')) ?? '';\n const match = TRACK_OFFSET.exec(style);\n if (!match) {\n throw new Error(\n `WrCarouselHarness.getTrackOffsetPercent(): the track carries no translateX() offset (style: \"${style}\"). ` +\n 'That transform is how the carousel moves at all, so it should always be there.'\n );\n }\n return Number(match[1]);\n }\n\n // The controls the carousel renders\n\n /** Whether the prev / next arrows are on the page. Both are dropped together. */\n async hasArrows(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__nav--next')()) !== null;\n }\n\n /** Whether the dot strip is on the page. */\n async hasDots(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__dots')()) !== null;\n }\n\n /** How many dots are rendered — one per slide, or `0` while the strip is hidden. */\n async getDotCount(): Promise<number> {\n return (await this.dots()).length;\n }\n\n /**\n * The accessible name of every dot, in order — `'Go to slide 1'`, … resolved\n * through the `ngwr/i18n` catalog.\n *\n * A dot is a bare button with no text of its own, so this label is all a screen\n * reader has to tell one from another. `[]` when the strip is hidden, matching\n * {@link getDotCount}.\n */\n async getDotLabels(): Promise<(string | null)[]> {\n const dots = await this.dots();\n return Promise.all(dots.map(dot => dot.getAttribute('aria-label')));\n }\n\n // Moving the carousel\n\n /**\n * Click the next-slide arrow.\n *\n * \"Next\" is the next SLIDE, not the next thing on the right: the buttons keep\n * their semantics under `dir=\"rtl\"` and only the travel under them turns around.\n * At the last slide this wraps to the first one, unless `[loop]` is off — in\n * which case the arrow is `disabled` and nothing moves, so nothing is asserted\n * about the move.\n */\n async next(): Promise<void> {\n return (await this.nav('next', 'next')).click();\n }\n\n /** Click the previous-slide arrow. Wraps to the last slide unless `[loop]` is off. */\n async previous(): Promise<void> {\n return (await this.nav('prev', 'previous')).click();\n }\n\n /**\n * Jump to a slide by clicking its dot — the only way the page offers to reach a\n * slide directly.\n *\n * Throws when the dots are hidden (the component's own `goTo()` is still there\n * for a spec holding the instance, but nothing on the page can be clicked) and\n * throws on an index no slide has, rather than clicking nothing and leaving the\n * carousel where it was.\n */\n async goTo(index: number): Promise<void> {\n const dots = await this.dots();\n if (!dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): this carousel renders no dots, and they are the only way to reach a ` +\n 'slide directly from the page — they are dropped when [showDots] is false or when there are fewer than ' +\n 'two slides. Use next() / previous(), or write the active index from the host.'\n );\n }\n if (!Number.isInteger(index) || index < 0 || index >= dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): out of range — this carousel has ${dots.length} slides, so the index ` +\n `must be a whole number between 0 and ${dots.length - 1}.`\n );\n }\n return dots[index].click();\n }\n\n // Holding autoplay\n\n /**\n * Move the pointer onto the carousel, which is what HOLDS autoplay.\n *\n * Aimed at the host and not the viewport, deliberately: the arrows and the dots\n * are the viewport's SIBLINGS, so a viewport-scoped hover would let a slide\n * change under a cursor that is aiming at an arrow.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer away again, releasing the hold. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * Put keyboard focus on the first control the carousel renders — the previous\n * arrow, or the first dot when the arrows are hidden.\n *\n * This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop\n * moving content, and hovering is not one for someone who never touches a mouse,\n * so the component listens for `focusin` on its host as well. Focus lands on the\n * carousel's OWN controls; anything focusable a slide happens to project is not\n * this harness's business, though in a browser it would hold autoplay just the\n * same.\n *\n * Note what this is NOT: the dot of the slide showing. The dots are ordinary\n * buttons with no roving `tabindex`, so each of them is a tab stop of its own and\n * the first one a Tab press meets is the prev arrow whatever slide is current —\n * two different questions, answered here and by {@link getActiveIndex}.\n *\n * Throws when the carousel renders no controls at all, because then there is\n * nothing for a Tab press to land on and no keyboard mechanism to assert.\n */\n async focus(): Promise<void> {\n const [first] = await this.controls();\n if (!first) {\n throw new Error(\n 'WrCarouselHarness.focus(): this carousel renders no controls of its own — the arrows and the dots are ' +\n 'both gone (a single slide, or [showArrows] and [showDots] switched off), so a Tab press has nothing ' +\n 'inside it to land on.'\n );\n }\n return first.focus();\n }\n\n /**\n * Take focus off whichever of the carousel's controls holds it, releasing the\n * hold {@link focus} started.\n *\n * Throws when none of them is focused: `focusout` is what the component listens\n * for, and blurring an element that never had focus fires nothing — a quiet\n * no-op here surfaces as an autoplay assertion failing three lines later.\n */\n async blur(): Promise<void> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return control.blur();\n }\n throw new Error(\n 'WrCarouselHarness.blur(): none of the controls this carousel renders holds focus, so there is no focus to ' +\n 'release. Call focus() first — the hold is released by blurring the element that took it.'\n );\n }\n\n /** Whether one of the carousel's own controls holds focus — which is what holds autoplay. */\n async isFocused(): Promise<boolean> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return true;\n }\n return false;\n }\n\n // Internals\n\n /** The element that carries the carousel's role and name. */\n private async viewport(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__viewport')();\n }\n\n /** The moving strip, whose inline transform is where the carousel IS. */\n private async track(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__track')();\n }\n\n private async slides(): Promise<TestElement[]> {\n return this.locatorForAll('wr-carousel-slide')();\n }\n\n private async dots(): Promise<TestElement[]> {\n return this.locatorForAll('.wr-carousel__dot')();\n }\n\n /**\n * Every control the carousel renders itself, in the order a Tab press meets\n * them: the two arrows, then the dots.\n */\n private async controls(): Promise<TestElement[]> {\n const navs = await this.locatorForAll('.wr-carousel__nav')();\n return [...navs, ...(await this.dots())];\n }\n\n /** One arrow, or a failure naming both reasons it might not be there. */\n private async nav(side: 'prev' | 'next', caller: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`.wr-carousel__nav--${side}`)();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${caller}(): this carousel renders no ${side} arrow — the arrows are dropped when ` +\n '[showArrows] is false or when there are fewer than two slides to page through.'\n );\n }\n return button;\n }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe;AAyCrB,IAAa,oBAAb,MAAa,0BAA0B,iBAAgB;CACrD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAoC,CAAA,GAAE;EAChD,OAAO,IAAI,iBAAiB,mBAAmB,OAAO,CAAC,CACpD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,cAAc,QAAQ,YAA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ADQ,KAAK,cAAc,mBAAmB,CAAC,CAAA,GACzC,GAAI,MAAM,KAAK,KAAI,CAAG;CACzC;CAGQ,MAAM,IAAI,MAAuB,QAAc;EACrD,MAAM,SAAS,MAAM,KAAK,mBAAmB,sBAAsB,MAAM,CAAC,CAAA;EAC1E,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,+BAAgC,KAAI,oHACmB;EAGtF,OAAO;CACT"}
1
+ {"version":3,"file":"ngwr-carousel-testing.mjs","names":[],"sources":["../../../projects/lib/carousel/testing/wr-carousel-harness.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, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrCarouselHarnessFilters } from './types';\n\n/**\n * The settled percentage out of `translateX(-100%)`, and out of the mid-drag\n * `translateX(calc(-100% + 12px))` — the pixel half is the finger, not the slide.\n */\nconst TRACK_OFFSET = /translateX\\(\\s*(?:calc\\(\\s*)?(-?[\\d.]+)%/;\n\n/**\n * Test harness for `<wr-carousel>` — drive the strip the way someone on the page\n * drives it.\n *\n * Everything it reads is public API: the `.wr-carousel__*` elements, the dots'\n * `aria-current`, and the `aria-roledescription` the viewport and each slide\n * publish. Two things are worth knowing before writing an assertion against it:\n *\n * - **The slides do not say which one is showing.** A `<wr-carousel-slide>` carries\n * `role=\"group\"` and `aria-roledescription=\"slide\"` and nothing else — no\n * `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is\n * published in exactly two places, the dot carrying `aria-current=\"true\"` and the\n * track's own offset, and {@link getActiveIndex} reads them in that order. A\n * move the reader made is also said by the one live region, which\n * {@link getAnnouncement} reads; an autoplay tick is not.\n * - **It never drags.** The swipe the component supports is a touch gesture\n * measured against the viewport's own width, and jsdom has no layout — that width\n * is 0, so the \"20% of the viewport\" threshold is 0 too and EVERY drag clears it,\n * a 1px twitch included. The result says nothing about a real finger, and the spec\n * pins that artifact rather than pretending otherwise. Every move here goes\n * through the arrow buttons and the dots instead, which is the accessible path\n * anyway. `carousel.spec.ts` is where the gesture itself is pinned, by staging the\n * touch events and declaring an `offsetWidth`.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const gallery = await loader.getHarness(WrCarouselHarness.with({ ariaLabel: 'Gallery' }));\n *\n * expect(await gallery.getSlideCount()).toBe(3);\n * await gallery.next();\n * expect(await gallery.getActiveIndex()).toBe(1);\n *\n * await gallery.goTo(2);\n * expect(await gallery.getActiveSlideText()).toBe('Dunes');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCarouselHarness extends ComponentHarness {\n static hostSelector = 'wr-carousel';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCarouselHarnessFilters = {}): HarnessPredicate<WrCarouselHarness> {\n return new HarnessPredicate(WrCarouselHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('slideCount', options.slideCount, async (harness, count) => (await harness.getSlideCount()) === count)\n .addOption('slideText', options.slideText, async (harness, text) => {\n for (const slide of await harness.getSlideTexts()) {\n if (await HarnessPredicate.stringMatches(slide, text)) return true;\n }\n return false;\n });\n }\n\n // What the carousel announces\n\n /**\n * The role the strip announces — `group`, which is what lets\n * `aria-roledescription` mean anything.\n *\n * Read off the VIEWPORT rather than the host, and that is the whole point of the\n * pairing: `aria-roledescription` is dropped on an element with no semantic role,\n * and the host element (`<wr-carousel>`) has none.\n */\n async getRole(): Promise<string | null> {\n return (await this.viewport()).getAttribute('role');\n }\n\n /** How the strip describes itself to a screen reader — `carousel`. */\n async getRoleDescription(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-roledescription');\n }\n\n /**\n * The carousel's accessible name.\n *\n * The RESOLVED one, which is the only one the page has: the `ariaLabel` input\n * defaults to `null` and the component runs it through the `ngwr/i18n` catalog\n * (`carousel.label`, falling back to `'Carousel'`), so a consumer who passed\n * nothing still gets a named group and this still answers. Reporting the raw\n * input would say `null` about a carousel that announces itself perfectly well.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-label');\n }\n\n /** The accessible name of the previous-slide button. Throws when the arrows are not rendered. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.nav('prev', 'getPreviousLabel')).getAttribute('aria-label');\n }\n\n /** The accessible name of the next-slide button. Throws when the arrows are not rendered. */\n async getNextLabel(): Promise<string | null> {\n return (await this.nav('next', 'getNextLabel')).getAttribute('aria-label');\n }\n\n /**\n * The accessible name of the dot group — what names the row of dots as a set\n * rather than leaving a screen reader with N unexplained buttons.\n *\n * Throws when the dots are not rendered: there is no group to name then, and a\n * `null` would read like a group that lost its label.\n */\n async getPaginationLabel(): Promise<string | null> {\n const dots = await this.locatorForOptional('.wr-carousel__dots')();\n if (!dots) {\n throw new Error(\n 'WrCarouselHarness.getPaginationLabel(): this carousel renders no dot group — the dots are dropped ' +\n 'when [showDots] is false or when there are fewer than two slides.'\n );\n }\n return dots.getAttribute('aria-label');\n }\n\n /**\n * What each slide announces itself as — `slide`, on every one of them, in DOM\n * order.\n *\n * The one piece of ARIA the slides carry, and the reason it is worth asking: it\n * is set on the slide component's own host, so a slide reaching the page through\n * some other element would come back `null` here while the carousel kept working.\n */\n async getSlideRoleDescriptions(): Promise<(string | null)[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.getAttribute('aria-roledescription')));\n }\n\n // What the carousel is showing\n\n /** How many slides the carousel holds. */\n async getSlideCount(): Promise<number> {\n return (await this.slides()).length;\n }\n\n /** The text of every slide, in DOM order. */\n async getSlideTexts(): Promise<string[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.text()));\n }\n\n /**\n * Which slide is showing, as a zero-based index.\n *\n * Taken from the dot carrying `aria-current=\"true\"` whenever the dots are\n * rendered — that attribute is the only thing on the page that tells a screen\n * reader where in the strip it has got to, so it is the answer that matters —\n * and derived from the track's rendered offset when they are not, `[showDots]`\n * being off and a single-slide carousel both dropping the strip entirely.\n *\n * That fallback takes the MAGNITUDE of the offset on purpose. The transform is\n * physical while the slides sit on the inline axis, so a mirrored carousel paints\n * `translateX(100%)` for the very slide an LTR one paints `translateX(-100%)`\n * for; signed, this reported slide -1 for a perfectly healthy RTL carousel.\n *\n * Throws on a carousel with no slides at all — nothing is showing there, and `0`\n * would read like the first slide.\n */\n async getActiveIndex(): Promise<number> {\n const count = await this.getSlideCount();\n if (count === 0) {\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): this carousel has no <wr-carousel-slide> children, so no slide is ' +\n 'current — 0 would read like the first one.'\n );\n }\n\n const dots = await this.dots();\n if (dots.length) {\n for (let index = 0; index < dots.length; index++) {\n if ((await dots[index].getAttribute('aria-current')) === 'true') return index;\n }\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): the dots are rendered but none of them carries aria-current, so the ' +\n 'page tells a screen reader that no slide is current. The component clamps `active` into range, so look ' +\n 'for a lost aria-current binding rather than an out-of-range index — the `--active` class alone is paint.'\n );\n }\n\n return Math.round(Math.abs(await this.getTrackOffsetPercent()) / 100);\n }\n\n /** The text of the slide that is showing. Throws on a carousel with no slides. */\n async getActiveSlideText(): Promise<string> {\n const index = await this.getActiveIndex();\n return (await this.slides())[index].text();\n }\n\n /**\n * The track's rendered offset, as a percentage of one viewport: `-100` for the\n * second slide of an LTR carousel, `+100` for the second slide of a mirrored one.\n *\n * Read off the inline `style` attribute rather than through `getCssValue()`,\n * because the percentage only survives where the component wrote it. jsdom hands\n * a declared `transform` straight back through `getComputedStyle`, so\n * `getCssValue()` answers correctly HERE and would stop the moment the same\n * harness ran against a real browser, which resolves the property to a pixel\n * matrix — a green unit test would be hiding it. Mid-drag the component writes\n * `translateX(calc(-100% + 12px))` and this reports the settled `-100`: the pixel\n * half is the finger's own displacement, which is physical in both directions and\n * belongs to no slide.\n *\n * Worth asserting next to {@link getActiveIndex}: it is the same fact painted\n * instead of announced, and a carousel that lights the right dot while parking\n * the track in blank space is exactly the failure nobody sees in a spec.\n */\n async getTrackOffsetPercent(): Promise<number> {\n const style = (await (await this.track()).getAttribute('style')) ?? '';\n const match = TRACK_OFFSET.exec(style);\n if (!match) {\n throw new Error(\n `WrCarouselHarness.getTrackOffsetPercent(): the track carries no translateX() offset (style: \"${style}\"). ` +\n 'That transform is how the carousel moves at all, so it should always be there.'\n );\n }\n return Number(match[1]);\n }\n\n // The controls the carousel renders\n\n /** Whether the prev / next arrows are on the page. Both are dropped together. */\n async hasArrows(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__nav--next')()) !== null;\n }\n\n /** Whether the dot strip is on the page. */\n async hasDots(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__dots')()) !== null;\n }\n\n /** How many dots are rendered — one per slide, or `0` while the strip is hidden. */\n async getDotCount(): Promise<number> {\n return (await this.dots()).length;\n }\n\n /**\n * The accessible name of every dot, in order — `'Go to slide 1'`, … resolved\n * through the `ngwr/i18n` catalog.\n *\n * A dot is a bare button with no text of its own, so this label is all a screen\n * reader has to tell one from another. `[]` when the strip is hidden, matching\n * {@link getDotCount}.\n */\n async getDotLabels(): Promise<(string | null)[]> {\n const dots = await this.dots();\n return Promise.all(dots.map(dot => dot.getAttribute('aria-label')));\n }\n\n // Moving the carousel\n\n /**\n * Click the next-slide arrow.\n *\n * \"Next\" is the next SLIDE, not the next thing on the right: the buttons keep\n * their semantics under `dir=\"rtl\"` and only the travel under them turns around.\n * At the last slide this wraps to the first one, unless `[loop]` is off — in\n * which case the arrow is `disabled` and nothing moves, so nothing is asserted\n * about the move.\n */\n async next(): Promise<void> {\n return (await this.nav('next', 'next')).click();\n }\n\n /** Click the previous-slide arrow. Wraps to the last slide unless `[loop]` is off. */\n async previous(): Promise<void> {\n return (await this.nav('prev', 'previous')).click();\n }\n\n /**\n * Jump to a slide by clicking its dot — the only way the page offers to reach a\n * slide directly.\n *\n * Throws when the dots are hidden (the component's own `goTo()` is still there\n * for a spec holding the instance, but nothing on the page can be clicked) and\n * throws on an index no slide has, rather than clicking nothing and leaving the\n * carousel where it was.\n */\n async goTo(index: number): Promise<void> {\n const dots = await this.dots();\n if (!dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): this carousel renders no dots, and they are the only way to reach a ` +\n 'slide directly from the page — they are dropped when [showDots] is false or when there are fewer than ' +\n 'two slides. Use next() / previous(), or write the active index from the host.'\n );\n }\n if (!Number.isInteger(index) || index < 0 || index >= dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): out of range — this carousel has ${dots.length} slides, so the index ` +\n `must be a whole number between 0 and ${dots.length - 1}.`\n );\n }\n return dots[index].click();\n }\n\n // What the carousel says\n\n /**\n * The text of the live region: `Slide 2 of 3` after an arrow, a dot or a swipe\n * moved the carousel, and empty before any move and after an autoplay tick.\n */\n async getAnnouncement(): Promise<string> {\n return (await (await this.locatorFor('.wr-carousel__live')()).text()).trim();\n }\n\n /**\n * Whether the live region speaks: `polite`, or `off` while the slides advance on\n * their own, when a tick must not be read out.\n */\n async getLivePoliteness(): Promise<string | null> {\n return (await this.locatorFor('.wr-carousel__live')()).getAttribute('aria-live');\n }\n\n // Autoplay\n\n /**\n * The name of the pause button, which says what a press does next: the pause\n * label while autoplay is on, the play label while it is off, held or not.\n * Throws when the carousel has no such button, which is every carousel\n * without `autoplay`.\n */\n async getAutoplayLabel(): Promise<string | null> {\n return (await this.autoplayButton('getAutoplayLabel')).getAttribute('aria-label');\n }\n\n /** Press the pause button. Throws without `autoplay`. */\n async toggleAutoplay(): Promise<void> {\n return (await this.autoplayButton('toggleAutoplay')).click();\n }\n\n // Holding autoplay\n\n /**\n * Move the pointer onto the carousel, which is what HOLDS autoplay.\n *\n * Aimed at the host and not the viewport, deliberately: the arrows and the dots\n * are the viewport's SIBLINGS, so a viewport-scoped hover would let a slide\n * change under a cursor that is aiming at an arrow.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer away again, releasing the hold. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * Put keyboard focus on the first control the carousel renders — the pause\n * button under `autoplay`, else the previous arrow, or the first dot when the\n * arrows are hidden.\n *\n * This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop\n * moving content, and hovering is not one for someone who never touches a mouse,\n * so the component listens for `focusin` on its host as well. Focus lands on the\n * carousel's OWN controls; anything focusable a slide happens to project is not\n * this harness's business, though in a browser it would hold autoplay just the\n * same.\n *\n * Note what this is NOT: the dot of the slide showing. The dots are ordinary\n * buttons with no roving `tabindex`, so each of them is a tab stop of its own and\n * the first one a Tab press meets is the same whatever slide is current —\n * two different questions, answered here and by {@link getActiveIndex}.\n *\n * Throws when the carousel renders no controls at all, because then there is\n * nothing for a Tab press to land on and no keyboard mechanism to assert.\n */\n async focus(): Promise<void> {\n const [first] = await this.controls();\n if (!first) {\n throw new Error(\n 'WrCarouselHarness.focus(): this carousel renders no controls of its own — the arrows and the dots are ' +\n 'both gone (a single slide, or [showArrows] and [showDots] switched off), so a Tab press has nothing ' +\n 'inside it to land on.'\n );\n }\n return first.focus();\n }\n\n /**\n * Take focus off whichever of the carousel's controls holds it, releasing the\n * hold {@link focus} started.\n *\n * Throws when none of them is focused: `focusout` is what the component listens\n * for, and blurring an element that never had focus fires nothing — a quiet\n * no-op here surfaces as an autoplay assertion failing three lines later.\n */\n async blur(): Promise<void> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return control.blur();\n }\n throw new Error(\n 'WrCarouselHarness.blur(): none of the controls this carousel renders holds focus, so there is no focus to ' +\n 'release. Call focus() first — the hold is released by blurring the element that took it.'\n );\n }\n\n /** Whether one of the carousel's own controls holds focus — which is what holds autoplay. */\n async isFocused(): Promise<boolean> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return true;\n }\n return false;\n }\n\n // Internals\n\n /** The element that carries the carousel's role and name. */\n private async viewport(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__viewport')();\n }\n\n /** The moving strip, whose inline transform is where the carousel IS. */\n private async track(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__track')();\n }\n\n private async slides(): Promise<TestElement[]> {\n return this.locatorForAll('wr-carousel-slide')();\n }\n\n private async dots(): Promise<TestElement[]> {\n return this.locatorForAll('.wr-carousel__dot')();\n }\n\n /**\n * Every control the carousel renders itself, in the order a Tab press meets\n * them: the two arrows, then the dots.\n */\n private async controls(): Promise<TestElement[]> {\n const toggle = await this.locatorForAll('.wr-carousel__toggle')();\n const navs = await this.locatorForAll('.wr-carousel__nav')();\n return [...toggle, ...navs, ...(await this.dots())];\n }\n\n /** One arrow, or a failure naming both reasons it might not be there. */\n private async autoplayButton(method: string): Promise<TestElement> {\n const button = await this.locatorForOptional('.wr-carousel__toggle')();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with ` +\n '[autoplay] on and two slides or more.'\n );\n }\n return button;\n }\n\n private async nav(side: 'prev' | 'next', caller: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`.wr-carousel__nav--${side}`)();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${caller}(): this carousel renders no ${side} arrow — the arrows are dropped when ` +\n '[showArrows] is false or when there are fewer than two slides to page through.'\n );\n }\n return button;\n }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe;AAyCrB,IAAa,oBAAb,MAAa,0BAA0B,iBAAgB;CACrD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAoC,CAAA,GAAE;EAChD,OAAO,IAAI,iBAAiB,mBAAmB,OAAO,CAAC,CACpD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,cAAc,QAAQ,YAAY,OAAO,SAAS,UAAW,MAAM,QAAQ,cAAa,MAAQ,KA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O;EAExC,OAAO;CACT;CAKQ,MAAM,WAAQ;EACpB,OAAO,KAAK,WAAW,wBAAwB,CAAC,CAAA;CAClD;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,WAAW,qBAAqB,CAAC,CAAA;CAC/C;CAEQ,MAAM,SAAM;EAClB,OAAO,KAAK,cAAc,mBAAmB,CAAC,CAAA;CAChD;CAEQ,MAAM,OAAI;EAChB,OAAO,KAAK,cAAc,mBAAmB,CAAC,CAAA;CAChD;CAMQ,MAAM,WAAQ;EACpB,MAAM,SAAS,MAAM,KAAK,cAAc,sBAAsB,CAAC,CAAA;EAC/D,MAAM,OAAO,MAAM,KAAK,cAAc,mBAAmB,CAAC,CAAA;EAC1D,OAAO;GAAC,GAAG;GAAQ,GAAG;GAAM,GAAI,MAAM,KAAK,KAAI;EAAG;CACpD;CAGQ,MAAM,eAAe,QAAc;EACzC,MAAM,SAAS,MAAM,KAAK,mBAAmB,sBAAsB,CAAC,CAAA;EACpE,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,yGACc;EAG7C,OAAO;CACT;CAEQ,MAAM,IAAI,MAAuB,QAAc;EACrD,MAAM,SAAS,MAAM,KAAK,mBAAmB,sBAAsB,MAAM,CAAC,CAAA;EAC1E,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,+BAAgC,KAAI,oHACmB;EAGtF,OAAO;CACT"}
@@ -116,6 +116,11 @@ var WrCarousel = class WrCarousel {
116
116
  roledescription = input(null, ...ngDevMode ? [{ debugName: "roledescription" }] : /* istanbul ignore next */ []);
117
117
  resolvedRoledescription = useI18nText(this.roledescription, "carousel.roledescription", "carousel");
118
118
  slideLabel = useI18nFormatter("carousel.goToSlide", "Go to slide {{index}}");
119
+ pauseLabel = input(null, ...ngDevMode ? [{ debugName: "pauseLabel" }] : /* istanbul ignore next */ []);
120
+ playLabel = input(null, ...ngDevMode ? [{ debugName: "playLabel" }] : /* istanbul ignore next */ []);
121
+ resolvedPauseLabel = useI18nText(this.pauseLabel, "marquee.pause", "Pause");
122
+ resolvedPlayLabel = useI18nText(this.playLabel, "marquee.play", "Play");
123
+ positionText = useI18nFormatter("carousel.position", "Slide {{current}} of {{total}}");
119
124
  active = model(0, ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
120
125
  showArrows = input(true, {
121
126
  ...ngDevMode ? { debugName: "showArrows" } : /* istanbul ignore next */ {},
@@ -158,6 +163,13 @@ var WrCarousel = class WrCarousel {
158
163
  focusWithin = signal(false, ...ngDevMode ? [{ debugName: "focusWithin" }] : /* istanbul ignore next */ []);
159
164
  paused = computed(() => this.hovered() || this.focusWithin() || this.dragging(), ...ngDevMode ? [{ debugName: "paused" }] : /* istanbul ignore next */ []);
160
165
  reducedMotion = inject(WrPlatform).prefersReducedMotion;
166
+ asked = signal(null, ...ngDevMode ? [{ debugName: "asked" }] : /* istanbul ignore next */ []);
167
+ playing = computed(() => {
168
+ const asked = this.asked();
169
+ return this.autoplay() && (asked === null ? !this.reducedMotion() : asked === "play");
170
+ }, ...ngDevMode ? [{ debugName: "playing" }] : /* istanbul ignore next */ []);
171
+ rotating = computed(() => this.isBrowser && this.playing() && !this.paused() && this.count() > 1, ...ngDevMode ? [{ debugName: "rotating" }] : /* istanbul ignore next */ []);
172
+ announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
161
173
  destroyRef = inject(DestroyRef);
162
174
  isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
163
175
  constructor() {
@@ -165,9 +177,12 @@ var WrCarousel = class WrCarousel {
165
177
  effect(() => {
166
178
  if (this.timer) clearInterval(this.timer);
167
179
  this.timer = null;
168
- if (!this.isBrowser || !this.autoplay() || this.paused() || this.reducedMotion() || this.count() < 2) return;
180
+ if (!this.rotating()) return;
169
181
  const interval = this.intervalMs();
170
- this.timer = setInterval(() => this.next(), interval);
182
+ this.timer = setInterval(() => {
183
+ this.move(this.active() + 1);
184
+ this.announcement.set("");
185
+ }, interval);
171
186
  });
172
187
  effect(() => {
173
188
  const max = this.count() - 1;
@@ -191,7 +206,25 @@ var WrCarousel = class WrCarousel {
191
206
  onFocusOut() {
192
207
  this.focusWithin.set(false);
193
208
  }
209
+ toggleAutoplay() {
210
+ if (this.playing()) {
211
+ this.asked.set("pause");
212
+ return;
213
+ }
214
+ this.asked.set("play");
215
+ this.hovered.set(false);
216
+ this.focusWithin.set(false);
217
+ }
194
218
  goTo(index) {
219
+ const before = this.active();
220
+ this.move(index);
221
+ const current = this.active();
222
+ if (current !== before) this.announcement.set(this.positionText({
223
+ current: current + 1,
224
+ total: this.count()
225
+ }));
226
+ }
227
+ move(index) {
195
228
  const max = this.count() - 1;
196
229
  if (max < 0) return;
197
230
  if (this.loop()) {
@@ -290,6 +323,20 @@ var WrCarousel = class WrCarousel {
290
323
  isRequired: false,
291
324
  transformFunction: null
292
325
  },
326
+ pauseLabel: {
327
+ classPropertyName: "pauseLabel",
328
+ publicName: "pauseLabel",
329
+ isSignal: true,
330
+ isRequired: false,
331
+ transformFunction: null
332
+ },
333
+ playLabel: {
334
+ classPropertyName: "playLabel",
335
+ publicName: "playLabel",
336
+ isSignal: true,
337
+ isRequired: false,
338
+ transformFunction: null
339
+ },
293
340
  active: {
294
341
  classPropertyName: "active",
295
342
  publicName: "active",
@@ -353,7 +400,7 @@ var WrCarousel = class WrCarousel {
353
400
  isSignal: true
354
401
  }],
355
402
  ngImport: i0,
356
- template: "<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n",
403
+ template: "<!--\n First in the DOM, so it is the first tab stop of the carousel: the way to stop\n the slides comes before the slides. Named for what a press does next.\n-->\n@if (autoplay() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__toggle\"\n [attr.aria-label]=\"playing() ? resolvedPauseLabel() : resolvedPlayLabel()\"\n (click)=\"toggleAutoplay()\"\n >\n @if (playing()) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n } @else {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n }\n </button>\n}\n\n<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n\n<!--\n One live region for the whole carousel, in the DOM before its text changes.\n Off while the slides advance on their own, as the WAI-ARIA carousel pattern has it.\n-->\n<div class=\"wr-carousel__live\" aria-atomic=\"true\" [attr.aria-live]=\"rotating() ? 'off' : 'polite'\">\n {{ announcement() }}\n</div>\n",
357
404
  encapsulation: i0.ViewEncapsulation.None
358
405
  });
359
406
  };
@@ -378,7 +425,7 @@ i0.ɵɵngDeclareClassMetadata({
378
425
  provide: WR_CAROUSEL,
379
426
  useExisting: forwardRef(() => WrCarousel)
380
427
  }],
381
- template: "<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n"
428
+ template: "<!--\n First in the DOM, so it is the first tab stop of the carousel: the way to stop\n the slides comes before the slides. Named for what a press does next.\n-->\n@if (autoplay() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__toggle\"\n [attr.aria-label]=\"playing() ? resolvedPauseLabel() : resolvedPlayLabel()\"\n (click)=\"toggleAutoplay()\"\n >\n @if (playing()) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n } @else {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n }\n </button>\n}\n\n<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n\n<!--\n One live region for the whole carousel, in the DOM before its text changes.\n Off while the slides advance on their own, as the WAI-ARIA carousel pattern has it.\n-->\n<div class=\"wr-carousel__live\" aria-atomic=\"true\" [attr.aria-live]=\"rotating() ? 'off' : 'polite'\">\n {{ announcement() }}\n</div>\n"
382
429
  }]
383
430
  }],
384
431
  ctorParameters: () => [],
@@ -423,6 +470,22 @@ i0.ɵɵngDeclareClassMetadata({
423
470
  required: false
424
471
  }]
425
472
  }],
473
+ pauseLabel: [{
474
+ type: i0.Input,
475
+ args: [{
476
+ isSignal: true,
477
+ alias: "pauseLabel",
478
+ required: false
479
+ }]
480
+ }],
481
+ playLabel: [{
482
+ type: i0.Input,
483
+ args: [{
484
+ isSignal: true,
485
+ alias: "playLabel",
486
+ required: false
487
+ }]
488
+ }],
426
489
  active: [{
427
490
  type: i0.Input,
428
491
  args: [{