@consumidor-positivo/aurora 3.2.0 → 3.2.2
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/Carousel/Root/index.astro +3 -1
- package/astro/FileUpload/Preview/index.astro +33 -11
- package/astro/FileUpload/Root/index.astro +6 -5
- package/dist/components/BadgeInfo/styles.css +1 -1
- package/dist/components/Button/styles.css +1 -1
- package/dist/components/Carousel/styles.css +1 -1
- package/dist/components/FileUpload/Preview/index.d.ts +15 -4
- package/dist/components/FileUpload/Preview/index.es.js +18 -4
- package/dist/components/FileUpload/Preview/index.es.js.map +1 -1
- package/dist/components/FileUpload/Root/index.d.ts +2 -2
- package/dist/components/FileUpload/Root/index.es.js +2 -2
- package/dist/components/FileUpload/Root/index.es.js.map +1 -1
- package/dist/components/PasswordField/styles.css +1 -1
- package/dist/components/styles/styles.css +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,9 @@ export type CarouselItemsPerView = number | { mobile?: number; desktop?: number
|
|
|
23
23
|
export type Props = Omit<HTMLAttributes<'div'>, 'draggable' | 'style'> & {
|
|
24
24
|
/**
|
|
25
25
|
* How the position is shown (Figma: Type). `text` writes "Página 1 de 2"
|
|
26
|
-
* between the arrows; `pin` replaces it with dots
|
|
26
|
+
* between the arrows; `pin` replaces it with dots. The arrows sit at the
|
|
27
|
+
* edges of the row (on desktop the position goes to the start and both
|
|
28
|
+
* arrows to the end); `only-pin` has no arrows.
|
|
27
29
|
*/
|
|
28
30
|
navigation?: CarouselNavigation
|
|
29
31
|
/** White arrows, text and pins for dark backgrounds (Figma: Negative). */
|
|
@@ -4,6 +4,7 @@ import LinkButton from '../../LinkButton/index.astro'
|
|
|
4
4
|
import ProgressBar from '../../ProgressBar/index.astro'
|
|
5
5
|
import IconPaperclip from '../../icons/default/IconPaperclip.astro'
|
|
6
6
|
import IconTrash2 from '../../icons/default/IconTrash2.astro'
|
|
7
|
+
import IconX from '../../icons/default/IconX.astro'
|
|
7
8
|
import '../../../dist/components/styles/styles.css'
|
|
8
9
|
|
|
9
10
|
export type FileUploadPreviewLink = {
|
|
@@ -14,8 +15,9 @@ export type FileUploadPreviewLink = {
|
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Same markup as the React `FileUpload.Preview`. `icon` is the `icon` slot.
|
|
17
|
-
* `onRemove` has no counterpart: `removable` renders the remove button
|
|
18
|
-
*
|
|
18
|
+
* `onRemove` has no counterpart: `removable` renders the remove button (the
|
|
19
|
+
* cancel X while there is `progress`), which carries
|
|
20
|
+
* `data-au-file-upload="remove"` for the page's own `<script>`; the
|
|
19
21
|
* link has no `onClick` either, so give it an `href` or listen on
|
|
20
22
|
* `.au-file-upload-preview__link`. Every other HTML attribute lands on the
|
|
21
23
|
* root `div`.
|
|
@@ -27,16 +29,27 @@ export type Props = HTMLAttributes<'div'> & {
|
|
|
27
29
|
description?: string
|
|
28
30
|
/** Mensagem de erro abaixo da linha, com o motivo e o próximo passo; liga o estado Error. Figma: Error Message, State=Error. */
|
|
29
31
|
error?: string
|
|
30
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Percentual do envio, de 0 a 100: a linha entra no estado Enviando, com a Percentage Bar abaixo
|
|
34
|
+
* (rótulo e percentual) e só o X de cancelar à direita; o link e a lixeira aparecem quando o envio
|
|
35
|
+
* termina. Figma: Show Progress.
|
|
36
|
+
*/
|
|
31
37
|
progress?: number
|
|
38
|
+
/** Rótulo à esquerda da barra durante o envio. */
|
|
39
|
+
progressLabel?: string
|
|
32
40
|
/** Esconde o quadro do ícone. Figma: Show Leading Icon=False. */
|
|
33
41
|
hideIcon?: boolean
|
|
34
|
-
/** Link Button small à direita ("Ver"). Figma: Show Link. */
|
|
42
|
+
/** Link Button small à direita ("Ver"), só com o arquivo já enviado. Figma: Show Link. */
|
|
35
43
|
link?: FileUploadPreviewLink
|
|
36
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Mostra o botão de remover o arquivo enviado (lixeira) ou de cancelar o envio em andamento (X,
|
|
46
|
+
* enquanto há `progress`). Figma: Show Button.
|
|
47
|
+
*/
|
|
37
48
|
removable?: boolean
|
|
38
49
|
/** `aria-label` do botão de remover. */
|
|
39
50
|
removeLabel?: string
|
|
51
|
+
/** `aria-label` do botão de cancelar, durante o envio. */
|
|
52
|
+
cancelLabel?: string
|
|
40
53
|
}
|
|
41
54
|
|
|
42
55
|
const {
|
|
@@ -44,15 +57,19 @@ const {
|
|
|
44
57
|
description,
|
|
45
58
|
error,
|
|
46
59
|
progress,
|
|
60
|
+
progressLabel = 'Enviando...',
|
|
47
61
|
hideIcon = false,
|
|
48
62
|
link,
|
|
49
63
|
removable = false,
|
|
50
64
|
removeLabel = 'Remover arquivo',
|
|
65
|
+
cancelLabel = 'Cancelar envio',
|
|
51
66
|
class: className,
|
|
52
67
|
...rest
|
|
53
68
|
} = Astro.props
|
|
54
69
|
|
|
55
70
|
const hasProgress = progress !== undefined
|
|
71
|
+
// While sending, the only action is to cancel: the link waits for the file.
|
|
72
|
+
const showLink = !!link && !hasProgress
|
|
56
73
|
const hasCustomIcon = Astro.slots.has('icon')
|
|
57
74
|
---
|
|
58
75
|
|
|
@@ -77,14 +94,19 @@ const hasCustomIcon = Astro.slots.has('icon')
|
|
|
77
94
|
{description && <span class="au-file-upload-preview__description">{description}</span>}
|
|
78
95
|
</span>
|
|
79
96
|
{
|
|
80
|
-
(
|
|
97
|
+
(showLink || removable) && (
|
|
81
98
|
<span class="au-file-upload-preview__actions">
|
|
82
|
-
{
|
|
83
|
-
<LinkButton as={link
|
|
99
|
+
{showLink && (
|
|
100
|
+
<LinkButton as={link!.href ? 'a' : 'button'} href={link!.href} target={link!.target} size="small" class="au-file-upload-preview__link">{link!.label}</LinkButton>
|
|
84
101
|
)}
|
|
102
|
+
{showLink && removable && <span class="au-file-upload-preview__actions-divider" aria-hidden="true" />}
|
|
85
103
|
{removable && (
|
|
86
|
-
<button
|
|
87
|
-
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class:list={['au-file-upload-preview__remove', hasProgress && 'au-file-upload-preview__remove--cancel']}
|
|
107
|
+
aria-label={hasProgress ? cancelLabel : removeLabel}
|
|
108
|
+
data-au-file-upload="remove">
|
|
109
|
+
{hasProgress ? <IconX /> : <IconTrash2 />}
|
|
88
110
|
</button>
|
|
89
111
|
)}
|
|
90
112
|
</span>
|
|
@@ -95,7 +117,7 @@ const hasCustomIcon = Astro.slots.has('icon')
|
|
|
95
117
|
{
|
|
96
118
|
hasProgress && (
|
|
97
119
|
<div class="au-file-upload-preview__progress">
|
|
98
|
-
<ProgressBar percentage={progress} stepName={
|
|
120
|
+
<ProgressBar percentage={progress} stepName={progressLabel} />
|
|
99
121
|
</div>
|
|
100
122
|
)
|
|
101
123
|
}
|
|
@@ -11,7 +11,8 @@ export type FileUploadType = 'drag-drop' | 'button'
|
|
|
11
11
|
* the root emits `au:fileuploadchange` (`detail: { files: File[] }`) when
|
|
12
12
|
* files are picked in the dialog or dropped on the area, and the native
|
|
13
13
|
* `change` of the input still fires for the dialog. `children` is the
|
|
14
|
-
* default slot (the `FileUpload.Preview` rows). The
|
|
14
|
+
* default slot (the `FileUpload.Preview` rows). The Only Button's button
|
|
15
|
+
* opens the dialog through the controller; the Drag & Drop has no button. The `data-drop-title` on the
|
|
15
16
|
* root is wiring for the controller, which removes it when it starts. Every
|
|
16
17
|
* other HTML attribute lands on the root `div`.
|
|
17
18
|
*/
|
|
@@ -31,8 +32,8 @@ export type Props = HTMLAttributes<'div'> & {
|
|
|
31
32
|
/** Formatos aceitos e tamanho máximo, antes do envio. Sem ele o texto some (Show Helper Text=False). */
|
|
32
33
|
helperText?: string
|
|
33
34
|
/**
|
|
34
|
-
* Rótulo do botão Outlined
|
|
35
|
-
* é o
|
|
35
|
+
* Rótulo do botão Outlined do Only Button ('Anexar arquivo' por padrão). Ignorado no Drag & Drop:
|
|
36
|
+
* ali a área inteira é o controle e não há botão dentro dela.
|
|
36
37
|
*/
|
|
37
38
|
buttonLabel?: string
|
|
38
39
|
/**
|
|
@@ -71,7 +72,7 @@ const {
|
|
|
71
72
|
const inputId = id ?? `au-file-upload-${crypto.randomUUID().slice(0, 8)}`
|
|
72
73
|
const isDragDrop = type === 'drag-drop'
|
|
73
74
|
const resolvedTitle = title ?? DEFAULT_TITLE[type]
|
|
74
|
-
const resolvedButtonLabel = isDragDrop ?
|
|
75
|
+
const resolvedButtonLabel = isDragDrop ? undefined : buttonLabel ?? 'Anexar arquivo'
|
|
75
76
|
const hasText = !hideTitle || !!helperText
|
|
76
77
|
const hasFiles = Astro.slots.has('default')
|
|
77
78
|
---
|
|
@@ -118,7 +119,7 @@ const hasFiles = Astro.slots.has('default')
|
|
|
118
119
|
{
|
|
119
120
|
resolvedButtonLabel && (
|
|
120
121
|
<Button type="outlined" size="medium" disabled={disabled} class="au-file-upload__button">
|
|
121
|
-
|
|
122
|
+
<IconUpload />
|
|
122
123
|
{resolvedButtonLabel}
|
|
123
124
|
</Button>
|
|
124
125
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-badgeInfo{font-family:"Source Sans 3",sans-serif;display:flex;justify-content:center;border-radius:8px;width:fit-content;height:26px;padding:4px 8px}.au-badgeInfo__content{display:flex;gap:4px;justify-content:center;align-items:center}.au-badgeInfo__content-icon .au-icon,.au-badgeInfo__content-icon .au-icon>svg{width:16px;height:16px}.au-badgeInfo__content-support-text{color:#313131;font-size:12px;font-weight:600}.au-badgeInfo--color-primary.au-badgeInfo--info{background-color:#eee6ff}.au-badgeInfo--color-primary.au-badgeInfo--success{background-color:#e5fff0}.au-badgeInfo--color-primary.au-badgeInfo--error{background-color:#ffe5e5}.au-badgeInfo--color-primary.au-badgeInfo--warning{background-color:#fff0e6}.au-badgeInfo--color-primary.au-badgeInfo--progress{background-color:#f1fcff}.au-badgeInfo--color-primary.au-badgeInfo--neutral{background-color:#e2e4e9}.au-badgeInfo--color-secondary.au-badgeInfo--info{background-color:#d4bfff}.au-badgeInfo--color-secondary.au-badgeInfo--success{background-color:#a1e5bd}.au-badgeInfo--color-secondary.au-badgeInfo--error{background-color:#ffbfbf}.au-badgeInfo--color-secondary.au-badgeInfo--warning{background-color:#ffdabf}.au-badgeInfo--color-secondary.au-badgeInfo--progress{background-color:#ccf3ff}.au-badgeInfo--color-secondary.au-badgeInfo--neutral{background-color:#c4c9d4}
|
|
1
|
+
.au-badgeInfo{font-family:"Source Sans 3",sans-serif;display:flex;justify-content:center;border-radius:8px;width:fit-content;min-height:26px;padding:4px 8px}.au-badgeInfo__content{display:flex;gap:4px;justify-content:center;align-items:center}.au-badgeInfo__content-icon .au-icon,.au-badgeInfo__content-icon .au-icon>svg{width:16px;height:16px}.au-badgeInfo__content-support-text{color:#313131;font-size:12px;font-weight:600}.au-badgeInfo--color-primary.au-badgeInfo--info{background-color:#eee6ff}.au-badgeInfo--color-primary.au-badgeInfo--success{background-color:#e5fff0}.au-badgeInfo--color-primary.au-badgeInfo--error{background-color:#ffe5e5}.au-badgeInfo--color-primary.au-badgeInfo--warning{background-color:#fff0e6}.au-badgeInfo--color-primary.au-badgeInfo--progress{background-color:#f1fcff}.au-badgeInfo--color-primary.au-badgeInfo--neutral{background-color:#e2e4e9}.au-badgeInfo--color-secondary.au-badgeInfo--info{background-color:#d4bfff}.au-badgeInfo--color-secondary.au-badgeInfo--success{background-color:#a1e5bd}.au-badgeInfo--color-secondary.au-badgeInfo--error{background-color:#ffbfbf}.au-badgeInfo--color-secondary.au-badgeInfo--warning{background-color:#ffdabf}.au-badgeInfo--color-secondary.au-badgeInfo--progress{background-color:#ccf3ff}.au-badgeInfo--color-secondary.au-badgeInfo--neutral{background-color:#c4c9d4}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-btn{align-items:center;border:none;cursor:pointer;display:inline-flex;font-weight:600;justify-content:center;outline:none;text-align:center;text-decoration:none;transition:background-color .3s ease;font-family:"Source Sans 3",sans-serif;gap:8px;height:48px;border-radius:48px;font-size:16px;padding:
|
|
1
|
+
.au-btn{align-items:center;border:none;cursor:pointer;display:inline-flex;font-weight:600;justify-content:center;outline:none;text-align:center;text-decoration:none;transition:background-color .3s ease;font-family:"Source Sans 3",sans-serif;gap:8px;min-height:48px;border-radius:48px;font-size:16px;padding:12px 18px}.au-btn:hover,.au-btn:focus{background-color:#1737a4}.au-btn:active{background-color:#18256c}.au-btn .au-icon,.au-btn .au-icon>svg{width:20px;height:20px;color:#fff}@media(min-width:600px){.au-btn--size-large{min-height:64px;border-radius:60px;font-size:20px;padding:16px 30px}}.au-btn--size-medium{min-height:48px;border-radius:48px;font-size:16px;padding:12px 18px}.au-btn--color-default{background-color:#0048db;color:#fff}.au-btn--type-outlined{color:#0048db;border:1px solid #0048db;background-color:transparent}.au-btn--type-outlined .au-icon,.au-btn--type-outlined .au-icon>svg{color:#0048db}.au-btn--type-outlined:hover,.au-btn--type-outlined:focus{background-color:#f2f5fc}.au-btn--type-outlined:active{background-color:#dce8ff}.au-btn--type-ghost{background-color:transparent;border:0;color:#0048db}.au-btn--type-ghost .au-icon,.au-btn--type-ghost .au-icon>svg{color:#0048db}.au-btn--type-ghost:hover,.au-btn--type-ghost:focus{background-color:#f2f5fc;border-color:0}.au-btn--type-ghost:active{background-color:#dce8ff;border:1px solid #1737a4;color:#1737a4}.au-btn--type-link{color:#0048db;padding:0;background:transparent}.au-btn--type-link:hover,.au-btn--type-link:focus{background-color:transparent}.au-btn--expand-x{width:100%}.au-btn--disabled{background-color:#e2e4e9;color:#5e6573;cursor:not-allowed}.au-btn--disabled .au-icon svg{color:#5e6573}.au-btn--disabled:hover,.au-btn--disabled:focus{background-color:#e2e4e9}.au-btn--disabled.au-btn--type-outlined{background-color:#fff;color:#5e6573;border-color:#5e6573}.au-btn--disabled.au-btn--type-outlined:hover,.au-btn--disabled.au-btn--type-outlined:focus{background-color:#fff}.au-btn--disabled.au-btn--type-ghost{background-color:#fff;color:#5e6573}.au-btn--disabled.au-btn--type-ghost:hover,.au-btn--disabled.au-btn--type-ghost:focus{background-color:#fff}.au-btn--disabled.au-btn--type-ghost:active{border:0}.au-btn--loading{background-color:#1737a4;color:#fff;cursor:progress}.au-btn--loading .au-icon{animation:spin 1s infinite linear}.au-btn--loading:hover,.au-btn--loading:focus{background-color:#1737a4}.au-btn--loading.au-btn--type-outlined{background-color:#fff;color:#0048db;border-color:#0048db}.au-btn--loading.au-btn--type-outlined:hover,.au-btn--loading.au-btn--type-outlined:focus{background-color:#fff;color:#0048db}.au-btn--loading.au-btn--type-outlined:hover .au-icon,.au-btn--loading.au-btn--type-outlined:hover .au-icon svg,.au-btn--loading.au-btn--type-outlined:focus .au-icon,.au-btn--loading.au-btn--type-outlined:focus .au-icon svg{color:#0048db}.au-btn--loading.au-btn--type-ghost{background-color:transparent;color:#5e6573}.au-btn--loading.au-btn--type-ghost .au-icon,.au-btn--loading.au-btn--type-ghost .au-icon svg{color:#5e6573}.au-btn--loading.au-btn--type-ghost:hover,.au-btn--loading.au-btn--type-ghost:focus{background-color:transparent;color:#5e6573}.au-btn--negative{background-color:#fff;color:#0048db}.au-btn--negative .au-icon,.au-btn--negative .au-icon>svg{color:#0048db}.au-btn--negative:hover,.au-btn--negative:focus{background-color:#f2f5fc;color:#1737a4}.au-btn--negative:hover .au-icon,.au-btn--negative:hover .au-icon>svg,.au-btn--negative:focus .au-icon,.au-btn--negative:focus .au-icon>svg{color:#1737a4}.au-btn--negative:active{background-color:#fff;color:#18256c}.au-btn--negative:active .au-icon,.au-btn--negative:active .au-icon>svg{color:#18256c}.au-btn--negative.au-btn--type-outlined{background-color:transparent;border-color:#fff;color:#fff}.au-btn--negative.au-btn--type-outlined .au-icon,.au-btn--negative.au-btn--type-outlined .au-icon>svg{color:#fff}.au-btn--negative.au-btn--type-outlined:hover,.au-btn--negative.au-btn--type-outlined:focus{background-color:#f2f5fc;border-color:#f2f5fc;color:#1737a4}.au-btn--negative.au-btn--type-outlined:hover .au-icon,.au-btn--negative.au-btn--type-outlined:hover .au-icon>svg,.au-btn--negative.au-btn--type-outlined:focus .au-icon,.au-btn--negative.au-btn--type-outlined:focus .au-icon>svg{color:#1737a4}.au-btn--negative.au-btn--type-outlined:active{background-color:#fff;color:#18256c}.au-btn--negative.au-btn--type-outlined:active .au-icon,.au-btn--negative.au-btn--type-outlined:active .au-icon>svg{color:#18256c}.au-btn--negative.au-btn--type-ghost{background-color:transparent;color:#fff}.au-btn--negative.au-btn--type-ghost .au-icon,.au-btn--negative.au-btn--type-ghost .au-icon>svg{color:#fff}.au-btn--negative.au-btn--type-ghost:hover,.au-btn--negative.au-btn--type-ghost:focus{background-color:#f2f5fc;color:#1737a4}.au-btn--negative.au-btn--type-ghost:hover .au-icon,.au-btn--negative.au-btn--type-ghost:hover .au-icon>svg,.au-btn--negative.au-btn--type-ghost:focus .au-icon,.au-btn--negative.au-btn--type-ghost:focus .au-icon>svg{color:#1737a4}.au-btn--negative.au-btn--type-ghost:active{background-color:#fff;border:0;color:#18256c}.au-btn--negative.au-btn--type-ghost:active .au-icon,.au-btn--negative.au-btn--type-ghost:active .au-icon>svg{color:#18256c}.au-btn--negative.au-btn--disabled{background-color:#f6f7fa;border-color:transparent;color:#c4c9d4}.au-btn--negative.au-btn--disabled .au-icon,.au-btn--negative.au-btn--disabled .au-icon>svg{color:#c4c9d4}.au-btn--negative.au-btn--disabled:hover,.au-btn--negative.au-btn--disabled:focus{background-color:#f6f7fa;border-color:transparent;color:#c4c9d4}.au-btn--negative.au-btn--disabled:hover .au-icon,.au-btn--negative.au-btn--disabled:hover .au-icon>svg,.au-btn--negative.au-btn--disabled:focus .au-icon,.au-btn--negative.au-btn--disabled:focus .au-icon>svg{color:#c4c9d4}.au-btn--negative.au-btn--loading{background-color:#fff;border-color:transparent;color:#0048db}.au-btn--negative.au-btn--loading .au-icon,.au-btn--negative.au-btn--loading .au-icon>svg,.au-btn--negative.au-btn--loading .au-icon svg{color:#0048db}.au-btn--negative.au-btn--loading:hover,.au-btn--negative.au-btn--loading:focus{background-color:#fff;color:#0048db}.au-btn--round-large .au-icon,.au-btn--round-large .au-icon>svg,.au-btn--round-medium .au-icon,.au-btn--round-medium .au-icon>svg{width:24px;height:24px}.au-btn--round-large{padding:12px;height:48px;min-height:48px;width:48px}.au-btn--round-medium{padding:10px;height:40px;min-height:40px;width:40px}@keyframes spin{to{transform:rotate(360deg)}}.btn-text{background-color:transparent;border:none;display:flex;color:#0048db;font-weight:600}.btn-text .au-icon svg{color:#0048db}.btn-text:hover,.btn-text:focus{background-color:transparent}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-carousel{--au-carousel-gap: 16px;position:relative}.au-carousel__rail{position:relative;display:flex;gap:var(--au-carousel-gap);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none}.au-carousel__rail::-webkit-scrollbar{display:none}@media(prefers-reduced-motion:no-preference){.au-carousel__rail{scroll-behavior:smooth}}.au-carousel__rail--dragging{scroll-snap-type:none;scroll-behavior:auto;cursor:grabbing;-webkit-user-select:none;user-select:none}.au-carousel--draggable .au-carousel__rail{cursor:grab}.au-carousel__item{flex:0 0 auto;min-width:0;scroll-snap-align:start}.au-carousel--items-per-view .au-carousel__item{flex-basis:calc((100% - var(--au-carousel-gap) * (var(--au-carousel-items) - 1)) / var(--au-carousel-items))}@media(min-width:600px){.au-carousel--items-per-view .au-carousel__item{flex-basis:calc((100% - var(--au-carousel-gap) * (var(--au-carousel-items-desktop, var(--au-carousel-items)) - 1)) / var(--au-carousel-items-desktop, var(--au-carousel-items)))}}.au-carousel__nav{display:flex;align-items:center;justify-content:space-between;gap:16px;
|
|
1
|
+
.au-carousel{--au-carousel-gap: 16px;position:relative}.au-carousel__rail{position:relative;display:flex;gap:var(--au-carousel-gap);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none}.au-carousel__rail::-webkit-scrollbar{display:none}@media(prefers-reduced-motion:no-preference){.au-carousel__rail{scroll-behavior:smooth}}.au-carousel__rail--dragging{scroll-snap-type:none;scroll-behavior:auto;cursor:grabbing;-webkit-user-select:none;user-select:none}.au-carousel--draggable .au-carousel__rail{cursor:grab}.au-carousel__item{flex:0 0 auto;min-width:0;scroll-snap-align:start}.au-carousel--items-per-view .au-carousel__item{flex-basis:calc((100% - var(--au-carousel-gap) * (var(--au-carousel-items) - 1)) / var(--au-carousel-items))}@media(min-width:600px){.au-carousel--items-per-view .au-carousel__item{flex-basis:calc((100% - var(--au-carousel-gap) * (var(--au-carousel-items-desktop, var(--au-carousel-items)) - 1)) / var(--au-carousel-items-desktop, var(--au-carousel-items)))}}.au-carousel__nav{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.au-carousel__nav[hidden]{display:none}.au-carousel--navigation-only-pin .au-carousel__nav{justify-content:center}@media(min-width:600px){.au-carousel--navigation-text .au-carousel__nav,.au-carousel--navigation-pin .au-carousel__nav{margin-top:32px}}@media(min-width:600px){.au-carousel--navigation-text .au-carousel__status,.au-carousel--navigation-pin .au-carousel__pins{order:-1;margin-right:auto}}.au-carousel__arrow{flex:none}.au-carousel__status{font-family:"Source Sans 3",sans-serif;font-size:16px;font-weight:400;line-height:24px;color:#454a54;text-align:center}.au-carousel__status--hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.au-carousel--negative .au-carousel__status{color:#fff}.au-carousel__pins{display:flex;align-items:center;gap:8px}.au-carousel__pin{position:relative;width:8px;height:8px;padding:0;border:0;border-radius:999px;background-color:#e2e4e9;cursor:pointer;transition:width .2s ease,background-color .2s ease}.au-carousel__pin:before{content:"";position:absolute;top:-8px;right:-8px;bottom:-8px;left:-8px}.au-carousel__pin:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0048db}.au-carousel__pin--active{width:38px;background-color:#16181d}.au-carousel--negative .au-carousel__pin{background-color:#fff6}.au-carousel--negative .au-carousel__pin--active{background-color:#fff}
|
|
@@ -12,19 +12,30 @@ export type FileUploadPreviewProps = {
|
|
|
12
12
|
description?: string;
|
|
13
13
|
/** Mensagem de erro abaixo da linha, com o motivo e o próximo passo; liga o estado Error. Figma: Error Message, State=Error. */
|
|
14
14
|
error?: string;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Percentual do envio, de 0 a 100: a linha entra no estado Enviando, com a Percentage Bar abaixo
|
|
17
|
+
* (rótulo e percentual) e só o X de cancelar à direita; o link e a lixeira aparecem quando o envio
|
|
18
|
+
* termina. Figma: Show Progress.
|
|
19
|
+
*/
|
|
16
20
|
progress?: number;
|
|
21
|
+
/** Rótulo à esquerda da barra durante o envio. @default 'Enviando...' */
|
|
22
|
+
progressLabel?: string;
|
|
17
23
|
/** Troca o ícone padrão (paperclip, 20px). Figma: Switch Icon. */
|
|
18
24
|
icon?: ReactNode;
|
|
19
25
|
/** Esconde o quadro do ícone. Figma: Show Leading Icon=False. */
|
|
20
26
|
hideIcon?: boolean;
|
|
21
|
-
/** Link Button small à direita ("Ver"). Figma: Show Link. */
|
|
27
|
+
/** Link Button small à direita ("Ver"), só com o arquivo já enviado. Figma: Show Link. */
|
|
22
28
|
link?: FileUploadPreviewLink;
|
|
23
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Remove o arquivo enviado (lixeira) ou cancela o envio em andamento (X, enquanto há `progress`).
|
|
31
|
+
* Sem ele o botão some (Show Button=False).
|
|
32
|
+
*/
|
|
24
33
|
onRemove?: () => void;
|
|
25
34
|
/** `aria-label` do botão de remover. @default 'Remover arquivo' */
|
|
26
35
|
removeLabel?: string;
|
|
36
|
+
/** `aria-label` do botão de cancelar, durante o envio. @default 'Cancelar envio' */
|
|
37
|
+
cancelLabel?: string;
|
|
27
38
|
className?: string;
|
|
28
39
|
'data-testid'?: string;
|
|
29
40
|
};
|
|
30
|
-
export declare const FileUploadPreview: ({ name, description, error, progress, icon, hideIcon, link, onRemove, removeLabel, className, "data-testid": dataTestId, }: FileUploadPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const FileUploadPreview: ({ name, description, error, progress, progressLabel, icon, hideIcon, link, onRemove, removeLabel, cancelLabel, className, "data-testid": dataTestId, }: FileUploadPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,21 +6,25 @@ import "react";
|
|
|
6
6
|
import "../../Icon/index.es.js";
|
|
7
7
|
import { IconPaperclip } from "../../icons/IconPaperclip/index.es.js";
|
|
8
8
|
import { IconTrash2 } from "../../icons/IconTrash2/index.es.js";
|
|
9
|
+
import { IconX } from "../../icons/IconX/index.es.js";
|
|
9
10
|
import '../../styles/styles.css';/* empty css */
|
|
10
11
|
const FileUploadPreview = ({
|
|
11
12
|
name,
|
|
12
13
|
description,
|
|
13
14
|
error,
|
|
14
15
|
progress,
|
|
16
|
+
progressLabel = "Enviando...",
|
|
15
17
|
icon,
|
|
16
18
|
hideIcon = false,
|
|
17
19
|
link,
|
|
18
20
|
onRemove,
|
|
19
21
|
removeLabel = "Remover arquivo",
|
|
22
|
+
cancelLabel = "Cancelar envio",
|
|
20
23
|
className,
|
|
21
24
|
"data-testid": dataTestId
|
|
22
25
|
}) => {
|
|
23
26
|
const hasProgress = progress !== void 0;
|
|
27
|
+
const showLink = !!link && !hasProgress;
|
|
24
28
|
const classes = classNames("au-file-upload-preview", {
|
|
25
29
|
"au-file-upload-preview--error": !!error,
|
|
26
30
|
"au-file-upload-preview--with-progress": hasProgress,
|
|
@@ -33,13 +37,23 @@ const FileUploadPreview = ({
|
|
|
33
37
|
/* @__PURE__ */ jsx("span", { className: "au-file-upload-preview__name", children: name }),
|
|
34
38
|
description && /* @__PURE__ */ jsx("span", { className: "au-file-upload-preview__description", children: description })
|
|
35
39
|
] }),
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
onRemove && /* @__PURE__ */ jsx("
|
|
40
|
+
(showLink || onRemove) && /* @__PURE__ */ jsxs("span", { className: "au-file-upload-preview__actions", children: [
|
|
41
|
+
showLink && (link.href ? /* @__PURE__ */ jsx(LinkButton, { as: "a", href: link.href, target: link.target, size: "small", className: "au-file-upload-preview__link", onClick: link.onClick, children: link.label }) : /* @__PURE__ */ jsx(LinkButton, { size: "small", className: "au-file-upload-preview__link", onClick: link.onClick, children: link.label })),
|
|
42
|
+
showLink && onRemove && /* @__PURE__ */ jsx("span", { className: "au-file-upload-preview__actions-divider", "aria-hidden": "true" }),
|
|
43
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
type: "button",
|
|
47
|
+
className: classNames("au-file-upload-preview__remove", { "au-file-upload-preview__remove--cancel": hasProgress }),
|
|
48
|
+
"aria-label": hasProgress ? cancelLabel : removeLabel,
|
|
49
|
+
onClick: onRemove,
|
|
50
|
+
children: hasProgress ? /* @__PURE__ */ jsx(IconX, {}) : /* @__PURE__ */ jsx(IconTrash2, {})
|
|
51
|
+
}
|
|
52
|
+
)
|
|
39
53
|
] })
|
|
40
54
|
] }),
|
|
41
55
|
error && /* @__PURE__ */ jsx("span", { className: "au-file-upload-preview__error", children: error }),
|
|
42
|
-
hasProgress && /* @__PURE__ */ jsx("div", { className: "au-file-upload-preview__progress", children: /* @__PURE__ */ jsx(ProgressBar, { percentage: progress, stepName:
|
|
56
|
+
hasProgress && /* @__PURE__ */ jsx("div", { className: "au-file-upload-preview__progress", children: /* @__PURE__ */ jsx(ProgressBar, { percentage: progress, stepName: progressLabel }) })
|
|
43
57
|
] });
|
|
44
58
|
};
|
|
45
59
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/FileUpload/Preview/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { LinkButton } from '@components/LinkButton'\nimport { ProgressBar } from '@components/ProgressBar'\nimport { IconPaperclip, IconTrash2 } from '@components/icons'\nimport '../styles.scss'\n\nexport type FileUploadPreviewLink = {\n label: string\n href?: string\n target?: string\n onClick?: () => void\n}\n\nexport type FileUploadPreviewProps = {\n /** Nome do arquivo. Figma: File Name. */\n name: string\n /** Tamanho (\"1,2 MB\") ou status (\"Enviando... 30%\"). Figma: Description. */\n description?: string\n /** Mensagem de erro abaixo da linha, com o motivo e o próximo passo; liga o estado Error. Figma: Error Message, State=Error. */\n error?: string\n
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/FileUpload/Preview/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { LinkButton } from '@components/LinkButton'\nimport { ProgressBar } from '@components/ProgressBar'\nimport { IconPaperclip, IconTrash2, IconX } from '@components/icons'\nimport '../styles.scss'\n\nexport type FileUploadPreviewLink = {\n label: string\n href?: string\n target?: string\n onClick?: () => void\n}\n\nexport type FileUploadPreviewProps = {\n /** Nome do arquivo. Figma: File Name. */\n name: string\n /** Tamanho (\"1,2 MB\") ou status (\"Enviando... 30%\"). Figma: Description. */\n description?: string\n /** Mensagem de erro abaixo da linha, com o motivo e o próximo passo; liga o estado Error. Figma: Error Message, State=Error. */\n error?: string\n /**\n * Percentual do envio, de 0 a 100: a linha entra no estado Enviando, com a Percentage Bar abaixo\n * (rótulo e percentual) e só o X de cancelar à direita; o link e a lixeira aparecem quando o envio\n * termina. Figma: Show Progress.\n */\n progress?: number\n /** Rótulo à esquerda da barra durante o envio. @default 'Enviando...' */\n progressLabel?: string\n /** Troca o ícone padrão (paperclip, 20px). Figma: Switch Icon. */\n icon?: ReactNode\n /** Esconde o quadro do ícone. Figma: Show Leading Icon=False. */\n hideIcon?: boolean\n /** Link Button small à direita (\"Ver\"), só com o arquivo já enviado. Figma: Show Link. */\n link?: FileUploadPreviewLink\n /**\n * Remove o arquivo enviado (lixeira) ou cancela o envio em andamento (X, enquanto há `progress`).\n * Sem ele o botão some (Show Button=False).\n */\n onRemove?: () => void\n /** `aria-label` do botão de remover. @default 'Remover arquivo' */\n removeLabel?: string\n /** `aria-label` do botão de cancelar, durante o envio. @default 'Cancelar envio' */\n cancelLabel?: string\n className?: string\n 'data-testid'?: string\n}\n\nexport const FileUploadPreview = ({\n name,\n description,\n error,\n progress,\n progressLabel = 'Enviando...',\n icon,\n hideIcon = false,\n link,\n onRemove,\n removeLabel = 'Remover arquivo',\n cancelLabel = 'Cancelar envio',\n className,\n 'data-testid': dataTestId,\n}: FileUploadPreviewProps) => {\n const hasProgress = progress !== undefined\n // While sending, the only action is to cancel: the link waits for the file.\n const showLink = !!link && !hasProgress\n const classes = classNames('au-file-upload-preview', {\n 'au-file-upload-preview--error': !!error,\n 'au-file-upload-preview--with-progress': hasProgress,\n [className!]: !!className,\n })\n\n return (\n <div className={classes} data-testid={dataTestId}>\n <div className=\"au-file-upload-preview__row\">\n {!hideIcon && (\n <span className=\"au-file-upload-preview__icon\" aria-hidden=\"true\">\n {icon ?? <IconPaperclip />}\n </span>\n )}\n <span className=\"au-file-upload-preview__text\">\n <span className=\"au-file-upload-preview__name\">{name}</span>\n {description && <span className=\"au-file-upload-preview__description\">{description}</span>}\n </span>\n {(showLink || onRemove) && (\n <span className=\"au-file-upload-preview__actions\">\n {showLink &&\n (link.href ? (\n <LinkButton as=\"a\" href={link.href} target={link.target} size=\"small\" className=\"au-file-upload-preview__link\" onClick={link.onClick}>\n {link.label}\n </LinkButton>\n ) : (\n <LinkButton size=\"small\" className=\"au-file-upload-preview__link\" onClick={link.onClick}>\n {link.label}\n </LinkButton>\n ))}\n {showLink && onRemove && <span className=\"au-file-upload-preview__actions-divider\" aria-hidden=\"true\" />}\n {onRemove && (\n <button\n type=\"button\"\n className={classNames('au-file-upload-preview__remove', { 'au-file-upload-preview__remove--cancel': hasProgress })}\n aria-label={hasProgress ? cancelLabel : removeLabel}\n onClick={onRemove}>\n {hasProgress ? <IconX /> : <IconTrash2 />}\n </button>\n )}\n </span>\n )}\n </div>\n {error && <span className=\"au-file-upload-preview__error\">{error}</span>}\n {hasProgress && (\n <div className=\"au-file-upload-preview__progress\">\n <ProgressBar percentage={progress} stepName={progressLabel} />\n </div>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAgDO,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,cAAc;AAAA,EACd;AAAA,EACA,eAAe;AACjB,MAA8B;AAC5B,QAAM,cAAc,aAAa;AAEjC,QAAM,WAAW,CAAC,CAAC,QAAQ,CAAC;AAC5B,QAAM,UAAU,WAAW,0BAA0B;AAAA,IACnD,iCAAiC,CAAC,CAAC;AAAA,IACnC,yCAAyC;AAAA,IACzC,CAAC,SAAU,GAAG,CAAC,CAAC;AAAA,EAAA,CACjB;AAED,SACE,qBAAC,OAAA,EAAI,WAAW,SAAS,eAAa,YACpC,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,WAAU,+BACZ,UAAA;AAAA,MAAA,CAAC,YACA,oBAAC,QAAA,EAAK,WAAU,gCAA+B,eAAY,QACxD,UAAA,QAAQ,oBAAC,eAAA,CAAA,CAAc,EAAA,CAC1B;AAAA,MAEF,qBAAC,QAAA,EAAK,WAAU,gCACd,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,WAAU,gCAAgC,UAAA,MAAK;AAAA,QACpD,eAAe,oBAAC,QAAA,EAAK,WAAU,uCAAuC,UAAA,YAAA,CAAY;AAAA,MAAA,GACrF;AAAA,OACE,YAAY,aACZ,qBAAC,QAAA,EAAK,WAAU,mCACb,UAAA;AAAA,QAAA,aACE,KAAK,OACJ,oBAAC,YAAA,EAAW,IAAG,KAAI,MAAM,KAAK,MAAM,QAAQ,KAAK,QAAQ,MAAK,SAAQ,WAAU,gCAA+B,SAAS,KAAK,SAC1H,UAAA,KAAK,MAAA,CACR,wBAEC,YAAA,EAAW,MAAK,SAAQ,WAAU,gCAA+B,SAAS,KAAK,SAC7E,eAAK,MAAA,CACR;AAAA,QAEH,YAAY,YAAY,oBAAC,UAAK,WAAU,2CAA0C,eAAY,QAAO;AAAA,QACrG,YACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAW,WAAW,kCAAkC,EAAE,0CAA0C,aAAa;AAAA,YACjH,cAAY,cAAc,cAAc;AAAA,YACxC,SAAS;AAAA,YACR,UAAA,cAAc,oBAAC,OAAA,CAAA,CAAM,wBAAM,YAAA,CAAA,CAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CAEJ;AAAA,IAAA,GAEJ;AAAA,IACC,SAAS,oBAAC,QAAA,EAAK,WAAU,iCAAiC,UAAA,OAAM;AAAA,IAChE,eACC,oBAAC,OAAA,EAAI,WAAU,oCACb,UAAA,oBAAC,aAAA,EAAY,YAAY,UAAU,UAAU,cAAA,CAAe,EAAA,CAC9D;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -16,8 +16,8 @@ export type FileUploadRootProps = {
|
|
|
16
16
|
/** Formatos aceitos e tamanho máximo, antes do envio. Sem ele o texto some (Show Helper Text=False). */
|
|
17
17
|
helperText?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Rótulo do botão Outlined
|
|
20
|
-
* é o
|
|
19
|
+
* Rótulo do botão Outlined do Only Button, com @default 'Anexar arquivo'. Ignorado no Drag & Drop:
|
|
20
|
+
* ali a área inteira é o controle e não há botão dentro dela.
|
|
21
21
|
*/
|
|
22
22
|
buttonLabel?: string;
|
|
23
23
|
/**
|
|
@@ -37,7 +37,7 @@ const FileUploadRoot = ({
|
|
|
37
37
|
const [dragging, setDragging] = useState(false);
|
|
38
38
|
const isDragDrop = type === "drag-drop";
|
|
39
39
|
const resolvedTitle = title ?? DEFAULT_TITLE[type];
|
|
40
|
-
const resolvedButtonLabel = isDragDrop ?
|
|
40
|
+
const resolvedButtonLabel = isDragDrop ? void 0 : buttonLabel ?? "Anexar arquivo";
|
|
41
41
|
const hasText = !hideTitle || !!helperText;
|
|
42
42
|
const classes = classNames("au-file-upload", `au-file-upload--type-${type}`, {
|
|
43
43
|
"au-file-upload--disabled": disabled,
|
|
@@ -115,7 +115,7 @@ const FileUploadRoot = ({
|
|
|
115
115
|
className: "au-file-upload__button",
|
|
116
116
|
onClick: openDialog,
|
|
117
117
|
children: [
|
|
118
|
-
|
|
118
|
+
/* @__PURE__ */ jsx(IconUpload, {}),
|
|
119
119
|
resolvedButtonLabel
|
|
120
120
|
]
|
|
121
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/FileUpload/Root/index.tsx"],"sourcesContent":["import { ChangeEvent, DragEvent, ReactNode, useId, useRef, useState } from 'react'\nimport classNames from 'classnames'\nimport { Button } from '@components/Button'\nimport { IconUpload } from '@components/icons'\nimport '../styles.scss'\n\nexport type FileUploadType = 'drag-drop' | 'button'\n\nexport type FileUploadRootProps = {\n /**\n * Drag & Drop (área tracejada que aceita arrastar ou clicar, para telas em que anexar é a ação\n * principal) ou Only Button (título, texto de apoio e botão, para formulários e espaços curtos).\n * Figma: Type.\n */\n type?: FileUploadType\n /** Título da área. @default 'Arraste o arquivo ou clique aqui' no Drag & Drop, 'Anexar arquivo' no Only Button. Figma: Title. */\n title?: string\n /** Esconde o título quando o card ou a seção em volta já diz o que anexar. Figma: Show Title=False. */\n hideTitle?: boolean\n /** Título mostrado enquanto um arquivo é arrastado sobre a área. @default 'Solte o arquivo para enviar' */\n dropTitle?: string\n /** Formatos aceitos e tamanho máximo, antes do envio. Sem ele o texto some (Show Helper Text=False). */\n helperText?: string\n /**\n * Rótulo do botão Outlined
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/FileUpload/Root/index.tsx"],"sourcesContent":["import { ChangeEvent, DragEvent, ReactNode, useId, useRef, useState } from 'react'\nimport classNames from 'classnames'\nimport { Button } from '@components/Button'\nimport { IconUpload } from '@components/icons'\nimport '../styles.scss'\n\nexport type FileUploadType = 'drag-drop' | 'button'\n\nexport type FileUploadRootProps = {\n /**\n * Drag & Drop (área tracejada que aceita arrastar ou clicar, para telas em que anexar é a ação\n * principal) ou Only Button (título, texto de apoio e botão, para formulários e espaços curtos).\n * Figma: Type.\n */\n type?: FileUploadType\n /** Título da área. @default 'Arraste o arquivo ou clique aqui' no Drag & Drop, 'Anexar arquivo' no Only Button. Figma: Title. */\n title?: string\n /** Esconde o título quando o card ou a seção em volta já diz o que anexar. Figma: Show Title=False. */\n hideTitle?: boolean\n /** Título mostrado enquanto um arquivo é arrastado sobre a área. @default 'Solte o arquivo para enviar' */\n dropTitle?: string\n /** Formatos aceitos e tamanho máximo, antes do envio. Sem ele o texto some (Show Helper Text=False). */\n helperText?: string\n /**\n * Rótulo do botão Outlined do Only Button, com @default 'Anexar arquivo'. Ignorado no Drag & Drop:\n * ali a área inteira é o controle e não há botão dentro dela.\n */\n buttonLabel?: string\n /**\n * `accept` do input de arquivo (`.png,.jpg,.pdf`). Filtra só o diálogo: um arquivo solto na área\n * chega ao `onChange` seja qual for o tipo, para o app recusar e explicar no Alert de erro abaixo\n * da área (\"Formato não aceito\"), como a spec pede. A validação de tipo e tamanho é do consumidor.\n */\n accept?: string\n multiple?: boolean\n disabled?: boolean\n name?: string\n id?: string\n /** Arquivos escolhidos no diálogo ou soltos na área; com `multiple` desligado, só o primeiro. */\n onChange?: (files: File[]) => void\n /** As linhas `FileUpload.Preview`, empilhadas logo abaixo da área com 8px entre elas. */\n children?: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\nconst DEFAULT_TITLE: Record<FileUploadType, string> = {\n 'drag-drop': 'Arraste o arquivo ou clique aqui',\n button: 'Anexar arquivo',\n}\n\n/** Caps the picked or dropped files to the input's `multiple`. The Astro controller has a copy. */\nfunction _pickFiles(list: FileList | null, multiple: boolean): File[] {\n const files = Array.from(list ?? [])\n return multiple ? files : files.slice(0, 1)\n}\n\nexport const FileUploadRoot = ({\n type = 'drag-drop',\n title,\n hideTitle = false,\n dropTitle = 'Solte o arquivo para enviar',\n helperText,\n buttonLabel,\n accept,\n multiple = false,\n disabled = false,\n name,\n id,\n onChange,\n children,\n className,\n 'data-testid': dataTestId,\n}: FileUploadRootProps) => {\n const generatedId = `au-file-upload-${useId().replace(/[^a-zA-Z0-9]/g, '')}`\n const inputId = id ?? generatedId\n const inputRef = useRef<HTMLInputElement>(null)\n // Nested dragenter/dragleave pairs: the area is \"dragging\" while the count is above zero.\n const dragDepth = useRef(0)\n const [dragging, setDragging] = useState(false)\n\n const isDragDrop = type === 'drag-drop'\n const resolvedTitle = title ?? DEFAULT_TITLE[type]\n const resolvedButtonLabel = isDragDrop ? undefined : buttonLabel ?? 'Anexar arquivo'\n const hasText = !hideTitle || !!helperText\n\n const classes = classNames('au-file-upload', `au-file-upload--type-${type}`, {\n 'au-file-upload--disabled': disabled,\n 'au-file-upload--dragging': dragging,\n [className!]: !!className,\n })\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(_pickFiles(event.target.files, multiple))\n // Lets the same file be picked twice in a row.\n event.target.value = ''\n }\n\n const handleDragEnter = (event: DragEvent<HTMLDivElement>) => {\n if (disabled || !isDragDrop) return\n event.preventDefault()\n dragDepth.current += 1\n setDragging(true)\n }\n\n const handleDragOver = (event: DragEvent<HTMLDivElement>) => {\n if (disabled || !isDragDrop) return\n event.preventDefault()\n }\n\n const handleDragLeave = () => {\n if (disabled || !isDragDrop) return\n dragDepth.current = Math.max(0, dragDepth.current - 1)\n if (dragDepth.current === 0) setDragging(false)\n }\n\n const handleDrop = (event: DragEvent<HTMLDivElement>) => {\n if (disabled || !isDragDrop) return\n event.preventDefault()\n dragDepth.current = 0\n setDragging(false)\n onChange?.(_pickFiles(event.dataTransfer.files, multiple))\n }\n\n const openDialog = () => inputRef.current?.click()\n\n return (\n <div className={classes} data-testid={dataTestId}>\n <div\n className=\"au-file-upload__area\"\n onDragEnter={handleDragEnter}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}>\n <input\n ref={inputRef}\n className=\"au-file-upload__input\"\n type=\"file\"\n id={inputId}\n name={name}\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n // In the Only Button the button is the focusable control; the input stays out of the tab order.\n tabIndex={isDragDrop ? undefined : -1}\n aria-label={hideTitle ? resolvedTitle : undefined}\n aria-describedby={helperText ? `${inputId}-helper` : undefined}\n onChange={handleChange}\n />\n {isDragDrop && (\n <span className=\"au-file-upload__icon\" aria-hidden=\"true\">\n <IconUpload />\n </span>\n )}\n {hasText && (\n <span className=\"au-file-upload__text\">\n {!hideTitle && (\n <label htmlFor={inputId} className=\"au-file-upload__title\">\n {dragging ? dropTitle : resolvedTitle}\n </label>\n )}\n {helperText && (\n <span id={`${inputId}-helper`} className=\"au-file-upload__helper\">\n {helperText}\n </span>\n )}\n </span>\n )}\n {resolvedButtonLabel && (\n <Button\n type=\"outlined\"\n size=\"medium\"\n disabled={disabled}\n className=\"au-file-upload__button\"\n onClick={openDialog}>\n <IconUpload />\n {resolvedButtonLabel}\n </Button>\n )}\n </div>\n {children && <div className=\"au-file-upload__files\">{children}</div>}\n </div>\n )\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-password-field__container{
|
|
1
|
+
.au-password-field__container{display:flex;align-items:stretch;min-height:56px;background-color:#fff;border:1px solid #454a54;border-radius:8px}.au-password-field__container:hover{border-color:#16181d}.au-password-field__container:has(.au-password-field__input:focus){border-color:#0048db;outline:1px solid #0048db}.au-password-field__container .au-password-field__input.au-field__input{flex:1;min-width:0;height:auto;padding:15px 8px 15px 15px;background-color:transparent;border:0;outline:0;animation:none}.au-password-field__btn{flex-shrink:0;background-color:transparent;border:none;color:#0048db;cursor:pointer;font-family:"Source Sans 3",sans-serif;font-size:14px;font-weight:600;text-transform:uppercase;padding:0 15px 0 8px}.au-password-field__btn:disabled{cursor:not-allowed}.au-field--disabled .au-password-field__container{background-color:#e2e4e9;border-color:#5e6573}.au-field--error .au-password-field__container{background-color:#f5eff0;border-color:#991717}.au-field--error .au-password-field__container:has(.au-password-field__input:focus){border-color:#0048db}.au-field--success .au-password-field__container{animation:inputSuccess 2s forwards}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-file-upload{display:flex;flex-direction:column;width:100%}.au-file-upload__area{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;width:100%;font-family:"Source Sans 3",sans-serif}.au-file-upload--type-drag-drop .au-file-upload__area{align-items:center;padding:24px;text-align:center;background-color:#fff;border:1px dashed #c4c9d4;border-radius:16px;transition:background-color .3s ease,border-color .3s ease}.au-file-upload--type-drag-drop .au-file-upload__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.au-file-upload--type-drag-drop
|
|
1
|
+
.au-file-upload{display:flex;flex-direction:column;width:100%}.au-file-upload__area{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;width:100%;font-family:"Source Sans 3",sans-serif}.au-file-upload--type-drag-drop .au-file-upload__area{align-items:center;padding:24px;text-align:center;background-color:#fff;border:1px dashed #c4c9d4;border-radius:16px;transition:background-color .3s ease,border-color .3s ease}.au-file-upload--type-drag-drop .au-file-upload__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.au-file-upload--type-drag-drop:not(.au-file-upload--disabled) .au-file-upload__area:hover,.au-file-upload--type-drag-drop.au-file-upload--dragging .au-file-upload__area{background-color:#f2f5fc;border-color:#0048db}.au-file-upload--type-drag-drop .au-file-upload__area:has(>.au-file-upload__input:focus-visible){border-style:solid;border-color:#0048db;outline:1px solid #0048db}.au-file-upload--type-drag-drop.au-file-upload--disabled .au-file-upload__area{background-color:#f6f7fa;border-color:#e2e4e9}.au-file-upload--type-drag-drop.au-file-upload--disabled .au-file-upload__input{cursor:default}.au-file-upload--type-button .au-file-upload__area{align-items:flex-start;gap:16px;text-align:start}.au-file-upload--type-button .au-file-upload__input{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;opacity:0;pointer-events:none}.au-file-upload__icon{display:flex;align-items:center;justify-content:center}.au-file-upload__text{display:flex;flex-direction:column}.au-file-upload--type-button .au-file-upload__text{gap:8px}.au-file-upload__title{font-size:14px;line-height:22px;font-weight:600;color:#454a54}.au-file-upload__helper{font-size:14px;line-height:22px;color:#5e6573}.au-file-upload--disabled .au-file-upload__title,.au-file-upload--disabled .au-file-upload__helper{color:#c4c9d4}.au-file-upload--disabled .au-file-upload__icon .au-icon,.au-file-upload--disabled .au-file-upload__icon .au-icon>svg{color:#c4c9d4}.au-file-upload__files{display:flex;flex-direction:column;gap:8px;margin-top:8px}.au-file-upload-preview{display:flex;flex-direction:column;gap:8px;box-sizing:border-box;width:100%;padding:14px 12px;font-family:"Source Sans 3",sans-serif;background-color:#fff;border:1px solid #e2e4e9;border-radius:8px}.au-file-upload-preview__row{display:flex;align-items:center;gap:12px}.au-file-upload-preview__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:40px;height:40px;background-color:#f6f7fa;border-radius:8px}.au-file-upload-preview__icon .au-icon,.au-file-upload-preview__icon .au-icon>svg{color:#313131}.au-file-upload-preview--error .au-file-upload-preview__icon{background-color:#ffe5e5}.au-file-upload-preview--error .au-file-upload-preview__icon .au-icon,.au-file-upload-preview--error .au-file-upload-preview__icon .au-icon>svg{color:#991717}.au-file-upload-preview__text{display:flex;flex:1;flex-direction:column;min-width:0}.au-file-upload-preview__name{overflow:hidden;font-size:14px;line-height:22px;font-weight:600;color:#454a54;text-overflow:ellipsis;white-space:nowrap}.au-file-upload-preview__description{font-size:12px;line-height:19px;color:#5e6573}.au-file-upload-preview__actions{display:flex;flex-shrink:0;align-items:center;gap:10px}.au-file-upload-preview .au-file-upload-preview__link{min-height:40px;padding:0 16px;margin:0 -16px}.au-file-upload-preview__actions-divider{width:0;height:40px;border-left:1px solid #F2F5FC}.au-file-upload-preview__remove{display:flex;align-items:center;justify-content:center;width:40px;height:40px;padding:8px;background-color:transparent;border:none;border-radius:999px;cursor:pointer;transition:background-color .3s ease}.au-file-upload-preview__remove:hover,.au-file-upload-preview__remove:focus-visible{background-color:#f2f5fc}.au-file-upload-preview__remove:active{background-color:#dce8ff}.au-file-upload-preview__error{margin-top:12px;font-size:12px;line-height:19px;color:#991717}.au-file-upload-preview__progress{width:100%}.au-file-upload-preview__progress .au-progress-bar{gap:12px}.au-file-upload-preview__progress .au-progress-bar__text .au-text{font-size:12px;line-height:19px}
|