@soyfri/shared-library 1.5.0-beta.4 → 1.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button-C17mExpd.cjs.map +1 -1
- package/Button-UkkP-bNw.js.map +1 -1
- package/components/ActionMenu/ActionMenu.cjs +107 -0
- package/components/ActionMenu/ActionMenu.cjs.map +1 -0
- package/components/ActionMenu/ActionMenu.d.ts +44 -0
- package/components/ActionMenu/ActionMenu.js +107 -0
- package/components/ActionMenu/ActionMenu.js.map +1 -0
- package/components/ActionMenu/index.d.ts +2 -0
- package/components/ActionMenu.d.ts +6 -0
- package/components/AppBar/AppBar.cjs +129 -0
- package/components/AppBar/AppBar.cjs.map +1 -0
- package/components/AppBar/AppBar.d.ts +55 -0
- package/components/AppBar/AppBar.js +129 -0
- package/components/AppBar/AppBar.js.map +1 -0
- package/components/AppBar/AppBar.sx.d.ts +12 -0
- package/components/AppBar/AppBarContext.d.ts +18 -0
- package/components/AppBar/AppBarMenuToggle.d.ts +39 -0
- package/components/AppBar/index.d.ts +6 -0
- package/components/AppBar.d.ts +6 -0
- package/components/Autocomplete/Autocomplete.cjs +263 -82
- package/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +71 -13
- package/components/Autocomplete/Autocomplete.definitions.d.ts +7 -0
- package/components/Autocomplete/Autocomplete.helpers.d.ts +22 -0
- package/components/Autocomplete/Autocomplete.js +264 -83
- package/components/Autocomplete/Autocomplete.js.map +1 -1
- package/components/Autocomplete/Autocomplete.sx.d.ts +7 -0
- package/components/Autocomplete/_parts/AutocompleteChips.d.ts +20 -0
- package/components/Autocomplete/_parts/AutocompleteLoader.d.ts +9 -0
- package/components/Autocomplete/_parts/AutocompleteOption.d.ts +16 -0
- package/components/Autocomplete/index.d.ts +2 -1
- package/components/Autocomplete.d.ts +4 -0
- package/components/Avatar/Avatar.cjs +117 -81
- package/components/Avatar/Avatar.cjs.map +1 -1
- package/components/Avatar/Avatar.d.ts +16 -2
- package/components/Avatar/Avatar.definitions.d.ts +11 -0
- package/components/Avatar/Avatar.js +118 -82
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/index.d.ts +1 -0
- package/components/Button/Button.d.ts +5 -5
- package/components/Button/index.d.ts +1 -0
- package/components/Card/Card.cjs +78 -7
- package/components/Card/Card.cjs.map +1 -1
- package/components/Card/Card.d.ts +31 -8
- package/components/Card/Card.js +79 -8
- package/components/Card/Card.js.map +1 -1
- package/components/Card/Card.sx.d.ts +14 -0
- package/components/Card/index.d.ts +4 -1
- package/components/Card.d.ts +4 -0
- package/components/Checkbox/Checkbox.cjs +189 -0
- package/components/Checkbox/Checkbox.cjs.map +1 -0
- package/components/Checkbox/Checkbox.d.ts +55 -0
- package/components/Checkbox/Checkbox.js +189 -0
- package/components/Checkbox/Checkbox.js.map +1 -0
- package/components/Checkbox/Checkbox.sx.d.ts +13 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox.d.ts +6 -0
- package/components/Chip/Chip.cjs +2 -1
- package/components/Chip/Chip.cjs.map +1 -1
- package/components/Chip/Chip.js +2 -1
- package/components/Chip/Chip.js.map +1 -1
- package/components/Chip/index.d.ts +2 -1
- package/components/Chip.d.ts +4 -0
- package/components/DatePicker/DatePicker.cjs +178 -3
- package/components/DatePicker/DatePicker.cjs.map +1 -1
- package/components/DatePicker/DatePicker.d.ts +35 -9
- package/components/DatePicker/DatePicker.definitions.d.ts +1 -0
- package/components/DatePicker/DatePicker.helpers.d.ts +7 -0
- package/components/DatePicker/DatePicker.js +177 -2
- package/components/DatePicker/DatePicker.js.map +1 -1
- package/components/DatePicker/DatePicker.sx.d.ts +9 -0
- package/components/DatePicker/index.d.ts +2 -1
- package/components/DatePicker.d.ts +4 -0
- package/components/DateTimePicker/DateTimePicker.cjs +121 -131
- package/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
- package/components/DateTimePicker/DateTimePicker.d.ts +41 -12
- package/components/DateTimePicker/DateTimePicker.definitions.d.ts +3 -0
- package/components/DateTimePicker/DateTimePicker.helpers.d.ts +13 -0
- package/components/DateTimePicker/DateTimePicker.js +121 -131
- package/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/components/DateTimePicker/DateTimePicker.sx.d.ts +7 -0
- package/components/DateTimePicker/index.d.ts +2 -1
- package/components/DateTimePicker.d.ts +4 -0
- package/components/Drawer/Drawer.cjs +272 -0
- package/components/Drawer/Drawer.cjs.map +1 -0
- package/components/Drawer/Drawer.d.ts +58 -0
- package/components/Drawer/Drawer.js +272 -0
- package/components/Drawer/Drawer.js.map +1 -0
- package/components/Drawer/Drawer.sx.d.ts +23 -0
- package/components/Drawer/DrawerContext.d.ts +18 -0
- package/components/Drawer/DrawerItem.d.ts +40 -0
- package/components/Drawer/index.d.ts +6 -0
- package/components/Drawer.d.ts +6 -0
- package/components/Gallery/Gallery.cjs +154 -79
- package/components/Gallery/Gallery.cjs.map +1 -1
- package/components/Gallery/Gallery.d.ts +25 -9
- package/components/Gallery/Gallery.js +154 -79
- package/components/Gallery/Gallery.js.map +1 -1
- package/components/Gallery/GalleryLightbox.d.ts +6 -10
- package/components/Gallery/GalleryMain.d.ts +3 -7
- package/components/Gallery/GalleryThumbnails.d.ts +7 -11
- package/components/Gallery/index.d.ts +2 -1
- package/components/Gallery.d.ts +4 -0
- package/components/Icon/Icon.cjs +49 -10
- package/components/Icon/Icon.cjs.map +1 -1
- package/components/Icon/Icon.d.ts +29 -2
- package/components/Icon/Icon.js +49 -10
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/index.d.ts +2 -1
- package/components/Icon.d.ts +4 -0
- package/components/Input/Input.cjs +186 -3
- package/components/Input/Input.cjs.map +1 -1
- package/components/Input/Input.d.ts +29 -17
- package/components/Input/Input.definitions.d.ts +6 -2
- package/components/Input/Input.helpers.d.ts +14 -0
- package/components/Input/Input.js +185 -2
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.sx.d.ts +8 -0
- package/components/Input/index.d.ts +2 -1
- package/components/Input.d.ts +4 -0
- package/components/InputGroup/InputGroup.cjs +107 -93
- package/components/InputGroup/InputGroup.cjs.map +1 -1
- package/components/InputGroup/InputGroup.d.ts +38 -2
- package/components/InputGroup/InputGroup.definitions.d.ts +6 -0
- package/components/InputGroup/InputGroup.js +109 -95
- package/components/InputGroup/InputGroup.js.map +1 -1
- package/components/InputGroup/index.d.ts +2 -1
- package/components/InputGroup.d.ts +4 -0
- package/components/Modal/Modal.cjs +287 -148
- package/components/Modal/Modal.cjs.map +1 -1
- package/components/Modal/Modal.d.ts +57 -6
- package/components/Modal/Modal.js +289 -150
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/ModalBody.d.ts +6 -1
- package/components/Modal/ModalFooter.d.ts +12 -4
- package/components/Modal/ModalHeader.d.ts +6 -1
- package/components/Modal/index.d.ts +8 -1
- package/components/Modal.d.ts +4 -0
- package/components/RadioGroup/RadioGroup.cjs +204 -0
- package/components/RadioGroup/RadioGroup.cjs.map +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +59 -0
- package/components/RadioGroup/RadioGroup.definitions.d.ts +6 -0
- package/components/RadioGroup/RadioGroup.js +204 -0
- package/components/RadioGroup/RadioGroup.js.map +1 -0
- package/components/RadioGroup/RadioGroup.sx.d.ts +20 -0
- package/components/RadioGroup/index.d.ts +2 -0
- package/components/RadioGroup.d.ts +6 -0
- package/components/Select/Select.cjs +311 -4
- package/components/Select/Select.cjs.map +1 -1
- package/components/Select/Select.d.ts +62 -27
- package/components/Select/Select.helpers.d.ts +15 -0
- package/components/Select/Select.js +310 -3
- package/components/Select/Select.js.map +1 -1
- package/components/Select/Select.sx.d.ts +7 -0
- package/components/Select/_parts/SelectMenuItem.d.ts +20 -0
- package/components/Select/index.d.ts +2 -1
- package/components/Select.d.ts +4 -0
- package/components/Stat/Stat.cjs +2 -2
- package/components/Stat/Stat.cjs.map +1 -1
- package/components/Stat/Stat.js +2 -2
- package/components/Stat/Stat.js.map +1 -1
- package/components/Stat/index.d.ts +2 -1
- package/components/Stat.d.ts +4 -0
- package/components/StatusMessage/StatusMessage.cjs +66 -55
- package/components/StatusMessage/StatusMessage.cjs.map +1 -1
- package/components/StatusMessage/StatusMessage.d.ts +20 -36
- package/components/StatusMessage/StatusMessage.js +68 -57
- package/components/StatusMessage/StatusMessage.js.map +1 -1
- package/components/StatusMessage/index.d.ts +2 -1
- package/components/StatusMessage.d.ts +4 -0
- package/components/Stepper/Stepper.cjs +285 -29
- package/components/Stepper/Stepper.cjs.map +1 -1
- package/components/Stepper/Stepper.d.ts +13 -7
- package/components/Stepper/Stepper.js +287 -31
- package/components/Stepper/Stepper.js.map +1 -1
- package/components/Stepper/StepperContext.d.ts +73 -0
- package/components/Stepper/_hooks/useHorizontalScroll.d.ts +19 -0
- package/components/Stepper/_parts/StepperScrollArrow.d.ts +19 -0
- package/components/Stepper/index.d.ts +6 -2
- package/components/Stepper.d.ts +4 -0
- package/components/Switch/Switch.cjs +184 -0
- package/components/Switch/Switch.cjs.map +1 -0
- package/components/Switch/Switch.d.ts +48 -0
- package/components/Switch/Switch.definitions.d.ts +7 -0
- package/components/Switch/Switch.js +184 -0
- package/components/Switch/Switch.js.map +1 -0
- package/components/Switch/Switch.sx.d.ts +22 -0
- package/components/Switch/Switch.types.d.ts +1 -0
- package/components/Switch/index.d.ts +2 -0
- package/components/Switch.d.ts +6 -0
- package/components/Tabs/Tabs.cjs +45 -29
- package/components/Tabs/Tabs.cjs.map +1 -1
- package/components/Tabs/Tabs.d.ts +21 -16
- package/components/Tabs/Tabs.js +46 -30
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/index.d.ts +4 -2
- package/components/Tabs.d.ts +4 -0
- package/components/Timeline/Timeline.cjs +3 -2
- package/components/Timeline/Timeline.cjs.map +1 -1
- package/components/Timeline/Timeline.d.ts +4 -8
- package/components/Timeline/Timeline.js +3 -2
- package/components/Timeline/Timeline.js.map +1 -1
- package/components/Timeline/index.d.ts +4 -2
- package/components/Timeline.d.ts +4 -0
- package/components/_shared/formField.sx.d.ts +33 -0
- package/components/_shared/mergeSx.d.ts +7 -0
- package/components/_shared/resolvePreset.d.ts +18 -0
- package/formField.sx-8_QRnKxv.js +68 -0
- package/formField.sx-8_QRnKxv.js.map +1 -0
- package/formField.sx-BAX7KwMR.cjs +67 -0
- package/formField.sx-BAX7KwMR.cjs.map +1 -0
- package/index.cjs +144 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +4 -0
- package/index.js +49 -2
- package/index.js.map +1 -1
- package/mergeSx-BXoNZjB_.js +10 -0
- package/mergeSx-BXoNZjB_.js.map +1 -0
- package/mergeSx-Dbccoo_H.cjs +9 -0
- package/mergeSx-Dbccoo_H.cjs.map +1 -0
- package/mui.d.ts +7 -0
- package/package.json +31 -1
- package/resolvePreset-B-IB0ehH.js +15 -0
- package/resolvePreset-B-IB0ehH.js.map +1 -0
- package/resolvePreset-CT3kU-K2.cjs +14 -0
- package/resolvePreset-CT3kU-K2.cjs.map +1 -0
- package/theme/componentStyles.d.ts +32 -0
- package/theme/tokens.d.ts +28 -0
- package/tokens-BRrcP_p_.js +21 -0
- package/tokens-BRrcP_p_.js.map +1 -0
- package/tokens-jaWWNk39.cjs +20 -0
- package/tokens-jaWWNk39.cjs.map +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/scrollToTop.d.ts +28 -0
- package/DatePicker-BSNboVhN.js +0 -201
- package/DatePicker-BSNboVhN.js.map +0 -1
- package/DatePicker-BoqxWAhj.cjs +0 -200
- package/DatePicker-BoqxWAhj.cjs.map +0 -1
- package/Input-DFHs7cJ_.js +0 -171
- package/Input-DFHs7cJ_.js.map +0 -1
- package/Input-c8MwNNPg.cjs +0 -170
- package/Input-c8MwNNPg.cjs.map +0 -1
- package/Select-BO2N56sm.cjs +0 -411
- package/Select-BO2N56sm.cjs.map +0 -1
- package/Select-BcLkyHSE.js +0 -412
- package/Select-BcLkyHSE.js.map +0 -1
- package/components/Select/Select.definitions.d.ts +0 -14
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare const BasicTextInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const BasicTextInputExample = () => {\n const [value, setValue] = useState('Texto de ejemplo');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Nombre\"\n value={value}\n onChange={setValue}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
2
2
|
export declare const NumberInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const NumberInputExample = () => {\n const [value, setValue] = useState(123);\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Cantidad\"\n type=\"number\"\n value={value}\n onChange={setValue}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
3
|
-
export declare const EmailInputDefinition = "\nimport React, { useState }
|
|
3
|
+
export declare const EmailInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const EmailInputExample = () => {\n const [value, setValue] = useState('ejemplo@dominio.com');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Correo Electr\u00F3nico\"\n type=\"email\"\n value={value}\n onChange={setValue}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
4
4
|
export declare const PasswordInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const PasswordInputExample = () => {\n const [value, setValue] = useState('micontrase\u00F1a');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Contrase\u00F1a\"\n type=\"password\"\n value={value}\n onChange={setValue}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
5
5
|
export declare const InputWithPlaceholderDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const InputWithPlaceholderExample = () => {\n const [value, setValue] = useState('');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"B\u00FAsqueda\"\n placeholder=\"Escribe tu t\u00E9rmino de b\u00FAsqueda...\"\n value={value}\n onChange={setValue}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value || 'Vac\u00EDo'}</Typography>\n </Box>\n );\n};\n";
|
|
6
6
|
export declare const InputWithErrorDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const InputWithErrorExample = () => {\n const [value, setValue] = useState('invalido');\n const hasError = value.length < 5 && value.length > 0;\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Nombre de usuario\"\n value={value}\n onChange={setValue}\n error={hasError}\n helperText={hasError ? 'M\u00EDnimo 5 caracteres' : ''}\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
7
7
|
export declare const DisabledInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const DisabledInputExample = () => {\n const [value, setValue] = useState('Campo deshabilitado');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Estado\"\n value={value}\n onChange={setValue}\n disabled\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
8
|
-
export declare const ReadOnlyInputDefinition = "\nimport React, { useState }
|
|
8
|
+
export declare const ReadOnlyInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const ReadOnlyInputExample = () => {\n const [value, setValue] = useState('Valor de solo lectura');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Informaci\u00F3n\"\n value={value}\n onChange={setValue}\n readOnly\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
9
9
|
export declare const InputVariantsDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const InputVariantsExample = () => {\n const [valueOutlined, setValueOutlined] = useState('Outlined');\n const [valueFilled, setValueFilled] = useState('Filled');\n const [valueStandard, setValueStandard] = useState('Standard');\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, width: 300 }}>\n <Input\n label=\"Esquema Outlined\"\n value={valueOutlined}\n onChange={setValueOutlined}\n variant=\"outlined\"\n />\n <Input\n label=\"Esquema Filled\"\n value={valueFilled}\n onChange={setValueFilled}\n variant=\"filled\"\n />\n <Input\n label=\"Esquema Standard\"\n value={valueStandard}\n onChange={setValueStandard}\n variant=\"standard\"\n />\n </Box>\n );\n};\n";
|
|
10
10
|
export declare const InputSizesDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const InputSizesExample = () => {\n const [valueMedium, setValueMedium] = useState('Tama\u00F1o Mediano');\n const [valueSmall, setValueSmall] = useState('Tama\u00F1o Peque\u00F1o');\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, width: 300 }}>\n <Input\n label=\"Input Mediano\"\n value={valueMedium}\n onChange={setValueMedium}\n size=\"medium\"\n />\n <Input\n label=\"Input Peque\u00F1o\"\n value={valueSmall}\n onChange={setValueSmall}\n size=\"small\"\n />\n </Box>\n );\n};\n";
|
|
11
11
|
export declare const FullWidthInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box, Typography } from '@mui/material';\n\nexport const FullWidthInputExample = () => {\n const [value, setValue] = useState('Ocupa todo el ancho');\n return (\n <Box sx={{ width: '100%' }}>\n <Input\n label=\"Input de Ancho Completo\"\n value={value}\n onChange={setValue}\n fullWidth\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
12
|
+
export declare const LabelPositionFloatingDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box } from '@mui/material';\n\nexport const LabelPositionExample = () => {\n const [outside, setOutside] = useState('Outside (default)');\n const [floating, setFloating] = useState('Floating');\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, width: 300 }}>\n <Input\n label=\"Label outside\"\n value={outside}\n onChange={setOutside}\n labelPosition=\"outside\"\n />\n <Input\n label=\"Label floating (MUI cl\u00E1sico)\"\n value={floating}\n onChange={setFloating}\n labelPosition=\"floating\"\n />\n </Box>\n );\n};\n";
|
|
13
|
+
export declare const CustomBorderRadiusDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box } from '@mui/material';\n\nexport const CustomBorderRadiusExample = () => {\n const [v, setV] = useState('Texto');\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, width: 300 }}>\n <Input label=\"Sin radius\" value={v} onChange={setV} borderRadius={0} />\n <Input label=\"Radius 4px\" value={v} onChange={setV} borderRadius={4} />\n <Input label=\"Default (10px)\" value={v} onChange={setV} />\n <Input label=\"Pill (24px)\" value={v} onChange={setV} borderRadius={24} />\n </Box>\n );\n};\n";
|
|
14
|
+
export declare const CustomStylingDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input'; // Ajusta la ruta si es necesario\nimport { Box } from '@mui/material';\n\nexport const CustomStylingExample = () => {\n const [v, setV] = useState('Custom completo');\n return (\n <Box sx={{ width: 300 }}>\n <Input\n label=\"Combinado: bg + borderColor + label color\"\n value={v}\n onChange={setV}\n sx={{\n '& .MuiInputLabel-root': { color: 'primary.main' },\n '& .MuiOutlinedInput-root': { bgcolor: '#fff7e6' },\n '& .MuiOutlinedInput-notchedOutline': {\n borderColor: 'warning.main',\n borderWidth: 2,\n },\n }}\n />\n </Box>\n );\n};\n";
|
|
15
|
+
export declare const MultilineInputDefinition = "\nimport React, { useState } from 'react';\nimport { Input } from './Input';\nimport { Box, Typography } from '@mui/material';\n\nexport const MultilineInputExample = () => {\n const [value, setValue] = useState('Escribe un comentario en varias l\u00EDneas...');\n return (\n <Box sx={{ width: 400 }}>\n <Input\n label=\"Comentario\"\n value={value}\n onChange={(v) => setValue(v.toString())}\n multiline\n minRows={3}\n maxRows={6}\n fullWidth\n />\n <Typography sx={{ mt: 2 }}>Valor actual: {value}</Typography>\n </Box>\n );\n};\n";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
|
3
|
+
import { InputType } from './Input';
|
|
4
|
+
/**
|
|
5
|
+
* Convierte el valor raw del evento al tipo apropiado.
|
|
6
|
+
* Para type="number" intenta parsear a número; si falla, devuelve el raw
|
|
7
|
+
* (permite estados intermedios como "" o "-" mientras el usuario tipea).
|
|
8
|
+
*/
|
|
9
|
+
export declare const parseValue: (raw: string, type: InputType) => string | number;
|
|
10
|
+
/**
|
|
11
|
+
* Construye los slotProps del TextField consolidando htmlInput + inputLabel.
|
|
12
|
+
* Maneja los atributos min/max cuando type="number", maxLength y readOnly.
|
|
13
|
+
*/
|
|
14
|
+
export declare const buildSlotProps: (type: InputType, min: number | undefined, max: number | undefined, maxLength: number | undefined, customSlotProps: TextFieldProps["slotProps"], customInputProps: InputHTMLAttributes<HTMLInputElement> | undefined, readOnly?: boolean) => TextFieldProps["slotProps"];
|
|
@@ -1,5 +1,188 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
import { TextField } from "@mui/material";
|
|
34
|
+
import { useTheme } from "@mui/material/styles";
|
|
35
|
+
import { Controller } from "react-hook-form";
|
|
36
|
+
import { b as buildFormFieldSx } from "../../formField.sx-8_QRnKxv.js";
|
|
37
|
+
import { F as FIELD_INPUT_PADDING_Y } from "../../tokens-BRrcP_p_.js";
|
|
38
|
+
import { r as resolvePreset } from "../../resolvePreset-B-IB0ehH.js";
|
|
39
|
+
const parseValue = (raw, type) => {
|
|
40
|
+
if (type !== "number") return raw;
|
|
41
|
+
if (raw === "" || raw === "-") return raw;
|
|
42
|
+
const n = parseFloat(raw);
|
|
43
|
+
return isNaN(n) ? raw : n;
|
|
44
|
+
};
|
|
45
|
+
const buildSlotProps = (type, min, max, maxLength, customSlotProps, customInputProps, readOnly) => {
|
|
46
|
+
const numberAttrs = type === "number" ? __spreadValues({ min: min != null ? min : Number.NEGATIVE_INFINITY }, max !== void 0 && { max }) : {};
|
|
47
|
+
return __spreadProps(__spreadValues({}, customSlotProps), {
|
|
48
|
+
htmlInput: __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, customInputProps), customSlotProps == null ? void 0 : customSlotProps.htmlInput), numberAttrs), maxLength !== void 0 && { maxLength }), readOnly && { readOnly: true }),
|
|
49
|
+
// Dejamos que MUI maneje el shrink nativamente (animación inside → up).
|
|
50
|
+
// El consumidor puede forzar shrink con slotProps.inputLabel.shrink=true si lo necesita.
|
|
51
|
+
inputLabel: __spreadValues({}, customSlotProps == null ? void 0 : customSlotProps.inputLabel)
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const buildInputSx = (borderRadius, labelPosition) => {
|
|
55
|
+
const radius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
56
|
+
return buildFormFieldSx({
|
|
57
|
+
borderRadius,
|
|
58
|
+
labelPosition,
|
|
59
|
+
extraOutsideSx: {
|
|
60
|
+
"& .MuiInputBase-input": {
|
|
61
|
+
paddingTop: FIELD_INPUT_PADDING_Y,
|
|
62
|
+
paddingBottom: FIELD_INPUT_PADDING_Y
|
|
63
|
+
},
|
|
64
|
+
// Filled: quitar el padding-top reservado para el label flotante dentro.
|
|
65
|
+
"& .MuiFilledInput-root": {
|
|
66
|
+
paddingTop: 0,
|
|
67
|
+
borderRadius: `${radius} ${radius} 0 0`
|
|
68
|
+
},
|
|
69
|
+
"& .MuiFilledInput-input": {
|
|
70
|
+
paddingTop: FIELD_INPUT_PADDING_Y
|
|
71
|
+
},
|
|
72
|
+
// Standard: quitar el margin-top reservado para el label flotante.
|
|
73
|
+
"& .MuiInput-root": {
|
|
74
|
+
marginTop: 0
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const Input = (props) => {
|
|
80
|
+
const _a = props, {
|
|
81
|
+
type = "text",
|
|
82
|
+
variant = "outlined",
|
|
83
|
+
size = "small",
|
|
84
|
+
borderRadius = 10,
|
|
85
|
+
labelPosition = "outside",
|
|
86
|
+
preset,
|
|
87
|
+
min,
|
|
88
|
+
max,
|
|
89
|
+
maxLength,
|
|
90
|
+
readOnly,
|
|
91
|
+
inputProps,
|
|
92
|
+
slotProps,
|
|
93
|
+
sx,
|
|
94
|
+
onBlur
|
|
95
|
+
} = _a, rest = __objRest(_a, [
|
|
96
|
+
"type",
|
|
97
|
+
"variant",
|
|
98
|
+
"size",
|
|
99
|
+
"borderRadius",
|
|
100
|
+
"labelPosition",
|
|
101
|
+
"preset",
|
|
102
|
+
"min",
|
|
103
|
+
"max",
|
|
104
|
+
"maxLength",
|
|
105
|
+
"readOnly",
|
|
106
|
+
"inputProps",
|
|
107
|
+
"slotProps",
|
|
108
|
+
"sx",
|
|
109
|
+
"onBlur"
|
|
110
|
+
]);
|
|
111
|
+
const theme = useTheme();
|
|
112
|
+
const presetSx = resolvePreset("Input", preset, theme);
|
|
113
|
+
const finalSlotProps = buildSlotProps(
|
|
114
|
+
type,
|
|
115
|
+
min,
|
|
116
|
+
max,
|
|
117
|
+
maxLength,
|
|
118
|
+
slotProps,
|
|
119
|
+
inputProps,
|
|
120
|
+
readOnly
|
|
121
|
+
);
|
|
122
|
+
const mergedSx = [
|
|
123
|
+
buildInputSx(borderRadius, labelPosition),
|
|
124
|
+
...presetSx ? [presetSx] : [],
|
|
125
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
126
|
+
];
|
|
127
|
+
if ("control" in props && props.control) {
|
|
128
|
+
const { name, control, validation, onValueChange } = props;
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
Controller,
|
|
131
|
+
{
|
|
132
|
+
name,
|
|
133
|
+
control,
|
|
134
|
+
rules: validation,
|
|
135
|
+
render: ({ field, fieldState: { error } }) => {
|
|
136
|
+
var _a2, _b;
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
TextField,
|
|
139
|
+
__spreadProps(__spreadValues({
|
|
140
|
+
fullWidth: true
|
|
141
|
+
}, rest), {
|
|
142
|
+
name: field.name,
|
|
143
|
+
value: (_a2 = field.value) != null ? _a2 : "",
|
|
144
|
+
onChange: (e) => {
|
|
145
|
+
const parsed = parseValue(e.target.value, type);
|
|
146
|
+
field.onChange(parsed);
|
|
147
|
+
onValueChange == null ? void 0 : onValueChange(parsed);
|
|
148
|
+
},
|
|
149
|
+
onBlur: (e) => {
|
|
150
|
+
field.onBlur();
|
|
151
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
152
|
+
},
|
|
153
|
+
inputRef: field.ref,
|
|
154
|
+
type,
|
|
155
|
+
variant,
|
|
156
|
+
size,
|
|
157
|
+
slotProps: finalSlotProps,
|
|
158
|
+
sx: mergedSx,
|
|
159
|
+
error: !!error || rest.error,
|
|
160
|
+
helperText: (_b = error == null ? void 0 : error.message) != null ? _b : rest.helperText
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const { value, onChange } = props;
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
TextField,
|
|
170
|
+
__spreadProps(__spreadValues({
|
|
171
|
+
fullWidth: true
|
|
172
|
+
}, rest), {
|
|
173
|
+
value: value != null ? value : "",
|
|
174
|
+
onChange: (e) => onChange(parseValue(e.target.value, type)),
|
|
175
|
+
onBlur,
|
|
176
|
+
type,
|
|
177
|
+
variant,
|
|
178
|
+
size,
|
|
179
|
+
slotProps: finalSlotProps,
|
|
180
|
+
sx: mergedSx
|
|
181
|
+
})
|
|
182
|
+
);
|
|
183
|
+
};
|
|
2
184
|
export {
|
|
3
|
-
|
|
185
|
+
Input,
|
|
186
|
+
Input as default
|
|
4
187
|
};
|
|
5
188
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.helpers.ts","../../../src/components/Input/Input.sx.ts","../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { InputHTMLAttributes } from 'react';\nimport type { TextFieldProps } from '@mui/material';\nimport type { InputType } from './Input';\n\n/**\n * Convierte el valor raw del evento al tipo apropiado.\n * Para type=\"number\" intenta parsear a número; si falla, devuelve el raw\n * (permite estados intermedios como \"\" o \"-\" mientras el usuario tipea).\n */\nexport const parseValue = (raw: string, type: InputType): string | number => {\n if (type !== 'number') return raw;\n if (raw === '' || raw === '-') return raw;\n const n = parseFloat(raw);\n return isNaN(n) ? raw : n;\n};\n\n/**\n * Construye los slotProps del TextField consolidando htmlInput + inputLabel.\n * Maneja los atributos min/max cuando type=\"number\", maxLength y readOnly.\n */\nexport const buildSlotProps = (\n type: InputType,\n min: number | undefined,\n max: number | undefined,\n maxLength: number | undefined,\n customSlotProps: TextFieldProps['slotProps'],\n customInputProps: InputHTMLAttributes<HTMLInputElement> | undefined,\n readOnly?: boolean,\n): TextFieldProps['slotProps'] => {\n const numberAttrs =\n type === 'number'\n ? { min: min ?? Number.NEGATIVE_INFINITY, ...(max !== undefined && { max }) }\n : {};\n\n return {\n ...customSlotProps,\n htmlInput: {\n ...customInputProps,\n ...(customSlotProps as any)?.htmlInput,\n ...numberAttrs,\n ...(maxLength !== undefined && { maxLength }),\n ...(readOnly && { readOnly: true }),\n },\n // Dejamos que MUI maneje el shrink nativamente (animación inside → up).\n // El consumidor puede forzar shrink con slotProps.inputLabel.shrink=true si lo necesita.\n inputLabel: {\n ...(customSlotProps as any)?.inputLabel,\n },\n };\n};\n","import type { TextFieldProps } from '@mui/material';\n\nimport { buildFormFieldSx } from '../_shared/formField.sx';\nimport { FIELD_INPUT_PADDING_Y } from '../../theme/tokens';\nimport type { LabelPosition } from './Input';\n\n/**\n * Builder de sx para el Input. Usa el builder compartido\n * `buildFormFieldSx` y añade overrides específicos de TextField\n * (padding del input base, filled, standard).\n */\nexport const buildInputSx = (\n borderRadius: number | string,\n labelPosition: LabelPosition,\n): TextFieldProps['sx'] => {\n const radius = typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n return buildFormFieldSx({\n borderRadius,\n labelPosition,\n extraOutsideSx: {\n '& .MuiInputBase-input': {\n paddingTop: FIELD_INPUT_PADDING_Y,\n paddingBottom: FIELD_INPUT_PADDING_Y,\n },\n\n // Filled: quitar el padding-top reservado para el label flotante dentro.\n '& .MuiFilledInput-root': {\n paddingTop: 0,\n borderRadius: `${radius} ${radius} 0 0`,\n },\n '& .MuiFilledInput-input': {\n paddingTop: FIELD_INPUT_PADDING_Y,\n },\n\n // Standard: quitar el margin-top reservado para el label flotante.\n '& .MuiInput-root': {\n marginTop: 0,\n },\n },\n });\n};\n","import { TextField, type TextFieldProps } from '@mui/material';\nimport { useTheme } from '@mui/material/styles';\nimport { Controller, type Control, type RegisterOptions } from 'react-hook-form';\n\nimport { parseValue, buildSlotProps } from './Input.helpers';\nimport { buildInputSx } from './Input.sx';\nimport { resolvePreset } from '../_shared/resolvePreset';\n\n// ── Tipos de dominio ─────────────────────────────────────────────────────\nexport type InputType =\n | 'text' | 'number' | 'email' | 'password' | 'tel'\n | 'url' | 'search' | 'date' | 'datetime-local'\n | 'month' | 'week' | 'time' | 'color';\n\nexport type LabelPosition = 'outside' | 'floating';\n\n// ── Props base (todo lo común entre RHF y controlado) ────────────────────\nexport interface BaseInputProps\n extends Omit<TextFieldProps, 'value' | 'onChange' | 'type'> {\n type?: InputType;\n min?: number;\n max?: number;\n maxLength?: number;\n /** Border radius del input. Default: 10 */\n borderRadius?: number | string;\n /** \"outside\" = label arriba del campo (default). \"floating\" = label clásico MUI dentro del borde */\n labelPosition?: LabelPosition;\n readOnly?: boolean;\n /**\n * Nombre del preset de estilo registrado en `theme.styles.Input`.\n * - `\"default\"` (o ausente) = estilo built-in del paquete.\n * - Cualquier otro string = mergea el preset encima del estilo built-in.\n */\n preset?: string;\n}\n\n// ── Variantes discriminadas (RHF vs controlado) ──────────────────────────\nexport interface RHFInputProps extends BaseInputProps {\n name: string;\n // `any` plano (no `Control<any>`): RHF tipa `Control<T>` con generics en\n // posiciones tanto contravariantes como covariantes (ej. `_subjects.state`).\n // Cuando el componente o su uso involucra generics adicionales, TS se\n // confunde narroweando el discriminated union y `Control<any>` no logra\n // absorber `Control<MyForm>` en la comparación estructural profunda. El\n // `any` plano elimina ese ruido. RHF adentro sigue teniendo sus tipos\n // fuertes — solo degradamos la superficie del prop del componente.\n control: any;\n validation?: RegisterOptions;\n /**\n * Side-effect que corre después de que RHF actualiza el form state.\n * Útil para cascadas entre campos (ej. reset de municipio al cambiar\n * departamento). NO reemplaza al handler de RHF.\n */\n onValueChange?: (value: string | number) => void;\n value?: never;\n onChange?: never;\n}\n\nexport interface ControlledInputProps extends BaseInputProps {\n name?: string;\n control?: never;\n validation?: never;\n value: string | number;\n onChange: (value: string | number) => void;\n}\n\n// ── API pública final ────────────────────────────────────────────────────\nexport type InputProps = RHFInputProps | ControlledInputProps;\n\nexport const Input: React.FC<InputProps> = (props) => {\n const {\n type = 'text',\n variant = 'outlined',\n size = 'small',\n borderRadius = 10,\n labelPosition = 'outside',\n preset,\n min,\n max,\n maxLength,\n readOnly,\n inputProps,\n slotProps,\n sx,\n onBlur,\n ...rest\n } = props as ControlledInputProps & {\n control?: Control<any>;\n validation?: RegisterOptions;\n };\n\n const theme = useTheme();\n const presetSx = resolvePreset('Input', preset, theme);\n\n const finalSlotProps = buildSlotProps(\n type,\n min,\n max,\n maxLength,\n slotProps,\n inputProps,\n readOnly,\n );\n const mergedSx = [\n buildInputSx(borderRadius, labelPosition),\n ...(presetSx ? [presetSx] : []),\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ];\n\n if ('control' in props && props.control) {\n const { name, control, validation, onValueChange } = props as RHFInputProps;\n return (\n <Controller\n name={name}\n control={control}\n rules={validation}\n render={({ field, fieldState: { error } }) => (\n <TextField\n fullWidth\n {...rest}\n name={field.name}\n value={field.value ?? ''}\n onChange={(e) => {\n const parsed = parseValue(e.target.value, type);\n field.onChange(parsed);\n onValueChange?.(parsed);\n }}\n onBlur={(e) => {\n field.onBlur();\n onBlur?.(e);\n }}\n inputRef={field.ref}\n type={type}\n variant={variant}\n size={size}\n slotProps={finalSlotProps}\n sx={mergedSx}\n error={!!error || rest.error}\n helperText={error?.message ?? rest.helperText}\n />\n )}\n />\n );\n }\n\n const { value, onChange } = props as ControlledInputProps;\n return (\n <TextField\n fullWidth\n {...rest}\n value={value ?? ''}\n onChange={(e) => onChange(parseValue(e.target.value, type))}\n onBlur={onBlur}\n type={type}\n variant={variant}\n size={size}\n slotProps={finalSlotProps}\n sx={mergedSx}\n />\n );\n};\n\nexport default Input;\n"],"names":["_a"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextFieldProps } from '@mui/material';
|
|
2
|
+
import { LabelPosition } from './Input';
|
|
3
|
+
/**
|
|
4
|
+
* Builder de sx para el Input. Usa el builder compartido
|
|
5
|
+
* `buildFormFieldSx` y añade overrides específicos de TextField
|
|
6
|
+
* (padding del input base, filled, standard).
|
|
7
|
+
*/
|
|
8
|
+
export declare const buildInputSx: (borderRadius: number | string, labelPosition: LabelPosition) => TextFieldProps["sx"];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { Input, default } from './Input';
|
|
2
|
+
export type { InputProps, BaseInputProps, RHFInputProps, ControlledInputProps, InputType, LabelPosition, } from './Input';
|
package/components/Input.d.ts
CHANGED
|
@@ -18,109 +18,123 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
Object.
|
|
21
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
22
|
const jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const React = require("react");
|
|
24
24
|
const material = require("@mui/material");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
25
|
+
const mergeSx = require("../../mergeSx-Dbccoo_H.cjs");
|
|
26
|
+
const tokens = require("../../tokens-jaWWNk39.cjs");
|
|
27
|
+
const InputGroup = ({
|
|
28
|
+
children,
|
|
29
|
+
sx,
|
|
30
|
+
slotSx,
|
|
31
|
+
borderRadius = 10,
|
|
32
|
+
disabled,
|
|
33
|
+
orientation = "horizontal",
|
|
34
|
+
className
|
|
35
|
+
}) => {
|
|
36
|
+
const radius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
37
|
+
const slots = React.Children.toArray(children).filter(React.isValidElement);
|
|
38
|
+
const isHorizontal = orientation === "horizontal";
|
|
39
|
+
const baseSx = {
|
|
40
|
+
// Respeta el label "outside" de Input/Select: los hijos pierden su marginTop
|
|
41
|
+
// (ver más abajo) y el grupo reserva el mismo espacio arriba para que los
|
|
42
|
+
// labels floten por encima del borde del grupo.
|
|
43
|
+
marginTop: tokens.LABEL_MARGIN_TOP,
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: isHorizontal ? "row" : "column",
|
|
46
|
+
alignItems: "stretch",
|
|
47
|
+
width: "100%",
|
|
48
|
+
border: (theme) => `1px solid ${theme.palette.divider}`,
|
|
49
|
+
borderRadius: radius,
|
|
50
|
+
backgroundColor: "background.paper",
|
|
51
|
+
transition: "border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms",
|
|
52
|
+
"&:focus-within": {
|
|
53
|
+
borderColor: "primary.main",
|
|
54
|
+
boxShadow: (theme) => `0 0 0 1px ${theme.palette.primary.main}`
|
|
55
|
+
},
|
|
56
|
+
opacity: disabled ? 0.6 : 1,
|
|
57
|
+
pointerEvents: disabled ? "none" : "auto",
|
|
58
|
+
// Cancelar el marginTop que Input/Select reservan en labelPosition="outside".
|
|
59
|
+
// El grupo ya lo reservó en su nivel externo.
|
|
60
|
+
"& .MuiFormControl-root, & > [data-input-group-slot] > .MuiTextField-root, & > [data-input-group-slot] > .MuiFormControl-root": {
|
|
61
|
+
marginTop: 0
|
|
62
|
+
},
|
|
63
|
+
// Quitar el borde del notched outline interno: el borde visible es el del
|
|
64
|
+
// grupo, los separadores son los borderRight/borderBottom de cada slot.
|
|
65
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
66
|
+
border: "none"
|
|
67
|
+
},
|
|
68
|
+
// Forzar que todos los campos pinten sus esquinas cuadradas (las esquinas
|
|
69
|
+
// redondeadas se aplican solo al primer/último slot más abajo).
|
|
70
|
+
"& .MuiInputBase-root, & .MuiChip-root": {
|
|
71
|
+
borderRadius: 0
|
|
72
|
+
},
|
|
73
|
+
// Botones integrados: sin radius propio, altura completa, sin sombra.
|
|
74
|
+
"& .MuiButton-root": {
|
|
75
|
+
borderRadius: 0,
|
|
76
|
+
height: "100%",
|
|
77
|
+
boxShadow: "none",
|
|
78
|
+
border: "none"
|
|
79
|
+
},
|
|
80
|
+
// Slots: cada hijo vive en un slot neutro que lo centra verticalmente.
|
|
81
|
+
"& > [data-input-group-slot]": __spreadProps(__spreadValues({
|
|
82
|
+
flex: 1,
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
minWidth: 0
|
|
86
|
+
}, isHorizontal ? { borderRight: (theme) => `1px solid ${theme.palette.divider}` } : { borderBottom: (theme) => `1px solid ${theme.palette.divider}` }), {
|
|
87
|
+
"&:last-of-type": {
|
|
88
|
+
borderRight: "none",
|
|
89
|
+
borderBottom: "none"
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
// Esquinas redondeadas: primer slot (izquierda o arriba).
|
|
93
|
+
"& > [data-input-group-slot]:first-of-type .MuiInputBase-root, & > [data-input-group-slot]:first-of-type .MuiButton-root, & > [data-input-group-slot]:first-of-type .MuiChip-root": isHorizontal ? {
|
|
94
|
+
borderTopLeftRadius: radius,
|
|
95
|
+
borderBottomLeftRadius: radius
|
|
96
|
+
} : {
|
|
97
|
+
borderTopLeftRadius: radius,
|
|
98
|
+
borderTopRightRadius: radius
|
|
99
|
+
},
|
|
100
|
+
// Esquinas redondeadas: último slot (derecha o abajo).
|
|
101
|
+
"& > [data-input-group-slot]:last-of-type .MuiInputBase-root, & > [data-input-group-slot]:last-of-type .MuiButton-root, & > [data-input-group-slot]:last-of-type .MuiChip-root": isHorizontal ? {
|
|
102
|
+
borderTopRightRadius: radius,
|
|
103
|
+
borderBottomRightRadius: radius
|
|
104
|
+
} : {
|
|
105
|
+
borderBottomLeftRadius: radius,
|
|
106
|
+
borderBottomRightRadius: radius
|
|
74
107
|
}
|
|
75
|
-
|
|
76
|
-
|
|
108
|
+
};
|
|
109
|
+
const baseSlotSx = {
|
|
110
|
+
flex: 1,
|
|
111
|
+
display: "flex",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
minWidth: 0
|
|
114
|
+
};
|
|
77
115
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
78
116
|
material.Box,
|
|
79
117
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
height: "32px",
|
|
94
|
-
border: "1px solid #ccc",
|
|
95
|
-
borderRadius: "10px",
|
|
96
|
-
padding: "8px 0px",
|
|
97
|
-
marginTop: "-5px",
|
|
98
|
-
marginBottom: "20px",
|
|
99
|
-
"& .MuiInputBase-root, & .MuiButtonBase-root, & .MuiChip-root": {
|
|
100
|
-
borderRadius: 0
|
|
101
|
-
},
|
|
102
|
-
"& > div:first-of-type .MuiInputBase-root, & > div:first-of-type .MuiButtonBase-root, & > div:first-of-type .MuiChip-root": {
|
|
103
|
-
borderTopLeftRadius: "10px",
|
|
104
|
-
borderBottomLeftRadius: "10px"
|
|
105
|
-
},
|
|
106
|
-
"& > div:last-of-type .MuiInputBase-root, & > div:last-of-type .MuiButtonBase-root, & > div:last-of-type .MuiChip-root": {
|
|
107
|
-
borderTopRightRadius: "10px",
|
|
108
|
-
borderBottomRightRadius: "10px",
|
|
109
|
-
border: "none !important"
|
|
110
|
-
},
|
|
111
|
-
// Estilo para los componentes que tienen `InputGroupChild` en la clase
|
|
112
|
-
"& .InputGroupChild": {
|
|
113
|
-
width: "100%"
|
|
114
|
-
},
|
|
115
|
-
"& > div:first-of-type .MuiInputBase-root > .MuiOutlinedInput-notchedOutline": {
|
|
116
|
-
border: "none !important"
|
|
117
|
-
}
|
|
118
|
+
"data-testid": "input-group",
|
|
119
|
+
className,
|
|
120
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
121
|
+
sx: mergeSx.mergeSx(baseSx, sx),
|
|
122
|
+
children: slots.map((child, i) => {
|
|
123
|
+
var _a;
|
|
124
|
+
const slotKey = (_a = child.key) != null ? _a : i;
|
|
125
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
+
material.Box,
|
|
127
|
+
{
|
|
128
|
+
"data-input-group-slot": true,
|
|
129
|
+
sx: mergeSx.mergeSx(baseSlotSx, slotSx),
|
|
130
|
+
children: child
|
|
118
131
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
)
|
|
132
|
+
slotKey
|
|
133
|
+
);
|
|
134
|
+
})
|
|
122
135
|
}
|
|
123
136
|
);
|
|
124
137
|
};
|
|
125
138
|
exports.InputGroup = InputGroup;
|
|
139
|
+
exports.default = InputGroup;
|
|
126
140
|
//# sourceMappingURL=InputGroup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.cjs","sources":["../../../src/components/InputGroup/InputGroup.tsx"],"sourcesContent":["import React, { Children,
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":["../../../src/components/InputGroup/InputGroup.tsx"],"sourcesContent":["import React, { Children, isValidElement } from 'react';\nimport { Box, type SxProps, type Theme } from '@mui/material';\n\nimport { mergeSx } from '../_shared/mergeSx';\nimport { LABEL_MARGIN_TOP } from '../../theme/tokens';\n\nexport interface InputGroupProps {\n children: React.ReactNode;\n /**\n * sx aplicado al contenedor raíz del grupo. Se mergea sobre los defaults.\n */\n sx?: SxProps<Theme>;\n /**\n * sx aplicado a cada slot individual. Útil para controlar flex/gap entre\n * los hijos del grupo.\n */\n slotSx?: SxProps<Theme>;\n /**\n * Radio del borde del grupo. Default: 10.\n */\n borderRadius?: number | string;\n /**\n * Desactiva visualmente el grupo (no cascada lógica — los hijos deben\n * manejar su propio `disabled`).\n */\n disabled?: boolean;\n /**\n * Orientación del grupo. Default: 'horizontal'.\n */\n orientation?: 'horizontal' | 'vertical';\n className?: string;\n}\n\n/**\n * Agrupa visualmente varios componentes de entrada (Input / Select / DatePicker /\n * Button, etc.) compartiendo un solo borde y con separadores internos.\n *\n * El grupo respeta el espacio que Input/Select reservan para su label `outside`\n * (`LABEL_MARGIN_TOP`) moviendo ese reservado al contenedor externo y\n * cancelándolo en los hijos. Los labels siguen flotando por encima del borde\n * del grupo con la misma animación que fuera del grupo.\n *\n * No inspecciona el tipo de cada hijo; aplica los overrides a través de\n * descendant selectors por CSS para funcionar con cualquier wrapper / memoizado.\n */\nexport const InputGroup: React.FC<InputGroupProps> = ({\n children,\n sx,\n slotSx,\n borderRadius = 10,\n disabled,\n orientation = 'horizontal',\n className,\n}) => {\n const radius = typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n const slots = Children.toArray(children).filter(isValidElement);\n const isHorizontal = orientation === 'horizontal';\n\n const baseSx: SxProps<Theme> = {\n // Respeta el label \"outside\" de Input/Select: los hijos pierden su marginTop\n // (ver más abajo) y el grupo reserva el mismo espacio arriba para que los\n // labels floten por encima del borde del grupo.\n marginTop: LABEL_MARGIN_TOP,\n\n display: 'flex',\n flexDirection: isHorizontal ? 'row' : 'column',\n alignItems: 'stretch',\n width: '100%',\n border: (theme) => `1px solid ${theme.palette.divider}`,\n borderRadius: radius,\n backgroundColor: 'background.paper',\n transition:\n 'border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms',\n '&:focus-within': {\n borderColor: 'primary.main',\n boxShadow: (theme) => `0 0 0 1px ${theme.palette.primary.main}`,\n },\n opacity: disabled ? 0.6 : 1,\n pointerEvents: disabled ? 'none' : 'auto',\n\n // Cancelar el marginTop que Input/Select reservan en labelPosition=\"outside\".\n // El grupo ya lo reservó en su nivel externo.\n '& .MuiFormControl-root, & > [data-input-group-slot] > .MuiTextField-root, & > [data-input-group-slot] > .MuiFormControl-root':\n {\n marginTop: 0,\n },\n\n // Quitar el borde del notched outline interno: el borde visible es el del\n // grupo, los separadores son los borderRight/borderBottom de cada slot.\n '& .MuiOutlinedInput-notchedOutline': {\n border: 'none',\n },\n\n // Forzar que todos los campos pinten sus esquinas cuadradas (las esquinas\n // redondeadas se aplican solo al primer/último slot más abajo).\n '& .MuiInputBase-root, & .MuiChip-root': {\n borderRadius: 0,\n },\n\n // Botones integrados: sin radius propio, altura completa, sin sombra.\n '& .MuiButton-root': {\n borderRadius: 0,\n height: '100%',\n boxShadow: 'none',\n border: 'none',\n },\n\n // Slots: cada hijo vive en un slot neutro que lo centra verticalmente.\n '& > [data-input-group-slot]': {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n minWidth: 0,\n // Separador entre slots (horizontal: borderRight / vertical: borderBottom),\n // usando el color de divider del theme.\n ...(isHorizontal\n ? { borderRight: (theme: Theme) => `1px solid ${theme.palette.divider}` }\n : { borderBottom: (theme: Theme) => `1px solid ${theme.palette.divider}` }),\n '&:last-of-type': {\n borderRight: 'none',\n borderBottom: 'none',\n },\n },\n\n // Esquinas redondeadas: primer slot (izquierda o arriba).\n '& > [data-input-group-slot]:first-of-type .MuiInputBase-root, & > [data-input-group-slot]:first-of-type .MuiButton-root, & > [data-input-group-slot]:first-of-type .MuiChip-root':\n isHorizontal\n ? {\n borderTopLeftRadius: radius,\n borderBottomLeftRadius: radius,\n }\n : {\n borderTopLeftRadius: radius,\n borderTopRightRadius: radius,\n },\n\n // Esquinas redondeadas: último slot (derecha o abajo).\n '& > [data-input-group-slot]:last-of-type .MuiInputBase-root, & > [data-input-group-slot]:last-of-type .MuiButton-root, & > [data-input-group-slot]:last-of-type .MuiChip-root':\n isHorizontal\n ? {\n borderTopRightRadius: radius,\n borderBottomRightRadius: radius,\n }\n : {\n borderBottomLeftRadius: radius,\n borderBottomRightRadius: radius,\n },\n };\n\n const baseSlotSx: SxProps<Theme> = {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n minWidth: 0,\n };\n\n return (\n <Box\n data-testid=\"input-group\"\n className={className}\n aria-disabled={disabled ? 'true' : undefined}\n sx={mergeSx(baseSx, sx)}\n >\n {slots.map((child, i) => {\n const slotKey = (child as React.ReactElement).key ?? i;\n return (\n <Box\n key={slotKey}\n data-input-group-slot\n sx={mergeSx(baseSlotSx, slotSx)}\n >\n {child}\n </Box>\n );\n })}\n </Box>\n );\n};\n\nexport default InputGroup;\n"],"names":["Children","isValidElement","LABEL_MARGIN_TOP","jsx","Box","mergeSx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CO,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,cAAc;AAAA,EACd;AACF,MAAM;AACJ,QAAM,SAAS,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AACxE,QAAM,QAAQA,MAAAA,SAAS,QAAQ,QAAQ,EAAE,OAAOC,oBAAc;AAC9D,QAAM,eAAe,gBAAgB;AAErC,QAAM,SAAyB;AAAA;AAAA;AAAA;AAAA,IAI7B,WAAWC,OAAAA;AAAAA,IAEX,SAAS;AAAA,IACT,eAAe,eAAe,QAAQ;AAAA,IACtC,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ,CAAC,UAAU,aAAa,MAAM,QAAQ,OAAO;AAAA,IACrD,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,YACE;AAAA,IACF,kBAAkB;AAAA,MAChB,aAAa;AAAA,MACb,WAAW,CAAC,UAAU,aAAa,MAAM,QAAQ,QAAQ,IAAI;AAAA,IAAA;AAAA,IAE/D,SAAS,WAAW,MAAM;AAAA,IAC1B,eAAe,WAAW,SAAS;AAAA;AAAA;AAAA,IAInC,gIACE;AAAA,MACE,WAAW;AAAA,IAAA;AAAA;AAAA;AAAA,IAKf,sCAAsC;AAAA,MACpC,QAAQ;AAAA,IAAA;AAAA;AAAA;AAAA,IAKV,yCAAyC;AAAA,MACvC,cAAc;AAAA,IAAA;AAAA;AAAA,IAIhB,qBAAqB;AAAA,MACnB,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,QAAQ;AAAA,IAAA;AAAA;AAAA,IAIV,+BAA+B;AAAA,MAC7B,MAAM;AAAA,MACN,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,UAAU;AAAA,OAGN,eACA,EAAE,aAAa,CAAC,UAAiB,aAAa,MAAM,QAAQ,OAAO,OACnE,EAAE,cAAc,CAAC,UAAiB,aAAa,MAAM,QAAQ,OAAO,GAAA,IAT3C;AAAA,MAU7B,kBAAkB;AAAA,QAChB,aAAa;AAAA,QACb,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA;AAAA,IAIF,oLACE,eACI;AAAA,MACE,qBAAqB;AAAA,MACrB,wBAAwB;AAAA,IAAA,IAE1B;AAAA,MACE,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,IAAA;AAAA;AAAA,IAI9B,iLACE,eACI;AAAA,MACE,sBAAsB;AAAA,MACtB,yBAAyB;AAAA,IAAA,IAE3B;AAAA,MACE,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAGR,QAAM,aAA6B;AAAA,IACjC,MAAM;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,UAAU;AAAA,EAAA;AAGZ,SACEC,2BAAAA;AAAAA,IAACC,SAAAA;AAAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ;AAAA,MACA,iBAAe,WAAW,SAAS;AAAA,MACnC,IAAIC,QAAAA,QAAQ,QAAQ,EAAE;AAAA,MAErB,UAAA,MAAM,IAAI,CAAC,OAAO,MAAM;;AACvB,cAAM,WAAW,WAA6B,QAA7B,YAAoC;AACrD,eACEF,2BAAAA;AAAAA,UAACC,SAAAA;AAAAA,UAAA;AAAA,YAEC,yBAAqB;AAAA,YACrB,IAAIC,QAAAA,QAAQ,YAAY,MAAM;AAAA,YAE7B,UAAA;AAAA,UAAA;AAAA,UAJI;AAAA,QAAA;AAAA,MAOX,CAAC;AAAA,IAAA;AAAA,EAAA;AAGP;;;"}
|
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface InputGroupProps {
|
|
3
4
|
children: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* sx aplicado al contenedor raíz del grupo. Se mergea sobre los defaults.
|
|
7
|
+
*/
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
/**
|
|
10
|
+
* sx aplicado a cada slot individual. Útil para controlar flex/gap entre
|
|
11
|
+
* los hijos del grupo.
|
|
12
|
+
*/
|
|
13
|
+
slotSx?: SxProps<Theme>;
|
|
14
|
+
/**
|
|
15
|
+
* Radio del borde del grupo. Default: 10.
|
|
16
|
+
*/
|
|
17
|
+
borderRadius?: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* Desactiva visualmente el grupo (no cascada lógica — los hijos deben
|
|
20
|
+
* manejar su propio `disabled`).
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Orientación del grupo. Default: 'horizontal'.
|
|
25
|
+
*/
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
className?: string;
|
|
4
28
|
}
|
|
5
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Agrupa visualmente varios componentes de entrada (Input / Select / DatePicker /
|
|
31
|
+
* Button, etc.) compartiendo un solo borde y con separadores internos.
|
|
32
|
+
*
|
|
33
|
+
* El grupo respeta el espacio que Input/Select reservan para su label `outside`
|
|
34
|
+
* (`LABEL_MARGIN_TOP`) moviendo ese reservado al contenedor externo y
|
|
35
|
+
* cancelándolo en los hijos. Los labels siguen flotando por encima del borde
|
|
36
|
+
* del grupo con la misma animación que fuera del grupo.
|
|
37
|
+
*
|
|
38
|
+
* No inspecciona el tipo de cada hijo; aplica los overrides a través de
|
|
39
|
+
* descendant selectors por CSS para funcionar con cualquier wrapper / memoizado.
|
|
40
|
+
*/
|
|
41
|
+
export declare const InputGroup: React.FC<InputGroupProps>;
|
|
6
42
|
export default InputGroup;
|