@consumidor-positivo/aurora 3.1.0 → 3.2.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.
- package/astro/FeedbackPage/index.astro +2 -2
- package/astro/ListRow/index.astro +32 -36
- package/astro/Logo/ac/BadgeWhiteStroke.astro +1 -0
- package/astro/Logo/cp/BadgeWhiteStroke.astro +1 -1
- package/astro/SearchBar/index.astro +72 -24
- package/dist/{BadgeWhite-CkZPPGmT.js → BadgeWhite-BjdKCzB3.js} +3 -2
- package/dist/{BadgeWhite-CkZPPGmT.js.map → BadgeWhite-BjdKCzB3.js.map} +1 -1
- package/dist/components/DropdownItem/styles.css +1 -1
- package/dist/components/FeedbackPage/index.es.js +2 -2
- package/dist/components/FeedbackPage/index.es.js.map +1 -1
- package/dist/components/ListRow/index.es.js +4 -7
- package/dist/components/ListRow/index.es.js.map +1 -1
- package/dist/components/ListRow/styles.css +1 -1
- package/dist/components/Logo/index.es.js +1 -1
- package/dist/components/SearchBar/hooks.d.ts +8 -2
- package/dist/components/SearchBar/index.d.ts +1 -1
- package/dist/components/SearchBar/index.es.js +23 -6
- package/dist/components/SearchBar/index.es.js.map +1 -1
- package/dist/components/SearchBar/styles.css +1 -1
- package/dist/components/SearchBar/types.d.ts +6 -0
- package/dist/components/SectionApp/styles.css +1 -1
- package/dist/main.es.js +1 -1
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@ import type { HTMLAttributes } from 'astro/types'
|
|
|
3
3
|
import Button from '../Button/index.astro'
|
|
4
4
|
import Text from '../Text/index.astro'
|
|
5
5
|
import IconAlertOctagon from '../icons/default/IconAlertOctagon.astro'
|
|
6
|
+
import IconAlertTriangle from '../icons/default/IconAlertTriangle.astro'
|
|
6
7
|
import IconCheckCircle from '../icons/default/IconCheckCircle.astro'
|
|
7
|
-
import IconRefreshCw from '../icons/default/IconRefreshCw.astro'
|
|
8
8
|
import '../../dist/components/FeedbackPage/styles.css'
|
|
9
9
|
|
|
10
10
|
export type FeedbackPageType = 'error' | 'success' | 'warning'
|
|
@@ -42,7 +42,7 @@ export type Props = HTMLAttributes<'section'> & {
|
|
|
42
42
|
const ICONS = {
|
|
43
43
|
error: IconAlertOctagon,
|
|
44
44
|
success: IconCheckCircle,
|
|
45
|
-
warning:
|
|
45
|
+
warning: IconAlertTriangle,
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const {
|
|
@@ -150,7 +150,7 @@ const Tag = clickable ? 'a' : as
|
|
|
150
150
|
<div class={`au-list-row__leading au-list-row__leading--${leading}`}>
|
|
151
151
|
{skeleton ? (
|
|
152
152
|
<Fragment>
|
|
153
|
-
{leading === 'icon' && <Skeleton
|
|
153
|
+
{leading === 'icon' && <Skeleton width={20} height={20} />}
|
|
154
154
|
{leading === 'partner' && <Skeleton shape="square" width={40} height={40} />}
|
|
155
155
|
{leading === 'radio' && <Skeleton shape="circle" width={20} height={20} />}
|
|
156
156
|
{leading === 'trackline' && <Skeleton shape="circle" width={24} height={24} />}
|
|
@@ -187,8 +187,8 @@ const Tag = clickable ? 'a' : as
|
|
|
187
187
|
{
|
|
188
188
|
skeleton ? (
|
|
189
189
|
<Fragment>
|
|
190
|
-
<Skeleton width={
|
|
191
|
-
|
|
190
|
+
{twoLines && <Skeleton width={104} height={22} />}
|
|
191
|
+
<Skeleton width={160} height={22} />
|
|
192
192
|
</Fragment>
|
|
193
193
|
) : (
|
|
194
194
|
<Fragment>
|
|
@@ -199,40 +199,36 @@ const Tag = clickable ? 'a' : as
|
|
|
199
199
|
}
|
|
200
200
|
</div>
|
|
201
201
|
{
|
|
202
|
-
hasTrailing && (
|
|
202
|
+
hasTrailing && !skeleton && (
|
|
203
203
|
<div class="au-list-row__trailing">
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
</span>
|
|
233
|
-
)}
|
|
234
|
-
</Fragment>
|
|
235
|
-
)}
|
|
204
|
+
<Fragment>
|
|
205
|
+
{hasSecondary && (
|
|
206
|
+
<span class="au-list-row__secondary">
|
|
207
|
+
{secondaryLabel && <span class="au-list-row__secondary-label">{secondaryLabel}</span>}
|
|
208
|
+
{secondaryDescription && (
|
|
209
|
+
<span class="au-list-row__secondary-description">{secondaryDescription}</span>
|
|
210
|
+
)}
|
|
211
|
+
</span>
|
|
212
|
+
)}
|
|
213
|
+
{link && (
|
|
214
|
+
<LinkButton
|
|
215
|
+
as={link.href ? 'a' : 'button'}
|
|
216
|
+
href={link.href}
|
|
217
|
+
target={link.target}
|
|
218
|
+
size="small"
|
|
219
|
+
class="au-list-row__link"
|
|
220
|
+
data-au-list-row="link">
|
|
221
|
+
{link.label}
|
|
222
|
+
</LinkButton>
|
|
223
|
+
)}
|
|
224
|
+
{badge && <BadgeState status={badge.status} text={badge.text} variant={badge.variant} />}
|
|
225
|
+
{toggle && <Switch {...toggle} />}
|
|
226
|
+
{chevron && (
|
|
227
|
+
<span class="au-list-row__chevron" aria-hidden="true">
|
|
228
|
+
<IconChevronRight />
|
|
229
|
+
</span>
|
|
230
|
+
)}
|
|
231
|
+
</Fragment>
|
|
236
232
|
</div>
|
|
237
233
|
)
|
|
238
234
|
}
|
|
@@ -6,5 +6,5 @@ export type Props = HTMLAttributes<'div'>
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
<Logo label="Consumidor Positivo" {...Astro.props}>
|
|
9
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="none"><path fill="#fff" d="M6.216 4.08C6.216 2.061 7.794.6 9.725.6c1.93 0 3.508 1.462 3.508 3.48 0 2.016-1.552 3.519-3.522 3.519-1.97 0-3.496-1.476-3.496-3.52Z"/><path fill="#0048DB" d="M9.712 6.729c-1.527 0-2.636-1.115-2.636-2.65 0-1.534 1.138-2.61 2.648-2.61 1.51 0 2.648 1.122 2.648 2.61 0 1.489-1.12 2.65-2.661 2.65Z"/><path fill="#fff" d="M20.018 6.84a4.66 4.66 0 0 0-3.334-1.394c-1.26 0-2.444.495-3.334 1.393l-3.487 3.524-1.168-1.18A4.76 4.76 0 0 0 5.29 7.759c-1.809 0-3.431 1.03-4.235 2.69a4.456 4.456 0 0 0-.37 1.121 4.83 4.83 0 0 0 .957 3.92c.136.17.642.687.774.822l3.335 3.369A5.748 5.748 0 0 0 9.863 21.4a5.767 5.767 0 0 0 3.836-1.456.931.931 0 0 0 .114-.095l6.149-6.214c.91-.918 1.42-2.11 1.437-3.356a4.756 4.756 0 0 0-1.38-3.439h-.001Z"/><path fill="#04D98C" d="m9.863 11.593.522-.528 3.573-3.61a3.83 3.83 0 0 1 5.45 0 3.891 3.891 0 0 1 1.128 2.81c-.014 1.037-.46 2.02-1.185 2.753l-1.357 1.372-.002.002-4.06 4.102-.57.575-.16.162-.011.004a4.926 4.926 0 0 1-6.833-.17l-3.335-3.369.23.042c1.51.279 2.873-.396 3.962-1.489l2.648-2.657Z"/><path fill="#0048DB" d="M2.386 14.918a4.789 4.789 0 0 0 4.265-1.336l2.6-2.609-1.166-1.177A3.929 3.929 0 0 0 5.29 8.627c-1.38 0-2.75.73-3.462 2.203a3.61 3.61 0 0 0-.297.902c-.221 1.176-.015 2.238.692 3.123.02.025.05.042.081.048l.082.015h.001Z"/></svg>
|
|
9
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none"><path fill="#fff" d="M6.216 4.08C6.216 2.061 7.794.6 9.725.6c1.93 0 3.508 1.462 3.508 3.48 0 2.016-1.552 3.519-3.522 3.519-1.97 0-3.496-1.476-3.496-3.52Z"/><path fill="#0048DB" d="M9.712 6.729c-1.527 0-2.636-1.115-2.636-2.65 0-1.534 1.138-2.61 2.648-2.61 1.51 0 2.648 1.122 2.648 2.61 0 1.489-1.12 2.65-2.661 2.65Z"/><path fill="#fff" d="M20.018 6.84a4.66 4.66 0 0 0-3.334-1.394c-1.26 0-2.444.495-3.334 1.393l-3.487 3.524-1.168-1.18A4.76 4.76 0 0 0 5.29 7.759c-1.809 0-3.431 1.03-4.235 2.69a4.456 4.456 0 0 0-.37 1.121 4.83 4.83 0 0 0 .957 3.92c.136.17.642.687.774.822l3.335 3.369A5.748 5.748 0 0 0 9.863 21.4a5.767 5.767 0 0 0 3.836-1.456.931.931 0 0 0 .114-.095l6.149-6.214c.91-.918 1.42-2.11 1.437-3.356a4.756 4.756 0 0 0-1.38-3.439h-.001Z"/><path fill="#04D98C" d="m9.863 11.593.522-.528 3.573-3.61a3.83 3.83 0 0 1 5.45 0 3.891 3.891 0 0 1 1.128 2.81c-.014 1.037-.46 2.02-1.185 2.753l-1.357 1.372-.002.002-4.06 4.102-.57.575-.16.162-.011.004a4.926 4.926 0 0 1-6.833-.17l-3.335-3.369.23.042c1.51.279 2.873-.396 3.962-1.489l2.648-2.657Z"/><path fill="#0048DB" d="M2.386 14.918a4.789 4.789 0 0 0 4.265-1.336l2.6-2.609-1.166-1.177A3.929 3.929 0 0 0 5.29 8.627c-1.38 0-2.75.73-3.462 2.203a3.61 3.61 0 0 0-.297.902c-.221 1.176-.015 2.238.692 3.123.02.025.05.042.081.048l.082.015h.001Z"/></svg>
|
|
10
10
|
</Logo>
|
|
@@ -32,7 +32,10 @@ export type SearchBarGroup = {
|
|
|
32
32
|
* a virtual focus (`aria-activedescendant`), Enter picks the highlighted
|
|
33
33
|
* option or searches, a click on a row picks it without blurring the field.
|
|
34
34
|
*
|
|
35
|
-
* Differences from React: `value` is the initial text; `
|
|
35
|
+
* Differences from React: `value` is the initial text; `filter` filters the
|
|
36
|
+
* rows of the markup (the controller keeps every row it found and shows the
|
|
37
|
+
* ones whose label matches the text, dropping categories left empty, so the
|
|
38
|
+
* rows come back as the text shrinks); `onChange` becomes
|
|
36
39
|
* `au:searchchange` (`detail.value`), `onSearch` becomes `au:search`
|
|
37
40
|
* (`detail.value`), `onSelect` becomes `au:searchselect` (`detail.value`,
|
|
38
41
|
* `detail.label`) and `onClear` becomes `au:searchclear`, all bubbling from
|
|
@@ -52,6 +55,12 @@ export type Props = Omit<HTMLAttributes<'div'>, 'style' | 'placeholder'> & {
|
|
|
52
55
|
value?: string
|
|
53
56
|
/** Resultados da busca, soltos ou em grupos com título. A lista abre com o campo em foco. */
|
|
54
57
|
options?: Array<SearchBarOption | SearchBarGroup>
|
|
58
|
+
/**
|
|
59
|
+
* Filtra as linhas pelo texto digitado no próprio componente, a cada letra, sem acento e sem
|
|
60
|
+
* diferenciar maiúsculas (Figma: Sync). Grupo que fica sem opção some. Com o campo vazio a lista
|
|
61
|
+
* sai inteira. Desligado, quem filtra é a página (busca assíncrona, com `au:searchcontrol`).
|
|
62
|
+
*/
|
|
63
|
+
filter?: boolean
|
|
55
64
|
/** Spinner no lugar do ícone e lista de skeletons enquanto os resultados chegam (Figma: Loading). */
|
|
56
65
|
loading?: boolean
|
|
57
66
|
/** Linha mostrada quando há texto e nenhum resultado (Figma: No Results). Vazio desliga. */
|
|
@@ -68,6 +77,7 @@ const {
|
|
|
68
77
|
placeholder = 'Buscar',
|
|
69
78
|
value = '',
|
|
70
79
|
options = [],
|
|
80
|
+
filter = false,
|
|
71
81
|
loading = false,
|
|
72
82
|
emptyText = 'Nenhum resultado',
|
|
73
83
|
disabled = false,
|
|
@@ -109,10 +119,11 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
109
119
|
|
|
110
120
|
<FieldRoot
|
|
111
121
|
style={style}
|
|
112
|
-
class:list={['au-search-bar', value !== '' && 'au-search-bar--filled', loading && 'au-search-bar--loading', className]}
|
|
122
|
+
class:list={['au-search-bar', value !== '' && !disabled && 'au-search-bar--filled', loading && 'au-search-bar--loading', className]}
|
|
113
123
|
disabled={disabled}
|
|
114
124
|
data-element="au-search-bar"
|
|
115
125
|
data-au-search-empty-text={emptyText}
|
|
126
|
+
data-au-search-filter={filter ? '' : undefined}
|
|
116
127
|
{...rest}>
|
|
117
128
|
<FieldLabel text={label} id={inputId} labelId={labelId} disabled={disabled} showOptionalLabel={false} />
|
|
118
129
|
<div class="au-search-bar__control">
|
|
@@ -138,9 +149,9 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
138
149
|
<div class="au-search-bar__action au-search-bar__action--loading">
|
|
139
150
|
<Spinner />
|
|
140
151
|
</div>
|
|
141
|
-
) : value !== '' ? (
|
|
142
|
-
<button type="button" class="au-search-bar__action au-search-bar__action--clear" aria-label="Limpar busca"
|
|
143
|
-
<IconX
|
|
152
|
+
) : value !== '' && !disabled ? (
|
|
153
|
+
<button type="button" class="au-search-bar__action au-search-bar__action--clear" aria-label="Limpar busca">
|
|
154
|
+
<IconX />
|
|
144
155
|
</button>
|
|
145
156
|
) : (
|
|
146
157
|
<button type="button" class="au-search-bar__action au-search-bar__action--search" aria-label="Buscar" disabled={disabled}>
|
|
@@ -185,8 +196,8 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
185
196
|
<div class="au-search-bar__action au-search-bar__action--loading">
|
|
186
197
|
<Spinner />
|
|
187
198
|
</div>
|
|
188
|
-
<button type="button" class="au-search-bar__action au-search-bar__action--clear" aria-label="Limpar busca"
|
|
189
|
-
<IconX
|
|
199
|
+
<button type="button" class="au-search-bar__action au-search-bar__action--clear" aria-label="Limpar busca">
|
|
200
|
+
<IconX />
|
|
190
201
|
</button>
|
|
191
202
|
<button type="button" class="au-search-bar__action au-search-bar__action--search" aria-label="Buscar" disabled={disabled}>
|
|
192
203
|
<IconSearch />
|
|
@@ -203,6 +214,11 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
203
214
|
|
|
204
215
|
const ITEM_CLASS = 'au-dropdown-item'
|
|
205
216
|
const FOCUSED_CLASS = 'au-dropdown-item--focused'
|
|
217
|
+
const CATEGORY_CLASS = 'au-dropdown-item--type-category'
|
|
218
|
+
|
|
219
|
+
// Copy of `matchesSearch` in `lib/components/SearchBar/hooks.ts`.
|
|
220
|
+
const normalize = (text: string) => text.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')
|
|
221
|
+
const matchesSearch = (label: string, value: string) => normalize(label).includes(normalize(value))
|
|
206
222
|
|
|
207
223
|
elementController('au-search-bar', ({ root, query, on, emit }) => {
|
|
208
224
|
const inputEl = query<HTMLInputElement>('.au-search-bar__input')
|
|
@@ -223,6 +239,8 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
223
239
|
// Controller settings only; React's root carries no such attribute.
|
|
224
240
|
const emptyText = root.dataset.auSearchEmptyText ?? ''
|
|
225
241
|
root.removeAttribute('data-au-search-empty-text')
|
|
242
|
+
const filter = root.hasAttribute('data-au-search-filter')
|
|
243
|
+
root.removeAttribute('data-au-search-filter')
|
|
226
244
|
|
|
227
245
|
const inputId = input.id
|
|
228
246
|
const disabled = input.disabled
|
|
@@ -246,36 +264,64 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
246
264
|
let dismissed = false
|
|
247
265
|
let activeIndex: number | null = null
|
|
248
266
|
let optionNodes: HTMLElement[] = []
|
|
267
|
+
// What the controller itself last put in the list: the same children
|
|
268
|
+
// again means the page did not touch the rows.
|
|
269
|
+
let lastRendered: HTMLElement[] | null = null
|
|
249
270
|
// Rows the page swaps in while the list is static.
|
|
250
271
|
const observer = new MutationObserver(() => render())
|
|
251
272
|
|
|
252
|
-
// The rows the page put in the list.
|
|
253
|
-
//
|
|
254
|
-
//
|
|
273
|
+
// The rows the page put in the list. Children equal to the last render
|
|
274
|
+
// (the filtered subset, the skeletons, the empty row) mean the options
|
|
275
|
+
// are the stored ones; anything else is the page's new rows, or the page
|
|
276
|
+
// clearing them.
|
|
255
277
|
function readOptions() {
|
|
256
278
|
const children = Array.from(list.children) as HTMLElement[]
|
|
257
|
-
if (children.length ===
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
279
|
+
if (lastRendered && children.length === lastRendered.length && children.every((child, index) => child === lastRendered![index])) return
|
|
280
|
+
const next = children.filter((child) => !owned.has(child))
|
|
281
|
+
const changed = next.length !== optionNodes.length || next.some((node, index) => node !== optionNodes[index])
|
|
282
|
+
optionNodes = next
|
|
283
|
+
// New rows, like new React `options`: the keyboard highlight restarts.
|
|
284
|
+
if (changed) activeIndex = null
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const isOption = (node: HTMLElement) => node.getAttribute('role') === 'option' && !node.classList.contains('au-dropdown-item--state-empty')
|
|
288
|
+
const labelOf = (node: HTMLElement) => node.querySelector('.au-dropdown-item__label')?.textContent ?? ''
|
|
289
|
+
|
|
290
|
+
// The rows to show: with `filter` and text, the options whose label
|
|
291
|
+
// matches and the categories that still have one below them, as
|
|
292
|
+
// `filterSearchBarOptions` in the React hook.
|
|
293
|
+
const visible = () => {
|
|
294
|
+
if (!filter || input.value === '') return optionNodes
|
|
295
|
+
const kept: HTMLElement[] = []
|
|
296
|
+
let category: HTMLElement | null = null
|
|
297
|
+
for (const node of optionNodes) {
|
|
298
|
+
if (node.classList.contains(CATEGORY_CLASS)) {
|
|
299
|
+
category = node
|
|
300
|
+
continue
|
|
301
|
+
}
|
|
302
|
+
if (isOption(node) && !matchesSearch(labelOf(node), input.value)) continue
|
|
303
|
+
if (category) {
|
|
304
|
+
kept.push(category)
|
|
305
|
+
category = null
|
|
306
|
+
}
|
|
307
|
+
kept.push(node)
|
|
263
308
|
}
|
|
309
|
+
return kept
|
|
264
310
|
}
|
|
265
311
|
|
|
266
312
|
// The option rows, in order: the `index` React keys them by.
|
|
267
|
-
const options = () =>
|
|
313
|
+
const options = () => visible().filter(isOption)
|
|
268
314
|
const selectable = () => options().filter((node) => node.getAttribute('aria-disabled') !== 'true')
|
|
269
315
|
|
|
270
|
-
const showEmpty = () => !loading &&
|
|
271
|
-
const isOpen = () => focused && !dismissed && !disabled && (loading ||
|
|
316
|
+
const showEmpty = () => !loading && visible().length === 0 && input.value !== '' && !!emptyText
|
|
317
|
+
const isOpen = () => focused && !dismissed && !disabled && (loading || visible().length > 0 || showEmpty())
|
|
272
318
|
|
|
273
319
|
function render() {
|
|
274
320
|
readOptions()
|
|
275
321
|
const open = isOpen()
|
|
276
322
|
|
|
277
323
|
root.classList.toggle('au-search-bar--open', open)
|
|
278
|
-
root.classList.toggle('au-search-bar--filled', input.value !== '')
|
|
324
|
+
root.classList.toggle('au-search-bar--filled', input.value !== '' && !disabled)
|
|
279
325
|
root.classList.toggle('au-search-bar--loading', loading)
|
|
280
326
|
list.classList.toggle('au-search-bar__results--open', open)
|
|
281
327
|
if (loading) list.setAttribute('aria-busy', 'true')
|
|
@@ -285,15 +331,16 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
285
331
|
else input.setAttribute('aria-activedescendant', optionId(activeIndex))
|
|
286
332
|
|
|
287
333
|
// The action at the right: spinner, clear or search.
|
|
288
|
-
|
|
334
|
+
// Disabled keeps the search icon: the spec has no Filled state with the X there.
|
|
335
|
+
const action = loading ? loadingAction : input.value !== '' && !disabled ? clearAction : searchAction
|
|
289
336
|
const current = (Array.from(control.children) as HTMLElement[]).find((child) => actions.has(child))
|
|
290
337
|
if (current !== action) {
|
|
291
338
|
if (current) current.replaceWith(action)
|
|
292
339
|
else control.appendChild(action)
|
|
293
340
|
}
|
|
294
341
|
|
|
295
|
-
// The rows: skeletons, the empty row, or the options.
|
|
296
|
-
const desired = loading ? skeletonNodes : showEmpty() ? [emptyNode] :
|
|
342
|
+
// The rows: skeletons, the empty row, or the (filtered) options.
|
|
343
|
+
const desired = loading ? skeletonNodes : showEmpty() ? [emptyNode] : visible()
|
|
297
344
|
options().forEach((node, index) => {
|
|
298
345
|
node.id = optionId(index)
|
|
299
346
|
node.classList.toggle(FOCUSED_CLASS, activeIndex === index)
|
|
@@ -304,6 +351,7 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
304
351
|
// The controller's own swap is not a change made by the page.
|
|
305
352
|
observer.takeRecords()
|
|
306
353
|
}
|
|
354
|
+
lastRendered = desired
|
|
307
355
|
|
|
308
356
|
// The `[activeIndex]` effect: scroll the highlighted row into view.
|
|
309
357
|
if (activeIndex !== null) list.querySelector<HTMLElement>(`.${FOCUSED_CLASS}`)?.scrollIntoView({ block: 'nearest' })
|
|
@@ -326,7 +374,7 @@ const showEmpty = !loading && rows.length === 0 && value !== '' && !!emptyText
|
|
|
326
374
|
|
|
327
375
|
function selectOption(node: HTMLElement) {
|
|
328
376
|
if (node.getAttribute('aria-disabled') === 'true') return
|
|
329
|
-
const label = node
|
|
377
|
+
const label = labelOf(node)
|
|
330
378
|
setValue(label)
|
|
331
379
|
emit('au:searchselect', { value: node.dataset.value ?? label, label })
|
|
332
380
|
activeIndex = null
|
|
@@ -606,7 +606,7 @@ const LogoTertiaryWhiteAC = ({ "data-testid": dataTestId }) => {
|
|
|
606
606
|
) });
|
|
607
607
|
};
|
|
608
608
|
const LogoBadgeWhiteStrokeCP = ({ "data-testid": dataTestId }) => {
|
|
609
|
-
return /* @__PURE__ */ jsx(Logo, { label: "Consumidor Positivo", "data-testid": dataTestId, children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", fill: "none", children: [
|
|
609
|
+
return /* @__PURE__ */ jsx(Logo, { label: "Consumidor Positivo", "data-testid": dataTestId, children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", children: [
|
|
610
610
|
/* @__PURE__ */ jsx("path", { fill: "#fff", d: "M6.216 4.08C6.216 2.061 7.794.6 9.725.6c1.93 0 3.508 1.462 3.508 3.48 0 2.016-1.552 3.519-3.522 3.519-1.97 0-3.496-1.476-3.496-3.52Z" }),
|
|
611
611
|
/* @__PURE__ */ jsx("path", { fill: "#0048DB", d: "M9.712 6.729c-1.527 0-2.636-1.115-2.636-2.65 0-1.534 1.138-2.61 2.648-2.61 1.51 0 2.648 1.122 2.648 2.61 0 1.489-1.12 2.65-2.661 2.65Z" }),
|
|
612
612
|
/* @__PURE__ */ jsx("path", { fill: "#fff", d: "M20.018 6.84a4.66 4.66 0 0 0-3.334-1.394c-1.26 0-2.444.495-3.334 1.393l-3.487 3.524-1.168-1.18A4.76 4.76 0 0 0 5.29 7.759c-1.809 0-3.431 1.03-4.235 2.69a4.456 4.456 0 0 0-.37 1.121 4.83 4.83 0 0 0 .957 3.92c.136.17.642.687.774.822l3.335 3.369A5.748 5.748 0 0 0 9.863 21.4a5.767 5.767 0 0 0 3.836-1.456.931.931 0 0 0 .114-.095l6.149-6.214c.91-.918 1.42-2.11 1.437-3.356a4.756 4.756 0 0 0-1.38-3.439h-.001Z" }),
|
|
@@ -621,6 +621,7 @@ const LogoBadgeWhiteStrokeAC = ({ "data-testid": dataTestId }) => {
|
|
|
621
621
|
xmlns: "http://www.w3.org/2000/svg",
|
|
622
622
|
width: "21",
|
|
623
623
|
height: "16",
|
|
624
|
+
viewBox: "0 0 21 16",
|
|
624
625
|
fill: "none",
|
|
625
626
|
children: [
|
|
626
627
|
/* @__PURE__ */ jsx(
|
|
@@ -743,4 +744,4 @@ export {
|
|
|
743
744
|
LogoTertiaryAC as r,
|
|
744
745
|
LogoTertiaryWhiteAC as s
|
|
745
746
|
};
|
|
746
|
-
//# sourceMappingURL=BadgeWhite-
|
|
747
|
+
//# sourceMappingURL=BadgeWhite-BjdKCzB3.js.map
|