@consumidor-positivo/aurora 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/astro/Carousel/Root/index.astro +2 -0
- package/astro/Divider/index.astro +19 -4
- package/astro/Icon/index.astro +3 -0
- package/astro/Pagination/index.astro +3 -0
- package/astro/PartnerBanner/index.astro +15 -9
- package/astro/ProgressBar/index.astro +41 -19
- package/astro/Skeleton/index.astro +3 -0
- package/astro/Switch/Pure/index.astro +3 -0
- package/astro/Switch/index.astro +86 -0
- package/dist/components/Divider/index.d.ts +8 -1
- package/dist/components/Divider/index.es.js +10 -5
- package/dist/components/Divider/index.es.js.map +1 -1
- package/dist/components/Divider/styles.css +1 -1
- package/dist/components/Header/styles.css +1 -1
- package/dist/components/PartnerBanner/index.d.ts +3 -1
- package/dist/components/PartnerBanner/index.es.js +5 -4
- package/dist/components/PartnerBanner/index.es.js.map +1 -1
- package/dist/components/PartnerBanner/styles.css +1 -1
- package/dist/components/ProgressBar/index.d.ts +20 -5
- package/dist/components/ProgressBar/index.es.js +15 -11
- package/dist/components/ProgressBar/index.es.js.map +1 -1
- package/dist/components/ProgressBar/styles.css +1 -1
- package/dist/components/Switch/Pure/index.d.ts +6 -0
- package/dist/components/Switch/Pure/index.es.js.map +1 -1
- package/dist/components/Switch/Pure/types.d.ts +1 -0
- package/dist/components/Switch/index.d.ts +23 -0
- package/dist/components/Switch/index.es.js +67 -0
- package/dist/components/Switch/index.es.js.map +1 -0
- package/dist/components/Switch/styles.css +1 -0
- package/dist/components/Transition/index.d.ts +8 -0
- package/dist/components/Transition/index.es.js +10 -14
- package/dist/components/Transition/index.es.js.map +1 -1
- package/dist/components/Transition/styles.css +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +3 -2
- package/dist/main.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -195,6 +195,8 @@ const style = [
|
|
|
195
195
|
if (!rail || !nav || !status) return
|
|
196
196
|
|
|
197
197
|
const pageLabel = (root.dataset.pageLabel ?? 'Página').trim()
|
|
198
|
+
// Controller wiring only; React's root carries no such attribute.
|
|
199
|
+
root.removeAttribute('data-page-label')
|
|
198
200
|
const pinLabel = pageLabel || 'Página'
|
|
199
201
|
const draggable = root.classList.contains('au-carousel--draggable')
|
|
200
202
|
let starts: number[] = []
|
|
@@ -2,26 +2,41 @@
|
|
|
2
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
3
3
|
import '../../dist/components/Divider/styles.css'
|
|
4
4
|
|
|
5
|
+
export type DividerWidth = 'small' | 'large'
|
|
6
|
+
|
|
5
7
|
/** Same props as React; every HTML attribute is forwarded to the `<hr>`. */
|
|
6
8
|
export type Props = HTMLAttributes<'hr'> & {
|
|
9
|
+
/** Espessura da linha: `small` (1px, padrão) ou `large` (2px). */
|
|
10
|
+
width?: DividerWidth
|
|
11
|
+
/** Esconde a linha mantendo o espaço que ela ocupa. */
|
|
12
|
+
invisible?: boolean
|
|
13
|
+
/** @deprecated Use `width`: `1` é `'small'` e `2` é `'large'`. */
|
|
7
14
|
borderWidth?: 1 | 2
|
|
15
|
+
/** @deprecated Use `invisible`. */
|
|
8
16
|
state?: 'visible' | 'invisible'
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
width,
|
|
21
|
+
invisible,
|
|
22
|
+
borderWidth,
|
|
23
|
+
state,
|
|
14
24
|
class: className,
|
|
15
25
|
...rest
|
|
16
26
|
} = Astro.props
|
|
27
|
+
|
|
28
|
+
const resolvedWidth: DividerWidth = width ?? (borderWidth === 2 ? 'large' : 'small')
|
|
29
|
+
const hidden = invisible ?? state === 'invisible'
|
|
17
30
|
---
|
|
18
31
|
|
|
19
32
|
<hr
|
|
20
33
|
class:list={[
|
|
21
34
|
'au-divider',
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
resolvedWidth === 'small' && 'au-divider--width-1',
|
|
36
|
+
resolvedWidth === 'large' && 'au-divider--width-2',
|
|
37
|
+
hidden && 'au-divider--invisible',
|
|
24
38
|
className,
|
|
25
39
|
]}
|
|
40
|
+
aria-hidden={hidden || undefined}
|
|
26
41
|
{...rest}
|
|
27
42
|
/>
|
package/astro/Icon/index.astro
CHANGED
|
@@ -29,6 +29,9 @@ const {
|
|
|
29
29
|
// picking it up here it would land in `...rest` and overwrite the classes
|
|
30
30
|
// this component builds.
|
|
31
31
|
'class:list': classList,
|
|
32
|
+
// An icon passed as `<IconX slot="icon" />` gets its own `slot` as a prop;
|
|
33
|
+
// spread into `...rest` it would render as a stray `slot` attribute.
|
|
34
|
+
slot: _slot,
|
|
32
35
|
...rest
|
|
33
36
|
} = Astro.props
|
|
34
37
|
---
|
|
@@ -223,6 +223,9 @@ const options = pageSizeOptions.includes(pageSize)
|
|
|
223
223
|
query<HTMLElement>('.au-pagination__page--active')?.textContent ?? 1,
|
|
224
224
|
)
|
|
225
225
|
let pageSize = Number(select?.value ?? root.dataset.pageSize ?? 1)
|
|
226
|
+
// Controller wiring only; React's root carries no such attributes.
|
|
227
|
+
root.removeAttribute('data-total-items')
|
|
228
|
+
root.removeAttribute('data-page-size')
|
|
226
229
|
|
|
227
230
|
const totalPages = () => Math.max(1, Math.ceil(totalItems / pageSize))
|
|
228
231
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import LinkButton from '../LinkButton/index.astro'
|
|
3
4
|
import Text from '../Text/index.astro'
|
|
4
5
|
import '../../dist/components/PartnerBanner/styles.css'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* The React `icon` prop is the `icon` slot (and still adds
|
|
8
|
+
* The React `icon` prop (the partner logo) is the `icon` slot (and still adds
|
|
8
9
|
* `au-partner-banner--with-icon`); `ariaLabel` is the plain `aria-label`
|
|
9
|
-
* attribute and `className` the plain `class`. No `onButtonClick`: the
|
|
10
|
+
* attribute and `className` the plain `class`. No `onButtonClick`: the action
|
|
10
11
|
* carries `data-au-partner-banner="button"` for the page's own `<script>`.
|
|
11
12
|
* Every HTML attribute is forwarded to the `<aside>`.
|
|
12
13
|
*/
|
|
13
14
|
export type Props = HTMLAttributes<'aside'> & {
|
|
14
15
|
text: string
|
|
15
|
-
|
|
16
|
+
/** Rótulo da ação, um Link Button small. Sem ele, o banner sai só com o texto. */
|
|
17
|
+
btnText?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const { text, btnText, class: className, ...rest } = Astro.props
|
|
@@ -42,11 +44,15 @@ const hasIcon = Astro.slots.has('icon')
|
|
|
42
44
|
class="au-partner-banner__text">
|
|
43
45
|
{text}
|
|
44
46
|
</Text>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
{
|
|
48
|
+
btnText && (
|
|
49
|
+
<LinkButton
|
|
50
|
+
size="small"
|
|
51
|
+
class="au-partner-banner__button"
|
|
52
|
+
data-au-partner-banner="button">
|
|
53
|
+
{btnText}
|
|
54
|
+
</LinkButton>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
51
57
|
</div>
|
|
52
58
|
</aside>
|
|
@@ -3,43 +3,63 @@ import type { HTMLAttributes } from 'astro/types'
|
|
|
3
3
|
import Text from '../Text/index.astro'
|
|
4
4
|
import '../../dist/components/ProgressBar/styles.css'
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/** Percentage Bar do Figma: avanço contínuo de 0 a 100. */
|
|
7
|
+
type ProgressBarPercentageProps = {
|
|
8
|
+
percentage: number
|
|
9
|
+
currentStep?: never
|
|
10
|
+
totalSteps?: never
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Step Bar do Figma: etapas definidas (de 2 a 6 no design). */
|
|
14
|
+
type ProgressBarStepProps = {
|
|
15
|
+
percentage?: undefined
|
|
11
16
|
currentStep: number
|
|
12
17
|
totalSteps: number
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
type ProgressBarOwnProps = {
|
|
21
|
+
/** Texto da descrição; também é o `aria-label` da barra. */
|
|
22
|
+
stepName: string
|
|
23
|
+
/** Mostra a descrição (label e contador) abaixo da barra. */
|
|
24
|
+
showDescription?: boolean
|
|
25
|
+
/** Barra contínua com percentual em vez de etapas. Ligado sozinho quando há `percentage`. */
|
|
26
|
+
percentageMode?: boolean
|
|
27
|
+
} & (ProgressBarPercentageProps | ProgressBarStepProps)
|
|
28
|
+
|
|
29
|
+
/** Same props as React; every HTML attribute is forwarded to the root `div`. */
|
|
30
|
+
export type Props = HTMLAttributes<'div'> & ProgressBarOwnProps
|
|
31
|
+
|
|
15
32
|
const {
|
|
16
33
|
percentageMode = false,
|
|
34
|
+
percentage,
|
|
17
35
|
stepName,
|
|
18
36
|
currentStep,
|
|
19
37
|
totalSteps,
|
|
38
|
+
showDescription = true,
|
|
20
39
|
class: className,
|
|
21
40
|
...rest
|
|
22
41
|
} = Astro.props
|
|
23
42
|
|
|
24
|
-
const
|
|
25
|
-
const
|
|
43
|
+
const isPercentage = percentageMode || percentage !== undefined
|
|
44
|
+
const steps = Math.max(1, totalSteps ?? 1)
|
|
45
|
+
const safeCurrentStep = Math.max(1, Math.min(currentStep ?? 1, steps))
|
|
46
|
+
const percentageWidth =
|
|
47
|
+
percentage !== undefined ? Math.max(0, Math.min(percentage, 100)) : (safeCurrentStep / steps) * 100
|
|
26
48
|
const roundedPercentage = Math.round(percentageWidth)
|
|
27
49
|
|
|
28
|
-
const progressText =
|
|
29
|
-
? `${roundedPercentage}%`
|
|
30
|
-
: `${safeCurrentStep} de ${totalSteps}`
|
|
50
|
+
const progressText = isPercentage ? `${roundedPercentage}%` : `${safeCurrentStep} de ${steps}`
|
|
31
51
|
---
|
|
32
52
|
|
|
33
53
|
<div
|
|
34
54
|
class:list={['au-progress-bar', className]}
|
|
35
55
|
role="progressbar"
|
|
36
|
-
aria-valuenow={
|
|
37
|
-
aria-valuemin={
|
|
38
|
-
aria-valuemax={
|
|
56
|
+
aria-valuenow={isPercentage ? roundedPercentage : safeCurrentStep}
|
|
57
|
+
aria-valuemin={isPercentage ? 0 : 1}
|
|
58
|
+
aria-valuemax={isPercentage ? 100 : steps}
|
|
39
59
|
aria-label={stepName}
|
|
40
60
|
{...rest}>
|
|
41
61
|
{
|
|
42
|
-
|
|
62
|
+
isPercentage ? (
|
|
43
63
|
<div class="au-progress-bar__bar">
|
|
44
64
|
<div
|
|
45
65
|
style={`width: ${percentageWidth}%`}
|
|
@@ -48,7 +68,7 @@ const progressText = percentageMode
|
|
|
48
68
|
</div>
|
|
49
69
|
) : (
|
|
50
70
|
<div class="au-progress-bar__steps">
|
|
51
|
-
{Array.from({ length:
|
|
71
|
+
{Array.from({ length: steps }).map((_, index) => (
|
|
52
72
|
<div class="au-progress-bar__step-container">
|
|
53
73
|
<div
|
|
54
74
|
class:list={[
|
|
@@ -63,8 +83,10 @@ const progressText = percentageMode
|
|
|
63
83
|
)
|
|
64
84
|
}
|
|
65
85
|
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
{showDescription && (
|
|
87
|
+
<div class="au-progress-bar__text">
|
|
88
|
+
<Text as="span" variant="body-medium" color="secondary">{stepName}</Text>
|
|
89
|
+
<Text as="span" variant="body-medium" color="secondary">{progressText}</Text>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
70
92
|
</div>
|
|
@@ -3,6 +3,9 @@ import type { HTMLAttributes } from 'astro/types'
|
|
|
3
3
|
import '../../../dist/components/Pure/styles.css'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated Use `Switch` (`astro/Switch/index.astro`), which follows the
|
|
7
|
+
* Figma spec. `isActive` becomes `checked`. Removed in the next major.
|
|
8
|
+
*
|
|
6
9
|
* Differences from React: the native checkbox is uncontrolled, `isActive` is
|
|
7
10
|
* only its initial state. No `activateCallBack`/`deactivateCallBack`: listen
|
|
8
11
|
* to the input's native `change` event (it bubbles to the root) and read
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import IconCheck from '../icons/default/IconCheck.astro'
|
|
4
|
+
import IconX from '../icons/default/IconX.astro'
|
|
5
|
+
import '../../dist/components/Switch/styles.css'
|
|
6
|
+
|
|
7
|
+
export type SwitchTextDirection = 'left' | 'right'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Differences from React: the native checkbox is uncontrolled, so there is no
|
|
11
|
+
* `checked`/`defaultChecked` pair: `checked` is the initial state. No
|
|
12
|
+
* `onChange`: listen to the input's native `change` event (it bubbles to the
|
|
13
|
+
* root `<label>`) and read `event.target.checked`. `id`, `name`, `value` and
|
|
14
|
+
* `aria-label` go to the input; every other attribute (`class`, `data-*`…)
|
|
15
|
+
* goes to the root.
|
|
16
|
+
*/
|
|
17
|
+
export type Props = Omit<HTMLAttributes<'label'>, 'aria-label'> & {
|
|
18
|
+
/** Texto do switch (Show Text / Edit Text no Figma). Sem `label`, passe `aria-label`. */
|
|
19
|
+
label?: string
|
|
20
|
+
/** Texto de apoio abaixo do label, em até duas linhas (Description no Figma). */
|
|
21
|
+
description?: string
|
|
22
|
+
/** Lado do texto em relação ao switch (Text Direction no Figma). */
|
|
23
|
+
textDirection?: SwitchTextDirection
|
|
24
|
+
/** Ocupa a largura do container: o texto cresce e o switch vai para a borda oposta. Sem ela, o switch fica a 8px do texto. */
|
|
25
|
+
fullWidth?: boolean
|
|
26
|
+
/** Initial state of the switch. */
|
|
27
|
+
checked?: boolean
|
|
28
|
+
disabled?: boolean
|
|
29
|
+
name?: string
|
|
30
|
+
value?: string
|
|
31
|
+
'aria-label'?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
label,
|
|
36
|
+
description,
|
|
37
|
+
textDirection = 'left',
|
|
38
|
+
fullWidth = false,
|
|
39
|
+
checked = false,
|
|
40
|
+
disabled = false,
|
|
41
|
+
id,
|
|
42
|
+
name,
|
|
43
|
+
value,
|
|
44
|
+
'aria-label': ariaLabel,
|
|
45
|
+
class: className,
|
|
46
|
+
...rest
|
|
47
|
+
} = Astro.props
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
<label
|
|
51
|
+
class:list={[
|
|
52
|
+
'au-switch-field',
|
|
53
|
+
textDirection === 'left' && 'au-switch-field--direction-left',
|
|
54
|
+
textDirection === 'right' && 'au-switch-field--direction-right',
|
|
55
|
+
description && 'au-switch-field--with-description',
|
|
56
|
+
fullWidth && 'au-switch-field--full-width',
|
|
57
|
+
disabled && 'au-switch-field--disabled',
|
|
58
|
+
className,
|
|
59
|
+
]}
|
|
60
|
+
{...rest}>
|
|
61
|
+
{label && (
|
|
62
|
+
<span class="au-switch-field__text">
|
|
63
|
+
<span class="au-switch-field__label">{label}</span>
|
|
64
|
+
{description && <span class="au-switch-field__description">{description}</span>}
|
|
65
|
+
</span>
|
|
66
|
+
)}
|
|
67
|
+
<span class="au-switch-field__control">
|
|
68
|
+
<input
|
|
69
|
+
class="au-switch-field__input"
|
|
70
|
+
type="checkbox"
|
|
71
|
+
role="switch"
|
|
72
|
+
id={id}
|
|
73
|
+
name={name}
|
|
74
|
+
value={value}
|
|
75
|
+
checked={checked}
|
|
76
|
+
disabled={disabled}
|
|
77
|
+
aria-label={ariaLabel}
|
|
78
|
+
/>
|
|
79
|
+
<span class="au-switch-field__track" aria-hidden="true">
|
|
80
|
+
<span class="au-switch-field__thumb">
|
|
81
|
+
<IconCheck class="au-switch-field__icon au-switch-field__icon--on" />
|
|
82
|
+
<IconX class="au-switch-field__icon au-switch-field__icon--off" />
|
|
83
|
+
</span>
|
|
84
|
+
</span>
|
|
85
|
+
</span>
|
|
86
|
+
</label>
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
export type DividerWidth = 'small' | 'large';
|
|
1
2
|
export type DividerProps = {
|
|
3
|
+
/** Espessura da linha: `small` (1px, padrão) ou `large` (2px). */
|
|
4
|
+
width?: DividerWidth;
|
|
5
|
+
/** Esconde a linha mantendo o espaço que ela ocupa. */
|
|
6
|
+
invisible?: boolean;
|
|
7
|
+
/** @deprecated Use `width`: `1` é `'small'` e `2` é `'large'`. */
|
|
2
8
|
borderWidth?: 1 | 2;
|
|
9
|
+
/** @deprecated Use `invisible`. */
|
|
3
10
|
state?: 'visible' | 'invisible';
|
|
4
11
|
'data-testid'?: string;
|
|
5
12
|
};
|
|
6
|
-
export declare const Divider: ({ borderWidth, state, "data-testid": dataTestId, }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Divider: ({ width, invisible, borderWidth, state, "data-testid": dataTestId, }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-BW2ZU5Hx.js";
|
|
3
3
|
import './styles.css';const Divider = ({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
width,
|
|
5
|
+
invisible,
|
|
6
|
+
borderWidth,
|
|
7
|
+
state,
|
|
6
8
|
"data-testid": dataTestId
|
|
7
9
|
}) => {
|
|
10
|
+
const resolvedWidth = width ?? (borderWidth === 2 ? "large" : "small");
|
|
11
|
+
const hidden = invisible ?? state === "invisible";
|
|
8
12
|
const classes = classNames("au-divider", {
|
|
9
|
-
|
|
10
|
-
"au-divider--
|
|
13
|
+
"au-divider--width-1": resolvedWidth === "small",
|
|
14
|
+
"au-divider--width-2": resolvedWidth === "large",
|
|
15
|
+
"au-divider--invisible": hidden
|
|
11
16
|
});
|
|
12
|
-
return /* @__PURE__ */ jsx("hr", { className: classes, "data-testid": dataTestId });
|
|
17
|
+
return /* @__PURE__ */ jsx("hr", { className: classes, "aria-hidden": hidden || void 0, "data-testid": dataTestId });
|
|
13
18
|
};
|
|
14
19
|
export {
|
|
15
20
|
Divider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport './styles.scss'\n\nexport type DividerProps = {\n borderWidth?: 1 | 2\n state?: 'visible' | 'invisible'\n 'data-testid'?: string\n}\n\nexport const Divider = ({\n borderWidth
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Divider/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport './styles.scss'\n\nexport type DividerWidth = 'small' | 'large'\n\nexport type DividerProps = {\n /** Espessura da linha: `small` (1px, padrão) ou `large` (2px). */\n width?: DividerWidth\n /** Esconde a linha mantendo o espaço que ela ocupa. */\n invisible?: boolean\n /** @deprecated Use `width`: `1` é `'small'` e `2` é `'large'`. */\n borderWidth?: 1 | 2\n /** @deprecated Use `invisible`. */\n state?: 'visible' | 'invisible'\n 'data-testid'?: string\n}\n\nexport const Divider = ({\n width,\n invisible,\n borderWidth,\n state,\n 'data-testid': dataTestId,\n}: DividerProps) => {\n const resolvedWidth: DividerWidth = width ?? (borderWidth === 2 ? 'large' : 'small')\n const hidden = invisible ?? state === 'invisible'\n\n const classes = classNames('au-divider', {\n 'au-divider--width-1': resolvedWidth === 'small',\n 'au-divider--width-2': resolvedWidth === 'large',\n 'au-divider--invisible': hidden,\n })\n\n return <hr className={classes} aria-hidden={hidden || undefined} data-testid={dataTestId} />\n}\n"],"names":[],"mappings":";;AAiBO,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAoB;AAClB,QAAM,gBAA8B,UAAU,gBAAgB,IAAI,UAAU;AAC5E,QAAM,SAAS,aAAa,UAAU;AAEtC,QAAM,UAAU,WAAW,cAAc;AAAA,IACvC,uBAAuB,kBAAkB;AAAA,IACzC,uBAAuB,kBAAkB;AAAA,IACzC,yBAAyB;AAAA,EAAA,CAC1B;AAED,SAAO,oBAAC,QAAG,WAAW,SAAS,eAAa,UAAU,QAAW,eAAa,YAAY;AAC5F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-divider{width:100%;margin:0;border:none;border-top-style:solid;border-top-color:#f2f5fc}.au-divider--width-1{border-top-width:1px}.au-divider--width-2{border-top-width:2px}.au-divider--invisible{
|
|
1
|
+
.au-divider{width:100%;margin:0;border:none;border-top-style:solid;border-top-color:#f2f5fc;border-radius:0}.au-divider--width-1{border-top-width:1px}.au-divider--width-2{border-top-width:2px}.au-divider--invisible{visibility:hidden}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-header{height:80px;border-bottom:1px solid #e2e4e9;background-color:#fff}.au-header--fixed{position:fixed;top:0;left:0;width:100%;z-index:5}.au-header--static{position:relative}.au-header__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media(min-width:1024px){.au-header__container{padding:0 16px}}.au-header__container{height:100%;display:flex;justify-content:space-between;align-items:center;gap:16px}.au-header__logo{display:flex;align-items:center}.au-header__logo .au-text{padding-left:16px;margin-left:16px;border-left:1px solid #e2e4e9}.au-header__logo--mobile{display:block}@media(min-width:1024px){.au-header__logo--mobile{display:none}}.au-header__logo--desktop{display:none}@media(min-width:1024px){.au-header__logo--desktop{display:block}}.au-header__link{cursor:pointer}.au-header__button{cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}.au-header__badges{display:flex;align-items:center}.au-header__badges>*+*{padding-left:16px;margin-left:16px;position:relative}.au-header__badges>*+*:before{content:"";height:24px;width:1px;background-color:#e2e4e9;position:absolute;left:0;top:calc(50% - 12px)}.au-header__badges .au-logo img{width:100%}.au-header__badges--limited-width .au-logo{max-width:56px}.au-header__navigation{height:100%;display:flex}.au-header__navigation>*+*{margin-left:24px}.au-header__navbar{color:#16181d;display:none}@media(min-width:1024px){.au-header__navbar{display:flex;align-items:center;gap:24px}}.au-header__navbar-item{position:relative}.au-header__navbar-item--is-dropdown{height:calc(100% + 8px);align-self:flex-start;display:flex;align-items:center;justify-content:center;padding-bottom:8px;gap:8px}.au-header__navbar-item--is-dropdown .au-icon{transition:transform .25s ease}.au-header__navbar-item--is-open .au-icon{transform:rotate(-180deg)}.au-header__navbar-item--is-open .au-header__dropdown{opacity:1;visibility:visible;transform:translateY(0)}.au-header__navbar-link{height:100%;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;color:inherit;text-align:inherit}.au-header__navbar-link .au-text{color:inherit;font-weight:inherit}.au-header__navbar-link[data-text],.au-header__navbar-link [data-text]{display:inline-flex;flex-direction:column}.au-header__navbar-link[data-text]:before,.au-header__navbar-link[data-text]:after,.au-header__navbar-link [data-text]:before,.au-header__navbar-link [data-text]:after{content:attr(data-text);height:0;overflow:hidden;visibility:hidden;-webkit-user-select:none;user-select:none;pointer-events:none}.au-header__navbar-link[data-text]:before,.au-header__navbar-link [data-text]:before{order:1;font-weight:300;letter-spacing:normal}.au-header__navbar-link[data-text]:after,.au-header__navbar-link [data-text]:after{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link--is-dropdown{position:relative;display:flex;align-items:center;justify-content:center;gap:8px}.au-header__navbar-link--is-active,.au-header__navbar-link:hover,.au-header__navbar-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link:hover,.au-header__navbar-link:focus{color:#16181d}.au-header__navbar-link--is-active{color:#0048db}.au-header__navbar-link--is-active:hover,.au-header__navbar-link--is-active:focus{color:#0048db}.au-header__dropdown{background-color:#fff;border-radius:16px;border:1px solid #e2e4e9;box-shadow:0 2px 8px #a9b1c514,0 4px 4px #0048db0a;max-width:230px;min-width:230px;position:absolute;overflow:hidden;z-index:2;top:100%;width:100%;left:-8px;opacity:0;visibility:hidden;transition:opacity .25s ease-in-out,transform .2s linear,visibility .25s ease-in-out;transform:translateY(-8px)}.au-header__dropdown-link{display:inline-block;padding:16px 24px;width:100%;display:flex;text-decoration:none;justify-content:space-between;cursor:pointer}.au-header__dropdown-link--is-active,.au-header__dropdown-link:hover,.au-header__dropdown-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__dropdown-link--is-active{color:#0048db;background-color:#fafbff;border-top:1px solid #e2e4e9}.au-header__actions{display:flex;align-items:center;gap:8px;margin-block:16px}@media(min-width:1024px){.au-header__actions--divider{border-left:1px solid #e2e4e9;padding-left:16px;margin-left:24px}}.au-header__profile{display:flex;align-items:center;gap:24px}.au-header__profile-notifications{cursor:pointer;position:relative;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}.au-header__profile-notifications-badge{position:absolute;top:-4px;right:-4px;background-color:#e52222;border-radius:999px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:700;height:18px;min-width:18px;padding:2px;border:1px solid #ffffff}.au-header__profile-notifications-badge:empty{width:12px;height:12px;min-width:12px;padding:0 4px;top:0;right:0}.au-header__profile-menu{display:none;align-items:center;gap:8px;cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__profile-menu{display:flex}}.au-header__profile-menu-mobile{display:block;cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__profile-menu-mobile{display:none}}.au-header__profile-letters{display:flex;align-items:center;justify-content:center;border-radius:50%;width:40px;height:40px;background-color:#9abcff;font-weight:500;font-family:Lexend Deca,sans-serif;color:#16181d;font-size:16px;text-transform:uppercase}.au-header__hamburger{cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__hamburger{display:none}}
|
|
1
|
+
.au-header{height:80px;border-bottom:1px solid #e2e4e9;background-color:#fff}.au-header--fixed{position:fixed;top:0;left:0;width:100%;z-index:5}.au-header--static{position:relative}.au-header__container{width:100%;max-width:1232px;margin:0 auto;padding:0 24px}@media(min-width:1024px){.au-header__container{padding:0 16px}}.au-header__container{height:100%;display:flex;justify-content:space-between;align-items:center;gap:16px}.au-header__logo{display:flex;align-items:center}.au-header__logo .au-text{padding-left:16px;margin-left:16px;border-left:1px solid #e2e4e9}.au-header__logo--mobile{display:block}@media(min-width:1024px){.au-header__logo--mobile{display:none}}.au-header__logo--desktop{display:none}@media(min-width:1024px){.au-header__logo--desktop{display:block}}.au-header__link{cursor:pointer}.au-header__button{cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}.au-header__badges{display:flex;align-items:center}.au-header__badges>*+*{padding-left:16px;margin-left:16px;position:relative}.au-header__badges>*+*:before{content:"";height:24px;width:1px;background-color:#e2e4e9;position:absolute;left:0;top:calc(50% - 12px)}.au-header__badges .au-logo img{width:100%}.au-header__badges--limited-width .au-logo{max-width:56px}.au-header__navigation{height:100%;display:flex}.au-header__navigation>*+*{margin-left:24px}.au-header__navbar{color:#16181d;display:none}@media(min-width:1024px){.au-header__navbar{display:flex;align-items:center;gap:24px}}.au-header__navbar-item{position:relative}.au-header__navbar-item--is-dropdown{height:calc(100% + 8px);align-self:flex-start;display:flex;align-items:center;justify-content:center;padding-bottom:8px;gap:8px}.au-header__navbar-item--is-dropdown .au-icon{transition:transform .25s ease}.au-header__navbar-item--is-open .au-icon{transform:rotate(-180deg)}.au-header__navbar-item--is-open .au-header__dropdown{opacity:1;visibility:visible;transform:translateY(0)}.au-header__navbar-link{height:100%;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;color:inherit;text-align:inherit;font-weight:300}.au-header__navbar-link .au-text{color:inherit;font-weight:inherit}.au-header__navbar-link[data-text],.au-header__navbar-link [data-text]{display:inline-flex;flex-direction:column}.au-header__navbar-link[data-text]:before,.au-header__navbar-link[data-text]:after,.au-header__navbar-link [data-text]:before,.au-header__navbar-link [data-text]:after{content:attr(data-text);height:0;overflow:hidden;visibility:hidden;-webkit-user-select:none;user-select:none;pointer-events:none}.au-header__navbar-link[data-text]:before,.au-header__navbar-link [data-text]:before{order:1;font-weight:300;letter-spacing:normal}.au-header__navbar-link[data-text]:after,.au-header__navbar-link [data-text]:after{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link--is-dropdown{position:relative;display:flex;align-items:center;justify-content:center;gap:8px}.au-header__navbar-link--is-active,.au-header__navbar-link:hover,.au-header__navbar-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__navbar-link:hover,.au-header__navbar-link:focus{color:#16181d}.au-header__navbar-link--is-active{color:#0048db}.au-header__navbar-link--is-active:hover,.au-header__navbar-link--is-active:focus{color:#0048db}.au-header__dropdown{background-color:#fff;border-radius:16px;border:1px solid #e2e4e9;box-shadow:0 2px 8px #a9b1c514,0 4px 4px #0048db0a;max-width:230px;min-width:230px;position:absolute;overflow:hidden;z-index:2;top:100%;width:100%;left:-8px;opacity:0;visibility:hidden;transition:opacity .25s ease-in-out,transform .2s linear,visibility .25s ease-in-out;transform:translateY(-8px)}.au-header__dropdown-link{display:inline-block;padding:16px 24px;width:100%;display:flex;text-decoration:none;justify-content:space-between;cursor:pointer}.au-header__dropdown-link--is-active,.au-header__dropdown-link:hover,.au-header__dropdown-link:focus{font-weight:700;letter-spacing:-.6px}.au-header__dropdown-link--is-active{color:#0048db;background-color:#fafbff;border-top:1px solid #e2e4e9}.au-header__actions{display:flex;align-items:center;gap:8px;margin-block:16px}@media(min-width:1024px){.au-header__actions--divider{border-left:1px solid #e2e4e9;padding-left:16px;margin-left:24px}}.au-header__profile{display:flex;align-items:center;gap:24px}.au-header__profile-notifications{cursor:pointer;position:relative;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}.au-header__profile-notifications-badge{position:absolute;top:-4px;right:-4px;background-color:#e52222;border-radius:999px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:700;height:18px;min-width:18px;padding:2px;border:1px solid #ffffff}.au-header__profile-notifications-badge:empty{width:12px;height:12px;min-width:12px;padding:0 4px;top:0;right:0}.au-header__profile-menu{display:none;align-items:center;gap:8px;cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__profile-menu{display:flex}}.au-header__profile-menu-mobile{display:block;cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__profile-menu-mobile{display:none}}.au-header__profile-letters{display:flex;align-items:center;justify-content:center;border-radius:50%;width:40px;height:40px;background-color:#9abcff;font-weight:500;font-family:Lexend Deca,sans-serif;color:#16181d;font-size:16px;text-transform:uppercase}.au-header__hamburger{cursor:pointer;border:none;background:none;padding:0;font:inherit;color:inherit;text-align:inherit}@media(min-width:1024px){.au-header__hamburger{display:none}}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type PartnerBannerProps = {
|
|
3
3
|
text: string;
|
|
4
|
-
|
|
4
|
+
/** Rótulo da ação, um Link Button small. Sem ele, o banner sai só com o texto (Show Action desligado no Figma). */
|
|
5
|
+
btnText?: string;
|
|
6
|
+
/** Logo do parceiro, recortado em 32x32 com raio 8 (Figma: Partner, Size=Minimum). Um Skeleton serve só para montar a tela. */
|
|
5
7
|
icon?: ReactNode;
|
|
6
8
|
onButtonClick?: () => void;
|
|
7
9
|
ariaLabel?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-BW2ZU5Hx.js";
|
|
3
|
+
import { LinkButton } from "../LinkButton/index.es.js";
|
|
3
4
|
import { Text } from "../Text/index.es.js";
|
|
4
5
|
import './styles.css';const PartnerBanner = ({
|
|
5
6
|
text,
|
|
@@ -27,13 +28,13 @@ import './styles.css';const PartnerBanner = ({
|
|
|
27
28
|
children: text
|
|
28
29
|
}
|
|
29
30
|
),
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
|
|
31
|
+
btnText && /* @__PURE__ */ jsx(
|
|
32
|
+
LinkButton,
|
|
32
33
|
{
|
|
33
|
-
|
|
34
|
+
size: "small",
|
|
34
35
|
className: "au-partner-banner__button",
|
|
35
36
|
onClick: onButtonClick,
|
|
36
|
-
children:
|
|
37
|
+
children: btnText
|
|
37
38
|
}
|
|
38
39
|
)
|
|
39
40
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/PartnerBanner/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { Text } from '@components/Text'\nimport './styles.scss'\n\nexport type PartnerBannerProps = {\n text: string\n btnText
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/PartnerBanner/index.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { LinkButton } from '@components/LinkButton'\nimport { Text } from '@components/Text'\nimport './styles.scss'\n\nexport type PartnerBannerProps = {\n text: string\n /** Rótulo da ação, um Link Button small. Sem ele, o banner sai só com o texto (Show Action desligado no Figma). */\n btnText?: string\n /** Logo do parceiro, recortado em 32x32 com raio 8 (Figma: Partner, Size=Minimum). Um Skeleton serve só para montar a tela. */\n icon?: ReactNode\n onButtonClick?: () => void\n ariaLabel?: string\n className?: string\n 'data-testid'?: string\n}\n\nexport const PartnerBanner = ({\n text,\n btnText,\n icon,\n onButtonClick,\n ariaLabel,\n className = '',\n 'data-testid': dataTestId,\n}: PartnerBannerProps) => {\n const classes = classNames('au-partner-banner', {\n [`au-partner-banner--with-icon`]: !!icon,\n [className]: !!className,\n })\n\n return (\n <aside className={classes} aria-label={ariaLabel} data-testid={dataTestId}>\n {icon && (\n <div className=\"au-partner-banner__icon\" aria-hidden=\"true\">\n {icon}\n </div>\n )}\n <div className=\"au-partner-banner__content\">\n <Text\n as=\"p\"\n variant=\"body-small\"\n color=\"secondary\"\n className=\"au-partner-banner__text\">\n {text}\n </Text>\n {btnText && (\n <LinkButton\n size=\"small\"\n className=\"au-partner-banner__button\"\n onClick={onButtonClick}>\n {btnText}\n </LinkButton>\n )}\n </div>\n </aside>\n )\n}\n"],"names":[],"mappings":";;;;AAkBO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,eAAe;AACjB,MAA0B;AACxB,QAAM,UAAU,WAAW,qBAAqB;AAAA,IAC9C,CAAC,8BAA8B,GAAG,CAAC,CAAC;AAAA,IACpC,CAAC,SAAS,GAAG,CAAC,CAAC;AAAA,EAAA,CAChB;AAED,8BACG,SAAA,EAAM,WAAW,SAAS,cAAY,WAAW,eAAa,YAC5D,UAAA;AAAA,IAAA,4BACE,OAAA,EAAI,WAAU,2BAA0B,eAAY,QAClD,UAAA,MACH;AAAA,IAEF,qBAAC,OAAA,EAAI,WAAU,8BACb,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAG;AAAA,UACH,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,WAAU;AAAA,UACT,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,WACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UACR,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-partner-banner{display:flex;gap:16px;border-radius:16px;background-color:#f6f7fa;padding:16px;width:272px}.au-partner-banner__content{display:flex;flex-direction:column;align-items:start;gap:8px}.au-partner-banner__icon{display:inline-flex;align-items:center;justify-content:center;
|
|
1
|
+
.au-partner-banner{display:flex;gap:16px;border-radius:16px;background-color:#f6f7fa;padding:16px;width:272px}.au-partner-banner__content{display:flex;flex-direction:column;align-items:start;gap:8px}.au-partner-banner__icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;border-radius:8px;overflow:hidden}.au-partner-banner__icon>img{width:100%;height:100%;object-fit:cover}.au-partner-banner__text{margin:0}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type ProgressBarBaseProps = {
|
|
2
|
+
/** Texto da descrição; também é o `aria-label` da barra. */
|
|
3
3
|
stepName: string;
|
|
4
|
+
/** Mostra a descrição (label e contador) abaixo da barra. */
|
|
5
|
+
showDescription?: boolean;
|
|
6
|
+
/** Barra contínua com percentual em vez de etapas. Ligado sozinho quando há `percentage`. */
|
|
7
|
+
percentageMode?: boolean;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Percentage Bar do Figma: avanço contínuo de 0 a 100. */
|
|
11
|
+
type ProgressBarPercentageProps = {
|
|
12
|
+
percentage: number;
|
|
13
|
+
currentStep?: never;
|
|
14
|
+
totalSteps?: never;
|
|
15
|
+
};
|
|
16
|
+
/** Step Bar do Figma: etapas definidas (de 2 a 6 no design). */
|
|
17
|
+
type ProgressBarStepProps = {
|
|
18
|
+
percentage?: undefined;
|
|
4
19
|
currentStep: number;
|
|
5
20
|
totalSteps: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const ProgressBar:
|
|
21
|
+
};
|
|
22
|
+
export type ProgressBarProps = ProgressBarBaseProps & (ProgressBarPercentageProps | ProgressBarStepProps);
|
|
23
|
+
export declare const ProgressBar: ({ percentageMode, percentage, stepName, currentStep, totalSteps, showDescription, "data-testid": dataTestId, }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
24
|
export {};
|
|
@@ -4,30 +4,34 @@ import { c as classNames } from "../../index-BW2ZU5Hx.js";
|
|
|
4
4
|
import { Text } from "../Text/index.es.js";
|
|
5
5
|
import './styles.css';const ProgressBar = ({
|
|
6
6
|
percentageMode = false,
|
|
7
|
+
percentage,
|
|
7
8
|
stepName,
|
|
8
9
|
currentStep,
|
|
9
10
|
totalSteps,
|
|
11
|
+
showDescription = true,
|
|
10
12
|
"data-testid": dataTestId
|
|
11
13
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
+
const isPercentage = percentageMode || percentage !== void 0;
|
|
15
|
+
const steps = Math.max(1, totalSteps ?? 1);
|
|
16
|
+
const safeCurrentStep = Math.max(1, Math.min(currentStep ?? 1, steps));
|
|
17
|
+
const percentageWidth = percentage !== void 0 ? Math.max(0, Math.min(percentage, 100)) : safeCurrentStep / steps * 100;
|
|
14
18
|
const roundedPercentage = Math.round(percentageWidth);
|
|
15
|
-
const progressText =
|
|
19
|
+
const progressText = isPercentage ? `${roundedPercentage}%` : `${safeCurrentStep} de ${steps}`;
|
|
16
20
|
return /* @__PURE__ */ jsxs(
|
|
17
21
|
"div",
|
|
18
22
|
{
|
|
19
23
|
className: "au-progress-bar",
|
|
20
24
|
role: "progressbar",
|
|
21
|
-
"aria-valuenow":
|
|
22
|
-
"aria-valuemin":
|
|
23
|
-
"aria-valuemax":
|
|
25
|
+
"aria-valuenow": isPercentage ? roundedPercentage : safeCurrentStep,
|
|
26
|
+
"aria-valuemin": isPercentage ? 0 : 1,
|
|
27
|
+
"aria-valuemax": isPercentage ? 100 : steps,
|
|
24
28
|
"aria-label": stepName,
|
|
25
29
|
"data-testid": dataTestId,
|
|
26
30
|
children: [
|
|
27
31
|
/* @__PURE__ */ jsx(
|
|
28
32
|
Conditional,
|
|
29
33
|
{
|
|
30
|
-
condition:
|
|
34
|
+
condition: isPercentage,
|
|
31
35
|
renderIf: /* @__PURE__ */ jsx("div", { className: "au-progress-bar__bar", children: /* @__PURE__ */ jsx(
|
|
32
36
|
"div",
|
|
33
37
|
{
|
|
@@ -35,7 +39,7 @@ import './styles.css';const ProgressBar = ({
|
|
|
35
39
|
className: "au-progress-bar__bar-filled"
|
|
36
40
|
}
|
|
37
41
|
) }),
|
|
38
|
-
renderElse: /* @__PURE__ */ jsx("div", { className: "au-progress-bar__steps", children: Array.from({ length:
|
|
42
|
+
renderElse: /* @__PURE__ */ jsx("div", { className: "au-progress-bar__steps", children: Array.from({ length: steps }).map((_, index) => /* @__PURE__ */ jsx("div", { className: "au-progress-bar__step-container", children: /* @__PURE__ */ jsx(
|
|
39
43
|
"div",
|
|
40
44
|
{
|
|
41
45
|
className: classNames("au-progress-bar__step-filled", {
|
|
@@ -45,9 +49,9 @@ import './styles.css';const ProgressBar = ({
|
|
|
45
49
|
) }, index)) })
|
|
46
50
|
}
|
|
47
51
|
),
|
|
48
|
-
/* @__PURE__ */ jsxs("div", { className: "au-progress-bar__text", children: [
|
|
49
|
-
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", children: stepName }),
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", children: progressText })
|
|
52
|
+
showDescription && /* @__PURE__ */ jsxs("div", { className: "au-progress-bar__text", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", color: "secondary", children: stepName }),
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", color: "secondary", children: progressText })
|
|
51
55
|
] })
|
|
52
56
|
]
|
|
53
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/ProgressBar/index.tsx"],"sourcesContent":["import { Conditional } from '@components/misc'\nimport classNames from 'classnames'\nimport { Text } from '../Text'\n\nimport './styles.scss'\n\
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/ProgressBar/index.tsx"],"sourcesContent":["import { Conditional } from '@components/misc'\nimport classNames from 'classnames'\nimport { Text } from '../Text'\n\nimport './styles.scss'\n\ntype ProgressBarBaseProps = {\n /** Texto da descrição; também é o `aria-label` da barra. */\n stepName: string\n /** Mostra a descrição (label e contador) abaixo da barra. */\n showDescription?: boolean\n /** Barra contínua com percentual em vez de etapas. Ligado sozinho quando há `percentage`. */\n percentageMode?: boolean\n 'data-testid'?: string\n}\n\n/** Percentage Bar do Figma: avanço contínuo de 0 a 100. */\ntype ProgressBarPercentageProps = {\n percentage: number\n currentStep?: never\n totalSteps?: never\n}\n\n/** Step Bar do Figma: etapas definidas (de 2 a 6 no design). */\ntype ProgressBarStepProps = {\n percentage?: undefined\n currentStep: number\n totalSteps: number\n}\n\nexport type ProgressBarProps = ProgressBarBaseProps & (ProgressBarPercentageProps | ProgressBarStepProps)\n\nexport const ProgressBar = ({\n percentageMode = false,\n percentage,\n stepName,\n currentStep,\n totalSteps,\n showDescription = true,\n 'data-testid': dataTestId,\n}: ProgressBarProps) => {\n const isPercentage = percentageMode || percentage !== undefined\n const steps = Math.max(1, totalSteps ?? 1)\n const safeCurrentStep = Math.max(1, Math.min(currentStep ?? 1, steps))\n const percentageWidth =\n percentage !== undefined ? Math.max(0, Math.min(percentage, 100)) : (safeCurrentStep / steps) * 100\n const roundedPercentage = Math.round(percentageWidth)\n\n const progressText = isPercentage ? `${roundedPercentage}%` : `${safeCurrentStep} de ${steps}`\n\n return (\n <div\n className=\"au-progress-bar\"\n role=\"progressbar\"\n aria-valuenow={isPercentage ? roundedPercentage : safeCurrentStep}\n aria-valuemin={isPercentage ? 0 : 1}\n aria-valuemax={isPercentage ? 100 : steps}\n aria-label={stepName}\n data-testid={dataTestId}>\n <Conditional\n condition={isPercentage}\n renderIf={\n <div className=\"au-progress-bar__bar\">\n <div\n style={{ width: `${percentageWidth}%` }}\n className=\"au-progress-bar__bar-filled\"\n />\n </div>\n }\n renderElse={\n <div className=\"au-progress-bar__steps\">\n {Array.from({ length: steps }).map((_, index) => (\n <div key={index} className=\"au-progress-bar__step-container\">\n <div\n className={classNames('au-progress-bar__step-filled', {\n 'au-progress-bar__step-filled--is-active':\n index < safeCurrentStep,\n })}\n />\n </div>\n ))}\n </div>\n }\n />\n\n {showDescription && (\n <div className=\"au-progress-bar__text\">\n <Text as=\"span\" variant=\"body-medium\" color=\"secondary\">\n {stepName}\n </Text>\n\n <Text as=\"span\" variant=\"body-medium\" color=\"secondary\">\n {progressText}\n </Text>\n </div>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";;;;AAgCO,MAAM,cAAc,CAAC;AAAA,EAC1B,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,eAAe;AACjB,MAAwB;AACtB,QAAM,eAAe,kBAAkB,eAAe;AACtD,QAAM,QAAQ,KAAK,IAAI,GAAG,cAAc,CAAC;AACzC,QAAM,kBAAkB,KAAK,IAAI,GAAG,KAAK,IAAI,eAAe,GAAG,KAAK,CAAC;AACrE,QAAM,kBACJ,eAAe,SAAY,KAAK,IAAI,GAAG,KAAK,IAAI,YAAY,GAAG,CAAC,IAAK,kBAAkB,QAAS;AAClG,QAAM,oBAAoB,KAAK,MAAM,eAAe;AAEpD,QAAM,eAAe,eAAe,GAAG,iBAAiB,MAAM,GAAG,eAAe,OAAO,KAAK;AAE5F,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,MAAK;AAAA,MACL,iBAAe,eAAe,oBAAoB;AAAA,MAClD,iBAAe,eAAe,IAAI;AAAA,MAClC,iBAAe,eAAe,MAAM;AAAA,MACpC,cAAY;AAAA,MACZ,eAAa;AAAA,MACb,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,YACX,UACE,oBAAC,OAAA,EAAI,WAAU,wBACb,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO,EAAE,OAAO,GAAG,eAAe,IAAA;AAAA,gBAClC,WAAU;AAAA,cAAA;AAAA,YAAA,GAEd;AAAA,YAEF,YACE,oBAAC,OAAA,EAAI,WAAU,0BACZ,UAAA,MAAM,KAAK,EAAE,QAAQ,OAAO,EAAE,IAAI,CAAC,GAAG,UACrC,oBAAC,OAAA,EAAgB,WAAU,mCACzB,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW,WAAW,gCAAgC;AAAA,kBACpD,2CACE,QAAQ;AAAA,gBAAA,CACX;AAAA,cAAA;AAAA,YAAA,EACH,GANQ,KAOV,CACD,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,QAIH,mBACC,qBAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,UAAA,oBAAC,QAAK,IAAG,QAAO,SAAQ,eAAc,OAAM,aACzC,UAAA,SAAA,CACH;AAAA,UAEA,oBAAC,QAAK,IAAG,QAAO,SAAQ,eAAc,OAAM,aACzC,UAAA,aAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-progress-bar{display:flex;flex-direction:column;gap:
|
|
1
|
+
.au-progress-bar{display:flex;flex-direction:column;gap:16px}.au-progress-bar__bar{background-color:#e2e4e9;overflow:hidden;border-radius:999px;width:100%;height:8px}.au-progress-bar__bar-filled{background-color:#0048db;transition:width .3s ease-in-out;border-radius:999px;height:8px}.au-progress-bar__steps{display:flex;width:100%;gap:6px}.au-progress-bar__step-container{display:flex;align-items:center;justify-content:center;background-color:#e2e4e9;border-radius:4px;width:100%;height:8px}.au-progress-bar__step-filled{transition:background-color .3s ease-in-out;background-color:transparent;border-radius:4px;width:100%;height:100%}.au-progress-bar__step-filled--is-active{background-color:#0048db}.au-progress-bar__text{display:flex;flex-direction:row;justify-content:space-between;gap:8px}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { SwitchProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Switch` (`lib/components/Switch`), which follows the Figma
|
|
4
|
+
* spec: 40x20 track with check/x icons, label 14/22, `textDirection` and `description`.
|
|
5
|
+
* `isActive` becomes `checked`/`defaultChecked`, and the two callbacks become
|
|
6
|
+
* `onChange(checked)`. This component will be removed in the next major.
|
|
7
|
+
*/
|
|
2
8
|
export declare const PureSwitch: React.FC<SwitchProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/Switch/Pure/index.tsx"],"sourcesContent":["import './styles.scss';\n\nimport { SwitchProps } from './types';\n\n\nexport const PureSwitch: React.FC<SwitchProps> = ({\n\tisActive,\n\tlabel,\n\tid,\n\tdisabled,\n\tactivateCallBack,\n\tdeactivateCallBack,\n\t'data-testid': dataTestId,\n}) => {\n\tconst handleToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst isActivated = event.target.checked;\n\n if(isActivated) return activateCallBack();\n\n\t\treturn deactivateCallBack?.()\n };\n\t\n\treturn (\n <div className=\"au-switch\" data-testid={dataTestId}>\n <label htmlFor={id} className=\"au-switch-label\">\n\t\t\t\t<span>{label}</span>\n\t\t\t\t<div className=\"au-switch-container\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tclassName=\"au-switch-checkbox\"\n\t\t\t\t\t\tchecked={isActive}\n\t\t\t\t\t\tonChange={handleToggle}\n\t\t\t\t\t\trole=\"switch\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"au-switch-track\">\n\t\t\t\t\t\t<div className=\"au-switch-thumb\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n </label>\n </div>\n )\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../lib/components/Switch/Pure/index.tsx"],"sourcesContent":["import './styles.scss';\n\nimport { SwitchProps } from './types';\n\n\n/**\n * @deprecated Use `Switch` (`lib/components/Switch`), which follows the Figma\n * spec: 40x20 track with check/x icons, label 14/22, `textDirection` and `description`.\n * `isActive` becomes `checked`/`defaultChecked`, and the two callbacks become\n * `onChange(checked)`. This component will be removed in the next major.\n */\nexport const PureSwitch: React.FC<SwitchProps> = ({\n\tisActive,\n\tlabel,\n\tid,\n\tdisabled,\n\tactivateCallBack,\n\tdeactivateCallBack,\n\t'data-testid': dataTestId,\n}) => {\n\tconst handleToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst isActivated = event.target.checked;\n\n if(isActivated) return activateCallBack();\n\n\t\treturn deactivateCallBack?.()\n };\n\t\n\treturn (\n <div className=\"au-switch\" data-testid={dataTestId}>\n <label htmlFor={id} className=\"au-switch-label\">\n\t\t\t\t<span>{label}</span>\n\t\t\t\t<div className=\"au-switch-container\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tclassName=\"au-switch-checkbox\"\n\t\t\t\t\t\tchecked={isActive}\n\t\t\t\t\t\tonChange={handleToggle}\n\t\t\t\t\t\trole=\"switch\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className=\"au-switch-track\">\n\t\t\t\t\t\t<div className=\"au-switch-thumb\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n </label>\n </div>\n )\n}\n"],"names":[],"mappings":";AAWO,MAAM,aAAoC,CAAC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAChB,MAAM;AACL,QAAM,eAAe,CAAC,UAA+C;AACpE,UAAM,cAAc,MAAM,OAAO;AAE/B,QAAG,oBAAoB,iBAAA;AAEzB,WAAO;AAAA,EACP;AAED,SACG,oBAAC,OAAA,EAAI,WAAU,aAAY,eAAa,YACtC,UAAA,qBAAC,SAAA,EAAM,SAAS,IAAI,WAAU,mBAChC,UAAA;AAAA,IAAA,oBAAC,UAAM,UAAA,MAAA,CAAM;AAAA,IACb,qBAAC,OAAA,EAAI,WAAU,uBACd,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACA;AAAA,UACA,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAK;AAAA,UACL;AAAA,QAAA;AAAA,MAAA;AAAA,MAGD,oBAAC,SAAI,WAAU,mBACd,8BAAC,OAAA,EAAI,WAAU,mBAAkB,EAAA,CAClC;AAAA,IAAA,EAAA,CACD;AAAA,EAAA,EAAA,CACA,EAAA,CACA;AAEJ;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type SwitchTextDirection = 'left' | 'right';
|
|
2
|
+
export type SwitchProps = {
|
|
3
|
+
/** Texto do switch (Show Text / Edit Text no Figma). Sem `label`, passe `aria-label`. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Texto de apoio abaixo do label, em até duas linhas (Description no Figma). */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Lado do texto em relação ao switch (Text Direction no Figma). */
|
|
8
|
+
textDirection?: SwitchTextDirection;
|
|
9
|
+
/** Ocupa a largura do container: o texto cresce e o switch vai para a borda oposta. Sem ela, o switch fica a 8px do texto. */
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
/** Estado controlado. Sem ele, o switch guarda o próprio estado a partir de `defaultChecked`. */
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
defaultChecked?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Atributos do `<input type="checkbox" role="switch">`. */
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
value?: string;
|
|
19
|
+
onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
'aria-label'?: string;
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const Switch: ({ label, description, textDirection, fullWidth, checked, defaultChecked, disabled, id, name, value, onChange, "aria-label": ariaLabel, "data-testid": dataTestId, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../index-BW2ZU5Hx.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import "../Icon/index.es.js";
|
|
5
|
+
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
6
|
+
import { IconX } from "../icons/IconX/index.es.js";
|
|
7
|
+
import './styles.css';const Switch = ({
|
|
8
|
+
label,
|
|
9
|
+
description,
|
|
10
|
+
textDirection = "left",
|
|
11
|
+
fullWidth = false,
|
|
12
|
+
checked,
|
|
13
|
+
defaultChecked = false,
|
|
14
|
+
disabled = false,
|
|
15
|
+
id,
|
|
16
|
+
name,
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
"aria-label": ariaLabel,
|
|
20
|
+
"data-testid": dataTestId
|
|
21
|
+
}) => {
|
|
22
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
23
|
+
const isControlled = checked !== void 0;
|
|
24
|
+
const isChecked = isControlled ? checked : internalChecked;
|
|
25
|
+
const handleChange = (event) => {
|
|
26
|
+
if (!isControlled) setInternalChecked(event.target.checked);
|
|
27
|
+
onChange == null ? void 0 : onChange(event.target.checked, event);
|
|
28
|
+
};
|
|
29
|
+
const classes = classNames("au-switch-field", {
|
|
30
|
+
"au-switch-field--direction-left": textDirection === "left",
|
|
31
|
+
"au-switch-field--direction-right": textDirection === "right",
|
|
32
|
+
"au-switch-field--with-description": !!description,
|
|
33
|
+
"au-switch-field--full-width": fullWidth,
|
|
34
|
+
"au-switch-field--disabled": disabled
|
|
35
|
+
});
|
|
36
|
+
return /* @__PURE__ */ jsxs("label", { className: classes, "data-testid": dataTestId, children: [
|
|
37
|
+
label && /* @__PURE__ */ jsxs("span", { className: "au-switch-field__text", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "au-switch-field__label", children: label }),
|
|
39
|
+
description && /* @__PURE__ */ jsx("span", { className: "au-switch-field__description", children: description })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ jsxs("span", { className: "au-switch-field__control", children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"input",
|
|
44
|
+
{
|
|
45
|
+
className: "au-switch-field__input",
|
|
46
|
+
type: "checkbox",
|
|
47
|
+
role: "switch",
|
|
48
|
+
id,
|
|
49
|
+
name,
|
|
50
|
+
...value !== void 0 && { value },
|
|
51
|
+
checked: isChecked,
|
|
52
|
+
disabled,
|
|
53
|
+
onChange: handleChange,
|
|
54
|
+
"aria-label": ariaLabel
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: "au-switch-field__track", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("span", { className: "au-switch-field__thumb", children: [
|
|
58
|
+
/* @__PURE__ */ jsx(IconCheck, { className: "au-switch-field__icon au-switch-field__icon--on" }),
|
|
59
|
+
/* @__PURE__ */ jsx(IconX, { className: "au-switch-field__icon au-switch-field__icon--off" })
|
|
60
|
+
] }) })
|
|
61
|
+
] })
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
Switch
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Switch/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useState } from 'react'\nimport { IconCheck, IconX } from '@components/icons'\nimport './styles.scss'\n\nexport type SwitchTextDirection = 'left' | 'right'\n\nexport type SwitchProps = {\n /** Texto do switch (Show Text / Edit Text no Figma). Sem `label`, passe `aria-label`. */\n label?: string\n /** Texto de apoio abaixo do label, em até duas linhas (Description no Figma). */\n description?: string\n /** Lado do texto em relação ao switch (Text Direction no Figma). */\n textDirection?: SwitchTextDirection\n /** Ocupa a largura do container: o texto cresce e o switch vai para a borda oposta. Sem ela, o switch fica a 8px do texto. */\n fullWidth?: boolean\n /** Estado controlado. Sem ele, o switch guarda o próprio estado a partir de `defaultChecked`. */\n checked?: boolean\n defaultChecked?: boolean\n disabled?: boolean\n /** Atributos do `<input type=\"checkbox\" role=\"switch\">`. */\n id?: string\n name?: string\n value?: string\n onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void\n 'aria-label'?: string\n 'data-testid'?: string\n}\n\nexport const Switch = ({\n label,\n description,\n textDirection = 'left',\n fullWidth = false,\n checked,\n defaultChecked = false,\n disabled = false,\n id,\n name,\n value,\n onChange,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n}: SwitchProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked)\n const isControlled = checked !== undefined\n const isChecked = isControlled ? checked : internalChecked\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) setInternalChecked(event.target.checked)\n onChange?.(event.target.checked, event)\n }\n\n const classes = classNames('au-switch-field', {\n 'au-switch-field--direction-left': textDirection === 'left',\n 'au-switch-field--direction-right': textDirection === 'right',\n 'au-switch-field--with-description': !!description,\n 'au-switch-field--full-width': fullWidth,\n 'au-switch-field--disabled': disabled,\n })\n\n return (\n <label className={classes} data-testid={dataTestId}>\n {label && (\n <span className=\"au-switch-field__text\">\n <span className=\"au-switch-field__label\">{label}</span>\n {description && <span className=\"au-switch-field__description\">{description}</span>}\n </span>\n )}\n <span className=\"au-switch-field__control\">\n <input\n className=\"au-switch-field__input\"\n type=\"checkbox\"\n role=\"switch\"\n id={id}\n name={name}\n // React sets `value=\"\"` on the input when the key exists, even as\n // `undefined`; the native checkbox (and the Astro one) submit \"on\".\n {...(value !== undefined && { value })}\n checked={isChecked}\n disabled={disabled}\n onChange={handleChange}\n aria-label={ariaLabel}\n />\n <span className=\"au-switch-field__track\" aria-hidden=\"true\">\n <span className=\"au-switch-field__thumb\">\n <IconCheck className=\"au-switch-field__icon au-switch-field__icon--on\" />\n <IconX className=\"au-switch-field__icon au-switch-field__icon--off\" />\n </span>\n </span>\n </span>\n </label>\n )\n}\n"],"names":[],"mappings":";;;;;;AA6BO,MAAM,SAAS,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe;AACjB,MAAmB;AACjB,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAS,cAAc;AACrE,QAAM,eAAe,YAAY;AACjC,QAAM,YAAY,eAAe,UAAU;AAE3C,QAAM,eAAe,CAAC,UAA+C;AACnE,QAAI,CAAC,aAAc,oBAAmB,MAAM,OAAO,OAAO;AAC1D,yCAAW,MAAM,OAAO,SAAS;AAAA,EACnC;AAEA,QAAM,UAAU,WAAW,mBAAmB;AAAA,IAC5C,mCAAmC,kBAAkB;AAAA,IACrD,oCAAoC,kBAAkB;AAAA,IACtD,qCAAqC,CAAC,CAAC;AAAA,IACvC,+BAA+B;AAAA,IAC/B,6BAA6B;AAAA,EAAA,CAC9B;AAED,SACE,qBAAC,SAAA,EAAM,WAAW,SAAS,eAAa,YACrC,UAAA;AAAA,IAAA,SACC,qBAAC,QAAA,EAAK,WAAU,yBACd,UAAA;AAAA,MAAA,oBAAC,QAAA,EAAK,WAAU,0BAA0B,UAAA,OAAM;AAAA,MAC/C,eAAe,oBAAC,QAAA,EAAK,WAAU,gCAAgC,UAAA,YAAA,CAAY;AAAA,IAAA,GAC9E;AAAA,IAEF,qBAAC,QAAA,EAAK,WAAU,4BACd,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAK;AAAA,UACL,MAAK;AAAA,UACL;AAAA,UACA;AAAA,UAGC,GAAI,UAAU,UAAa,EAAE,MAAA;AAAA,UAC9B,SAAS;AAAA,UACT;AAAA,UACA,UAAU;AAAA,UACV,cAAY;AAAA,QAAA;AAAA,MAAA;AAAA,MAEd,oBAAC,UAAK,WAAU,0BAAyB,eAAY,QACnD,UAAA,qBAAC,QAAA,EAAK,WAAU,0BACd,UAAA;AAAA,QAAA,oBAAC,WAAA,EAAU,WAAU,kDAAA,CAAkD;AAAA,QACvE,oBAAC,OAAA,EAAM,WAAU,mDAAA,CAAmD;AAAA,MAAA,EAAA,CACtE,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.au-switch-field{display:flex;width:fit-content;align-items:center;gap:8px;font-family:"Source Sans 3",sans-serif;font-size:14px;font-weight:400;line-height:22px;color:#454a54;cursor:pointer;-webkit-user-select:none;user-select:none}.au-switch-field--direction-right .au-switch-field__text{order:1}.au-switch-field--with-description{align-items:flex-start}.au-switch-field--with-description .au-switch-field__label{font-weight:600;color:#313131}.au-switch-field--full-width{width:100%}.au-switch-field--disabled{cursor:default}.au-switch-field__text{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.au-switch-field__label{display:block}.au-switch-field__description{display:block;margin-top:4px;font-weight:400;color:#5e6573}.au-switch-field__control{display:flex;flex:none;align-items:center;height:22px}.au-switch-field__input{position:absolute;width:0;height:0;margin:0;opacity:0}.au-switch-field__track{position:relative;display:block;width:40px;height:20px;border-radius:999px;background-color:#5e6573;transition:background-color .2s ease-in-out}.au-switch-field__thumb{position:absolute;top:2px;left:2px;display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background-color:#fff;transition:transform .2s ease-in-out,background-color .2s ease-in-out}.au-switch-field__thumb .au-switch-field__icon,.au-switch-field__thumb .au-switch-field__icon>svg{width:13px;height:13px}.au-switch-field__thumb .au-switch-field__icon>svg{color:#313131}.au-switch-field__thumb .au-switch-field__icon--on{display:none}.au-switch-field__input:checked+.au-switch-field__track{background-color:#0048db}.au-switch-field__input:checked+.au-switch-field__track .au-switch-field__thumb{transform:translate(20px)}.au-switch-field__input:checked+.au-switch-field__track .au-switch-field__icon--on{display:flex}.au-switch-field__input:checked+.au-switch-field__track .au-switch-field__icon--off{display:none}.au-switch-field__input:checked+.au-switch-field__track .au-switch-field__icon>svg{color:#0048db}.au-switch-field:hover .au-switch-field__input:not(:disabled)+.au-switch-field__track .au-switch-field__thumb{background-color:#e2e4e9}.au-switch-field:hover .au-switch-field__input:checked:not(:disabled)+.au-switch-field__track .au-switch-field__thumb{background-color:#dce8ff}.au-switch-field__input:focus-visible+.au-switch-field__track{outline:2px solid #0048db;outline-offset:2px}.au-switch-field__input:disabled+.au-switch-field__track{background-color:#c4c9d4}.au-switch-field__input:disabled+.au-switch-field__track .au-switch-field__thumb{background-color:#5e6573}.au-switch-field__input:disabled+.au-switch-field__track .au-switch-field__icon>svg{color:#c4c9d4}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
export type TransitionAlign = 'left' | 'center';
|
|
2
2
|
export type TransitionProps = {
|
|
3
|
+
/** Etapas do processo, na ordem; cada uma vira a mensagem da tela por `messageDuration`. */
|
|
3
4
|
messages: string[];
|
|
5
|
+
/** Tempo de cada etapa em ms. */
|
|
4
6
|
messageDuration?: number;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated O alinhamento segue o tamanho da tela, como no Figma: à esquerda
|
|
9
|
+
* no Mobile e centralizado no Desktop (a partir de 1024px). Use só para forçar um dos dois.
|
|
10
|
+
*/
|
|
5
11
|
align?: TransitionAlign;
|
|
12
|
+
/** Enquanto `true`, segura na penúltima etapa até o processo real terminar. */
|
|
6
13
|
isLoading?: boolean;
|
|
14
|
+
/** Chamado depois que a última etapa ficou na tela por `messageDuration`. */
|
|
7
15
|
onFinish?: () => void;
|
|
8
16
|
className?: string;
|
|
9
17
|
'data-testid'?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-BW2ZU5Hx.js";
|
|
3
3
|
import { Text } from "../Text/index.es.js";
|
|
4
4
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -41,13 +41,13 @@ import './styles.css';const useTransition = ({
|
|
|
41
41
|
}, messageDuration);
|
|
42
42
|
return () => clearTimeout(timer);
|
|
43
43
|
}, [isLast, messageDuration]);
|
|
44
|
-
const progress = mounted && totalMessages > 0 ? (currentStep +
|
|
44
|
+
const progress = mounted && totalMessages > 0 ? (currentStep + 0.5) / totalMessages * 100 : 0;
|
|
45
45
|
return { currentStep, progress };
|
|
46
46
|
};
|
|
47
47
|
const Transition = ({
|
|
48
48
|
messages,
|
|
49
49
|
messageDuration = 2e3,
|
|
50
|
-
align
|
|
50
|
+
align,
|
|
51
51
|
isLoading,
|
|
52
52
|
onFinish,
|
|
53
53
|
className,
|
|
@@ -61,30 +61,26 @@ const Transition = ({
|
|
|
61
61
|
});
|
|
62
62
|
const currentMessage = messages[currentStep] ?? "";
|
|
63
63
|
const previousMessage = currentStep > 0 ? messages[currentStep - 1] : null;
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
67
|
className: classNames(
|
|
68
68
|
"au-transition",
|
|
69
|
-
`au-transition--align-${align}
|
|
69
|
+
{ [`au-transition--align-${align}`]: !!align },
|
|
70
70
|
className
|
|
71
71
|
),
|
|
72
72
|
"data-testid": dataTestId,
|
|
73
|
-
children: [
|
|
73
|
+
children: /* @__PURE__ */ jsxs("div", { className: "au-transition__content", children: [
|
|
74
74
|
/* @__PURE__ */ jsxs("div", { className: "au-transition__messages", children: [
|
|
75
|
-
/* @__PURE__ */ jsx(
|
|
75
|
+
previousMessage && /* @__PURE__ */ jsx(
|
|
76
76
|
Text,
|
|
77
77
|
{
|
|
78
78
|
as: "p",
|
|
79
79
|
variant: "heading-medium",
|
|
80
80
|
weight: "semibold",
|
|
81
81
|
"aria-hidden": "true",
|
|
82
|
-
className:
|
|
83
|
-
|
|
84
|
-
"au-transition__message--previous",
|
|
85
|
-
{ "au-transition__message--hidden": !previousMessage }
|
|
86
|
-
),
|
|
87
|
-
children: previousMessage || " "
|
|
82
|
+
className: "au-transition__message au-transition__message--previous",
|
|
83
|
+
children: previousMessage
|
|
88
84
|
}
|
|
89
85
|
),
|
|
90
86
|
/* @__PURE__ */ jsx(
|
|
@@ -121,7 +117,7 @@ const Transition = ({
|
|
|
121
117
|
)
|
|
122
118
|
}
|
|
123
119
|
)
|
|
124
|
-
]
|
|
120
|
+
] })
|
|
125
121
|
}
|
|
126
122
|
);
|
|
127
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Transition/hooks.ts","../../../lib/components/Transition/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\n\ntype UseTransitionProps = {\n totalMessages: number\n messageDuration: number\n isLoading?: boolean\n onFinish?: () => void\n}\n\nexport const useTransition = ({\n totalMessages,\n messageDuration,\n isLoading,\n onFinish,\n}: UseTransitionProps) => {\n const [currentStep, setCurrentStep] = useState(0)\n const [mounted, setMounted] = useState(false)\n const hasFinished = useRef(false)\n const onFinishRef = useRef(onFinish)\n\n useEffect(() => {\n onFinishRef.current = onFinish\n }, [onFinish])\n\n useEffect(() => {\n setMounted(true)\n }, [])\n\n useEffect(() => {\n setCurrentStep(0)\n hasFinished.current = false\n }, [totalMessages, messageDuration])\n\n const isLast = currentStep >= totalMessages - 1\n const holdIndex = Math.max(0, totalMessages - 2)\n const shouldHold = isLoading === true && currentStep >= holdIndex\n\n useEffect(() => {\n if (isLast || shouldHold) return\n\n const timer = setTimeout(() => {\n setCurrentStep((step) => Math.min(step + 1, totalMessages - 1))\n }, messageDuration)\n\n return () => clearTimeout(timer)\n }, [currentStep, shouldHold, isLast, messageDuration, totalMessages])\n\n useEffect(() => {\n if (!isLast || hasFinished.current) return\n hasFinished.current = true\n\n const timer = setTimeout(() => {\n onFinishRef.current?.()\n }, messageDuration)\n\n return () => clearTimeout(timer)\n }, [isLast, messageDuration])\n\n const progress =\n mounted && totalMessages > 0
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Transition/hooks.ts","../../../lib/components/Transition/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\n\ntype UseTransitionProps = {\n totalMessages: number\n messageDuration: number\n isLoading?: boolean\n onFinish?: () => void\n}\n\nexport const useTransition = ({\n totalMessages,\n messageDuration,\n isLoading,\n onFinish,\n}: UseTransitionProps) => {\n const [currentStep, setCurrentStep] = useState(0)\n const [mounted, setMounted] = useState(false)\n const hasFinished = useRef(false)\n const onFinishRef = useRef(onFinish)\n\n useEffect(() => {\n onFinishRef.current = onFinish\n }, [onFinish])\n\n useEffect(() => {\n setMounted(true)\n }, [])\n\n useEffect(() => {\n setCurrentStep(0)\n hasFinished.current = false\n }, [totalMessages, messageDuration])\n\n const isLast = currentStep >= totalMessages - 1\n const holdIndex = Math.max(0, totalMessages - 2)\n const shouldHold = isLoading === true && currentStep >= holdIndex\n\n useEffect(() => {\n if (isLast || shouldHold) return\n\n const timer = setTimeout(() => {\n setCurrentStep((step) => Math.min(step + 1, totalMessages - 1))\n }, messageDuration)\n\n return () => clearTimeout(timer)\n }, [currentStep, shouldHold, isLast, messageDuration, totalMessages])\n\n useEffect(() => {\n if (!isLast || hasFinished.current) return\n hasFinished.current = true\n\n const timer = setTimeout(() => {\n onFinishRef.current?.()\n }, messageDuration)\n\n return () => clearTimeout(timer)\n }, [isLast, messageDuration])\n\n // The bar sits at the middle of the current step, as the Figma states show\n // (about 15%, 50% and 85% for Begin, Mid and End): it is never empty on the\n // first step and never full while the last one is still on screen.\n const progress =\n mounted && totalMessages > 0\n ? ((currentStep + 0.5) / totalMessages) * 100\n : 0\n\n return { currentStep, progress }\n}\n","import classNames from 'classnames'\nimport { Text } from '@components/Text'\nimport { useTransition } from './hooks'\nimport './styles.scss'\n\nexport type TransitionAlign = 'left' | 'center'\n\nexport type TransitionProps = {\n /** Etapas do processo, na ordem; cada uma vira a mensagem da tela por `messageDuration`. */\n messages: string[]\n /** Tempo de cada etapa em ms. */\n messageDuration?: number\n /**\n * @deprecated O alinhamento segue o tamanho da tela, como no Figma: à esquerda\n * no Mobile e centralizado no Desktop (a partir de 1024px). Use só para forçar um dos dois.\n */\n align?: TransitionAlign\n /** Enquanto `true`, segura na penúltima etapa até o processo real terminar. */\n isLoading?: boolean\n /** Chamado depois que a última etapa ficou na tela por `messageDuration`. */\n onFinish?: () => void\n className?: string\n 'data-testid'?: string\n}\n\nexport const Transition = ({\n messages,\n messageDuration = 2000,\n align,\n isLoading,\n onFinish,\n className,\n 'data-testid': dataTestId,\n}: TransitionProps) => {\n const { currentStep, progress } = useTransition({\n totalMessages: messages.length,\n messageDuration,\n isLoading,\n onFinish,\n })\n\n const currentMessage = messages[currentStep] ?? ''\n const previousMessage = currentStep > 0 ? messages[currentStep - 1] : null\n\n return (\n <div\n className={classNames(\n 'au-transition',\n { [`au-transition--align-${align}`]: !!align },\n className,\n )}\n data-testid={dataTestId}>\n <div className=\"au-transition__content\">\n <div className=\"au-transition__messages\">\n {previousMessage && (\n <Text\n as=\"p\"\n variant=\"heading-medium\"\n weight=\"semibold\"\n aria-hidden=\"true\"\n className=\"au-transition__message au-transition__message--previous\">\n {previousMessage}\n </Text>\n )}\n\n <Text\n key={currentStep}\n as=\"p\"\n variant=\"heading-medium\"\n weight=\"semibold\"\n aria-live=\"polite\"\n className=\"au-transition__message au-transition__message--current\">\n {currentMessage}\n </Text>\n </div>\n\n <div\n className=\"au-transition__bar\"\n role=\"progressbar\"\n aria-valuenow={Math.round(progress)}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={currentMessage}>\n <div\n className=\"au-transition__bar-filled\"\n style={{\n width: `${progress}%`,\n transitionDuration: `${messageDuration}ms`,\n }}\n />\n </div>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;AASO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA0B;AACxB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAChD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,cAAc,OAAO,KAAK;AAChC,QAAM,cAAc,OAAO,QAAQ;AAEnC,YAAU,MAAM;AACd,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,QAAQ,CAAC;AAEb,YAAU,MAAM;AACd,eAAW,IAAI;AAAA,EACjB,GAAG,CAAA,CAAE;AAEL,YAAU,MAAM;AACd,mBAAe,CAAC;AAChB,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,eAAe,eAAe,CAAC;AAEnC,QAAM,SAAS,eAAe,gBAAgB;AAC9C,QAAM,YAAY,KAAK,IAAI,GAAG,gBAAgB,CAAC;AAC/C,QAAM,aAAa,cAAc,QAAQ,eAAe;AAExD,YAAU,MAAM;AACd,QAAI,UAAU,WAAY;AAE1B,UAAM,QAAQ,WAAW,MAAM;AAC7B,qBAAe,CAAC,SAAS,KAAK,IAAI,OAAO,GAAG,gBAAgB,CAAC,CAAC;AAAA,IAChE,GAAG,eAAe;AAElB,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,aAAa,YAAY,QAAQ,iBAAiB,aAAa,CAAC;AAEpE,YAAU,MAAM;AACd,QAAI,CAAC,UAAU,YAAY,QAAS;AACpC,gBAAY,UAAU;AAEtB,UAAM,QAAQ,WAAW,MAAM;;AAC7B,wBAAY,YAAZ;AAAA,IACF,GAAG,eAAe;AAElB,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,QAAQ,eAAe,CAAC;AAK5B,QAAM,WACJ,WAAW,gBAAgB,KACrB,cAAc,OAAO,gBAAiB,MACxC;AAEN,SAAO,EAAE,aAAa,SAAA;AACxB;AC1CO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AACjB,MAAuB;AACrB,QAAM,EAAE,aAAa,SAAA,IAAa,cAAc;AAAA,IAC9C,eAAe,SAAS;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAED,QAAM,iBAAiB,SAAS,WAAW,KAAK;AAChD,QAAM,kBAAkB,cAAc,IAAI,SAAS,cAAc,CAAC,IAAI;AAEtE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,EAAE,CAAC,wBAAwB,KAAK,EAAE,GAAG,CAAC,CAAC,MAAA;AAAA,QACvC;AAAA,MAAA;AAAA,MAEF,eAAa;AAAA,MACb,UAAA,qBAAC,OAAA,EAAI,WAAU,0BACb,UAAA;AAAA,QAAA,qBAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,UAAA,mBACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAG;AAAA,cACH,SAAQ;AAAA,cACR,QAAO;AAAA,cACP,eAAY;AAAA,cACZ,WAAU;AAAA,cACT,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAIL;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,IAAG;AAAA,cACH,SAAQ;AAAA,cACR,QAAO;AAAA,cACP,aAAU;AAAA,cACV,WAAU;AAAA,cACT,UAAA;AAAA,YAAA;AAAA,YANI;AAAA,UAAA;AAAA,QAOP,GACF;AAAA,QAEA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAK;AAAA,YACL,iBAAe,KAAK,MAAM,QAAQ;AAAA,YAClC,iBAAe;AAAA,YACf,iBAAe;AAAA,YACf,cAAY;AAAA,YACZ,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,OAAO;AAAA,kBACL,OAAO,GAAG,QAAQ;AAAA,kBAClB,oBAAoB,GAAG,eAAe;AAAA,gBAAA;AAAA,cACxC;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-transition{display:flex;flex-direction:column;
|
|
1
|
+
.au-transition{display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;box-sizing:border-box;background-color:#fff;padding:64px 24px;width:100%;min-height:100vh;min-height:100dvh;text-align:start}@media(min-width:1024px){.au-transition{justify-content:center;align-items:center;text-align:center}}.au-transition--align-left{align-items:flex-start;text-align:start}.au-transition--align-center{align-items:center;text-align:center}.au-transition__content,.au-transition__messages{display:flex;flex-direction:column;gap:24px;width:100%}@media(min-width:1024px){.au-transition__content{max-width:272px}}.au-transition__message{transition:opacity .3s ease}.au-transition__message--previous.au-text{color:#f6f7fa}.au-transition__message--current{animation:au-transition-fade-in .5s ease}.au-transition__bar{background-color:#e2e4e9;border-radius:999px;overflow:hidden;width:100%;height:8px}.au-transition__bar-filled{background-color:#0048db;border-radius:999px;height:100%;transition-property:width;transition-timing-function:linear}@keyframes au-transition-fade-in{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.au-transition .au-transition__message--current{animation:none}.au-transition .au-transition__bar-filled{transition:none}}
|
package/dist/main.d.ts
CHANGED
package/dist/main.es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./components/globalStyles/index.es.js";
|
|
2
2
|
import { Button } from "./components/Button/index.es.js";
|
|
3
|
+
import { Switch } from "./components/Switch/index.es.js";
|
|
3
4
|
import { PureSwitch } from "./components/Switch/Pure/index.es.js";
|
|
4
5
|
import { CardSwitch } from "./components/Switch/Card/index.es.js";
|
|
5
6
|
import { Chip } from "./components/Chip/index.es.js";
|
|
@@ -374,7 +375,7 @@ import { IconZapOff } from "./components/icons/IconZapOff/index.es.js";
|
|
|
374
375
|
import { IconZoomIn } from "./components/icons/IconZoomIn/index.es.js";
|
|
375
376
|
import { IconZoomOut } from "./components/icons/IconZoomOut/index.es.js";
|
|
376
377
|
import { IconSocialGoogle } from "./components/icons/IconSocialGoogle/index.es.js";
|
|
377
|
-
import { C, D, E, W, I,
|
|
378
|
+
import { C, D, E, W, I, T } from "./react-if.esm-Cozt8l48.js";
|
|
378
379
|
import { BORDER_RADIUS_BIG, BORDER_RADIUS_MEDIUM, BORDER_RADIUS_PILL, BORDER_RADIUS_SMALL, BREAKPOINT_LG, BREAKPOINT_MD, BREAKPOINT_SM, BREAKPOINT_XLG, BREAKPOINT_XSM, COLOR_BRAND_BLUE_00, COLOR_BRAND_BLUE_10, COLOR_BRAND_BLUE_20, COLOR_BRAND_BLUE_30, COLOR_BRAND_BLUE_40, COLOR_BRAND_BLUE_50, COLOR_BRAND_BLUE_60, COLOR_BRAND_CYAN_10, COLOR_BRAND_CYAN_20, COLOR_BRAND_CYAN_30, COLOR_BRAND_CYAN_40, COLOR_BRAND_CYAN_50, COLOR_BRAND_CYAN_60, COLOR_BRAND_EMERALD_10, COLOR_BRAND_EMERALD_20, COLOR_BRAND_EMERALD_30, COLOR_BRAND_EMERALD_40, COLOR_BRAND_EMERALD_50, COLOR_BRAND_EMERALD_60, COLOR_ERROR_00, COLOR_ERROR_10, COLOR_ERROR_20, COLOR_ERROR_30, COLOR_ERROR_40, COLOR_ERROR_50, COLOR_ERROR_60, COLOR_INFO_00, COLOR_INFO_10, COLOR_INFO_20, COLOR_INFO_30, COLOR_INFO_40, COLOR_INFO_50, COLOR_INFO_60, COLOR_NEUTRAL_00, COLOR_NEUTRAL_10, COLOR_NEUTRAL_20, COLOR_NEUTRAL_30, COLOR_NEUTRAL_40, COLOR_NEUTRAL_50, COLOR_NEUTRAL_60, COLOR_NEUTRAL_70, COLOR_SUCCESS_00, COLOR_SUCCESS_10, COLOR_SUCCESS_20, COLOR_SUCCESS_30, COLOR_SUCCESS_40, COLOR_SUCCESS_50, COLOR_SUCCESS_60, COLOR_WARNING_00, COLOR_WARNING_10, COLOR_WARNING_20, COLOR_WARNING_30, COLOR_WARNING_40, COLOR_WARNING_50, COLOR_WARNING_60, CONTAINER_SIZE, FONT_BODY, FONT_SIZE_H1, FONT_SIZE_H2, FONT_SIZE_H3, FONT_SIZE_H4, FONT_SIZE_H5, FONT_SIZE_H6, FONT_SIZE_P1, FONT_SIZE_P2, FONT_SIZE_P3, FONT_SIZE_P4, FONT_TITLE, FONT_WEIGHT_BOLD, FONT_WEIGHT_MEDIUM, FONT_WEIGHT_REGULAR, FONT_WEIGHT_SEMIBOLD, OPACITY_00, OPACITY_10, OPACITY_20, OPACITY_30, OPACITY_40, SHADOW_01, SHADOW_02, SHADOW_03, SHADOW_04, SPACING_050, SPACING_100, SPACING_200, SPACING_300, SPACING_400, SPACING_500, SPACING_600, SPACING_700, SPACING_800, SPACING_900 } from "./astro/tokens/index.es.js";
|
|
379
380
|
function useDrawer(props) {
|
|
380
381
|
const [drawerOpen, setDrawerOpen] = useState(props);
|
|
@@ -884,7 +885,7 @@ export {
|
|
|
884
885
|
SpecialButton,
|
|
885
886
|
Spinner,
|
|
886
887
|
SubHeader,
|
|
887
|
-
|
|
888
|
+
Switch,
|
|
888
889
|
Tabs,
|
|
889
890
|
Text,
|
|
890
891
|
TextAreaField,
|
package/dist/main.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.es.js","sources":["../lib/components/Drawer/hooks.ts"],"sourcesContent":["import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.es.js","sources":["../lib/components/Drawer/hooks.ts"],"sourcesContent":["import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,UAAU,OAAuB;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAyB,KAAK;AAElE,WAAS,iBAAiB,MAAc;AACtC,kBAAc,CAAC,SAAS;AACtB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,CAAC,IAAI,GAAG,CAAC,KAAK,IAAI;AAAA,MAAA;AAAA,IAEtB,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|