@s_mart/form 16.1.1 → 16.1.3
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/checkbox/checkbox.mjs +43 -0
- package/dist/checkbox/checkbox.mjs.map +1 -0
- package/dist/components/fieldError/fieldError.mjs +20 -0
- package/dist/components/fieldError/fieldError.mjs.map +1 -0
- package/dist/components/fieldInfo/fieldInfo.mjs +20 -0
- package/dist/components/fieldInfo/fieldInfo.mjs.map +1 -0
- package/dist/components/fieldLabel/fieldLabel.mjs +29 -0
- package/dist/components/fieldLabel/fieldLabel.mjs.map +1 -0
- package/dist/creatable/creatable.mjs +191 -0
- package/dist/creatable/creatable.mjs.map +1 -0
- package/dist/creatable/creatable.styles.mjs +41 -0
- package/dist/creatable/creatable.styles.mjs.map +1 -0
- package/dist/datePicker/datePicker.mjs +75 -0
- package/dist/datePicker/datePicker.mjs.map +1 -0
- package/dist/datePicker/datePicker.styles.mjs +29 -0
- package/dist/datePicker/datePicker.styles.mjs.map +1 -0
- package/dist/form/form.mjs +16 -0
- package/dist/form/form.mjs.map +1 -0
- package/dist/form/formProvider.mjs +19 -0
- package/dist/form/formProvider.mjs.map +1 -0
- package/dist/form/useForm.mjs +20 -0
- package/dist/form/useForm.mjs.map +1 -0
- package/dist/formComponentPrecisaDeControl.mjs +10 -0
- package/dist/formComponentPrecisaDeControl.mjs.map +1 -0
- package/dist/index.mjs +18 -865
- package/dist/radio/radioButton/radioButton.mjs +19 -0
- package/dist/radio/radioButton/radioButton.mjs.map +1 -0
- package/dist/radio/radioGroup/radioGroup.mjs +46 -0
- package/dist/radio/radioGroup/radioGroup.mjs.map +1 -0
- package/dist/searchable/searchable.mjs +111 -0
- package/dist/searchable/searchable.mjs.map +1 -0
- package/dist/select/select.mjs +117 -0
- package/dist/select/select.mjs.map +1 -0
- package/dist/select/selectRenderValue.mjs +11 -0
- package/dist/select/selectRenderValue.mjs.map +1 -0
- package/dist/slider/slider.mjs +26 -0
- package/dist/slider/slider.mjs.map +1 -0
- package/dist/switch/switch.mjs +39 -0
- package/dist/switch/switch.mjs.map +1 -0
- package/dist/textField/textField.mjs +102 -0
- package/dist/textField/textField.mjs.map +1 -0
- package/dist/timePicker/timePicker.mjs +76 -0
- package/dist/timePicker/timePicker.mjs.map +1 -0
- package/dist/timePicker/timePicker.styles.mjs +29 -0
- package/dist/timePicker/timePicker.styles.mjs.map +1 -0
- package/dist/utils/erroFieldFormatado.mjs +6 -0
- package/dist/utils/erroFieldFormatado.mjs.map +1 -0
- package/dist/utils/typedMemo.mjs +7 -0
- package/dist/utils/typedMemo.mjs.map +1 -0
- package/package.json +17 -17
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IconButton as e, styled as t } from "@mui/material";
|
|
2
|
+
import { toRem as n } from "@s_mart/utils";
|
|
3
|
+
//#region src/timePicker/timePicker.styles.ts
|
|
4
|
+
var r = (e) => {
|
|
5
|
+
switch (e) {
|
|
6
|
+
case "small": return n(16);
|
|
7
|
+
case "large": return n(24);
|
|
8
|
+
default: return n(20);
|
|
9
|
+
}
|
|
10
|
+
}, i = (e) => {
|
|
11
|
+
switch (e) {
|
|
12
|
+
case "small": return `${n(2)} ${n(8)}`;
|
|
13
|
+
case "large": return n(10);
|
|
14
|
+
default: return `${n(6)} ${n(8)}`;
|
|
15
|
+
}
|
|
16
|
+
}, a = t(e)`
|
|
17
|
+
margin: 0px;
|
|
18
|
+
|
|
19
|
+
padding: ${({ size: e }) => i(e)};
|
|
20
|
+
border-radius: 0 ${n(4)} ${n(4)} 0;
|
|
21
|
+
|
|
22
|
+
svg {
|
|
23
|
+
width: ${({ size: e }) => r(e)} !important;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as SIconButton };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=timePicker.styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timePicker.styles.mjs","names":[],"sources":["../../src/timePicker/timePicker.styles.ts"],"sourcesContent":["import { type BaseTextFieldProps, type IconButtonProps, styled } from '@mui/material';\nimport { IconButton } from '@mui/material';\n\nimport { toRem } from '@s_mart/utils';\n\nconst _svgSize = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return toRem(16);\n case 'large':\n return toRem(24);\n default:\n return toRem(20);\n }\n};\n\nconst _padding = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return `${toRem(2)} ${toRem(8)}`;\n case 'large':\n return toRem(10);\n default:\n return `${toRem(6)} ${toRem(8)}`;\n }\n};\n\nexport const SIconButton = styled(IconButton)`\n margin: 0px;\n\n padding: ${({ size }) => _padding(size)};\n border-radius: 0 ${toRem(4)} ${toRem(4)} 0;\n\n svg {\n width: ${({ size }) => _svgSize(size)} !important;\n }\n`;\n"],"mappings":";;;AAKA,IAAM,KAAY,MAAkC;CAClD,QAAQ,GAAR;EACE,KAAK,SACH,OAAO,EAAM,EAAE;EACjB,KAAK,SACH,OAAO,EAAM,EAAE;EACjB,SACE,OAAO,EAAM,EAAE;CACnB;AACF,GAEM,KAAY,MAAkC;CAClD,QAAQ,GAAR;EACE,KAAK,SACH,OAAO,GAAG,EAAM,CAAC,EAAE,GAAG,EAAM,CAAC;EAC/B,KAAK,SACH,OAAO,EAAM,EAAE;EACjB,SACE,OAAO,GAAG,EAAM,CAAC,EAAE,GAAG,EAAM,CAAC;CACjC;AACF,GAEa,IAAc,EAAO,CAAU,CAAC;;;cAG/B,EAAE,cAAW,EAAS,CAAI,EAAE;qBACrB,EAAM,CAAC,EAAE,GAAG,EAAM,CAAC,EAAE;;;cAG5B,EAAE,cAAW,EAAS,CAAI,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erroFieldFormatado.mjs","names":[],"sources":["../../src/utils/erroFieldFormatado.ts"],"sourcesContent":["import type { FieldErrors, FieldValues } from 'react-hook-form';\n\nexport const erroFieldFormatado = (errors: FieldErrors<FieldValues>, name: string) => {\n const path = name.replace(/[[\\]]/g, '').split('.');\n\n return path.reduce((obj: Record<string, any>, key) => obj?.[key], errors);\n};\n"],"mappings":";AAEA,IAAa,KAAsB,GAAkC,MACtD,EAAK,QAAQ,UAAU,EAAE,CAAC,CAAC,MAAM,GAEvC,CAAA,CAAK,QAAQ,GAA0B,MAAQ,IAAM,IAAM,CAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedMemo.mjs","names":[],"sources":["../../src/utils/typedMemo.ts"],"sourcesContent":["import { memo } from 'react';\n\nexport const typedMemo: <T>(c: T) => T = memo;\n"],"mappings":";;AAEA,IAAa,IAA4B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/form",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"@mui/material": "^9.3.1",
|
|
20
20
|
"@mui/system": "^9.3.0",
|
|
21
21
|
"@mui/x-date-pickers": "^9.12.0",
|
|
22
|
-
"@s_mart/core": "16.1.
|
|
23
|
-
"@s_mart/masks": "16.1.
|
|
24
|
-
"@s_mart/regular-icons": "16.1.
|
|
25
|
-
"@s_mart/rules": "16.1.
|
|
26
|
-
"@s_mart/solid-icons": "16.1.
|
|
27
|
-
"@s_mart/tokens": "16.1.
|
|
28
|
-
"@s_mart/typed": "16.1.
|
|
29
|
-
"@s_mart/utils": "16.1.
|
|
22
|
+
"@s_mart/core": "16.1.2",
|
|
23
|
+
"@s_mart/masks": "16.1.2",
|
|
24
|
+
"@s_mart/regular-icons": "16.1.2",
|
|
25
|
+
"@s_mart/rules": "16.1.2",
|
|
26
|
+
"@s_mart/solid-icons": "16.1.2",
|
|
27
|
+
"@s_mart/tokens": "16.1.2",
|
|
28
|
+
"@s_mart/typed": "16.1.2",
|
|
29
|
+
"@s_mart/utils": "16.1.2",
|
|
30
30
|
"@types/lodash-es": "^4.17.12",
|
|
31
31
|
"@types/react": "^19.2.18",
|
|
32
32
|
"@types/react-dom": "^19.2.5",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@mui/material": "^9.0.0",
|
|
43
43
|
"@mui/system": "^9.0.0",
|
|
44
44
|
"@mui/x-date-pickers": "^9.0.0",
|
|
45
|
-
"@s_mart/core": "16.1.
|
|
46
|
-
"@s_mart/masks": "16.1.
|
|
47
|
-
"@s_mart/regular-icons": "16.1.
|
|
48
|
-
"@s_mart/rules": "16.1.
|
|
49
|
-
"@s_mart/solid-icons": "16.1.
|
|
50
|
-
"@s_mart/tokens": "16.1.
|
|
51
|
-
"@s_mart/typed": "16.1.
|
|
52
|
-
"@s_mart/utils": "16.1.
|
|
45
|
+
"@s_mart/core": "16.1.2",
|
|
46
|
+
"@s_mart/masks": "16.1.2",
|
|
47
|
+
"@s_mart/regular-icons": "16.1.2",
|
|
48
|
+
"@s_mart/rules": "16.1.2",
|
|
49
|
+
"@s_mart/solid-icons": "16.1.2",
|
|
50
|
+
"@s_mart/tokens": "16.1.2",
|
|
51
|
+
"@s_mart/typed": "16.1.2",
|
|
52
|
+
"@s_mart/utils": "16.1.2",
|
|
53
53
|
"@types/lodash-es": ">=4.17.12",
|
|
54
54
|
"@types/react": ">=18.3.12",
|
|
55
55
|
"@types/react-dom": ">=18.3.1",
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/erroFieldFormatado.ts","../src/components/fieldError/fieldError.tsx","../src/components/fieldLabel/fieldLabel.tsx","../src/formComponentPrecisaDeControl.ts","../src/utils/typedMemo.ts","../src/checkbox/checkbox.tsx","../src/components/fieldInfo/fieldInfo.tsx","../src/creatable/creatable.styles.ts","../src/creatable/creatable.tsx","../src/datePicker/datePicker.styles.ts","../src/datePicker/datePicker.tsx","../src/form/formProvider.tsx","../src/form/useForm.ts","../src/form/form.tsx","../src/radio/radioButton/radioButton.tsx","../src/radio/radioGroup/radioGroup.tsx","../src/searchable/searchable.tsx","../src/select/selectRenderValue.tsx","../src/select/select.tsx","../src/slider/slider.tsx","../src/switch/switch.tsx","../src/textField/textField.tsx","../src/timePicker/timePicker.styles.ts","../src/timePicker/timePicker.tsx"],"sourcesContent":["import type { FieldErrors, FieldValues } from 'react-hook-form';\n\nexport const erroFieldFormatado = (errors: FieldErrors<FieldValues>, name: string) => {\n const path = name.replace(/[[\\]]/g, '').split('.');\n\n return path.reduce((obj: Record<string, any>, key) => obj?.[key], errors);\n};\n","import { Indicator } from '@s_mart/core';\nimport type { FieldPath, FieldValues } from 'react-hook-form';\nimport { useFormState } from 'react-hook-form';\nimport { erroFieldFormatado } from '../../utils/erroFieldFormatado';\nimport type { FieldErrorProps } from './fieldError.types';\n\nconst FieldError = <\n TFieldValues extends FieldValues = FieldValues,\n TFieldNames extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n name,\n disableIcon,\n control,\n}: FieldErrorProps<TFieldValues, TFieldNames>) => {\n const formState = useFormState<TFieldValues>({ control, name });\n\n const erro = erroFieldFormatado(formState?.errors, name);\n\n if (!erro) {\n return null;\n }\n\n return (\n <Indicator severity='error' icon={disableIcon ? false : undefined}>\n {erro?.message}\n </Indicator>\n );\n};\n\nexport default FieldError;\n","import { Typography } from '@mui/material';\nimport { toRem } from '@s_mart/utils';\nimport type { FieldLabelProps } from './fieldLabel.types';\n\nconst FieldLabel = ({ label, required, regular }: FieldLabelProps) => {\n return (\n <span style={{ display: 'flex', alignItems: 'center', gap: toRem(2) }}>\n <Typography\n variant='caption'\n style={{ display: 'flex', alignItems: 'center' }}\n sx={{\n fontWeight: regular ? 400 : 700,\n }}\n >\n {label}\n </Typography>\n {required && (\n <Typography\n variant='caption'\n color='error'\n sx={{\n fontWeight: 900,\n }}\n >\n *\n </Typography>\n )}\n </span>\n );\n};\n\nexport default FieldLabel;\n","export class FormComponentPrecisaDeControl extends Error {\n constructor(componentName: string) {\n super(\n `O componente ${componentName} precisa de um control para funcionar. Passe o control como prop ou coloque o componente dentro de um <Form />`,\n );\n this.name = 'FormComponentPrecisaDeControl';\n }\n}\n","import { memo } from 'react';\n\nexport const typedMemo: <T>(c: T) => T = memo;\n","import { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport type { CheckboxProps } from './checkbox.types';\nimport { Checkbox as CheckboxMui, FormControlLabel } from '@mui/material';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\n\nconst Checkbox = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n labelPlacement,\n required,\n disableIconError,\n onChange: onChangeProp,\n ...rest\n}: CheckboxProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Checkbox');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <span>\n <FormControlLabel\n control={\n <CheckboxMui\n key={name}\n checked={Boolean(field.value)}\n value={field.value ?? ''}\n defaultValue={field.value}\n onChange={(event, checked) => {\n field.onChange(event, checked);\n onChangeProp?.(event, checked);\n }}\n {...rest}\n />\n }\n label={<FieldLabel label={label} required={required} regular />}\n labelPlacement={labelPlacement || 'end'}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </span>\n );\n};\n\nexport default typedMemo(Checkbox);\n","import { Tooltip } from '@mui/material';\nimport { LIcon } from '@s_mart/core';\nimport { lineInfoCircle } from '@s_mart/solid-icons';\nimport type { FieldInfoProps } from './fieldInfo.types';\n\nconst FieldInfo = ({ title }: FieldInfoProps) => {\n return (\n <Tooltip title={title} placement='top'>\n <div style={{ width: 'fit-content' }}>\n <LIcon icon={lineInfoCircle} color='#757575' />\n </div>\n </Tooltip>\n );\n};\n\nexport default FieldInfo;\n","import { toRem } from '@s_mart/utils';\n\nimport { css, styled } from '@mui/material';\n\nconst flexCenter = css`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const SDivAutoComplete = styled('div')`\n display: flex;\n\n div.endAdornments {\n position: absolute;\n right: 0;\n\n ${flexCenter}\n }\n\n .MuiAutocomplete-endAdornment {\n position: relative;\n right: 0;\n }\n\n .endAdornments > .MuiAutocomplete-endAdornment {\n transform: translate(0, 0);\n }\n\n .creatable,\n .editable {\n ${flexCenter}\n\n .divider {\n width: 1px;\n height: ${toRem(20)};\n background-color: ${({ theme }) => theme.palette.grey[400]};\n }\n }\n`;\n","import {\n forwardRef,\n type KeyboardEventHandler,\n type LegacyRef,\n type MouseEventHandler,\n useCallback,\n useState,\n} from 'react';\n\nimport { LIcon } from '@s_mart/core';\nimport { linePen, linePlus } from '@s_mart/solid-icons';\nimport { colorPalette } from '@s_mart/tokens';\nimport { toRem } from '@s_mart/utils';\n\nimport {\n Autocomplete,\n type AutocompleteChangeDetails,\n type AutocompleteChangeReason,\n type AutocompleteInputChangeReason,\n type AutocompleteValue,\n Button,\n Divider,\n IconButton,\n TextField,\n} from '@mui/material';\nimport isEmpty from 'lodash-es/isEmpty';\nimport isEqual from 'lodash-es/isEqual';\nimport isObject from 'lodash-es/isObject';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SDivAutoComplete } from './creatable.styles';\nimport type { CreatableProps } from './creatable.types';\n\nfunction Creatable<\n FieldValue,\n Multiple extends boolean | undefined = undefined,\n DisableClearable extends boolean | undefined = undefined,\n FreeSolo extends boolean | undefined = undefined,\n>(props: CreatableProps<FieldValue, Multiple, DisableClearable, FreeSolo>) {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n footer,\n showCreatableButton = true,\n showEditableButton,\n onEditOption,\n onCreateOption,\n getOptionKey,\n getOptionLabel,\n getOptionAfterLabel,\n getInputValueLabel,\n multiple,\n info,\n noOptionsText = 'Nenhuma opção encontrada',\n onChange: onChangeProp,\n onInputChange,\n placeholder,\n ...rest\n } = props;\n\n const [curText, setCurText] = useState('');\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Creatable');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n const hideAddButton = !showCreatableButton || rest.disabled;\n\n const { field } = useController({\n name,\n control,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const getRootRightPadding = (\n value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>,\n ) => {\n let padding = 0;\n\n if (!props.slotProps?.textField?.slotProps?.input) padding += 2.5;\n\n if (!hideAddButton) {\n padding += 2.56;\n\n if (showEditButton(value)) padding += 2.56;\n }\n\n if (!rest.disableClearable && !rest.disabled) padding += 1.3;\n\n return `${padding}rem`;\n };\n\n const showEditButton = (\n value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>,\n ) => {\n if (rest.disabled) return false;\n\n return showEditableButton && isObject(value) && !isEmpty(value);\n };\n\n const showCreateButton = () => {\n if (rest.disabled) return false;\n\n return showCreatableButton;\n };\n\n const handleCreateOption: MouseEventHandler<HTMLButtonElement> = useCallback(() => {\n if (typeof onCreateOption !== 'undefined') {\n onCreateOption(curText);\n setCurText('');\n }\n }, [curText, onCreateOption]);\n\n const handleEditOption: MouseEventHandler<HTMLButtonElement> = useCallback(() => {\n onEditOption?.(field.value);\n }, [field.value, onEditOption]);\n\n const handleInputChange = useCallback(\n (event: React.SyntheticEvent, value: string, reason: AutocompleteInputChangeReason) => {\n if (reason === 'input') {\n setCurText(value);\n onInputChange?.(value);\n }\n },\n [onInputChange],\n );\n\n const handleChange = useCallback(\n (\n _: React.SyntheticEvent,\n value: AutocompleteValue<FieldValue, Multiple, DisableClearable, FreeSolo>,\n ) => {\n setCurText('');\n field.onChange(value);\n onChangeProp?.(value);\n },\n [field.onChange, onChangeProp],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement, Element>) => {\n rest?.onBlur?.(event);\n setCurText('');\n },\n [rest?.onBlur],\n );\n\n const fieldValue = !field.value ? (multiple ? [] : null) : field.value;\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <SDivAutoComplete>\n <Autocomplete<FieldValue, Multiple, DisableClearable, FreeSolo>\n key={name}\n fullWidth\n onChange={handleChange}\n onInputChange={handleInputChange}\n onBlur={handleBlur}\n slotProps={{\n ...rest.slotProps,\n\n listbox: {\n component: forwardRef(function Ul(props, ref: LegacyRef<HTMLUListElement>) {\n return (\n <>\n <ul {...props} ref={ref} />\n\n {typeof footer !== 'undefined' ? (\n <div key='creatable-footer' {...props}>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </div>\n ) : null}\n </>\n );\n }),\n },\n }}\n value={fieldValue}\n options={options}\n multiple={multiple}\n readOnly={rest.disabled}\n noOptionsText={\n <>\n {noOptionsText}\n {!hideAddButton && (\n <Button\n sx={{\n justifyContent: 'flex-start',\n padding: `${toRem(6)} ${toRem(-16)}`,\n margin: 0,\n }}\n fullWidth\n onClick={handleCreateOption}\n variant='text'\n startIcon={<LIcon icon={linePlus} />}\n >\n Adicionar {`\"${curText}\"`}\n </Button>\n )}\n\n {typeof footer !== 'undefined' && (\n <>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </>\n )}\n </>\n }\n isOptionEqualToValue={(option, value) => isEqual(option, value)}\n getOptionLabel={\n getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel\n }\n getOptionKey={getOptionKey}\n renderOption={\n typeof getOptionAfterLabel === 'function'\n ? (props, option) => {\n const afterlabel = getOptionAfterLabel(option);\n const key = getOptionKey(option);\n return (\n <li {...props} key={key}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n <span>{getOptionLabel(option)}</span>\n {typeof afterlabel === 'string' ? <span>{afterlabel}</span> : afterlabel}\n </div>\n </li>\n );\n }\n : undefined\n }\n {...rest}\n sx={{\n '& div.MuiInputBase-root': {\n paddingRight: `${getRootRightPadding(field.value)} !important`,\n },\n ...rest.sx,\n }}\n renderInput={(params) => (\n <TextField\n placeholder={placeholder}\n {...params}\n error={Boolean(formattedError)}\n {...props.slotProps?.textField}\n slotProps={{\n ...params.slotProps,\n\n input: {\n ...params.slotProps.input,\n ...props.slotProps?.textField?.slotProps?.input,\n inputRef: field.ref,\n\n endAdornment: (\n <div className='endAdornments'>\n {params.slotProps.input.endAdornment}\n\n {/* biome-ignore lint/suspicious/noExplicitAny: A tipagem do MUI não funciona com props, porém ao usar o componente, a tipagem é inferida corretamente */}\n {(props.slotProps?.textField?.slotProps?.input as Record<string, any>)\n ?.endAdornment ?? null}\n {showEditButton(field.value) ? (\n <div className='editable'>\n <div className='divider' />\n <IconButton\n size='small'\n onClick={handleEditOption}\n sx={{ mx: '3px' }}\n tabIndex={-1}\n >\n <LIcon icon={linePen} size='24px' removeMargin />\n </IconButton>\n </div>\n ) : null}\n {showCreateButton() && (\n <div className='creatable'>\n <div className='divider' />\n <IconButton\n size='small'\n onClick={handleCreateOption}\n sx={{ mx: '3px' }}\n tabIndex={-1}\n >\n <LIcon icon={linePlus} size='24px' removeMargin />\n </IconButton>\n </div>\n )}\n </div>\n ),\n },\n }}\n />\n )}\n />\n </SDivAutoComplete>\n <FieldError name={name} control={control} />\n </div>\n );\n}\n\nexport default typedMemo(Creatable);\n","import { type IconButtonProps, IconButton, styled } from '@mui/material';\nimport { toRem } from '@s_mart/utils';\n\nconst _svgSize = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return toRem(16);\n case 'large':\n return toRem(24);\n default:\n return toRem(20);\n }\n};\n\nconst _padding = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return `${toRem(2)} ${toRem(8)}`;\n case 'large':\n return `${toRem(10)}`;\n default:\n return `${toRem(6)} ${toRem(8)}`;\n }\n};\n\nexport const SIconButton = styled(IconButton)`\n margin: 0px;\n\n padding: ${({ size }) => _padding(size)};\n border-radius: 0 ${toRem(4)} ${toRem(4)} 0;\n\n svg {\n width: ${({ size }) => _svgSize(size)} !important;\n }\n`;\n","import { composeValidators, date } from '@s_mart/rules';\n\nimport { Stack } from '@mui/material';\nimport { DatePicker as DatePickerMui } from '@mui/x-date-pickers';\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\nimport { ptBR } from '@mui/x-date-pickers/locales';\nimport { useController, useFormContext, useFormState } from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SIconButton } from './datePicker.styles';\nimport type { DatePickerProps } from './datePicker.types';\n\nimport 'dayjs/locale/pt-br';\n\nconst DatePicker = ({\n // RHF\n rules,\n name,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n disabled,\n disableIconError,\n size,\n ...rest\n}: DatePickerProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('DatePicker');\n }\n\n const formState = useFormState({ control, name });\n const formattedError = erroFieldFormatado(formState.errors, name);\n const dateFormat = rest?.format || 'DD/MM/YYYY';\n const newRules = rules ? composeValidators([date(dateFormat), rules as any]) : date(dateFormat);\n\n const { field } = useController({\n control,\n name,\n rules: newRules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <LocalizationProvider\n dateAdapter={AdapterDayjs}\n localeText={ptBR.components.MuiLocalizationProvider.defaultProps.localeText}\n >\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <DatePickerMui\n {...rest}\n key={name}\n value={field.value ?? null}\n format={dateFormat}\n onChange={(value, context) => {\n field.onChange(value, context);\n rest?.onChange?.(value, context);\n }}\n disabled={disabled}\n slots={{\n openPickerButton: SIconButton,\n }}\n slotProps={{\n ...rest?.slotProps,\n textField: {\n error: Boolean(formattedError),\n size,\n ...rest.slotProps?.textField,\n slotProps: {\n ...(rest.slotProps?.textField as any)?.slotProps,\n input: {\n ...(rest.slotProps?.textField as any)?.slotProps?.input,\n inputRef: field.ref,\n },\n },\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n </LocalizationProvider>\n );\n};\n\nexport default typedMemo(DatePicker);\n","import { type FieldValues, FormProvider as HookFormProvider } from 'react-hook-form';\n\nimport type { IFormProviderProps } from './form.types';\n\nfunction FormProvider<TFieldValues extends FieldValues>({\n children,\n style,\n onSubmit,\n ...methods\n}: IFormProviderProps<TFieldValues>) {\n return (\n <HookFormProvider<TFieldValues> {...methods}>\n <form\n onSubmit={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onSubmit(e);\n }}\n style={style}\n >\n {children}\n </form>\n </HookFormProvider>\n );\n}\n\nexport default FormProvider;\n","import { useEffect } from 'react';\n\nimport { type FieldValues, type Resolver, type UseFormReturn, useForm as useHookForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport type { IUseFormProps } from './form.types';\n\nconst useForm = <TValues extends FieldValues>({\n disableDefaultValuesUpdate,\n onSubmit,\n ...rest\n}: IUseFormProps<TValues>): UseFormReturn<TValues> & { onSubmit: (e?: React.BaseSyntheticEvent) => Promise<void> } => {\n const methods = useHookForm<TValues>({\n ...rest,\n resolver: rest.schema && (zodResolver(rest.schema) as unknown as Resolver<TValues>),\n });\n\n useEffect(() => {\n if (!disableDefaultValuesUpdate) methods.reset(rest.defaultValues as TValues);\n }, [rest.defaultValues, methods.reset]);\n\n return { ...methods, onSubmit: methods.handleSubmit((data) => onSubmit(data, methods)) };\n};\n\nexport default useForm;\n","import type { JSX } from 'react';\n\nimport type { FieldValues } from 'react-hook-form';\n\nimport type { IFormProps } from './form.types';\nimport FormProvider from './formProvider';\nimport useForm from './useForm';\n\n/**\n * Utilizado overloading para poder passar uma tipagem para o Componente\n * @example\n * // Não passar uma tipagem, todas as props terão o funcionamento normal, sem tipagem\n * <Form onSubmit={({email}) => {}}>\n * ...\n * </Form>\n * @example\n * // Passar uma tipagem, todas as props derivadas do react-hook-form terão a tipagem passada no generic\n * type Cadastro = {\n * email: string;\n * }\n * <Form<Cadastro> onSubmit={({email}) => {}}>\n * ...\n * </Form>\n */\nfunction Form(props: IFormProps<any>): JSX.Element;\nfunction Form<T extends FieldValues>(props: IFormProps<T>): JSX.Element;\n\nfunction Form<T extends FieldValues>({ children, style, ...useFormProps }: IFormProps<T>) {\n const methods = useForm<T>(useFormProps);\n\n return (\n <FormProvider {...methods} style={style}>\n {typeof children === 'function' ? children(methods) : children}\n </FormProvider>\n );\n}\n\nexport default Form;\n","import { FormControlLabel, Grid, Radio as RadioMui } from '@mui/material';\nimport type { RadioProps } from './radioButton.types';\nimport { FieldLabel } from '../../components/fieldLabel';\n\nconst RadioButton = ({ label, labelPlacement, ...rest }: RadioProps) => {\n return (\n <Grid\n sx={{\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <FormControlLabel\n control={<RadioMui {...rest} />}\n label={<FieldLabel label={label} />}\n labelPlacement={labelPlacement || 'end'}\n />\n </Grid>\n );\n};\n\nexport default RadioButton;\n","import { RadioGroup as RadioGroupMui, Stack } from '@mui/material';\nimport { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport { FieldError } from '../../components/fieldError';\nimport { FieldLabel } from '../../components/fieldLabel';\nimport type { RadioGroupProps } from './radioGroup.types';\nimport { FormComponentPrecisaDeControl } from '../../formComponentPrecisaDeControl';\n\nconst RadioGroup = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n children,\n orientation = 'row',\n disableIconError,\n ...rest\n}: RadioGroupProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('RadioGroup');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <RadioGroupMui\n key={name}\n value={field.value || ''}\n name={name}\n {...rest}\n onChange={(e) => {\n rest?.onChange?.(e, e.target?.value);\n field.onChange(e);\n }}\n style={{\n display: 'flex',\n flexDirection: orientation,\n }}\n >\n {children}\n </RadioGroupMui>\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default RadioGroup;\n","import { forwardRef, type LegacyRef } from 'react';\n\nimport { colorPalette } from '@s_mart/tokens';\n\nimport type { AutocompleteValue } from '@mui/material';\nimport { Autocomplete, Divider, TextField } from '@mui/material';\nimport isEqual from 'lodash-es/isEqual';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport type { SearchableProps } from './searchable.types';\n\nconst Searchable = <\n FieldValue,\n Multiple extends boolean | undefined = undefined,\n DisableClearable extends boolean | undefined = undefined,\n FreeSolo extends boolean | undefined = undefined,\n>(\n props: SearchableProps<FieldValue, Multiple, DisableClearable, FreeSolo>,\n) => {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n textFieldProps,\n noOptionsText,\n footer,\n multiple,\n info,\n placeholder,\n onChange: onChangeProp,\n onInputChange,\n getOptionAfterLabel,\n getOptionLabel,\n getInputValueLabel,\n getOptionKey,\n ...rest\n } = props;\n\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Searchable');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const { field } = useController({\n name,\n control,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const fieldValue = !field.value ? (multiple ? [] : null) : field.value;\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <Autocomplete<FieldValue, Multiple, DisableClearable, FreeSolo>\n key={name}\n onChange={(_, value) => {\n field.onChange(value);\n onChangeProp?.(value);\n }}\n onInputChange={(_, value, reason) => {\n if (reason === 'input') {\n onInputChange?.(value);\n }\n }}\n value={fieldValue}\n options={options}\n multiple={multiple}\n readOnly={rest.disabled}\n slotProps={{\n ...rest.slotProps,\n\n listbox: {\n component: forwardRef(function Ul(props, ref: LegacyRef<HTMLUListElement>) {\n return (\n <>\n <ul {...props} ref={ref} />\n\n {typeof footer !== 'undefined' ? (\n <div key='searchable-footer' {...props}>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </div>\n ) : null}\n </>\n );\n }),\n },\n }}\n noOptionsText={\n <>\n {noOptionsText || 'Nenhuma opção encontrada'}\n {typeof footer !== 'undefined' ? (\n <>\n <div style={{ paddingTop: '0.5rem', paddingBottom: '0.5rem' }}>\n <Divider />\n </div>\n {footer()}\n </>\n ) : null}\n </>\n }\n isOptionEqualToValue={(option, value) => isEqual(option, value)}\n getOptionLabel={getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel}\n getOptionKey={getOptionKey}\n renderOption={\n typeof getOptionAfterLabel === 'function'\n ? (props, option) => {\n const afterlabel = getOptionAfterLabel(option);\n const key = getOptionKey(option);\n return (\n <li {...props} key={key}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n <span>{getOptionLabel(option)}</span>\n {typeof afterlabel === 'string' ? <span>{afterlabel}</span> : afterlabel}\n </div>\n </li>\n );\n }\n : undefined\n }\n {...rest}\n renderInput={(params) => {\n return (\n <TextField\n error={Boolean(formattedError)}\n placeholder={placeholder}\n {...params}\n {...textFieldProps}\n inputRef={field.ref}\n />\n );\n }}\n />\n <FieldError name={name} control={control} />\n </div>\n );\n};\n\nexport default typedMemo(Searchable);\n","import { colorPalette } from '@s_mart/tokens';\n\nimport type { FieldPath, FieldValues } from 'react-hook-form';\n\nimport type { SelectReturnValueProps } from './select.types';\n\nexport const SelectRenderValue = <\n TFieldValues extends FieldValues = FieldValues,\n TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n value,\n placeholder,\n getOptionLabel,\n}: SelectReturnValueProps<TFieldValues, TFieldName>) => {\n if (value === null || value?.length === 0) {\n return <p style={{ color: colorPalette.neutral[100] }}>{placeholder}</p>;\n }\n\n return getOptionLabel(value);\n};\n","import { useState } from 'react';\n\nimport { IconButton, LIcon } from '@s_mart/core';\nimport { lineTimes } from '@s_mart/regular-icons';\nimport { colorPalette } from '@s_mart/tokens';\n\nimport { Divider, MenuItem, Select as SelectMui } from '@mui/material';\nimport {\n type FieldPath,\n type FieldPathValue,\n type FieldValues,\n useController,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldInfo } from '../components/fieldInfo';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport type { SelectProps } from './select.types';\nimport { SelectRenderValue } from './selectRenderValue';\n\nconst Select = <FieldValue extends FieldValues | string | number>(\n props: SelectProps<FieldValue>,\n) => {\n const {\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n options,\n placeholder,\n clearable,\n info,\n footer,\n onChange: onChangeProp,\n variant = 'outlined',\n getOptionKey,\n getOptionLabel,\n getOptionAfterLabel,\n getInputValueLabel,\n getOptionIcon,\n ...rest\n } = props;\n\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n const [showSelect, setShowSelect] = useState(false);\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Select');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <div style={{ display: 'flex' }}>\n {label && <FieldLabel label={label} required={required} />}\n {info && <FieldInfo title={info} />}\n </div>\n <SelectMui<FieldValue>\n key={name}\n open={showSelect}\n onOpen={() => setShowSelect(true)}\n onClose={() => setShowSelect(false)}\n displayEmpty={Boolean(placeholder)}\n variant={variant}\n autoComplete='off'\n value={field.value || null}\n renderValue={(value) => {\n return (\n <SelectRenderValue\n getOptionLabel={\n getOptionAfterLabel ? getInputValueLabel || getOptionLabel : getOptionLabel\n }\n placeholder={placeholder}\n value={value}\n />\n );\n }}\n onChange={(e) => {\n field.onChange(e.target.value);\n onChangeProp?.(e.target.value as FieldValue);\n }}\n error={Boolean(formattedError)}\n size={rest.size || 'medium'}\n inputRef={field.ref}\n {...rest}\n endAdornment={\n <>\n {rest.endAdornment}\n\n {Boolean(clearable && field.value) && (\n <IconButton\n variant='text'\n color='neutral'\n size='small'\n sx={{ borderRadius: '50%', position: 'absolute', right: '2rem' }}\n style={{ padding: 0 }}\n aria-label='Limpar'\n title='Limpar'\n onClick={() => {\n field.onChange(null);\n onChangeProp?.(null);\n }}\n >\n <LIcon\n icon={lineTimes}\n color={colorPalette.neutral[100]}\n size='25px'\n removeMargin\n />\n </IconButton>\n )}\n </>\n }\n >\n {options.map((option) => {\n const key = getOptionKey(option);\n const label = getOptionLabel(option);\n const icon = getOptionIcon?.(option);\n return (\n <MenuItem key={key} value={option as any}>\n <div style={{ display: 'flex', flexDirection: 'column', flex: 1 }}>\n {icon !== undefined ? (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {icon}\n {label}\n </div>\n ) : (\n label\n )}\n <span>{getOptionAfterLabel?.(option) ?? null}</span>\n </div>\n </MenuItem>\n );\n })}\n {footer !== undefined && (\n <div key='footer'>\n <div key='footer-divider' style={{ padding: '8px 16px' }}>\n <Divider />\n </div>\n <div key='footer-content'>{footer({ closeSelect: () => setShowSelect(false) })}</div>\n </div>\n )}\n </SelectMui>\n <FieldError name={name} control={control} />\n </div>\n );\n};\n\nexport default typedMemo(Select);\n","import { type FieldPath, type FieldValues, useController, useFormContext } from 'react-hook-form';\nimport type { SliderProps } from './slider.types';\nimport { Slider as SliderMui } from '@mui/material';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\n\nconst Slider = ({ name, rules, defaultValue, shouldUnregister, control: controlFromProps, ...rest }: SliderProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Slider');\n }\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <SliderMui\n key={name}\n value={field.value || rest?.min || 0}\n onChange={field.onChange}\n valueLabelDisplay='auto'\n {...rest}\n />\n );\n};\n\nexport default Slider;\n","import { FormControlLabel, Stack, Switch as SwitchMui } from '@mui/material';\nimport { useController, useFormContext } from 'react-hook-form';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport type { SwitchProps } from './switch.types';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\nimport { useCallback } from 'react';\n\nconst Switch = ({\n // RHF\n name,\n rules,\n defaultValue,\n defaultChecked,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n labelPlacement = 'end',\n disableIconError,\n onChange: onChangeProp,\n ...rest\n}: SwitchProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('Switch');\n }\n\n const { field } = useController<Record<string, boolean>>({\n control,\n name,\n rules,\n defaultValue: defaultChecked ?? defaultValue ?? false,\n shouldUnregister,\n });\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => {\n field.onChange(checked);\n onChangeProp?.(event, checked);\n },\n [field, onChangeProp],\n );\n\n return (\n <Stack>\n <FormControlLabel\n control={<SwitchMui {...rest} {...field} checked={Boolean(field.value)} onChange={handleChange} />}\n label={<FieldLabel label={label} />}\n labelPlacement={labelPlacement}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default Switch;\n","import { Grid, InputAdornment, Stack, TextField as TextFieldMui, Tooltip } from '@mui/material';\nimport { LIcon } from '@s_mart/core';\nimport * as masks from '@s_mart/masks';\nimport { lineEye, lineEyeSlash, lineInfoCircle } from '@s_mart/solid-icons';\nimport { useRef, useState } from 'react';\nimport { type FieldPath, type FieldValues, useController, useFormContext, useFormState } from 'react-hook-form';\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport type { TextFieldProps } from './textField.types';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { typedMemo } from '../utils/typedMemo';\n\nconst TextField = ({\n // RHF\n name,\n rules,\n defaultValue,\n shouldUnregister,\n control: controlFromProps,\n // Component Props\n label,\n required,\n mask,\n variant = 'outlined',\n info,\n parse,\n format,\n onInputChange,\n disableIconError,\n ...rest\n}: TextFieldProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n const previousValue = useRef<string | undefined>(defaultValue || undefined);\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('TextField');\n }\n\n const [showPassword, setShowPassword] = useState(false);\n\n const _handleFormat = (value: string) => {\n let _value = value;\n\n _value = format?.(value) ?? value;\n\n if (mask) {\n return masks?.[mask]?.format(_value);\n }\n\n return _value;\n };\n\n const handleParse = (value: string) => {\n let _value = value;\n\n _value = parse?.(value) ?? _value;\n\n if (mask) {\n return masks?.[mask]?.parse(_value, previousValue.current);\n }\n return _value;\n };\n\n const onKeyDown = (event?: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>): void => {\n if (!event) return;\n\n if (mask !== 'porcentagem' && mask !== 'porcentagem0') {\n return;\n }\n\n event?.stopPropagation();\n\n const value = (event?.target as HTMLInputElement).value;\n\n if (value) {\n const str = String(value);\n\n if (str.length > 0) {\n const percentIndex = str.indexOf('%');\n\n if (percentIndex > -1) {\n event.currentTarget.selectionEnd = percentIndex;\n }\n }\n }\n };\n\n const { field } = useController({\n control,\n name,\n rules,\n defaultValue,\n shouldUnregister,\n });\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n return (\n <Stack>\n <div style={{ display: 'flex' }}>\n {label && (\n <div>\n <FieldLabel label={label} required={required} />\n </div>\n )}\n {info && (\n <div>\n <Tooltip title={info} placement='top'>\n <div style={{ width: 'fit-content' }}>\n <LIcon icon={lineInfoCircle} color='#757575' />\n </div>\n </Tooltip>\n </div>\n )}\n </div>\n <TextFieldMui\n key={name}\n variant={variant}\n defaultValue={defaultValue}\n // biome-ignore lint/suspicious/noDoubleEquals: Comparamos com != pois pode ser que o valor seja '0' ou 0\n value={_handleFormat(field.value || (field.value != 0 ? '' : field.value))}\n onChange={(e) => {\n const parsedValue = handleParse(e?.target?.value);\n field.onChange(parsedValue);\n onInputChange?.(parsedValue);\n\n previousValue.current = e.target.value;\n }}\n error={Boolean(formattedError)}\n {...rest}\n type={rest.type === 'password' ? (showPassword ? 'text' : 'password') : rest.type}\n autoComplete={rest.autoComplete || 'off'}\n slotProps={{\n ...rest.slotProps,\n input: {\n onKeyDown,\n inputRef: field.ref,\n endAdornment: rest.type === 'password' && (\n <InputAdornment\n position='start'\n onClick={() => setShowPassword(!showPassword)}\n style={{ cursor: 'pointer' }}\n >\n <LIcon icon={showPassword ? lineEye : lineEyeSlash} size='24px' removeMargin />\n </InputAdornment>\n ),\n ...rest.slotProps?.input,\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n );\n};\n\nexport default typedMemo(TextField);\n","import { type BaseTextFieldProps, type IconButtonProps, styled } from '@mui/material';\nimport { IconButton } from '@mui/material';\n\nimport { toRem } from '@s_mart/utils';\n\nconst _svgSize = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return toRem(16);\n case 'large':\n return toRem(24);\n default:\n return toRem(20);\n }\n};\n\nconst _padding = (size: IconButtonProps['size']) => {\n switch (size) {\n case 'small':\n return `${toRem(2)} ${toRem(8)}`;\n case 'large':\n return toRem(10);\n default:\n return `${toRem(6)} ${toRem(8)}`;\n }\n};\n\nexport const SIconButton = styled(IconButton)`\n margin: 0px;\n\n padding: ${({ size }) => _padding(size)};\n border-radius: 0 ${toRem(4)} ${toRem(4)} 0;\n\n svg {\n width: ${({ size }) => _svgSize(size)} !important;\n }\n`;\n","import { composeValidators, time } from '@s_mart/rules';\n\nimport { Stack } from '@mui/material';\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\nimport { TimePicker as TimePickerMui } from '@mui/x-date-pickers/TimePicker';\nimport { useController, useFormContext, useFormState } from 'react-hook-form';\n\nimport { FieldError } from '../components/fieldError';\nimport { FieldLabel } from '../components/fieldLabel';\nimport { FormComponentPrecisaDeControl } from '../formComponentPrecisaDeControl';\nimport { erroFieldFormatado } from '../utils/erroFieldFormatado';\nimport { typedMemo } from '../utils/typedMemo';\nimport { SIconButton } from './timePicker.styles';\nimport type { TimePickerProps } from './timePicker.types';\n\nimport 'dayjs/locale/pt-br';\n\nconst TimePicker = ({\n // RHF\n rules,\n defaultValue,\n shouldUnregister,\n name,\n control: controlFromProps,\n // Component Props\n required,\n label,\n disabled,\n disableIconError,\n size,\n ...rest\n}: TimePickerProps) => {\n const controlFromContext = useFormContext()?.control;\n\n const control = controlFromProps ?? controlFromContext;\n\n if (!control) {\n throw new FormComponentPrecisaDeControl('TimePicker');\n }\n\n const formState = useFormState({ control, name });\n\n const formattedError = erroFieldFormatado(formState.errors, name);\n\n const timeFormat = rest.format || 'HH:mm';\n const newRules = rules ? composeValidators([time(timeFormat), rules as any]) : time(timeFormat);\n\n const { field } = useController({\n control,\n name,\n rules: newRules,\n defaultValue,\n shouldUnregister,\n });\n\n return (\n <LocalizationProvider dateAdapter={AdapterDayjs}>\n <Stack>\n {label && <FieldLabel label={label} required={required} />}\n <TimePickerMui\n key={name}\n ampm={false}\n format={timeFormat}\n value={field.value ?? null}\n disabled={disabled}\n {...rest}\n onChange={(value, context) => {\n field.onChange(value, context);\n rest?.onChange?.(value, context);\n }}\n slots={{\n openPickerButton: SIconButton,\n }}\n slotProps={{\n ...rest.slotProps,\n textField: {\n error: Boolean(formattedError),\n size,\n ...rest.slotProps?.textField,\n slotProps: {\n ...(rest.slotProps?.textField as any)?.slotProps,\n input: {\n ...(rest.slotProps?.textField as any)?.slotProps?.input,\n inputRef: field.ref,\n },\n },\n },\n actionBar: {\n actions: [],\n ...rest.slotProps?.actionBar,\n },\n }}\n />\n <FieldError name={name} disableIcon={disableIconError} control={control} />\n </Stack>\n </LocalizationProvider>\n );\n};\n\nexport default typedMemo(TimePicker);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,KAAsB,GAAkC,MACtD,EAAK,QAAQ,UAAU,EAAE,CAAC,CAAC,MAAM,GAEvC,CAAA,CAAK,QAAQ,GAA0B,MAAQ,IAAM,IAAM,CAAM,GCCpE,KAGJ,EACA,SACA,gBACA,iBACgD;CAGhD,IAAM,IAAO,EAFK,EAA2B;EAAE;EAAS;CAAK,CAE7B,CAAA,EAAW,QAAQ,CAAI;CAMvD,OAJK,IAKH,kBAAC,GAAD;EAAW,UAAS;EAAQ,MAAM,MAAsB,KAAA;EACrD,UAAA,GAAM;CACE,CAAA,IANJ;AAQX,GCvBM,KAAc,EAAE,UAAO,aAAU,iBAEnC,kBAAC,QAAD;CAAM,OAAO;EAAE,SAAS;EAAQ,YAAY;EAAU,KAAK,EAAM,CAAC;CAAE;CAApE,UAAA,CACE,kBAAC,GAAD;EACE,SAAQ;EACR,OAAO;GAAE,SAAS;GAAQ,YAAY;EAAS;EAC/C,IAAI,EACF,YAAY,IAAU,MAAM,IAC9B;EAEC,UAAA;CACS,CAAA,GACX,KACC,kBAAC,GAAD;EACE,SAAQ;EACR,OAAM;EACN,IAAI,EACF,YAAY,IACd;EACD,UAAA;CAEW,CAAA,CAEV;IC3BG,IAAb,cAAmD,MAAM;CACvD,YAAY,GAAuB;EAIjC,AAHA,MACE,gBAAgB,EAAc,+GAChC,GACA,KAAK,OAAO;CACd;AACF,GCLa,IAA4B,GC6DzC,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