@consumidor-positivo/aurora 0.0.68 → 0.0.70
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/Calendar/index.es.js +2 -2
- package/dist/components/CalendarHeader/index.es.js +2 -2
- package/dist/components/CheckboxField/index.es.js +2 -2
- package/dist/components/Datepicker/index.es.js +3 -3
- package/dist/components/ErrorMessage/index.es.js +9 -0
- package/dist/components/ErrorMessage/index.es.js.map +1 -0
- package/dist/components/Group/index.es.js +1 -1
- package/dist/components/Input/index.es.js +14 -0
- package/dist/components/Input/index.es.js.map +1 -0
- package/dist/components/InputField/index.es.js +1 -1
- package/dist/components/InputHolder/index.es.js +14 -0
- package/dist/components/InputHolder/index.es.js.map +1 -0
- package/dist/components/Label/index.es.js +49 -0
- package/dist/components/Label/index.es.js.map +1 -0
- package/dist/components/PasswordField/index.es.js +1 -1
- package/dist/components/PortalHolder/index.es.js +1 -1
- package/dist/components/Root/index.es.js +21 -0
- package/dist/components/Root/index.es.js.map +1 -0
- package/dist/components/Segment/index.es.js +1 -1
- package/dist/components/SelectField/index.es.js +1 -1
- package/dist/components/TextArea/index.es.js +139 -0
- package/dist/components/TextArea/index.es.js.map +1 -0
- package/dist/components/TextareaField/index.es.js +3 -13
- package/dist/components/TextareaField/index.es.js.map +1 -1
- package/dist/components/TokenField/index.es.js +1 -1
- package/dist/components/form/Field/TextArea/hook.d.ts +17 -0
- package/dist/components/form/Field/TextArea/index.d.ts +10 -0
- package/dist/components/form/Field/index.d.ts +4 -2
- package/dist/components/form/TextareaField/index.d.ts +2 -1
- package/dist/components/index/styles.css +1 -1
- package/dist/components/index/styles2.css +1 -1
- package/dist/components/index/styles3.css +1 -1
- package/dist/{index-BuHGuwbT.js → index-C8RdzVRj.js} +2 -2
- package/dist/{index-BuHGuwbT.js.map → index-C8RdzVRj.js.map} +1 -1
- package/dist/{index-EAEcmr1o.js → index-CK85YRoz.js} +4 -4
- package/dist/{index-EAEcmr1o.js.map → index-CK85YRoz.js.map} +1 -1
- package/dist/{index-CLq9qZyb.js → index-CP-KKFUb.js} +3 -3
- package/dist/{index-CLq9qZyb.js.map → index-CP-KKFUb.js.map} +1 -1
- package/dist/index-DfksciAR.js +18 -0
- package/dist/index-DfksciAR.js.map +1 -0
- package/dist/main.es.js +41 -41
- package/dist/{tokens-TYOJv1j5.js → tokens-DGTtjw-_.js} +41 -41
- package/dist/{tokens-TYOJv1j5.js.map → tokens-DGTtjw-_.js.map} +1 -1
- package/package.json +1 -1
- package/dist/components/form/Field/TextArea.d.ts +0 -7
- package/dist/index-DY3hp3Pl.js +0 -101
- package/dist/index-DY3hp3Pl.js.map +0 -1
- /package/dist/components/form/Field/{ErrorMessage.d.ts → ErrorMessage/index.d.ts} +0 -0
- /package/dist/components/form/Field/{Input.d.ts → Input/index.d.ts} +0 -0
- /package/dist/components/form/Field/{InputHolder.d.ts → InputHolder/index.d.ts} +0 -0
- /package/dist/components/form/Field/{Label.d.ts → Label/index.d.ts} +0 -0
- /package/dist/components/form/Field/{Root.d.ts → Root/index.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../index-CweZ_OcN.js";
|
|
3
|
-
import "../../index-
|
|
3
|
+
import "../../index-C8RdzVRj.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-CK85YRoz.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-CP-KKFUb.js";
|
|
7
|
+
import { C } from "../../index-C8RdzVRj.js";
|
|
8
8
|
export {
|
|
9
9
|
C as CalendarHeader
|
|
10
10
|
};
|
|
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
3
|
import "../Icon/index.es.js";
|
|
4
4
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
6
|
+
import { m as COLOR_NEUTRAL_00 } from "../../tokens-DGTtjw-_.js";
|
|
7
7
|
import './styles.css';const CheckboxField = ({
|
|
8
8
|
label,
|
|
9
9
|
error,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { B as BREAKPOINT_MD, g as COLOR_NEUTRAL_40 } from "../../tokens-TYOJv1j5.js";
|
|
3
2
|
import "../../index-CweZ_OcN.js";
|
|
4
3
|
import "../Icon/index.es.js";
|
|
5
4
|
import { IconCalendar } from "../icons/IconCalendar/index.es.js";
|
|
6
5
|
import { InputField } from "../InputField/index.es.js";
|
|
7
|
-
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-CK85YRoz.js";
|
|
8
7
|
import { useRef, useState, useMemo, useEffect } from "react";
|
|
9
8
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
10
|
-
import { u as useOutsideClick } from "../../index-
|
|
9
|
+
import { u as useOutsideClick } from "../../index-CP-KKFUb.js";
|
|
10
|
+
import { B as BREAKPOINT_MD, b as COLOR_NEUTRAL_40 } from "../../tokens-DGTtjw-_.js";
|
|
11
11
|
import './styles.css';function useDatepicker({
|
|
12
12
|
value,
|
|
13
13
|
defaultValue = "empty",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const FieldErrorMessage = ({ hasError, message }) => {
|
|
3
|
+
if (!hasError || !message) return null;
|
|
4
|
+
return /* @__PURE__ */ jsx("p", { className: "au-field__error-message", children: message });
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
FieldErrorMessage
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/ErrorMessage/index.tsx"],"sourcesContent":["type ErrorMessageProps = {\n hasError?: boolean\n message?: string\n}\n\nexport const FieldErrorMessage = ({ hasError, message }: ErrorMessageProps) => {\n if (!hasError || !message) return null\n\n return <p className=\"au-field__error-message\">{message}</p>\n}\n"],"names":[],"mappings":";AAKO,MAAM,oBAAoB,CAAC,EAAE,UAAU,cAAiC;AAC7E,MAAI,CAAC,YAAY,CAAC,QAAgB,QAAA;AAElC,SAAQ,oBAAA,KAAA,EAAE,WAAU,2BAA2B,UAAQ,QAAA,CAAA;AACzD;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
|
-
import { F as Field } from "../../index-
|
|
3
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
4
4
|
import { Conditional } from "../Conditional/index.es.js";
|
|
5
5
|
import { Text } from "../Text/index.es.js";
|
|
6
6
|
import $dbSRa$react__default, { useState } from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
|
+
const FieldInput = ({
|
|
4
|
+
inputRef,
|
|
5
|
+
customclass,
|
|
6
|
+
...props
|
|
7
|
+
}) => {
|
|
8
|
+
const inputClasses = classNames("au-field__input", customclass);
|
|
9
|
+
return /* @__PURE__ */ jsx("input", { className: inputClasses, ref: inputRef, ...props });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
FieldInput
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/Input/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\ntype FieldInputProps = React.InputHTMLAttributes<HTMLInputElement> & {\n inputRef?: React.RefObject<HTMLInputElement>\n customclass?: string\n}\n\nexport const FieldInput = ({\n inputRef,\n customclass,\n ...props\n}: FieldInputProps) => {\n const inputClasses = classNames('au-field__input', customclass)\n\n return <input className={inputClasses} ref={inputRef} {...props} />\n}\n"],"names":[],"mappings":";;AAOO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuB;AACf,QAAA,eAAe,WAAW,mBAAmB,WAAW;AAE9D,6BAAQ,SAAM,EAAA,WAAW,cAAc,KAAK,UAAW,GAAG,MAAO,CAAA;AACnE;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
const FieldInputHolder = ({
|
|
3
|
+
children,
|
|
4
|
+
rightSideSlot
|
|
5
|
+
}) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: "au-field__input-holder", children: [
|
|
7
|
+
children,
|
|
8
|
+
rightSideSlot && /* @__PURE__ */ jsx("div", { className: "au-field__right-slot", children: rightSideSlot })
|
|
9
|
+
] });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
FieldInputHolder
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/InputHolder/index.tsx"],"sourcesContent":["import React from 'react'\n\ntype FieldInputHolderProps = {\n children?: React.ReactNode\n rightSideSlot?: React.ReactNode\n}\n\nexport const FieldInputHolder = ({\n children,\n rightSideSlot,\n}: FieldInputHolderProps) => {\n return (\n <div className=\"au-field__input-holder\">\n {children}\n {rightSideSlot && (\n <div className=\"au-field__right-slot\">{rightSideSlot}</div>\n )}\n </div>\n )\n}\n"],"names":[],"mappings":";AAOO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAA6B;AAEzB,SAAA,qBAAC,OAAI,EAAA,WAAU,0BACZ,UAAA;AAAA,IAAA;AAAA,IACA,iBACC,oBAAC,OAAI,EAAA,WAAU,wBAAwB,UAAc,eAAA;AAAA,EAEzD,EAAA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "../../index-CweZ_OcN.js";
|
|
3
|
+
import "../Icon/index.es.js";
|
|
4
|
+
import { IconAlertOctagon } from "../icons/IconAlertOctagon/index.es.js";
|
|
5
|
+
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
6
|
+
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
7
|
+
import { C as COLOR_SUCCESS_50, a as COLOR_ERROR_50, b as COLOR_NEUTRAL_40 } from "../../tokens-DGTtjw-_.js";
|
|
8
|
+
const FieldLabel = ({
|
|
9
|
+
id,
|
|
10
|
+
text,
|
|
11
|
+
required,
|
|
12
|
+
optional,
|
|
13
|
+
success,
|
|
14
|
+
error,
|
|
15
|
+
disabled
|
|
16
|
+
}) => {
|
|
17
|
+
if (!text) return null;
|
|
18
|
+
const states = [
|
|
19
|
+
{ state: "optional", value: !!optional, icon: /* @__PURE__ */ jsx("span", { children: "(Opcional)" }) },
|
|
20
|
+
{
|
|
21
|
+
state: "success",
|
|
22
|
+
value: !!success,
|
|
23
|
+
icon: /* @__PURE__ */ jsx(IconCheck, { rawColor: COLOR_SUCCESS_50 })
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
state: "error",
|
|
27
|
+
value: !!error,
|
|
28
|
+
icon: /* @__PURE__ */ jsx(IconAlertOctagon, { rawColor: COLOR_ERROR_50 })
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
state: "disabled",
|
|
32
|
+
value: !!disabled,
|
|
33
|
+
icon: /* @__PURE__ */ jsx(IconSlash, { rawColor: COLOR_NEUTRAL_40 })
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
const currentState = states.find(({ value }) => !!value);
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { className: "au-field__header", children: [
|
|
38
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: id, className: "au-field__header-label", children: [
|
|
39
|
+
text,
|
|
40
|
+
" ",
|
|
41
|
+
required && /* @__PURE__ */ jsx("strong", { className: "au-field__header-label--required", children: "*" })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "au-field__header-icon", children: currentState == null ? void 0 : currentState.icon })
|
|
44
|
+
] });
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
FieldLabel
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/Label/index.tsx"],"sourcesContent":["import { IconAlertOctagon, IconCheck, IconSlash } from '@components/icons'\nimport {\n COLOR_ERROR_50,\n COLOR_NEUTRAL_40,\n COLOR_SUCCESS_50,\n} from '@core/tokens'\n\ntype FieldLabelProps = {\n id?: string\n text?: string\n required?: boolean\n optional?: boolean\n success?: boolean\n error?: boolean\n disabled?: boolean\n}\n\nexport const FieldLabel = ({\n id,\n text,\n required,\n optional,\n success,\n error,\n disabled,\n}: FieldLabelProps) => {\n if (!text) return null\n\n const states = [\n { state: 'optional', value: !!optional, icon: <span>(Opcional)</span> },\n {\n state: 'success',\n value: !!success,\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n {\n state: 'error',\n value: !!error,\n icon: <IconAlertOctagon rawColor={COLOR_ERROR_50} />,\n },\n {\n state: 'disabled',\n value: !!disabled,\n icon: <IconSlash rawColor={COLOR_NEUTRAL_40} />,\n },\n ]\n\n const currentState = states.find(({ value }) => !!value)\n\n return (\n <div className=\"au-field__header\">\n <label htmlFor={id} className=\"au-field__header-label\">\n {text}{' '}\n {required && (\n <strong className=\"au-field__header-label--required\">*</strong>\n )}\n </label>\n <div className=\"au-field__header-icon\">{currentState?.icon}</div>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;;;;AAiBO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACjB,MAAA,CAAC,KAAa,QAAA;AAElB,QAAM,SAAS;AAAA,IACb,EAAE,OAAO,YAAY,OAAO,CAAC,CAAC,UAAU,MAAM,oBAAC,QAAK,EAAA,UAAA,aAAU,CAAA,EAAQ;AAAA,IACtE;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,WAAU,EAAA,UAAU,iBAAkB,CAAA;AAAA,IAC/C;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,kBAAiB,EAAA,UAAU,eAAgB,CAAA;AAAA,IACpD;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,WAAU,EAAA,UAAU,iBAAkB,CAAA;AAAA,IAC/C;AAAA,EAAA;AAGI,QAAA,eAAe,OAAO,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,KAAK;AAGrD,SAAA,qBAAC,OAAI,EAAA,WAAU,oBACb,UAAA;AAAA,IAAA,qBAAC,SAAM,EAAA,SAAS,IAAI,WAAU,0BAC3B,UAAA;AAAA,MAAA;AAAA,MAAM;AAAA,MACN,YACC,oBAAC,UAAO,EAAA,WAAU,oCAAmC,UAAC,KAAA;AAAA,IAAA,GAE1D;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,yBAAyB,uDAAc,MAAK;AAAA,EAC7D,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { F as Field } from "../../index-
|
|
2
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import './styles.css';const usePasswordField = () => {
|
|
5
5
|
const [showPassword, setShowPassword] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { a as above } from "../../screen-DfYo7XQ_.js";
|
|
3
|
-
import { B as BREAKPOINT_MD } from "../../tokens-TYOJv1j5.js";
|
|
4
3
|
import { Portal } from "../Portal/index.es.js";
|
|
4
|
+
import { B as BREAKPOINT_MD } from "../../tokens-DGTtjw-_.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,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
|
+
const FieldRoot = ({
|
|
4
|
+
children,
|
|
5
|
+
disabled,
|
|
6
|
+
success,
|
|
7
|
+
error,
|
|
8
|
+
style,
|
|
9
|
+
customclass
|
|
10
|
+
}) => {
|
|
11
|
+
const inputClasses = classNames("au-field", customclass, {
|
|
12
|
+
"au-field--disabled": !!disabled,
|
|
13
|
+
"au-field--success": !!success,
|
|
14
|
+
"au-field--error": !!error
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: inputClasses, style, children });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
FieldRoot
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/Root/index.tsx"],"sourcesContent":["import classNames from 'classnames'\n\ntype FieldRootProps = {\n children: React.ReactNode\n disabled?: boolean\n success?: boolean\n error?: boolean\n style?: React.CSSProperties\n customclass?: string\n}\n\nexport const FieldRoot = ({\n children,\n disabled,\n success,\n error,\n style,\n customclass,\n}: FieldRootProps) => {\n const inputClasses = classNames('au-field', customclass, {\n 'au-field--disabled': !!disabled,\n 'au-field--success': !!success,\n 'au-field--error': !!error,\n })\n\n return (\n <div className={inputClasses} style={style}>\n {children}\n </div>\n )\n}\n"],"names":[],"mappings":";;AAWO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsB;AACd,QAAA,eAAe,WAAW,YAAY,aAAa;AAAA,IACvD,sBAAsB,CAAC,CAAC;AAAA,IACxB,qBAAqB,CAAC,CAAC;AAAA,IACvB,mBAAmB,CAAC,CAAC;AAAA,EAAA,CACtB;AAED,SACG,oBAAA,OAAA,EAAI,WAAW,cAAc,OAC3B,SACH,CAAA;AAEJ;"}
|
|
@@ -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-CP-KKFUb.js";
|
|
8
8
|
export {
|
|
9
9
|
S as Segment
|
|
10
10
|
};
|
|
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
|
|
|
4
4
|
import { IconCheck } from "../icons/IconCheck/index.es.js";
|
|
5
5
|
import { IconChevronDown } from "../icons/IconChevronDown/index.es.js";
|
|
6
6
|
import { IconSlash } from "../icons/IconSlash/index.es.js";
|
|
7
|
-
import { F as Field } from "../../index-
|
|
7
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
8
8
|
import { useState, useRef, useEffect } from "react";
|
|
9
9
|
import './styles.css';const useSelectField = (options, initialValue, onChange, disabled, register, autocomplete = false) => {
|
|
10
10
|
var _a;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
|
+
import { Text } from "../Text/index.es.js";
|
|
4
|
+
import { useState, useRef, useEffect } from "react";
|
|
5
|
+
const useFieldTextArea = ({
|
|
6
|
+
rows = 3,
|
|
7
|
+
cols,
|
|
8
|
+
horizontalResize = false,
|
|
9
|
+
onChange
|
|
10
|
+
}) => {
|
|
11
|
+
const [dimensions, setDimensions] = useState({
|
|
12
|
+
width: cols ? cols * 10 : "100%",
|
|
13
|
+
height: rows * 26
|
|
14
|
+
});
|
|
15
|
+
const [charCount, setCharCount] = useState(0);
|
|
16
|
+
const isResizing = useRef(false);
|
|
17
|
+
const lastMousePosition = useRef({ x: 0, y: 0 });
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setDimensions({
|
|
20
|
+
width: cols ? cols * 10 : "100%",
|
|
21
|
+
height: rows * 26
|
|
22
|
+
});
|
|
23
|
+
}, [rows, cols]);
|
|
24
|
+
const handleMouseDown = (e) => {
|
|
25
|
+
isResizing.current = true;
|
|
26
|
+
lastMousePosition.current = { x: e.clientX, y: e.clientY };
|
|
27
|
+
if (dimensions.width === "100%") {
|
|
28
|
+
const container = e.currentTarget.closest(
|
|
29
|
+
".au-field__textarea-container"
|
|
30
|
+
);
|
|
31
|
+
setDimensions((prev) => ({
|
|
32
|
+
...prev,
|
|
33
|
+
width: container ? container.offsetWidth : 300
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
37
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
38
|
+
};
|
|
39
|
+
const handleMouseMove = (e) => {
|
|
40
|
+
if (!isResizing.current) return;
|
|
41
|
+
const deltaX = e.clientX - lastMousePosition.current.x;
|
|
42
|
+
const deltaY = e.clientY - lastMousePosition.current.y;
|
|
43
|
+
setDimensions((prev) => {
|
|
44
|
+
let currentWidth = typeof prev.width === "number" ? prev.width : 100;
|
|
45
|
+
const target = e.currentTarget;
|
|
46
|
+
if (target) {
|
|
47
|
+
const container = target.closest(
|
|
48
|
+
".textarea-container"
|
|
49
|
+
);
|
|
50
|
+
currentWidth = container ? container.offsetWidth : currentWidth;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
width: horizontalResize ? Math.max(100, currentWidth + deltaX) : prev.width,
|
|
54
|
+
height: Math.max(50, prev.height + deltaY)
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
lastMousePosition.current = { x: e.clientX, y: e.clientY };
|
|
58
|
+
};
|
|
59
|
+
const handleMouseUp = () => {
|
|
60
|
+
isResizing.current = false;
|
|
61
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
62
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
63
|
+
};
|
|
64
|
+
const handleInputChange = (e) => {
|
|
65
|
+
setCharCount(e.target.value.length);
|
|
66
|
+
if (onChange) {
|
|
67
|
+
onChange(e);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
dimensions,
|
|
72
|
+
charCount,
|
|
73
|
+
handleMouseDown,
|
|
74
|
+
handleInputChange
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const FieldTextArea = ({
|
|
78
|
+
textareaRef,
|
|
79
|
+
customClass,
|
|
80
|
+
rows = 3,
|
|
81
|
+
cols,
|
|
82
|
+
horizontalResize = false,
|
|
83
|
+
maxLength,
|
|
84
|
+
...props
|
|
85
|
+
}) => {
|
|
86
|
+
const { dimensions, charCount, handleMouseDown, handleInputChange } = useFieldTextArea({ rows, cols, horizontalResize, onChange: props.onChange });
|
|
87
|
+
const textareaClasses = classNames("au-field__textarea", customClass);
|
|
88
|
+
return /* @__PURE__ */ jsxs(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
className: "au-field__textarea-container",
|
|
92
|
+
style: {
|
|
93
|
+
width: typeof dimensions.width === "number" ? `${dimensions.width}px` : dimensions.width,
|
|
94
|
+
height: `${dimensions.height}px`
|
|
95
|
+
},
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"textarea",
|
|
99
|
+
{
|
|
100
|
+
ref: textareaRef,
|
|
101
|
+
className: textareaClasses,
|
|
102
|
+
style: { width: "100%", height: "100%", resize: "none" },
|
|
103
|
+
onChange: handleInputChange,
|
|
104
|
+
maxLength,
|
|
105
|
+
...props
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
maxLength && /* @__PURE__ */ jsxs(Text, { variant: "caption", className: "au-field__char-counter", children: [
|
|
109
|
+
charCount,
|
|
110
|
+
"/",
|
|
111
|
+
maxLength
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ jsx("div", { className: "custom-resize", onMouseDown: handleMouseDown, children: /* @__PURE__ */ jsx(
|
|
114
|
+
"svg",
|
|
115
|
+
{
|
|
116
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
+
width: "9",
|
|
118
|
+
height: "9",
|
|
119
|
+
viewBox: "0 0 9 9",
|
|
120
|
+
fill: "none",
|
|
121
|
+
children: /* @__PURE__ */ jsx(
|
|
122
|
+
"path",
|
|
123
|
+
{
|
|
124
|
+
fillRule: "evenodd",
|
|
125
|
+
clipRule: "evenodd",
|
|
126
|
+
d: "M0.146447 8.14645C-0.0488155 8.34171 -0.0488155 8.65829 0.146447 8.85355C0.341709 9.04882 0.658291 9.04882 0.853553 8.85355L8.85355 0.853553C9.04882 0.658291 9.04882 0.341708 8.85355 0.146446C8.65829 -0.0488159 8.34171 -0.0488157 8.14645 0.146446L0.146447 8.14645ZM4.14645 8.14645C3.95118 8.34171 3.95118 8.65829 4.14645 8.85355C4.34171 9.04882 4.65829 9.04882 4.85355 8.85355L8.85355 4.85355C9.04882 4.65829 9.04882 4.34171 8.85355 4.14645C8.65829 3.95118 8.34171 3.95118 8.14645 4.14645L4.14645 8.14645Z",
|
|
127
|
+
fill: "#454A54"
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
FieldTextArea
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/TextArea/hook.ts","../../../lib/components/form/Field/TextArea/index.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react'\n\ntype UseFieldTextAreaProps = {\n rows?: number\n cols?: number\n horizontalResize?: boolean\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void\n}\n\nexport const useFieldTextArea = ({\n rows = 3,\n cols,\n horizontalResize = false,\n onChange,\n}: UseFieldTextAreaProps) => {\n const [dimensions, setDimensions] = useState({\n width: cols ? cols * 10 : '100%',\n height: rows * 26,\n })\n const [charCount, setCharCount] = useState(0)\n const isResizing = useRef(false)\n const lastMousePosition = useRef({ x: 0, y: 0 })\n\n useEffect(() => {\n setDimensions({\n width: cols ? cols * 10 : '100%',\n height: rows * 26,\n })\n }, [rows, cols])\n\n const handleMouseDown = (e: React.MouseEvent) => {\n isResizing.current = true\n lastMousePosition.current = { x: e.clientX, y: e.clientY }\n\n if (dimensions.width === '100%') {\n const container = e.currentTarget.closest(\n '.au-field__textarea-container',\n ) as HTMLElement\n setDimensions((prev) => ({\n ...prev,\n width: container ? container.offsetWidth : 300,\n }))\n }\n\n window.addEventListener('mousemove', handleMouseMove)\n window.addEventListener('mouseup', handleMouseUp)\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n if (!isResizing.current) return\n const deltaX = e.clientX - lastMousePosition.current.x\n const deltaY = e.clientY - lastMousePosition.current.y\n\n setDimensions((prev) => {\n let currentWidth = typeof prev.width === 'number' ? prev.width : 100\n const target = e.currentTarget as HTMLElement | null\n if (target) {\n const container = target.closest(\n '.textarea-container',\n ) as HTMLElement | null\n currentWidth = container ? container.offsetWidth : currentWidth\n }\n\n return {\n width: horizontalResize\n ? Math.max(100, currentWidth + deltaX)\n : prev.width,\n height: Math.max(50, prev.height + deltaY),\n }\n })\n\n lastMousePosition.current = { x: e.clientX, y: e.clientY }\n }\n\n const handleMouseUp = () => {\n isResizing.current = false\n window.removeEventListener('mousemove', handleMouseMove)\n window.removeEventListener('mouseup', handleMouseUp)\n }\n\n const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCharCount(e.target.value.length)\n if (onChange) {\n onChange(e)\n }\n }\n\n return {\n dimensions,\n charCount,\n handleMouseDown,\n handleInputChange,\n }\n}\n","import React from 'react'\nimport classNames from 'classnames'\nimport { Text } from '@components/Text'\nimport { useFieldTextArea } from './hook'\n\ntype FieldTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n customClass?: string\n horizontalResize?: boolean\n maxLength?: number\n}\n\nexport const FieldTextArea = ({\n textareaRef,\n customClass,\n rows = 3,\n cols,\n horizontalResize = false,\n maxLength,\n ...props\n}: FieldTextAreaProps) => {\n const { dimensions, charCount, handleMouseDown, handleInputChange } =\n useFieldTextArea({ rows, cols, horizontalResize, onChange: props.onChange })\n\n const textareaClasses = classNames('au-field__textarea', customClass)\n\n return (\n <div\n className=\"au-field__textarea-container\"\n style={{\n width:\n typeof dimensions.width === 'number'\n ? `${dimensions.width}px`\n : dimensions.width,\n height: `${dimensions.height}px`,\n }}>\n <textarea\n ref={textareaRef}\n className={textareaClasses}\n style={{ width: '100%', height: '100%', resize: 'none' }}\n onChange={handleInputChange}\n maxLength={maxLength}\n {...props}\n />\n {maxLength && (\n <Text variant=\"caption\" className=\"au-field__char-counter\">\n {charCount}/{maxLength}\n </Text>\n )}\n <div className=\"custom-resize\" onMouseDown={handleMouseDown}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"none\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.146447 8.14645C-0.0488155 8.34171 -0.0488155 8.65829 0.146447 8.85355C0.341709 9.04882 0.658291 9.04882 0.853553 8.85355L8.85355 0.853553C9.04882 0.658291 9.04882 0.341708 8.85355 0.146446C8.65829 -0.0488159 8.34171 -0.0488157 8.14645 0.146446L0.146447 8.14645ZM4.14645 8.14645C3.95118 8.34171 3.95118 8.65829 4.14645 8.85355C4.34171 9.04882 4.65829 9.04882 4.85355 8.85355L8.85355 4.85355C9.04882 4.65829 9.04882 4.34171 8.85355 4.14645C8.65829 3.95118 8.34171 3.95118 8.14645 4.14645L4.14645 8.14645Z\"\n fill=\"#454A54\"\n />\n </svg>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Text } from "../Text/index.es.js";
|
|
4
|
-
import { F as Field } from "../../index-DY3hp3Pl.js";
|
|
2
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
5
3
|
const TextAreaField = ({
|
|
6
4
|
optional,
|
|
7
5
|
required,
|
|
@@ -16,12 +14,9 @@ const TextAreaField = ({
|
|
|
16
14
|
textAreaStyle,
|
|
17
15
|
textareaRef,
|
|
18
16
|
maxLength,
|
|
17
|
+
horizontalResize,
|
|
19
18
|
...props
|
|
20
19
|
}) => {
|
|
21
|
-
const [charCount, setCharCount] = useState(0);
|
|
22
|
-
const handleInputChange = (e) => {
|
|
23
|
-
setCharCount(e.target.value.length);
|
|
24
|
-
};
|
|
25
20
|
return /* @__PURE__ */ jsxs(
|
|
26
21
|
Field.Root,
|
|
27
22
|
{
|
|
@@ -51,15 +46,10 @@ const TextAreaField = ({
|
|
|
51
46
|
disabled,
|
|
52
47
|
style: textAreaStyle,
|
|
53
48
|
maxLength,
|
|
54
|
-
|
|
49
|
+
horizontalResize,
|
|
55
50
|
...props
|
|
56
51
|
}
|
|
57
52
|
),
|
|
58
|
-
maxLength && /* @__PURE__ */ jsxs(Text, { className: "au-field__char-counter", children: [
|
|
59
|
-
charCount,
|
|
60
|
-
"/",
|
|
61
|
-
maxLength
|
|
62
|
-
] }),
|
|
63
53
|
/* @__PURE__ */ jsx(Field.ErrorMessage, { hasError: !!error, message: errorMessage })
|
|
64
54
|
]
|
|
65
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/TextareaField/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/TextareaField/index.tsx"],"sourcesContent":["import Field from '../Field'\n\nexport type TextAreaProps =\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n optional?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n label?: string\n textAreaStyle?: React.CSSProperties\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n horizontalResize?: boolean\n }\n\nexport const TextAreaField = ({\n optional,\n required,\n success,\n error,\n errorMessage,\n label,\n id,\n disabled,\n style,\n className,\n textAreaStyle,\n textareaRef,\n maxLength,\n horizontalResize,\n ...props\n}: TextAreaProps) => {\n return (\n <Field.Root\n style={style}\n customclass={className}\n success={success}\n error={error}\n disabled={disabled}>\n <Field.Label\n text={label}\n id={id}\n required={required}\n optional={optional}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.TextArea\n id={id}\n textareaRef={textareaRef}\n disabled={disabled}\n style={textAreaStyle}\n maxLength={maxLength}\n horizontalResize={horizontalResize}\n {...props}\n />\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;AAcO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqB;AAEjB,SAAA;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACC;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAA;AAAA,QAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,QACA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACC,GAAG;AAAA,UAAA;AAAA,QACN;AAAA,QACA,oBAAC,MAAM,cAAN,EAAmB,UAAU,CAAC,CAAC,OAAO,SAAS,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { F as Field } from "../../index-
|
|
2
|
+
import { F as Field } from "../../index-DfksciAR.js";
|
|
3
3
|
import { useRef, useState, useEffect } from "react";
|
|
4
4
|
import './styles.css';function inputtedValueIsValid(value) {
|
|
5
5
|
const numberValue = Number(value);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type UseFieldTextAreaProps = {
|
|
3
|
+
rows?: number;
|
|
4
|
+
cols?: number;
|
|
5
|
+
horizontalResize?: boolean;
|
|
6
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const useFieldTextArea: ({ rows, cols, horizontalResize, onChange, }: UseFieldTextAreaProps) => {
|
|
9
|
+
dimensions: {
|
|
10
|
+
width: string | number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
charCount: number;
|
|
14
|
+
handleMouseDown: (e: React.MouseEvent) => void;
|
|
15
|
+
handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type FieldTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
4
|
+
textareaRef?: React.RefObject<HTMLTextAreaElement>;
|
|
5
|
+
customClass?: string;
|
|
6
|
+
horizontalResize?: boolean;
|
|
7
|
+
maxLength?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const FieldTextArea: ({ textareaRef, customClass, rows, cols, horizontalResize, maxLength, ...props }: FieldTextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -29,9 +29,11 @@ declare const _default: {
|
|
|
29
29
|
hasError?: boolean | undefined;
|
|
30
30
|
message?: string | undefined;
|
|
31
31
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
32
|
-
TextArea: ({ textareaRef,
|
|
32
|
+
TextArea: ({ textareaRef, customClass, rows, cols, horizontalResize, maxLength, ...props }: import('react').TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
33
33
|
textareaRef?: import('react').RefObject<HTMLTextAreaElement> | undefined;
|
|
34
|
-
|
|
34
|
+
customClass?: string | undefined;
|
|
35
|
+
horizontalResize?: boolean | undefined;
|
|
36
|
+
maxLength?: number | undefined;
|
|
35
37
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
38
|
};
|
|
37
39
|
export default _default;
|
|
@@ -7,5 +7,6 @@ export type TextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> &
|
|
|
7
7
|
label?: string;
|
|
8
8
|
textAreaStyle?: React.CSSProperties;
|
|
9
9
|
textareaRef?: React.RefObject<HTMLTextAreaElement>;
|
|
10
|
+
horizontalResize?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const TextAreaField: ({ optional, required, success, error, errorMessage, label, id, disabled, style, className, textAreaStyle, textareaRef, maxLength, ...props }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const TextAreaField: ({ optional, required, success, error, errorMessage, label, id, disabled, style, className, textAreaStyle, textareaRef, maxLength, horizontalResize, ...props }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-
|
|
1
|
+
.au-field{cursor:pointer;border-radius:8px}.au-field__input-holder{position:relative;height:56px}.au-field__input{height:56px}.au-field__textarea{padding:10px;box-sizing:border-box;resize:none;border:none;outline:none;width:100%;height:100%}.au-field__textarea-container{position:relative;display:inline-block;box-sizing:border-box;resize:none}.au-field__textarea-container .custom-resize{width:9px;height:9px;position:absolute;cursor:nwse-resize;display:block;display:flex;bottom:5px;right:5px}.au-field__input,.au-field__textarea{background-color:#fff;border:1px solid #454a54;border-radius:8px;box-sizing:border-box;font-family:inherit;font-size:16px;line-height:22px;padding:16px;width:100%}.au-field__input:hover,.au-field__textarea:hover{border:1px solid #16181d}.au-field__input:focus,.au-field__textarea:focus{border-color:#0048db;outline:1px solid #0048db}.au-field__char-counter{text-align:right;color:#454a54}.au-field:focus-within:not(.au-field--error) .au-field__header-label{color:#0048db}.au-field__header{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px}.au-field__header-label{color:#454a54;cursor:pointer;font-size:14px;font-weight:600}.au-field__header-label--required{color:#991717}.au-field__header-icon span{font-size:14px;color:#454a54}.au-field__right-slot{position:absolute;right:16px;top:50%;transform:translateY(-50%)}.au-field__error-message{color:#991717;font-size:16px;font-weight:400;line-height:24px;padding-top:8px}.au-field--disabled{cursor:not-allowed}.au-field--disabled .au-field__input,.au-field--disabled .au-field__textarea{background-color:#e2e4e9;border-color:#5e6573;color:#5e6573;cursor:not-allowed}.au-field--disabled .au-field__header-label{color:#5e6573;cursor:not-allowed}.au-field--error .au-field__input,.au-field--error .au-field__textarea{background-color:#f5eff0;border-color:#991717}.au-field--error .au-field__input:focus,.au-field--error .au-field__textarea:focus{border-color:#0048db}.au-field--error .au-field__header-label{color:#991717}.au-field--success .au-field__input,.au-field--success .au-field__textarea{animation:inputSuccess 2s forwards}.au-field--success .au-field__header-label{animation:labelSuccess 2s forwards}.au-field--success .au-field__header-icon .au-icon{animation:iconSucess 2s forwards}@keyframes inputSuccess{0%,70%{background-color:#f0fcf5;border-color:#10593b}}@keyframes labelSuccess{0%,70%{color:#10593b}}@keyframes iconSucess{0%,70%{opacity:1}to{opacity:0}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@media (min-width: 600px){.au-
|
|
1
|
+
.au-datepicker__calendar{visibility:hidden;opacity:0;position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;transition:opacity .2s,visibility .2s}@media (min-width: 600px){.au-datepicker__calendar{width:414px;position:absolute;top:calc(100% + 90px);left:0;right:auto;bottom:auto;transition:opacity .2s,visibility .2s,transform .2s ease-in-out}}.au-datepicker__calendar--visible,.au-datepicker__calendar--visible .au-datepicker__calendar-backdrop{visibility:visible;opacity:1}.au-datepicker__calendar--visible .au-datepicker__calendar-card{transform:translateY(0)}@media (min-width: 600px){.au-datepicker__calendar--visible{transform:translateY(-74px)}}.au-datepicker__calendar-backdrop{background-color:#16181dcc;cursor:pointer;position:absolute;width:100%;height:100%;visibility:0;z-index:1;-webkit-tap-highlight-color:transparent;opacity:0;transition:visibility .2s,opacity .2s}@media (min-width: 600px){.au-datepicker__calendar-backdrop{display:none}}.au-datepicker__calendar-card{width:100%;padding:16px;position:absolute;border-radius:16px 16px 0 0;border:1px solid #e2e4e9;background:#fff;bottom:0;z-index:2;transform:translateY(500px);transition:transform .2s ease-in-out}@media (min-width: 600px){.au-datepicker__calendar-card{position:relative;height:auto;transform:none;bottom:auto;transition:none;border-radius:16px}}.au-datepicker__calendar-base{width:100%}.au-datepicker__calendar-grid{width:100%;margin-top:16px}.au-datepicker__calendar-weekday,.au-datepicker__calendar-day{width:48px;height:48px;font-size:16px;font-weight:400;text-align:center;color:#16181d}@media (max-width: 320px){.au-datepicker__calendar-weekday,.au-datepicker__calendar-day{width:30px;height:30px}}.au-datepicker__calendar-day{cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid transparent;transition:border .2s ease-in-out,color .2s ease-in-out,background-color .2s ease-in-out}.au-datepicker__calendar-day:hover{border:1px solid #0048db}.au-datepicker__calendar-day[data-disabled]{cursor:default;color:#5e6573}.au-datepicker__calendar-day[data-disabled]:hover{border:1px solid transparent}.au-datepicker__calendar-day[data-selected]{background-color:#0048db;color:#fff}.au-datepicker__calendar-actions-dock{display:flex;gap:8px;padding-top:16px}@media (min-width: 600px){.au-datepicker__calendar-actions-dock{display:none}}.au-datepicker__calendar-cancel{max-width:125px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-
|
|
1
|
+
@media (min-width: 600px){.au-datepicker__segment{position:relative}}.au-datepicker__segment--open .au-datepicker__segment-input .au-icon{transform:rotate(180deg)}.au-datepicker__segment--open .au-datepicker__segment-list-holder{transform:translate(0);visibility:visible}@media (min-width: 600px){.au-datepicker__segment--open .au-datepicker__segment-list-holder{opacity:1;transform:none}}.au-datepicker__segment-input{padding:8px;gap:8px;display:flex;border-radius:8px;cursor:pointer;border:1px solid #e2e4e9}.au-datepicker__segment-list-holder{background:#fff;border-radius:16px 16px 0 0;position:absolute;top:0;right:0;bottom:0;left:0;visibility:hidden;opacity:1;display:flex;flex-direction:column;transform:translate(100%);transition:visibility .2s,transform .2s}@media (min-width: 600px){.au-datepicker__segment-list-holder{inset:unset;left:0;opacity:0;top:calc(100% + 8px);height:224px;border-radius:16px;border:1px solid #e2e4e9;transform:none;transition:opacity .2s,visibility .2s,transform .2s}}.au-datepicker__segment-list-header{padding:24px 16px;display:flex;align-items:center;justify-content:space-between}@media (min-width: 600px){.au-datepicker__segment-list-header{display:none}}.au-datepicker__segment-list{overflow-x:scroll;flex:1}.au-datepicker__segment-list-item{padding:16px 24px;font-size:16px;line-height:150%;cursor:pointer}.au-datepicker__segment-list-item:hover,.au-datepicker__segment-list-item--active{background-color:#f6f7fa}.au-datepicker__segment-list-item:not(:last-of-type){border-bottom:1px solid #e2e4e9}@media (min-width: 600px){.au-datepicker__segment-list-item:not(:last-of-type){border-bottom:none}}.au-datepicker__segment-title{font-family:"Source Sans 3",sans-serif;font-size:16px;font-weight:600}
|
|
@@ -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-CP-KKFUb.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-C8RdzVRj.js.map
|