@soyfri/shared-library 2.0.0-beta.16 → 2.0.0-beta.18
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/.dockerignore +8 -0
- package/.github/workflows/publish.yml +107 -0
- package/.prettierrc +3 -0
- package/.storybook/main.ts +19 -0
- package/.storybook/preview.ts +14 -0
- package/.storybook/vitest.setup.ts +9 -0
- package/Dockerfile +37 -0
- package/build.js +117 -0
- package/chromatic.config.json +5 -0
- package/cleanDirectories.js +40 -0
- package/{Autocomplete-4i0dNDKr.cjs → dist/Autocomplete-DBWWcKQO.cjs} +5 -4
- package/dist/Autocomplete-DBWWcKQO.cjs.map +1 -0
- package/{Autocomplete-i3-V38n1.js → dist/Autocomplete-QTPCObBL.js} +5 -4
- package/dist/Autocomplete-QTPCObBL.js.map +1 -0
- package/{DatePicker-CtCFqXDw.cjs → dist/DatePicker-CUHUAzW4.cjs} +5 -4
- package/dist/DatePicker-CUHUAzW4.cjs.map +1 -0
- package/{DatePicker-D0Bz9Ryg.js → dist/DatePicker-kWjQEXIQ.js} +5 -4
- package/dist/DatePicker-kWjQEXIQ.js.map +1 -0
- package/{DateTimePicker-CTnRQCZo.cjs → dist/DateTimePicker-AVmtL4vS.cjs} +5 -4
- package/dist/DateTimePicker-AVmtL4vS.cjs.map +1 -0
- package/{DateTimePicker-77w-9TP5.js → dist/DateTimePicker-BO76eZ0P.js} +5 -4
- package/dist/DateTimePicker-BO76eZ0P.js.map +1 -0
- package/{Input-jYapjJYM.cjs → dist/Input-5VGBxiO2.cjs} +5 -4
- package/dist/Input-5VGBxiO2.cjs.map +1 -0
- package/{Input-rVVhI_wk.js → dist/Input-BVaetLBc.js} +5 -4
- package/dist/Input-BVaetLBc.js.map +1 -0
- package/dist/README.md +243 -0
- package/{Select-bSVQokFX.js → dist/Select-8fFMOx-I.js} +4 -4
- package/dist/Select-8fFMOx-I.js.map +1 -0
- package/{Select-B6jE3WH_.cjs → dist/Select-DyWV0aL9.cjs} +4 -4
- package/dist/Select-DyWV0aL9.cjs.map +1 -0
- package/{components → dist/components}/Autocomplete/Autocomplete.cjs +1 -1
- package/{components → dist/components}/Autocomplete/Autocomplete.js +1 -1
- package/{components → dist/components}/Autocomplete/Autocomplete.sx.d.ts +1 -1
- package/{components → dist/components}/DatePicker/DatePicker.cjs +1 -1
- package/{components → dist/components}/DatePicker/DatePicker.js +1 -1
- package/{components → dist/components}/DatePicker/DatePicker.sx.d.ts +1 -1
- package/{components → dist/components}/DateTimePicker/DateTimePicker.cjs +1 -1
- package/{components → dist/components}/DateTimePicker/DateTimePicker.js +1 -1
- package/{components → dist/components}/DateTimePicker/DateTimePicker.sx.d.ts +1 -1
- package/{components → dist/components}/Input/Input.cjs +1 -1
- package/{components → dist/components}/Input/Input.js +1 -1
- package/{components → dist/components}/Input/Input.sx.d.ts +1 -1
- package/{components → dist/components}/Select/Select.cjs +1 -1
- package/{components → dist/components}/Select/Select.js +1 -1
- package/{components → dist/components}/Select/Select.sx.d.ts +1 -1
- package/{components → dist/components}/_shared/formField.sx.d.ts +11 -1
- package/{formField.sx-8_QRnKxv.js → dist/formField.sx-Cmhj9iGb.js} +15 -15
- package/dist/formField.sx-Cmhj9iGb.js.map +1 -0
- package/{formField.sx-BAX7KwMR.cjs → dist/formField.sx-V9PLO0wv.cjs} +15 -15
- package/dist/formField.sx-V9PLO0wv.cjs.map +1 -0
- package/{index.cjs → dist/index.cjs} +5 -7
- package/{index.cjs.map → dist/index.cjs.map} +1 -1
- package/{index.d.ts → dist/index.d.ts} +0 -1
- package/{index.js → dist/index.js} +6 -8
- package/{index.js.map → dist/index.js.map} +1 -1
- package/dist/package.json +190 -0
- package/package.json +57 -171
- package/rollup.config.cjs +87 -0
- package/scripts/gen-dist-pkg.mjs +15 -0
- package/shared-library-comercios-MUI.code-workspace +10 -0
- package/src/components/ActionMenu/ActionMenu.stories.tsx +427 -0
- package/src/components/ActionMenu/ActionMenu.tsx +153 -0
- package/src/components/ActionMenu/index.ts +2 -0
- package/src/components/AppBar/AppBar.stories.tsx +316 -0
- package/src/components/AppBar/AppBar.sx.ts +32 -0
- package/src/components/AppBar/AppBar.tsx +119 -0
- package/src/components/AppBar/AppBarContext.ts +25 -0
- package/src/components/AppBar/AppBarMenuToggle.tsx +90 -0
- package/src/components/AppBar/index.ts +12 -0
- package/src/components/Autocomplete/Autocomplete.definitions.ts +477 -0
- package/src/components/Autocomplete/Autocomplete.helpers.ts +80 -0
- package/src/components/Autocomplete/Autocomplete.stories.tsx +784 -0
- package/src/components/Autocomplete/Autocomplete.sx.ts +32 -0
- package/src/components/Autocomplete/Autocomplete.tsx +394 -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 +29 -0
- package/src/components/Autocomplete/index.ts +12 -0
- package/src/components/Avatar/Avatar.definitions.ts +162 -0
- package/src/components/Avatar/Avatar.stories.tsx +258 -0
- package/src/components/Avatar/Avatar.tsx +206 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Button/Button.definition.ts +97 -0
- package/src/components/Button/Button.stories.tsx +285 -0
- package/src/components/Button/Button.tsx +66 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.definition.ts +5 -0
- package/src/components/Card/Card.stories.tsx +102 -0
- package/src/components/Card/Card.sx.ts +58 -0
- package/src/components/Card/Card.tsx +85 -0
- package/src/components/Card/index.ts +4 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +212 -0
- package/src/components/Checkbox/Checkbox.sx.ts +67 -0
- package/src/components/Checkbox/Checkbox.tsx +208 -0
- package/src/components/Checkbox/index.ts +10 -0
- package/src/components/Chip/Chip.definitions.ts +167 -0
- package/src/components/Chip/Chip.stories.tsx +265 -0
- package/src/components/Chip/Chip.tsx +61 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/Column/Column.tsx +29 -0
- package/src/components/Column/index.ts +2 -0
- package/src/components/DatePicker/DatePicker.definitions.ts +228 -0
- package/src/components/DatePicker/DatePicker.helpers.ts +24 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +309 -0
- package/src/components/DatePicker/DatePicker.sx.ts +35 -0
- package/src/components/DatePicker/DatePicker.tsx +134 -0
- package/src/components/DatePicker/index.ts +7 -0
- package/src/components/DateTimePicker/DateTimePicker.definitions.ts +317 -0
- package/src/components/DateTimePicker/DateTimePicker.helpers.ts +45 -0
- package/src/components/DateTimePicker/DateTimePicker.stories.tsx +415 -0
- package/src/components/DateTimePicker/DateTimePicker.sx.ts +32 -0
- package/src/components/DateTimePicker/DateTimePicker.tsx +241 -0
- package/src/components/DateTimePicker/index.ts +9 -0
- package/src/components/Drawer/Drawer.stories.tsx +438 -0
- package/src/components/Drawer/Drawer.sx.ts +106 -0
- package/src/components/Drawer/Drawer.tsx +224 -0
- package/src/components/Drawer/DrawerContext.ts +26 -0
- package/src/components/Drawer/DrawerItem.tsx +120 -0
- package/src/components/Drawer/index.ts +10 -0
- package/src/components/Flyout/Flyout.stories.tsx +282 -0
- package/src/components/Flyout/Flyout.tsx +122 -0
- package/src/components/Flyout/index.ts +1 -0
- package/src/components/Gallery/Gallery.definition.tsx +37 -0
- package/src/components/Gallery/Gallery.stories.tsx +82 -0
- package/src/components/Gallery/Gallery.tsx +158 -0
- package/src/components/Gallery/GalleryLightbox.tsx +186 -0
- package/src/components/Gallery/GalleryMain.tsx +87 -0
- package/src/components/Gallery/GalleryThumbnails.tsx +122 -0
- package/src/components/Gallery/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +121 -0
- package/src/components/Icon/Icon.tsx +163 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Input/Input.definitions.ts +348 -0
- package/src/components/Input/Input.helpers.ts +50 -0
- package/src/components/Input/Input.stories.tsx +528 -0
- package/src/components/Input/Input.sx.ts +44 -0
- package/src/components/Input/Input.tsx +163 -0
- package/src/components/Input/index.ts +10 -0
- package/src/components/InputGroup/InputGroup.definitions.ts +158 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +267 -0
- package/src/components/InputGroup/InputGroup.tsx +180 -0
- package/src/components/InputGroup/index.ts +2 -0
- package/src/components/MenuButton/MenuButton.stories.tsx +197 -0
- package/src/components/MenuButton/MenuButton.tsx +100 -0
- package/src/components/MenuButton/index.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +721 -0
- package/src/components/Modal/Modal.tsx +407 -0
- package/src/components/Modal/ModalBody.tsx +23 -0
- package/src/components/Modal/ModalFooter.tsx +83 -0
- package/src/components/Modal/ModalHeader.tsx +33 -0
- package/src/components/Modal/index.ts +11 -0
- package/src/components/RadioGroup/RadioGroup.definitions.ts +177 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +231 -0
- package/src/components/RadioGroup/RadioGroup.sx.ts +75 -0
- package/src/components/RadioGroup/RadioGroup.tsx +207 -0
- package/src/components/RadioGroup/index.ts +10 -0
- package/src/components/Select/Select.helpers.ts +31 -0
- package/src/components/Select/Select.stories.tsx +393 -0
- package/src/components/Select/Select.sx.ts +15 -0
- package/src/components/Select/Select.tsx +328 -0
- package/src/components/Select/_parts/SelectMenuItem.tsx +40 -0
- package/src/components/Select/_parts/SelectValue.tsx +95 -0
- package/src/components/Select/index.ts +12 -0
- package/src/components/Stat/Stat.stories.tsx +85 -0
- package/src/components/Stat/Stat.tsx +117 -0
- package/src/components/Stat/index.ts +2 -0
- package/src/components/StatusMessage/StatusMessage.stories.tsx +159 -0
- package/src/components/StatusMessage/StatusMessage.tsx +143 -0
- package/src/components/StatusMessage/index.ts +3 -0
- package/src/components/Stepper/Step.tsx +21 -0
- package/src/components/Stepper/Stepper.definition.ts +75 -0
- package/src/components/Stepper/Stepper.stories.tsx +194 -0
- package/src/components/Stepper/Stepper.tsx +194 -0
- package/src/components/Stepper/StepperContext.tsx +176 -0
- package/src/components/Stepper/StepperProvider.stories.tsx +286 -0
- package/src/components/Stepper/_hooks/useHorizontalScroll.ts +56 -0
- package/src/components/Stepper/_parts/StepperScrollArrow.tsx +50 -0
- package/src/components/Stepper/index.ts +15 -0
- package/src/components/Switch/Switch.definitions.ts +134 -0
- package/src/components/Switch/Switch.stories.tsx +213 -0
- package/src/components/Switch/Switch.sx.ts +81 -0
- package/src/components/Switch/Switch.tsx +188 -0
- package/src/components/Switch/Switch.types.ts +10 -0
- package/src/components/Switch/index.ts +9 -0
- package/src/components/Table/EmptyTable.png +0 -0
- package/src/components/Table/Table.definition.ts +580 -0
- package/src/components/Table/Table.stories.tsx +853 -0
- package/src/components/Table/Table.tsx +494 -0
- package/src/components/Table/data.ts +134 -0
- package/src/components/Table/exportsUtils.ts +195 -0
- package/src/components/Table/index.ts +3 -0
- package/src/components/Table/types.ts +34 -0
- package/src/components/Tabs/Tab.definition.ts +53 -0
- package/src/components/Tabs/Tab.tsx +19 -0
- package/src/components/Tabs/Tabs.stories.tsx +118 -0
- package/src/components/Tabs/Tabs.tsx +163 -0
- package/src/components/Tabs/_tabUtils.tsx +4 -0
- package/src/components/Tabs/index.ts +5 -0
- package/src/components/Timeline/Timeline.definition.ts +43 -0
- package/src/components/Timeline/Timeline.stories.tsx +108 -0
- package/src/components/Timeline/Timeline.tsx +44 -0
- package/src/components/Timeline/TimelineItem.tsx +31 -0
- package/src/components/Timeline/index.ts +5 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +129 -0
- package/src/components/Tooltip/Tooltip.tsx +58 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/_shared/formField.sx.ts +134 -0
- package/src/components/_shared/mergeSx.ts +16 -0
- package/src/components/_shared/resolvePreset.ts +38 -0
- package/src/hooks/ClipBoard/ClipBoard.stories.tsx +168 -0
- package/src/hooks/ClipBoard/ClipBoard.tsx +131 -0
- package/src/hooks/ClipBoard/ClipboardUnifiedDemo.tsx +111 -0
- package/src/hooks/ClipBoard/index.ts +1 -0
- package/src/index.ts +51 -0
- package/src/mui.ts +57 -0
- package/src/styles.css +3 -0
- package/src/theme/componentStyles.ts +50 -0
- package/src/theme/tokens.ts +43 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/scrollToTop.ts +36 -0
- package/storybook-static/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/storybook-static/assets/AccountCircle-BDZFsbTw.js +1 -0
- package/storybook-static/assets/ActionMenu-EynP8yU1.js +19 -0
- package/storybook-static/assets/ActionMenu.stories-DqSqRGix.js +185 -0
- package/storybook-static/assets/Alert-3zvTPc0p.js +1 -0
- package/storybook-static/assets/AppBar.stories-DcX3M5th.js +172 -0
- package/storybook-static/assets/Autocomplete.stories-CXJm8FOT.js +788 -0
- package/storybook-static/assets/Avatar-NbFfkZws.js +1 -0
- package/storybook-static/assets/Avatar.stories-CwOYCzqU.js +390 -0
- package/storybook-static/assets/Box-BnhEcfFm.js +1 -0
- package/storybook-static/assets/Button-D9h7OggD.js +1 -0
- package/storybook-static/assets/Button-DBpqmVB_.js +1 -0
- package/storybook-static/assets/Button.stories-F20dmnjq.js +320 -0
- package/storybook-static/assets/ButtonBase-qyaMEhe4.js +74 -0
- package/storybook-static/assets/Card.stories-B3NpAhO0.js +154 -0
- package/storybook-static/assets/CheckCircleOutline-CEj5mDsl.js +1 -0
- package/storybook-static/assets/Chip-C3vKPpzR.js +1 -0
- package/storybook-static/assets/Chip.stories-sxcfHVo9.js +333 -0
- package/storybook-static/assets/CircularProgress-DC7ZNWwl.js +28 -0
- package/storybook-static/assets/Clear-4kYcKvT3.js +1 -0
- package/storybook-static/assets/ClipBoard-DvLBdNHe.js +1 -0
- package/storybook-static/assets/ClipBoard.stories-BGUo47r6.js +108 -0
- package/storybook-static/assets/Close-CgHeRgmh.js +1 -0
- package/storybook-static/assets/Close-Cy8nELYU.js +1 -0
- package/storybook-static/assets/Color-AVL7NMMY-BJKvwERm.js +1 -0
- package/storybook-static/assets/ContentCopy-BfLTDb10.js +1 -0
- package/storybook-static/assets/DatePicker-Clkpr-Ku.js +1 -0
- package/storybook-static/assets/DatePicker.stories-EaUCMkh3.js +444 -0
- package/storybook-static/assets/DateRangePicker.stories-BMlkj-8K.js +390 -0
- package/storybook-static/assets/DateTimePicker.stories-B6gdzKq5.js +555 -0
- package/storybook-static/assets/DefaultPropsProvider-BGoQxtDa.js +16 -0
- package/storybook-static/assets/Delete-D2SMMmIA.js +1 -0
- package/storybook-static/assets/DialogContent-BeCDKgax.js +1 -0
- package/storybook-static/assets/Divider-BbCj9wT4.js +1 -0
- package/storybook-static/assets/DocsRenderer-PQXLIZUC-BebLK5Y_.js +1243 -0
- package/storybook-static/assets/Drawer-DcFwy73r.js +1 -0
- package/storybook-static/assets/Drawer.stories-C5AZkJBk.js +173 -0
- package/storybook-static/assets/EmptyTable-B-RKtgVs.png +0 -0
- package/storybook-static/assets/ErrorOutline-D9gM7ART.js +1 -0
- package/storybook-static/assets/Fade-Ll96CvH8.js +1 -0
- package/storybook-static/assets/Flyout.stories-Cf7z6MNw.js +163 -0
- package/storybook-static/assets/Gallery.stories-DdpWVTF6.js +127 -0
- package/storybook-static/assets/Grow-8y4FglGK.js +1 -0
- package/storybook-static/assets/Home-BRvJEp2L.js +1 -0
- package/storybook-static/assets/Icon.stories-D0mUiW_t.js +78 -0
- package/storybook-static/assets/IconButton-9OYSTH58.js +1 -0
- package/storybook-static/assets/Input-CjX0t4h-.js +1 -0
- package/storybook-static/assets/Input.stories-BRxekliy.js +650 -0
- package/storybook-static/assets/InputGroup.stories-DH6gUfmn.js +306 -0
- package/storybook-static/assets/KeyboardArrowRight-WO_attK2.js +1 -0
- package/storybook-static/assets/KeyboardArrowUp-DsyVef-i.js +1 -0
- package/storybook-static/assets/ListItem-D3O0103N.js +1 -0
- package/storybook-static/assets/ListItemIcon-hca6xN79.js +1 -0
- package/storybook-static/assets/ListItemText-BFLAwLdl.js +1 -0
- package/storybook-static/assets/Logout-gj-P3AfU.js +1 -0
- package/storybook-static/assets/Menu-ClzfjLc3.js +1 -0
- package/storybook-static/assets/MenuButton.stories-B-W_QVDt.js +162 -0
- package/storybook-static/assets/MenuItem-iU6tAqJI.js +1 -0
- package/storybook-static/assets/Modal-3okp9H2i.js +1 -0
- package/storybook-static/assets/Modal.stories-DIWzm4qR.js +468 -0
- package/storybook-static/assets/MoreVert-BoIVG4gh.js +1 -0
- package/storybook-static/assets/Notifications-DY_A-Sho.js +1 -0
- package/storybook-static/assets/PageLoader.stories-DmtO1mlm.js +158 -0
- package/storybook-static/assets/Paper-SwQBhqI7.js +1 -0
- package/storybook-static/assets/Person-CkQl-mpq.js +1 -0
- package/storybook-static/assets/PickersModalDialog-Tjnr_cu5.js +10 -0
- package/storybook-static/assets/PickersToolbarButton-Tt185-si.js +1 -0
- package/storybook-static/assets/Popper-CnCTYXxy.js +1 -0
- package/storybook-static/assets/Portal-Cj8XF9Lf.js +1 -0
- package/storybook-static/assets/ScrollTopButton.stories-BflQCwNP.js +90 -0
- package/storybook-static/assets/Select-CjcuMAY0.js +4 -0
- package/storybook-static/assets/Select-DJh2biEb.js +3 -0
- package/storybook-static/assets/Select.stories-DU1Gb3I2.js +1103 -0
- package/storybook-static/assets/Settings-BLKc1CnO.js +1 -0
- package/storybook-static/assets/Snackbar-BtVeKTw6.js +1 -0
- package/storybook-static/assets/Stack-D01OUIXi.js +1 -0
- package/storybook-static/assets/Stat.stories-Bn9-iuPT.js +60 -0
- package/storybook-static/assets/StatusMessage.stories-hnfX8FeU.js +73 -0
- package/storybook-static/assets/Stepper-BtKB5ykn.js +2 -0
- package/storybook-static/assets/Stepper.stories-CTEZbgPc.js +165 -0
- package/storybook-static/assets/Table.stories-CTn2Ktmn.js +1260 -0
- package/storybook-static/assets/TableContainer-CzLNaEU-.js +1 -0
- package/storybook-static/assets/TableRow-CS88-1HF.js +2 -0
- package/storybook-static/assets/Tabs-DLpDOu_n.js +1 -0
- package/storybook-static/assets/Tabs.stories-BFVuFy_5.js +159 -0
- package/storybook-static/assets/TextField-22T-xHBm.js +1 -0
- package/storybook-static/assets/Timeline.stories-DJU_U2Hv.js +97 -0
- package/storybook-static/assets/Tooltip-DbnHUxNj.js +1 -0
- package/storybook-static/assets/Tooltip.stories-B7tA3dnV.js +66 -0
- package/storybook-static/assets/Typography-BgntX2Ep.js +1 -0
- package/storybook-static/assets/Wizard.stories-CVrJLK_D.js +23 -0
- package/storybook-static/assets/createSimplePaletteValueFilter-bm0fmN_7.js +1 -0
- package/storybook-static/assets/createSvgIcon-D_Gca4vA.js +1 -0
- package/storybook-static/assets/debounce-Be36O1Ab.js +1 -0
- package/storybook-static/assets/emotion-react.browser.esm--g-C9cX9.js +8 -0
- package/storybook-static/assets/extendSxProp-CEpa30hT.js +1 -0
- package/storybook-static/assets/formField.sx-DMCmZIAa.js +1 -0
- package/storybook-static/assets/getReactElementRef-BQ3ANZdy.js +1 -0
- package/storybook-static/assets/iframe-BAJnc_4n.js +1079 -0
- package/storybook-static/assets/index-B1tlhOpe.js +240 -0
- package/storybook-static/assets/index-BF3FAXTk.js +9 -0
- package/storybook-static/assets/index-CIeucmOB.js +2 -0
- package/storybook-static/assets/index-CY7j4a7o.js +1 -0
- package/storybook-static/assets/index-CxkKctw5.js +1 -0
- package/storybook-static/assets/isFocusVisible-B8k4qzLc.js +1 -0
- package/storybook-static/assets/isMuiElement-CTZSFcY5.js +1 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/listItemTextClasses-CC_rwJam.js +1 -0
- package/storybook-static/assets/mergeSlotProps-B0UBKBMe.js +1 -0
- package/storybook-static/assets/ownerDocument-DW-IO8s5.js +1 -0
- package/storybook-static/assets/ownerWindow-HkKU3E4x.js +1 -0
- package/storybook-static/assets/preload-helper-PPVm8Dsz.js +1 -0
- package/storybook-static/assets/react-18-BUJ64QCV.js +25 -0
- package/storybook-static/assets/resolvePreset-CN2aOJJr.js +1 -0
- package/storybook-static/assets/useControlled-DsVh1a5j.js +1 -0
- package/storybook-static/assets/useForkRef-0ANIrxcF.js +1 -0
- package/storybook-static/assets/useId-b4fZxjOL.js +1 -0
- package/storybook-static/assets/useMobilePicker-DK-c8xbD.js +1 -0
- package/storybook-static/assets/usePreviousProps-WR0rG4aR.js +1 -0
- package/storybook-static/assets/useSlot-b6pXgp5_.js +1 -0
- package/storybook-static/assets/useSlotProps-C0uMfuBt.js +1 -0
- package/storybook-static/assets/useTheme-BmOJK7ra.js +1 -0
- package/storybook-static/assets/useThemeProps-DYtxXiUU.js +1 -0
- package/storybook-static/assets/useThemeProps-U4yXiZ_5.js +1 -0
- package/storybook-static/assets/useTimeout-DNjRaOWc.js +1 -0
- package/storybook-static/assets/visuallyHidden-Dan1xhjv.js +1 -0
- package/storybook-static/favicon-wrapper.svg +46 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +686 -0
- package/storybook-static/index.html +160 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-2/manager-bundle.js +356 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-2/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/docs-4/manager-bundle.js +151 -0
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
- package/storybook-static/sb-addons/vitest-3/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +797 -0
- package/storybook-static/sb-manager/globals-runtime.js +69679 -0
- package/storybook-static/sb-manager/globals.js +34 -0
- package/storybook-static/sb-manager/runtime.js +13195 -0
- package/storybook-static/vite-inject-mocker-entry.js +18 -0
- package/tailwind.config.js +10 -0
- package/tsconfig.json +48 -0
- package/tsup.config.js +41 -0
- package/vite.config.js +132 -0
- package/vitest.config.ts +35 -0
- package/Autocomplete-4i0dNDKr.cjs.map +0 -1
- package/Autocomplete-i3-V38n1.js.map +0 -1
- package/DatePicker-CtCFqXDw.cjs.map +0 -1
- package/DatePicker-D0Bz9Ryg.js.map +0 -1
- package/DateRangePicker-BVpeJCHI.js +0 -76
- package/DateRangePicker-BVpeJCHI.js.map +0 -1
- package/DateRangePicker-B_hKQhbj.cjs +0 -75
- package/DateRangePicker-B_hKQhbj.cjs.map +0 -1
- package/DateTimePicker-77w-9TP5.js.map +0 -1
- package/DateTimePicker-CTnRQCZo.cjs.map +0 -1
- package/Input-jYapjJYM.cjs.map +0 -1
- package/Input-rVVhI_wk.js.map +0 -1
- package/Select-B6jE3WH_.cjs.map +0 -1
- package/Select-bSVQokFX.js.map +0 -1
- package/components/DateRangePicker/DateRangePicker.cjs +0 -5
- package/components/DateRangePicker/DateRangePicker.cjs.map +0 -1
- package/components/DateRangePicker/DateRangePicker.d.ts +0 -15
- package/components/DateRangePicker/DateRangePicker.definitions.d.ts +0 -6
- package/components/DateRangePicker/DateRangePicker.js +0 -5
- package/components/DateRangePicker/DateRangePicker.js.map +0 -1
- package/components/DateRangePicker/index.d.ts +0 -1
- package/components/DateRangePicker.d.ts +0 -2
- package/formField.sx-8_QRnKxv.js.map +0 -1
- package/formField.sx-BAX7KwMR.cjs.map +0 -1
- /package/{README.md → Readme.md} +0 -0
- /package/{Avatar-CgT7955R.js → dist/Avatar-CgT7955R.js} +0 -0
- /package/{Avatar-CgT7955R.js.map → dist/Avatar-CgT7955R.js.map} +0 -0
- /package/{Avatar-CuSrK8Wn.cjs → dist/Avatar-CuSrK8Wn.cjs} +0 -0
- /package/{Avatar-CuSrK8Wn.cjs.map → dist/Avatar-CuSrK8Wn.cjs.map} +0 -0
- /package/{Button-C17mExpd.cjs → dist/Button-C17mExpd.cjs} +0 -0
- /package/{Button-C17mExpd.cjs.map → dist/Button-C17mExpd.cjs.map} +0 -0
- /package/{Button-UkkP-bNw.js → dist/Button-UkkP-bNw.js} +0 -0
- /package/{Button-UkkP-bNw.js.map → dist/Button-UkkP-bNw.js.map} +0 -0
- /package/{Card-B1wtavyl.js → dist/Card-B1wtavyl.js} +0 -0
- /package/{Card-B1wtavyl.js.map → dist/Card-B1wtavyl.js.map} +0 -0
- /package/{Card-DfdU610V.cjs → dist/Card-DfdU610V.cjs} +0 -0
- /package/{Card-DfdU610V.cjs.map → dist/Card-DfdU610V.cjs.map} +0 -0
- /package/{Checkbox-BCqMFWt4.cjs → dist/Checkbox-BCqMFWt4.cjs} +0 -0
- /package/{Checkbox-BCqMFWt4.cjs.map → dist/Checkbox-BCqMFWt4.cjs.map} +0 -0
- /package/{Checkbox-gB5YKkVo.js → dist/Checkbox-gB5YKkVo.js} +0 -0
- /package/{Checkbox-gB5YKkVo.js.map → dist/Checkbox-gB5YKkVo.js.map} +0 -0
- /package/{Chip-OPYQ1uQ_.js → dist/Chip-OPYQ1uQ_.js} +0 -0
- /package/{Chip-OPYQ1uQ_.js.map → dist/Chip-OPYQ1uQ_.js.map} +0 -0
- /package/{Chip-qoJLDiva.cjs → dist/Chip-qoJLDiva.cjs} +0 -0
- /package/{Chip-qoJLDiva.cjs.map → dist/Chip-qoJLDiva.cjs.map} +0 -0
- /package/{Modal-BN5s-Tfk.cjs → dist/Modal-BN5s-Tfk.cjs} +0 -0
- /package/{Modal-BN5s-Tfk.cjs.map → dist/Modal-BN5s-Tfk.cjs.map} +0 -0
- /package/{Modal-BRZMPwDj.js → dist/Modal-BRZMPwDj.js} +0 -0
- /package/{Modal-BRZMPwDj.js.map → dist/Modal-BRZMPwDj.js.map} +0 -0
- /package/{RadioGroup-Dd0rHXSX.cjs → dist/RadioGroup-Dd0rHXSX.cjs} +0 -0
- /package/{RadioGroup-Dd0rHXSX.cjs.map → dist/RadioGroup-Dd0rHXSX.cjs.map} +0 -0
- /package/{RadioGroup-bO-ahP9T.js → dist/RadioGroup-bO-ahP9T.js} +0 -0
- /package/{RadioGroup-bO-ahP9T.js.map → dist/RadioGroup-bO-ahP9T.js.map} +0 -0
- /package/{Stat-BUcFCGrz.cjs → dist/Stat-BUcFCGrz.cjs} +0 -0
- /package/{Stat-BUcFCGrz.cjs.map → dist/Stat-BUcFCGrz.cjs.map} +0 -0
- /package/{Stat-C06A_izS.js → dist/Stat-C06A_izS.js} +0 -0
- /package/{Stat-C06A_izS.js.map → dist/Stat-C06A_izS.js.map} +0 -0
- /package/{StatusMessage-B3nXpuRl.cjs → dist/StatusMessage-B3nXpuRl.cjs} +0 -0
- /package/{StatusMessage-B3nXpuRl.cjs.map → dist/StatusMessage-B3nXpuRl.cjs.map} +0 -0
- /package/{StatusMessage-D0WgSBx7.js → dist/StatusMessage-D0WgSBx7.js} +0 -0
- /package/{StatusMessage-D0WgSBx7.js.map → dist/StatusMessage-D0WgSBx7.js.map} +0 -0
- /package/{Step-BArsou1V.js → dist/Step-BArsou1V.js} +0 -0
- /package/{Step-BArsou1V.js.map → dist/Step-BArsou1V.js.map} +0 -0
- /package/{Step-Nd7SJbRZ.cjs → dist/Step-Nd7SJbRZ.cjs} +0 -0
- /package/{Step-Nd7SJbRZ.cjs.map → dist/Step-Nd7SJbRZ.cjs.map} +0 -0
- /package/{Switch-CQFOopYy.cjs → dist/Switch-CQFOopYy.cjs} +0 -0
- /package/{Switch-CQFOopYy.cjs.map → dist/Switch-CQFOopYy.cjs.map} +0 -0
- /package/{Switch-D72dpkH2.js → dist/Switch-D72dpkH2.js} +0 -0
- /package/{Switch-D72dpkH2.js.map → dist/Switch-D72dpkH2.js.map} +0 -0
- /package/{Tab-BbP8jBcK.cjs → dist/Tab-BbP8jBcK.cjs} +0 -0
- /package/{Tab-BbP8jBcK.cjs.map → dist/Tab-BbP8jBcK.cjs.map} +0 -0
- /package/{Tab-BxSxKJsP.js → dist/Tab-BxSxKJsP.js} +0 -0
- /package/{Tab-BxSxKJsP.js.map → dist/Tab-BxSxKJsP.js.map} +0 -0
- /package/{Table-C2LbW0B1.js → dist/Table-C2LbW0B1.js} +0 -0
- /package/{Table-C2LbW0B1.js.map → dist/Table-C2LbW0B1.js.map} +0 -0
- /package/{Table-C4OM6rrC.cjs → dist/Table-C4OM6rrC.cjs} +0 -0
- /package/{Table-C4OM6rrC.cjs.map → dist/Table-C4OM6rrC.cjs.map} +0 -0
- /package/{components → dist/components}/ActionMenu/ActionMenu.cjs +0 -0
- /package/{components → dist/components}/ActionMenu/ActionMenu.cjs.map +0 -0
- /package/{components → dist/components}/ActionMenu/ActionMenu.d.ts +0 -0
- /package/{components → dist/components}/ActionMenu/ActionMenu.js +0 -0
- /package/{components → dist/components}/ActionMenu/ActionMenu.js.map +0 -0
- /package/{components → dist/components}/ActionMenu/index.d.ts +0 -0
- /package/{components → dist/components}/ActionMenu.d.ts +0 -0
- /package/{components → dist/components}/AppBar/AppBar.cjs +0 -0
- /package/{components → dist/components}/AppBar/AppBar.cjs.map +0 -0
- /package/{components → dist/components}/AppBar/AppBar.d.ts +0 -0
- /package/{components → dist/components}/AppBar/AppBar.js +0 -0
- /package/{components → dist/components}/AppBar/AppBar.js.map +0 -0
- /package/{components → dist/components}/AppBar/AppBar.sx.d.ts +0 -0
- /package/{components → dist/components}/AppBar/AppBarContext.d.ts +0 -0
- /package/{components → dist/components}/AppBar/AppBarMenuToggle.d.ts +0 -0
- /package/{components → dist/components}/AppBar/index.d.ts +0 -0
- /package/{components → dist/components}/AppBar.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/Autocomplete.cjs.map +0 -0
- /package/{components → dist/components}/Autocomplete/Autocomplete.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/Autocomplete.definitions.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/Autocomplete.helpers.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/Autocomplete.js.map +0 -0
- /package/{components → dist/components}/Autocomplete/_parts/AutocompleteChips.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/_parts/AutocompleteLoader.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/_parts/AutocompleteOption.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete/index.d.ts +0 -0
- /package/{components → dist/components}/Autocomplete.d.ts +0 -0
- /package/{components → dist/components}/Avatar/Avatar.cjs +0 -0
- /package/{components → dist/components}/Avatar/Avatar.cjs.map +0 -0
- /package/{components → dist/components}/Avatar/Avatar.d.ts +0 -0
- /package/{components → dist/components}/Avatar/Avatar.definitions.d.ts +0 -0
- /package/{components → dist/components}/Avatar/Avatar.js +0 -0
- /package/{components → dist/components}/Avatar/Avatar.js.map +0 -0
- /package/{components → dist/components}/Avatar/index.d.ts +0 -0
- /package/{components → dist/components}/Avatar.d.ts +0 -0
- /package/{components → dist/components}/Button/Button.cjs +0 -0
- /package/{components → dist/components}/Button/Button.cjs.map +0 -0
- /package/{components → dist/components}/Button/Button.d.ts +0 -0
- /package/{components → dist/components}/Button/Button.definition.d.ts +0 -0
- /package/{components → dist/components}/Button/Button.js +0 -0
- /package/{components → dist/components}/Button/Button.js.map +0 -0
- /package/{components → dist/components}/Button/index.d.ts +0 -0
- /package/{components → dist/components}/Button.d.ts +0 -0
- /package/{components → dist/components}/Card/Card.cjs +0 -0
- /package/{components → dist/components}/Card/Card.cjs.map +0 -0
- /package/{components → dist/components}/Card/Card.d.ts +0 -0
- /package/{components → dist/components}/Card/Card.definition.d.ts +0 -0
- /package/{components → dist/components}/Card/Card.js +0 -0
- /package/{components → dist/components}/Card/Card.js.map +0 -0
- /package/{components → dist/components}/Card/Card.sx.d.ts +0 -0
- /package/{components → dist/components}/Card/index.d.ts +0 -0
- /package/{components → dist/components}/Card.d.ts +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.cjs +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.cjs.map +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.d.ts +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.js +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.js.map +0 -0
- /package/{components → dist/components}/Checkbox/Checkbox.sx.d.ts +0 -0
- /package/{components → dist/components}/Checkbox/index.d.ts +0 -0
- /package/{components → dist/components}/Checkbox.d.ts +0 -0
- /package/{components → dist/components}/Chip/Chip.cjs +0 -0
- /package/{components → dist/components}/Chip/Chip.cjs.map +0 -0
- /package/{components → dist/components}/Chip/Chip.d.ts +0 -0
- /package/{components → dist/components}/Chip/Chip.definitions.d.ts +0 -0
- /package/{components → dist/components}/Chip/Chip.js +0 -0
- /package/{components → dist/components}/Chip/Chip.js.map +0 -0
- /package/{components → dist/components}/Chip/index.d.ts +0 -0
- /package/{components → dist/components}/Chip.d.ts +0 -0
- /package/{components → dist/components}/Column/Column.cjs +0 -0
- /package/{components → dist/components}/Column/Column.cjs.map +0 -0
- /package/{components → dist/components}/Column/Column.d.ts +0 -0
- /package/{components → dist/components}/Column/Column.js +0 -0
- /package/{components → dist/components}/Column/Column.js.map +0 -0
- /package/{components → dist/components}/Column/index.d.ts +0 -0
- /package/{components → dist/components}/Column.d.ts +0 -0
- /package/{components → dist/components}/DatePicker/DatePicker.cjs.map +0 -0
- /package/{components → dist/components}/DatePicker/DatePicker.d.ts +0 -0
- /package/{components → dist/components}/DatePicker/DatePicker.definitions.d.ts +0 -0
- /package/{components → dist/components}/DatePicker/DatePicker.helpers.d.ts +0 -0
- /package/{components → dist/components}/DatePicker/DatePicker.js.map +0 -0
- /package/{components → dist/components}/DatePicker/index.d.ts +0 -0
- /package/{components → dist/components}/DatePicker.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.cjs.map +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.definitions.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.helpers.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.js.map +0 -0
- /package/{components → dist/components}/DateTimePicker/index.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker.d.ts +0 -0
- /package/{components → dist/components}/Drawer/Drawer.cjs +0 -0
- /package/{components → dist/components}/Drawer/Drawer.cjs.map +0 -0
- /package/{components → dist/components}/Drawer/Drawer.d.ts +0 -0
- /package/{components → dist/components}/Drawer/Drawer.js +0 -0
- /package/{components → dist/components}/Drawer/Drawer.js.map +0 -0
- /package/{components → dist/components}/Drawer/Drawer.sx.d.ts +0 -0
- /package/{components → dist/components}/Drawer/DrawerContext.d.ts +0 -0
- /package/{components → dist/components}/Drawer/DrawerItem.d.ts +0 -0
- /package/{components → dist/components}/Drawer/index.d.ts +0 -0
- /package/{components → dist/components}/Drawer.d.ts +0 -0
- /package/{components → dist/components}/Flyout/Flyout.cjs +0 -0
- /package/{components → dist/components}/Flyout/Flyout.cjs.map +0 -0
- /package/{components → dist/components}/Flyout/Flyout.d.ts +0 -0
- /package/{components → dist/components}/Flyout/Flyout.js +0 -0
- /package/{components → dist/components}/Flyout/Flyout.js.map +0 -0
- /package/{components → dist/components}/Flyout/index.d.ts +0 -0
- /package/{components → dist/components}/Flyout.d.ts +0 -0
- /package/{components → dist/components}/Gallery/Gallery.cjs +0 -0
- /package/{components → dist/components}/Gallery/Gallery.cjs.map +0 -0
- /package/{components → dist/components}/Gallery/Gallery.d.ts +0 -0
- /package/{components → dist/components}/Gallery/Gallery.definition.d.ts +0 -0
- /package/{components → dist/components}/Gallery/Gallery.js +0 -0
- /package/{components → dist/components}/Gallery/Gallery.js.map +0 -0
- /package/{components → dist/components}/Gallery/GalleryLightbox.d.ts +0 -0
- /package/{components → dist/components}/Gallery/GalleryMain.d.ts +0 -0
- /package/{components → dist/components}/Gallery/GalleryThumbnails.d.ts +0 -0
- /package/{components → dist/components}/Gallery/index.d.ts +0 -0
- /package/{components → dist/components}/Gallery.d.ts +0 -0
- /package/{components → dist/components}/Icon/Icon.cjs +0 -0
- /package/{components → dist/components}/Icon/Icon.cjs.map +0 -0
- /package/{components → dist/components}/Icon/Icon.d.ts +0 -0
- /package/{components → dist/components}/Icon/Icon.js +0 -0
- /package/{components → dist/components}/Icon/Icon.js.map +0 -0
- /package/{components → dist/components}/Icon/index.d.ts +0 -0
- /package/{components → dist/components}/Icon.d.ts +0 -0
- /package/{components → dist/components}/Input/Input.cjs.map +0 -0
- /package/{components → dist/components}/Input/Input.d.ts +0 -0
- /package/{components → dist/components}/Input/Input.definitions.d.ts +0 -0
- /package/{components → dist/components}/Input/Input.helpers.d.ts +0 -0
- /package/{components → dist/components}/Input/Input.js.map +0 -0
- /package/{components → dist/components}/Input/index.d.ts +0 -0
- /package/{components → dist/components}/Input.d.ts +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.cjs +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.cjs.map +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.d.ts +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.definitions.d.ts +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.js +0 -0
- /package/{components → dist/components}/InputGroup/InputGroup.js.map +0 -0
- /package/{components → dist/components}/InputGroup/index.d.ts +0 -0
- /package/{components → dist/components}/InputGroup.d.ts +0 -0
- /package/{components → dist/components}/MenuButton/MenuButton.cjs +0 -0
- /package/{components → dist/components}/MenuButton/MenuButton.cjs.map +0 -0
- /package/{components → dist/components}/MenuButton/MenuButton.d.ts +0 -0
- /package/{components → dist/components}/MenuButton/MenuButton.js +0 -0
- /package/{components → dist/components}/MenuButton/MenuButton.js.map +0 -0
- /package/{components → dist/components}/MenuButton/index.d.ts +0 -0
- /package/{components → dist/components}/MenuButton.d.ts +0 -0
- /package/{components → dist/components}/Modal/Modal.cjs +0 -0
- /package/{components → dist/components}/Modal/Modal.cjs.map +0 -0
- /package/{components → dist/components}/Modal/Modal.d.ts +0 -0
- /package/{components → dist/components}/Modal/Modal.js +0 -0
- /package/{components → dist/components}/Modal/Modal.js.map +0 -0
- /package/{components → dist/components}/Modal/ModalBody.d.ts +0 -0
- /package/{components → dist/components}/Modal/ModalFooter.d.ts +0 -0
- /package/{components → dist/components}/Modal/ModalHeader.d.ts +0 -0
- /package/{components → dist/components}/Modal/index.d.ts +0 -0
- /package/{components → dist/components}/Modal.d.ts +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.cjs +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.cjs.map +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.d.ts +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.definitions.d.ts +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.js +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.js.map +0 -0
- /package/{components → dist/components}/RadioGroup/RadioGroup.sx.d.ts +0 -0
- /package/{components → dist/components}/RadioGroup/index.d.ts +0 -0
- /package/{components → dist/components}/RadioGroup.d.ts +0 -0
- /package/{components → dist/components}/Select/Select.cjs.map +0 -0
- /package/{components → dist/components}/Select/Select.d.ts +0 -0
- /package/{components → dist/components}/Select/Select.helpers.d.ts +0 -0
- /package/{components → dist/components}/Select/Select.js.map +0 -0
- /package/{components → dist/components}/Select/_parts/SelectMenuItem.d.ts +0 -0
- /package/{components → dist/components}/Select/_parts/SelectValue.d.ts +0 -0
- /package/{components → dist/components}/Select/index.d.ts +0 -0
- /package/{components → dist/components}/Select.d.ts +0 -0
- /package/{components → dist/components}/Stat/Stat.cjs +0 -0
- /package/{components → dist/components}/Stat/Stat.cjs.map +0 -0
- /package/{components → dist/components}/Stat/Stat.d.ts +0 -0
- /package/{components → dist/components}/Stat/Stat.js +0 -0
- /package/{components → dist/components}/Stat/Stat.js.map +0 -0
- /package/{components → dist/components}/Stat/index.d.ts +0 -0
- /package/{components → dist/components}/Stat.d.ts +0 -0
- /package/{components → dist/components}/StatusMessage/StatusMessage.cjs +0 -0
- /package/{components → dist/components}/StatusMessage/StatusMessage.cjs.map +0 -0
- /package/{components → dist/components}/StatusMessage/StatusMessage.d.ts +0 -0
- /package/{components → dist/components}/StatusMessage/StatusMessage.js +0 -0
- /package/{components → dist/components}/StatusMessage/StatusMessage.js.map +0 -0
- /package/{components → dist/components}/StatusMessage/index.d.ts +0 -0
- /package/{components → dist/components}/StatusMessage.d.ts +0 -0
- /package/{components → dist/components}/Stepper/Step.d.ts +0 -0
- /package/{components → dist/components}/Stepper/Stepper.cjs +0 -0
- /package/{components → dist/components}/Stepper/Stepper.cjs.map +0 -0
- /package/{components → dist/components}/Stepper/Stepper.d.ts +0 -0
- /package/{components → dist/components}/Stepper/Stepper.definition.d.ts +0 -0
- /package/{components → dist/components}/Stepper/Stepper.js +0 -0
- /package/{components → dist/components}/Stepper/Stepper.js.map +0 -0
- /package/{components → dist/components}/Stepper/StepperContext.d.ts +0 -0
- /package/{components → dist/components}/Stepper/_hooks/useHorizontalScroll.d.ts +0 -0
- /package/{components → dist/components}/Stepper/_parts/StepperScrollArrow.d.ts +0 -0
- /package/{components → dist/components}/Stepper/index.d.ts +0 -0
- /package/{components → dist/components}/Stepper.d.ts +0 -0
- /package/{components → dist/components}/Switch/Switch.cjs +0 -0
- /package/{components → dist/components}/Switch/Switch.cjs.map +0 -0
- /package/{components → dist/components}/Switch/Switch.d.ts +0 -0
- /package/{components → dist/components}/Switch/Switch.definitions.d.ts +0 -0
- /package/{components → dist/components}/Switch/Switch.js +0 -0
- /package/{components → dist/components}/Switch/Switch.js.map +0 -0
- /package/{components → dist/components}/Switch/Switch.sx.d.ts +0 -0
- /package/{components → dist/components}/Switch/Switch.types.d.ts +0 -0
- /package/{components → dist/components}/Switch/index.d.ts +0 -0
- /package/{components → dist/components}/Switch.d.ts +0 -0
- /package/{components → dist/components}/Table/Table.cjs +0 -0
- /package/{components → dist/components}/Table/Table.cjs.map +0 -0
- /package/{components → dist/components}/Table/Table.d.ts +0 -0
- /package/{components → dist/components}/Table/Table.definition.d.ts +0 -0
- /package/{components → dist/components}/Table/Table.js +0 -0
- /package/{components → dist/components}/Table/Table.js.map +0 -0
- /package/{components → dist/components}/Table/data.d.ts +0 -0
- /package/{components → dist/components}/Table/exportsUtils.d.ts +0 -0
- /package/{components → dist/components}/Table/index.d.ts +0 -0
- /package/{components → dist/components}/Table/types.d.ts +0 -0
- /package/{components → dist/components}/Table.d.ts +0 -0
- /package/{components → dist/components}/Tabs/Tab.d.ts +0 -0
- /package/{components → dist/components}/Tabs/Tab.definition.d.ts +0 -0
- /package/{components → dist/components}/Tabs/Tabs.cjs +0 -0
- /package/{components → dist/components}/Tabs/Tabs.cjs.map +0 -0
- /package/{components → dist/components}/Tabs/Tabs.d.ts +0 -0
- /package/{components → dist/components}/Tabs/Tabs.js +0 -0
- /package/{components → dist/components}/Tabs/Tabs.js.map +0 -0
- /package/{components → dist/components}/Tabs/_tabUtils.d.ts +0 -0
- /package/{components → dist/components}/Tabs/index.d.ts +0 -0
- /package/{components → dist/components}/Tabs.d.ts +0 -0
- /package/{components → dist/components}/Timeline/Timeline.cjs +0 -0
- /package/{components → dist/components}/Timeline/Timeline.cjs.map +0 -0
- /package/{components → dist/components}/Timeline/Timeline.d.ts +0 -0
- /package/{components → dist/components}/Timeline/Timeline.definition.d.ts +0 -0
- /package/{components → dist/components}/Timeline/Timeline.js +0 -0
- /package/{components → dist/components}/Timeline/Timeline.js.map +0 -0
- /package/{components → dist/components}/Timeline/TimelineItem.d.ts +0 -0
- /package/{components → dist/components}/Timeline/index.d.ts +0 -0
- /package/{components → dist/components}/Timeline.d.ts +0 -0
- /package/{components → dist/components}/Tooltip/Tooltip.cjs +0 -0
- /package/{components → dist/components}/Tooltip/Tooltip.cjs.map +0 -0
- /package/{components → dist/components}/Tooltip/Tooltip.d.ts +0 -0
- /package/{components → dist/components}/Tooltip/Tooltip.js +0 -0
- /package/{components → dist/components}/Tooltip/Tooltip.js.map +0 -0
- /package/{components → dist/components}/Tooltip/index.d.ts +0 -0
- /package/{components → dist/components}/Tooltip.d.ts +0 -0
- /package/{components → dist/components}/_shared/mergeSx.d.ts +0 -0
- /package/{components → dist/components}/_shared/resolvePreset.d.ts +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipBoard.cjs +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipBoard.cjs.map +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipBoard.d.ts +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipBoard.js +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipBoard.js.map +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/ClipboardUnifiedDemo.d.ts +0 -0
- /package/{hooks → dist/hooks}/ClipBoard/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/ClipBoard.d.ts +0 -0
- /package/{index.css → dist/index.css} +0 -0
- /package/{mergeSx-BXoNZjB_.js → dist/mergeSx-BXoNZjB_.js} +0 -0
- /package/{mergeSx-BXoNZjB_.js.map → dist/mergeSx-BXoNZjB_.js.map} +0 -0
- /package/{mergeSx-Dbccoo_H.cjs → dist/mergeSx-Dbccoo_H.cjs} +0 -0
- /package/{mergeSx-Dbccoo_H.cjs.map → dist/mergeSx-Dbccoo_H.cjs.map} +0 -0
- /package/{mui.d.ts → dist/mui.d.ts} +0 -0
- /package/{resolvePreset-CxTI6_Ln.cjs → dist/resolvePreset-CxTI6_Ln.cjs} +0 -0
- /package/{resolvePreset-CxTI6_Ln.cjs.map → dist/resolvePreset-CxTI6_Ln.cjs.map} +0 -0
- /package/{resolvePreset-K6_BfWHD.js → dist/resolvePreset-K6_BfWHD.js} +0 -0
- /package/{resolvePreset-K6_BfWHD.js.map → dist/resolvePreset-K6_BfWHD.js.map} +0 -0
- /package/{theme → dist/theme}/componentStyles.d.ts +0 -0
- /package/{theme → dist/theme}/tokens.d.ts +0 -0
- /package/{tokens-BRrcP_p_.js → dist/tokens-BRrcP_p_.js} +0 -0
- /package/{tokens-BRrcP_p_.js.map → dist/tokens-BRrcP_p_.js.map} +0 -0
- /package/{tokens-jaWWNk39.cjs → dist/tokens-jaWWNk39.cjs} +0 -0
- /package/{tokens-jaWWNk39.cjs.map → dist/tokens-jaWWNk39.cjs.map} +0 -0
- /package/{utils → dist/utils}/index.d.ts +0 -0
- /package/{utils → dist/utils}/scrollToTop.d.ts +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IconButton } from '@mui/material';
|
|
2
|
+
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
|
3
|
+
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
4
|
+
|
|
5
|
+
interface StepperScrollArrowProps {
|
|
6
|
+
direction: 'left' | 'right';
|
|
7
|
+
/** Cuando `false`, el botón está deshabilitado (por ejemplo, ya estás al inicio). */
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Cuando `false`, el botón queda con `visibility: hidden` (reserva su
|
|
11
|
+
* espacio pero no se ve). Útil para que el área de scroll no se corra
|
|
12
|
+
* horizontalmente cuando no hay overflow en ningún lado.
|
|
13
|
+
*/
|
|
14
|
+
visible: boolean;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Flecha de scroll (`<` / `>`) del Stepper horizontal. Se muestra a los
|
|
20
|
+
* costados del área scrollable cuando hay overflow. Componente privado —
|
|
21
|
+
* no se exporta del barrel.
|
|
22
|
+
*/
|
|
23
|
+
export const StepperScrollArrow = ({
|
|
24
|
+
direction,
|
|
25
|
+
enabled,
|
|
26
|
+
visible,
|
|
27
|
+
onClick,
|
|
28
|
+
}: StepperScrollArrowProps) => {
|
|
29
|
+
const isLeft = direction === 'left';
|
|
30
|
+
const Icon = isLeft ? ChevronLeftIcon : ChevronRightIcon;
|
|
31
|
+
const ariaLabel = isLeft ? 'Anterior' : 'Siguiente';
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<IconButton
|
|
35
|
+
aria-label={ariaLabel}
|
|
36
|
+
size="small"
|
|
37
|
+
onClick={onClick}
|
|
38
|
+
disabled={!enabled}
|
|
39
|
+
sx={{
|
|
40
|
+
flex: '0 0 auto',
|
|
41
|
+
// Reservamos el slot siempre que haya overflow en algún lado,
|
|
42
|
+
// así el área scroll tiene un ancho estable (no saltan los
|
|
43
|
+
// steps cuando aparece/desaparece la flecha).
|
|
44
|
+
visibility: visible ? 'visible' : 'hidden',
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<Icon fontSize="small" />
|
|
48
|
+
</IconButton>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Stepper, default } from './Stepper';
|
|
2
|
+
export type { StepperProps } from './Stepper';
|
|
3
|
+
|
|
4
|
+
export { Step } from './Step';
|
|
5
|
+
export type { StepProps } from './Step';
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
StepperProvider,
|
|
9
|
+
StepperContext,
|
|
10
|
+
useStepper,
|
|
11
|
+
} from './StepperContext';
|
|
12
|
+
export type {
|
|
13
|
+
StepperContextValue,
|
|
14
|
+
StepperProviderProps,
|
|
15
|
+
} from './StepperContext';
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Switch.definitions.ts — código fuente para la pestaña Docs de Storybook.
|
|
2
|
+
|
|
3
|
+
export const BasicSwitchDefinition = `
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { Switch } from './Switch';
|
|
6
|
+
import { Box, Typography } from '@mui/material';
|
|
7
|
+
|
|
8
|
+
export const BasicSwitchExample = () => {
|
|
9
|
+
const [checked, setChecked] = useState(false);
|
|
10
|
+
return (
|
|
11
|
+
<Box sx={{ width: 280 }}>
|
|
12
|
+
<Switch checked={checked} onChange={setChecked} />
|
|
13
|
+
<Typography sx={{ mt: 2 }}>Estado: {checked ? 'ON' : 'OFF'}</Typography>
|
|
14
|
+
</Box>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const SwitchWithLabelDefinition = `
|
|
20
|
+
import React, { useState } from 'react';
|
|
21
|
+
import { Switch } from './Switch';
|
|
22
|
+
import { Box } from '@mui/material';
|
|
23
|
+
|
|
24
|
+
export const SwitchWithLabelExample = () => {
|
|
25
|
+
const [checked, setChecked] = useState(true);
|
|
26
|
+
return (
|
|
27
|
+
<Box sx={{ width: 280 }}>
|
|
28
|
+
<Switch
|
|
29
|
+
label="Notificaciones por email"
|
|
30
|
+
checked={checked}
|
|
31
|
+
onChange={setChecked}
|
|
32
|
+
/>
|
|
33
|
+
</Box>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const BorderedSwitchDefinition = `
|
|
39
|
+
import React, { useState } from 'react';
|
|
40
|
+
import { Switch } from './Switch';
|
|
41
|
+
import { Box } from '@mui/material';
|
|
42
|
+
|
|
43
|
+
export const BorderedSwitchExample = () => {
|
|
44
|
+
const [checked, setChecked] = useState(true);
|
|
45
|
+
return (
|
|
46
|
+
<Box sx={{ width: 360 }}>
|
|
47
|
+
<Switch
|
|
48
|
+
label="Recibir reportes diarios"
|
|
49
|
+
checked={checked}
|
|
50
|
+
onChange={setChecked}
|
|
51
|
+
bordered
|
|
52
|
+
/>
|
|
53
|
+
</Box>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
export const SwitchSizesDefinition = `
|
|
59
|
+
import React, { useState } from 'react';
|
|
60
|
+
import { Switch } from './Switch';
|
|
61
|
+
import { Box } from '@mui/material';
|
|
62
|
+
|
|
63
|
+
export const SwitchSizesExample = () => {
|
|
64
|
+
const [a, setA] = useState(false);
|
|
65
|
+
const [b, setB] = useState(true);
|
|
66
|
+
return (
|
|
67
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, width: 280 }}>
|
|
68
|
+
<Switch label="Pequeño" size="small" checked={a} onChange={setA} />
|
|
69
|
+
<Switch label="Mediano (default)" size="medium" checked={b} onChange={setB} />
|
|
70
|
+
</Box>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
export const SwitchWithErrorDefinition = `
|
|
76
|
+
import React, { useState } from 'react';
|
|
77
|
+
import { Switch } from './Switch';
|
|
78
|
+
import { Box } from '@mui/material';
|
|
79
|
+
|
|
80
|
+
export const SwitchWithErrorExample = () => {
|
|
81
|
+
const [checked, setChecked] = useState(false);
|
|
82
|
+
const hasError = !checked;
|
|
83
|
+
return (
|
|
84
|
+
<Box sx={{ width: 320 }}>
|
|
85
|
+
<Switch
|
|
86
|
+
label="Aceptar términos y condiciones"
|
|
87
|
+
checked={checked}
|
|
88
|
+
onChange={setChecked}
|
|
89
|
+
error={hasError}
|
|
90
|
+
helperText={hasError ? 'Debes aceptar los términos para continuar' : ''}
|
|
91
|
+
/>
|
|
92
|
+
</Box>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
export const DisabledSwitchDefinition = `
|
|
98
|
+
import React from 'react';
|
|
99
|
+
import { Switch } from './Switch';
|
|
100
|
+
import { Box } from '@mui/material';
|
|
101
|
+
|
|
102
|
+
export const DisabledSwitchExample = () => (
|
|
103
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, width: 280 }}>
|
|
104
|
+
<Switch label="Off bloqueado" checked={false} onChange={() => {}} disabled />
|
|
105
|
+
<Switch label="On bloqueado" checked={true} onChange={() => {}} disabled />
|
|
106
|
+
</Box>
|
|
107
|
+
);
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
export const RHFSwitchDefinition = `
|
|
111
|
+
import React from 'react';
|
|
112
|
+
import { useForm } from 'react-hook-form';
|
|
113
|
+
import { Switch } from './Switch';
|
|
114
|
+
import { Box, Button, Typography } from '@mui/material';
|
|
115
|
+
|
|
116
|
+
export const RHFSwitchExample = () => {
|
|
117
|
+
const { control, handleSubmit, watch } = useForm({
|
|
118
|
+
defaultValues: { darkMode: false },
|
|
119
|
+
});
|
|
120
|
+
const value = watch('darkMode');
|
|
121
|
+
return (
|
|
122
|
+
<Box sx={{ width: 320 }} component="form" onSubmit={handleSubmit(console.log)}>
|
|
123
|
+
<Switch
|
|
124
|
+
label="Modo oscuro"
|
|
125
|
+
name="darkMode"
|
|
126
|
+
control={control}
|
|
127
|
+
bordered
|
|
128
|
+
/>
|
|
129
|
+
<Typography sx={{ mt: 2 }}>Valor en el form: {String(value)}</Typography>
|
|
130
|
+
<Button type="submit" sx={{ mt: 1 }}>Enviar</Button>
|
|
131
|
+
</Box>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
`;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Box, Button, Typography } from '@mui/material';
|
|
4
|
+
import { useForm } from 'react-hook-form';
|
|
5
|
+
|
|
6
|
+
import { Switch } from './Switch';
|
|
7
|
+
import {
|
|
8
|
+
BasicSwitchDefinition,
|
|
9
|
+
SwitchWithLabelDefinition,
|
|
10
|
+
BorderedSwitchDefinition,
|
|
11
|
+
SwitchSizesDefinition,
|
|
12
|
+
SwitchWithErrorDefinition,
|
|
13
|
+
DisabledSwitchDefinition,
|
|
14
|
+
RHFSwitchDefinition,
|
|
15
|
+
} from './Switch.definitions';
|
|
16
|
+
|
|
17
|
+
// =============================================================================
|
|
18
|
+
// Meta
|
|
19
|
+
// =============================================================================
|
|
20
|
+
const meta: Meta<typeof Switch> = {
|
|
21
|
+
title: 'Components/Switch',
|
|
22
|
+
component: Switch,
|
|
23
|
+
tags: ['autodocs'],
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: 'centered',
|
|
26
|
+
docs: {
|
|
27
|
+
description: {
|
|
28
|
+
component:
|
|
29
|
+
'Un toggle/switch basado en MUI `Switch`. Soporta modo controlado (`checked` + `onChange`) ' +
|
|
30
|
+
'y modo react-hook-form (`name` + `control`). Mantiene compatibilidad visual con el legacy ' +
|
|
31
|
+
'`FormToggleInput` mediante la prop `bordered` (label a la izquierda, switch a la derecha).',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
argTypes: {
|
|
36
|
+
label: { control: 'text', description: 'Texto al lado del switch. Si está ausente, se renderiza solo el switch.' },
|
|
37
|
+
labelPlacement: {
|
|
38
|
+
control: 'radio',
|
|
39
|
+
options: ['start', 'end', 'top', 'bottom'],
|
|
40
|
+
description: 'Posición del label respecto al switch. Default: `end`.',
|
|
41
|
+
},
|
|
42
|
+
size: { control: 'radio', options: ['small', 'medium'], description: 'Tamaño del switch. Default: `medium`.' },
|
|
43
|
+
bordered: { control: 'boolean', description: 'Renderizar contenedor con borde estilo "form field". Default: false.' },
|
|
44
|
+
borderRadius: { control: { type: 'number' }, description: 'Border radius del contenedor cuando `bordered`. Default: 10.' },
|
|
45
|
+
disabled: { control: 'boolean', description: 'Deshabilitar el switch.' },
|
|
46
|
+
error: { control: 'boolean', description: 'Estado de error visual.' },
|
|
47
|
+
helperText: { control: 'text', description: 'Texto auxiliar debajo del switch.' },
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
type Story = StoryObj<typeof Switch>;
|
|
53
|
+
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// Stories
|
|
56
|
+
// =============================================================================
|
|
57
|
+
|
|
58
|
+
export const BasicSwitch: Story = {
|
|
59
|
+
render: () => {
|
|
60
|
+
const [checked, setChecked] = useState(false);
|
|
61
|
+
return (
|
|
62
|
+
<Box sx={{ width: 280 }}>
|
|
63
|
+
<Switch checked={checked} onChange={setChecked} />
|
|
64
|
+
<Typography sx={{ mt: 2 }}>Estado: {checked ? 'ON' : 'OFF'}</Typography>
|
|
65
|
+
</Box>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
parameters: {
|
|
69
|
+
docs: {
|
|
70
|
+
description: { story: 'Uso mínimo, sin label. Equivalente al legacy `ToggleInputReport`.' },
|
|
71
|
+
source: { code: BasicSwitchDefinition.trim() },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const SwitchWithLabel: Story = {
|
|
77
|
+
render: () => {
|
|
78
|
+
const [checked, setChecked] = useState(true);
|
|
79
|
+
return (
|
|
80
|
+
<Box sx={{ width: 280 }}>
|
|
81
|
+
<Switch
|
|
82
|
+
label="Notificaciones por email"
|
|
83
|
+
checked={checked}
|
|
84
|
+
onChange={setChecked}
|
|
85
|
+
/>
|
|
86
|
+
</Box>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: { story: 'Switch con label a la derecha (default `labelPlacement="end"`).' },
|
|
92
|
+
source: { code: SwitchWithLabelDefinition.trim() },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const BorderedSwitch: Story = {
|
|
98
|
+
render: () => {
|
|
99
|
+
const [checked, setChecked] = useState(true);
|
|
100
|
+
return (
|
|
101
|
+
<Box sx={{ width: 360 }}>
|
|
102
|
+
<Switch
|
|
103
|
+
label="Recibir reportes diarios"
|
|
104
|
+
checked={checked}
|
|
105
|
+
onChange={setChecked}
|
|
106
|
+
bordered
|
|
107
|
+
/>
|
|
108
|
+
</Box>
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
parameters: {
|
|
112
|
+
docs: {
|
|
113
|
+
description: {
|
|
114
|
+
story:
|
|
115
|
+
'Variante con `bordered`: contenedor con borde, label a la izquierda y switch al borde opuesto. ' +
|
|
116
|
+
'Replica el estilo del legacy `FormToggleInput`.',
|
|
117
|
+
},
|
|
118
|
+
source: { code: BorderedSwitchDefinition.trim() },
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const SwitchSizes: Story = {
|
|
124
|
+
render: () => {
|
|
125
|
+
const [a, setA] = useState(false);
|
|
126
|
+
const [b, setB] = useState(true);
|
|
127
|
+
return (
|
|
128
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, width: 280 }}>
|
|
129
|
+
<Switch label="Pequeño" size="small" checked={a} onChange={setA} />
|
|
130
|
+
<Switch label="Mediano (default)" size="medium" checked={b} onChange={setB} />
|
|
131
|
+
</Box>
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
parameters: {
|
|
135
|
+
docs: {
|
|
136
|
+
description: { story: 'Tamaños disponibles: `small` y `medium` (default).' },
|
|
137
|
+
source: { code: SwitchSizesDefinition.trim() },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const SwitchWithError: Story = {
|
|
143
|
+
render: () => {
|
|
144
|
+
const [checked, setChecked] = useState(false);
|
|
145
|
+
const hasError = !checked;
|
|
146
|
+
return (
|
|
147
|
+
<Box sx={{ width: 320 }}>
|
|
148
|
+
<Switch
|
|
149
|
+
label="Aceptar términos y condiciones"
|
|
150
|
+
checked={checked}
|
|
151
|
+
onChange={setChecked}
|
|
152
|
+
error={hasError}
|
|
153
|
+
helperText={hasError ? 'Debes aceptar los términos para continuar' : ''}
|
|
154
|
+
/>
|
|
155
|
+
</Box>
|
|
156
|
+
);
|
|
157
|
+
},
|
|
158
|
+
parameters: {
|
|
159
|
+
docs: {
|
|
160
|
+
description: { story: 'Estado de error con `error` + `helperText`.' },
|
|
161
|
+
source: { code: SwitchWithErrorDefinition.trim() },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const DisabledSwitch: Story = {
|
|
167
|
+
render: () => (
|
|
168
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, width: 280 }}>
|
|
169
|
+
<Switch label="Off bloqueado" checked={false} onChange={() => {}} disabled />
|
|
170
|
+
<Switch label="On bloqueado" checked={true} onChange={() => {}} disabled />
|
|
171
|
+
</Box>
|
|
172
|
+
),
|
|
173
|
+
parameters: {
|
|
174
|
+
docs: {
|
|
175
|
+
description: { story: 'Switch deshabilitado en ambos estados.' },
|
|
176
|
+
source: { code: DisabledSwitchDefinition.trim() },
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const RHFSwitch: Story = {
|
|
182
|
+
render: () => {
|
|
183
|
+
const { control, handleSubmit, watch } = useForm({
|
|
184
|
+
defaultValues: { darkMode: false },
|
|
185
|
+
});
|
|
186
|
+
const value = watch('darkMode');
|
|
187
|
+
return (
|
|
188
|
+
<Box
|
|
189
|
+
sx={{ width: 320 }}
|
|
190
|
+
component="form"
|
|
191
|
+
onSubmit={handleSubmit((data) => console.log(data))}
|
|
192
|
+
>
|
|
193
|
+
<Switch
|
|
194
|
+
label="Modo oscuro"
|
|
195
|
+
name="darkMode"
|
|
196
|
+
control={control}
|
|
197
|
+
bordered
|
|
198
|
+
/>
|
|
199
|
+
<Typography sx={{ mt: 2 }}>Valor en el form: {String(value)}</Typography>
|
|
200
|
+
<Button type="submit" sx={{ mt: 1 }}>Enviar</Button>
|
|
201
|
+
</Box>
|
|
202
|
+
);
|
|
203
|
+
},
|
|
204
|
+
parameters: {
|
|
205
|
+
docs: {
|
|
206
|
+
description: {
|
|
207
|
+
story:
|
|
208
|
+
'Modo react-hook-form con `name` + `control`. El valor `true`/`false` viaja directo al form state.',
|
|
209
|
+
},
|
|
210
|
+
source: { code: RHFSwitchDefinition.trim() },
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
export interface BuildSwitchSxOptions {
|
|
4
|
+
bordered: boolean;
|
|
5
|
+
borderRadius: number | string;
|
|
6
|
+
hasLabel: boolean;
|
|
7
|
+
error: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const toRadius = (borderRadius: number | string) =>
|
|
11
|
+
typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Transición compartida (matchea el InputGroup y el RadioGroup).
|
|
15
|
+
*/
|
|
16
|
+
const FOCUS_TRANSITION =
|
|
17
|
+
'border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +
|
|
18
|
+
'box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Builder de sx para Switch. Reproduce el estilo del antiguo
|
|
22
|
+
* `FormToggleInput` legacy cuando `bordered=true`: contenedor con borde,
|
|
23
|
+
* label a la izquierda y switch a la derecha (vía justify-content: space-between).
|
|
24
|
+
*
|
|
25
|
+
* Cuando `bordered=true`, el contenedor gana:
|
|
26
|
+
* - `:focus-within` → borde + shadow primario (mismo patrón que `InputGroup`).
|
|
27
|
+
* - `error=true` → borde + shadow de error (palette.error.main).
|
|
28
|
+
*
|
|
29
|
+
* El shadow es de 1px, así que no hay shift de layout — sólo se intensifica
|
|
30
|
+
* visualmente el borde sin empujar nada alrededor.
|
|
31
|
+
*
|
|
32
|
+
* Si `bordered=false`, sólo aplica un reset de margin del helper text.
|
|
33
|
+
*/
|
|
34
|
+
export const buildSwitchSx = ({
|
|
35
|
+
bordered,
|
|
36
|
+
borderRadius,
|
|
37
|
+
hasLabel,
|
|
38
|
+
error,
|
|
39
|
+
}: BuildSwitchSxOptions): SxProps<Theme> => {
|
|
40
|
+
const radius = toRadius(borderRadius);
|
|
41
|
+
|
|
42
|
+
if (!bordered) {
|
|
43
|
+
return {
|
|
44
|
+
'& .MuiFormHelperText-root': { marginLeft: 0 },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (theme) => ({
|
|
49
|
+
'& .MuiFormControlLabel-root': {
|
|
50
|
+
marginLeft: 0,
|
|
51
|
+
marginRight: 0,
|
|
52
|
+
paddingX: 1.5,
|
|
53
|
+
paddingY: 1.25,
|
|
54
|
+
border: `1px solid ${
|
|
55
|
+
error ? theme.palette.error.main : theme.palette.divider
|
|
56
|
+
}`,
|
|
57
|
+
borderRadius: radius,
|
|
58
|
+
transition: FOCUS_TRANSITION,
|
|
59
|
+
...(error && {
|
|
60
|
+
boxShadow: `0 0 0 1px ${theme.palette.error.main}`,
|
|
61
|
+
}),
|
|
62
|
+
// Focus del usuario sobre el switch interno.
|
|
63
|
+
'&:focus-within': {
|
|
64
|
+
borderColor: error
|
|
65
|
+
? theme.palette.error.main
|
|
66
|
+
: theme.palette.primary.main,
|
|
67
|
+
boxShadow: `0 0 0 1px ${
|
|
68
|
+
error ? theme.palette.error.main : theme.palette.primary.main
|
|
69
|
+
}`,
|
|
70
|
+
},
|
|
71
|
+
// Si hay label, separar el switch al borde opuesto.
|
|
72
|
+
...(hasLabel && {
|
|
73
|
+
width: '100%',
|
|
74
|
+
justifyContent: 'space-between',
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
'& .MuiFormHelperText-root': {
|
|
78
|
+
marginLeft: 0,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { useTheme } from '@mui/material/styles';
|
|
2
|
+
import {
|
|
3
|
+
FormControl,
|
|
4
|
+
FormControlLabel,
|
|
5
|
+
FormHelperText,
|
|
6
|
+
Switch as MuiSwitch,
|
|
7
|
+
type SwitchProps as MuiSwitchProps,
|
|
8
|
+
type SxProps,
|
|
9
|
+
type Theme,
|
|
10
|
+
} from '@mui/material';
|
|
11
|
+
import { Controller, type Control, type RegisterOptions } from 'react-hook-form';
|
|
12
|
+
|
|
13
|
+
import { buildSwitchSx } from './Switch.sx';
|
|
14
|
+
import { resolvePreset } from '../_shared/resolvePreset';
|
|
15
|
+
|
|
16
|
+
// ── Tipos de dominio ─────────────────────────────────────────────────────
|
|
17
|
+
export type SwitchSize = 'small' | 'medium';
|
|
18
|
+
export type SwitchLabelPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
19
|
+
|
|
20
|
+
// ── Props base (todo lo común entre RHF y controlado) ────────────────────
|
|
21
|
+
export interface BaseSwitchProps
|
|
22
|
+
extends Omit<MuiSwitchProps, 'value' | 'onChange' | 'checked' | 'defaultChecked' | 'size'> {
|
|
23
|
+
/** Texto al lado del switch. Si está ausente, no se renderiza FormControlLabel. */
|
|
24
|
+
label?: string;
|
|
25
|
+
size?: SwitchSize;
|
|
26
|
+
/** Posición del label. Default: 'end' (legacy `FormToggleInput` lo ponía a la izquierda con su flex-stack). */
|
|
27
|
+
labelPlacement?: SwitchLabelPlacement;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
error?: boolean;
|
|
30
|
+
helperText?: string;
|
|
31
|
+
/** Renderiza un contenedor con borde alrededor del switch + label. Default: false. */
|
|
32
|
+
bordered?: boolean;
|
|
33
|
+
/** Border radius del contenedor (cuando bordered). Default: 10. */
|
|
34
|
+
borderRadius?: number | string;
|
|
35
|
+
defaultChecked?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Nombre del preset de estilo registrado en `theme.styles.Switch`.
|
|
38
|
+
* - `"default"` (o ausente) = estilo built-in del paquete.
|
|
39
|
+
* - Cualquier otro string = mergea el preset encima del estilo built-in.
|
|
40
|
+
*/
|
|
41
|
+
preset?: string;
|
|
42
|
+
sx?: SxProps<Theme>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ── Variantes discriminadas (RHF vs controlado) ──────────────────────────
|
|
46
|
+
export interface RHFSwitchProps extends BaseSwitchProps {
|
|
47
|
+
name: string;
|
|
48
|
+
// `any` plano (no `Control<any>`): RHF tipa `Control<T>` con generics en
|
|
49
|
+
// posiciones tanto contravariantes como covariantes (ej. `_subjects.state`).
|
|
50
|
+
// Cuando el componente o su uso involucra generics adicionales, TS se
|
|
51
|
+
// confunde narroweando el discriminated union y `Control<any>` no logra
|
|
52
|
+
// absorber `Control<MyForm>` en la comparación estructural profunda. El
|
|
53
|
+
// `any` plano elimina ese ruido. RHF adentro sigue teniendo sus tipos
|
|
54
|
+
// fuertes — solo degradamos la superficie del prop del componente.
|
|
55
|
+
control: any;
|
|
56
|
+
validation?: RegisterOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Side-effect que corre después de que RHF actualiza el form state.
|
|
59
|
+
* Útil para cascadas entre campos. NO reemplaza al handler de RHF.
|
|
60
|
+
*/
|
|
61
|
+
onValueChange?: (checked: boolean) => void;
|
|
62
|
+
checked?: never;
|
|
63
|
+
onChange?: never;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ControlledSwitchProps extends BaseSwitchProps {
|
|
67
|
+
name?: string;
|
|
68
|
+
control?: never;
|
|
69
|
+
validation?: never;
|
|
70
|
+
checked: boolean;
|
|
71
|
+
onChange: (checked: boolean) => void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ── API pública final ────────────────────────────────────────────────────
|
|
75
|
+
export type SwitchProps = RHFSwitchProps | ControlledSwitchProps;
|
|
76
|
+
|
|
77
|
+
export const Switch: React.FC<SwitchProps> = (props) => {
|
|
78
|
+
const {
|
|
79
|
+
label,
|
|
80
|
+
size = 'medium',
|
|
81
|
+
labelPlacement = 'end',
|
|
82
|
+
disabled = false,
|
|
83
|
+
error = false,
|
|
84
|
+
helperText,
|
|
85
|
+
bordered = false,
|
|
86
|
+
borderRadius = 10,
|
|
87
|
+
defaultChecked,
|
|
88
|
+
preset,
|
|
89
|
+
sx,
|
|
90
|
+
...rest
|
|
91
|
+
} = props as ControlledSwitchProps & {
|
|
92
|
+
control?: Control<any>;
|
|
93
|
+
validation?: RegisterOptions;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const theme = useTheme();
|
|
97
|
+
const presetSx = resolvePreset('Switch', preset, theme);
|
|
98
|
+
|
|
99
|
+
// Construye el sx con el estado de error efectivo; se llama por rama
|
|
100
|
+
// (RHF usa el error del Controller, controlado usa el prop `error`).
|
|
101
|
+
const buildSx = (effectiveError: boolean) => [
|
|
102
|
+
buildSwitchSx({
|
|
103
|
+
bordered,
|
|
104
|
+
borderRadius,
|
|
105
|
+
hasLabel: !!label,
|
|
106
|
+
error: effectiveError,
|
|
107
|
+
}),
|
|
108
|
+
...(presetSx ? [presetSx] : []),
|
|
109
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
const renderSwitch = (
|
|
113
|
+
checked: boolean,
|
|
114
|
+
onChange: (next: boolean) => void,
|
|
115
|
+
onBlur?: () => void,
|
|
116
|
+
inputRef?: React.Ref<HTMLInputElement>,
|
|
117
|
+
) => {
|
|
118
|
+
const switchEl = (
|
|
119
|
+
<MuiSwitch
|
|
120
|
+
{...rest}
|
|
121
|
+
size={size}
|
|
122
|
+
checked={!!checked}
|
|
123
|
+
onChange={(_e, next) => onChange(next)}
|
|
124
|
+
onBlur={onBlur}
|
|
125
|
+
// @ts-ignore — Ref<HTMLInputElement> type mismatch between @types/react versions in monorepo
|
|
126
|
+
inputRef={inputRef}
|
|
127
|
+
disabled={disabled}
|
|
128
|
+
/>
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
return label ? (
|
|
132
|
+
<FormControlLabel
|
|
133
|
+
control={switchEl}
|
|
134
|
+
label={label}
|
|
135
|
+
labelPlacement={labelPlacement}
|
|
136
|
+
disabled={disabled}
|
|
137
|
+
/>
|
|
138
|
+
) : (
|
|
139
|
+
switchEl
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// ── RHF mode ──────────────────────────────────────────────────────────
|
|
144
|
+
if ('control' in props && props.control) {
|
|
145
|
+
const { name, control, validation, onValueChange } = props as RHFSwitchProps;
|
|
146
|
+
return (
|
|
147
|
+
<Controller
|
|
148
|
+
name={name}
|
|
149
|
+
control={control}
|
|
150
|
+
rules={validation}
|
|
151
|
+
defaultValue={defaultChecked}
|
|
152
|
+
render={({ field, fieldState: { error: fieldError } }) => {
|
|
153
|
+
const finalError = !!fieldError || error;
|
|
154
|
+
const finalHelperText = fieldError?.message ?? helperText;
|
|
155
|
+
return (
|
|
156
|
+
<FormControl
|
|
157
|
+
error={finalError}
|
|
158
|
+
disabled={disabled}
|
|
159
|
+
sx={buildSx(finalError)}
|
|
160
|
+
>
|
|
161
|
+
{renderSwitch(
|
|
162
|
+
!!field.value,
|
|
163
|
+
(next) => {
|
|
164
|
+
field.onChange(next);
|
|
165
|
+
onValueChange?.(next);
|
|
166
|
+
},
|
|
167
|
+
field.onBlur,
|
|
168
|
+
field.ref,
|
|
169
|
+
)}
|
|
170
|
+
{finalHelperText && <FormHelperText>{finalHelperText}</FormHelperText>}
|
|
171
|
+
</FormControl>
|
|
172
|
+
);
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ── Controlled mode ───────────────────────────────────────────────────
|
|
179
|
+
const { checked, onChange } = props as ControlledSwitchProps;
|
|
180
|
+
return (
|
|
181
|
+
<FormControl error={error} disabled={disabled} sx={buildSx(error)}>
|
|
182
|
+
{renderSwitch(checked, onChange)}
|
|
183
|
+
{helperText && <FormHelperText>{helperText}</FormHelperText>}
|
|
184
|
+
</FormControl>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export default Switch;
|