@consumidor-positivo/aurora 0.0.186 → 0.0.187
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/dist/components/Alert/index.es.js +1 -1
- package/dist/components/Calendar/index.es.js +2 -2
- package/dist/components/CalendarHeader/index.es.js +2 -2
- package/dist/components/Card/index.es.js +17 -64
- package/dist/components/Card/index.es.js.map +1 -1
- package/dist/components/Card/styles.css +1 -1
- package/dist/components/Checkbox/index.es.js +1 -1
- package/dist/components/Datepicker/index.es.js +3 -3
- package/dist/components/Drawer/styles.css +1 -1
- package/dist/components/Image/index.es.js +1 -1
- package/dist/components/Label/index.es.js +1 -1
- package/dist/components/PortalHolder/index.es.js +1 -1
- package/dist/components/Pure/index.es.js +37 -0
- package/dist/components/Pure/index.es.js.map +1 -0
- package/dist/components/Pure/styles.css +1 -0
- package/dist/components/Segment/index.es.js +1 -1
- package/dist/components/SelectField/index.es.js +1 -1
- package/dist/components/Switch/Card/index.d.ts +3 -0
- package/dist/components/Switch/Card/types.d.ts +10 -0
- package/dist/components/Switch/Pure/index.d.ts +3 -0
- package/dist/components/Switch/Pure/types.d.ts +8 -0
- package/dist/components/Tag/index.es.js +1 -1
- package/dist/components/main/styles.css +1 -1
- package/dist/{index-DcE5oHTB.js → index-C1N6rwrZ.js} +3 -3
- package/dist/{index-DcE5oHTB.js.map → index-C1N6rwrZ.js.map} +1 -1
- package/dist/{index-ChXllGFe.js → index-C8AM9yBn.js} +2 -2
- package/dist/{index-ChXllGFe.js.map → index-C8AM9yBn.js.map} +1 -1
- package/dist/{index-wo9iM9yw.js → index-CL0DrUGQ.js} +2 -2
- package/dist/{index-wo9iM9yw.js.map → index-CL0DrUGQ.js.map} +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.es.js +126 -55
- package/dist/main.es.js.map +1 -1
- package/dist/{tokens-D1vxtHgK.js → tokens-D_iASp38.js} +52 -52
- package/dist/{tokens-D1vxtHgK.js.map → tokens-D_iASp38.js.map} +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { IconInfo } from "../icons/IconInfo/index.es.js";
|
|
|
10
10
|
import { IconX } from "../icons/IconX/index.es.js";
|
|
11
11
|
import { Conditional } from "../Conditional/index.es.js";
|
|
12
12
|
import { Text } from "../Text/index.es.js";
|
|
13
|
-
import {
|
|
13
|
+
import { d as COLOR_NEUTRAL_70, C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, e as COLOR_WARNING_50, f as COLOR_INFO_50 } from "../../tokens-D_iASp38.js";
|
|
14
14
|
import './styles.css';const Alert = ({
|
|
15
15
|
showIcon = true,
|
|
16
16
|
status = "info",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../index-CweZ_OcN.js";
|
|
3
|
-
import "../../index-
|
|
3
|
+
import "../../index-C8AM9yBn.js";
|
|
4
4
|
import "../Button/index.es.js";
|
|
5
5
|
import "../PortalHolder/index.es.js";
|
|
6
|
-
import { a } from "../../index-
|
|
6
|
+
import { a } from "../../index-C1N6rwrZ.js";
|
|
7
7
|
export {
|
|
8
8
|
a as DatepickerCalendar
|
|
9
9
|
};
|
|
@@ -3,8 +3,8 @@ import "../../index-CweZ_OcN.js";
|
|
|
3
3
|
import "../Icon/index.es.js";
|
|
4
4
|
import "../icons/IconChevronLeft/index.es.js";
|
|
5
5
|
import "../icons/IconChevronRight/index.es.js";
|
|
6
|
-
import "../../index-
|
|
7
|
-
import { C } from "../../index-
|
|
6
|
+
import "../../index-CL0DrUGQ.js";
|
|
7
|
+
import { C } from "../../index-C8AM9yBn.js";
|
|
8
8
|
export {
|
|
9
9
|
C as CalendarHeader
|
|
10
10
|
};
|
|
@@ -1,72 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CardEmphasis } from "../Emphasis/index.es.js";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
const CardRoot = ({
|
|
13
|
-
border = true,
|
|
14
|
-
color = "primary",
|
|
15
|
-
width,
|
|
16
|
-
height,
|
|
17
|
-
maxWidth,
|
|
18
|
-
maxHeight,
|
|
19
|
-
hoverShadow,
|
|
20
|
-
paddingLess,
|
|
21
|
-
children
|
|
22
|
-
}) => {
|
|
23
|
-
const rootClasses = classNames("au-card__root", {
|
|
24
|
-
"au-card__root--border-none": !border,
|
|
25
|
-
"au-card__root--color-secondary": color === "secondary",
|
|
26
|
-
"au-card__root--with-hover-shadow": !!hoverShadow,
|
|
27
|
-
"au-card__root--paddingless": !!paddingLess
|
|
3
|
+
import { PureSwitch } from "../Pure/index.es.js";
|
|
4
|
+
import './styles.css';const CardSwitch = ({ isActive, label, id, disabled, activateCallBack, deactivateCallBack, shouldFadeOutAfterActivate }) => {
|
|
5
|
+
const cardSwitchClassNames = classNames("au-card-switch", {});
|
|
6
|
+
const cardSwitchWrapperClassNames = classNames("au-card-switch-wrapper", {
|
|
7
|
+
"au-card-switch-wrapper--fade-out": shouldFadeOutAfterActivate && isActive,
|
|
8
|
+
"au-card-switch-wrapper--active": isActive
|
|
28
9
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
height: `${height}px`,
|
|
32
|
-
maxWidth: `${maxWidth}px`,
|
|
33
|
-
maxHeight: `${maxHeight}px`
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
36
|
-
"div",
|
|
10
|
+
return /* @__PURE__ */ jsx("div", { className: cardSwitchClassNames, children: /* @__PURE__ */ jsx("div", { className: cardSwitchWrapperClassNames, children: /* @__PURE__ */ jsx(
|
|
11
|
+
PureSwitch,
|
|
37
12
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
isActive,
|
|
14
|
+
label,
|
|
15
|
+
id,
|
|
16
|
+
activateCallBack,
|
|
17
|
+
deactivateCallBack,
|
|
18
|
+
disabled
|
|
41
19
|
}
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
const CardTag = ({
|
|
45
|
-
color = "primary",
|
|
46
|
-
icon,
|
|
47
|
-
children
|
|
48
|
-
}) => {
|
|
49
|
-
const tagClasses = classNames("au-card__tag", {
|
|
50
|
-
"au-card__tag--primary": color === "primary",
|
|
51
|
-
"au-card__tag--secondary": color === "secondary"
|
|
52
|
-
});
|
|
53
|
-
return /* @__PURE__ */ jsxs("div", { className: tagClasses, children: [
|
|
54
|
-
/* @__PURE__ */ jsx("span", { children: icon }),
|
|
55
|
-
/* @__PURE__ */ jsx("span", { children })
|
|
56
|
-
] });
|
|
57
|
-
};
|
|
58
|
-
const components = {
|
|
59
|
-
Root: CardRoot,
|
|
60
|
-
Container: CardContainer,
|
|
61
|
-
Emphasis: CardEmphasis,
|
|
62
|
-
Image: CardImage,
|
|
63
|
-
Tag: CardTag
|
|
20
|
+
) }) });
|
|
64
21
|
};
|
|
65
|
-
Object.keys(components).forEach((key) => {
|
|
66
|
-
const component = components[key];
|
|
67
|
-
component.displayName = `Card.${key}`;
|
|
68
|
-
});
|
|
69
22
|
export {
|
|
70
|
-
|
|
23
|
+
CardSwitch
|
|
71
24
|
};
|
|
72
25
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Switch/Card/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { PureSwitch } from '../Pure';\n\nimport './styles.scss';\nimport { CardSwitchProps } from './types';\n\nexport const CardSwitch: React.FC<CardSwitchProps> = ({ isActive, label, id, disabled, activateCallBack, deactivateCallBack , shouldFadeOutAfterActivate }) => {\n\t\n\tconst cardSwitchClassNames = classNames(\"au-card-switch\", {\n\t\t\n\t});\n\n\tconst cardSwitchWrapperClassNames = classNames(\"au-card-switch-wrapper\", {\n\t\t\"au-card-switch-wrapper--fade-out\": shouldFadeOutAfterActivate && isActive,\n\t\t\"au-card-switch-wrapper--active\": isActive\n\t});\n\n\treturn (\n <div className={cardSwitchClassNames}>\n <div className={cardSwitchWrapperClassNames}>\n\t\t\t<PureSwitch \n\t\t\t\tisActive={isActive}\n\t\t\t\tlabel={label}\n\t\t\t\tid={id}\n\t\t\t\tactivateCallBack={activateCallBack}\n\t\t\t\tdeactivateCallBack={deactivateCallBack}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n </div>\n</div>\n )\n}\n"],"names":[],"mappings":";;;AAMa,MAAA,aAAwC,CAAC,EAAE,UAAU,OAAO,IAAI,UAAU,kBAAkB,oBAAqB,iCAAiC;AAE9J,QAAM,uBAAuB,WAAW,kBAAmB,CAE1D,CAAA;AAEK,QAAA,8BAA8B,WAAW,0BAA2B;AAAA,IACzE,oCAAoC,8BAA8B;AAAA,IAClE,kCAAkC;AAAA,EAAA,CAClC;AAED,6BACI,OAAI,EAAA,WAAW,sBAChB,UAAC,oBAAA,OAAA,EAAI,WAAW,6BACjB,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA,EAEA,CAAA,EACJ,CAAA;AAEA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-card{
|
|
1
|
+
.au-card-switch{background:#fff}.au-card-switch .au-card-switch-wrapper{margin:24px;display:flex;align-items:center;justify-content:center;height:150px;padding:16px;box-sizing:border-box;overflow:hidden;transition:all .3s ease-in-out;border:1px solid #e2e4e9;-webkit-box-shadow:0px 0px 0px 5px #F2F5FC;box-shadow:0 0 0 5px #f2f5fc;border-radius:16px}@media (min-width: 600px){.au-card-switch .au-card-switch-wrapper{height:80px}}.au-card-switch .au-card-switch-wrapper--active{border:1px solid #0048db}.au-card-switch .au-card-switch-wrapper--fade-out{animation:collapseAndFadeOutMobile .3s ease-in-out 1s forwards}@media (min-width: 600px){.au-card-switch .au-card-switch-wrapper--fade-out{animation:collapseAndFadeOutDesktop .3s ease-in-out 1s forwards}}@keyframes collapseAndFadeOutMobile{0%{opacity:1;height:150px;padding:16px;margin:24px}to{opacity:0;height:0;padding:0;margin:0;border:0px;box-shadow:none}}@keyframes collapseAndFadeOutDesktop{0%{opacity:1;height:80px;padding:16px;margin:24px}to{opacity:0;height:0;padding:0;margin:0;border:0px;box-shadow:none}}
|
|
@@ -5,7 +5,7 @@ import "../Icon/index.es.js";
|
|
|
5
5
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
6
6
|
import { F as Field } from "../../index-ZE6zszxw.js";
|
|
7
7
|
import { Conditional } from "../Conditional/index.es.js";
|
|
8
|
-
import {
|
|
8
|
+
import { h as COLOR_NEUTRAL_00 } from "../../tokens-D_iASp38.js";
|
|
9
9
|
import { Text } from "../Text/index.es.js";
|
|
10
10
|
import './styles.css';const CheckboxField = ({
|
|
11
11
|
label,
|
|
@@ -3,11 +3,11 @@ import "../../index-CweZ_OcN.js";
|
|
|
3
3
|
import "../Icon/index.es.js";
|
|
4
4
|
import { IconCalendar } from "../icons/IconCalendar/index.es.js";
|
|
5
5
|
import { InputField } from "../InputField/index.es.js";
|
|
6
|
-
import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-
|
|
6
|
+
import { g as getDefaultDate, D as DDMMYYYY, a as DatepickerCalendar, A as AUCalendarDate } from "../../index-C1N6rwrZ.js";
|
|
7
7
|
import { useRef, useState, useMemo, useEffect } from "react";
|
|
8
8
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
9
|
-
import { u as useOutsideClick } from "../../index-
|
|
10
|
-
import { B as BREAKPOINT_MD, c as COLOR_NEUTRAL_40 } from "../../tokens-
|
|
9
|
+
import { u as useOutsideClick } from "../../index-CL0DrUGQ.js";
|
|
10
|
+
import { B as BREAKPOINT_MD, c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
11
11
|
import './styles.css';function useDatepicker({
|
|
12
12
|
value,
|
|
13
13
|
defaultValue = "empty",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-drawer{height:100vh;width:100vw;position:fixed;top:0;left:0;background-color:#16181dcc;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s ease,visibility .4s ease;z-index:5}.au-drawer--is-open{opacity:1;visibility:visible;pointer-events:all;transition:opacity .3s ease}.au-drawer--is-open .au-drawer__container{transform:translateY(0)}.au-drawer__container{background-color:#fff;width:100%;height:100vh;height:100dvh;position:fixed;z-index:6;top:0;right:0;transform:translate(100%);transition:transform .3s ease;overflow:hidden}@media (min-width: 600px){.au-drawer__container{border-radius:16px 0 0 16px;box-shadow:0 24px 56px #7686ad14,0 12px 12px #0048db0a;max-width:414px}}.au-drawer__header{position:relative;border-bottom:1px solid #e2e4e9;padding:16px 24px;height:80px;display:flex;align-items:center;justify-content:space-between}.au-drawer__header-close{cursor:pointer}.au-drawer__header .au-logo{margin:8px 0;display:block;height:100%}.au-drawer__header .au-logo svg{height:100%}.au-drawer__content{height:calc(100% - 80px)}
|
|
1
|
+
.au-drawer{height:100vh;width:100vw;position:fixed;top:0;left:0;background-color:#16181dcc;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .3s ease,visibility .4s ease;z-index:5}.au-drawer--is-open{opacity:1;visibility:visible;pointer-events:all;transition:opacity .3s ease}.au-drawer--is-open .au-drawer__container{transform:translateY(0)}.au-drawer__container{background-color:#fff;width:100%;height:100vh;height:100dvh;position:fixed;z-index:6;top:0;right:0;transform:translate(100%);transition:transform .3s ease;overflow:hidden}@media (min-width: 600px){.au-drawer__container{border-radius:16px 0 0 16px;box-shadow:0 24px 56px #7686ad14,0 12px 12px #0048db0a;max-width:414px}}.au-drawer__header{position:relative;border-bottom:1px solid #e2e4e9;padding:16px 24px;height:80px;display:flex;align-items:center;justify-content:space-between}.au-drawer__header-close{cursor:pointer}.au-drawer__header .au-logo{margin:8px 0;display:block;height:100%}.au-drawer__header .au-logo svg{height:100%}.au-drawer__content{height:calc(100% - 80px);overflow-y:scroll}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { B as BREAKPOINT_MD, a as BREAKPOINT_LG } from "../../tokens-
|
|
2
|
+
import { B as BREAKPOINT_MD, a as BREAKPOINT_LG } from "../../tokens-D_iASp38.js";
|
|
3
3
|
const Image = ({ srcMob, srcTablet, srcDesk, ...props }) => {
|
|
4
4
|
return /* @__PURE__ */ jsxs("picture", { children: [
|
|
5
5
|
/* @__PURE__ */ jsx("source", { media: `(max-width: ${BREAKPOINT_MD})`, srcSet: srcMob }),
|
|
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
|
|
|
4
4
|
import { IconAlertOctagon } from "../icons/IconAlertOctagon/index.es.js";
|
|
5
5
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
6
6
|
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
7
|
-
import { C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, c as COLOR_NEUTRAL_40 } from "../../tokens-
|
|
7
|
+
import { C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
8
8
|
const FieldLabel = ({
|
|
9
9
|
id,
|
|
10
10
|
text,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
3
3
|
import { Portal } from "../Portal/index.es.js";
|
|
4
|
-
import { B as BREAKPOINT_MD } from "../../tokens-
|
|
4
|
+
import { B as BREAKPOINT_MD } from "../../tokens-D_iASp38.js";
|
|
5
5
|
const PortalHolder = ({ withPortal, children }) => {
|
|
6
6
|
const shouldUsePortal = !above(BREAKPOINT_MD) && withPortal;
|
|
7
7
|
if (shouldUsePortal) return /* @__PURE__ */ jsx(Portal, { children });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './styles.css';const PureSwitch = ({
|
|
3
|
+
isActive,
|
|
4
|
+
label,
|
|
5
|
+
id,
|
|
6
|
+
disabled,
|
|
7
|
+
activateCallBack,
|
|
8
|
+
deactivateCallBack
|
|
9
|
+
}) => {
|
|
10
|
+
const handleToggle = (event) => {
|
|
11
|
+
const isActivated = event.target.checked;
|
|
12
|
+
if (isActivated) return activateCallBack();
|
|
13
|
+
return deactivateCallBack == null ? void 0 : deactivateCallBack();
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { className: "au-switch", children: /* @__PURE__ */ jsxs("label", { htmlFor: id, className: "au-switch-label", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { className: "au-switch-container", children: [
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"input",
|
|
20
|
+
{
|
|
21
|
+
id,
|
|
22
|
+
type: "checkbox",
|
|
23
|
+
className: "au-switch-checkbox",
|
|
24
|
+
checked: isActive,
|
|
25
|
+
onChange: handleToggle,
|
|
26
|
+
role: "switch",
|
|
27
|
+
disabled
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "au-switch-track", children: /* @__PURE__ */ jsx("div", { className: "au-switch-thumb" }) })
|
|
31
|
+
] })
|
|
32
|
+
] }) });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
PureSwitch
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +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}) => {\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\">\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":";AAKO,MAAM,aAAoC,CAAC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAM;AACC,QAAA,eAAe,CAAC,UAA+C;AAC9D,UAAA,cAAc,MAAM,OAAO;AAE5B,QAAA,oBAAoB;AAEzB,WAAO;AAAA,EAAqB;AAI1B,SAAA,oBAAC,SAAI,WAAU,aACb,+BAAC,SAAM,EAAA,SAAS,IAAI,WAAU,mBAChC,UAAA;AAAA,IAAA,oBAAC,UAAM,UAAM,MAAA,CAAA;AAAA,IACb,qBAAC,OAAI,EAAA,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,MACD;AAAA,MAEA,oBAAC,SAAI,WAAU,mBACd,8BAAC,OAAI,EAAA,WAAU,mBAAkB,EAClC,CAAA;AAAA,IAAA,GACD;AAAA,EAAA,EACA,CAAA,EACA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.au-switch-label{font-family:"Source Sans 3",sans-serif;display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none}.au-switch-checkbox{opacity:0;width:0;height:0;position:absolute}.au-switch-container{position:relative}.au-switch-track{width:42px;height:24px;background-color:#5e6573;border-radius:16px;transition:background-color .2s ease-in-out}.au-switch-thumb{position:absolute;top:3px;left:4px;width:18px;height:18px;background-color:#fff;border-radius:50%;transition:transform .2s ease-in-out}.au-switch-checkbox:checked+.au-switch-track{background-color:#0048db}.au-switch-checkbox:checked+.au-switch-track .au-switch-thumb{transform:translate(16px)}.au-switch-checkbox:focus-visible+.au-switch-track{outline:2px solid #0048db;outline-offset:2px}
|
|
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
|
|
|
4
4
|
import "../icons/IconChevronDown/index.es.js";
|
|
5
5
|
import "../icons/IconChevronLeft/index.es.js";
|
|
6
6
|
import "../icons/IconX/index.es.js";
|
|
7
|
-
import { S } from "../../index-
|
|
7
|
+
import { S } from "../../index-CL0DrUGQ.js";
|
|
8
8
|
export {
|
|
9
9
|
S as Segment
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ import { Conditional } from "../Conditional/index.es.js";
|
|
|
12
12
|
import { i as isMobile } from "../../isMobile-RyKhTreE.js";
|
|
13
13
|
import { F as Field } from "../../index-ZE6zszxw.js";
|
|
14
14
|
import { useState, useRef, useEffect } from "react";
|
|
15
|
-
import { c as COLOR_NEUTRAL_40 } from "../../tokens-
|
|
15
|
+
import { c as COLOR_NEUTRAL_40 } from "../../tokens-D_iASp38.js";
|
|
16
16
|
import './styles.css';const useSelectField = (options, initialValue, onChange, onBlur, disabled, register, autocomplete = false, fullScreenOptions = false) => {
|
|
17
17
|
var _a;
|
|
18
18
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
@@ -7,7 +7,7 @@ import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
|
7
7
|
import { IconInfo } from "../icons/IconInfo/index.es.js";
|
|
8
8
|
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
9
9
|
import { Conditional } from "../Conditional/index.es.js";
|
|
10
|
-
import { C as COLOR_SUCCESS_50, b as COLOR_ERROR_50,
|
|
10
|
+
import { C as COLOR_SUCCESS_50, b as COLOR_ERROR_50, e as COLOR_WARNING_50, f as COLOR_INFO_50, g as COLOR_BRAND_CYAN_50, d as COLOR_NEUTRAL_70 } from "../../tokens-D_iASp38.js";
|
|
11
11
|
import './styles.css';const Tag = ({
|
|
12
12
|
status,
|
|
13
13
|
border = "square",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
html{box-sizing:border-box;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}*,*:before,*:after{box-sizing:inherit;margin:0;padding:0}:focus{outline:none}body{font-family:"Source Sans 3",sans-serif;background-color:#fff}
|
|
1
|
+
html{box-sizing:border-box;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}*,*:before,*:after{box-sizing:inherit;margin:0;padding:0}:focus{outline:none}body{font-family:"Source Sans 3",sans-serif;background-color:#fff}.au-card{font-family:"Source Sans 3",sans-serif}.au-card__root{background-color:#fff;border-radius:16px;border:1px solid #e2e4e9;padding:16px}.au-card__root--border-none{border:none}.au-card__root--color-secondary{background-color:#f6f7fa}.au-card__root--paddingless{padding:0}.au-card__root--with-hover-shadow{transition:box-shadow .4s ease}.au-card__root--with-hover-shadow:hover{box-shadow:1px 0 8px 1px #0000001a}.au-card__container{display:flex;flex-direction:column;align-items:start;width:100%;height:100%}.au-card__container--direction-row{flex-direction:row}.au-card__container--align-items-center{align-items:center}.au-card__container--justify-content-center{justify-content:center}.au-card__container--justify-content-space-between{justify-content:space-between}.au-card__emphasis{background-color:#f2f5fc;display:flex;flex-direction:column;justify-content:center;gap:16px;padding:16px;margin:0 -16px;width:calc(100% + 32px)}.au-card__emphasis-container{display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:end}.au-card__tag{border-radius:8px;display:flex;justify-content:center;align-items:center;gap:4px;padding:4px 16px;width:100%;color:#16181d;font-size:14px;font-weight:600;line-height:21px}.au-card__tag--primary{background-color:#95f0cf}.au-card__tag--secondary{background-color:#eee6ff}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "./index-CweZ_OcN.js";
|
|
3
|
-
import { $ as $35ea8db9cb2ccb90$export$99faa760c7908e4f, a as $dfd62f934fc76fed$export$e1aef45b828286de, C as CalendarHeader, b as $dfd62f934fc76fed$export$5bd780d491cfc46c, c as $dfd62f934fc76fed$export$22e2d15eaa4d2377, d as $dfd62f934fc76fed$export$ad2135cac3a11b3d, e as $dfd62f934fc76fed$export$e11f8ba65d857bff, f as $dfd62f934fc76fed$export$5d847498420df57b } from "./index-
|
|
3
|
+
import { $ as $35ea8db9cb2ccb90$export$99faa760c7908e4f, a as $dfd62f934fc76fed$export$e1aef45b828286de, C as CalendarHeader, b as $dfd62f934fc76fed$export$5bd780d491cfc46c, c as $dfd62f934fc76fed$export$22e2d15eaa4d2377, d as $dfd62f934fc76fed$export$ad2135cac3a11b3d, e as $dfd62f934fc76fed$export$e11f8ba65d857bff, f as $dfd62f934fc76fed$export$5d847498420df57b } from "./index-C8AM9yBn.js";
|
|
4
4
|
import { Button } from "./components/Button/index.es.js";
|
|
5
5
|
import { PortalHolder } from "./components/PortalHolder/index.es.js";
|
|
6
6
|
import { useRef, useState, useEffect } from "react";
|
|
7
7
|
import { a as above } from "./screen-DfYo7XQ_.js";
|
|
8
|
-
import { B as BREAKPOINT_MD } from "./tokens-
|
|
8
|
+
import { B as BREAKPOINT_MD } from "./tokens-D_iASp38.js";
|
|
9
9
|
import './components/index/styles2.css';const DDMMYYYY = {
|
|
10
10
|
placeholder: "DD/MM/YYYY",
|
|
11
11
|
/** Apply DD/MM/YYYY to a field text while typing */
|
|
@@ -238,4 +238,4 @@ export {
|
|
|
238
238
|
DatepickerCalendar as a,
|
|
239
239
|
getDefaultDate as g
|
|
240
240
|
};
|
|
241
|
-
//# sourceMappingURL=index-
|
|
241
|
+
//# sourceMappingURL=index-C1N6rwrZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DcE5oHTB.js","sources":["../lib/components/form/Datepicker/helpers.ts","../lib/components/form/Datepicker/Calendar/hook.ts","../lib/components/form/Datepicker/Calendar/index.tsx"],"sourcesContent":["import { AUCalendarDateShape, DefaultValue, FormatAdapter } from './types'\n\n/**\n * This adapter Handle the input format and convert to a more\n * universal structure, that can be used accross all subcomponents in the datepicker.\n * if we need to support another format like dd-mm-yyyy, we only need to create another adapter\n * following this model\n */\nexport const DDMMYYYY: FormatAdapter = {\n placeholder: 'DD/MM/YYYY',\n /** Apply DD/MM/YYYY to a field text while typing */\n maskDate(dateStr) {\n let fmtInputDate = dateStr\n fmtInputDate = fmtInputDate.replace(/\\D/g, '') // Remove non-numeric characters\n\n if (fmtInputDate.length > 2) {\n fmtInputDate = `${fmtInputDate.slice(0, 2)}/${fmtInputDate.slice(2)}`\n }\n if (fmtInputDate.length > 5) {\n fmtInputDate = `${fmtInputDate.slice(0, 5)}/${fmtInputDate.slice(5)}`\n }\n return fmtInputDate\n },\n /** Check if a string is on DD/MM/YYYY Format */\n validateFormat(dateStr) {\n const pattern = /^\\d{2}\\/\\d{2}\\/\\d{4}$/\n return pattern.test(dateStr)\n },\n /** Covert a DD/MM/YYYY to the datepicker date structure */\n toCalendarDate(dateStr): AUCalendarDateShape {\n const [day, month, year] = dateStr.split('/').map(Number)\n return AUCalendarDate(day, month, year)\n },\n /** Covert a Date in the datepicker structure into a DD/MM/YYYY string */\n toString(dateObj: AUCalendarDateShape): string {\n const fmtNumber = (digit: number) =>\n String(digit).length === 1 ? `0${digit}` : String(digit)\n const { day, month, year } = dateObj\n\n return `${fmtNumber(day)}/${fmtNumber(month)}/${year}`\n },\n /** Check if a DD/MM/YYYY is a valid date */\n validate(dateStr, minValue, maxValue): boolean {\n const [day, month, year] = dateStr.split('/').map(Number)\n const date = new Date(year, month - 1, day)\n const isOlderThanMinDate =\n !!minValue &&\n date < new Date(minValue.year, minValue.month - 1, minValue.day)\n\n const exceedsMaxDate =\n !!maxValue &&\n date > new Date(maxValue.year, maxValue.month - 1, maxValue.day)\n\n return (\n date.getDate() === day &&\n date.getMonth() + 1 === month &&\n date.getFullYear() === year &&\n !isOlderThanMinDate &&\n !exceedsMaxDate\n )\n },\n}\n\nexport function AUCalendarDate(\n day: number,\n month: number,\n year: number,\n): AUCalendarDateShape {\n return {\n day,\n month,\n year,\n }\n}\n\nexport function getDefaultDate(\n defaultDateProp: DefaultValue,\n): AUCalendarDateShape | null {\n if (defaultDateProp == 'empty') return null\n if (defaultDateProp === 'now') {\n const now = new Date()\n return AUCalendarDate(now.getDate(), now.getMonth() + 1, now.getFullYear())\n }\n\n return defaultDateProp\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { CalendarDate } from '@internationalized/date'\nimport { BREAKPOINT_MD } from '@core/tokens'\nimport { above } from '@core/utils/screen'\nimport { AUCalendarDate } from '../helpers'\nimport { AUCalendarDateShape } from '../types'\n\ntype UseCalendarProps = {\n minValue: AUCalendarDateShape\n maxValue: AUCalendarDateShape\n value?: AUCalendarDateShape | null\n isVisible: boolean\n onClose: () => void\n onChange: (date: AUCalendarDateShape) => void\n}\n\nexport function useCalendar({\n onChange,\n onClose,\n minValue,\n maxValue,\n value,\n isVisible,\n}: UseCalendarProps) {\n const rootEl = useRef<HTMLDivElement>(null)\n const [enteredAnimation, setEnteredAnimation] = useState(false)\n const [calendarInternalState, setCalendarInternalState] =\n useState<CalendarDate>()\n\n const [delayedIsVisible, setDelayedIsVisible] = useState(false)\n\n const usedMinValue = new CalendarDate(\n minValue.year,\n minValue.month,\n minValue.day,\n )\n const usedMaxValue = new CalendarDate(\n maxValue.year,\n maxValue.month,\n maxValue.day,\n )\n\n useEffect(() => {\n if (!value) return\n const { day, month, year } = value\n setCalendarInternalState(new CalendarDate(year, month, day))\n }, [value])\n\n useEffect(() => {\n if (isVisible) {\n setDelayedIsVisible(true)\n return delayComponentMount()\n } else {\n return delayComponentUnmount()\n }\n }, [isVisible])\n\n function delayComponentMount(delayTime = 100) {\n const t = setTimeout(() => {\n setEnteredAnimation(true)\n }, delayTime)\n\n return () => {\n clearTimeout(t)\n }\n }\n\n function delayComponentUnmount(delayTime = 200) {\n setEnteredAnimation(false)\n const timoutToUnmount = setTimeout(() => {\n setDelayedIsVisible(false)\n }, delayTime)\n\n return () => {\n clearTimeout(timoutToUnmount)\n }\n }\n\n function fmtWeekday(day: string) {\n const capitalized = `${day.charAt(0).toUpperCase()}${day.slice(1)}`\n return capitalized.replace('.', '')\n }\n\n function triggerChange(date: CalendarDate) {\n const { day, month, year } = date\n onChange(AUCalendarDate(day, month, year))\n onClose()\n }\n\n function calendarChange(date: CalendarDate) {\n setCalendarInternalState(date)\n if (!above(BREAKPOINT_MD)) return\n triggerChange(date)\n }\n\n function actionChange() {\n if (calendarInternalState) {\n triggerChange(calendarInternalState)\n }\n }\n\n return {\n actionChange,\n calendarChange,\n fmtWeekday,\n usedMaxValue,\n usedMinValue,\n rootEl,\n calendarInternalState,\n enteredAnimation,\n delayedIsVisible,\n }\n}\n","import classNames from 'classnames'\nimport {\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n} from 'react-aria-components'\nimport { Button } from '@components/Button'\nimport { CalendarHeader } from '../CalendarHeader'\nimport { PortalHolder } from '../PortalHolder'\n\n\nimport { AUCalendarDateShape } from '../types'\nimport { useCalendar } from './hook'\nimport './styles.scss'\n\ntype DatepickerCalendarProps = {\n withPortal?: boolean\n minValue: AUCalendarDateShape\n maxValue: AUCalendarDateShape\n value?: AUCalendarDateShape | null\n onClose: () => void\n onChange: (date: AUCalendarDateShape) => void\n isVisible: boolean\n}\n\nexport const DatepickerCalendar = ({\n onClose,\n withPortal,\n minValue,\n maxValue,\n value,\n onChange,\n isVisible,\n}: DatepickerCalendarProps) => {\n const {\n rootEl,\n usedMaxValue,\n usedMinValue,\n calendarInternalState,\n calendarChange,\n fmtWeekday,\n actionChange,\n enteredAnimation,\n delayedIsVisible,\n } = useCalendar({\n onChange,\n onClose,\n minValue,\n maxValue,\n value,\n isVisible,\n })\n\n const componentClass = classNames('au-datepicker__calendar', {\n 'au-datepicker__calendar--visible': enteredAnimation,\n })\n\n if (!delayedIsVisible) return\n\n return (\n <PortalHolder withPortal={withPortal}>\n <div className={componentClass} ref={rootEl}>\n <div className=\"au-datepicker__calendar-backdrop\" onClick={onClose} />\n <div className=\"au-datepicker__calendar-card\">\n <Calendar\n autoFocus\n className=\"au-datepicker__calendar-base\"\n minValue={usedMinValue}\n maxValue={usedMaxValue}\n value={calendarInternalState}\n onChange={calendarChange}>\n <CalendarHeader defaultFocusDate={calendarInternalState} />\n <CalendarGrid\n className=\"au-datepicker__calendar-grid\"\n weekdayStyle=\"short\">\n <CalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell className=\"au-datepicker__calendar-weekday\">\n {fmtWeekday(day)}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n className=\"au-datepicker__calendar-day\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </Calendar>\n <div className=\"au-datepicker__calendar-actions-dock\">\n <Button\n type=\"outlined\"\n className=\"au-datepicker__calendar-cancel\"\n expand=\"x\"\n onClick={onClose}>\n Cancelar\n </Button>\n <Button\n disabled={!calendarInternalState}\n onClick={actionChange}\n expand=\"x\">\n Confirmar\n </Button>\n </div>\n </div>\n </div>\n </PortalHolder>\n )\n}\n"],"names":["CalendarDate","Calendar","CalendarGrid","CalendarGridHeader","CalendarHeaderCell","CalendarGridBody","CalendarCell"],"mappings":";;;;;;;;AAQO,MAAM,WAA0B;AAAA,EACrC,aAAa;AAAA;AAAA,EAEb,SAAS,SAAS;AAChB,QAAI,eAAe;AACJ,mBAAA,aAAa,QAAQ,OAAO,EAAE;AAEzC,QAAA,aAAa,SAAS,GAAG;AACZ,qBAAA,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,MAAM,CAAC,CAAC;AAAA,IACrE;AACI,QAAA,aAAa,SAAS,GAAG;AACZ,qBAAA,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,MAAM,CAAC,CAAC;AAAA,IACrE;AACO,WAAA;AAAA,EACT;AAAA;AAAA,EAEA,eAAe,SAAS;AACtB,UAAM,UAAU;AACT,WAAA,QAAQ,KAAK,OAAO;AAAA,EAC7B;AAAA;AAAA,EAEA,eAAe,SAA8B;AACrC,UAAA,CAAC,KAAK,OAAO,IAAI,IAAI,QAAQ,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,WAAA,eAAe,KAAK,OAAO,IAAI;AAAA,EACxC;AAAA;AAAA,EAEA,SAAS,SAAsC;AAC7C,UAAM,YAAY,CAAC,UACjB,OAAO,KAAK,EAAE,WAAW,IAAI,IAAI,KAAK,KAAK,OAAO,KAAK;AACzD,UAAM,EAAE,KAAK,OAAO,KAAA,IAAS;AAEtB,WAAA,GAAG,UAAU,GAAG,CAAC,IAAI,UAAU,KAAK,CAAC,IAAI,IAAI;AAAA,EACtD;AAAA;AAAA,EAEA,SAAS,SAAS,UAAU,UAAmB;AACvC,UAAA,CAAC,KAAK,OAAO,IAAI,IAAI,QAAQ,MAAM,GAA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F;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MACA,qBAAC,OAAI,EAAA,WAAU,wCACb,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAU;AAAA,YACV,QAAO;AAAA,YACP,SAAS;AAAA,YAAS,UAAA;AAAA,UAAA;AAAA,QAEpB;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,UAAU,CAAC;AAAA,YACX,SAAS;AAAA,YACT,QAAO;AAAA,YAAI,UAAA;AAAA,UAAA;AAAA,QAEb;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index-C1N6rwrZ.js","sources":["../lib/components/form/Datepicker/helpers.ts","../lib/components/form/Datepicker/Calendar/hook.ts","../lib/components/form/Datepicker/Calendar/index.tsx"],"sourcesContent":["import { AUCalendarDateShape, DefaultValue, FormatAdapter } from './types'\n\n/**\n * This adapter Handle the input format and convert to a more\n * universal structure, that can be used accross all subcomponents in the datepicker.\n * if we need to support another format like dd-mm-yyyy, we only need to create another adapter\n * following this model\n */\nexport const DDMMYYYY: FormatAdapter = {\n placeholder: 'DD/MM/YYYY',\n /** Apply DD/MM/YYYY to a field text while typing */\n maskDate(dateStr) {\n let fmtInputDate = dateStr\n fmtInputDate = fmtInputDate.replace(/\\D/g, '') // Remove non-numeric characters\n\n if (fmtInputDate.length > 2) {\n fmtInputDate = `${fmtInputDate.slice(0, 2)}/${fmtInputDate.slice(2)}`\n }\n if (fmtInputDate.length > 5) {\n fmtInputDate = `${fmtInputDate.slice(0, 5)}/${fmtInputDate.slice(5)}`\n }\n return fmtInputDate\n },\n /** Check if a string is on DD/MM/YYYY Format */\n validateFormat(dateStr) {\n const pattern = /^\\d{2}\\/\\d{2}\\/\\d{4}$/\n return pattern.test(dateStr)\n },\n /** Covert a DD/MM/YYYY to the datepicker date structure */\n toCalendarDate(dateStr): AUCalendarDateShape {\n const [day, month, year] = dateStr.split('/').map(Number)\n return AUCalendarDate(day, month, year)\n },\n /** Covert a Date in the datepicker structure into a DD/MM/YYYY string */\n toString(dateObj: AUCalendarDateShape): string {\n const fmtNumber = (digit: number) =>\n String(digit).length === 1 ? `0${digit}` : String(digit)\n const { day, month, year } = dateObj\n\n return `${fmtNumber(day)}/${fmtNumber(month)}/${year}`\n },\n /** Check if a DD/MM/YYYY is a valid date */\n validate(dateStr, minValue, maxValue): boolean {\n const [day, month, year] = dateStr.split('/').map(Number)\n const date = new Date(year, month - 1, day)\n const isOlderThanMinDate =\n !!minValue &&\n date < new Date(minValue.year, minValue.month - 1, minValue.day)\n\n const exceedsMaxDate =\n !!maxValue &&\n date > new Date(maxValue.year, maxValue.month - 1, maxValue.day)\n\n return (\n date.getDate() === day &&\n date.getMonth() + 1 === month &&\n date.getFullYear() === year &&\n !isOlderThanMinDate &&\n !exceedsMaxDate\n )\n },\n}\n\nexport function AUCalendarDate(\n day: number,\n month: number,\n year: number,\n): AUCalendarDateShape {\n return {\n day,\n month,\n year,\n }\n}\n\nexport function getDefaultDate(\n defaultDateProp: DefaultValue,\n): AUCalendarDateShape | null {\n if (defaultDateProp == 'empty') return null\n if (defaultDateProp === 'now') {\n const now = new Date()\n return AUCalendarDate(now.getDate(), now.getMonth() + 1, now.getFullYear())\n }\n\n return defaultDateProp\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { CalendarDate } from '@internationalized/date'\nimport { BREAKPOINT_MD } from '@core/tokens'\nimport { above } from '@core/utils/screen'\nimport { AUCalendarDate } from '../helpers'\nimport { AUCalendarDateShape } from '../types'\n\ntype UseCalendarProps = {\n minValue: AUCalendarDateShape\n maxValue: AUCalendarDateShape\n value?: AUCalendarDateShape | null\n isVisible: boolean\n onClose: () => void\n onChange: (date: AUCalendarDateShape) => void\n}\n\nexport function useCalendar({\n onChange,\n onClose,\n minValue,\n maxValue,\n value,\n isVisible,\n}: UseCalendarProps) {\n const rootEl = useRef<HTMLDivElement>(null)\n const [enteredAnimation, setEnteredAnimation] = useState(false)\n const [calendarInternalState, setCalendarInternalState] =\n useState<CalendarDate>()\n\n const [delayedIsVisible, setDelayedIsVisible] = useState(false)\n\n const usedMinValue = new CalendarDate(\n minValue.year,\n minValue.month,\n minValue.day,\n )\n const usedMaxValue = new CalendarDate(\n maxValue.year,\n maxValue.month,\n maxValue.day,\n )\n\n useEffect(() => {\n if (!value) return\n const { day, month, year } = value\n setCalendarInternalState(new CalendarDate(year, month, day))\n }, [value])\n\n useEffect(() => {\n if (isVisible) {\n setDelayedIsVisible(true)\n return delayComponentMount()\n } else {\n return delayComponentUnmount()\n }\n }, [isVisible])\n\n function delayComponentMount(delayTime = 100) {\n const t = setTimeout(() => {\n setEnteredAnimation(true)\n }, delayTime)\n\n return () => {\n clearTimeout(t)\n }\n }\n\n function delayComponentUnmount(delayTime = 200) {\n setEnteredAnimation(false)\n const timoutToUnmount = setTimeout(() => {\n setDelayedIsVisible(false)\n }, delayTime)\n\n return () => {\n clearTimeout(timoutToUnmount)\n }\n }\n\n function fmtWeekday(day: string) {\n const capitalized = `${day.charAt(0).toUpperCase()}${day.slice(1)}`\n return capitalized.replace('.', '')\n }\n\n function triggerChange(date: CalendarDate) {\n const { day, month, year } = date\n onChange(AUCalendarDate(day, month, year))\n onClose()\n }\n\n function calendarChange(date: CalendarDate) {\n setCalendarInternalState(date)\n if (!above(BREAKPOINT_MD)) return\n triggerChange(date)\n }\n\n function actionChange() {\n if (calendarInternalState) {\n triggerChange(calendarInternalState)\n }\n }\n\n return {\n actionChange,\n calendarChange,\n fmtWeekday,\n usedMaxValue,\n usedMinValue,\n rootEl,\n calendarInternalState,\n enteredAnimation,\n delayedIsVisible,\n }\n}\n","import classNames from 'classnames'\nimport {\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n} from 'react-aria-components'\nimport { Button } from '@components/Button'\nimport { CalendarHeader } from '../CalendarHeader'\nimport { PortalHolder } from '../PortalHolder'\n\n\nimport { AUCalendarDateShape } from '../types'\nimport { useCalendar } from './hook'\nimport './styles.scss'\n\ntype DatepickerCalendarProps = {\n withPortal?: boolean\n minValue: AUCalendarDateShape\n maxValue: AUCalendarDateShape\n value?: AUCalendarDateShape | null\n onClose: () => void\n onChange: (date: AUCalendarDateShape) => void\n isVisible: boolean\n}\n\nexport const DatepickerCalendar = ({\n onClose,\n withPortal,\n minValue,\n maxValue,\n value,\n onChange,\n isVisible,\n}: DatepickerCalendarProps) => {\n const {\n rootEl,\n usedMaxValue,\n usedMinValue,\n calendarInternalState,\n calendarChange,\n fmtWeekday,\n actionChange,\n enteredAnimation,\n delayedIsVisible,\n } = useCalendar({\n onChange,\n onClose,\n minValue,\n maxValue,\n value,\n isVisible,\n })\n\n const componentClass = classNames('au-datepicker__calendar', {\n 'au-datepicker__calendar--visible': enteredAnimation,\n })\n\n if (!delayedIsVisible) return\n\n return (\n <PortalHolder withPortal={withPortal}>\n <div className={componentClass} ref={rootEl}>\n <div className=\"au-datepicker__calendar-backdrop\" onClick={onClose} />\n <div className=\"au-datepicker__calendar-card\">\n <Calendar\n autoFocus\n className=\"au-datepicker__calendar-base\"\n minValue={usedMinValue}\n maxValue={usedMaxValue}\n value={calendarInternalState}\n onChange={calendarChange}>\n <CalendarHeader defaultFocusDate={calendarInternalState} />\n <CalendarGrid\n className=\"au-datepicker__calendar-grid\"\n weekdayStyle=\"short\">\n <CalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell className=\"au-datepicker__calendar-weekday\">\n {fmtWeekday(day)}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n className=\"au-datepicker__calendar-day\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </Calendar>\n <div className=\"au-datepicker__calendar-actions-dock\">\n <Button\n type=\"outlined\"\n className=\"au-datepicker__calendar-cancel\"\n expand=\"x\"\n onClick={onClose}>\n Cancelar\n </Button>\n <Button\n disabled={!calendarInternalState}\n onClick={actionChange}\n expand=\"x\">\n Confirmar\n </Button>\n </div>\n </div>\n </div>\n </PortalHolder>\n )\n}\n"],"names":["CalendarDate","Calendar","CalendarGrid","CalendarGridHeader","CalendarHeaderCell","CalendarGridBody","CalendarCell"],"mappings":";;;;;;;;AAQO,MAAM,WAA0B;AAAA,EACrC,aAAa;AAAA;AAAA,EAEb,SAAS,SAAS;AAChB,QAAI,eAAe;AACJ,mBAAA,aAAa,QAAQ,OAAO,EAAE;AAEzC,QAAA,aAAa,SAAS,GAAG;AACZ,qBAAA,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,MAAM,CAAC,CAAC;AAAA,IACrE;AACI,QAAA,aAAa,SAAS,GAAG;AACZ,qBAAA,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC,IAAI,aAAa,MAAM,CAAC,CAAC;AAAA,IACrE;AACO,WAAA;AAAA,EACT;AAAA;AAAA,EAEA,eAAe,SAAS;AACtB,UAAM,UAAU;AACT,WAAA,QAAQ,KAAK,OAAO;AAAA,EAC7B;AAAA;AAAA,EAEA,eAAe,SAA8B;AACrC,UAAA,CAAC,KAAK,OAAO,IAAI,IAAI,QAAQ,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,WAAA,eAAe,KAAK,OAAO,IAAI;AAAA,EACxC;AAAA;AAAA,EAEA,SAAS,SAAsC;AAC7C,UAAM,YAAY,CAAC,UACjB,OAAO,KAAK,EAAE,WAAW,IAAI,IAAI,KAAK,KAAK,OAAO,KAAK;AACzD,UAAM,EAAE,KAAK,OAAO,KAAA,IAAS;AAEtB,WAAA,GAAG,UAAU,GAAG,CAAC,IAAI,UAAU,KAAK,CAAC,IAAI,IAAI;AAAA,EACtD;AAAA;AAAA,EAEA,SAAS,SAAS,UAAU,UAAmB;AACvC,UAAA,CAAC,KAAK,OAAO,IAAI,IAAI,QAAQ,MAAM,GAAG,EAAE,IAAI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;AAAA,QAAA;AAAA,MACF;AAAA,MACA,qBAAC,OAAI,EAAA,WAAU,wCACb,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAU;AAAA,YACV,QAAO;AAAA,YACP,SAAS;AAAA,YAAS,UAAA;AAAA,UAAA;AAAA,QAEpB;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,UAAU,CAAC;AAAA,YACX,SAAS;AAAA,YACT,QAAO;AAAA,YAAI,UAAA;AAAA,UAAA;AAAA,QAEb;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -3,7 +3,7 @@ import "./index-CweZ_OcN.js";
|
|
|
3
3
|
import "./components/Icon/index.es.js";
|
|
4
4
|
import { IconChevronLeft } from "./components/icons/IconChevronLeft/index.es.js";
|
|
5
5
|
import { IconChevronRight } from "./components/icons/IconChevronRight/index.es.js";
|
|
6
|
-
import { S as Segment } from "./index-
|
|
6
|
+
import { S as Segment } from "./index-CL0DrUGQ.js";
|
|
7
7
|
import $dbSRa$react__default, { createContext, useContext, useState, useRef, useCallback, useEffect, useMemo, forwardRef } from "react";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
createContext(null);
|
|
@@ -5686,4 +5686,4 @@ export {
|
|
|
5686
5686
|
$dfd62f934fc76fed$export$e11f8ba65d857bff as e,
|
|
5687
5687
|
$dfd62f934fc76fed$export$5d847498420df57b as f
|
|
5688
5688
|
};
|
|
5689
|
-
//# sourceMappingURL=index-
|
|
5689
|
+
//# sourceMappingURL=index-C8AM9yBn.js.map
|