@arkyn/components 3.0.1-beta.93 → 3.0.1-beta.94
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/bundle.js +1041 -1043
- package/dist/bundle.umd.cjs +12 -12
- package/dist/components/checkbox/index.js +3 -3
- package/dist/components/currencyInput/index.js +3 -3
- package/dist/components/imageUpload/index.d.ts +2 -0
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.js +3 -2
- package/dist/components/input/index.js +3 -3
- package/dist/components/mapView/index.js +1 -1
- package/dist/components/maskedInput/index.js +3 -3
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.js +2 -2
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +2 -2
- package/dist/components/radio/radioGroup/index.js +3 -3
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/textarea/index.js +3 -3
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ import "./styles.css";
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
function Checkbox(props) {
|
|
69
|
-
const { id, name, className:
|
|
69
|
+
const { id, name, className: wrapperClassName = "", size = "md", errorMessage: baseErrorMessage, defaultChecked = false, label, checked: baseChecked = null, onCheck, orientation = "horizontalReverse", value, ...rest } = props;
|
|
70
70
|
const { fieldErrors } = useForm();
|
|
71
71
|
const checkboxRef = useRef(null);
|
|
72
72
|
const checkboxId = id || useId();
|
|
@@ -76,12 +76,12 @@ function Checkbox(props) {
|
|
|
76
76
|
const currentChecked = typeof baseChecked === "boolean" ? baseChecked : isChecked;
|
|
77
77
|
const errorClass = isError ? "errorTrue" : "errorFalse";
|
|
78
78
|
const currentCheckedClass = currentChecked ? "checkedTrue" : "checkedFalse";
|
|
79
|
-
const className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}
|
|
79
|
+
const className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}`;
|
|
80
80
|
function handleCheck() {
|
|
81
81
|
const defaultChecked = isChecked;
|
|
82
82
|
setIsChecked(!defaultChecked);
|
|
83
83
|
onCheck && onCheck(!defaultChecked ? value || "checked" : "");
|
|
84
84
|
}
|
|
85
|
-
return (_jsxs(FieldWrapper, { orientation: orientation, children: [label && _jsx(FieldLabel, { htmlFor: checkboxId, children: label }), _jsxs("button", { id: checkboxId, type: "button", className: className, onClick: handleCheck, ...rest, children: [_jsx("input", { type: "hidden", name: name, ref: checkboxRef, value: currentChecked ? value || "checked" : "" }), _jsx(Check, {})] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
85
|
+
return (_jsxs(FieldWrapper, { orientation: orientation, className: wrapperClassName, children: [label && _jsx(FieldLabel, { htmlFor: checkboxId, children: label }), _jsxs("button", { id: checkboxId, type: "button", className: className, onClick: handleCheck, ...rest, children: [_jsx("input", { type: "hidden", name: name, ref: checkboxRef, value: currentChecked ? value || "checked" : "" }), _jsx(Check, {})] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
86
86
|
}
|
|
87
87
|
export { Checkbox };
|
|
@@ -82,7 +82,7 @@ import "./style.css";
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
function CurrencyInput(props) {
|
|
85
|
-
const { name, disabled, title, style, variant = "solid", label, className:
|
|
85
|
+
const { name, disabled, title, style, variant = "solid", label, className: wrapperClassName = "", value, defaultValue, max = 1000000000, locale, onChange, prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, showAsterisk, rightIcon, size = "md", id, ...rest } = props;
|
|
86
86
|
const { fieldErrors } = useForm();
|
|
87
87
|
const [isFocused, setIsFocused] = useState(false);
|
|
88
88
|
const [maskedValue, setMaskedValue] = useState("0");
|
|
@@ -135,7 +135,7 @@ function CurrencyInput(props) {
|
|
|
135
135
|
const errored = isError ? "errored" : "";
|
|
136
136
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
137
137
|
const focused = isFocused ? "focused" : "";
|
|
138
|
-
const className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
139
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style,
|
|
138
|
+
const className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
139
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, className: className, onClick: handleSectionClick, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange, id: inputId, placeholder: isDisabled ? maskedValue : undefined, value: isDisabled ? undefined : maskedValue, ...rest }), _jsx("input", { type: "hidden", name: name, value: normalizeValue(maskedValue), readOnly: true }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
140
140
|
}
|
|
141
141
|
export { CurrencyInput };
|
|
@@ -3,6 +3,7 @@ type ImageUploadProps = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
action: string;
|
|
5
5
|
defaultValue?: string | null;
|
|
6
|
+
className?: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
label?: string;
|
|
8
9
|
showAsterisk?: boolean;
|
|
@@ -22,6 +23,7 @@ type ImageUploadProps = {
|
|
|
22
23
|
* @param props.name - Required field name for form handling
|
|
23
24
|
* @param props.defaultValue - Initial image URL to display as preview. Default: ""
|
|
24
25
|
* @param props.disabled - Whether the image upload is disabled. Default: false
|
|
26
|
+
* @param props.className - Additional class name(s) for the wrapper element
|
|
25
27
|
* @param props.label - Optional label text to display above the image upload area
|
|
26
28
|
* @param props.showAsterisk - Whether to show asterisk on label for required fields. Default: false
|
|
27
29
|
* @param props.changeImageButtonText - Text for the button to change/replace an uploaded image. Default: "Alterar imagem"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/imageUpload/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/imageUpload/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAqG3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -14,6 +14,7 @@ import "./styles.css";
|
|
|
14
14
|
* @param props.name - Required field name for form handling
|
|
15
15
|
* @param props.defaultValue - Initial image URL to display as preview. Default: ""
|
|
16
16
|
* @param props.disabled - Whether the image upload is disabled. Default: false
|
|
17
|
+
* @param props.className - Additional class name(s) for the wrapper element
|
|
17
18
|
* @param props.label - Optional label text to display above the image upload area
|
|
18
19
|
* @param props.showAsterisk - Whether to show asterisk on label for required fields. Default: false
|
|
19
20
|
* @param props.changeImageButtonText - Text for the button to change/replace an uploaded image. Default: "Alterar imagem"
|
|
@@ -102,7 +103,7 @@ import "./styles.css";
|
|
|
102
103
|
* ```
|
|
103
104
|
*/
|
|
104
105
|
function ImageUpload(props) {
|
|
105
|
-
const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, } = props;
|
|
106
|
+
const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", className: wrapperClassName = "", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, } = props;
|
|
106
107
|
const { fieldErrors } = useForm();
|
|
107
108
|
const fieldError = fieldErrors?.[name];
|
|
108
109
|
const [value, setValue] = useState(defaultValue);
|
|
@@ -143,6 +144,6 @@ function ImageUpload(props) {
|
|
|
143
144
|
const hasErrorClassName = errorMessage ? "hasError" : "noHasError";
|
|
144
145
|
const hasImageClassName = filePath ? "hasImage" : "noHasImage";
|
|
145
146
|
const className = `arkynImageUpload ${hasErrorClassName} ${hasImageClassName}`;
|
|
146
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, dropImageText: dropImageText, handleSelectFile: handleSelectFile, selectImageButtonText: selectImageButtonText })), filePath && (_jsx(HasFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, filePath: filePath, handleSelectFile: handleSelectFile, changeImageButtonText: changeImageButtonText, reSendImage: !!errorMessage && file ? () => handleUploadImage(file) : undefined }))] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
147
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, dropImageText: dropImageText, handleSelectFile: handleSelectFile, selectImageButtonText: selectImageButtonText })), filePath && (_jsx(HasFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, filePath: filePath, handleSelectFile: handleSelectFile, changeImageButtonText: changeImageButtonText, reSendImage: !!errorMessage && file ? () => handleUploadImage(file) : undefined }))] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
147
148
|
}
|
|
148
149
|
export { ImageUpload };
|
|
@@ -70,7 +70,7 @@ import "./style.css";
|
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
72
|
function Input(props) {
|
|
73
|
-
const { name, disabled, title, style, variant = "solid", label, className:
|
|
73
|
+
const { name, disabled, title, style, variant = "solid", label, className: wrapperClassName = "", prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, showAsterisk, rightIcon, type = "text", size = "md", id, value, placeholder, ...rest } = props;
|
|
74
74
|
const { fieldErrors } = useForm();
|
|
75
75
|
const [isFocused, setIsFocused] = useState(false);
|
|
76
76
|
const inputRef = useRef(null);
|
|
@@ -108,7 +108,7 @@ function Input(props) {
|
|
|
108
108
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
109
109
|
const focused = isFocused ? "focused" : "";
|
|
110
110
|
const disabledClass = disabled ? "disabled" : "";
|
|
111
|
-
const className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
112
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, type: type, id: inputId, name: name, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
111
|
+
const className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
112
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, type: type, id: inputId, name: name, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
113
113
|
}
|
|
114
114
|
export { Input };
|
|
@@ -8,7 +8,7 @@ function MapView(props) {
|
|
|
8
8
|
return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, ...rest, children: _jsx(MapPinned, {}) }));
|
|
9
9
|
}
|
|
10
10
|
return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
|
|
11
|
-
borderRadius: "
|
|
11
|
+
borderRadius: "8px",
|
|
12
12
|
width: "100%",
|
|
13
13
|
height: "100%",
|
|
14
14
|
}, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }));
|
|
@@ -91,7 +91,7 @@ const BaseInput = forwardRef((props, ref) => {
|
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
93
|
function MaskedInput(props) {
|
|
94
|
-
const { name, disabled, title, style, variant = "solid", separate, mask, showMask, replacement, label, className:
|
|
94
|
+
const { name, disabled, title, style, variant = "solid", separate, mask, showMask, replacement, label, className: wrapperClassName = "", prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, defaultValue, showAsterisk, rightIcon, size = "md", id, value, placeholder, ...rest } = props;
|
|
95
95
|
const { fieldErrors } = useForm();
|
|
96
96
|
const [isFocused, setIsFocused] = useState(false);
|
|
97
97
|
const inputRef = useRef(null);
|
|
@@ -125,7 +125,7 @@ function MaskedInput(props) {
|
|
|
125
125
|
const errored = isError ? "errored" : "";
|
|
126
126
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
127
127
|
const focused = isFocused ? "focused" : "";
|
|
128
|
-
const className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
129
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx(InputMask, { component: BaseInput, mask: mask, replacement: replacement, separate: separate, showMask: showMask, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, readOnly: readOnly, id: inputId, name: name, defaultValue: defaultValue || undefined, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
128
|
+
const className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
129
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx(InputMask, { component: BaseInput, mask: mask, replacement: replacement, separate: separate, showMask: showMask, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, readOnly: readOnly, id: inputId, name: name, defaultValue: defaultValue || undefined, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
130
130
|
}
|
|
131
131
|
export { MaskedInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/multiSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAiB5D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE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U,CAAC;IAEtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAwK3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -104,7 +104,7 @@ import { MultiSelectSpinner } from "./multiSelectSpinner";
|
|
|
104
104
|
* ```
|
|
105
105
|
*/
|
|
106
106
|
function MultiSelect(props) {
|
|
107
|
-
const { name, options, className = "", placeholder = "Selecione...", closeOnSelect = false, defaultValue = [], errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
107
|
+
const { name, options, className: wrapperClassName = "", placeholder = "Selecione...", closeOnSelect = false, defaultValue = [], errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
108
108
|
const { fieldErrors } = useForm();
|
|
109
109
|
const multiSelectRef = useRef(null);
|
|
110
110
|
const multiSelectId = id || useId();
|
|
@@ -164,6 +164,6 @@ function MultiSelect(props) {
|
|
|
164
164
|
return true;
|
|
165
165
|
return false;
|
|
166
166
|
});
|
|
167
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(MultiSelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant,
|
|
167
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(MultiSelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant, prefixExists: !!prefix, id: multiSelectId, children: [_jsx("input", { ref: multiSelectRef, name: name, value: JSON.stringify(forceSelectedOptions), type: "hidden" }), _jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), LeftIcon && _jsx(LeftIcon, { size: iconSize, strokeWidth: 2.5 }), _jsxs(MultiSelectContent, { size: size, children: [forceSelectedOptions.map((value) => (_jsx(MultiSelectMark, { label: getOptionLabel(value), value: value, handleChangeValue: handleChangeValue, disabled: disabled }, value))), forceSelectedOptions.length <= 0 && _jsx("p", { children: placeholder })] }), _jsxs(MultiSelectOptionsContainer, { isFocused: isFocused, isSearchable: isSearchable, search: search, onSearch: handleSearch, children: [mappedOptions.map(({ label, value }) => (_jsx(MultiSelectOption, { label: label, value: value, size: size, handleChangeValue: handleChangeValue, optionHasSelected: optionHasSelected }, value))), mappedOptions.length <= 0 && _jsx("p", { children: notFoundText })] }), _jsx(MultiSelectChevron, { disabled: disabled, isFocused: isFocused, readOnly: readOnly, iconSize: iconSize, isLoading: isLoading }), _jsx(MultiSelectSpinner, { iconSize: iconSize, isLoading: isLoading }), _jsx(MultiSelectOverlay, { handleBlur: handleBlur, isFocused: isFocused })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
168
168
|
}
|
|
169
169
|
export { MultiSelect };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/phoneInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA0B7C,KAAK,eAAe,GAAG;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,C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AE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CA0LzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -118,7 +118,7 @@ import { PhoneInputMask } from "./phoneInputMask";
|
|
|
118
118
|
* phone numbers according to each country's specific format and mask patterns.
|
|
119
119
|
*/
|
|
120
120
|
function PhoneInput(props) {
|
|
121
|
-
const { defaultCountry, label, className = "", disabled = false, errorMessage: baseErrorMessage, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", showAsterisk, name, onChange, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", id, } = props;
|
|
121
|
+
const { defaultCountry, label, className: wrapperClassName = "", disabled = false, errorMessage: baseErrorMessage, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", showAsterisk, name, onChange, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", id, } = props;
|
|
122
122
|
const defaultData = getDefaultFormatPhoneNumber(defaultValue);
|
|
123
123
|
const [isFocused, setIsFocused] = useState(false);
|
|
124
124
|
const [search, setSearch] = useState("");
|
|
@@ -190,7 +190,7 @@ function PhoneInput(props) {
|
|
|
190
190
|
returnValue += removeNumberMasks(props || value);
|
|
191
191
|
return returnValue;
|
|
192
192
|
}
|
|
193
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { htmlFor: phoneInputId, showAsterisk: showAsterisk, children: label })), _jsxs(PhoneInputContainer, { disabled: isDisabled, isError: isError, isLoading: isLoading, isFocused: isFocused, readOnly: readOnly, size: size, variant: variant,
|
|
193
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { htmlFor: phoneInputId, showAsterisk: showAsterisk, children: label })), _jsxs(PhoneInputContainer, { disabled: isDisabled, isError: isError, isLoading: isLoading, isFocused: isFocused, readOnly: readOnly, size: size, variant: variant, onFocus: handleContainerFocus, children: [_jsx(PhoneInputCountrySelector, { currentCountry: currentCountry, onClick: handleOpenCountryOptions, size: size }), _jsxs(PhoneInputCountryOptionsContainer, { isOpen: isDisabled ? false : readOnly ? false : showCountryOptions, search: search, placeholder: searchCountryPlaceholder, onSearch: setSearch, children: [countries
|
|
194
194
|
.filter((country) => filterCountryFunction(country))
|
|
195
195
|
.map((country) => (_jsx(PhoneInputCountryOption, { country: country, handleChangeValue: () => {
|
|
196
196
|
setCurrentCountry(country);
|
|
@@ -84,7 +84,7 @@ import "./styles.css";
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
function RadioGroup(props) {
|
|
87
|
-
const { defaultValue = "", name, label, showAsterisk, errorMessage: baseErrorMessage, value: forceValue, onChange, size = "md", className:
|
|
87
|
+
const { defaultValue = "", name, label, showAsterisk, errorMessage: baseErrorMessage, value: forceValue, onChange, size = "md", className: wrapperClassName = "", disabled = false, ...rest } = props;
|
|
88
88
|
const [value, setValue] = useState(defaultValue);
|
|
89
89
|
const { fieldErrors } = useForm();
|
|
90
90
|
function handleChange(value) {
|
|
@@ -94,7 +94,7 @@ function RadioGroup(props) {
|
|
|
94
94
|
}
|
|
95
95
|
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
|
96
96
|
const isError = !!errorMessage;
|
|
97
|
-
const className = `arkynRadioGroup ${size}
|
|
98
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(RadioProvider, { isError: isError, size: size, value: forceValue || value, handleChange: handleChange, disabled: disabled, children: [_jsx("input", { style: { display: "none" }, type: "text", readOnly: true, name: name, value: forceValue || value }), _jsx("div", { className: className.trim(), ...rest })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
97
|
+
const className = `arkynRadioGroup ${size}`;
|
|
98
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(RadioProvider, { isError: isError, size: size, value: forceValue || value, handleChange: handleChange, disabled: disabled, children: [_jsx("input", { style: { display: "none" }, type: "text", readOnly: true, name: name, value: forceValue || value }), _jsx("div", { className: className.trim(), ...rest })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
99
99
|
}
|
|
100
100
|
export { RadioGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAgB5D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAiKjC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -103,7 +103,7 @@ import { SelectSpinner } from "./selectSpinner";
|
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
105
|
function Select(props) {
|
|
106
|
-
const { name, options, className = "", placeholder = "Selecione...", closeOnSelect = true, defaultValue = "", errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
106
|
+
const { name, options, className: wrapperClassName = "", placeholder = "Selecione...", closeOnSelect = true, defaultValue = "", errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
107
107
|
const { fieldErrors } = useForm();
|
|
108
108
|
const selectRef = useRef(null);
|
|
109
109
|
const selectId = id || useId();
|
|
@@ -163,6 +163,6 @@ function Select(props) {
|
|
|
163
163
|
return true;
|
|
164
164
|
return false;
|
|
165
165
|
});
|
|
166
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(SelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant,
|
|
166
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(SelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant, prefixExists: !!prefix, id: selectId, children: [_jsx("input", { ref: selectRef, name: name, value: forceSelectedOptions, type: "hidden" }), _jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), LeftIcon && _jsx(LeftIcon, { size: iconSize, strokeWidth: 2.5 }), _jsxs(SelectContent, { size: size, children: [forceSelectedOptions !== "" && (_jsx("p", { className: "hasValue", children: getOptionLabel(forceSelectedOptions) })), forceSelectedOptions === "" && _jsx("p", { children: placeholder })] }), _jsxs(SelectOptionsContainer, { isFocused: isFocused, isSearchable: isSearchable, search: search, onSearch: handleSearch, children: [mappedOptions.map(({ label, value }) => (_jsx(SelectOption, { label: label, value: value, size: size, handleChangeValue: handleChangeValue, optionHasSelected: optionHasSelected }, value))), mappedOptions.length <= 0 && _jsx("p", { children: notFoundText })] }), _jsx(SelectChevron, { disabled: disabled, isFocused: isFocused, readOnly: readOnly, iconSize: iconSize, isLoading: isLoading }), _jsx(SelectSpinner, { iconSize: iconSize, isLoading: isLoading }), _jsx(SelectOverlay, { handleBlur: handleBlur, isFocused: isFocused })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
167
167
|
}
|
|
168
168
|
export { Select };
|
|
@@ -96,7 +96,7 @@ import "./styles.css";
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
function Textarea(props) {
|
|
99
|
-
const { variant = "solid", size = "md", className:
|
|
99
|
+
const { variant = "solid", size = "md", className: wrapperClassName, errorMessage: baseErrorMessage, disabled = false, readOnly = false, label, showAsterisk, name, onFocus, onBlur, title, style, value, defaultValue, placeholder, id, ...rest } = props;
|
|
100
100
|
const { fieldErrors } = useForm();
|
|
101
101
|
const [isFocused, setIsFocused] = useState(false);
|
|
102
102
|
const textareaRef = useRef(null);
|
|
@@ -106,7 +106,7 @@ function Textarea(props) {
|
|
|
106
106
|
const errorClass = isError ? "errorTrue" : "errorFalse";
|
|
107
107
|
const opacityClass = disabled || readOnly ? "opacityTrue" : "opacityFalse";
|
|
108
108
|
const focusedClass = isFocused ? "focusedTrue" : "focusedFalse";
|
|
109
|
-
const className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}
|
|
109
|
+
const className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;
|
|
110
110
|
function handleSectionClick() {
|
|
111
111
|
if (disabled || !textareaRef?.current)
|
|
112
112
|
return;
|
|
@@ -123,6 +123,6 @@ function Textarea(props) {
|
|
|
123
123
|
if (onBlur)
|
|
124
124
|
onBlur(e);
|
|
125
125
|
}
|
|
126
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { htmlFor: textareaId, showAsterisk: showAsterisk, children: label })), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, name: name, onFocus: handleFocus, onBlur: handleBlur, defaultValue: defaultValue || "", placeholder: disabled ? value || placeholder : placeholder, value: disabled ? undefined : value, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
126
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { htmlFor: textareaId, showAsterisk: showAsterisk, children: label })), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, name: name, onFocus: handleFocus, onBlur: handleBlur, defaultValue: defaultValue || "", placeholder: disabled ? value || placeholder : placeholder, value: disabled ? undefined : value, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
127
127
|
}
|
|
128
128
|
export { Textarea };
|