@soyfri/shared-library 1.5.0 → 2.0.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/dist/components/ActionMenu/ActionMenu.cjs +107 -0
- package/dist/components/ActionMenu/ActionMenu.cjs.map +1 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +60 -0
- package/dist/components/ActionMenu/ActionMenu.js +107 -0
- package/dist/components/ActionMenu/ActionMenu.js.map +1 -0
- package/dist/components/ActionMenu/index.d.ts +2 -0
- package/dist/components/ActionMenu.d.ts +6 -0
- package/dist/components/AppBar/AppBar.cjs +346 -0
- package/dist/components/AppBar/AppBar.cjs.map +1 -0
- package/dist/components/AppBar/AppBar.d.ts +55 -0
- package/dist/components/AppBar/AppBar.js +346 -0
- package/dist/components/AppBar/AppBar.js.map +1 -0
- package/dist/components/AppBar/AppBar.sx.d.ts +12 -0
- package/dist/components/AppBar/AppBarBrand.d.ts +31 -0
- package/dist/components/AppBar/AppBarContext.d.ts +18 -0
- package/dist/components/AppBar/AppBarMenuToggle.d.ts +39 -0
- package/dist/components/AppBar/AppBarUserMenu.d.ts +65 -0
- package/dist/components/AppBar/index.d.ts +12 -0
- package/dist/components/AppBar.d.ts +6 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +259 -54
- package/dist/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +64 -9
- package/dist/components/Autocomplete/Autocomplete.definitions.d.ts +6 -0
- package/dist/components/Autocomplete/Autocomplete.helpers.d.ts +18 -0
- package/dist/components/Autocomplete/Autocomplete.js +261 -56
- package/dist/components/Autocomplete/Autocomplete.js.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.sx.d.ts +7 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +1 -0
- package/dist/components/Autocomplete/_parts/AutocompleteChips.d.ts +19 -0
- package/dist/components/Autocomplete/_parts/AutocompleteLoader.d.ts +9 -0
- package/dist/components/Autocomplete/_parts/AutocompleteOption.d.ts +19 -0
- package/dist/components/Autocomplete/index.d.ts +2 -1
- package/dist/components/Autocomplete.d.ts +4 -0
- package/dist/components/Avatar/Avatar.cjs +116 -79
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +16 -2
- package/dist/components/Avatar/Avatar.definitions.d.ts +11 -0
- package/dist/components/Avatar/Avatar.js +117 -80
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Card/Card.cjs +168 -9
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +78 -8
- package/dist/components/Card/Card.js +170 -11
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.sx.d.ts +17 -0
- package/dist/components/Card/index.d.ts +4 -1
- package/dist/components/Card.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.cjs +201 -3
- package/dist/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +47 -9
- package/dist/components/DatePicker/DatePicker.definitions.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.helpers.d.ts +7 -0
- package/dist/components/DatePicker/DatePicker.js +200 -2
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.sx.d.ts +9 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +2 -1
- package/dist/components/DatePicker.d.ts +4 -0
- package/dist/components/DateTimePicker/DateTimePicker.cjs +152 -138
- package/dist/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +46 -9
- package/dist/components/DateTimePicker/DateTimePicker.definitions.d.ts +1 -0
- package/dist/components/DateTimePicker/DateTimePicker.helpers.d.ts +11 -0
- package/dist/components/DateTimePicker/DateTimePicker.js +152 -138
- package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.sx.d.ts +7 -0
- package/dist/components/DateTimePicker/DateTimePicker.types.d.ts +1 -0
- package/dist/components/DateTimePicker/index.d.ts +2 -1
- package/dist/components/DateTimePicker.d.ts +4 -0
- package/dist/components/Drawer/Drawer.cjs +271 -0
- package/dist/components/Drawer/Drawer.cjs.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +51 -0
- package/dist/components/Drawer/Drawer.js +271 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Drawer/Drawer.sx.d.ts +23 -0
- package/dist/components/Drawer/DrawerContext.d.ts +18 -0
- package/dist/components/Drawer/DrawerItem.d.ts +35 -0
- package/dist/components/Drawer/index.d.ts +6 -0
- package/dist/components/Drawer.d.ts +6 -0
- package/dist/components/Icon/Icon.cjs +44 -3
- package/dist/components/Icon/Icon.cjs.map +1 -1
- package/dist/components/Icon/Icon.d.ts +34 -1
- package/dist/components/Icon/Icon.js +44 -3
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Input/Input.cjs +173 -3
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.ts +20 -15
- package/dist/components/Input/Input.definitions.d.ts +5 -2
- package/dist/components/Input/Input.helpers.d.ts +14 -0
- package/dist/components/Input/Input.js +172 -2
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.sx.d.ts +8 -0
- package/dist/components/Input/Input.types.d.ts +1 -0
- package/dist/components/Input/index.d.ts +2 -1
- package/dist/components/Input.d.ts +4 -0
- package/dist/components/InputGroup/InputGroup.cjs +104 -91
- package/dist/components/InputGroup/InputGroup.cjs.map +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +37 -1
- package/dist/components/InputGroup/InputGroup.definitions.d.ts +6 -0
- package/dist/components/InputGroup/InputGroup.js +106 -93
- package/dist/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/components/Modal/Modal.cjs +226 -116
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +38 -2
- package/dist/components/Modal/Modal.js +227 -117
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/ModalFooter.d.ts +9 -1
- package/dist/components/Modal/index.d.ts +5 -0
- package/dist/components/PageLoader/PageLoader.cjs +61 -0
- package/dist/components/PageLoader/PageLoader.cjs.map +1 -0
- package/dist/components/PageLoader/PageLoader.d.ts +38 -0
- package/dist/components/PageLoader/PageLoader.js +61 -0
- package/dist/components/PageLoader/PageLoader.js.map +1 -0
- package/dist/components/PageLoader/index.d.ts +2 -0
- package/dist/components/PageLoader.d.ts +6 -0
- package/dist/components/ScrollTopButton/ScrollTopButton.cjs +79 -0
- package/dist/components/ScrollTopButton/ScrollTopButton.cjs.map +1 -0
- package/dist/components/ScrollTopButton/ScrollTopButton.d.ts +48 -0
- package/dist/components/ScrollTopButton/ScrollTopButton.js +79 -0
- package/dist/components/ScrollTopButton/ScrollTopButton.js.map +1 -0
- package/dist/components/ScrollTopButton/index.d.ts +4 -0
- package/dist/components/ScrollTopButton/scrollToTop.d.ts +29 -0
- package/dist/components/ScrollTopButton.d.ts +6 -0
- package/dist/components/Select/Select.cjs +446 -4
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.d.ts +33 -13
- package/dist/components/Select/Select.definitions.d.ts +3 -0
- package/dist/components/Select/Select.helpers.d.ts +28 -0
- package/dist/components/Select/Select.js +445 -3
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.sx.d.ts +7 -0
- package/dist/components/Select/Select.types.d.ts +1 -0
- package/dist/components/Select/_parts/SelectMenuItem.d.ts +20 -0
- package/dist/components/Select/_parts/SelectSearchHeader.d.ts +15 -0
- package/dist/components/Select/_parts/SelectValue.d.ts +22 -0
- package/dist/components/Select/index.d.ts +2 -1
- package/dist/components/Select.d.ts +4 -0
- package/dist/components/Stat/Stat.cjs +1 -1
- package/dist/components/Stat/Stat.js +1 -1
- package/dist/components/Stepper/Stepper.cjs +4 -1
- package/dist/components/Stepper/Stepper.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +5 -0
- package/dist/components/Stepper/Stepper.js +4 -1
- package/dist/components/Stepper/Stepper.js.map +1 -1
- package/dist/components/_shared/formField.sx.d.ts +33 -0
- package/dist/components/_shared/resolvePreset.d.ts +18 -0
- package/dist/formField.sx-CQ1mbk9M.cjs +76 -0
- package/dist/formField.sx-CQ1mbk9M.cjs.map +1 -0
- package/dist/formField.sx-DfVbMe0V.js +77 -0
- package/dist/formField.sx-DfVbMe0V.js.map +1 -0
- package/dist/hooks/Wizard/Wizard.cjs +7 -0
- package/dist/hooks/Wizard/Wizard.cjs.map +1 -0
- package/dist/hooks/Wizard/Wizard.js +7 -0
- package/dist/hooks/Wizard/Wizard.js.map +1 -0
- package/dist/hooks/Wizard/WizardContext.d.ts +67 -0
- package/dist/hooks/Wizard/index.d.ts +3 -0
- package/dist/hooks/Wizard/useWizard.d.ts +9 -0
- package/dist/hooks/Wizard.d.ts +2 -0
- package/dist/index.cjs +99 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +31 -2
- package/dist/index.js.map +1 -1
- package/dist/mui.d.ts +5 -0
- package/dist/resolvePreset-B-IB0ehH.js +15 -0
- package/dist/resolvePreset-B-IB0ehH.js.map +1 -0
- package/dist/resolvePreset-CT3kU-K2.cjs +14 -0
- package/dist/resolvePreset-CT3kU-K2.cjs.map +1 -0
- package/dist/styles.css +3 -112
- package/dist/theme/componentStyles.d.ts +32 -0
- package/dist/theme/tokens.d.ts +28 -0
- package/dist/useWizard-CWdIxZzX.cjs +94 -0
- package/dist/useWizard-CWdIxZzX.cjs.map +1 -0
- package/dist/useWizard-CWq--C3o.js +95 -0
- package/dist/useWizard-CWq--C3o.js.map +1 -0
- package/package.json +1 -1
- package/src/components/ActionMenu/ActionMenu.stories.tsx +230 -0
- package/src/components/ActionMenu/ActionMenu.tsx +174 -0
- package/src/components/ActionMenu/index.ts +2 -0
- package/src/components/AppBar/AppBar.stories.tsx +272 -0
- package/src/components/AppBar/AppBar.sx.ts +32 -0
- package/src/components/AppBar/AppBar.tsx +123 -0
- package/src/components/AppBar/AppBarBrand.tsx +120 -0
- package/src/components/AppBar/AppBarContext.ts +25 -0
- package/src/components/AppBar/AppBarMenuToggle.tsx +90 -0
- package/src/components/AppBar/AppBarUserMenu.tsx +217 -0
- package/src/components/AppBar/index.ts +25 -0
- package/src/components/Autocomplete/Autocomplete.definitions.ts +223 -0
- package/src/components/Autocomplete/Autocomplete.helpers.ts +60 -0
- package/src/components/Autocomplete/Autocomplete.stories.tsx +363 -2
- package/src/components/Autocomplete/Autocomplete.sx.ts +30 -0
- package/src/components/Autocomplete/Autocomplete.tsx +312 -90
- package/src/components/Autocomplete/Autocomplete.types.ts +13 -0
- package/src/components/Autocomplete/_parts/AutocompleteChips.tsx +55 -0
- package/src/components/Autocomplete/_parts/AutocompleteLoader.tsx +17 -0
- package/src/components/Autocomplete/_parts/AutocompleteOption.tsx +31 -0
- package/src/components/Autocomplete/index.ts +12 -1
- package/src/components/Avatar/Avatar.definitions.ts +162 -0
- package/src/components/Avatar/Avatar.stories.tsx +205 -1
- package/src/components/Avatar/Avatar.tsx +166 -103
- package/src/components/Card/Card.stories.tsx +205 -16
- package/src/components/Card/Card.sx.ts +104 -0
- package/src/components/Card/Card.tsx +191 -35
- package/src/components/Card/index.ts +9 -1
- package/src/components/DatePicker/DatePicker.definitions.ts +24 -1
- package/src/components/DatePicker/DatePicker.helpers.ts +24 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +29 -2
- package/src/components/DatePicker/DatePicker.sx.ts +33 -0
- package/src/components/DatePicker/DatePicker.tsx +163 -139
- package/src/components/DatePicker/DatePicker.types.ts +10 -0
- package/src/components/DatePicker/index.ts +9 -1
- package/src/components/DateTimePicker/DateTimePicker.definitions.ts +24 -0
- package/src/components/DateTimePicker/DateTimePicker.helpers.ts +38 -0
- package/src/components/DateTimePicker/DateTimePicker.stories.tsx +29 -1
- package/src/components/DateTimePicker/DateTimePicker.sx.ts +30 -0
- package/src/components/DateTimePicker/DateTimePicker.tsx +200 -166
- package/src/components/DateTimePicker/DateTimePicker.types.ts +10 -0
- package/src/components/DateTimePicker/index.ts +9 -1
- package/src/components/Drawer/Drawer.stories.tsx +270 -0
- package/src/components/Drawer/Drawer.sx.ts +106 -0
- package/src/components/Drawer/Drawer.tsx +214 -0
- package/src/components/Drawer/DrawerContext.ts +26 -0
- package/src/components/Drawer/DrawerItem.tsx +110 -0
- package/src/components/Drawer/index.ts +10 -0
- package/src/components/Flyout/Flyout.stories.tsx +26 -18
- package/src/components/Icon/Icon.stories.tsx +68 -1
- package/src/components/Icon/Icon.tsx +87 -6
- package/src/components/Input/Input.definitions.ts +74 -2
- package/src/components/Input/Input.helpers.ts +49 -0
- package/src/components/Input/Input.stories.tsx +116 -4
- package/src/components/Input/Input.sx.ts +42 -0
- package/src/components/Input/Input.tsx +117 -162
- package/src/components/Input/Input.types.ts +10 -0
- package/src/components/Input/index.ts +9 -1
- package/src/components/InputGroup/InputGroup.definitions.ts +158 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +159 -28
- package/src/components/InputGroup/InputGroup.tsx +159 -116
- package/src/components/Modal/Modal.stories.tsx +434 -6
- package/src/components/Modal/Modal.tsx +303 -121
- package/src/components/Modal/ModalFooter.tsx +22 -12
- package/src/components/Modal/index.ts +6 -1
- package/src/components/PageLoader/PageLoader.stories.tsx +217 -0
- package/src/components/PageLoader/PageLoader.tsx +96 -0
- package/src/components/PageLoader/index.ts +2 -0
- package/src/components/ScrollTopButton/ScrollTopButton.stories.tsx +158 -0
- package/src/components/ScrollTopButton/ScrollTopButton.tsx +135 -0
- package/src/components/ScrollTopButton/index.ts +8 -0
- package/src/components/ScrollTopButton/scrollToTop.ts +37 -0
- package/src/components/Select/Select.definitions.ts +114 -0
- package/src/components/Select/Select.helpers.ts +71 -0
- package/src/components/Select/Select.stories.tsx +126 -8
- package/src/components/Select/Select.sx.ts +14 -0
- package/src/components/Select/Select.tsx +246 -285
- package/src/components/Select/Select.types.ts +15 -0
- package/src/components/Select/_parts/SelectMenuItem.tsx +40 -0
- package/src/components/Select/_parts/SelectSearchHeader.tsx +51 -0
- package/src/components/Select/_parts/SelectValue.tsx +96 -0
- package/src/components/Select/index.ts +14 -1
- package/src/components/Stepper/Stepper.tsx +17 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -3
- package/src/components/_shared/formField.sx.ts +118 -0
- package/src/components/_shared/resolvePreset.ts +35 -0
- package/src/hooks/Wizard/Wizard.stories.tsx +301 -0
- package/src/hooks/Wizard/WizardContext.tsx +166 -0
- package/src/hooks/Wizard/index.ts +6 -0
- package/src/hooks/Wizard/useWizard.ts +13 -0
- package/src/index.ts +17 -1
- package/src/mui.ts +44 -0
- package/src/theme/componentStyles.ts +47 -0
- package/src/theme/tokens.ts +43 -0
- package/dist/DatePicker-BSNboVhN.js +0 -201
- package/dist/DatePicker-BSNboVhN.js.map +0 -1
- package/dist/DatePicker-BoqxWAhj.cjs +0 -200
- package/dist/DatePicker-BoqxWAhj.cjs.map +0 -1
- package/dist/Input-DFHs7cJ_.js +0 -171
- package/dist/Input-DFHs7cJ_.js.map +0 -1
- package/dist/Input-c8MwNNPg.cjs +0 -170
- package/dist/Input-c8MwNNPg.cjs.map +0 -1
- package/dist/Select-BO2N56sm.cjs +0 -411
- package/dist/Select-BO2N56sm.cjs.map +0 -1
- package/dist/Select-BcLkyHSE.js +0 -412
- package/dist/Select-BcLkyHSE.js.map +0 -1
- package/dist/index.css +0 -3
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const material = require("@mui/material");
|
|
5
|
+
const useWizard = require("../../useWizard-CWdIxZzX.cjs");
|
|
5
6
|
const Stepper = ({
|
|
6
7
|
children,
|
|
7
8
|
orientation = "horizontal",
|
|
8
9
|
alternateLabel = false,
|
|
9
10
|
sx,
|
|
10
|
-
currentStep
|
|
11
|
+
currentStep: currentStepProp
|
|
11
12
|
}) => {
|
|
13
|
+
const wizard = useWizard.useWizard();
|
|
14
|
+
const currentStep = currentStepProp !== void 0 ? currentStepProp : wizard.totalSteps > 0 ? wizard.currentStep : 0;
|
|
12
15
|
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx, children: [
|
|
13
16
|
/* @__PURE__ */ jsxRuntime.jsx(material.Stepper, { activeStep: currentStep, orientation, alternativeLabel: alternateLabel, children: children.map((child, idx) => {
|
|
14
17
|
const { label, completed, disabled, className, sx: stepSx, dotColor, activeDotColor, completedDotColor, iconTextColor } = child.props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.cjs","sources":["../../../src/components/Stepper/Stepper.tsx","../../../src/components/Stepper/Step.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Stepper as MuiStepper, Step as MuiStep, StepLabel as MuiStepLabel, Box } from \"@mui/material\";\nimport { StepProps } from \"./Step\";\n\ninterface MyStepperProps {\n children: ReactElement<StepProps>[];\n orientation?: \"horizontal\" | \"vertical\";\n sx?: object;\n alternateLabel?: boolean;\n currentStep?: number;\n}\n\nexport const Stepper: React.FC<MyStepperProps> = ({\n children,\n orientation = \"horizontal\",\n alternateLabel = false,\n\n sx,\n currentStep
|
|
1
|
+
{"version":3,"file":"Stepper.cjs","sources":["../../../src/components/Stepper/Stepper.tsx","../../../src/components/Stepper/Step.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Stepper as MuiStepper, Step as MuiStep, StepLabel as MuiStepLabel, Box } from \"@mui/material\";\nimport { StepProps } from \"./Step\";\nimport { useWizard } from \"../../hooks/Wizard\";\n\ninterface MyStepperProps {\n children: ReactElement<StepProps>[];\n orientation?: \"horizontal\" | \"vertical\";\n sx?: object;\n alternateLabel?: boolean;\n /**\n * Índice 0-based del paso activo. Si no se provee, el Stepper intenta\n * leerlo del `WizardContext` (si está dentro de un `<WizardProvider>`).\n * Si tampoco hay provider, el default es 0.\n */\n currentStep?: number;\n}\n\nexport const Stepper: React.FC<MyStepperProps> = ({\n children,\n orientation = \"horizontal\",\n alternateLabel = false,\n\n sx,\n currentStep: currentStepProp,\n}) => {\n // Lee el paso desde el WizardContext cuando el consumer no lo pasa como prop.\n // Si el Stepper NO está dentro de un WizardProvider, `useWizard()` devuelve\n // el valor default (currentStep=0, totalSteps=0), así que no rompe nada.\n const wizard = useWizard();\n const currentStep =\n currentStepProp !== undefined\n ? currentStepProp\n : wizard.totalSteps > 0\n ? wizard.currentStep\n : 0;\n\n return (\n <Box sx={sx}>\n <MuiStepper activeStep={currentStep} orientation={orientation} alternativeLabel={alternateLabel} >\n {children.map((child, idx) => {\n const { label, completed, disabled, className, sx: stepSx, dotColor, activeDotColor, completedDotColor, iconTextColor } = child.props;\n return (\n <MuiStep key={idx} completed={completed} disabled={disabled} className={className} sx={stepSx}>\n <MuiStepLabel sx={{\n pointerEvents: 'none',\n \"& .MuiStepIcon-root\": {\n color: dotColor,\n },\n \"& .MuiStepIcon-active\": {\n color: activeDotColor,\n },\n \"& .MuiStepIcon-completed\": {\n color: completedDotColor,\n },\n \"& .MuiStepIcon-text\": {\n fill: iconTextColor,\n },\n }}\n >{label}\n </MuiStepLabel>\n </MuiStep>\n );\n })}\n </MuiStepper>\n <Box mt={2}>\n {children.map((child, idx) =>\n idx === currentStep ? <Box key={idx}>{child.props.children}</Box> : null\n )}\n </Box>\n </Box>\n );\n};\n\nexport default Stepper;","import React from \"react\";\nimport { StepProps as MuiStepProps } from \"@mui/material\";\n\ntype PickMuiStepProps = Pick<MuiStepProps, \"completed\" | \"disabled\" | \"sx\" | \"className\">;\n\nexport interface StepProps extends PickMuiStepProps {\n label: React.ReactNode;\n children?: React.ReactNode;\n disabled?: boolean;\n sx?: object;\n dotColor?: string; // dot base\n activeDotColor?: string; // dot activa\n completedDotColor?: string; // dot completada\n iconTextColor?: string; // número o check dentro\n}\n\nexport const Step = (_: StepProps): null => null;\n\nStep.displayName = \"Step\";\n\nexport default Step;"],"names":["useWizard","jsxs","Box","jsx","MuiStepper","MuiStep","MuiStepLabel"],"mappings":";;;;;AAkBO,MAAM,UAAoC,CAAC;AAAA,EAChD;AAAA,EACA,cAAc;AAAA,EACd,iBAAiB;AAAA,EAEjB;AAAA,EACA,aAAa;AACf,MAAM;AAIJ,QAAM,SAASA,UAAAA,UAAA;AACf,QAAM,cACJ,oBAAoB,SAChB,kBACA,OAAO,aAAa,IAClB,OAAO,cACP;AAER,SACEC,gCAACC,SAAAA,OAAI,IACH,UAAA;AAAA,IAAAC,2BAAAA,IAACC,SAAAA,SAAA,EAAW,YAAY,aAAa,aAA0B,kBAAkB,gBAC9E,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;AAC5B,YAAM,EAAE,OAAO,WAAW,UAAU,WAAW,IAAI,QAAQ,UAAU,gBAAgB,mBAAmB,cAAA,IAAkB,MAAM;AAChI,4CACGC,eAAA,EAAkB,WAAsB,UAAoB,WAAsB,IAAI,QACrF,UAAAF,2BAAAA;AAAAA,QAACG,SAAAA;AAAAA,QAAA;AAAA,UAAa,IAAI;AAAA,YAChB,eAAe;AAAA,YACf,uBAAuB;AAAA,cACrB,OAAO;AAAA,YAAA;AAAA,YAET,yBAAyB;AAAA,cACvB,OAAO;AAAA,YAAA;AAAA,YAET,4BAA4B;AAAA,cAC1B,OAAO;AAAA,YAAA;AAAA,YAET,uBAAuB;AAAA,cACrB,MAAM;AAAA,YAAA;AAAA,UACR;AAAA,UAEA,UAAA;AAAA,QAAA;AAAA,MAAA,KAhBU,GAkBd;AAAA,IAEJ,CAAC,EAAA,CACH;AAAA,IACAH,2BAAAA,IAACD,SAAAA,KAAA,EAAI,IAAI,GACN,UAAA,SAAS;AAAA,MAAI,CAAC,OAAO,QACpB,QAAQ,cAAcC,2BAAAA,IAACD,SAAAA,KAAA,EAAe,UAAA,MAAM,MAAM,SAAA,GAAlB,GAA2B,IAAS;AAAA,IAAA,EACtE,CACF;AAAA,EAAA,GACF;AAEJ;ACxDO,MAAM,OAAO,CAAC,MAAuB;AAE5C,KAAK,cAAc;;;"}
|
|
@@ -5,6 +5,11 @@ interface MyStepperProps {
|
|
|
5
5
|
orientation?: "horizontal" | "vertical";
|
|
6
6
|
sx?: object;
|
|
7
7
|
alternateLabel?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Índice 0-based del paso activo. Si no se provee, el Stepper intenta
|
|
10
|
+
* leerlo del `WizardContext` (si está dentro de un `<WizardProvider>`).
|
|
11
|
+
* Si tampoco hay provider, el default es 0.
|
|
12
|
+
*/
|
|
8
13
|
currentStep?: number;
|
|
9
14
|
}
|
|
10
15
|
export declare const Stepper: React.FC<MyStepperProps>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Stepper as Stepper$1, Step as Step$1, StepLabel } from "@mui/material";
|
|
3
|
+
import { u as useWizard } from "../../useWizard-CWq--C3o.js";
|
|
3
4
|
const Stepper = ({
|
|
4
5
|
children,
|
|
5
6
|
orientation = "horizontal",
|
|
6
7
|
alternateLabel = false,
|
|
7
8
|
sx,
|
|
8
|
-
currentStep
|
|
9
|
+
currentStep: currentStepProp
|
|
9
10
|
}) => {
|
|
11
|
+
const wizard = useWizard();
|
|
12
|
+
const currentStep = currentStepProp !== void 0 ? currentStepProp : wizard.totalSteps > 0 ? wizard.currentStep : 0;
|
|
10
13
|
return /* @__PURE__ */ jsxs(Box, { sx, children: [
|
|
11
14
|
/* @__PURE__ */ jsx(Stepper$1, { activeStep: currentStep, orientation, alternativeLabel: alternateLabel, children: children.map((child, idx) => {
|
|
12
15
|
const { label, completed, disabled, className, sx: stepSx, dotColor, activeDotColor, completedDotColor, iconTextColor } = child.props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sources":["../../../src/components/Stepper/Stepper.tsx","../../../src/components/Stepper/Step.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Stepper as MuiStepper, Step as MuiStep, StepLabel as MuiStepLabel, Box } from \"@mui/material\";\nimport { StepProps } from \"./Step\";\n\ninterface MyStepperProps {\n children: ReactElement<StepProps>[];\n orientation?: \"horizontal\" | \"vertical\";\n sx?: object;\n alternateLabel?: boolean;\n currentStep?: number;\n}\n\nexport const Stepper: React.FC<MyStepperProps> = ({\n children,\n orientation = \"horizontal\",\n alternateLabel = false,\n\n sx,\n currentStep
|
|
1
|
+
{"version":3,"file":"Stepper.js","sources":["../../../src/components/Stepper/Stepper.tsx","../../../src/components/Stepper/Step.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { Stepper as MuiStepper, Step as MuiStep, StepLabel as MuiStepLabel, Box } from \"@mui/material\";\nimport { StepProps } from \"./Step\";\nimport { useWizard } from \"../../hooks/Wizard\";\n\ninterface MyStepperProps {\n children: ReactElement<StepProps>[];\n orientation?: \"horizontal\" | \"vertical\";\n sx?: object;\n alternateLabel?: boolean;\n /**\n * Índice 0-based del paso activo. Si no se provee, el Stepper intenta\n * leerlo del `WizardContext` (si está dentro de un `<WizardProvider>`).\n * Si tampoco hay provider, el default es 0.\n */\n currentStep?: number;\n}\n\nexport const Stepper: React.FC<MyStepperProps> = ({\n children,\n orientation = \"horizontal\",\n alternateLabel = false,\n\n sx,\n currentStep: currentStepProp,\n}) => {\n // Lee el paso desde el WizardContext cuando el consumer no lo pasa como prop.\n // Si el Stepper NO está dentro de un WizardProvider, `useWizard()` devuelve\n // el valor default (currentStep=0, totalSteps=0), así que no rompe nada.\n const wizard = useWizard();\n const currentStep =\n currentStepProp !== undefined\n ? currentStepProp\n : wizard.totalSteps > 0\n ? wizard.currentStep\n : 0;\n\n return (\n <Box sx={sx}>\n <MuiStepper activeStep={currentStep} orientation={orientation} alternativeLabel={alternateLabel} >\n {children.map((child, idx) => {\n const { label, completed, disabled, className, sx: stepSx, dotColor, activeDotColor, completedDotColor, iconTextColor } = child.props;\n return (\n <MuiStep key={idx} completed={completed} disabled={disabled} className={className} sx={stepSx}>\n <MuiStepLabel sx={{\n pointerEvents: 'none',\n \"& .MuiStepIcon-root\": {\n color: dotColor,\n },\n \"& .MuiStepIcon-active\": {\n color: activeDotColor,\n },\n \"& .MuiStepIcon-completed\": {\n color: completedDotColor,\n },\n \"& .MuiStepIcon-text\": {\n fill: iconTextColor,\n },\n }}\n >{label}\n </MuiStepLabel>\n </MuiStep>\n );\n })}\n </MuiStepper>\n <Box mt={2}>\n {children.map((child, idx) =>\n idx === currentStep ? <Box key={idx}>{child.props.children}</Box> : null\n )}\n </Box>\n </Box>\n );\n};\n\nexport default Stepper;","import React from \"react\";\nimport { StepProps as MuiStepProps } from \"@mui/material\";\n\ntype PickMuiStepProps = Pick<MuiStepProps, \"completed\" | \"disabled\" | \"sx\" | \"className\">;\n\nexport interface StepProps extends PickMuiStepProps {\n label: React.ReactNode;\n children?: React.ReactNode;\n disabled?: boolean;\n sx?: object;\n dotColor?: string; // dot base\n activeDotColor?: string; // dot activa\n completedDotColor?: string; // dot completada\n iconTextColor?: string; // número o check dentro\n}\n\nexport const Step = (_: StepProps): null => null;\n\nStep.displayName = \"Step\";\n\nexport default Step;"],"names":["MuiStepper","MuiStep","MuiStepLabel"],"mappings":";;;AAkBO,MAAM,UAAoC,CAAC;AAAA,EAChD;AAAA,EACA,cAAc;AAAA,EACd,iBAAiB;AAAA,EAEjB;AAAA,EACA,aAAa;AACf,MAAM;AAIJ,QAAM,SAAS,UAAA;AACf,QAAM,cACJ,oBAAoB,SAChB,kBACA,OAAO,aAAa,IAClB,OAAO,cACP;AAER,SACE,qBAAC,OAAI,IACH,UAAA;AAAA,IAAA,oBAACA,WAAA,EAAW,YAAY,aAAa,aAA0B,kBAAkB,gBAC9E,UAAA,SAAS,IAAI,CAAC,OAAO,QAAQ;AAC5B,YAAM,EAAE,OAAO,WAAW,UAAU,WAAW,IAAI,QAAQ,UAAU,gBAAgB,mBAAmB,cAAA,IAAkB,MAAM;AAChI,iCACGC,QAAA,EAAkB,WAAsB,UAAoB,WAAsB,IAAI,QACrF,UAAA;AAAA,QAACC;AAAAA,QAAA;AAAA,UAAa,IAAI;AAAA,YAChB,eAAe;AAAA,YACf,uBAAuB;AAAA,cACrB,OAAO;AAAA,YAAA;AAAA,YAET,yBAAyB;AAAA,cACvB,OAAO;AAAA,YAAA;AAAA,YAET,4BAA4B;AAAA,cAC1B,OAAO;AAAA,YAAA;AAAA,YAET,uBAAuB;AAAA,cACrB,MAAM;AAAA,YAAA;AAAA,UACR;AAAA,UAEA,UAAA;AAAA,QAAA;AAAA,MAAA,KAhBU,GAkBd;AAAA,IAEJ,CAAC,EAAA,CACH;AAAA,IACA,oBAAC,KAAA,EAAI,IAAI,GACN,UAAA,SAAS;AAAA,MAAI,CAAC,OAAO,QACpB,QAAQ,cAAc,oBAAC,KAAA,EAAe,UAAA,MAAM,MAAM,SAAA,GAAlB,GAA2B,IAAS;AAAA,IAAA,EACtE,CACF;AAAA,EAAA,GACF;AAEJ;ACxDO,MAAM,OAAO,CAAC,MAAuB;AAE5C,KAAK,cAAc;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
export type LabelPosition = 'outside' | 'floating';
|
|
3
|
+
export interface BuildFormFieldSxOptions {
|
|
4
|
+
borderRadius: number | string;
|
|
5
|
+
labelPosition: LabelPosition;
|
|
6
|
+
/**
|
|
7
|
+
* Si es `true`, los selectores incluyen también la API nueva de MUI X
|
|
8
|
+
* Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.
|
|
9
|
+
*/
|
|
10
|
+
includePickersApi?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.
|
|
13
|
+
* Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).
|
|
14
|
+
*/
|
|
15
|
+
extraOutsideSx?: Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.
|
|
18
|
+
*/
|
|
19
|
+
extraFloatingSx?: Record<string, any>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Builder del sx compartido por todos los campos de formulario
|
|
23
|
+
* (Input/Select/Autocomplete/DatePicker/DateTimePicker).
|
|
24
|
+
*
|
|
25
|
+
* Produce:
|
|
26
|
+
* - en modo "floating": sólo el border-radius del outlined input;
|
|
27
|
+
* - en modo "outside": todo el pack (margen superior, label flotante afuera,
|
|
28
|
+
* input base, notched outline oculto, helper text sin margen izquierdo).
|
|
29
|
+
*
|
|
30
|
+
* Componentes con paddings o selectores propios pueden inyectarlos vía
|
|
31
|
+
* `extraOutsideSx` / `extraFloatingSx`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const buildFormFieldSx: ({ borderRadius, labelPosition, includePickersApi, extraOutsideSx, extraFloatingSx, }: BuildFormFieldSxOptions) => SxProps<Theme>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
import { LibraryComponentName } from '../../theme/componentStyles';
|
|
3
|
+
/**
|
|
4
|
+
* Nombre del preset built-in del paquete. No se registra en el theme: si un
|
|
5
|
+
* componente recibe `preset="default"` (o no recibe preset), sólo aplica el
|
|
6
|
+
* estilo base de fábrica.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_PRESET_NAME = "default";
|
|
9
|
+
/**
|
|
10
|
+
* Resuelve el sx de un preset registrado en `theme.styles[componentName]`.
|
|
11
|
+
*
|
|
12
|
+
* - Si `presetName` es `"default"` o `undefined`, devuelve `undefined`
|
|
13
|
+
* (caller sólo aplicará el estilo base del paquete).
|
|
14
|
+
* - Si la entrada en el theme es una función `(theme) => sx`, se ejecuta.
|
|
15
|
+
* - Si la entrada no existe, devuelve `undefined` silenciosamente (no se
|
|
16
|
+
* rompe el componente — la responsabilidad de registrarlo es del consumer).
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolvePreset(componentName: LibraryComponentName, presetName: string | undefined, theme: Theme): SxProps<Theme> | undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
18
|
+
const LABEL_MARGIN_TOP = "14px";
|
|
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;
|
|
27
|
+
const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
28
|
+
const buildFormFieldSx = ({
|
|
29
|
+
borderRadius,
|
|
30
|
+
labelPosition,
|
|
31
|
+
includePickersApi = false,
|
|
32
|
+
extraOutsideSx,
|
|
33
|
+
extraFloatingSx
|
|
34
|
+
}) => {
|
|
35
|
+
const radius = toRadius(borderRadius);
|
|
36
|
+
const outlinedRootSelector = includePickersApi ? "& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root" : "& .MuiOutlinedInput-root";
|
|
37
|
+
const inputBaseSelector = includePickersApi ? "& .MuiInputBase-root, & .MuiPickersInputBase-root" : "& .MuiInputBase-root";
|
|
38
|
+
const notchedOutlineSelector = includePickersApi ? "& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline" : "& .MuiOutlinedInput-notchedOutline";
|
|
39
|
+
if (labelPosition === "floating") {
|
|
40
|
+
return __spreadValues({
|
|
41
|
+
[outlinedRootSelector]: { borderRadius: radius }
|
|
42
|
+
}, extraFloatingSx != null ? extraFloatingSx : {});
|
|
43
|
+
}
|
|
44
|
+
return __spreadValues({
|
|
45
|
+
marginTop: LABEL_MARGIN_TOP,
|
|
46
|
+
"& .MuiInputLabel-root": {
|
|
47
|
+
color: LABEL_COLOR_REST,
|
|
48
|
+
transition: LABEL_TRANSITION,
|
|
49
|
+
// Estado shrunk (focused o con valor): flota ARRIBA del input.
|
|
50
|
+
"&.MuiInputLabel-shrink": {
|
|
51
|
+
transform: LABEL_SHRINK_TRANSFORM,
|
|
52
|
+
transformOrigin: LABEL_TRANSFORM_ORIGIN,
|
|
53
|
+
color: LABEL_COLOR_FILLED,
|
|
54
|
+
fontWeight: LABEL_FONT_WEIGHT_FILLED
|
|
55
|
+
},
|
|
56
|
+
"&.Mui-focused": { color: LABEL_COLOR_FOCUSED }
|
|
57
|
+
},
|
|
58
|
+
// Input base — centra verticalmente (clásico y, si aplica, pickers).
|
|
59
|
+
[inputBaseSelector]: {
|
|
60
|
+
borderRadius: radius,
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center"
|
|
63
|
+
},
|
|
64
|
+
// El label flota afuera: ocultar legend del notch.
|
|
65
|
+
[notchedOutlineSelector]: {
|
|
66
|
+
top: 0,
|
|
67
|
+
"& legend": { display: "none" }
|
|
68
|
+
},
|
|
69
|
+
"& .MuiFormHelperText-root": {
|
|
70
|
+
marginLeft: 0
|
|
71
|
+
}
|
|
72
|
+
}, extraOutsideSx != null ? extraOutsideSx : {});
|
|
73
|
+
};
|
|
74
|
+
exports.FIELD_INPUT_PADDING_Y = FIELD_INPUT_PADDING_Y;
|
|
75
|
+
exports.buildFormFieldSx = buildFormFieldSx;
|
|
76
|
+
//# sourceMappingURL=formField.sx-CQ1mbk9M.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formField.sx-CQ1mbk9M.cjs","sources":["../src/theme/tokens.ts","../src/components/_shared/formField.sx.ts"],"sourcesContent":["/**\n * Design tokens compartidos por los componentes de formulario\n * (Input, Select, Autocomplete, DatePicker, DateTimePicker).\n *\n * Centralizar estos valores garantiza que:\n * - el espaciado, la tipografía y las animaciones del label sean idénticos\n * en todos los campos;\n * - un cambio visual global (p.ej. cambiar el transform del shrink) se haga\n * en un único archivo.\n */\n\n// ── Spacing ──────────────────────────────────────────────────────────────\n/** Margen superior que deja el aire para el label flotante \"outside\". */\nexport const LABEL_MARGIN_TOP = '14px';\n\n/** Padding vertical interno del input (TextField/Select/Picker sections). */\nexport const FIELD_INPUT_PADDING_Y = '8.5px';\n\n// ── Label animation ──────────────────────────────────────────────────────\n/** Transform que aplica el label cuando sube arriba del input (shrink). */\nexport const LABEL_SHRINK_TRANSFORM = 'translate(4px, -22px) scale(0.85)';\n\n/** Origen del transform para el shrink. */\nexport const LABEL_TRANSFORM_ORIGIN = 'top left';\n\n/** Transición del label (color + transform + max-width). */\nexport const LABEL_TRANSITION =\n 'color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +\n 'transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +\n 'max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms';\n\n// ── Label colors (theme-aware) ───────────────────────────────────────────\n/** Color del label en reposo. */\nexport const LABEL_COLOR_REST = 'text.secondary';\n\n/** Color del label cuando el campo tiene valor (shrink). */\nexport const LABEL_COLOR_FILLED = 'text.primary';\n\n/** Color del label cuando el campo está focused. */\nexport const LABEL_COLOR_FOCUSED = 'primary.main';\n\n/** Peso del label cuando sube (filled/focused). */\nexport const LABEL_FONT_WEIGHT_FILLED = 500;\n","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":";;;;;;;;;;;;;;;;;AAaO,MAAM,mBAAmB;AAGzB,MAAM,wBAAwB;AAI9B,MAAM,yBAAyB;AAG/B,MAAM,yBAAyB;AAG/B,MAAM,mBACX;AAMK,MAAM,mBAAmB;AAGzB,MAAM,qBAAqB;AAG3B,MAAM,sBAAsB;AAG5B,MAAM,2BAA2B;ACRxC,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;;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const LABEL_MARGIN_TOP = "14px";
|
|
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;
|
|
26
|
+
const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
27
|
+
const buildFormFieldSx = ({
|
|
28
|
+
borderRadius,
|
|
29
|
+
labelPosition,
|
|
30
|
+
includePickersApi = false,
|
|
31
|
+
extraOutsideSx,
|
|
32
|
+
extraFloatingSx
|
|
33
|
+
}) => {
|
|
34
|
+
const radius = toRadius(borderRadius);
|
|
35
|
+
const outlinedRootSelector = includePickersApi ? "& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root" : "& .MuiOutlinedInput-root";
|
|
36
|
+
const inputBaseSelector = includePickersApi ? "& .MuiInputBase-root, & .MuiPickersInputBase-root" : "& .MuiInputBase-root";
|
|
37
|
+
const notchedOutlineSelector = includePickersApi ? "& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline" : "& .MuiOutlinedInput-notchedOutline";
|
|
38
|
+
if (labelPosition === "floating") {
|
|
39
|
+
return __spreadValues({
|
|
40
|
+
[outlinedRootSelector]: { borderRadius: radius }
|
|
41
|
+
}, extraFloatingSx != null ? extraFloatingSx : {});
|
|
42
|
+
}
|
|
43
|
+
return __spreadValues({
|
|
44
|
+
marginTop: LABEL_MARGIN_TOP,
|
|
45
|
+
"& .MuiInputLabel-root": {
|
|
46
|
+
color: LABEL_COLOR_REST,
|
|
47
|
+
transition: LABEL_TRANSITION,
|
|
48
|
+
// Estado shrunk (focused o con valor): flota ARRIBA del input.
|
|
49
|
+
"&.MuiInputLabel-shrink": {
|
|
50
|
+
transform: LABEL_SHRINK_TRANSFORM,
|
|
51
|
+
transformOrigin: LABEL_TRANSFORM_ORIGIN,
|
|
52
|
+
color: LABEL_COLOR_FILLED,
|
|
53
|
+
fontWeight: LABEL_FONT_WEIGHT_FILLED
|
|
54
|
+
},
|
|
55
|
+
"&.Mui-focused": { color: LABEL_COLOR_FOCUSED }
|
|
56
|
+
},
|
|
57
|
+
// Input base — centra verticalmente (clásico y, si aplica, pickers).
|
|
58
|
+
[inputBaseSelector]: {
|
|
59
|
+
borderRadius: radius,
|
|
60
|
+
display: "flex",
|
|
61
|
+
alignItems: "center"
|
|
62
|
+
},
|
|
63
|
+
// El label flota afuera: ocultar legend del notch.
|
|
64
|
+
[notchedOutlineSelector]: {
|
|
65
|
+
top: 0,
|
|
66
|
+
"& legend": { display: "none" }
|
|
67
|
+
},
|
|
68
|
+
"& .MuiFormHelperText-root": {
|
|
69
|
+
marginLeft: 0
|
|
70
|
+
}
|
|
71
|
+
}, extraOutsideSx != null ? extraOutsideSx : {});
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
FIELD_INPUT_PADDING_Y as F,
|
|
75
|
+
buildFormFieldSx as b
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=formField.sx-DfVbMe0V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formField.sx-DfVbMe0V.js","sources":["../src/theme/tokens.ts","../src/components/_shared/formField.sx.ts"],"sourcesContent":["/**\n * Design tokens compartidos por los componentes de formulario\n * (Input, Select, Autocomplete, DatePicker, DateTimePicker).\n *\n * Centralizar estos valores garantiza que:\n * - el espaciado, la tipografía y las animaciones del label sean idénticos\n * en todos los campos;\n * - un cambio visual global (p.ej. cambiar el transform del shrink) se haga\n * en un único archivo.\n */\n\n// ── Spacing ──────────────────────────────────────────────────────────────\n/** Margen superior que deja el aire para el label flotante \"outside\". */\nexport const LABEL_MARGIN_TOP = '14px';\n\n/** Padding vertical interno del input (TextField/Select/Picker sections). */\nexport const FIELD_INPUT_PADDING_Y = '8.5px';\n\n// ── Label animation ──────────────────────────────────────────────────────\n/** Transform que aplica el label cuando sube arriba del input (shrink). */\nexport const LABEL_SHRINK_TRANSFORM = 'translate(4px, -22px) scale(0.85)';\n\n/** Origen del transform para el shrink. */\nexport const LABEL_TRANSFORM_ORIGIN = 'top left';\n\n/** Transición del label (color + transform + max-width). */\nexport const LABEL_TRANSITION =\n 'color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +\n 'transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +\n 'max-width 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms';\n\n// ── Label colors (theme-aware) ───────────────────────────────────────────\n/** Color del label en reposo. */\nexport const LABEL_COLOR_REST = 'text.secondary';\n\n/** Color del label cuando el campo tiene valor (shrink). */\nexport const LABEL_COLOR_FILLED = 'text.primary';\n\n/** Color del label cuando el campo está focused. */\nexport const LABEL_COLOR_FOCUSED = 'primary.main';\n\n/** Peso del label cuando sube (filled/focused). */\nexport const LABEL_FONT_WEIGHT_FILLED = 500;\n","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":";;;;;;;;;;;;;;;;AAaO,MAAM,mBAAmB;AAGzB,MAAM,wBAAwB;AAI9B,MAAM,yBAAyB;AAG/B,MAAM,yBAAyB;AAG/B,MAAM,mBACX;AAMK,MAAM,mBAAmB;AAGzB,MAAM,qBAAqB;AAG3B,MAAM,sBAAsB;AAG5B,MAAM,2BAA2B;ACRxC,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;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const useWizard = require("../../useWizard-CWdIxZzX.cjs");
|
|
4
|
+
exports.WizardContext = useWizard.WizardContext;
|
|
5
|
+
exports.WizardProvider = useWizard.WizardProvider;
|
|
6
|
+
exports.useWizard = useWizard.useWizard;
|
|
7
|
+
//# sourceMappingURL=Wizard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wizard.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { default as React, FC, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* API expuesta por `useWizard()`.
|
|
4
|
+
*
|
|
5
|
+
* Nota de retro-compatibilidad: los nombres `submitStep`, `nextStep`,
|
|
6
|
+
* `prevStep`, `goToStep` se mantienen idénticos al `WizardContext` de
|
|
7
|
+
* `@soyfri/fri-web-components` para que consumers migrando no tengan que
|
|
8
|
+
* cambiar sus llamadas. Se agregan campos extra opcionales que antes no
|
|
9
|
+
* existían (`currentStep`, `totalSteps`, `isFirst`, `isLast`, `completed`).
|
|
10
|
+
*/
|
|
11
|
+
export interface WizardContextValue {
|
|
12
|
+
/** Índice del paso actual (0-based). */
|
|
13
|
+
currentStep: number;
|
|
14
|
+
/** Total de pasos del wizard. */
|
|
15
|
+
totalSteps: number;
|
|
16
|
+
/** True si `currentStep === 0`. */
|
|
17
|
+
isFirst: boolean;
|
|
18
|
+
/** True si `currentStep === totalSteps - 1`. */
|
|
19
|
+
isLast: boolean;
|
|
20
|
+
/** True tras ejecutar `submitStep()` desde el último paso. */
|
|
21
|
+
completed: boolean;
|
|
22
|
+
/** Avanza al siguiente paso (no pasa de `totalSteps - 1`). */
|
|
23
|
+
nextStep: () => void;
|
|
24
|
+
/** Retrocede al paso anterior (no baja de 0). */
|
|
25
|
+
prevStep: () => void;
|
|
26
|
+
/** Salta a un paso específico (0-based). No-op si fuera de rango. */
|
|
27
|
+
goToStep: (stepNumber: number) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Envía el wizard. Marca `completed = true` y dispara el callback
|
|
30
|
+
* `onSubmit` del provider. En el último paso suele reemplazar a `nextStep`.
|
|
31
|
+
*/
|
|
32
|
+
submitStep: () => void;
|
|
33
|
+
/** Resetea el wizard al paso inicial y limpia `completed`. */
|
|
34
|
+
reset: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const WizardContext: React.Context<WizardContextValue>;
|
|
37
|
+
export interface WizardProviderProps {
|
|
38
|
+
/** Número total de pasos del wizard. Requerido. */
|
|
39
|
+
totalSteps: number;
|
|
40
|
+
/** Paso inicial (0-based). Default: 0. */
|
|
41
|
+
initialStep?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Callback disparado cuando se llama `submitStep()`. Recibe el paso actual.
|
|
44
|
+
* El paquete NO ejecuta ninguna petición; queda a cargo del consumer.
|
|
45
|
+
*/
|
|
46
|
+
onSubmit?: (currentStep: number) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Callback disparado en cada cambio de paso (next/prev/goTo).
|
|
49
|
+
* Útil para tracking o validaciones externas.
|
|
50
|
+
*/
|
|
51
|
+
onStepChange?: (newStep: number, prevStep: number) => void;
|
|
52
|
+
children?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Provider del wizard. Administra el `currentStep` internamente. El consumer
|
|
56
|
+
* no necesita gestionar estado — sólo consumirlo con `useWizard()` desde
|
|
57
|
+
* cualquier descendiente.
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <WizardProvider totalSteps={3} onSubmit={handleFinalSubmit}>
|
|
61
|
+
* <Stepper ... />
|
|
62
|
+
* <StepContent />
|
|
63
|
+
* <WizardControls />
|
|
64
|
+
* </WizardProvider>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare const WizardProvider: FC<WizardProviderProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WizardContextValue } from './WizardContext';
|
|
2
|
+
/**
|
|
3
|
+
* Hook para consumir el `WizardContext` desde cualquier descendiente de
|
|
4
|
+
* `<WizardProvider>`.
|
|
5
|
+
*
|
|
6
|
+
* Si se llama fuera de un provider, devuelve los valores por defecto (no-op)
|
|
7
|
+
* para mantener compatibilidad con el hook original de fri-web-components.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useWizard(): WizardContextValue;
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require('./styles.css');;/* empty css */
|
|
4
|
+
const resolvePreset = require("./resolvePreset-CT3kU-K2.cjs");
|
|
5
|
+
const material = require("@mui/material");
|
|
6
|
+
exports.DEFAULT_PRESET_NAME = resolvePreset.DEFAULT_PRESET_NAME;
|
|
7
|
+
exports.resolvePreset = resolvePreset.resolvePreset;
|
|
8
|
+
Object.defineProperty(exports, "Alert", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: () => material.Alert
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AlertTitle", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => material.AlertTitle
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "Backdrop", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => material.Backdrop
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "Box", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: () => material.Box
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CircularProgress", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: () => material.CircularProgress
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "Collapse", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: () => material.Collapse
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "Container", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: () => material.Container
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "Divider", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: () => material.Divider
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "Fade", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: () => material.Fade
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "Grid", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: () => material.Grid
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "Grow", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: () => material.Grow
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "LinearProgress", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: () => material.LinearProgress
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "Link", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: () => material.Link
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "Paper", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: () => material.Paper
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "Skeleton", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: () => material.Skeleton
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "Snackbar", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: () => material.Snackbar
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "Stack", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: () => material.Stack
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "Typography", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: () => material.Typography
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "Zoom", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: () => material.Zoom
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "alpha", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: () => material.alpha
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "styled", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: () => material.styled
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "useMediaQuery", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: () => material.useMediaQuery
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "useTheme", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: () => material.useTheme
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import './styles.css';/* empty css */
|
|
2
|
+
import { D, r } from "./resolvePreset-B-IB0ehH.js";
|
|
3
|
+
import { Alert, AlertTitle, Backdrop, Box, CircularProgress, Collapse, Container, Divider, Fade, Grid, Grow, LinearProgress, Link, Paper, Skeleton, Snackbar, Stack, Typography, Zoom, alpha, styled, useMediaQuery, useTheme } from "@mui/material";
|
|
4
|
+
export {
|
|
5
|
+
Alert,
|
|
6
|
+
AlertTitle,
|
|
7
|
+
Backdrop,
|
|
8
|
+
Box,
|
|
9
|
+
CircularProgress,
|
|
10
|
+
Collapse,
|
|
11
|
+
Container,
|
|
12
|
+
D as DEFAULT_PRESET_NAME,
|
|
13
|
+
Divider,
|
|
14
|
+
Fade,
|
|
15
|
+
Grid,
|
|
16
|
+
Grow,
|
|
17
|
+
LinearProgress,
|
|
18
|
+
Link,
|
|
19
|
+
Paper,
|
|
20
|
+
Skeleton,
|
|
21
|
+
Snackbar,
|
|
22
|
+
Stack,
|
|
23
|
+
Typography,
|
|
24
|
+
Zoom,
|
|
25
|
+
alpha,
|
|
26
|
+
r as resolvePreset,
|
|
27
|
+
styled,
|
|
28
|
+
useMediaQuery,
|
|
29
|
+
useTheme
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/mui.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Box, Stack, Grid, Container, Paper, Divider, } from '@mui/material';
|
|
2
|
+
export { Typography, Link } from '@mui/material';
|
|
3
|
+
export { CircularProgress, LinearProgress, Skeleton, Alert, AlertTitle, Snackbar, Backdrop, Fade, Grow, Zoom, Collapse, } from '@mui/material';
|
|
4
|
+
export { useTheme, useMediaQuery, alpha, styled } from '@mui/material';
|
|
5
|
+
export type { SxProps, Theme } from '@mui/material/styles';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const DEFAULT_PRESET_NAME = "default";
|
|
2
|
+
function resolvePreset(componentName, presetName, theme) {
|
|
3
|
+
var _a;
|
|
4
|
+
if (!presetName || presetName === DEFAULT_PRESET_NAME) return void 0;
|
|
5
|
+
const componentPresets = (_a = theme.styles) == null ? void 0 : _a[componentName];
|
|
6
|
+
if (!componentPresets) return void 0;
|
|
7
|
+
const entry = componentPresets[presetName];
|
|
8
|
+
if (!entry) return void 0;
|
|
9
|
+
return typeof entry === "function" ? entry(theme) : entry;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
DEFAULT_PRESET_NAME as D,
|
|
13
|
+
resolvePreset as r
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=resolvePreset-B-IB0ehH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePreset-B-IB0ehH.js","sources":["../src/components/_shared/resolvePreset.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport type { LibraryComponentName, PresetStyle } from '../../theme/componentStyles';\n\n/**\n * Nombre del preset built-in del paquete. No se registra en el theme: si un\n * componente recibe `preset=\"default\"` (o no recibe preset), sólo aplica el\n * estilo base de fábrica.\n */\nexport const DEFAULT_PRESET_NAME = 'default';\n\n/**\n * Resuelve el sx de un preset registrado en `theme.styles[componentName]`.\n *\n * - Si `presetName` es `\"default\"` o `undefined`, devuelve `undefined`\n * (caller sólo aplicará el estilo base del paquete).\n * - Si la entrada en el theme es una función `(theme) => sx`, se ejecuta.\n * - Si la entrada no existe, devuelve `undefined` silenciosamente (no se\n * rompe el componente — la responsabilidad de registrarlo es del consumer).\n */\nexport function resolvePreset(\n componentName: LibraryComponentName,\n presetName: string | undefined,\n theme: Theme,\n): SxProps<Theme> | undefined {\n if (!presetName || presetName === DEFAULT_PRESET_NAME) return undefined;\n\n const componentPresets = theme.styles?.[componentName];\n if (!componentPresets) return undefined;\n\n const entry: PresetStyle | undefined = componentPresets[presetName];\n if (!entry) return undefined;\n\n return typeof entry === 'function' ? entry(theme) : entry;\n}\n"],"names":[],"mappings":"AASO,MAAM,sBAAsB;AAW5B,SAAS,cACd,eACA,YACA,OAC4B;AAfvB;AAgBL,MAAI,CAAC,cAAc,eAAe,oBAAqB,QAAO;AAE9D,QAAM,oBAAmB,WAAM,WAAN,mBAAe;AACxC,MAAI,CAAC,iBAAkB,QAAO;AAE9B,QAAM,QAAiC,iBAAiB,UAAU;AAClE,MAAI,CAAC,MAAO,QAAO;AAEnB,SAAO,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AACtD;"}
|