@soyfri/shared-library 2.0.0-beta.13 → 2.0.0-beta.16
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/{Autocomplete-C2x-lBvZ.cjs → Autocomplete-4i0dNDKr.cjs} +55 -33
- package/Autocomplete-4i0dNDKr.cjs.map +1 -0
- package/{Autocomplete-BA-cGASd.js → Autocomplete-i3-V38n1.js} +56 -34
- package/Autocomplete-i3-V38n1.js.map +1 -0
- package/{Avatar-BJTr-PBd.js → Avatar-CgT7955R.js} +18 -19
- package/Avatar-CgT7955R.js.map +1 -0
- package/{Avatar-9L7YMxya.cjs → Avatar-CuSrK8Wn.cjs} +18 -19
- package/Avatar-CuSrK8Wn.cjs.map +1 -0
- package/Button-C17mExpd.cjs.map +1 -1
- package/Button-UkkP-bNw.js.map +1 -1
- package/Card-B1wtavyl.js +98 -0
- package/Card-B1wtavyl.js.map +1 -0
- package/Card-DfdU610V.cjs +97 -0
- package/Card-DfdU610V.cjs.map +1 -0
- package/Checkbox-BCqMFWt4.cjs +187 -0
- package/Checkbox-BCqMFWt4.cjs.map +1 -0
- package/Checkbox-gB5YKkVo.js +188 -0
- package/Checkbox-gB5YKkVo.js.map +1 -0
- package/{DatePicker-DLSfkgGA.cjs → DatePicker-CtCFqXDw.cjs} +41 -64
- package/DatePicker-CtCFqXDw.cjs.map +1 -0
- package/{DatePicker-8f_9bwhS.js → DatePicker-D0Bz9Ryg.js} +37 -60
- package/DatePicker-D0Bz9Ryg.js.map +1 -0
- package/{DateTimePicker-D4L9GAod.js → DateTimePicker-77w-9TP5.js} +27 -17
- package/DateTimePicker-77w-9TP5.js.map +1 -0
- package/{DateTimePicker-CWNW09-O.cjs → DateTimePicker-CTnRQCZo.cjs} +31 -21
- package/DateTimePicker-CTnRQCZo.cjs.map +1 -0
- package/{Input-DI0jfq5X.cjs → Input-jYapjJYM.cjs} +27 -14
- package/Input-jYapjJYM.cjs.map +1 -0
- package/{Input-Cp911l23.js → Input-rVVhI_wk.js} +24 -11
- package/Input-rVVhI_wk.js.map +1 -0
- package/{Modal-Bm_HH9cv.cjs → Modal-BN5s-Tfk.cjs} +126 -98
- package/Modal-BN5s-Tfk.cjs.map +1 -0
- package/{Modal-Bnz6d9m9.js → Modal-BRZMPwDj.js} +134 -106
- package/Modal-BRZMPwDj.js.map +1 -0
- package/{RadioGroup-CxqDHap1.cjs → RadioGroup-Dd0rHXSX.cjs} +10 -8
- package/RadioGroup-Dd0rHXSX.cjs.map +1 -0
- package/{RadioGroup-DMi9FvMP.js → RadioGroup-bO-ahP9T.js} +10 -8
- package/RadioGroup-bO-ahP9T.js.map +1 -0
- package/Select-B6jE3WH_.cjs +253 -0
- package/Select-B6jE3WH_.cjs.map +1 -0
- package/Select-bSVQokFX.js +254 -0
- package/Select-bSVQokFX.js.map +1 -0
- package/StatusMessage-B3nXpuRl.cjs +88 -0
- package/StatusMessage-B3nXpuRl.cjs.map +1 -0
- package/StatusMessage-D0WgSBx7.js +89 -0
- package/StatusMessage-D0WgSBx7.js.map +1 -0
- package/Step-BArsou1V.js +301 -0
- package/Step-BArsou1V.js.map +1 -0
- package/Step-Nd7SJbRZ.cjs +300 -0
- package/Step-Nd7SJbRZ.cjs.map +1 -0
- package/{Switch-BIeobv6i.cjs → Switch-CQFOopYy.cjs} +6 -3
- package/Switch-CQFOopYy.cjs.map +1 -0
- package/{Switch-DQEOxM2R.js → Switch-D72dpkH2.js} +6 -3
- package/Switch-D72dpkH2.js.map +1 -0
- package/{Tab-Co31KY2k.cjs → Tab-BbP8jBcK.cjs} +43 -28
- package/Tab-BbP8jBcK.cjs.map +1 -0
- package/Tab-BxSxKJsP.js +111 -0
- package/Tab-BxSxKJsP.js.map +1 -0
- package/components/ActionMenu/ActionMenu.cjs +52 -52
- package/components/ActionMenu/ActionMenu.cjs.map +1 -1
- package/components/ActionMenu/ActionMenu.d.ts +20 -36
- package/components/ActionMenu/ActionMenu.js +55 -55
- package/components/ActionMenu/ActionMenu.js.map +1 -1
- package/components/ActionMenu/index.d.ts +2 -2
- package/components/AppBar/AppBar.cjs +2 -219
- package/components/AppBar/AppBar.cjs.map +1 -1
- package/components/AppBar/AppBar.d.ts +6 -6
- package/components/AppBar/AppBar.js +5 -222
- package/components/AppBar/AppBar.js.map +1 -1
- package/components/AppBar/index.d.ts +0 -6
- package/components/Autocomplete/Autocomplete.cjs +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +8 -6
- package/components/Autocomplete/Autocomplete.helpers.d.ts +8 -4
- package/components/Autocomplete/Autocomplete.js +1 -1
- package/components/Autocomplete/_parts/AutocompleteOption.d.ts +5 -8
- package/components/Autocomplete/index.d.ts +1 -1
- package/components/Avatar/Avatar.cjs +1 -1
- package/components/Avatar/Avatar.js +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 +1 -4
- package/components/Card/Card.cjs.map +1 -1
- package/components/Card/Card.d.ts +3 -50
- package/components/Card/Card.js +1 -4
- package/components/Card/Card.sx.d.ts +3 -6
- package/components/Card/index.d.ts +1 -1
- package/components/Checkbox/Checkbox.cjs +6 -0
- package/components/Checkbox/Checkbox.cjs.map +1 -0
- package/components/Checkbox/Checkbox.d.ts +55 -0
- package/components/Checkbox/Checkbox.js +6 -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 +3 -2
- package/components/Chip/index.d.ts +2 -1
- package/components/Chip.d.ts +4 -0
- package/components/DatePicker/DatePicker.cjs +1 -1
- package/components/DatePicker/DatePicker.d.ts +1 -13
- package/components/DatePicker/DatePicker.js +1 -1
- package/components/DatePicker/index.d.ts +1 -1
- package/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/components/DateTimePicker/DateTimePicker.d.ts +10 -6
- package/components/DateTimePicker/DateTimePicker.definitions.d.ts +2 -0
- package/components/DateTimePicker/DateTimePicker.helpers.d.ts +4 -2
- package/components/DateTimePicker/DateTimePicker.js +1 -1
- package/components/DateTimePicker/index.d.ts +1 -1
- package/components/Drawer/Drawer.cjs +10 -6
- package/components/Drawer/Drawer.cjs.map +1 -1
- package/components/Drawer/Drawer.js +11 -7
- package/components/Drawer/Drawer.js.map +1 -1
- package/components/Drawer/DrawerItem.d.ts +6 -1
- 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 +6 -8
- package/components/Icon/Icon.cjs.map +1 -1
- package/components/Icon/Icon.d.ts +11 -17
- package/components/Icon/Icon.js +6 -8
- 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 +1 -1
- package/components/Input/Input.d.ts +9 -2
- package/components/Input/Input.helpers.d.ts +3 -3
- package/components/Input/Input.js +1 -1
- package/components/Input/index.d.ts +1 -1
- package/components/InputGroup/InputGroup.cjs +23 -22
- package/components/InputGroup/InputGroup.cjs.map +1 -1
- package/components/InputGroup/InputGroup.d.ts +4 -4
- package/components/InputGroup/InputGroup.js +22 -21
- 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 +1 -1
- package/components/Modal/Modal.d.ts +20 -5
- package/components/Modal/Modal.js +6 -6
- package/components/Modal/ModalBody.d.ts +6 -1
- package/components/Modal/ModalFooter.d.ts +4 -4
- package/components/Modal/ModalHeader.d.ts +6 -1
- package/components/Modal/index.d.ts +2 -0
- package/components/RadioGroup/RadioGroup.cjs +1 -1
- package/components/RadioGroup/RadioGroup.d.ts +9 -3
- package/components/RadioGroup/RadioGroup.js +1 -1
- package/components/RadioGroup/index.d.ts +1 -1
- package/components/Select/Select.cjs +1 -1
- package/components/Select/Select.d.ts +13 -18
- package/components/Select/Select.helpers.d.ts +5 -19
- package/components/Select/Select.js +1 -1
- package/components/Select/index.d.ts +1 -1
- package/components/Stat/Stat.cjs +2 -2
- package/components/Stat/Stat.js +3 -3
- 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 +1 -1
- package/components/StatusMessage/StatusMessage.d.ts +20 -36
- package/components/StatusMessage/StatusMessage.js +1 -1
- package/components/Stepper/Stepper.cjs +6 -2
- package/components/Stepper/Stepper.cjs.map +1 -1
- package/components/Stepper/Stepper.d.ts +9 -8
- package/components/Stepper/Stepper.js +6 -2
- package/{hooks/Wizard/WizardContext.d.ts → components/Stepper/StepperContext.d.ts} +28 -22
- 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 +1 -1
- package/components/Switch/Switch.d.ts +7 -2
- package/components/Switch/Switch.js +1 -1
- package/components/Tabs/Tabs.cjs +3 -2
- package/components/Tabs/Tabs.cjs.map +1 -1
- package/components/Tabs/Tabs.d.ts +21 -16
- package/components/Tabs/Tabs.js +3 -2
- package/components/Tabs/index.d.ts +4 -2
- package/components/Tabs.d.ts +4 -0
- package/components/Timeline/Timeline.cjs +3 -3
- package/components/Timeline/Timeline.cjs.map +1 -1
- package/components/Timeline/Timeline.d.ts +4 -8
- package/components/Timeline/Timeline.js +2 -2
- package/components/Timeline/Timeline.js.map +1 -1
- package/components/Timeline/index.d.ts +4 -3
- package/components/Timeline.d.ts +4 -0
- package/components/_shared/mergeSx.d.ts +7 -0
- package/{formField.sx-DfVbMe0V.js → formField.sx-8_QRnKxv.js} +2 -11
- package/formField.sx-8_QRnKxv.js.map +1 -0
- package/{formField.sx-CQ1mbk9M.cjs → formField.sx-BAX7KwMR.cjs} +10 -19
- package/formField.sx-BAX7KwMR.cjs.map +1 -0
- package/index.cjs +38 -15
- package/index.cjs.map +1 -1
- package/index.d.ts +3 -0
- package/index.js +33 -19
- 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 +2 -1
- package/package.json +28 -42
- package/theme/componentStyles.d.ts +1 -1
- 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/{components/ScrollTopButton → utils}/scrollToTop.d.ts +6 -7
- package/Autocomplete-BA-cGASd.js.map +0 -1
- package/Autocomplete-C2x-lBvZ.cjs.map +0 -1
- package/Avatar-9L7YMxya.cjs.map +0 -1
- package/Avatar-BJTr-PBd.js.map +0 -1
- package/Card-DG_crfkK.cjs +0 -185
- package/Card-DG_crfkK.cjs.map +0 -1
- package/Card-Ug-ttVSh.js +0 -186
- package/Card-Ug-ttVSh.js.map +0 -1
- package/DatePicker-8f_9bwhS.js.map +0 -1
- package/DatePicker-DLSfkgGA.cjs.map +0 -1
- package/DateTimePicker-CWNW09-O.cjs.map +0 -1
- package/DateTimePicker-D4L9GAod.js.map +0 -1
- package/Input-Cp911l23.js.map +0 -1
- package/Input-DI0jfq5X.cjs.map +0 -1
- package/Modal-Bm_HH9cv.cjs.map +0 -1
- package/Modal-Bnz6d9m9.js.map +0 -1
- package/RadioGroup-CxqDHap1.cjs.map +0 -1
- package/RadioGroup-DMi9FvMP.js.map +0 -1
- package/Select-3CBOfM2H.js +0 -447
- package/Select-3CBOfM2H.js.map +0 -1
- package/Select-Bku4f4f8.cjs +0 -446
- package/Select-Bku4f4f8.cjs.map +0 -1
- package/StatusMessage-C5B6oGZ_.cjs +0 -78
- package/StatusMessage-C5B6oGZ_.cjs.map +0 -1
- package/StatusMessage-D1GlfQdz.js +0 -79
- package/StatusMessage-D1GlfQdz.js.map +0 -1
- package/Step-Dq0N72YB.js +0 -49
- package/Step-Dq0N72YB.js.map +0 -1
- package/Step-a8U8O-91.cjs +0 -48
- package/Step-a8U8O-91.cjs.map +0 -1
- package/Switch-BIeobv6i.cjs.map +0 -1
- package/Switch-DQEOxM2R.js.map +0 -1
- package/Tab-Co31KY2k.cjs.map +0 -1
- package/Tab-DiK62gRz.js +0 -96
- package/Tab-DiK62gRz.js.map +0 -1
- package/components/AppBar/AppBarBrand.d.ts +0 -31
- package/components/AppBar/AppBarUserMenu.d.ts +0 -65
- package/components/Autocomplete/Autocomplete.types.d.ts +0 -1
- package/components/DatePicker/DatePicker.types.d.ts +0 -1
- package/components/DateTimePicker/DateTimePicker.types.d.ts +0 -1
- package/components/Input/Input.types.d.ts +0 -1
- package/components/PageLoader/PageLoader.cjs +0 -61
- package/components/PageLoader/PageLoader.cjs.map +0 -1
- package/components/PageLoader/PageLoader.d.ts +0 -38
- package/components/PageLoader/PageLoader.js +0 -61
- package/components/PageLoader/PageLoader.js.map +0 -1
- package/components/PageLoader/index.d.ts +0 -2
- package/components/PageLoader.d.ts +0 -6
- package/components/RadioGroup/RadioGroup.types.d.ts +0 -1
- package/components/ScrollTopButton/ScrollTopButton.cjs +0 -79
- package/components/ScrollTopButton/ScrollTopButton.cjs.map +0 -1
- package/components/ScrollTopButton/ScrollTopButton.d.ts +0 -48
- package/components/ScrollTopButton/ScrollTopButton.js +0 -79
- package/components/ScrollTopButton/ScrollTopButton.js.map +0 -1
- package/components/ScrollTopButton/index.d.ts +0 -4
- package/components/ScrollTopButton.d.ts +0 -6
- package/components/Select/Select.definitions.d.ts +0 -17
- package/components/Select/Select.types.d.ts +0 -1
- package/components/Select/_parts/SelectSearchHeader.d.ts +0 -15
- package/formField.sx-CQ1mbk9M.cjs.map +0 -1
- package/formField.sx-DfVbMe0V.js.map +0 -1
- package/hooks/Wizard/Wizard.cjs +0 -7
- package/hooks/Wizard/Wizard.cjs.map +0 -1
- package/hooks/Wizard/Wizard.js +0 -7
- package/hooks/Wizard/Wizard.js.map +0 -1
- package/hooks/Wizard/index.d.ts +0 -3
- package/hooks/Wizard/useWizard.d.ts +0 -9
- package/hooks/Wizard.d.ts +0 -2
- package/useWizard-CWdIxZzX.cjs +0 -94
- package/useWizard-CWdIxZzX.cjs.map +0 -1
- package/useWizard-CWq--C3o.js +0 -95
- package/useWizard-CWq--C3o.js.map +0 -1
- /package/{styles.css → index.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SwitchProps as MuiSwitchProps, SxProps, Theme } from '@mui/material';
|
|
2
|
-
import {
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
3
|
export type SwitchSize = 'small' | 'medium';
|
|
4
4
|
export type SwitchLabelPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
5
5
|
export interface BaseSwitchProps extends Omit<MuiSwitchProps, 'value' | 'onChange' | 'checked' | 'defaultChecked' | 'size'> {
|
|
@@ -26,8 +26,13 @@ export interface BaseSwitchProps extends Omit<MuiSwitchProps, 'value' | 'onChang
|
|
|
26
26
|
}
|
|
27
27
|
export interface RHFSwitchProps extends BaseSwitchProps {
|
|
28
28
|
name: string;
|
|
29
|
-
control:
|
|
29
|
+
control: any;
|
|
30
30
|
validation?: RegisterOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Side-effect que corre después de que RHF actualiza el form state.
|
|
33
|
+
* Útil para cascadas entre campos. NO reemplaza al handler de RHF.
|
|
34
|
+
*/
|
|
35
|
+
onValueChange?: (checked: boolean) => void;
|
|
31
36
|
checked?: never;
|
|
32
37
|
onChange?: never;
|
|
33
38
|
}
|
package/components/Tabs/Tabs.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
const Tab = require("../../Tab-
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const Tab = require("../../Tab-BbP8jBcK.cjs");
|
|
4
4
|
exports.Tab = Tab.Tab;
|
|
5
5
|
exports.Tabs = Tab.Tabs;
|
|
6
|
+
exports.default = Tab.Tabs;
|
|
6
7
|
//# sourceMappingURL=Tabs.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { TabsProps as MuiTabsProps } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
children:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
type PickTabsProps = Pick<MuiTabsProps, 'centered' | 'indicatorColor' | 'orientation' | 'scrollButtons' | 'variant' | 'className' | 'sx' | 'visibleScrollbar' | 'allowScrollButtonsMobile'>;
|
|
4
|
+
export interface TabsProps extends PickTabsProps {
|
|
5
|
+
/** Uno o varios `<Tab>`. Children que no sean `<Tab>` se ignoran. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Valor del tab inicialmente activo. Si no se provee, toma el `value` del primer `<Tab>` o `0`. */
|
|
8
|
+
defaultValue?: number | string;
|
|
9
|
+
/** Callback al cambiar de tab. Recibe el `value` del tab nuevo. */
|
|
10
|
+
onChangeValue?: (newValue: number | string) => void;
|
|
11
|
+
labelColor?: 'primary' | 'secondary' | 'inherit';
|
|
12
|
+
/**
|
|
13
|
+
* Cómo se manejan los paneles al cambiar de tab:
|
|
14
|
+
* - `false` (default): **unmount** — solo se renderiza el panel activo; los
|
|
15
|
+
* demás se desmontan. El state interno de los hijos se pierde al navegar.
|
|
16
|
+
* Menor uso de memoria.
|
|
17
|
+
* - `true`: **keep mounted** — renderiza todos los paneles pero oculta los
|
|
18
|
+
* no activos con `display: none`. El state se preserva (inputs, scroll,
|
|
19
|
+
* timers, subscripciones) al navegar entre tabs.
|
|
20
|
+
*/
|
|
21
|
+
keepMounted?: boolean;
|
|
17
22
|
}
|
|
18
|
-
export declare const Tabs:
|
|
23
|
+
export declare const Tabs: FC<TabsProps>;
|
|
19
24
|
export default Tabs;
|
package/components/Tabs/Tabs.js
CHANGED
package/components/Tabs.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
}
|
|
16
16
|
return a;
|
|
17
17
|
};
|
|
18
|
-
Object.
|
|
18
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
19
19
|
const jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
const React = require("react");
|
|
21
21
|
const MuiTimeline = require("@mui/lab/Timeline");
|
|
@@ -59,7 +59,7 @@ const Timeline = ({ children, position = "right", sx }) => {
|
|
|
59
59
|
(child, idx) => {
|
|
60
60
|
var _a;
|
|
61
61
|
return React__namespace.isValidElement(child) ? React__namespace.cloneElement(child, {
|
|
62
|
-
connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "
|
|
62
|
+
connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "grey" : void 0
|
|
63
63
|
}) : null;
|
|
64
64
|
}
|
|
65
65
|
)
|
|
@@ -82,5 +82,5 @@ const TimelineItem = ({
|
|
|
82
82
|
};
|
|
83
83
|
exports.Timeline = Timeline;
|
|
84
84
|
exports.TimelineItem = TimelineItem;
|
|
85
|
-
exports.
|
|
85
|
+
exports.default = Timeline;
|
|
86
86
|
//# sourceMappingURL=Timeline.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.cjs","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"file":"Timeline.cjs","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport MuiTimeline from '@mui/lab/Timeline';\nimport { timelineItemClasses } from '@mui/lab/TimelineItem';\n\nimport type { TimelineItemProps } from './TimelineItem';\n\nexport interface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'grey'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":["React","timelineItemClasses","jsx","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQA,iBAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAMC,gBAAAA,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,2BAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpCF,kCAAM,eAAe,KAAK,IACtBA,iBAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,SAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;AC5BO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,yCACG,iBAAA,EACC,UAAA;AAAA,IAAAG,gCAAC,sBAAA,EACC,UAAA;AAAA,MAAAD,2BAAAA,IAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAaA,2BAAAA,IAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACAA,+BAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;;;;"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { TimelineItemProps
|
|
2
|
-
import * as React from
|
|
3
|
-
interface
|
|
4
|
-
connectorColor?: string;
|
|
5
|
-
sx?: object;
|
|
6
|
-
}
|
|
7
|
-
interface TimelineProps {
|
|
1
|
+
import { TimelineItemProps } from './TimelineItem';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TimelineProps {
|
|
8
4
|
children: React.ReactElement<TimelineItemProps>[];
|
|
9
|
-
position?:
|
|
5
|
+
position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';
|
|
10
6
|
sx?: object;
|
|
11
7
|
}
|
|
12
8
|
export declare const Timeline: React.FC<TimelineProps>;
|
|
@@ -40,7 +40,7 @@ const Timeline = ({ children, position = "right", sx }) => {
|
|
|
40
40
|
(child, idx) => {
|
|
41
41
|
var _a;
|
|
42
42
|
return React.isValidElement(child) ? React.cloneElement(child, {
|
|
43
|
-
connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "
|
|
43
|
+
connectorColor: idx < count - 1 ? (_a = child.props.connectorColor) != null ? _a : "grey" : void 0
|
|
44
44
|
}) : null;
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -64,6 +64,6 @@ const TimelineItem = ({
|
|
|
64
64
|
export {
|
|
65
65
|
Timeline,
|
|
66
66
|
TimelineItem,
|
|
67
|
-
|
|
67
|
+
Timeline as default
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=Timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"file":"Timeline.js","sources":["../../../src/components/Timeline/Timeline.tsx","../../../src/components/Timeline/TimelineItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport MuiTimeline from '@mui/lab/Timeline';\nimport { timelineItemClasses } from '@mui/lab/TimelineItem';\n\nimport type { TimelineItemProps } from './TimelineItem';\n\nexport interface TimelineProps {\n children: React.ReactElement<TimelineItemProps>[];\n position?: 'left' | 'right' | 'alternate' | 'alternate-reverse';\n sx?: object;\n}\n\nexport const Timeline: React.FC<TimelineProps> = ({ children, position = \"right\", sx }) => {\n const count = React.Children.count(children);\n\n const customSx = (position === \"left\" || position === \"right\")\n ? {\n [`& .${timelineItemClasses.root}:before`]: {\n flex: 0,\n padding: 0,\n },\n ...sx,\n }\n : sx;\n \n return (\n <MuiTimeline position={position}\n sx={{...customSx}}\n >\n {React.Children.map(children, (child, idx) =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n connectorColor: idx < count - 1\n ? child.props.connectorColor ?? 'grey'\n : undefined,\n })\n : null\n )}\n </MuiTimeline>\n\n );\n};\n\nexport default Timeline;","\nimport MuiTimelineItem from \"@mui/lab/TimelineItem\";\nimport MuiTimelineSeparator from \"@mui/lab/TimelineSeparator\";\nimport MuiTimelineConnector from \"@mui/lab/TimelineConnector\";\nimport MuiTimelineContent from \"@mui/lab/TimelineContent\";\nimport MuiTimelineDot from \"@mui/lab/TimelineDot\";\n\nexport interface TimelineItemProps {\n dotColor?: 'primary' | 'secondary' | 'grey' | 'inherit' | 'success' | 'error' | 'info' | 'warning';\n connectorColor?: 'success' | 'error' | 'info' | 'warning' | 'primary' | 'secondary' | 'grey';\n children: React.ReactNode;\n}\n\nexport const TimelineItem: React.FC<TimelineItemProps> = ({\n dotColor = 'grey',\n connectorColor,\n children\n}) => {\n const color = connectorColor ? `${connectorColor}.main` : 'secondary.main';\n return (\n <MuiTimelineItem>\n <MuiTimelineSeparator>\n <MuiTimelineDot color={dotColor} />\n {connectorColor !== undefined && <MuiTimelineConnector sx={{ bgcolor: color }} />}\n </MuiTimelineSeparator>\n <MuiTimelineContent>{children}</MuiTimelineContent>\n </MuiTimelineItem>\n );\n};\n\nexport default TimelineItem"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,WAAoC,CAAC,EAAE,UAAU,WAAW,SAAS,SAAS;AACzF,QAAM,QAAQ,MAAM,SAAS,MAAM,QAAQ;AAEzC,QAAM,WAAY,aAAa,UAAU,aAAa,UACpD;AAAA,IACE,CAAC,MAAM,oBAAoB,IAAI,SAAS,GAAG;AAAA,MACzC,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,KAER,MAEL;AAEJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MAAY;AAAA,MACX,IAAI,mBAAI;AAAA,MAEP,gBAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAAO,QAAA;;AACpC,uBAAM,eAAe,KAAK,IACtB,MAAM,aAAa,OAAO;AAAA,YAC1B,gBAAgB,MAAM,QAAQ,KAC1B,WAAM,MAAM,mBAAZ,YAA8B,SAC9B;AAAA,UAAA,CACL,IACC;AAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIN;AC5BO,MAAM,eAA4C,CAAC;AAAA,EACxD,WAAW;AAAA,EACX;AAAA,EACA;AACF,MAAM;AACJ,QAAM,QAAQ,iBAAiB,GAAG,cAAc,UAAU;AAC1D,8BACG,iBAAA,EACC,UAAA;AAAA,IAAA,qBAAC,sBAAA,EACC,UAAA;AAAA,MAAA,oBAAC,gBAAA,EAAe,OAAO,SAAA,CAAU;AAAA,MAChC,mBAAmB,UAAa,oBAAC,sBAAA,EAAqB,IAAI,EAAE,SAAS,QAAM,CAAG;AAAA,IAAA,GACjF;AAAA,IACA,oBAAC,sBAAoB,SAAA,CAAS;AAAA,EAAA,GAChC;AAEJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { default
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { Timeline, default } from './Timeline';
|
|
2
|
+
export type { TimelineProps } from './Timeline';
|
|
3
|
+
export { TimelineItem } from './TimelineItem';
|
|
4
|
+
export type { TimelineItemProps } from './TimelineItem';
|
package/components/Timeline.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
/**
|
|
3
|
+
* Merge helper para props `sx` de MUI. Acepta formatos objeto o array y
|
|
4
|
+
* devuelve un array combinado. El `extra` se aplica después del `base` —
|
|
5
|
+
* el consumer puede pisar los defaults del componente.
|
|
6
|
+
*/
|
|
7
|
+
export declare const mergeSx: (base: SxProps<Theme>, extra?: SxProps<Theme>) => SxProps<Theme>;
|
|
@@ -14,15 +14,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
const FIELD_INPUT_PADDING_Y = "8.5px";
|
|
19
|
-
const LABEL_SHRINK_TRANSFORM = "translate(4px, -22px) scale(0.85)";
|
|
20
|
-
const LABEL_TRANSFORM_ORIGIN = "top left";
|
|
21
|
-
const LABEL_TRANSITION = "color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms";
|
|
22
|
-
const LABEL_COLOR_REST = "text.secondary";
|
|
23
|
-
const LABEL_COLOR_FILLED = "text.primary";
|
|
24
|
-
const LABEL_COLOR_FOCUSED = "primary.main";
|
|
25
|
-
const LABEL_FONT_WEIGHT_FILLED = 500;
|
|
17
|
+
import { a as LABEL_COLOR_FOCUSED, b as LABEL_FONT_WEIGHT_FILLED, c as LABEL_COLOR_FILLED, d as LABEL_TRANSFORM_ORIGIN, e as LABEL_SHRINK_TRANSFORM, f as LABEL_TRANSITION, g as LABEL_COLOR_REST, L as LABEL_MARGIN_TOP } from "./tokens-BRrcP_p_.js";
|
|
26
18
|
const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
27
19
|
const buildFormFieldSx = ({
|
|
28
20
|
borderRadius,
|
|
@@ -71,7 +63,6 @@ const buildFormFieldSx = ({
|
|
|
71
63
|
}, extraOutsideSx != null ? extraOutsideSx : {});
|
|
72
64
|
};
|
|
73
65
|
export {
|
|
74
|
-
FIELD_INPUT_PADDING_Y as F,
|
|
75
66
|
buildFormFieldSx as b
|
|
76
67
|
};
|
|
77
|
-
//# sourceMappingURL=formField.sx-
|
|
68
|
+
//# sourceMappingURL=formField.sx-8_QRnKxv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formField.sx-8_QRnKxv.js","sources":["../src/components/_shared/formField.sx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport {\n LABEL_COLOR_FILLED,\n LABEL_COLOR_FOCUSED,\n LABEL_COLOR_REST,\n LABEL_FONT_WEIGHT_FILLED,\n LABEL_MARGIN_TOP,\n LABEL_SHRINK_TRANSFORM,\n LABEL_TRANSFORM_ORIGIN,\n LABEL_TRANSITION,\n} from '../../theme/tokens';\n\nexport type LabelPosition = 'outside' | 'floating';\n\nexport interface BuildFormFieldSxOptions {\n borderRadius: number | string;\n labelPosition: LabelPosition;\n /**\n * Si es `true`, los selectores incluyen también la API nueva de MUI X\n * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.\n */\n includePickersApi?: boolean;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.\n * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).\n */\n extraOutsideSx?: Record<string, any>;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.\n */\n extraFloatingSx?: Record<string, any>;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Builder del sx compartido por todos los campos de formulario\n * (Input/Select/Autocomplete/DatePicker/DateTimePicker).\n *\n * Produce:\n * - en modo \"floating\": sólo el border-radius del outlined input;\n * - en modo \"outside\": todo el pack (margen superior, label flotante afuera,\n * input base, notched outline oculto, helper text sin margen izquierdo).\n *\n * Componentes con paddings o selectores propios pueden inyectarlos vía\n * `extraOutsideSx` / `extraFloatingSx`.\n */\nexport const buildFormFieldSx = ({\n borderRadius,\n labelPosition,\n includePickersApi = false,\n extraOutsideSx,\n extraFloatingSx,\n}: BuildFormFieldSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n // ── Selectores (alternan según la API de pickers) ────────────────────\n const outlinedRootSelector = includePickersApi\n ? '& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root'\n : '& .MuiOutlinedInput-root';\n\n const inputBaseSelector = includePickersApi\n ? '& .MuiInputBase-root, & .MuiPickersInputBase-root'\n : '& .MuiInputBase-root';\n\n const notchedOutlineSelector = includePickersApi\n ? '& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'\n : '& .MuiOutlinedInput-notchedOutline';\n\n // ── Floating ─────────────────────────────────────────────────────────\n if (labelPosition === 'floating') {\n return {\n [outlinedRootSelector]: { borderRadius: radius },\n ...(extraFloatingSx ?? {}),\n };\n }\n\n // ── Outside ──────────────────────────────────────────────────────────\n return {\n marginTop: LABEL_MARGIN_TOP,\n\n '& .MuiInputLabel-root': {\n color: LABEL_COLOR_REST,\n transition: LABEL_TRANSITION,\n\n // Estado shrunk (focused o con valor): flota ARRIBA del input.\n '&.MuiInputLabel-shrink': {\n transform: LABEL_SHRINK_TRANSFORM,\n transformOrigin: LABEL_TRANSFORM_ORIGIN,\n color: LABEL_COLOR_FILLED,\n fontWeight: LABEL_FONT_WEIGHT_FILLED,\n },\n\n '&.Mui-focused': { color: LABEL_COLOR_FOCUSED },\n },\n\n // Input base — centra verticalmente (clásico y, si aplica, pickers).\n [inputBaseSelector]: {\n borderRadius: radius,\n display: 'flex',\n alignItems: 'center',\n },\n\n // El label flota afuera: ocultar legend del notch.\n [notchedOutlineSelector]: {\n top: 0,\n '& legend': { display: 'none' },\n },\n\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n\n ...(extraOutsideSx ?? {}),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkCA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAcpD,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,SAAS,SAAS,YAAY;AAGpC,QAAM,uBAAuB,oBACzB,8DACA;AAEJ,QAAM,oBAAoB,oBACtB,sDACA;AAEJ,QAAM,yBAAyB,oBAC3B,kFACA;AAGJ,MAAI,kBAAkB,YAAY;AAChC,WAAO;AAAA,MACL,CAAC,oBAAoB,GAAG,EAAE,cAAc,OAAA;AAAA,OACpC,4CAAmB,CAAA;AAAA,EAE3B;AAGA,SAAO;AAAA,IACL,WAAW;AAAA,IAEX,yBAAyB;AAAA,MACvB,OAAO;AAAA,MACP,YAAY;AAAA;AAAA,MAGZ,0BAA0B;AAAA,QACxB,WAAW;AAAA,QACX,iBAAiB;AAAA,QACjB,OAAO;AAAA,QACP,YAAY;AAAA,MAAA;AAAA,MAGd,iBAAiB,EAAE,OAAO,oBAAA;AAAA,IAAoB;AAAA;AAAA,IAIhD,CAAC,iBAAiB,GAAG;AAAA,MACnB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA;AAAA,IAId,CAAC,sBAAsB,GAAG;AAAA,MACxB,KAAK;AAAA,MACL,YAAY,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,IAGhC,6BAA6B;AAAA,MAC3B,YAAY;AAAA,IAAA;AAAA,KAGV,0CAAkB,CAAA;AAE1B;"}
|
|
@@ -15,15 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
}
|
|
16
16
|
return a;
|
|
17
17
|
};
|
|
18
|
-
const
|
|
19
|
-
const FIELD_INPUT_PADDING_Y = "8.5px";
|
|
20
|
-
const LABEL_SHRINK_TRANSFORM = "translate(4px, -22px) scale(0.85)";
|
|
21
|
-
const LABEL_TRANSFORM_ORIGIN = "top left";
|
|
22
|
-
const LABEL_TRANSITION = "color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms";
|
|
23
|
-
const LABEL_COLOR_REST = "text.secondary";
|
|
24
|
-
const LABEL_COLOR_FILLED = "text.primary";
|
|
25
|
-
const LABEL_COLOR_FOCUSED = "primary.main";
|
|
26
|
-
const LABEL_FONT_WEIGHT_FILLED = 500;
|
|
18
|
+
const tokens = require("./tokens-jaWWNk39.cjs");
|
|
27
19
|
const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
28
20
|
const buildFormFieldSx = ({
|
|
29
21
|
borderRadius,
|
|
@@ -42,18 +34,18 @@ const buildFormFieldSx = ({
|
|
|
42
34
|
}, extraFloatingSx != null ? extraFloatingSx : {});
|
|
43
35
|
}
|
|
44
36
|
return __spreadValues({
|
|
45
|
-
marginTop: LABEL_MARGIN_TOP,
|
|
37
|
+
marginTop: tokens.LABEL_MARGIN_TOP,
|
|
46
38
|
"& .MuiInputLabel-root": {
|
|
47
|
-
color: LABEL_COLOR_REST,
|
|
48
|
-
transition: LABEL_TRANSITION,
|
|
39
|
+
color: tokens.LABEL_COLOR_REST,
|
|
40
|
+
transition: tokens.LABEL_TRANSITION,
|
|
49
41
|
// Estado shrunk (focused o con valor): flota ARRIBA del input.
|
|
50
42
|
"&.MuiInputLabel-shrink": {
|
|
51
|
-
transform: LABEL_SHRINK_TRANSFORM,
|
|
52
|
-
transformOrigin: LABEL_TRANSFORM_ORIGIN,
|
|
53
|
-
color: LABEL_COLOR_FILLED,
|
|
54
|
-
fontWeight: LABEL_FONT_WEIGHT_FILLED
|
|
43
|
+
transform: tokens.LABEL_SHRINK_TRANSFORM,
|
|
44
|
+
transformOrigin: tokens.LABEL_TRANSFORM_ORIGIN,
|
|
45
|
+
color: tokens.LABEL_COLOR_FILLED,
|
|
46
|
+
fontWeight: tokens.LABEL_FONT_WEIGHT_FILLED
|
|
55
47
|
},
|
|
56
|
-
"&.Mui-focused": { color: LABEL_COLOR_FOCUSED }
|
|
48
|
+
"&.Mui-focused": { color: tokens.LABEL_COLOR_FOCUSED }
|
|
57
49
|
},
|
|
58
50
|
// Input base — centra verticalmente (clásico y, si aplica, pickers).
|
|
59
51
|
[inputBaseSelector]: {
|
|
@@ -71,6 +63,5 @@ const buildFormFieldSx = ({
|
|
|
71
63
|
}
|
|
72
64
|
}, extraOutsideSx != null ? extraOutsideSx : {});
|
|
73
65
|
};
|
|
74
|
-
exports.FIELD_INPUT_PADDING_Y = FIELD_INPUT_PADDING_Y;
|
|
75
66
|
exports.buildFormFieldSx = buildFormFieldSx;
|
|
76
|
-
//# sourceMappingURL=formField.sx-
|
|
67
|
+
//# sourceMappingURL=formField.sx-BAX7KwMR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formField.sx-BAX7KwMR.cjs","sources":["../src/components/_shared/formField.sx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport {\n LABEL_COLOR_FILLED,\n LABEL_COLOR_FOCUSED,\n LABEL_COLOR_REST,\n LABEL_FONT_WEIGHT_FILLED,\n LABEL_MARGIN_TOP,\n LABEL_SHRINK_TRANSFORM,\n LABEL_TRANSFORM_ORIGIN,\n LABEL_TRANSITION,\n} from '../../theme/tokens';\n\nexport type LabelPosition = 'outside' | 'floating';\n\nexport interface BuildFormFieldSxOptions {\n borderRadius: number | string;\n labelPosition: LabelPosition;\n /**\n * Si es `true`, los selectores incluyen también la API nueva de MUI X\n * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.\n */\n includePickersApi?: boolean;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.\n * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).\n */\n extraOutsideSx?: Record<string, any>;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.\n */\n extraFloatingSx?: Record<string, any>;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Builder del sx compartido por todos los campos de formulario\n * (Input/Select/Autocomplete/DatePicker/DateTimePicker).\n *\n * Produce:\n * - en modo \"floating\": sólo el border-radius del outlined input;\n * - en modo \"outside\": todo el pack (margen superior, label flotante afuera,\n * input base, notched outline oculto, helper text sin margen izquierdo).\n *\n * Componentes con paddings o selectores propios pueden inyectarlos vía\n * `extraOutsideSx` / `extraFloatingSx`.\n */\nexport const buildFormFieldSx = ({\n borderRadius,\n labelPosition,\n includePickersApi = false,\n extraOutsideSx,\n extraFloatingSx,\n}: BuildFormFieldSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n // ── Selectores (alternan según la API de pickers) ────────────────────\n const outlinedRootSelector = includePickersApi\n ? '& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root'\n : '& .MuiOutlinedInput-root';\n\n const inputBaseSelector = includePickersApi\n ? '& .MuiInputBase-root, & .MuiPickersInputBase-root'\n : '& .MuiInputBase-root';\n\n const notchedOutlineSelector = includePickersApi\n ? '& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'\n : '& .MuiOutlinedInput-notchedOutline';\n\n // ── Floating ─────────────────────────────────────────────────────────\n if (labelPosition === 'floating') {\n return {\n [outlinedRootSelector]: { borderRadius: radius },\n ...(extraFloatingSx ?? {}),\n };\n }\n\n // ── Outside ──────────────────────────────────────────────────────────\n return {\n marginTop: LABEL_MARGIN_TOP,\n\n '& .MuiInputLabel-root': {\n color: LABEL_COLOR_REST,\n transition: LABEL_TRANSITION,\n\n // Estado shrunk (focused o con valor): flota ARRIBA del input.\n '&.MuiInputLabel-shrink': {\n transform: LABEL_SHRINK_TRANSFORM,\n transformOrigin: LABEL_TRANSFORM_ORIGIN,\n color: LABEL_COLOR_FILLED,\n fontWeight: LABEL_FONT_WEIGHT_FILLED,\n },\n\n '&.Mui-focused': { color: LABEL_COLOR_FOCUSED },\n },\n\n // Input base — centra verticalmente (clásico y, si aplica, pickers).\n [inputBaseSelector]: {\n borderRadius: radius,\n display: 'flex',\n alignItems: 'center',\n },\n\n // El label flota afuera: ocultar legend del notch.\n [notchedOutlineSelector]: {\n top: 0,\n '& legend': { display: 'none' },\n },\n\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n\n ...(extraOutsideSx ?? {}),\n };\n};\n"],"names":["LABEL_MARGIN_TOP","LABEL_COLOR_REST","LABEL_TRANSITION","LABEL_SHRINK_TRANSFORM","LABEL_TRANSFORM_ORIGIN","LABEL_COLOR_FILLED","LABEL_FONT_WEIGHT_FILLED","LABEL_COLOR_FOCUSED"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAcpD,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,SAAS,SAAS,YAAY;AAGpC,QAAM,uBAAuB,oBACzB,8DACA;AAEJ,QAAM,oBAAoB,oBACtB,sDACA;AAEJ,QAAM,yBAAyB,oBAC3B,kFACA;AAGJ,MAAI,kBAAkB,YAAY;AAChC,WAAO;AAAA,MACL,CAAC,oBAAoB,GAAG,EAAE,cAAc,OAAA;AAAA,OACpC,4CAAmB,CAAA;AAAA,EAE3B;AAGA,SAAO;AAAA,IACL,WAAWA,OAAAA;AAAAA,IAEX,yBAAyB;AAAA,MACvB,OAAOC,OAAAA;AAAAA,MACP,YAAYC,OAAAA;AAAAA;AAAAA,MAGZ,0BAA0B;AAAA,QACxB,WAAWC,OAAAA;AAAAA,QACX,iBAAiBC,OAAAA;AAAAA,QACjB,OAAOC,OAAAA;AAAAA,QACP,YAAYC,OAAAA;AAAAA,MAAA;AAAA,MAGd,iBAAiB,EAAE,OAAOC,OAAAA,oBAAA;AAAA,IAAoB;AAAA;AAAA,IAIhD,CAAC,iBAAiB,GAAG;AAAA,MACnB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA;AAAA,IAId,CAAC,sBAAsB,GAAG;AAAA,MACxB,KAAK;AAAA,MACL,YAAY,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,IAGhC,6BAA6B;AAAA,MAC3B,YAAY;AAAA,IAAA;AAAA,KAGV,0CAAkB,CAAA;AAE1B;;"}
|
package/index.cjs
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
require('./
|
|
4
|
-
const resolvePreset = require("./resolvePreset-CxTI6_Ln.cjs");
|
|
3
|
+
require('./index.css');const resolvePreset = require("./resolvePreset-CxTI6_Ln.cjs");
|
|
5
4
|
const material = require("@mui/material");
|
|
5
|
+
const timeViewRenderers = require("@mui/x-date-pickers/timeViewRenderers");
|
|
6
6
|
const Button = require("./Button-C17mExpd.cjs");
|
|
7
|
-
const Card = require("./Card-
|
|
7
|
+
const Card = require("./Card-DfdU610V.cjs");
|
|
8
8
|
const Chip = require("./Chip-qoJLDiva.cjs");
|
|
9
9
|
const components_Column = require("./components/Column/Column.cjs");
|
|
10
|
-
const Avatar = require("./Avatar-
|
|
10
|
+
const Avatar = require("./Avatar-CuSrK8Wn.cjs");
|
|
11
11
|
const Stat = require("./Stat-BUcFCGrz.cjs");
|
|
12
|
-
const Step = require("./Step-
|
|
13
|
-
const Tab = require("./Tab-
|
|
12
|
+
const Step = require("./Step-Nd7SJbRZ.cjs");
|
|
13
|
+
const Tab = require("./Tab-BbP8jBcK.cjs");
|
|
14
14
|
const Table = require("./Table-C4OM6rrC.cjs");
|
|
15
|
-
const StatusMessage = require("./StatusMessage-
|
|
16
|
-
const Modal = require("./Modal-
|
|
17
|
-
const Input = require("./Input-
|
|
18
|
-
const Select = require("./Select-
|
|
19
|
-
const Autocomplete = require("./Autocomplete-
|
|
20
|
-
const Switch = require("./Switch-
|
|
21
|
-
const RadioGroup = require("./RadioGroup-
|
|
22
|
-
const
|
|
15
|
+
const StatusMessage = require("./StatusMessage-B3nXpuRl.cjs");
|
|
16
|
+
const Modal = require("./Modal-BN5s-Tfk.cjs");
|
|
17
|
+
const Input = require("./Input-jYapjJYM.cjs");
|
|
18
|
+
const Select = require("./Select-B6jE3WH_.cjs");
|
|
19
|
+
const Autocomplete = require("./Autocomplete-4i0dNDKr.cjs");
|
|
20
|
+
const Switch = require("./Switch-CQFOopYy.cjs");
|
|
21
|
+
const RadioGroup = require("./RadioGroup-Dd0rHXSX.cjs");
|
|
22
|
+
const Checkbox = require("./Checkbox-BCqMFWt4.cjs");
|
|
23
|
+
const DatePicker = require("./DatePicker-CtCFqXDw.cjs");
|
|
23
24
|
const DateRangePicker = require("./DateRangePicker-B_hKQhbj.cjs");
|
|
24
|
-
const DateTimePicker = require("./DateTimePicker-
|
|
25
|
+
const DateTimePicker = require("./DateTimePicker-CTnRQCZo.cjs");
|
|
26
|
+
function scrollToTop({
|
|
27
|
+
behavior = "smooth",
|
|
28
|
+
target = typeof window !== "undefined" ? window : void 0,
|
|
29
|
+
top = 0
|
|
30
|
+
} = {}) {
|
|
31
|
+
if (!target) return;
|
|
32
|
+
target.scrollTo({ top, left: 0, behavior });
|
|
33
|
+
}
|
|
25
34
|
exports.DEFAULT_PRESET_NAME = resolvePreset.DEFAULT_PRESET_NAME;
|
|
26
35
|
exports.resolvePreset = resolvePreset.resolvePreset;
|
|
27
36
|
Object.defineProperty(exports, "Alert", {
|
|
@@ -116,6 +125,10 @@ Object.defineProperty(exports, "Stack", {
|
|
|
116
125
|
enumerable: true,
|
|
117
126
|
get: () => material.Stack
|
|
118
127
|
});
|
|
128
|
+
Object.defineProperty(exports, "ThemeProvider", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: () => material.ThemeProvider
|
|
131
|
+
});
|
|
119
132
|
Object.defineProperty(exports, "Typography", {
|
|
120
133
|
enumerable: true,
|
|
121
134
|
get: () => material.Typography
|
|
@@ -128,6 +141,10 @@ Object.defineProperty(exports, "alpha", {
|
|
|
128
141
|
enumerable: true,
|
|
129
142
|
get: () => material.alpha
|
|
130
143
|
});
|
|
144
|
+
Object.defineProperty(exports, "createTheme", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: () => material.createTheme
|
|
147
|
+
});
|
|
131
148
|
Object.defineProperty(exports, "styled", {
|
|
132
149
|
enumerable: true,
|
|
133
150
|
get: () => material.styled
|
|
@@ -140,6 +157,10 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
140
157
|
enumerable: true,
|
|
141
158
|
get: () => material.useTheme
|
|
142
159
|
});
|
|
160
|
+
Object.defineProperty(exports, "renderMultiSectionDigitalClockTimeView", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: () => timeViewRenderers.renderMultiSectionDigitalClockTimeView
|
|
163
|
+
});
|
|
143
164
|
exports.Button = Button.Button;
|
|
144
165
|
exports.Card = Card.Card;
|
|
145
166
|
exports.Chip = Chip.Chip;
|
|
@@ -163,7 +184,9 @@ exports.Autocomplete = Autocomplete.Autocomplete;
|
|
|
163
184
|
exports.AutocompleteSelect = Autocomplete.AutocompleteSelect;
|
|
164
185
|
exports.Switch = Switch.Switch;
|
|
165
186
|
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
187
|
+
exports.Checkbox = Checkbox.Checkbox;
|
|
166
188
|
exports.DatePicker = DatePicker.DatePicker;
|
|
167
189
|
exports.DateRangePicker = DateRangePicker.DateRangePicker;
|
|
168
190
|
exports.DateTimePicker = DateTimePicker.DateTimePicker;
|
|
191
|
+
exports.scrollToTop = scrollToTop;
|
|
169
192
|
//# sourceMappingURL=index.cjs.map
|
package/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/utils/scrollToTop.ts"],"sourcesContent":["export interface ScrollToTopOptions {\n /** Comportamiento del scroll. Default: `'smooth'`. */\n behavior?: ScrollBehavior;\n /**\n * Elemento target del scroll. Default: `window`. Útil cuando el contenedor\n * scrolleable NO es `window` (p.ej. un `<Box>` con `overflow: auto`).\n */\n target?: Window | HTMLElement;\n /** Offset desde el top. Default: `0`. */\n top?: number;\n}\n\n/**\n * Hace scroll al tope (por default con animación suave). Safe en SSR — si\n * `window` no existe, es un no-op.\n *\n * Llamar tras mutaciones / cambios de filtros / apertura de modales para\n * asegurar que el usuario vea el mensaje de confirmación en la parte\n * superior de la página.\n *\n * ```ts\n * import { scrollToTop } from '@soyfri/shared-library';\n *\n * scrollToTop(); // window, smooth\n * scrollToTop({ behavior: 'auto' }); // window, instantáneo\n * scrollToTop({ target: myScrollableRef.current }); // container custom\n * ```\n */\nexport function scrollToTop({\n behavior = 'smooth',\n target = typeof window !== 'undefined' ? window : undefined,\n top = 0,\n}: ScrollToTopOptions = {}): void {\n if (!target) return;\n target.scrollTo({ top, left: 0, behavior });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,SAAS,YAAY;AAAA,EAC1B,WAAW;AAAA,EACX,SAAS,OAAO,WAAW,cAAc,SAAS;AAAA,EAClD,MAAM;AACR,IAAwB,IAAU;AAChC,MAAI,CAAC,OAAQ;AACb,SAAO,SAAS,EAAE,KAAK,MAAM,GAAG,UAAU;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { LibraryComponentName, PresetStyle, ComponentPresets, LibraryStyles, } from './theme/componentStyles';
|
|
2
2
|
export { DEFAULT_PRESET_NAME, resolvePreset } from './components/_shared/resolvePreset';
|
|
3
|
+
export * from './utils';
|
|
3
4
|
export * from './mui';
|
|
4
5
|
export { Button } from './components/Button';
|
|
5
6
|
export { Card } from './components/Card';
|
|
@@ -26,6 +27,8 @@ export { Switch } from './components/Switch';
|
|
|
26
27
|
export type { SwitchProps, BaseSwitchProps } from './components/Switch';
|
|
27
28
|
export { RadioGroup } from './components/RadioGroup';
|
|
28
29
|
export type { RadioGroupProps, RadioOption, BaseRadioGroupProps } from './components/RadioGroup';
|
|
30
|
+
export { Checkbox } from './components/Checkbox';
|
|
31
|
+
export type { CheckboxProps, BaseCheckboxProps } from './components/Checkbox';
|
|
29
32
|
export { DatePicker } from './components/DatePicker';
|
|
30
33
|
export type { DatePickerProps } from './components/DatePicker';
|
|
31
34
|
export { DateRangePicker } from './components/DateRangePicker';
|
package/index.js
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import './styles.css';/* empty css */
|
|
2
1
|
import { D, r } from "./resolvePreset-K6_BfWHD.js";
|
|
3
|
-
import { Alert, AlertTitle, Backdrop, Box, CircularProgress, Collapse, Container, Divider, Fade, Grid, Grow, LinearProgress, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Paper, Skeleton, Snackbar, Stack, Typography, Zoom, alpha, styled, useMediaQuery, useTheme } from "@mui/material";
|
|
2
|
+
import { Alert, AlertTitle, Backdrop, Box, CircularProgress, Collapse, Container, Divider, Fade, Grid, Grow, LinearProgress, Link, List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Paper, Skeleton, Snackbar, Stack, ThemeProvider, Typography, Zoom, alpha, createTheme, styled, useMediaQuery, useTheme } from "@mui/material";
|
|
3
|
+
import { renderMultiSectionDigitalClockTimeView } from "@mui/x-date-pickers/timeViewRenderers";
|
|
4
4
|
import { B } from "./Button-UkkP-bNw.js";
|
|
5
|
-
import { C } from "./Card-
|
|
5
|
+
import { C } from "./Card-B1wtavyl.js";
|
|
6
6
|
import { C as C2 } from "./Chip-OPYQ1uQ_.js";
|
|
7
7
|
import { Column } from "./components/Column/Column.js";
|
|
8
|
-
import { A } from "./Avatar-
|
|
8
|
+
import { A } from "./Avatar-CgT7955R.js";
|
|
9
9
|
import { S } from "./Stat-C06A_izS.js";
|
|
10
|
-
import { a, S as S2 } from "./Step-
|
|
11
|
-
import { a as a2, T } from "./Tab-
|
|
10
|
+
import { a, S as S2 } from "./Step-BArsou1V.js";
|
|
11
|
+
import { a as a2, T } from "./Tab-BxSxKJsP.js";
|
|
12
12
|
import { T as T2 } from "./Table-C2LbW0B1.js";
|
|
13
|
-
import { S as S3 } from "./StatusMessage-
|
|
14
|
-
import {
|
|
15
|
-
import { I } from "./Input-
|
|
16
|
-
import { O, S as S4 } from "./Select-
|
|
17
|
-
import { A as A2, a as a4 } from "./Autocomplete-
|
|
18
|
-
import { S as S5 } from "./Switch-
|
|
19
|
-
import { R } from "./RadioGroup-
|
|
20
|
-
import {
|
|
13
|
+
import { S as S3 } from "./StatusMessage-D0WgSBx7.js";
|
|
14
|
+
import { a as a3, c, d, b } from "./Modal-BRZMPwDj.js";
|
|
15
|
+
import { I } from "./Input-rVVhI_wk.js";
|
|
16
|
+
import { O, S as S4 } from "./Select-bSVQokFX.js";
|
|
17
|
+
import { A as A2, a as a4 } from "./Autocomplete-i3-V38n1.js";
|
|
18
|
+
import { S as S5 } from "./Switch-D72dpkH2.js";
|
|
19
|
+
import { R } from "./RadioGroup-bO-ahP9T.js";
|
|
20
|
+
import { C as C3 } from "./Checkbox-gB5YKkVo.js";
|
|
21
|
+
import { D as D2 } from "./DatePicker-D0Bz9Ryg.js";
|
|
21
22
|
import { D as D3 } from "./DateRangePicker-BVpeJCHI.js";
|
|
22
|
-
import { D as D4 } from "./DateTimePicker-
|
|
23
|
+
import { D as D4 } from "./DateTimePicker-77w-9TP5.js";
|
|
24
|
+
import './index.css';function scrollToTop({
|
|
25
|
+
behavior = "smooth",
|
|
26
|
+
target = typeof window !== "undefined" ? window : void 0,
|
|
27
|
+
top = 0
|
|
28
|
+
} = {}) {
|
|
29
|
+
if (!target) return;
|
|
30
|
+
target.scrollTo({ top, left: 0, behavior });
|
|
31
|
+
}
|
|
23
32
|
export {
|
|
24
33
|
Alert,
|
|
25
34
|
AlertTitle,
|
|
@@ -30,6 +39,7 @@ export {
|
|
|
30
39
|
Box,
|
|
31
40
|
B as Button,
|
|
32
41
|
C as Card,
|
|
42
|
+
C3 as Checkbox,
|
|
33
43
|
C2 as Chip,
|
|
34
44
|
CircularProgress,
|
|
35
45
|
Collapse,
|
|
@@ -52,10 +62,10 @@ export {
|
|
|
52
62
|
ListItemIcon,
|
|
53
63
|
ListItemText,
|
|
54
64
|
ListSubheader,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
a3 as Modal,
|
|
66
|
+
c as ModalBody,
|
|
67
|
+
d as ModalFooter,
|
|
68
|
+
b as ModalHeader,
|
|
59
69
|
O as Option,
|
|
60
70
|
Paper,
|
|
61
71
|
R as RadioGroup,
|
|
@@ -71,10 +81,14 @@ export {
|
|
|
71
81
|
a2 as Tab,
|
|
72
82
|
T2 as Table,
|
|
73
83
|
T as Tabs,
|
|
84
|
+
ThemeProvider,
|
|
74
85
|
Typography,
|
|
75
86
|
Zoom,
|
|
76
87
|
alpha,
|
|
88
|
+
createTheme,
|
|
89
|
+
renderMultiSectionDigitalClockTimeView,
|
|
77
90
|
r as resolvePreset,
|
|
91
|
+
scrollToTop,
|
|
78
92
|
styled,
|
|
79
93
|
useMediaQuery,
|
|
80
94
|
useTheme
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/scrollToTop.ts"],"sourcesContent":["export interface ScrollToTopOptions {\n /** Comportamiento del scroll. Default: `'smooth'`. */\n behavior?: ScrollBehavior;\n /**\n * Elemento target del scroll. Default: `window`. Útil cuando el contenedor\n * scrolleable NO es `window` (p.ej. un `<Box>` con `overflow: auto`).\n */\n target?: Window | HTMLElement;\n /** Offset desde el top. Default: `0`. */\n top?: number;\n}\n\n/**\n * Hace scroll al tope (por default con animación suave). Safe en SSR — si\n * `window` no existe, es un no-op.\n *\n * Llamar tras mutaciones / cambios de filtros / apertura de modales para\n * asegurar que el usuario vea el mensaje de confirmación en la parte\n * superior de la página.\n *\n * ```ts\n * import { scrollToTop } from '@soyfri/shared-library';\n *\n * scrollToTop(); // window, smooth\n * scrollToTop({ behavior: 'auto' }); // window, instantáneo\n * scrollToTop({ target: myScrollableRef.current }); // container custom\n * ```\n */\nexport function scrollToTop({\n behavior = 'smooth',\n target = typeof window !== 'undefined' ? window : undefined,\n top = 0,\n}: ScrollToTopOptions = {}): void {\n if (!target) return;\n target.scrollTo({ top, left: 0, behavior });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BO,SAAS,YAAY;AAAA,EAC1B,WAAW;AAAA,EACX,SAAS,OAAO,WAAW,cAAc,SAAS;AAAA,EAClD,MAAM;AACR,IAAwB,IAAU;AAChC,MAAI,CAAC,OAAQ;AACb,SAAO,SAAS,EAAE,KAAK,MAAM,GAAG,UAAU;AAC5C;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const mergeSx = (base, extra) => {
|
|
2
|
+
if (!extra) return base;
|
|
3
|
+
const baseArr = Array.isArray(base) ? base : [base];
|
|
4
|
+
const extraArr = Array.isArray(extra) ? extra : [extra];
|
|
5
|
+
return [...baseArr, ...extraArr];
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
mergeSx as m
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=mergeSx-BXoNZjB_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeSx-BXoNZjB_.js","sources":["../src/components/_shared/mergeSx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\n/**\n * Merge helper para props `sx` de MUI. Acepta formatos objeto o array y\n * devuelve un array combinado. El `extra` se aplica después del `base` —\n * el consumer puede pisar los defaults del componente.\n */\nexport const mergeSx = (\n base: SxProps<Theme>,\n extra?: SxProps<Theme>,\n): SxProps<Theme> => {\n if (!extra) return base;\n const baseArr = Array.isArray(base) ? base : [base];\n const extraArr = Array.isArray(extra) ? extra : [extra];\n return [...baseArr, ...extraArr] as SxProps<Theme>;\n};\n"],"names":[],"mappings":"AAOO,MAAM,UAAU,CACrB,MACA,UACmB;AACnB,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,UAAU,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAClD,QAAM,WAAW,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AACtD,SAAO,CAAC,GAAG,SAAS,GAAG,QAAQ;AACjC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const mergeSx = (base, extra) => {
|
|
3
|
+
if (!extra) return base;
|
|
4
|
+
const baseArr = Array.isArray(base) ? base : [base];
|
|
5
|
+
const extraArr = Array.isArray(extra) ? extra : [extra];
|
|
6
|
+
return [...baseArr, ...extraArr];
|
|
7
|
+
};
|
|
8
|
+
exports.mergeSx = mergeSx;
|
|
9
|
+
//# sourceMappingURL=mergeSx-Dbccoo_H.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeSx-Dbccoo_H.cjs","sources":["../src/components/_shared/mergeSx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\n/**\n * Merge helper para props `sx` de MUI. Acepta formatos objeto o array y\n * devuelve un array combinado. El `extra` se aplica después del `base` —\n * el consumer puede pisar los defaults del componente.\n */\nexport const mergeSx = (\n base: SxProps<Theme>,\n extra?: SxProps<Theme>,\n): SxProps<Theme> => {\n if (!extra) return base;\n const baseArr = Array.isArray(base) ? base : [base];\n const extraArr = Array.isArray(extra) ? extra : [extra];\n return [...baseArr, ...extraArr] as SxProps<Theme>;\n};\n"],"names":[],"mappings":";AAOO,MAAM,UAAU,CACrB,MACA,UACmB;AACnB,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,UAAU,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAClD,QAAM,WAAW,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;AACtD,SAAO,CAAC,GAAG,SAAS,GAAG,QAAQ;AACjC;;"}
|
package/mui.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { Box, Stack, Grid, Container, Paper, Divider, } from '@mui/material';
|
|
|
2
2
|
export { Typography, Link } from '@mui/material';
|
|
3
3
|
export { List, ListItem, ListItemButton, ListItemIcon, ListItemText, ListSubheader, } from '@mui/material';
|
|
4
4
|
export { CircularProgress, LinearProgress, Skeleton, Alert, AlertTitle, Snackbar, Backdrop, Fade, Grow, Zoom, Collapse, } from '@mui/material';
|
|
5
|
-
export { useTheme, useMediaQuery, alpha, styled } from '@mui/material';
|
|
5
|
+
export { useTheme, useMediaQuery, alpha, styled, createTheme, ThemeProvider } from '@mui/material';
|
|
6
6
|
export type { SxProps, Theme } from '@mui/material/styles';
|
|
7
|
+
export { renderMultiSectionDigitalClockTimeView } from '@mui/x-date-pickers/timeViewRenderers';
|