@consumidor-positivo/aurora 3.0.1 → 3.1.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 (69) hide show
  1. package/assets/section-app/default-score-desktop.png +0 -0
  2. package/assets/section-app/default-score-mobile.png +0 -0
  3. package/assets/section-app/re-score-desktop.png +0 -0
  4. package/assets/section-app/re-score-mobile.png +0 -0
  5. package/astro/BadgeState/index.astro +4 -0
  6. package/astro/DropdownItem/index.astro +121 -0
  7. package/astro/EmptyState/index.astro +134 -0
  8. package/astro/FeedbackPage/index.astro +112 -0
  9. package/astro/FileUpload/Preview/index.astro +102 -0
  10. package/astro/FileUpload/Root/index.astro +205 -0
  11. package/astro/ListRow/index.astro +241 -0
  12. package/astro/SearchBar/index.astro +432 -0
  13. package/astro/SectionApp/index.astro +202 -0
  14. package/astro/form/Checkbox/Field/index.astro +1 -1
  15. package/astro/form/Field/ErrorMessage/index.astro +1 -1
  16. package/astro/form/Field/Input/index.astro +1 -1
  17. package/astro/form/Field/InputHolder/index.astro +1 -1
  18. package/astro/form/Field/Label/index.astro +1 -1
  19. package/astro/form/Field/Message/index.astro +1 -1
  20. package/astro/form/Field/Root/index.astro +1 -1
  21. package/astro/form/Field/TextArea/index.astro +1 -1
  22. package/dist/components/DropdownItem/index.d.ts +25 -0
  23. package/dist/components/DropdownItem/index.es.js +89 -0
  24. package/dist/components/DropdownItem/index.es.js.map +1 -0
  25. package/dist/components/DropdownItem/styles.css +1 -0
  26. package/dist/components/EmptyState/index.d.ts +37 -0
  27. package/dist/components/EmptyState/index.es.js +67 -0
  28. package/dist/components/EmptyState/index.es.js.map +1 -0
  29. package/dist/components/EmptyState/styles.css +1 -0
  30. package/dist/components/FeedbackPage/index.d.ts +26 -0
  31. package/dist/components/FeedbackPage/index.es.js +64 -0
  32. package/dist/components/FeedbackPage/index.es.js.map +1 -0
  33. package/dist/components/FeedbackPage/styles.css +1 -0
  34. package/dist/components/Field/styles.css +1 -1
  35. package/dist/components/Field/styles2.css +1 -1
  36. package/dist/components/FileUpload/Preview/index.d.ts +30 -0
  37. package/dist/components/FileUpload/Preview/index.es.js +48 -0
  38. package/dist/components/FileUpload/Preview/index.es.js.map +1 -0
  39. package/dist/components/FileUpload/Root/index.d.ts +40 -0
  40. package/dist/components/FileUpload/Root/index.es.js +132 -0
  41. package/dist/components/FileUpload/Root/index.es.js.map +1 -0
  42. package/dist/components/FileUpload/index.d.ts +10 -0
  43. package/dist/components/FileUpload/index.es.js +15 -0
  44. package/dist/components/FileUpload/index.es.js.map +1 -0
  45. package/dist/components/Footer/index.es.js +2 -74
  46. package/dist/components/Footer/index.es.js.map +1 -1
  47. package/dist/components/ListRow/index.d.ts +65 -0
  48. package/dist/components/ListRow/index.es.js +137 -0
  49. package/dist/components/ListRow/index.es.js.map +1 -0
  50. package/dist/components/ListRow/styles.css +1 -0
  51. package/dist/components/SearchBar/hooks.d.ts +36 -0
  52. package/dist/components/SearchBar/index.d.ts +3 -0
  53. package/dist/components/SearchBar/index.es.js +319 -0
  54. package/dist/components/SearchBar/index.es.js.map +1 -0
  55. package/dist/components/SearchBar/styles.css +1 -0
  56. package/dist/components/SearchBar/types.d.ts +41 -0
  57. package/dist/components/SectionApp/index.d.ts +39 -0
  58. package/dist/components/SectionApp/index.es.js +95 -0
  59. package/dist/components/SectionApp/index.es.js.map +1 -0
  60. package/dist/components/SectionApp/styles.css +1 -0
  61. package/dist/components/form/Checkbox/Field/index.es.js +1 -1
  62. package/dist/components/form/Field/index.es.js +1 -1
  63. package/dist/components/styles/styles.css +1 -0
  64. package/dist/data-CpVzbjKR.js +81 -0
  65. package/dist/data-CpVzbjKR.js.map +1 -0
  66. package/dist/main.d.ts +7 -0
  67. package/dist/main.es.js +14 -0
  68. package/dist/main.es.js.map +1 -1
  69. package/package.json +5 -3
@@ -0,0 +1,36 @@
1
+ import { SearchBarGroup, SearchBarOption, SearchBarProps } from './types';
2
+ export type SearchBarRow = {
3
+ kind: 'category';
4
+ key: string;
5
+ label: string;
6
+ } | {
7
+ kind: 'option';
8
+ key: string;
9
+ option: SearchBarOption;
10
+ index: number;
11
+ };
12
+ /**
13
+ * Flattens `options` (loose options and titled groups) into the rows the list
14
+ * renders. `index` counts only the options, which is what the keyboard walks.
15
+ */
16
+ export declare const getSearchBarRows: (options: Array<SearchBarOption | SearchBarGroup>) => SearchBarRow[];
17
+ type UseSearchBarArgs = Pick<SearchBarProps, 'value' | 'defaultValue' | 'options' | 'loading' | 'emptyText' | 'disabled' | 'onChange' | 'onSearch' | 'onSelect' | 'onClear'>;
18
+ export declare const useSearchBar: ({ value, defaultValue, options, loading, emptyText, disabled, onChange, onSearch, onSelect, onClear, }: UseSearchBarArgs) => {
19
+ value: string;
20
+ rows: SearchBarRow[];
21
+ isOpen: boolean;
22
+ showEmpty: boolean;
23
+ activeIndex: number | null;
24
+ inputRef: import('react').RefObject<HTMLInputElement>;
25
+ listRef: import('react').RefObject<HTMLUListElement>;
26
+ selectOption: (option: SearchBarOption) => void;
27
+ clear: () => void;
28
+ search: () => void;
29
+ handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
30
+ handleFocus: () => void;
31
+ handleBlur: () => void;
32
+ handleKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
33
+ handleListMouseDown: (event: React.MouseEvent) => void;
34
+ handleListMouseMove: () => void;
35
+ };
36
+ export {};
@@ -0,0 +1,3 @@
1
+ import { SearchBarProps } from './types';
2
+ export type { SearchBarProps, SearchBarOption, SearchBarGroup } from './types';
3
+ export declare const SearchBar: ({ label, placeholder, value, defaultValue, options, loading, emptyText, disabled, id, name, className, style, onChange, onSearch, onSelect, onClear, "data-testid": dataTestId, }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,319 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useRef, useEffect, useId } from "react";
3
+ import { c as classNames } from "../../index-BW2ZU5Hx.js";
4
+ import "../Icon/index.es.js";
5
+ import { IconSearch } from "../icons/IconSearch/index.es.js";
6
+ import { IconX } from "../icons/IconX/index.es.js";
7
+ import { DropdownItem } from "../DropdownItem/index.es.js";
8
+ import { Spinner } from "../Spinner/index.es.js";
9
+ import Field from "../form/Field/index.es.js";
10
+ import './styles.css';const _isGroup = (entry) => "category" in entry;
11
+ const getSearchBarRows = (options) => {
12
+ const rows = [];
13
+ let index = 0;
14
+ options.forEach((entry, position) => {
15
+ if (_isGroup(entry)) {
16
+ rows.push({ kind: "category", key: `category-${position}`, label: entry.category });
17
+ entry.options.forEach((option) => {
18
+ rows.push({ kind: "option", key: `option-${index}`, option, index });
19
+ index += 1;
20
+ });
21
+ return;
22
+ }
23
+ rows.push({ kind: "option", key: `option-${index}`, option: entry, index });
24
+ index += 1;
25
+ });
26
+ return rows;
27
+ };
28
+ const useSearchBar = ({
29
+ value,
30
+ defaultValue = "",
31
+ options = [],
32
+ loading = false,
33
+ emptyText = "",
34
+ disabled = false,
35
+ onChange,
36
+ onSearch,
37
+ onSelect,
38
+ onClear
39
+ }) => {
40
+ const [internalValue, setInternalValue] = useState(defaultValue);
41
+ const [focused, setFocused] = useState(false);
42
+ const [dismissed, setDismissed] = useState(false);
43
+ const [activeIndex, setActiveIndex] = useState(null);
44
+ const inputRef = useRef(null);
45
+ const listRef = useRef(null);
46
+ const isControlled = value !== void 0;
47
+ const currentValue = isControlled ? value : internalValue;
48
+ const rows = getSearchBarRows(options);
49
+ const selectable = rows.filter(
50
+ (row) => row.kind === "option" && !row.option.disabled
51
+ );
52
+ const showEmpty = !loading && rows.length === 0 && currentValue !== "" && !!emptyText;
53
+ const hasContent = loading || rows.length > 0 || showEmpty;
54
+ const isOpen = focused && !dismissed && !disabled && hasContent;
55
+ const rowsKey = rows.map((row) => row.kind === "option" ? `${row.key}:${row.option.value}` : row.key).join("|");
56
+ useEffect(() => {
57
+ setActiveIndex(null);
58
+ }, [loading, rowsKey]);
59
+ useEffect(() => {
60
+ var _a;
61
+ if (activeIndex === null || !listRef.current) return;
62
+ (_a = listRef.current.querySelector(".au-dropdown-item--focused")) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
63
+ }, [activeIndex]);
64
+ const _setValue = (next) => {
65
+ if (!isControlled) setInternalValue(next);
66
+ onChange == null ? void 0 : onChange(next);
67
+ };
68
+ const _moveActive = (direction) => {
69
+ if (loading || selectable.length === 0) return;
70
+ const positions = selectable.map((row) => row.index);
71
+ const current = activeIndex === null ? -1 : positions.indexOf(activeIndex);
72
+ const step = direction === "down" ? 1 : -1;
73
+ const start = current === -1 && direction === "up" ? positions.length : current;
74
+ const next = (start + step + positions.length) % positions.length;
75
+ setActiveIndex(positions[next]);
76
+ };
77
+ const selectOption = (option) => {
78
+ if (option.disabled) return;
79
+ _setValue(option.label);
80
+ onSelect == null ? void 0 : onSelect(option);
81
+ setActiveIndex(null);
82
+ setDismissed(true);
83
+ };
84
+ const clear = () => {
85
+ var _a;
86
+ _setValue("");
87
+ onClear == null ? void 0 : onClear();
88
+ setActiveIndex(null);
89
+ setDismissed(false);
90
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
91
+ };
92
+ const search = () => {
93
+ var _a;
94
+ onSearch == null ? void 0 : onSearch(currentValue);
95
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
96
+ };
97
+ const handleChange = (event) => {
98
+ _setValue(event.target.value);
99
+ setActiveIndex(null);
100
+ setDismissed(false);
101
+ };
102
+ const handleFocus = () => setFocused(true);
103
+ const handleBlur = () => {
104
+ setFocused(false);
105
+ setActiveIndex(null);
106
+ };
107
+ const handleKeyDown = (event) => {
108
+ if (disabled) return;
109
+ const _actions = {
110
+ ArrowDown: () => {
111
+ event.preventDefault();
112
+ setDismissed(false);
113
+ _moveActive("down");
114
+ },
115
+ ArrowUp: () => {
116
+ event.preventDefault();
117
+ setDismissed(false);
118
+ _moveActive("up");
119
+ },
120
+ Enter: () => {
121
+ const active = activeIndex === null ? void 0 : selectable.find((row) => row.index === activeIndex);
122
+ if (isOpen && active) {
123
+ event.preventDefault();
124
+ selectOption(active.option);
125
+ return;
126
+ }
127
+ onSearch == null ? void 0 : onSearch(currentValue);
128
+ },
129
+ Escape: () => {
130
+ event.preventDefault();
131
+ if (!isOpen) return;
132
+ setDismissed(true);
133
+ setActiveIndex(null);
134
+ }
135
+ };
136
+ if (Object.prototype.hasOwnProperty.call(_actions, event.key)) _actions[event.key]();
137
+ };
138
+ const handleListMouseDown = (event) => event.preventDefault();
139
+ const handleListMouseMove = () => {
140
+ if (activeIndex !== null) setActiveIndex(null);
141
+ };
142
+ return {
143
+ value: currentValue,
144
+ rows,
145
+ isOpen,
146
+ showEmpty,
147
+ activeIndex,
148
+ inputRef,
149
+ listRef,
150
+ selectOption,
151
+ clear,
152
+ search,
153
+ handleChange,
154
+ handleFocus,
155
+ handleBlur,
156
+ handleKeyDown,
157
+ handleListMouseDown,
158
+ handleListMouseMove
159
+ };
160
+ };
161
+ const SearchBar = ({
162
+ label,
163
+ placeholder = "Buscar",
164
+ value,
165
+ defaultValue,
166
+ options = [],
167
+ loading = false,
168
+ emptyText = "Nenhum resultado",
169
+ disabled = false,
170
+ id,
171
+ name,
172
+ className,
173
+ style,
174
+ onChange,
175
+ onSearch,
176
+ onSelect,
177
+ onClear,
178
+ "data-testid": dataTestId
179
+ }) => {
180
+ const generatedId = useId().replace(/[^a-zA-Z0-9]/g, "");
181
+ const inputId = id ?? `au-search-bar-${generatedId}`;
182
+ const labelId = `${inputId}-label`;
183
+ const listId = `${inputId}-listbox`;
184
+ const optionId = (index) => `${inputId}-option-${index}`;
185
+ const {
186
+ value: currentValue,
187
+ rows,
188
+ isOpen,
189
+ showEmpty,
190
+ activeIndex,
191
+ inputRef,
192
+ listRef,
193
+ selectOption,
194
+ clear,
195
+ search,
196
+ handleChange,
197
+ handleFocus,
198
+ handleBlur,
199
+ handleKeyDown,
200
+ handleListMouseDown,
201
+ handleListMouseMove
202
+ } = useSearchBar({ value, defaultValue, options, loading, emptyText, disabled, onChange, onSearch, onSelect, onClear });
203
+ const rootClasses = classNames("au-search-bar", {
204
+ "au-search-bar--open": isOpen,
205
+ "au-search-bar--filled": currentValue !== "",
206
+ "au-search-bar--loading": loading,
207
+ [className]: !!className
208
+ });
209
+ const listClasses = classNames("au-search-bar__results", {
210
+ "au-search-bar__results--open": isOpen
211
+ });
212
+ const _renderAction = () => {
213
+ if (loading) {
214
+ return /* @__PURE__ */ jsx("div", { className: "au-search-bar__action au-search-bar__action--loading", children: /* @__PURE__ */ jsx(Spinner, {}) });
215
+ }
216
+ if (currentValue !== "") {
217
+ return /* @__PURE__ */ jsx(
218
+ "button",
219
+ {
220
+ type: "button",
221
+ className: "au-search-bar__action au-search-bar__action--clear",
222
+ "aria-label": "Limpar busca",
223
+ disabled,
224
+ onMouseDown: handleListMouseDown,
225
+ onClick: clear,
226
+ children: /* @__PURE__ */ jsx(IconX, { size: "medium" })
227
+ }
228
+ );
229
+ }
230
+ return /* @__PURE__ */ jsx(
231
+ "button",
232
+ {
233
+ type: "button",
234
+ className: "au-search-bar__action au-search-bar__action--search",
235
+ "aria-label": "Buscar",
236
+ disabled,
237
+ onMouseDown: handleListMouseDown,
238
+ onClick: search,
239
+ children: /* @__PURE__ */ jsx(IconSearch, {})
240
+ }
241
+ );
242
+ };
243
+ const _renderRows = () => {
244
+ if (loading) {
245
+ return [0, 1, 2].map((index) => /* @__PURE__ */ jsx(DropdownItem, { label: "", state: "skeleton" }, `skeleton-${index}`));
246
+ }
247
+ if (showEmpty) {
248
+ return /* @__PURE__ */ jsx(DropdownItem, { label: emptyText, state: "empty" });
249
+ }
250
+ return rows.map(
251
+ (row) => row.kind === "category" ? /* @__PURE__ */ jsx(DropdownItem, { type: "category", label: row.label }, row.key) : /* @__PURE__ */ jsx(
252
+ DropdownItem,
253
+ {
254
+ id: optionId(row.index),
255
+ label: row.option.label,
256
+ description: row.option.description,
257
+ disabled: row.option.disabled,
258
+ selected: row.option.selected,
259
+ focused: activeIndex === row.index,
260
+ "data-value": row.option.value,
261
+ onClick: () => selectOption(row.option)
262
+ },
263
+ row.key
264
+ )
265
+ );
266
+ };
267
+ return /* @__PURE__ */ jsxs(Field.Root, { style, customclass: rootClasses, disabled, children: [
268
+ /* @__PURE__ */ jsx(Field.Label, { text: label, id: inputId, labelId, disabled, showOptionalLabel: false }),
269
+ /* @__PURE__ */ jsxs("div", { className: "au-search-bar__control", children: [
270
+ /* @__PURE__ */ jsx(
271
+ "input",
272
+ {
273
+ ref: inputRef,
274
+ className: "au-field__input au-search-bar__input",
275
+ type: "search",
276
+ role: "combobox",
277
+ id: inputId,
278
+ name,
279
+ value: currentValue,
280
+ placeholder,
281
+ disabled,
282
+ autoComplete: "off",
283
+ enterKeyHint: "search",
284
+ "aria-autocomplete": "list",
285
+ "aria-expanded": isOpen,
286
+ "aria-controls": listId,
287
+ "aria-label": label ? void 0 : placeholder,
288
+ "aria-activedescendant": activeIndex === null ? void 0 : optionId(activeIndex),
289
+ "data-testid": dataTestId,
290
+ onChange: handleChange,
291
+ onFocus: handleFocus,
292
+ onBlur: handleBlur,
293
+ onKeyDown: handleKeyDown
294
+ }
295
+ ),
296
+ _renderAction()
297
+ ] }),
298
+ /* @__PURE__ */ jsx(
299
+ "ul",
300
+ {
301
+ ref: listRef,
302
+ id: listId,
303
+ className: listClasses,
304
+ role: "listbox",
305
+ "aria-labelledby": label ? labelId : void 0,
306
+ "aria-label": label ? void 0 : "Resultados da busca",
307
+ "aria-busy": loading || void 0,
308
+ tabIndex: -1,
309
+ onMouseDown: handleListMouseDown,
310
+ onMouseMove: handleListMouseMove,
311
+ children: _renderRows()
312
+ }
313
+ )
314
+ ] });
315
+ };
316
+ export {
317
+ SearchBar
318
+ };
319
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/SearchBar/hooks.ts","../../../lib/components/SearchBar/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { SearchBarGroup, SearchBarOption, SearchBarProps } from './types'\n\nexport type SearchBarRow =\n | { kind: 'category'; key: string; label: string }\n | { kind: 'option'; key: string; option: SearchBarOption; index: number }\n\nconst _isGroup = (entry: SearchBarOption | SearchBarGroup): entry is SearchBarGroup =>\n 'category' in entry\n\n/**\n * Flattens `options` (loose options and titled groups) into the rows the list\n * renders. `index` counts only the options, which is what the keyboard walks.\n */\nexport const getSearchBarRows = (options: Array<SearchBarOption | SearchBarGroup>) => {\n const rows: SearchBarRow[] = []\n let index = 0\n options.forEach((entry, position) => {\n if (_isGroup(entry)) {\n rows.push({ kind: 'category', key: `category-${position}`, label: entry.category })\n entry.options.forEach((option) => {\n rows.push({ kind: 'option', key: `option-${index}`, option, index })\n index += 1\n })\n return\n }\n rows.push({ kind: 'option', key: `option-${index}`, option: entry, index })\n index += 1\n })\n return rows\n}\n\ntype UseSearchBarArgs = Pick<\n SearchBarProps,\n 'value' | 'defaultValue' | 'options' | 'loading' | 'emptyText' | 'disabled' | 'onChange' | 'onSearch' | 'onSelect' | 'onClear'\n>\n\nexport const useSearchBar = ({\n value,\n defaultValue = '',\n options = [],\n loading = false,\n emptyText = '',\n disabled = false,\n onChange,\n onSearch,\n onSelect,\n onClear,\n}: UseSearchBarArgs) => {\n const [internalValue, setInternalValue] = useState(defaultValue)\n const [focused, setFocused] = useState(false)\n // Escape closes the list until the person types or navigates again.\n const [dismissed, setDismissed] = useState(false)\n const [activeIndex, setActiveIndex] = useState<number | null>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const listRef = useRef<HTMLUListElement>(null)\n\n const isControlled = value !== undefined\n const currentValue = isControlled ? value : internalValue\n\n const rows = getSearchBarRows(options)\n const selectable = rows.filter(\n (row): row is Extract<SearchBarRow, { kind: 'option' }> =>\n row.kind === 'option' && !row.option.disabled,\n )\n const showEmpty = !loading && rows.length === 0 && currentValue !== '' && !!emptyText\n const hasContent = loading || rows.length > 0 || showEmpty\n const isOpen = focused && !dismissed && !disabled && hasContent\n\n // New rows (or the skeletons): the keyboard highlight restarts, so\n // `aria-activedescendant` never points at a row that is gone.\n const rowsKey = rows.map((row) => (row.kind === 'option' ? `${row.key}:${row.option.value}` : row.key)).join('|')\n useEffect(() => {\n setActiveIndex(null)\n }, [loading, rowsKey])\n\n // Scroll the row the keyboard reached into view.\n useEffect(() => {\n if (activeIndex === null || !listRef.current) return\n listRef.current\n .querySelector<HTMLElement>('.au-dropdown-item--focused')\n ?.scrollIntoView({ block: 'nearest' })\n }, [activeIndex])\n\n const _setValue = (next: string) => {\n if (!isControlled) setInternalValue(next)\n onChange?.(next)\n }\n\n const _moveActive = (direction: 'down' | 'up') => {\n if (loading || selectable.length === 0) return\n const positions = selectable.map((row) => row.index)\n const current = activeIndex === null ? -1 : positions.indexOf(activeIndex)\n const step = direction === 'down' ? 1 : -1\n const start = current === -1 && direction === 'up' ? positions.length : current\n const next = (start + step + positions.length) % positions.length\n setActiveIndex(positions[next])\n }\n\n const selectOption = (option: SearchBarOption) => {\n if (option.disabled) return\n _setValue(option.label)\n onSelect?.(option)\n setActiveIndex(null)\n setDismissed(true)\n }\n\n const clear = () => {\n _setValue('')\n onClear?.()\n setActiveIndex(null)\n setDismissed(false)\n inputRef.current?.focus()\n }\n\n const search = () => {\n onSearch?.(currentValue)\n inputRef.current?.focus()\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n _setValue(event.target.value)\n setActiveIndex(null)\n setDismissed(false)\n }\n\n const handleFocus = () => setFocused(true)\n\n const handleBlur = () => {\n setFocused(false)\n setActiveIndex(null)\n }\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return\n const _actions: Record<string, () => void> = {\n ArrowDown: () => {\n event.preventDefault()\n setDismissed(false)\n _moveActive('down')\n },\n ArrowUp: () => {\n event.preventDefault()\n setDismissed(false)\n _moveActive('up')\n },\n Enter: () => {\n const active = activeIndex === null ? undefined : selectable.find((row) => row.index === activeIndex)\n if (isOpen && active) {\n event.preventDefault()\n selectOption(active.option)\n return\n }\n onSearch?.(currentValue)\n },\n Escape: () => {\n // Always prevented: Chrome clears a `type=\"search\"` field on Escape.\n event.preventDefault()\n if (!isOpen) return\n setDismissed(true)\n setActiveIndex(null)\n },\n }\n // Own keys only: `event.key` could otherwise reach a prototype member.\n if (Object.prototype.hasOwnProperty.call(_actions, event.key)) _actions[event.key]()\n }\n\n // The list never takes the focus from the field: a click on a row selects\n // it with the field still focused, and moving the mouse drops the keyboard\n // highlight so only one row reads as the current one.\n const handleListMouseDown = (event: React.MouseEvent) => event.preventDefault()\n const handleListMouseMove = () => {\n if (activeIndex !== null) setActiveIndex(null)\n }\n\n return {\n value: currentValue,\n rows,\n isOpen,\n showEmpty,\n activeIndex,\n inputRef,\n listRef,\n selectOption,\n clear,\n search,\n handleChange,\n handleFocus,\n handleBlur,\n handleKeyDown,\n handleListMouseDown,\n handleListMouseMove,\n }\n}\n","import { useId } from 'react'\nimport classNames from 'classnames'\nimport { IconSearch, IconX } from '@components/icons'\nimport { DropdownItem } from '@components/DropdownItem'\nimport { Spinner } from '@components/Spinner'\nimport Field from '../form/Field'\nimport { SearchBarProps } from './types'\nimport { useSearchBar } from './hooks'\nimport './styles.scss'\n\nexport type { SearchBarProps, SearchBarOption, SearchBarGroup } from './types'\n\nexport const SearchBar = ({\n label,\n placeholder = 'Buscar',\n value,\n defaultValue,\n options = [],\n loading = false,\n emptyText = 'Nenhum resultado',\n disabled = false,\n id,\n name,\n className,\n style,\n onChange,\n onSearch,\n onSelect,\n onClear,\n 'data-testid': dataTestId,\n}: SearchBarProps) => {\n const generatedId = useId().replace(/[^a-zA-Z0-9]/g, '')\n const inputId = id ?? `au-search-bar-${generatedId}`\n const labelId = `${inputId}-label`\n const listId = `${inputId}-listbox`\n const optionId = (index: number) => `${inputId}-option-${index}`\n\n const {\n value: currentValue,\n rows,\n isOpen,\n showEmpty,\n activeIndex,\n inputRef,\n listRef,\n selectOption,\n clear,\n search,\n handleChange,\n handleFocus,\n handleBlur,\n handleKeyDown,\n handleListMouseDown,\n handleListMouseMove,\n } = useSearchBar({ value, defaultValue, options, loading, emptyText, disabled, onChange, onSearch, onSelect, onClear })\n\n const rootClasses = classNames('au-search-bar', {\n 'au-search-bar--open': isOpen,\n 'au-search-bar--filled': currentValue !== '',\n 'au-search-bar--loading': loading,\n [className!]: !!className,\n })\n\n const listClasses = classNames('au-search-bar__results', {\n 'au-search-bar__results--open': isOpen,\n })\n\n const _renderAction = () => {\n if (loading) {\n return (\n <div className=\"au-search-bar__action au-search-bar__action--loading\">\n <Spinner />\n </div>\n )\n }\n if (currentValue !== '') {\n return (\n <button\n type=\"button\"\n className=\"au-search-bar__action au-search-bar__action--clear\"\n aria-label=\"Limpar busca\"\n disabled={disabled}\n onMouseDown={handleListMouseDown}\n onClick={clear}>\n <IconX size=\"medium\" />\n </button>\n )\n }\n return (\n <button\n type=\"button\"\n className=\"au-search-bar__action au-search-bar__action--search\"\n aria-label=\"Buscar\"\n disabled={disabled}\n onMouseDown={handleListMouseDown}\n onClick={search}>\n <IconSearch />\n </button>\n )\n }\n\n const _renderRows = () => {\n if (loading) {\n return [0, 1, 2].map((index) => <DropdownItem key={`skeleton-${index}`} label=\"\" state=\"skeleton\" />)\n }\n if (showEmpty) {\n return <DropdownItem label={emptyText} state=\"empty\" />\n }\n return rows.map((row) =>\n row.kind === 'category' ? (\n <DropdownItem key={row.key} type=\"category\" label={row.label} />\n ) : (\n <DropdownItem\n key={row.key}\n id={optionId(row.index)}\n label={row.option.label}\n description={row.option.description}\n disabled={row.option.disabled}\n selected={row.option.selected}\n focused={activeIndex === row.index}\n data-value={row.option.value}\n onClick={() => selectOption(row.option)}\n />\n ),\n )\n }\n\n return (\n <Field.Root style={style} customclass={rootClasses} disabled={disabled}>\n <Field.Label text={label} id={inputId} labelId={labelId} disabled={disabled} showOptionalLabel={false} />\n <div className=\"au-search-bar__control\">\n <input\n ref={inputRef}\n className=\"au-field__input au-search-bar__input\"\n type=\"search\"\n role=\"combobox\"\n id={inputId}\n name={name}\n value={currentValue}\n placeholder={placeholder}\n disabled={disabled}\n autoComplete=\"off\"\n enterKeyHint=\"search\"\n aria-autocomplete=\"list\"\n aria-expanded={isOpen}\n aria-controls={listId}\n aria-label={label ? undefined : placeholder}\n aria-activedescendant={activeIndex === null ? undefined : optionId(activeIndex)}\n data-testid={dataTestId}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n {_renderAction()}\n </div>\n <ul\n ref={listRef}\n id={listId}\n className={listClasses}\n role=\"listbox\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={label ? undefined : 'Resultados da busca'}\n aria-busy={loading || undefined}\n tabIndex={-1}\n onMouseDown={handleListMouseDown}\n onMouseMove={handleListMouseMove}>\n {_renderRows()}\n </ul>\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,WAAW,CAAC,UAChB,cAAc;AAMT,MAAM,mBAAmB,CAAC,YAAqD;AACpF,QAAM,OAAuB,CAAA;AAC7B,MAAI,QAAQ;AACZ,UAAQ,QAAQ,CAAC,OAAO,aAAa;AACnC,QAAI,SAAS,KAAK,GAAG;AACnB,WAAK,KAAK,EAAE,MAAM,YAAY,KAAK,YAAY,QAAQ,IAAI,OAAO,MAAM,SAAA,CAAU;AAClF,YAAM,QAAQ,QAAQ,CAAC,WAAW;AAChC,aAAK,KAAK,EAAE,MAAM,UAAU,KAAK,UAAU,KAAK,IAAI,QAAQ,MAAA,CAAO;AACnE,iBAAS;AAAA,MACX,CAAC;AACD;AAAA,IACF;AACA,SAAK,KAAK,EAAE,MAAM,UAAU,KAAK,UAAU,KAAK,IAAI,QAAQ,OAAO,MAAA,CAAO;AAC1E,aAAS;AAAA,EACX,CAAC;AACD,SAAO;AACT;AAOO,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,eAAe;AAAA,EACf,UAAU,CAAA;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX;AA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AK;AAAA,QACL,IAAI;AAAA,QACJ,WAAW;AAAA,QACX,MAAK;AAAA,QACL,mBAAiB,QAAQ,UAAU;AAAA,QACnC,cAAY,QAAQ,SAAY;AAAA,QAChC,aAAW,WAAW;AAAA,QACtB,UAAU;AAAA,QACV,aAAa;AAAA,QACb,aAAa;AAAA,QACZ,UAAA,YAAA;AAAA,MAAY;AAAA,IAAA;AAAA,EACf,GACF;AAEJ;"}
@@ -0,0 +1 @@
1
+ .au-search-bar,.au-search-bar__control{position:relative}.au-search-bar .au-search-bar__input{padding-right:52px;border-color:#e2e4e9;line-height:24px;color:#16181d;-moz-appearance:none;appearance:none;-webkit-appearance:none}.au-search-bar .au-search-bar__input::-webkit-search-decoration,.au-search-bar .au-search-bar__input::-webkit-search-cancel-button,.au-search-bar .au-search-bar__input::-webkit-search-results-button,.au-search-bar .au-search-bar__input::-webkit-search-results-decoration{display:none;-webkit-appearance:none}.au-search-bar .au-search-bar__input::placeholder{color:#5e6573}.au-search-bar .au-search-bar__input:hover{border-color:#454a54}.au-search-bar .au-search-bar__input:focus{border-color:#0048db;outline:none}.au-search-bar .au-search-bar__input:active:not(:disabled){border-color:#0048db;outline:1px solid #0048db}.au-search-bar.au-field--disabled .au-search-bar__input{border-color:#5e6573}.au-search-bar--filled .au-search-bar__input{padding-right:56px}.au-search-bar__action{position:absolute;right:16px;top:50%;display:flex;width:20px;height:20px;padding:0;align-items:center;justify-content:center;border:0;border-radius:999px;background:none;color:#0048db;transform:translateY(-50%);cursor:pointer}.au-search-bar__action .au-icon,.au-search-bar__action .au-icon>svg{color:inherit}.au-search-bar__action:focus-visible{outline:2px solid #0048db;outline-offset:2px}.au-search-bar__action:disabled{color:#5e6573;cursor:not-allowed}.au-search-bar__action--clear{right:8px;width:40px;height:40px;padding:8px;color:#16181d;transition:background-color .3s ease}.au-search-bar__action--clear:hover,.au-search-bar__action--clear:focus-visible{background-color:#f2f5fc}.au-search-bar__action--clear:active{background-color:#dce8ff}.au-search-bar__action--loading{cursor:default}.au-search-bar__results{position:absolute;left:0;right:0;z-index:1;max-height:218px;margin:16px 0 0;padding:0;box-sizing:border-box;overflow-y:auto;list-style:none;background:#fff;border:1px solid #0048db;border-radius:8px;transform-origin:top left;transform:scaleY(0);opacity:0;visibility:hidden;transition:transform .2s,opacity .2s,visibility 0s .2s;scrollbar-width:thin;scrollbar-color:#16181d transparent}.au-search-bar__results::-webkit-scrollbar{width:12px}.au-search-bar__results::-webkit-scrollbar-thumb{background-color:#16181d;background-clip:padding-box;border:4px solid transparent;border-radius:8px}.au-search-bar__results::-webkit-scrollbar-track{background-color:transparent}.au-search-bar__results--open{transform:scaleY(1);opacity:1;visibility:visible;transition:transform .2s,opacity .2s}
@@ -0,0 +1,41 @@
1
+ export type SearchBarOption = {
2
+ value: string;
3
+ label: string;
4
+ /** Segunda linha abaixo do label (Dropdown Instance, Description=True). */
5
+ description?: string;
6
+ disabled?: boolean;
7
+ /** Marca a opção como a escolhida (Dropdown Instance, State=Selected). */
8
+ selected?: boolean;
9
+ };
10
+ /** Grupo de resultados com título (Dropdown Instance, Type=Category), como "Buscas recentes". */
11
+ export type SearchBarGroup = {
12
+ category: string;
13
+ options: SearchBarOption[];
14
+ };
15
+ export type SearchBarProps = {
16
+ label?: string;
17
+ /** @default 'Buscar' */
18
+ placeholder?: string;
19
+ /** Texto controlado. Sem ele, o campo guarda o próprio texto a partir de `defaultValue`. */
20
+ value?: string;
21
+ defaultValue?: string;
22
+ /** Resultados da busca, soltos ou em grupos com título. A lista abre com o campo em foco. */
23
+ options?: Array<SearchBarOption | SearchBarGroup>;
24
+ /** Spinner no lugar do ícone e lista de skeletons enquanto os resultados chegam (Figma: Loading). */
25
+ loading?: boolean;
26
+ /** Linha mostrada quando há texto e nenhum resultado (Figma: No Results). Vazio desliga. @default 'Nenhum resultado' */
27
+ emptyText?: string;
28
+ disabled?: boolean;
29
+ /** Id do `<input>`; sem ele, um id gerado. */
30
+ id?: string;
31
+ name?: string;
32
+ className?: string;
33
+ style?: React.CSSProperties;
34
+ /** Texto digitado, limpo ou preenchido por uma escolha. */
35
+ onChange?: (value: string) => void;
36
+ /** Enter sem opção destacada, ou clique na lupa. */
37
+ onSearch?: (value: string) => void;
38
+ onSelect?: (option: SearchBarOption) => void;
39
+ onClear?: () => void;
40
+ 'data-testid'?: string;
41
+ };
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ export type SectionAppType = 'default' | 'about-us' | 'step-by-step';
3
+ export type SectionAppSize = 'mobile' | 'desktop';
4
+ export type SectionAppCampaign = 'default-score' | 're-score';
5
+ export type SectionAppStores = {
6
+ googleplay?: string;
7
+ appstore?: string;
8
+ };
9
+ export type SectionAppQrCode = {
10
+ src: string;
11
+ alt?: string;
12
+ /** @default 'Ou escaneie o código para baixar nosso aplicativo.' */
13
+ text?: string;
14
+ };
15
+ export type SectionAppProps = {
16
+ /** Default (ações antes da lista, checks), About us (ações depois da lista) ou Step-by-step (números, até 6 itens). Figma: Section App, Type. */
17
+ type?: SectionAppType;
18
+ title: string;
19
+ description?: string;
20
+ /** Benefícios (Default e About us) ou passos (Step-by-step), um por linha. */
21
+ items: string[];
22
+ /** Links das lojas; os badges vêm da lib (os mesmos do Footer). Sem nenhum, a seção sai sem botões. */
23
+ stores?: SectionAppStores;
24
+ /** QR code ao lado dos botões. Só aparece no Desktop (a partir de 1024px). */
25
+ qrCode?: SectionAppQrCode;
26
+ /** Ícone do app, num quadro de 40x40 com raio 11,25 e fundo action (Partner Thumb no Figma). */
27
+ logo?: ReactNode;
28
+ /** Imagem da seção. Vence `campaign`. Sem as duas, fica o quadro vazio da spec. */
29
+ image?: ReactNode;
30
+ /** Uma das artes do Section App Image que vêm com a lib (Default Score ou Rê Score), na versão Mobile ou Desktop conforme o breakpoint ou `size`. */
31
+ campaign?: SectionAppCampaign;
32
+ /** Força o layout Mobile (empilhado, sem QR code) ou Desktop (lado a lado, com QR code). Sem ela, segue o breakpoint de 1024px. Figma: Size. */
33
+ size?: SectionAppSize;
34
+ /** Tag do título. @default 'h2' */
35
+ titleAs?: 'h1' | 'h2' | 'h3';
36
+ className?: string;
37
+ 'data-testid'?: string;
38
+ };
39
+ export declare const SectionApp: ({ type, title, description, items, stores, qrCode, logo, image, campaign, size, titleAs, className, "data-testid": dataTestId, }: SectionAppProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,95 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { c as classNames } from "../../index-BW2ZU5Hx.js";
3
+ import { Divider } from "../Divider/index.es.js";
4
+ import { Text } from "../Text/index.es.js";
5
+ import "react";
6
+ import "../Icon/index.es.js";
7
+ import { IconCheck } from "../icons/IconCheck/index.es.js";
8
+ import { a as storesMap } from "../../data-CpVzbjKR.js";
9
+ import defaultScoreDesktop from "@consumidor-positivo/aurora/assets/section-app/default-score-desktop.png";
10
+ import defaultScoreMobile from "@consumidor-positivo/aurora/assets/section-app/default-score-mobile.png";
11
+ import reScoreDesktop from "@consumidor-positivo/aurora/assets/section-app/re-score-desktop.png";
12
+ import reScoreMobile from "@consumidor-positivo/aurora/assets/section-app/re-score-mobile.png";
13
+ import './styles.css';const _imageUrl = (asset) => typeof asset === "string" ? asset : asset.src;
14
+ const CAMPAIGN_IMAGES = {
15
+ "default-score": { desktop: _imageUrl(defaultScoreDesktop), mobile: _imageUrl(defaultScoreMobile) },
16
+ "re-score": { desktop: _imageUrl(reScoreDesktop), mobile: _imageUrl(reScoreMobile) }
17
+ };
18
+ const DEFAULT_QR_TEXT = "Ou escaneie o código para baixar nosso aplicativo.";
19
+ const SectionApp = ({
20
+ type = "default",
21
+ title,
22
+ description,
23
+ items,
24
+ stores = {},
25
+ qrCode,
26
+ logo,
27
+ image,
28
+ campaign,
29
+ size,
30
+ titleAs = "h2",
31
+ className,
32
+ "data-testid": dataTestId
33
+ }) => {
34
+ const usedStores = Object.keys(stores).filter((store) => !!stores[store]).map((store) => ({ ...storesMap[store], url: stores[store] }));
35
+ const hasActions = usedStores.length > 0 || !!qrCode;
36
+ const numbered = type === "step-by-step";
37
+ const campaignImages = campaign ? CAMPAIGN_IMAGES[campaign] : void 0;
38
+ const hasImage = !!image || !!campaignImages;
39
+ const classes = classNames("au-section-app", `au-section-app--type-${type}`, {
40
+ [`au-section-app--size-${size}`]: !!size,
41
+ "au-section-app--with-logo": !!logo,
42
+ "au-section-app--with-image": hasImage,
43
+ [className]: !!className
44
+ });
45
+ const _renderCampaign = () => campaignImages && (size ? /* @__PURE__ */ jsx("img", { className: "au-section-app__campaign", src: campaignImages[size], alt: "", loading: "lazy", draggable: false }) : /* @__PURE__ */ jsxs("picture", { children: [
46
+ /* @__PURE__ */ jsx("source", { media: "(min-width: 1024px)", srcSet: campaignImages.desktop }),
47
+ /* @__PURE__ */ jsx("img", { className: "au-section-app__campaign", src: campaignImages.mobile, alt: "", loading: "lazy", draggable: false })
48
+ ] }));
49
+ const actions = hasActions && /* @__PURE__ */ jsxs("div", { className: "au-section-app__actions", children: [
50
+ usedStores.length > 0 && /* @__PURE__ */ jsx("div", { className: "au-section-app__stores", children: usedStores.map(({ icon, url, name }) => /* @__PURE__ */ jsx("a", { className: "au-section-app__store", href: url, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx("img", { src: icon, alt: name, width: 133, height: 42, loading: "lazy", draggable: false }) }, name)) }),
51
+ usedStores.length > 0 && qrCode && /* @__PURE__ */ jsx("span", { className: "au-section-app__actions-divider", "aria-hidden": "true" }),
52
+ qrCode && /* @__PURE__ */ jsxs("div", { className: "au-section-app__qr", children: [
53
+ /* @__PURE__ */ jsx(
54
+ "img",
55
+ {
56
+ className: "au-section-app__qr-image",
57
+ src: qrCode.src,
58
+ alt: qrCode.alt ?? "QR code para baixar o aplicativo",
59
+ width: 74,
60
+ height: 74,
61
+ loading: "lazy",
62
+ draggable: false
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsx(Text, { as: "p", variant: "body-medium", color: "secondary", className: "au-section-app__qr-text", children: qrCode.text ?? DEFAULT_QR_TEXT })
66
+ ] })
67
+ ] });
68
+ const list = /* @__PURE__ */ jsx("ol", { className: "au-section-app__list", children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "au-section-app__item", children: [
69
+ /* @__PURE__ */ jsx("span", { className: classNames("au-section-app__marker", { "au-section-app__marker--number": numbered }), "aria-hidden": "true", children: numbered ? index + 1 : /* @__PURE__ */ jsx(IconCheck, { size: "small" }) }),
70
+ /* @__PURE__ */ jsx("span", { className: "au-section-app__item-text", children: item })
71
+ ] }, index)) });
72
+ return /* @__PURE__ */ jsxs("section", { className: classes, "data-testid": dataTestId, children: [
73
+ /* @__PURE__ */ jsxs("div", { className: "au-section-app__content", children: [
74
+ logo && /* @__PURE__ */ jsx("div", { className: "au-section-app__logo", "aria-hidden": "true", children: logo }),
75
+ /* @__PURE__ */ jsxs("div", { className: "au-section-app__text", children: [
76
+ /* @__PURE__ */ jsx(Text, { as: titleAs, variant: "heading-medium", weight: "bold", className: "au-section-app__title", children: title }),
77
+ description && /* @__PURE__ */ jsx(Text, { as: "p", variant: "body-medium", color: "secondary", className: "au-section-app__description", children: description })
78
+ ] }),
79
+ type === "default" ? /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ actions,
81
+ hasActions && /* @__PURE__ */ jsx(Divider, { width: "small" }),
82
+ list
83
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
84
+ list,
85
+ hasActions && /* @__PURE__ */ jsx(Divider, { width: "small" }),
86
+ actions
87
+ ] })
88
+ ] }),
89
+ /* @__PURE__ */ jsx("div", { className: "au-section-app__image-area", children: /* @__PURE__ */ jsx("div", { className: classNames("au-section-app__image", { "au-section-app__image--filled": hasImage }), children: image ?? _renderCampaign() }) })
90
+ ] });
91
+ };
92
+ export {
93
+ SectionApp
94
+ };
95
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/SectionApp/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { Divider } from '@components/Divider'\nimport { Text } from '@components/Text'\nimport { IconCheck } from '@components/icons'\nimport { storesMap } from '../Footer/data'\nimport defaultScoreDesktop from '@consumidor-positivo/aurora/assets/section-app/default-score-desktop.png'\nimport defaultScoreMobile from '@consumidor-positivo/aurora/assets/section-app/default-score-mobile.png'\nimport reScoreDesktop from '@consumidor-positivo/aurora/assets/section-app/re-score-desktop.png'\nimport reScoreMobile from '@consumidor-positivo/aurora/assets/section-app/re-score-mobile.png'\nimport './styles.scss'\n\nexport type SectionAppType = 'default' | 'about-us' | 'step-by-step'\nexport type SectionAppSize = 'mobile' | 'desktop'\nexport type SectionAppCampaign = 'default-score' | 're-score'\n\n// The Section App Image of the Figma, one per campaign and size. The files\n// are published with the package (`assets/section-app/`) and resolved by the\n// consumer's bundler: Vite hands a URL back, Astro (a React island in an\n// Astro site) hands metadata whose `.src` is the URL.\ntype ImportedImage = string | { src: string }\nconst _imageUrl = (asset: ImportedImage): string => (typeof asset === 'string' ? asset : asset.src)\nconst CAMPAIGN_IMAGES: Record<SectionAppCampaign, Record<SectionAppSize, string>> = {\n 'default-score': { desktop: _imageUrl(defaultScoreDesktop), mobile: _imageUrl(defaultScoreMobile) },\n 're-score': { desktop: _imageUrl(reScoreDesktop), mobile: _imageUrl(reScoreMobile) },\n}\n\nexport type SectionAppStores = {\n googleplay?: string\n appstore?: string\n}\n\nexport type SectionAppQrCode = {\n src: string\n alt?: string\n /** @default 'Ou escaneie o código para baixar nosso aplicativo.' */\n text?: string\n}\n\nexport type SectionAppProps = {\n /** Default (ações antes da lista, checks), About us (ações depois da lista) ou Step-by-step (números, até 6 itens). Figma: Section App, Type. */\n type?: SectionAppType\n title: string\n description?: string\n /** Benefícios (Default e About us) ou passos (Step-by-step), um por linha. */\n items: string[]\n /** Links das lojas; os badges vêm da lib (os mesmos do Footer). Sem nenhum, a seção sai sem botões. */\n stores?: SectionAppStores\n /** QR code ao lado dos botões. Só aparece no Desktop (a partir de 1024px). */\n qrCode?: SectionAppQrCode\n /** Ícone do app, num quadro de 40x40 com raio 11,25 e fundo action (Partner Thumb no Figma). */\n logo?: ReactNode\n /** Imagem da seção. Vence `campaign`. Sem as duas, fica o quadro vazio da spec. */\n image?: ReactNode\n /** Uma das artes do Section App Image que vêm com a lib (Default Score ou Rê Score), na versão Mobile ou Desktop conforme o breakpoint ou `size`. */\n campaign?: SectionAppCampaign\n /** Força o layout Mobile (empilhado, sem QR code) ou Desktop (lado a lado, com QR code). Sem ela, segue o breakpoint de 1024px. Figma: Size. */\n size?: SectionAppSize\n /** Tag do título. @default 'h2' */\n titleAs?: 'h1' | 'h2' | 'h3'\n className?: string\n 'data-testid'?: string\n}\n\nconst DEFAULT_QR_TEXT = 'Ou escaneie o código para baixar nosso aplicativo.'\n\nexport const SectionApp = ({\n type = 'default',\n title,\n description,\n items,\n stores = {},\n qrCode,\n logo,\n image,\n campaign,\n size,\n titleAs = 'h2',\n className,\n 'data-testid': dataTestId,\n}: SectionAppProps) => {\n const usedStores = (Object.keys(stores) as Array<keyof SectionAppStores>)\n .filter((store) => !!stores[store])\n .map((store) => ({ ...storesMap[store], url: stores[store]! }))\n const hasActions = usedStores.length > 0 || !!qrCode\n const numbered = type === 'step-by-step'\n\n const campaignImages = campaign ? CAMPAIGN_IMAGES[campaign] : undefined\n const hasImage = !!image || !!campaignImages\n\n const classes = classNames('au-section-app', `au-section-app--type-${type}`, {\n [`au-section-app--size-${size}`]: !!size,\n 'au-section-app--with-logo': !!logo,\n 'au-section-app--with-image': hasImage,\n [className!]: !!className,\n })\n\n // The campaign art is decorative (the text says it all), so `alt=\"\"`.\n // Without `size`, the browser picks the Desktop file from 1024px, the same\n // breakpoint the layout uses.\n const _renderCampaign = () =>\n campaignImages &&\n (size ? (\n <img className=\"au-section-app__campaign\" src={campaignImages[size]} alt=\"\" loading=\"lazy\" draggable={false} />\n ) : (\n <picture>\n <source media=\"(min-width: 1024px)\" srcSet={campaignImages.desktop} />\n <img className=\"au-section-app__campaign\" src={campaignImages.mobile} alt=\"\" loading=\"lazy\" draggable={false} />\n </picture>\n ))\n\n const actions = hasActions && (\n <div className=\"au-section-app__actions\">\n {usedStores.length > 0 && (\n <div className=\"au-section-app__stores\">\n {usedStores.map(({ icon, url, name }) => (\n <a key={name} className=\"au-section-app__store\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">\n <img src={icon} alt={name} width={133} height={42} loading=\"lazy\" draggable={false} />\n </a>\n ))}\n </div>\n )}\n {usedStores.length > 0 && qrCode && <span className=\"au-section-app__actions-divider\" aria-hidden=\"true\" />}\n {qrCode && (\n <div className=\"au-section-app__qr\">\n <img\n className=\"au-section-app__qr-image\"\n src={qrCode.src}\n alt={qrCode.alt ?? 'QR code para baixar o aplicativo'}\n width={74}\n height={74}\n loading=\"lazy\"\n draggable={false}\n />\n <Text as=\"p\" variant=\"body-medium\" color=\"secondary\" className=\"au-section-app__qr-text\">\n {qrCode.text ?? DEFAULT_QR_TEXT}\n </Text>\n </div>\n )}\n </div>\n )\n\n const list = (\n <ol className=\"au-section-app__list\">\n {items.map((item, index) => (\n <li key={index} className=\"au-section-app__item\">\n <span className={classNames('au-section-app__marker', { 'au-section-app__marker--number': numbered })} aria-hidden=\"true\">\n {numbered ? index + 1 : <IconCheck size=\"small\" />}\n </span>\n <span className=\"au-section-app__item-text\">{item}</span>\n </li>\n ))}\n </ol>\n )\n\n return (\n <section className={classes} data-testid={dataTestId}>\n <div className=\"au-section-app__content\">\n {logo && (\n <div className=\"au-section-app__logo\" aria-hidden=\"true\">\n {logo}\n </div>\n )}\n <div className=\"au-section-app__text\">\n <Text as={titleAs} variant=\"heading-medium\" weight=\"bold\" className=\"au-section-app__title\">\n {title}\n </Text>\n {description && (\n <Text as=\"p\" variant=\"body-medium\" color=\"secondary\" className=\"au-section-app__description\">\n {description}\n </Text>\n )}\n </div>\n {type === 'default' ? (\n <>\n {actions}\n {hasActions && <Divider width=\"small\" />}\n {list}\n </>\n ) : (\n <>\n {list}\n {hasActions && <Divider width=\"small\" />}\n {actions}\n </>\n )}\n </div>\n <div className=\"au-section-app__image-area\">\n <div className={classNames('au-section-app__image', { 'au-section-app__image--filled': hasImage })}>\n {image ?? _renderCampaign()}\n </div>\n </div>\n </section>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,MAAM,YAAY,CAAC,UAAkC,OAAO,UAAU,WAAW,QAAQ,MAAM;AAC/F,MAAM,kBAA8E;AAAA,EAClF,iBAAiB,EAAE,SAAS,UAAU,mBAAmB,GAAG,QAAQ,UAAU,kBAAkB,EAAA;AAAA,EAChG,YAAY,EAAE,SAAS,UAAU,cAAc,GAAG,QAAQ,UAAU,aAAa,EAAA;AACnF;AAuCA,MAAM,kBAAkB;AAEjB,MAAM,aAAa,CAAC;AAAA,EACzB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAA;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,eAAe;AACjB,MAAuB;AACrB,QAAM,aAAc,OAAO,KAAK,MAAM,EACnC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,KAAK,CAAC,EACjC,IAAI,CAAC,WAAW,EAAE,GAAG,UAAU,KAAK,GAAG,KAAK,OAAO,KAAK,EAAA,EAAK;AAChE,QAAM,aAAa,WAAW,SAAS,KAAK,CAAC,CAAC;AAC9C,QAAM,WAAW,SAAS;AAE1B,QAAM,iBAAiB,WAAW,gBAAgB,QAAQ,IAAI;AAC9D,QAAM,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC;AAE9B,QAAM,UAAU,WAAW,kBAAkB,wBAAwB,IAAI,IAAI;AAAA,IAC3E,CAAC,wBAAwB,IAAI,EAAE,GAAG,CAAC,CAAC;AAAA,IACpC,6BAA6B,CAAC,CAAC;AAAA,IAC/B,8BAA8B;AAAA,IAC9B,CAAC,SAAU,GAAG,CAAC,CAAC;AA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,GACZ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1 @@
1
+ .au-section-app{display:flex;flex-direction:column;width:100%;box-sizing:border-box;background-color:#fff;font-family:"Source Sans 3",sans-serif;text-align:start}.au-section-app__content{display:flex;flex-direction:column;align-items:flex-start;gap:24px;padding:32px 24px 0;box-sizing:border-box}.au-section-app__logo{display:flex;align-items:center;justify-content:center;width:40px;height:40px;overflow:hidden;border-radius:11.25px;background-color:#0048db;color:#fff}.au-section-app__logo img,.au-section-app__logo svg{display:block;width:100%;height:100%}.au-section-app__text{display:flex;flex-direction:column;gap:16px}.au-section-app__title{margin:0;color:#16181d}.au-section-app__description{margin:0;color:#454a54}.au-section-app__actions{display:flex;flex-direction:column;gap:24px}.au-section-app__stores{display:flex;flex-wrap:wrap;gap:8px}.au-section-app__store{display:block;width:133px;height:42px}.au-section-app__store img{display:block;width:100%;height:100%;object-fit:contain}.au-section-app__store:hover{opacity:.6}.au-section-app__actions-divider,.au-section-app__qr{display:none}.au-section-app__actions-divider{width:0;height:48px;border-left:1px solid #e2e4e9}.au-section-app__qr{align-items:center;gap:8px}.au-section-app__qr-image{display:block;flex:none;width:74px;height:74px}.au-section-app__qr-text{margin:0;max-width:180px;color:#454a54}.au-section-app__list{display:flex;flex-direction:column;gap:16px;margin:0;padding:0;list-style:none}.au-section-app__item{display:flex;align-items:flex-start;gap:16px}.au-section-app__marker{display:flex;flex:none;align-items:center;justify-content:center;width:24px;height:24px;border-radius:999px;background-color:#f6f7fa;color:#454a54;font-size:14px;font-weight:600;line-height:22px}.au-section-app__marker .au-icon,.au-section-app__marker .au-icon>svg{color:#0048db}.au-section-app__item-text{font-size:14px;font-weight:400;line-height:22px;color:#454a54}.au-section-app__image-area{display:flex;padding:24px;box-sizing:border-box}.au-section-app__image{display:flex;align-items:center;justify-content:center;width:272px;max-width:100%;height:368px;padding:8px;box-sizing:border-box;overflow:hidden;border:1px solid #e2e4e9;border-radius:8px;background-color:#f6f7fa}.au-section-app__image img,.au-section-app__image svg{display:block;width:100%;height:100%;object-fit:cover}.au-section-app__image picture{display:contents}.au-section-app__image--filled{padding:0;border:0;border-radius:0;background:none}.au-section-app--size-desktop{flex-direction:row;align-items:stretch;gap:24px}.au-section-app--size-desktop .au-section-app__content{flex:1 1 717px;max-width:717px;padding:64px 32px 64px 83px}.au-section-app--size-desktop .au-section-app__actions{flex-direction:row;align-items:center}.au-section-app--size-desktop .au-section-app__actions-divider{display:block}.au-section-app--size-desktop .au-section-app__qr{display:flex}.au-section-app--size-desktop .au-section-app__image-area{flex:1 1 auto;align-items:center;justify-content:center;padding:64px 83px 64px 32px}.au-section-app--size-desktop .au-section-app__image{width:534px;height:446px}@media(min-width:1024px){.au-section-app:not(.au-section-app--size-mobile){flex-direction:row;align-items:stretch;gap:24px}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__content{flex:1 1 717px;max-width:717px;padding:64px 32px 64px 83px}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__actions{flex-direction:row;align-items:center}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__actions-divider{display:block}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__qr{display:flex}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__image-area{flex:1 1 auto;align-items:center;justify-content:center;padding:64px 83px 64px 32px}.au-section-app:not(.au-section-app--size-mobile) .au-section-app__image{width:534px;height:446px}}
@@ -6,7 +6,7 @@ import { IconCheck } from "../../../icons/IconCheck/index.es.js";
6
6
  import { COLOR_NEUTRAL_00 } from "../../../../astro/tokens/index.es.js";
7
7
  import Field from "../../Field/index.es.js";
8
8
  import { Conditional } from "../../../misc/Conditional/index.es.js";
9
- import '../../../Field/styles.css';const CheckboxField = ({
9
+ import '../../../Field/styles2.css';const CheckboxField = ({
10
10
  label,
11
11
  error,
12
12
  errorMessage,
@@ -5,7 +5,7 @@ import { FieldInputHolder } from "./InputHolder/index.es.js";
5
5
  import { FieldLabel } from "./Label/index.es.js";
6
6
  import { FieldRoot } from "./Root/index.es.js";
7
7
  import { FieldTextArea } from "./TextArea/index.es.js";
8
- import '../../Field/styles2.css';const Field = {
8
+ import '../../Field/styles.css';const Field = {
9
9
  Root: FieldRoot,
10
10
  Input: FieldInput,
11
11
  InputHolder: FieldInputHolder,