@soyfri/shared-library 1.5.0 → 1.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button-C17mExpd.cjs.map +1 -0
- package/Button-UkkP-bNw.js.map +1 -0
- package/components/ActionMenu/ActionMenu.cjs +107 -0
- package/components/ActionMenu/ActionMenu.cjs.map +1 -0
- package/components/ActionMenu/ActionMenu.d.ts +44 -0
- package/components/ActionMenu/ActionMenu.js +107 -0
- package/components/ActionMenu/ActionMenu.js.map +1 -0
- package/components/ActionMenu/index.d.ts +2 -0
- package/components/ActionMenu.d.ts +6 -0
- package/components/AppBar/AppBar.cjs +129 -0
- package/components/AppBar/AppBar.cjs.map +1 -0
- package/components/AppBar/AppBar.d.ts +55 -0
- package/components/AppBar/AppBar.js +129 -0
- package/components/AppBar/AppBar.js.map +1 -0
- package/components/AppBar/AppBar.sx.d.ts +12 -0
- package/components/AppBar/AppBarContext.d.ts +18 -0
- package/components/AppBar/AppBarMenuToggle.d.ts +39 -0
- package/components/AppBar/index.d.ts +6 -0
- package/components/AppBar.d.ts +6 -0
- package/components/Autocomplete/Autocomplete.cjs +313 -0
- package/components/Autocomplete/Autocomplete.cjs.map +1 -0
- package/components/Autocomplete/Autocomplete.d.ts +86 -0
- package/components/Autocomplete/Autocomplete.definitions.d.ts +16 -0
- package/components/Autocomplete/Autocomplete.helpers.d.ts +22 -0
- package/components/Autocomplete/Autocomplete.js +313 -0
- package/components/Autocomplete/Autocomplete.js.map +1 -0
- package/components/Autocomplete/Autocomplete.sx.d.ts +7 -0
- package/components/Autocomplete/_parts/AutocompleteChips.d.ts +20 -0
- package/components/Autocomplete/_parts/AutocompleteLoader.d.ts +9 -0
- package/components/Autocomplete/_parts/AutocompleteOption.d.ts +16 -0
- package/components/Autocomplete/index.d.ts +2 -0
- package/components/Autocomplete.d.ts +6 -0
- package/components/Avatar/Avatar.cjs +162 -0
- package/components/Avatar/Avatar.cjs.map +1 -0
- package/components/Avatar/Avatar.d.ts +33 -0
- package/components/Avatar/Avatar.definitions.d.ts +11 -0
- package/components/Avatar/Avatar.js +162 -0
- package/components/Avatar/Avatar.js.map +1 -0
- package/components/Avatar/index.d.ts +2 -0
- package/{dist/components → components}/Button/Button.d.ts +5 -5
- package/{dist/components → components}/Button/index.d.ts +1 -0
- package/components/Card/Card.cjs +99 -0
- package/components/Card/Card.cjs.map +1 -0
- package/components/Card/Card.d.ts +36 -0
- package/components/Card/Card.js +99 -0
- package/components/Card/Card.js.map +1 -0
- package/components/Card/Card.sx.d.ts +14 -0
- package/components/Card/index.d.ts +4 -0
- package/components/Card.d.ts +6 -0
- package/components/Checkbox/Checkbox.cjs +189 -0
- package/components/Checkbox/Checkbox.cjs.map +1 -0
- package/components/Checkbox/Checkbox.d.ts +55 -0
- package/components/Checkbox/Checkbox.js +189 -0
- package/components/Checkbox/Checkbox.js.map +1 -0
- package/components/Checkbox/Checkbox.sx.d.ts +13 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox.d.ts +6 -0
- package/{dist/components → components}/Chip/Chip.cjs +2 -1
- package/components/Chip/Chip.cjs.map +1 -0
- package/{dist/components → components}/Chip/Chip.js +2 -1
- package/components/Chip/Chip.js.map +1 -0
- package/components/Chip/index.d.ts +2 -0
- package/components/Chip.d.ts +6 -0
- package/components/DatePicker/DatePicker.cjs +180 -0
- package/components/DatePicker/DatePicker.cjs.map +1 -0
- package/components/DatePicker/DatePicker.d.ts +44 -0
- package/{dist/components → components}/DatePicker/DatePicker.definitions.d.ts +1 -0
- package/components/DatePicker/DatePicker.helpers.d.ts +7 -0
- package/components/DatePicker/DatePicker.js +180 -0
- package/components/DatePicker/DatePicker.js.map +1 -0
- package/components/DatePicker/DatePicker.sx.d.ts +9 -0
- package/components/DatePicker/index.d.ts +2 -0
- package/components/DatePicker.d.ts +6 -0
- package/components/DateTimePicker/DateTimePicker.cjs +198 -0
- package/components/DateTimePicker/DateTimePicker.cjs.map +1 -0
- package/components/DateTimePicker/DateTimePicker.d.ts +57 -0
- package/{dist/components → components}/DateTimePicker/DateTimePicker.definitions.d.ts +3 -0
- package/components/DateTimePicker/DateTimePicker.helpers.d.ts +13 -0
- package/components/DateTimePicker/DateTimePicker.js +198 -0
- package/components/DateTimePicker/DateTimePicker.js.map +1 -0
- package/components/DateTimePicker/DateTimePicker.sx.d.ts +7 -0
- package/components/DateTimePicker/index.d.ts +2 -0
- package/components/DateTimePicker.d.ts +6 -0
- package/components/Drawer/Drawer.cjs +272 -0
- package/components/Drawer/Drawer.cjs.map +1 -0
- package/components/Drawer/Drawer.d.ts +58 -0
- package/components/Drawer/Drawer.js +272 -0
- package/components/Drawer/Drawer.js.map +1 -0
- package/components/Drawer/Drawer.sx.d.ts +23 -0
- package/components/Drawer/DrawerContext.d.ts +18 -0
- package/components/Drawer/DrawerItem.d.ts +40 -0
- package/components/Drawer/index.d.ts +6 -0
- package/components/Drawer.d.ts +6 -0
- package/{dist/components → components}/Gallery/Gallery.cjs +154 -79
- package/components/Gallery/Gallery.cjs.map +1 -0
- package/components/Gallery/Gallery.d.ts +28 -0
- package/{dist/components → components}/Gallery/Gallery.js +154 -79
- package/components/Gallery/Gallery.js.map +1 -0
- package/components/Gallery/GalleryLightbox.d.ts +16 -0
- package/{dist/components → components}/Gallery/GalleryMain.d.ts +3 -7
- package/components/Gallery/GalleryThumbnails.d.ts +13 -0
- package/components/Gallery/index.d.ts +2 -0
- package/components/Gallery.d.ts +6 -0
- package/{dist/components → components}/Icon/Icon.cjs +49 -10
- package/components/Icon/Icon.cjs.map +1 -0
- package/components/Icon/Icon.d.ts +48 -0
- package/{dist/components → components}/Icon/Icon.js +49 -10
- package/components/Icon/Icon.js.map +1 -0
- package/components/Icon/index.d.ts +2 -0
- package/components/Icon.d.ts +6 -0
- package/components/Input/Input.cjs +188 -0
- package/components/Input/Input.cjs.map +1 -0
- package/components/Input/Input.d.ts +44 -0
- package/{dist/components → components}/Input/Input.definitions.d.ts +6 -2
- package/components/Input/Input.helpers.d.ts +14 -0
- package/components/Input/Input.js +188 -0
- package/components/Input/Input.js.map +1 -0
- package/components/Input/Input.sx.d.ts +8 -0
- package/components/Input/index.d.ts +2 -0
- package/components/Input.d.ts +6 -0
- package/components/InputGroup/InputGroup.cjs +140 -0
- package/components/InputGroup/InputGroup.cjs.map +1 -0
- package/components/InputGroup/InputGroup.d.ts +42 -0
- package/components/InputGroup/InputGroup.definitions.d.ts +6 -0
- package/components/InputGroup/InputGroup.js +140 -0
- package/components/InputGroup/InputGroup.js.map +1 -0
- package/components/InputGroup/index.d.ts +2 -0
- package/components/InputGroup.d.ts +6 -0
- package/components/Modal/Modal.cjs +348 -0
- package/components/Modal/Modal.cjs.map +1 -0
- package/components/Modal/Modal.d.ts +80 -0
- package/components/Modal/Modal.js +348 -0
- package/components/Modal/Modal.js.map +1 -0
- package/components/Modal/ModalBody.d.ts +11 -0
- package/components/Modal/ModalFooter.d.ts +27 -0
- package/components/Modal/ModalHeader.d.ts +11 -0
- package/components/Modal/index.d.ts +8 -0
- package/components/Modal.d.ts +6 -0
- package/components/RadioGroup/RadioGroup.cjs +204 -0
- package/components/RadioGroup/RadioGroup.cjs.map +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +59 -0
- package/components/RadioGroup/RadioGroup.definitions.d.ts +6 -0
- package/components/RadioGroup/RadioGroup.js +204 -0
- package/components/RadioGroup/RadioGroup.js.map +1 -0
- package/components/RadioGroup/RadioGroup.sx.d.ts +20 -0
- package/components/RadioGroup/index.d.ts +2 -0
- package/components/RadioGroup.d.ts +6 -0
- package/components/Select/Select.cjs +313 -0
- package/components/Select/Select.cjs.map +1 -0
- package/components/Select/Select.d.ts +95 -0
- package/components/Select/Select.helpers.d.ts +15 -0
- package/components/Select/Select.js +313 -0
- package/components/Select/Select.js.map +1 -0
- package/components/Select/Select.sx.d.ts +7 -0
- package/components/Select/_parts/SelectMenuItem.d.ts +20 -0
- package/components/Select/index.d.ts +2 -0
- package/components/Select.d.ts +6 -0
- package/{dist/components → components}/Stat/Stat.cjs +2 -2
- package/{dist/components → components}/Stat/Stat.cjs.map +1 -1
- package/{dist/components → components}/Stat/Stat.js +2 -2
- package/{dist/components → components}/Stat/Stat.js.map +1 -1
- package/components/Stat/index.d.ts +2 -0
- package/components/Stat.d.ts +6 -0
- package/components/StatusMessage/StatusMessage.cjs +90 -0
- package/components/StatusMessage/StatusMessage.cjs.map +1 -0
- package/components/StatusMessage/StatusMessage.d.ts +28 -0
- package/components/StatusMessage/StatusMessage.js +90 -0
- package/components/StatusMessage/StatusMessage.js.map +1 -0
- package/components/StatusMessage/index.d.ts +2 -0
- package/components/StatusMessage.d.ts +6 -0
- package/components/Stepper/Stepper.cjs +302 -0
- package/components/Stepper/Stepper.cjs.map +1 -0
- package/components/Stepper/Stepper.d.ts +17 -0
- package/components/Stepper/Stepper.js +302 -0
- package/components/Stepper/Stepper.js.map +1 -0
- package/components/Stepper/StepperContext.d.ts +73 -0
- package/components/Stepper/_hooks/useHorizontalScroll.d.ts +19 -0
- package/components/Stepper/_parts/StepperScrollArrow.d.ts +19 -0
- package/components/Stepper/index.d.ts +6 -0
- package/components/Stepper.d.ts +6 -0
- package/components/Switch/Switch.cjs +184 -0
- package/components/Switch/Switch.cjs.map +1 -0
- package/components/Switch/Switch.d.ts +48 -0
- package/components/Switch/Switch.definitions.d.ts +7 -0
- package/components/Switch/Switch.js +184 -0
- package/components/Switch/Switch.js.map +1 -0
- package/components/Switch/Switch.sx.d.ts +22 -0
- package/components/Switch/Switch.types.d.ts +1 -0
- package/components/Switch/index.d.ts +2 -0
- package/components/Switch.d.ts +6 -0
- package/components/Tabs/Tabs.cjs +112 -0
- package/components/Tabs/Tabs.cjs.map +1 -0
- package/components/Tabs/Tabs.d.ts +24 -0
- package/components/Tabs/Tabs.js +112 -0
- package/components/Tabs/Tabs.js.map +1 -0
- package/components/Tabs/index.d.ts +4 -0
- package/components/Tabs.d.ts +6 -0
- package/{dist/components → components}/Timeline/Timeline.cjs +3 -2
- package/components/Timeline/Timeline.cjs.map +1 -0
- package/components/Timeline/Timeline.d.ts +9 -0
- package/{dist/components → components}/Timeline/Timeline.js +3 -2
- package/components/Timeline/Timeline.js.map +1 -0
- package/components/Timeline/index.d.ts +4 -0
- package/components/Timeline.d.ts +6 -0
- package/components/_shared/formField.sx.d.ts +33 -0
- package/components/_shared/mergeSx.d.ts +7 -0
- package/components/_shared/resolvePreset.d.ts +18 -0
- package/formField.sx-8_QRnKxv.js +68 -0
- package/formField.sx-8_QRnKxv.js.map +1 -0
- package/formField.sx-BAX7KwMR.cjs +67 -0
- package/formField.sx-BAX7KwMR.cjs.map +1 -0
- package/index.cjs +145 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +49 -0
- package/index.js.map +1 -0
- package/mergeSx-BXoNZjB_.js +10 -0
- package/mergeSx-BXoNZjB_.js.map +1 -0
- package/mergeSx-Dbccoo_H.cjs +9 -0
- package/mergeSx-Dbccoo_H.cjs.map +1 -0
- package/mui.d.ts +7 -0
- package/package.json +164 -43
- package/resolvePreset-B-IB0ehH.js +15 -0
- package/resolvePreset-B-IB0ehH.js.map +1 -0
- package/resolvePreset-CT3kU-K2.cjs +14 -0
- package/resolvePreset-CT3kU-K2.cjs.map +1 -0
- package/theme/componentStyles.d.ts +32 -0
- package/theme/tokens.d.ts +28 -0
- package/tokens-BRrcP_p_.js +21 -0
- package/tokens-BRrcP_p_.js.map +1 -0
- package/tokens-jaWWNk39.cjs +20 -0
- package/tokens-jaWWNk39.cjs.map +1 -0
- package/utils/index.d.ts +2 -0
- package/utils/scrollToTop.d.ts +28 -0
- package/.dockerignore +0 -8
- package/.github/workflows/publish.yml +0 -107
- package/.prettierrc +0 -3
- package/.storybook/main.ts +0 -19
- package/.storybook/preview.ts +0 -14
- package/.storybook/vitest.setup.ts +0 -9
- package/Dockerfile +0 -37
- package/build.js +0 -102
- package/chromatic.config.json +0 -5
- package/cleanDirectories.js +0 -40
- package/dist/Button-C17mExpd.cjs.map +0 -1
- package/dist/Button-UkkP-bNw.js.map +0 -1
- 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/components/Autocomplete/Autocomplete.cjs +0 -109
- package/dist/components/Autocomplete/Autocomplete.cjs.map +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -28
- package/dist/components/Autocomplete/Autocomplete.definitions.d.ts +0 -9
- package/dist/components/Autocomplete/Autocomplete.js +0 -109
- package/dist/components/Autocomplete/Autocomplete.js.map +0 -1
- package/dist/components/Autocomplete/index.d.ts +0 -1
- package/dist/components/Autocomplete.d.ts +0 -2
- package/dist/components/Avatar/Avatar.cjs +0 -126
- package/dist/components/Avatar/Avatar.cjs.map +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -19
- package/dist/components/Avatar/Avatar.js +0 -126
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Avatar/index.d.ts +0 -1
- package/dist/components/Card/Card.cjs +0 -28
- package/dist/components/Card/Card.cjs.map +0 -1
- package/dist/components/Card/Card.d.ts +0 -13
- package/dist/components/Card/Card.js +0 -28
- package/dist/components/Card/Card.js.map +0 -1
- package/dist/components/Card/index.d.ts +0 -1
- package/dist/components/Card.d.ts +0 -2
- package/dist/components/Chip/Chip.cjs.map +0 -1
- package/dist/components/Chip/Chip.js.map +0 -1
- package/dist/components/Chip/index.d.ts +0 -1
- package/dist/components/Chip.d.ts +0 -2
- package/dist/components/DatePicker/DatePicker.cjs +0 -5
- package/dist/components/DatePicker/DatePicker.cjs.map +0 -1
- package/dist/components/DatePicker/DatePicker.d.ts +0 -18
- package/dist/components/DatePicker/DatePicker.js +0 -5
- package/dist/components/DatePicker/DatePicker.js.map +0 -1
- package/dist/components/DatePicker/index.d.ts +0 -1
- package/dist/components/DatePicker.d.ts +0 -2
- package/dist/components/DateTimePicker/DateTimePicker.cjs +0 -208
- package/dist/components/DateTimePicker/DateTimePicker.cjs.map +0 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +0 -28
- package/dist/components/DateTimePicker/DateTimePicker.js +0 -208
- package/dist/components/DateTimePicker/DateTimePicker.js.map +0 -1
- package/dist/components/DateTimePicker/index.d.ts +0 -1
- package/dist/components/DateTimePicker.d.ts +0 -2
- package/dist/components/Gallery/Gallery.cjs.map +0 -1
- package/dist/components/Gallery/Gallery.d.ts +0 -12
- package/dist/components/Gallery/Gallery.js.map +0 -1
- package/dist/components/Gallery/GalleryLightbox.d.ts +0 -20
- package/dist/components/Gallery/GalleryThumbnails.d.ts +0 -17
- package/dist/components/Gallery/index.d.ts +0 -1
- package/dist/components/Gallery.d.ts +0 -2
- package/dist/components/Icon/Icon.cjs.map +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -21
- package/dist/components/Icon/Icon.js.map +0 -1
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Icon.d.ts +0 -2
- package/dist/components/Input/Input.cjs +0 -5
- package/dist/components/Input/Input.cjs.map +0 -1
- package/dist/components/Input/Input.d.ts +0 -32
- package/dist/components/Input/Input.js +0 -5
- package/dist/components/Input/Input.js.map +0 -1
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Input.d.ts +0 -2
- package/dist/components/InputGroup/InputGroup.cjs +0 -126
- package/dist/components/InputGroup/InputGroup.cjs.map +0 -1
- package/dist/components/InputGroup/InputGroup.d.ts +0 -6
- package/dist/components/InputGroup/InputGroup.js +0 -126
- package/dist/components/InputGroup/InputGroup.js.map +0 -1
- package/dist/components/InputGroup/index.d.ts +0 -1
- package/dist/components/InputGroup.d.ts +0 -2
- package/dist/components/Modal/Modal.cjs +0 -209
- package/dist/components/Modal/Modal.cjs.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -29
- package/dist/components/Modal/Modal.js +0 -209
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Modal/ModalBody.d.ts +0 -6
- package/dist/components/Modal/ModalFooter.d.ts +0 -19
- package/dist/components/Modal/ModalHeader.d.ts +0 -6
- package/dist/components/Modal/index.d.ts +0 -1
- package/dist/components/Modal.d.ts +0 -2
- package/dist/components/Select/Select.cjs +0 -6
- package/dist/components/Select/Select.cjs.map +0 -1
- package/dist/components/Select/Select.d.ts +0 -60
- package/dist/components/Select/Select.definitions.d.ts +0 -14
- package/dist/components/Select/Select.js +0 -6
- package/dist/components/Select/Select.js.map +0 -1
- package/dist/components/Select/index.d.ts +0 -1
- package/dist/components/Select.d.ts +0 -2
- package/dist/components/Stat/index.d.ts +0 -1
- package/dist/components/Stat.d.ts +0 -2
- package/dist/components/StatusMessage/StatusMessage.cjs +0 -79
- package/dist/components/StatusMessage/StatusMessage.cjs.map +0 -1
- package/dist/components/StatusMessage/StatusMessage.d.ts +0 -44
- package/dist/components/StatusMessage/StatusMessage.js +0 -79
- package/dist/components/StatusMessage/StatusMessage.js.map +0 -1
- package/dist/components/StatusMessage/index.d.ts +0 -1
- package/dist/components/StatusMessage.d.ts +0 -2
- package/dist/components/Stepper/Stepper.cjs +0 -46
- package/dist/components/Stepper/Stepper.cjs.map +0 -1
- package/dist/components/Stepper/Stepper.d.ts +0 -11
- package/dist/components/Stepper/Stepper.js +0 -46
- package/dist/components/Stepper/Stepper.js.map +0 -1
- package/dist/components/Stepper/index.d.ts +0 -2
- package/dist/components/Stepper.d.ts +0 -2
- package/dist/components/Tabs/Tabs.cjs +0 -96
- package/dist/components/Tabs/Tabs.cjs.map +0 -1
- package/dist/components/Tabs/Tabs.d.ts +0 -19
- package/dist/components/Tabs/Tabs.js +0 -96
- package/dist/components/Tabs/Tabs.js.map +0 -1
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Tabs.d.ts +0 -2
- package/dist/components/Timeline/Timeline.cjs.map +0 -1
- package/dist/components/Timeline/Timeline.d.ts +0 -13
- package/dist/components/Timeline/Timeline.js.map +0 -1
- package/dist/components/Timeline/index.d.ts +0 -2
- package/dist/components/Timeline.d.ts +0 -2
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/styles.css +0 -112
- package/rollup.config.cjs +0 -87
- package/src/components/Autocomplete/Autocomplete.definitions.ts +0 -254
- package/src/components/Autocomplete/Autocomplete.stories.tsx +0 -387
- package/src/components/Autocomplete/Autocomplete.tsx +0 -139
- package/src/components/Autocomplete/index.ts +0 -1
- package/src/components/Avatar/Avatar.stories.tsx +0 -54
- package/src/components/Avatar/Avatar.tsx +0 -143
- package/src/components/Avatar/index.ts +0 -1
- package/src/components/Button/Button.definition.ts +0 -97
- package/src/components/Button/Button.stories.tsx +0 -285
- package/src/components/Button/Button.tsx +0 -67
- package/src/components/Button/index.ts +0 -1
- package/src/components/Card/Card.definition.ts +0 -5
- package/src/components/Card/Card.stories.tsx +0 -32
- package/src/components/Card/Card.tsx +0 -44
- package/src/components/Card/index.ts +0 -1
- package/src/components/Chip/Chip.definitions.ts +0 -167
- package/src/components/Chip/Chip.stories.tsx +0 -265
- package/src/components/Chip/Chip.tsx +0 -61
- package/src/components/Chip/index.ts +0 -1
- package/src/components/Column/Column.tsx +0 -29
- package/src/components/Column/index.ts +0 -1
- package/src/components/DatePicker/DatePicker.definitions.ts +0 -205
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -282
- package/src/components/DatePicker/DatePicker.tsx +0 -165
- package/src/components/DatePicker/index.ts +0 -1
- package/src/components/DateRangePicker/DateRangePicker.definitions.ts +0 -191
- package/src/components/DateRangePicker/DateRangePicker.stories.tsx +0 -252
- package/src/components/DateRangePicker/DateRangePicker.tsx +0 -56
- package/src/components/DateRangePicker/index.ts +0 -1
- package/src/components/DateTimePicker/DateTimePicker.definitions.ts +0 -232
- package/src/components/DateTimePicker/DateTimePicker.stories.tsx +0 -390
- package/src/components/DateTimePicker/DateTimePicker.tsx +0 -191
- package/src/components/DateTimePicker/index.ts +0 -1
- package/src/components/Flyout/Flyout.stories.tsx +0 -274
- package/src/components/Flyout/Flyout.tsx +0 -122
- package/src/components/Flyout/index.ts +0 -1
- package/src/components/Gallery/Gallery.definition.tsx +0 -37
- package/src/components/Gallery/Gallery.stories.tsx +0 -82
- package/src/components/Gallery/Gallery.tsx +0 -118
- package/src/components/Gallery/GalleryLightbox.tsx +0 -170
- package/src/components/Gallery/GalleryMain.tsx +0 -84
- package/src/components/Gallery/GalleryThumbnails.tsx +0 -106
- package/src/components/Gallery/index.ts +0 -1
- package/src/components/Icon/Icon.stories.tsx +0 -54
- package/src/components/Icon/Icon.tsx +0 -94
- package/src/components/Icon/index.ts +0 -2
- package/src/components/Input/Input.definitions.ts +0 -252
- package/src/components/Input/Input.stories.tsx +0 -387
- package/src/components/Input/Input.tsx +0 -186
- package/src/components/Input/index.ts +0 -1
- package/src/components/InputGroup/InputGroup.stories.tsx +0 -136
- package/src/components/InputGroup/InputGroup.tsx +0 -136
- package/src/components/InputGroup/index.ts +0 -1
- package/src/components/MenuButton/MenuButton.stories.tsx +0 -197
- package/src/components/MenuButton/MenuButton.tsx +0 -100
- package/src/components/MenuButton/index.ts +0 -1
- package/src/components/Modal/Modal.stories.tsx +0 -293
- package/src/components/Modal/Modal.tsx +0 -173
- package/src/components/Modal/ModalBody.tsx +0 -16
- package/src/components/Modal/ModalFooter.tsx +0 -61
- package/src/components/Modal/ModalHeader.tsx +0 -18
- package/src/components/Modal/index.ts +0 -1
- package/src/components/Select/Select.definitions.ts +0 -488
- package/src/components/Select/Select.stories.tsx +0 -569
- package/src/components/Select/Select.tsx +0 -468
- package/src/components/Select/index.ts +0 -1
- package/src/components/Stat/Stat.stories.tsx +0 -85
- package/src/components/Stat/Stat.tsx +0 -117
- package/src/components/Stat/index.ts +0 -2
- package/src/components/StatusMessage/StatusMessage.stories.tsx +0 -130
- package/src/components/StatusMessage/StatusMessage.tsx +0 -162
- package/src/components/StatusMessage/index.ts +0 -2
- package/src/components/Stepper/Step.tsx +0 -21
- package/src/components/Stepper/Stepper.definition.ts +0 -75
- package/src/components/Stepper/Stepper.stories.tsx +0 -122
- package/src/components/Stepper/Stepper.tsx +0 -59
- package/src/components/Stepper/index.ts +0 -2
- package/src/components/Table/EmptyTable.png +0 -0
- package/src/components/Table/Table.definition.ts +0 -580
- package/src/components/Table/Table.stories.tsx +0 -853
- package/src/components/Table/Table.tsx +0 -495
- package/src/components/Table/data.ts +0 -134
- package/src/components/Table/exportsUtils.ts +0 -195
- package/src/components/Table/index.ts +0 -3
- package/src/components/Table/types.ts +0 -34
- package/src/components/Tabs/Tab.definition.ts +0 -53
- package/src/components/Tabs/Tab.tsx +0 -19
- package/src/components/Tabs/Tabs.stories.tsx +0 -118
- package/src/components/Tabs/Tabs.tsx +0 -99
- package/src/components/Tabs/_tabUtils.tsx +0 -4
- package/src/components/Tabs/index.ts +0 -2
- package/src/components/Timeline/Timeline.definition.ts +0 -43
- package/src/components/Timeline/Timeline.stories.tsx +0 -108
- package/src/components/Timeline/Timeline.tsx +0 -49
- package/src/components/Timeline/TimelineItem.tsx +0 -31
- package/src/components/Timeline/index.ts +0 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -117
- package/src/components/Tooltip/Tooltip.tsx +0 -58
- package/src/components/Tooltip/index.ts +0 -1
- package/src/hooks/ClipBoard/ClipBoard.stories.tsx +0 -168
- package/src/hooks/ClipBoard/ClipBoard.tsx +0 -131
- package/src/hooks/ClipBoard/ClipboardUnifiedDemo.tsx +0 -111
- package/src/hooks/ClipBoard/index.ts +0 -1
- package/src/index.ts +0 -1
- package/src/styles.css +0 -3
- package/tailwind.config.js +0 -10
- package/tsconfig.json +0 -48
- package/tsup.config.js +0 -41
- package/vite.config.js +0 -132
- package/vitest.config.ts +0 -35
- /package/{dist/Button-C17mExpd.cjs → Button-C17mExpd.cjs} +0 -0
- /package/{dist/Button-UkkP-bNw.js → Button-UkkP-bNw.js} +0 -0
- /package/{Readme.md → README.md} +0 -0
- /package/{dist/components → components}/Avatar.d.ts +0 -0
- /package/{dist/components → components}/Button/Button.cjs +0 -0
- /package/{dist/components → components}/Button/Button.cjs.map +0 -0
- /package/{dist/components → components}/Button/Button.definition.d.ts +0 -0
- /package/{dist/components → components}/Button/Button.js +0 -0
- /package/{dist/components → components}/Button/Button.js.map +0 -0
- /package/{dist/components → components}/Button.d.ts +0 -0
- /package/{dist/components → components}/Card/Card.definition.d.ts +0 -0
- /package/{dist/components → components}/Chip/Chip.d.ts +0 -0
- /package/{dist/components → components}/Chip/Chip.definitions.d.ts +0 -0
- /package/{dist/components → components}/Column/Column.cjs +0 -0
- /package/{dist/components → components}/Column/Column.cjs.map +0 -0
- /package/{dist/components → components}/Column/Column.d.ts +0 -0
- /package/{dist/components → components}/Column/Column.js +0 -0
- /package/{dist/components → components}/Column/Column.js.map +0 -0
- /package/{dist/components → components}/Column/index.d.ts +0 -0
- /package/{dist/components → components}/Column.d.ts +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.cjs +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.cjs.map +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.d.ts +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.definitions.d.ts +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.js +0 -0
- /package/{dist/components → components}/DateRangePicker/DateRangePicker.js.map +0 -0
- /package/{dist/components → components}/DateRangePicker/index.d.ts +0 -0
- /package/{dist/components → components}/DateRangePicker.d.ts +0 -0
- /package/{dist/components → components}/Flyout/Flyout.cjs +0 -0
- /package/{dist/components → components}/Flyout/Flyout.cjs.map +0 -0
- /package/{dist/components → components}/Flyout/Flyout.d.ts +0 -0
- /package/{dist/components → components}/Flyout/Flyout.js +0 -0
- /package/{dist/components → components}/Flyout/Flyout.js.map +0 -0
- /package/{dist/components → components}/Flyout/index.d.ts +0 -0
- /package/{dist/components → components}/Flyout.d.ts +0 -0
- /package/{dist/components → components}/Gallery/Gallery.definition.d.ts +0 -0
- /package/{dist/components → components}/MenuButton/MenuButton.cjs +0 -0
- /package/{dist/components → components}/MenuButton/MenuButton.cjs.map +0 -0
- /package/{dist/components → components}/MenuButton/MenuButton.d.ts +0 -0
- /package/{dist/components → components}/MenuButton/MenuButton.js +0 -0
- /package/{dist/components → components}/MenuButton/MenuButton.js.map +0 -0
- /package/{dist/components → components}/MenuButton/index.d.ts +0 -0
- /package/{dist/components → components}/MenuButton.d.ts +0 -0
- /package/{dist/components → components}/Stat/Stat.d.ts +0 -0
- /package/{dist/components → components}/Stepper/Step.d.ts +0 -0
- /package/{dist/components → components}/Stepper/Stepper.definition.d.ts +0 -0
- /package/{dist/components → components}/Table/Table.cjs +0 -0
- /package/{dist/components → components}/Table/Table.cjs.map +0 -0
- /package/{dist/components → components}/Table/Table.d.ts +0 -0
- /package/{dist/components → components}/Table/Table.definition.d.ts +0 -0
- /package/{dist/components → components}/Table/Table.js +0 -0
- /package/{dist/components → components}/Table/Table.js.map +0 -0
- /package/{dist/components → components}/Table/data.d.ts +0 -0
- /package/{dist/components → components}/Table/exportsUtils.d.ts +0 -0
- /package/{dist/components → components}/Table/index.d.ts +0 -0
- /package/{dist/components → components}/Table/types.d.ts +0 -0
- /package/{dist/components → components}/Table.d.ts +0 -0
- /package/{dist/components → components}/Tabs/Tab.d.ts +0 -0
- /package/{dist/components → components}/Tabs/Tab.definition.d.ts +0 -0
- /package/{dist/components → components}/Tabs/_tabUtils.d.ts +0 -0
- /package/{dist/components → components}/Timeline/Timeline.definition.d.ts +0 -0
- /package/{dist/components → components}/Timeline/TimelineItem.d.ts +0 -0
- /package/{dist/components → components}/Tooltip/Tooltip.cjs +0 -0
- /package/{dist/components → components}/Tooltip/Tooltip.cjs.map +0 -0
- /package/{dist/components → components}/Tooltip/Tooltip.d.ts +0 -0
- /package/{dist/components → components}/Tooltip/Tooltip.js +0 -0
- /package/{dist/components → components}/Tooltip/Tooltip.js.map +0 -0
- /package/{dist/components → components}/Tooltip/index.d.ts +0 -0
- /package/{dist/components → components}/Tooltip.d.ts +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipBoard.cjs +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipBoard.cjs.map +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipBoard.d.ts +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipBoard.js +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipBoard.js.map +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/ClipboardUnifiedDemo.d.ts +0 -0
- /package/{dist/hooks → hooks}/ClipBoard/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/ClipBoard.d.ts +0 -0
- /package/{dist/index.css → index.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button-C17mExpd.cjs","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import { Button as MuiButton } from \"@mui/material\";\nimport type { SxProps, Theme } from \"@mui/material/styles\";\nimport React from \"react\";\n\nexport interface ButtonProps {\n children?: React.ReactNode;\n variant?: \"text\" | \"outlined\" | \"contained\";\n disabled?: boolean;\n endIcon?: React.ReactNode;\n startIcon?: React.ReactNode;\n size?: \"small\" | \"medium\" | \"large\";\n className?: string;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n loading?: boolean;\n loadingIndicator?: React.ReactNode;\n loadingPosition?: \"start\" | \"end\" | \"center\";\n color?: \"inherit\" | \"primary\" | \"secondary\" | \"success\" | \"error\" | \"info\" | \"warning\";\n href?: string;\n \"data-testid\"?: string;\n type?: \"button\" | \"submit\";\n sx?: SxProps<Theme>;\n}\n\nexport const Button: React.FC<ButtonProps> = ({\n children,\n variant,\n disabled,\n startIcon,\n endIcon,\n size,\n className,\n onClick,\n loading,\n loadingPosition,\n loadingIndicator,\n color,\n href,\n \"data-testid\": dataTestId,\n type,\n sx\n}) => {\n return (\n <MuiButton\n disabled={disabled}\n variant={variant}\n startIcon={startIcon}\n endIcon={endIcon}\n size={size}\n className={className}\n onClick={onClick}\n loading={loading}\n loadingPosition={loadingPosition}\n loadingIndicator={loadingIndicator}\n sx={{ textTransform: \"none\", ...sx }}\n disableRipple={true}\n disableElevation={true}\n color={color}\n data-testid={dataTestId}\n href={href}\n type={type}\n >\n {children}\n </MuiButton>);\n};\n\nexport default Button;"],"names":["jsx","MuiButton"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBO,MAAM,SAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AACF,MAAM;AACJ,SACEA,2BAAAA;AAAAA,IAACC,SAAAA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,iBAAE,eAAe,UAAW;AAAA,MAChC,eAAe;AAAA,MACf,kBAAkB;AAAA,MAClB;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAEP;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button-UkkP-bNw.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import { Button as MuiButton } from \"@mui/material\";\nimport type { SxProps, Theme } from \"@mui/material/styles\";\nimport React from \"react\";\n\nexport interface ButtonProps {\n children?: React.ReactNode;\n variant?: \"text\" | \"outlined\" | \"contained\";\n disabled?: boolean;\n endIcon?: React.ReactNode;\n startIcon?: React.ReactNode;\n size?: \"small\" | \"medium\" | \"large\";\n className?: string;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n loading?: boolean;\n loadingIndicator?: React.ReactNode;\n loadingPosition?: \"start\" | \"end\" | \"center\";\n color?: \"inherit\" | \"primary\" | \"secondary\" | \"success\" | \"error\" | \"info\" | \"warning\";\n href?: string;\n \"data-testid\"?: string;\n type?: \"button\" | \"submit\";\n sx?: SxProps<Theme>;\n}\n\nexport const Button: React.FC<ButtonProps> = ({\n children,\n variant,\n disabled,\n startIcon,\n endIcon,\n size,\n className,\n onClick,\n loading,\n loadingPosition,\n loadingIndicator,\n color,\n href,\n \"data-testid\": dataTestId,\n type,\n sx\n}) => {\n return (\n <MuiButton\n disabled={disabled}\n variant={variant}\n startIcon={startIcon}\n endIcon={endIcon}\n size={size}\n className={className}\n onClick={onClick}\n loading={loading}\n loadingPosition={loadingPosition}\n loadingIndicator={loadingIndicator}\n sx={{ textTransform: \"none\", ...sx }}\n disableRipple={true}\n disableElevation={true}\n color={color}\n data-testid={dataTestId}\n href={href}\n type={type}\n >\n {children}\n </MuiButton>);\n};\n\nexport default Button;"],"names":["MuiButton"],"mappings":";;;;;;;;;;;;;;;;;;AAuBO,MAAM,SAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AACF,MAAM;AACJ,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI,iBAAE,eAAe,UAAW;AAAA,MAChC,eAAe;AAAA,MACf,kBAAkB;AAAA,MAClB;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MAEC;AAAA,IAAA;AAAA,EAAA;AAEP;"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
34
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
35
|
+
const React = require("react");
|
|
36
|
+
const material = require("@mui/material");
|
|
37
|
+
const MoreVertIcon = require("@mui/icons-material/MoreVert");
|
|
38
|
+
const ActionMenuContext = React.createContext(null);
|
|
39
|
+
const ActionMenu = ({
|
|
40
|
+
children,
|
|
41
|
+
trigger,
|
|
42
|
+
triggerTooltip,
|
|
43
|
+
anchorOrigin = { vertical: "bottom", horizontal: "right" },
|
|
44
|
+
transformOrigin = { vertical: "top", horizontal: "right" },
|
|
45
|
+
menuSx,
|
|
46
|
+
disabled = false
|
|
47
|
+
}) => {
|
|
48
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
49
|
+
const open = Boolean(anchorEl);
|
|
50
|
+
const handleClose = () => setAnchorEl(null);
|
|
51
|
+
const openMenu = (event) => {
|
|
52
|
+
if (disabled) return;
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
setAnchorEl(event.currentTarget);
|
|
55
|
+
};
|
|
56
|
+
const triggerElement = trigger ? React.cloneElement(trigger, {
|
|
57
|
+
onClick: openMenu,
|
|
58
|
+
disabled
|
|
59
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: triggerTooltip, arrow: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
material.IconButton,
|
|
61
|
+
{
|
|
62
|
+
size: "small",
|
|
63
|
+
onClick: openMenu,
|
|
64
|
+
disabled,
|
|
65
|
+
"aria-label": triggerTooltip,
|
|
66
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MoreVertIcon, { fontSize: "small" })
|
|
67
|
+
}
|
|
68
|
+
) });
|
|
69
|
+
const paperSx = [
|
|
70
|
+
{ minWidth: 180 },
|
|
71
|
+
...Array.isArray(menuSx) ? menuSx : menuSx ? [menuSx] : []
|
|
72
|
+
];
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
74
|
+
triggerElement,
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
76
|
+
material.Menu,
|
|
77
|
+
{
|
|
78
|
+
anchorEl,
|
|
79
|
+
open,
|
|
80
|
+
onClose: handleClose,
|
|
81
|
+
anchorOrigin,
|
|
82
|
+
transformOrigin,
|
|
83
|
+
slotProps: { paper: { sx: paperSx } },
|
|
84
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ActionMenuContext.Provider, { value: { close: handleClose }, children })
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
};
|
|
89
|
+
const ActionMenuItem = React.forwardRef(
|
|
90
|
+
function ActionMenuItem2(_a, ref) {
|
|
91
|
+
var _b = _a, { icon, children, onClick } = _b, rest = __objRest(_b, ["icon", "children", "onClick"]);
|
|
92
|
+
const ctx = React.useContext(ActionMenuContext);
|
|
93
|
+
const handleClick = (event) => {
|
|
94
|
+
event.stopPropagation();
|
|
95
|
+
onClick == null ? void 0 : onClick(event);
|
|
96
|
+
ctx == null ? void 0 : ctx.close();
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.MenuItem, __spreadProps(__spreadValues({ ref, onClick: handleClick }, rest), { children: [
|
|
99
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { sx: { minWidth: 32 }, children: icon }),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.ListItemText, { primary: children })
|
|
101
|
+
] }));
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
exports.ActionMenu = ActionMenu;
|
|
105
|
+
exports.ActionMenuItem = ActionMenuItem;
|
|
106
|
+
exports.default = ActionMenu;
|
|
107
|
+
//# sourceMappingURL=ActionMenu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMenu.cjs","sources":["../../../src/components/ActionMenu/ActionMenu.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useContext,\n useState,\n type ReactElement,\n type ReactNode,\n type MouseEvent,\n} from 'react';\nimport {\n IconButton,\n Menu,\n MenuItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n type MenuItemProps as MuiMenuItemProps,\n} from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nexport interface ActionMenuProps {\n /** Items del menú. Normalmente `<ActionMenuItem>` o `<Divider />`. */\n children: ReactNode;\n /**\n * Elemento disparador — cualquier componente clickeable (Button, Chip, IconButton…).\n * El ActionMenu le inyecta `onClick` automáticamente. Si se omite, se usa un\n * IconButton de tres puntos por defecto.\n */\n trigger?: ReactElement;\n /** Texto de tooltip sobre el trigger default. Default: \"Acciones\". */\n triggerTooltip?: string;\n /** Anchor origin del menu. Default: { vertical: 'bottom', horizontal: 'right' }. */\n anchorOrigin?: {\n vertical: 'top' | 'center' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n /** Transform origin del menu. Default: { vertical: 'top', horizontal: 'right' }. */\n transformOrigin?: {\n vertical: 'top' | 'center' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n /** sx del Menu (Paper interno). */\n menuSx?: SxProps<Theme>;\n /** Deshabilita el trigger entero. */\n disabled?: boolean;\n}\n\ninterface ActionMenuContextValue {\n close: () => void;\n}\n\nconst ActionMenuContext = createContext<ActionMenuContextValue | null>(null);\n\nexport const ActionMenu: React.FC<ActionMenuProps> = ({\n children,\n trigger,\n triggerTooltip,\n anchorOrigin = { vertical: 'bottom', horizontal: 'right' },\n transformOrigin = { vertical: 'top', horizontal: 'right' },\n menuSx,\n disabled = false,\n}) => {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const open = Boolean(anchorEl);\n\n const handleClose = () => setAnchorEl(null);\n\n // Abre el menú anclándolo al elemento que recibió el click.\n const openMenu = (event: MouseEvent<HTMLElement>) => {\n if (disabled) return;\n event.stopPropagation();\n setAnchorEl(event.currentTarget);\n };\n\n // Si el consumer pasó un trigger (ej. <Button>), le inyectamos onClick.\n // Si no, usamos el IconButton de tres puntos por defecto.\n const triggerElement = trigger ? (\n React.cloneElement(trigger as ReactElement<any>, {\n onClick: openMenu,\n disabled,\n })\n ) : (\n <Tooltip title={triggerTooltip} arrow>\n <IconButton\n size=\"small\"\n onClick={openMenu}\n disabled={disabled}\n aria-label={triggerTooltip}\n >\n <MoreVertIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n );\n\n const paperSx = [\n { minWidth: 180 },\n ...(Array.isArray(menuSx) ? menuSx : menuSx ? [menuSx] : []),\n ] as SxProps<Theme>;\n\n return (\n <>\n {triggerElement}\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n slotProps={{ paper: { sx: paperSx } }}\n >\n <ActionMenuContext.Provider value={{ close: handleClose }}>\n {children}\n </ActionMenuContext.Provider>\n </Menu>\n </>\n );\n};\n\nexport interface ActionMenuItemProps\n extends Omit<MuiMenuItemProps, 'children' | 'onClick'> {\n /** Icono opcional a la izquierda. */\n icon?: ReactNode;\n /** Texto (o nodo) del item. */\n children: ReactNode;\n /** Handler de click. El menú se cierra automáticamente después. */\n onClick?: (event: MouseEvent<HTMLLIElement>) => void;\n}\n\n/**\n * Item del `ActionMenu`. Se cierra automáticamente al hacer click.\n * Acepta todos los props de `MenuItem` de MUI (disabled, selected, sx, …).\n */\nexport const ActionMenuItem = forwardRef<HTMLLIElement, ActionMenuItemProps>(\n function ActionMenuItem({ icon, children, onClick, ...rest }, ref) {\n const ctx = useContext(ActionMenuContext);\n\n const handleClick = (event: MouseEvent<HTMLLIElement>) => {\n event.stopPropagation();\n onClick?.(event);\n ctx?.close();\n };\n\n return (\n <MenuItem ref={ref} onClick={handleClick} {...rest}>\n {icon && <ListItemIcon sx={{ minWidth: 32 }}>{icon}</ListItemIcon>}\n <ListItemText primary={children} />\n </MenuItem>\n );\n },\n);\n\nexport default ActionMenu;\n"],"names":["createContext","useState","jsx","Tooltip","IconButton","jsxs","Fragment","Menu","forwardRef","ActionMenuItem","useContext","MenuItem","ListItemIcon","ListItemText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,oBAAoBA,MAAAA,cAA6C,IAAI;AAEpE,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe,EAAE,UAAU,UAAU,YAAY,QAAA;AAAA,EACjD,kBAAkB,EAAE,UAAU,OAAO,YAAY,QAAA;AAAA,EACjD;AAAA,EACA,WAAW;AACb,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAIC,MAAAA,SAA6B,IAAI;AACjE,QAAM,OAAO,QAAQ,QAAQ;AAE7B,QAAM,cAAc,MAAM,YAAY,IAAI;AAG1C,QAAM,WAAW,CAAC,UAAmC;AACnD,QAAI,SAAU;AACd,UAAM,gBAAA;AACN,gBAAY,MAAM,aAAa;AAAA,EACjC;AAIA,QAAM,iBAAiB,UACrB,MAAM,aAAa,SAA8B;AAAA,IAC/C,SAAS;AAAA,IACT;AAAA,EAAA,CACD,IAEDC,2BAAAA,IAACC,SAAAA,WAAQ,OAAO,gBAAgB,OAAK,MACnC,UAAAD,2BAAAA;AAAAA,IAACE,SAAAA;AAAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT;AAAA,MACA,cAAY;AAAA,MAEZ,UAAAF,2BAAAA,IAAC,cAAA,EAAa,UAAS,QAAA,CAAQ;AAAA,IAAA;AAAA,EAAA,GAEnC;AAGF,QAAM,UAAU;AAAA,IACd,EAAE,UAAU,IAAA;AAAA,IACZ,GAAI,MAAM,QAAQ,MAAM,IAAI,SAAS,SAAS,CAAC,MAAM,IAAI,CAAA;AAAA,EAAC;AAG5D,SACEG,2BAAAA,KAAAC,qBAAA,EACG,UAAA;AAAA,IAAA;AAAA,IACDJ,2BAAAA;AAAAA,MAACK,SAAAA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,WAAW,EAAE,OAAO,EAAE,IAAI,UAAQ;AAAA,QAElC,UAAAL,2BAAAA,IAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,OAAO,YAAA,GACzC,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAgBO,MAAM,iBAAiBM,MAAAA;AAAAA,EAC5B,SAASC,gBAAe,IAAsC,KAAK;AAA3C,iBAAE,QAAM,UAAU,YAAlB,IAA8B,iBAA9B,IAA8B,CAA5B,QAAM,YAAU;AACxC,UAAM,MAAMC,MAAAA,WAAW,iBAAiB;AAExC,UAAM,cAAc,CAAC,UAAqC;AACxD,YAAM,gBAAA;AACN,yCAAU;AACV,iCAAK;AAAA,IACP;AAEA,2CACGC,SAAAA,UAAA,+BAAS,KAAU,SAAS,eAAiB,OAA7C,EACE,UAAA;AAAA,MAAA,uCAASC,SAAAA,cAAA,EAAa,IAAI,EAAE,UAAU,GAAA,GAAO,UAAA,MAAK;AAAA,MACnDV,2BAAAA,IAACW,SAAAA,cAAA,EAAa,SAAS,SAAA,CAAU;AAAA,IAAA,IACnC;AAAA,EAEJ;AACF;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React, ReactElement, ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { MenuItemProps as MuiMenuItemProps } from '@mui/material';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
export interface ActionMenuProps {
|
|
5
|
+
/** Items del menú. Normalmente `<ActionMenuItem>` o `<Divider />`. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Elemento disparador — cualquier componente clickeable (Button, Chip, IconButton…).
|
|
9
|
+
* El ActionMenu le inyecta `onClick` automáticamente. Si se omite, se usa un
|
|
10
|
+
* IconButton de tres puntos por defecto.
|
|
11
|
+
*/
|
|
12
|
+
trigger?: ReactElement;
|
|
13
|
+
/** Texto de tooltip sobre el trigger default. Default: "Acciones". */
|
|
14
|
+
triggerTooltip?: string;
|
|
15
|
+
/** Anchor origin del menu. Default: { vertical: 'bottom', horizontal: 'right' }. */
|
|
16
|
+
anchorOrigin?: {
|
|
17
|
+
vertical: 'top' | 'center' | 'bottom';
|
|
18
|
+
horizontal: 'left' | 'center' | 'right';
|
|
19
|
+
};
|
|
20
|
+
/** Transform origin del menu. Default: { vertical: 'top', horizontal: 'right' }. */
|
|
21
|
+
transformOrigin?: {
|
|
22
|
+
vertical: 'top' | 'center' | 'bottom';
|
|
23
|
+
horizontal: 'left' | 'center' | 'right';
|
|
24
|
+
};
|
|
25
|
+
/** sx del Menu (Paper interno). */
|
|
26
|
+
menuSx?: SxProps<Theme>;
|
|
27
|
+
/** Deshabilita el trigger entero. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const ActionMenu: React.FC<ActionMenuProps>;
|
|
31
|
+
export interface ActionMenuItemProps extends Omit<MuiMenuItemProps, 'children' | 'onClick'> {
|
|
32
|
+
/** Icono opcional a la izquierda. */
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
/** Texto (o nodo) del item. */
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
/** Handler de click. El menú se cierra automáticamente después. */
|
|
37
|
+
onClick?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Item del `ActionMenu`. Se cierra automáticamente al hacer click.
|
|
41
|
+
* Acepta todos los props de `MenuItem` de MUI (disabled, selected, sx, …).
|
|
42
|
+
*/
|
|
43
|
+
export declare const ActionMenuItem: React.ForwardRefExoticComponent<Omit<ActionMenuItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
44
|
+
export default ActionMenu;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
33
|
+
import React__default, { createContext, forwardRef, useContext, useState } from "react";
|
|
34
|
+
import { MenuItem, ListItemIcon, ListItemText, Tooltip, IconButton, Menu } from "@mui/material";
|
|
35
|
+
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
|
36
|
+
const ActionMenuContext = createContext(null);
|
|
37
|
+
const ActionMenu = ({
|
|
38
|
+
children,
|
|
39
|
+
trigger,
|
|
40
|
+
triggerTooltip,
|
|
41
|
+
anchorOrigin = { vertical: "bottom", horizontal: "right" },
|
|
42
|
+
transformOrigin = { vertical: "top", horizontal: "right" },
|
|
43
|
+
menuSx,
|
|
44
|
+
disabled = false
|
|
45
|
+
}) => {
|
|
46
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
47
|
+
const open = Boolean(anchorEl);
|
|
48
|
+
const handleClose = () => setAnchorEl(null);
|
|
49
|
+
const openMenu = (event) => {
|
|
50
|
+
if (disabled) return;
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
setAnchorEl(event.currentTarget);
|
|
53
|
+
};
|
|
54
|
+
const triggerElement = trigger ? React__default.cloneElement(trigger, {
|
|
55
|
+
onClick: openMenu,
|
|
56
|
+
disabled
|
|
57
|
+
}) : /* @__PURE__ */ jsx(Tooltip, { title: triggerTooltip, arrow: true, children: /* @__PURE__ */ jsx(
|
|
58
|
+
IconButton,
|
|
59
|
+
{
|
|
60
|
+
size: "small",
|
|
61
|
+
onClick: openMenu,
|
|
62
|
+
disabled,
|
|
63
|
+
"aria-label": triggerTooltip,
|
|
64
|
+
children: /* @__PURE__ */ jsx(MoreVertIcon, { fontSize: "small" })
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
const paperSx = [
|
|
68
|
+
{ minWidth: 180 },
|
|
69
|
+
...Array.isArray(menuSx) ? menuSx : menuSx ? [menuSx] : []
|
|
70
|
+
];
|
|
71
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
+
triggerElement,
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Menu,
|
|
75
|
+
{
|
|
76
|
+
anchorEl,
|
|
77
|
+
open,
|
|
78
|
+
onClose: handleClose,
|
|
79
|
+
anchorOrigin,
|
|
80
|
+
transformOrigin,
|
|
81
|
+
slotProps: { paper: { sx: paperSx } },
|
|
82
|
+
children: /* @__PURE__ */ jsx(ActionMenuContext.Provider, { value: { close: handleClose }, children })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
};
|
|
87
|
+
const ActionMenuItem = forwardRef(
|
|
88
|
+
function ActionMenuItem2(_a, ref) {
|
|
89
|
+
var _b = _a, { icon, children, onClick } = _b, rest = __objRest(_b, ["icon", "children", "onClick"]);
|
|
90
|
+
const ctx = useContext(ActionMenuContext);
|
|
91
|
+
const handleClick = (event) => {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
onClick == null ? void 0 : onClick(event);
|
|
94
|
+
ctx == null ? void 0 : ctx.close();
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsxs(MenuItem, __spreadProps(__spreadValues({ ref, onClick: handleClick }, rest), { children: [
|
|
97
|
+
icon && /* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 32 }, children: icon }),
|
|
98
|
+
/* @__PURE__ */ jsx(ListItemText, { primary: children })
|
|
99
|
+
] }));
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
export {
|
|
103
|
+
ActionMenu,
|
|
104
|
+
ActionMenuItem,
|
|
105
|
+
ActionMenu as default
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=ActionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMenu.js","sources":["../../../src/components/ActionMenu/ActionMenu.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useContext,\n useState,\n type ReactElement,\n type ReactNode,\n type MouseEvent,\n} from 'react';\nimport {\n IconButton,\n Menu,\n MenuItem,\n ListItemIcon,\n ListItemText,\n Tooltip,\n type MenuItemProps as MuiMenuItemProps,\n} from '@mui/material';\nimport MoreVertIcon from '@mui/icons-material/MoreVert';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nexport interface ActionMenuProps {\n /** Items del menú. Normalmente `<ActionMenuItem>` o `<Divider />`. */\n children: ReactNode;\n /**\n * Elemento disparador — cualquier componente clickeable (Button, Chip, IconButton…).\n * El ActionMenu le inyecta `onClick` automáticamente. Si se omite, se usa un\n * IconButton de tres puntos por defecto.\n */\n trigger?: ReactElement;\n /** Texto de tooltip sobre el trigger default. Default: \"Acciones\". */\n triggerTooltip?: string;\n /** Anchor origin del menu. Default: { vertical: 'bottom', horizontal: 'right' }. */\n anchorOrigin?: {\n vertical: 'top' | 'center' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n /** Transform origin del menu. Default: { vertical: 'top', horizontal: 'right' }. */\n transformOrigin?: {\n vertical: 'top' | 'center' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n /** sx del Menu (Paper interno). */\n menuSx?: SxProps<Theme>;\n /** Deshabilita el trigger entero. */\n disabled?: boolean;\n}\n\ninterface ActionMenuContextValue {\n close: () => void;\n}\n\nconst ActionMenuContext = createContext<ActionMenuContextValue | null>(null);\n\nexport const ActionMenu: React.FC<ActionMenuProps> = ({\n children,\n trigger,\n triggerTooltip,\n anchorOrigin = { vertical: 'bottom', horizontal: 'right' },\n transformOrigin = { vertical: 'top', horizontal: 'right' },\n menuSx,\n disabled = false,\n}) => {\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const open = Boolean(anchorEl);\n\n const handleClose = () => setAnchorEl(null);\n\n // Abre el menú anclándolo al elemento que recibió el click.\n const openMenu = (event: MouseEvent<HTMLElement>) => {\n if (disabled) return;\n event.stopPropagation();\n setAnchorEl(event.currentTarget);\n };\n\n // Si el consumer pasó un trigger (ej. <Button>), le inyectamos onClick.\n // Si no, usamos el IconButton de tres puntos por defecto.\n const triggerElement = trigger ? (\n React.cloneElement(trigger as ReactElement<any>, {\n onClick: openMenu,\n disabled,\n })\n ) : (\n <Tooltip title={triggerTooltip} arrow>\n <IconButton\n size=\"small\"\n onClick={openMenu}\n disabled={disabled}\n aria-label={triggerTooltip}\n >\n <MoreVertIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n );\n\n const paperSx = [\n { minWidth: 180 },\n ...(Array.isArray(menuSx) ? menuSx : menuSx ? [menuSx] : []),\n ] as SxProps<Theme>;\n\n return (\n <>\n {triggerElement}\n <Menu\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n slotProps={{ paper: { sx: paperSx } }}\n >\n <ActionMenuContext.Provider value={{ close: handleClose }}>\n {children}\n </ActionMenuContext.Provider>\n </Menu>\n </>\n );\n};\n\nexport interface ActionMenuItemProps\n extends Omit<MuiMenuItemProps, 'children' | 'onClick'> {\n /** Icono opcional a la izquierda. */\n icon?: ReactNode;\n /** Texto (o nodo) del item. */\n children: ReactNode;\n /** Handler de click. El menú se cierra automáticamente después. */\n onClick?: (event: MouseEvent<HTMLLIElement>) => void;\n}\n\n/**\n * Item del `ActionMenu`. Se cierra automáticamente al hacer click.\n * Acepta todos los props de `MenuItem` de MUI (disabled, selected, sx, …).\n */\nexport const ActionMenuItem = forwardRef<HTMLLIElement, ActionMenuItemProps>(\n function ActionMenuItem({ icon, children, onClick, ...rest }, ref) {\n const ctx = useContext(ActionMenuContext);\n\n const handleClick = (event: MouseEvent<HTMLLIElement>) => {\n event.stopPropagation();\n onClick?.(event);\n ctx?.close();\n };\n\n return (\n <MenuItem ref={ref} onClick={handleClick} {...rest}>\n {icon && <ListItemIcon sx={{ minWidth: 32 }}>{icon}</ListItemIcon>}\n <ListItemText primary={children} />\n </MenuItem>\n );\n },\n);\n\nexport default ActionMenu;\n"],"names":["React","ActionMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,oBAAoB,cAA6C,IAAI;AAEpE,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe,EAAE,UAAU,UAAU,YAAY,QAAA;AAAA,EACjD,kBAAkB,EAAE,UAAU,OAAO,YAAY,QAAA;AAAA,EACjD;AAAA,EACA,WAAW;AACb,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAA6B,IAAI;AACjE,QAAM,OAAO,QAAQ,QAAQ;AAE7B,QAAM,cAAc,MAAM,YAAY,IAAI;AAG1C,QAAM,WAAW,CAAC,UAAmC;AACnD,QAAI,SAAU;AACd,UAAM,gBAAA;AACN,gBAAY,MAAM,aAAa;AAAA,EACjC;AAIA,QAAM,iBAAiB,UACrBA,eAAM,aAAa,SAA8B;AAAA,IAC/C,SAAS;AAAA,IACT;AAAA,EAAA,CACD,IAED,oBAAC,WAAQ,OAAO,gBAAgB,OAAK,MACnC,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS;AAAA,MACT;AAAA,MACA,cAAY;AAAA,MAEZ,UAAA,oBAAC,cAAA,EAAa,UAAS,QAAA,CAAQ;AAAA,IAAA;AAAA,EAAA,GAEnC;AAGF,QAAM,UAAU;AAAA,IACd,EAAE,UAAU,IAAA;AAAA,IACZ,GAAI,MAAM,QAAQ,MAAM,IAAI,SAAS,SAAS,CAAC,MAAM,IAAI,CAAA;AAAA,EAAC;AAG5D,SACE,qBAAA,UAAA,EACG,UAAA;AAAA,IAAA;AAAA,IACD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,WAAW,EAAE,OAAO,EAAE,IAAI,UAAQ;AAAA,QAElC,UAAA,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,OAAO,YAAA,GACzC,SAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAgBO,MAAM,iBAAiB;AAAA,EAC5B,SAASC,gBAAe,IAAsC,KAAK;AAA3C,iBAAE,QAAM,UAAU,YAAlB,IAA8B,iBAA9B,IAA8B,CAA5B,QAAM,YAAU;AACxC,UAAM,MAAM,WAAW,iBAAiB;AAExC,UAAM,cAAc,CAAC,UAAqC;AACxD,YAAM,gBAAA;AACN,yCAAU;AACV,iCAAK;AAAA,IACP;AAEA,gCACG,UAAA,+BAAS,KAAU,SAAS,eAAiB,OAA7C,EACE,UAAA;AAAA,MAAA,4BAAS,cAAA,EAAa,IAAI,EAAE,UAAU,GAAA,GAAO,UAAA,MAAK;AAAA,MACnD,oBAAC,cAAA,EAAa,SAAS,SAAA,CAAU;AAAA,IAAA,IACnC;AAAA,EAEJ;AACF;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
const React = require("react");
|
|
24
|
+
const material = require("@mui/material");
|
|
25
|
+
const styles = require("@mui/material/styles");
|
|
26
|
+
const resolvePreset = require("../../resolvePreset-CT3kU-K2.cjs");
|
|
27
|
+
const MenuIcon = require("@mui/icons-material/Menu");
|
|
28
|
+
const MenuOpenIcon = require("@mui/icons-material/MenuOpen");
|
|
29
|
+
const AppBarContext = React.createContext(null);
|
|
30
|
+
function useAppBarContext() {
|
|
31
|
+
const ctx = React.useContext(AppBarContext);
|
|
32
|
+
return ctx != null ? ctx : {};
|
|
33
|
+
}
|
|
34
|
+
function buildAppBarSx({
|
|
35
|
+
height = 64,
|
|
36
|
+
transparent = false
|
|
37
|
+
}) {
|
|
38
|
+
return (theme) => __spreadProps(__spreadValues({
|
|
39
|
+
minHeight: height,
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
backgroundImage: "none"
|
|
42
|
+
}, transparent && {
|
|
43
|
+
backgroundColor: "transparent",
|
|
44
|
+
boxShadow: "none",
|
|
45
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
46
|
+
}), {
|
|
47
|
+
"& .MuiToolbar-root": {
|
|
48
|
+
minHeight: height,
|
|
49
|
+
gap: 1.5
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function AppBar({
|
|
54
|
+
children,
|
|
55
|
+
position = "sticky",
|
|
56
|
+
color = "default",
|
|
57
|
+
elevation = 1,
|
|
58
|
+
height = 64,
|
|
59
|
+
onMenuToggle,
|
|
60
|
+
menuOpen,
|
|
61
|
+
preset,
|
|
62
|
+
sx,
|
|
63
|
+
toolbarSx,
|
|
64
|
+
appBarProps
|
|
65
|
+
}) {
|
|
66
|
+
const theme = styles.useTheme();
|
|
67
|
+
const presetSx = resolvePreset.resolvePreset("AppBar", preset, theme);
|
|
68
|
+
const rootSx = [
|
|
69
|
+
buildAppBarSx({ height, transparent: color === "transparent" }),
|
|
70
|
+
...presetSx ? [presetSx] : [],
|
|
71
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
72
|
+
];
|
|
73
|
+
const contextValue = React.useMemo(
|
|
74
|
+
() => ({ onMenuToggle, menuOpen }),
|
|
75
|
+
[onMenuToggle, menuOpen]
|
|
76
|
+
);
|
|
77
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AppBarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
+
material.AppBar,
|
|
79
|
+
__spreadProps(__spreadValues({
|
|
80
|
+
position,
|
|
81
|
+
color,
|
|
82
|
+
elevation,
|
|
83
|
+
sx: rootSx
|
|
84
|
+
}, appBarProps), {
|
|
85
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(material.Toolbar, { sx: toolbarSx, children })
|
|
86
|
+
})
|
|
87
|
+
) });
|
|
88
|
+
}
|
|
89
|
+
function AppBarMenuToggle({
|
|
90
|
+
onClick,
|
|
91
|
+
menuOpen,
|
|
92
|
+
closedIcon,
|
|
93
|
+
openIcon,
|
|
94
|
+
tooltip = "Menú",
|
|
95
|
+
ariaLabel,
|
|
96
|
+
size = "medium",
|
|
97
|
+
hideIfNoHandler = true,
|
|
98
|
+
sx,
|
|
99
|
+
className
|
|
100
|
+
}) {
|
|
101
|
+
var _a;
|
|
102
|
+
const ctx = useAppBarContext();
|
|
103
|
+
const handler = onClick != null ? onClick : ctx.onMenuToggle;
|
|
104
|
+
const open = (_a = menuOpen != null ? menuOpen : ctx.menuOpen) != null ? _a : false;
|
|
105
|
+
if (!handler && hideIfNoHandler) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const icon = open ? openIcon != null ? openIcon : /* @__PURE__ */ jsxRuntime.jsx(MenuOpenIcon, {}) : closedIcon != null ? closedIcon : /* @__PURE__ */ jsxRuntime.jsx(MenuIcon, {});
|
|
109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(material.Tooltip, { title: tooltip, arrow: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
+
material.IconButton,
|
|
111
|
+
{
|
|
112
|
+
size,
|
|
113
|
+
edge: "start",
|
|
114
|
+
color: "inherit",
|
|
115
|
+
"aria-label": ariaLabel != null ? ariaLabel : tooltip,
|
|
116
|
+
onClick: handler,
|
|
117
|
+
disabled: !handler,
|
|
118
|
+
className,
|
|
119
|
+
sx,
|
|
120
|
+
children: icon
|
|
121
|
+
}
|
|
122
|
+
) }) });
|
|
123
|
+
}
|
|
124
|
+
exports.AppBar = AppBar;
|
|
125
|
+
exports.AppBarContext = AppBarContext;
|
|
126
|
+
exports.AppBarMenuToggle = AppBarMenuToggle;
|
|
127
|
+
exports.default = AppBar;
|
|
128
|
+
exports.useAppBarContext = useAppBarContext;
|
|
129
|
+
//# sourceMappingURL=AppBar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppBar.cjs","sources":["../../../src/components/AppBar/AppBarContext.ts","../../../src/components/AppBar/AppBar.sx.ts","../../../src/components/AppBar/AppBar.tsx","../../../src/components/AppBar/AppBarMenuToggle.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * Context interno del AppBar. Permite que sub-componentes (MenuToggle, etc.)\n * consuman callbacks registrados en el AppBar padre sin tener que pasarlos\n * por props explícitas.\n */\nexport interface AppBarContextValue {\n /** Handler del botón hamburguesa. Si es undefined, el toggle se oculta. */\n onMenuToggle?: () => void;\n /** Estado actual del drawer asociado (usado por el icono del toggle). */\n menuOpen?: boolean;\n}\n\nexport const AppBarContext = createContext<AppBarContextValue | null>(null);\n\n/**\n * Hook para leer el contexto del AppBar. Si se llama fuera de un `<AppBar>`,\n * devuelve un objeto vacío — los sub-componentes caen en modo \"standalone\"\n * con sus defaults en lugar de romper.\n */\nexport function useAppBarContext(): AppBarContextValue {\n const ctx = useContext(AppBarContext);\n return ctx ?? {};\n}\n","import type { SxProps, Theme } from '@mui/material/styles';\n\nexport interface BuildAppBarSxArgs {\n /** Altura en px. Default: 64. */\n height?: number;\n /** Color del AppBar (se pasa al MuiAppBar). */\n transparent?: boolean;\n}\n\n/**\n * sx del root del MuiAppBar. Define altura fija y layout flex del Toolbar\n * interno. El color/elevación se dejan a las props nativas de MuiAppBar.\n */\nexport function buildAppBarSx({\n height = 64,\n transparent = false,\n}: BuildAppBarSxArgs): SxProps<Theme> {\n return (theme) => ({\n minHeight: height,\n justifyContent: 'center',\n backgroundImage: 'none',\n ...(transparent && {\n backgroundColor: 'transparent',\n boxShadow: 'none',\n borderBottom: `1px solid ${theme.palette.divider}`,\n }),\n '& .MuiToolbar-root': {\n minHeight: height,\n gap: 1.5,\n },\n });\n}\n","import React, { useMemo, type ReactNode } from 'react';\nimport {\n AppBar as MuiAppBar,\n Toolbar,\n type AppBarProps as MuiAppBarProps,\n} from '@mui/material';\nimport {\n useTheme,\n type SxProps,\n type Theme,\n} from '@mui/material/styles';\n\nimport { AppBarContext } from './AppBarContext';\nimport { buildAppBarSx } from './AppBar.sx';\nimport { resolvePreset } from '../_shared/resolvePreset';\n\nexport type AppBarPosition = 'fixed' | 'sticky' | 'static' | 'absolute' | 'relative';\nexport type AppBarColor =\n | 'default'\n | 'primary'\n | 'secondary'\n | 'transparent'\n | 'inherit';\n\nexport interface AppBarProps {\n /** Contenido del AppBar (típicamente sub-componentes + acciones custom). */\n children?: ReactNode;\n /** Posicionamiento. Default: `'sticky'`. */\n position?: AppBarPosition;\n /** Color. Default: `'default'`. */\n color?: AppBarColor;\n /** Nivel de sombra. Default: 1. */\n elevation?: number;\n /** Altura en px. Default: 64. */\n height?: number;\n /**\n * Handler del botón hamburguesa. Se expone vía AppBarContext para que el\n * sub-componente `<AppBarMenuToggle>` lo consuma sin prop drilling.\n */\n onMenuToggle?: () => void;\n /** Estado del drawer asociado (para que el icono del toggle cambie). */\n menuOpen?: boolean;\n /**\n * Nombre del preset de estilo registrado en `theme.styles.AppBar`.\n * - `\"default\"` (o ausente) = estilo built-in del paquete.\n */\n preset?: string;\n /** sx del root (se mergea después del preset). */\n sx?: SxProps<Theme>;\n /** sx del Toolbar interno. */\n toolbarSx?: SxProps<Theme>;\n className?: string;\n /** Otras props nativas del MuiAppBar (ej. `enableColorOnDark`). */\n appBarProps?: Omit<\n MuiAppBarProps,\n 'position' | 'color' | 'elevation' | 'sx' | 'children' | 'className'\n >;\n}\n\n/**\n * AppBar (header superior) del paquete. Se diseñó como un shell compositivo\n * — el consumer arma el contenido libremente (logo, título, menú de usuario,\n * etc.) y puede usar `<AppBarMenuToggle>` para el botón hamburguesa\n * integrado con el contexto.\n *\n * Patrón recomendado para navegación en dashboards:\n *\n * ```tsx\n * <AppBar onMenuToggle={toggleDrawer}>\n * <AppBarMenuToggle />\n * <MyBrand />\n * <Box sx={{ flex: 1 }} />\n * <MyUserMenu />\n * </AppBar>\n * ```\n */\nexport function AppBar({\n children,\n position = 'sticky',\n color = 'default',\n elevation = 1,\n height = 64,\n onMenuToggle,\n menuOpen,\n preset,\n sx,\n toolbarSx,\n appBarProps,\n}: AppBarProps) {\n const theme = useTheme();\n const presetSx = resolvePreset('AppBar', preset, theme);\n\n const rootSx: SxProps<Theme> = [\n buildAppBarSx({ height, transparent: color === 'transparent' }),\n ...(presetSx ? [presetSx] : []),\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ];\n\n const contextValue = useMemo(\n () => ({ onMenuToggle, menuOpen }),\n [onMenuToggle, menuOpen],\n );\n\n return (\n <AppBarContext.Provider value={contextValue}>\n <MuiAppBar\n position={position}\n color={color}\n elevation={elevation}\n sx={rootSx}\n {...appBarProps}\n >\n <Toolbar sx={toolbarSx}>{children}</Toolbar>\n </MuiAppBar>\n </AppBarContext.Provider>\n );\n}\n\nexport default AppBar;\n","import { type ReactNode } from 'react';\nimport { IconButton, Tooltip } from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport MenuOpenIcon from '@mui/icons-material/MenuOpen';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nimport { useAppBarContext } from './AppBarContext';\n\nexport interface AppBarMenuToggleProps {\n /**\n * Callback explícito. Si se omite, se consume del `AppBarContext`. Útil para\n * usar el toggle fuera de un `<AppBar>` (p.ej. en un header custom).\n */\n onClick?: () => void;\n /** Estado del drawer asociado. Si se omite, se lee del `AppBarContext`. */\n menuOpen?: boolean;\n /** Icono custom cuando el drawer está cerrado. Default: `<MenuIcon />`. */\n closedIcon?: ReactNode;\n /** Icono custom cuando el drawer está abierto. Default: `<MenuOpenIcon />`. */\n openIcon?: ReactNode;\n /** Texto de tooltip. Default: \"Menú\". */\n tooltip?: string;\n /** aria-label del botón. Default: el mismo tooltip. */\n ariaLabel?: string;\n /** Tamaño del IconButton. Default: `'medium'`. */\n size?: 'small' | 'medium' | 'large';\n /** Oculta el botón cuando no hay handler disponible. Default: true. */\n hideIfNoHandler?: boolean;\n sx?: SxProps<Theme>;\n className?: string;\n}\n\n/**\n * Botón hamburguesa del AppBar. Por default consume `onMenuToggle` y\n * `menuOpen` del `AppBarContext` (pattern composicional), pero permite\n * overrides explícitos si se usa fuera de un `<AppBar>`.\n *\n * ```tsx\n * <AppBar onMenuToggle={toggleDrawer} menuOpen={open}>\n * <AppBarMenuToggle />\n * ...\n * </AppBar>\n * ```\n */\nexport function AppBarMenuToggle({\n onClick,\n menuOpen,\n closedIcon,\n openIcon,\n tooltip = 'Menú',\n ariaLabel,\n size = 'medium',\n hideIfNoHandler = true,\n sx,\n className,\n}: AppBarMenuToggleProps) {\n const ctx = useAppBarContext();\n\n const handler = onClick ?? ctx.onMenuToggle;\n const open = menuOpen ?? ctx.menuOpen ?? false;\n\n if (!handler && hideIfNoHandler) {\n return null;\n }\n\n const icon = open\n ? (openIcon ?? <MenuOpenIcon />)\n : (closedIcon ?? <MenuIcon />);\n\n return (\n <Tooltip title={tooltip} arrow>\n <span>\n <IconButton\n size={size}\n edge=\"start\"\n color=\"inherit\"\n aria-label={ariaLabel ?? tooltip}\n onClick={handler}\n disabled={!handler}\n className={className}\n sx={sx}\n >\n {icon}\n </IconButton>\n </span>\n </Tooltip>\n );\n}\n\nexport default AppBarMenuToggle;\n"],"names":["createContext","useContext","useTheme","resolvePreset","useMemo","jsx","MuiAppBar","Toolbar","Tooltip","IconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,gBAAgBA,MAAAA,cAAyC,IAAI;AAOnE,SAAS,mBAAuC;AACrD,QAAM,MAAMC,MAAAA,WAAW,aAAa;AACpC,SAAO,oBAAO,CAAA;AAChB;ACXO,SAAS,cAAc;AAAA,EAC5B,SAAS;AAAA,EACT,cAAc;AAChB,GAAsC;AACpC,SAAO,CAAC,UAAW;AAAA,IACjB,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,KACb,eAAe;AAAA,IACjB,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX,cAAc,aAAa,MAAM,QAAQ,OAAO;AAAA,EAAA,IAPjC;AAAA,IASjB,sBAAsB;AAAA,MACpB,WAAW;AAAA,MACX,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ;AC6CO,SAAS,OAAO;AAAA,EACrB;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgB;AACd,QAAM,QAAQC,OAAAA,SAAA;AACd,QAAM,WAAWC,cAAAA,cAAc,UAAU,QAAQ,KAAK;AAEtD,QAAM,SAAyB;AAAA,IAC7B,cAAc,EAAE,QAAQ,aAAa,UAAU,eAAe;AAAA,IAC9D,GAAI,WAAW,CAAC,QAAQ,IAAI,CAAA;AAAA,IAC5B,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,KAAK,CAAC,EAAE,IAAI,CAAA;AAAA,EAAC;AAG5C,QAAM,eAAeC,MAAAA;AAAAA,IACnB,OAAO,EAAE,cAAc;IACvB,CAAC,cAAc,QAAQ;AAAA,EAAA;AAGzB,SACEC,2BAAAA,IAAC,cAAc,UAAd,EAAuB,OAAO,cAC7B,UAAAA,2BAAAA;AAAAA,IAACC,SAAAA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,IAAI;AAAA,OACA,cALL;AAAA,MAOC,UAAAD,2BAAAA,IAACE,SAAAA,SAAA,EAAQ,IAAI,WAAY,SAAA,CAAS;AAAA,IAAA;AAAA,EAAA,GAEtC;AAEJ;ACxEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB;AAAA,EACA;AACF,GAA0B;;AACxB,QAAM,MAAM,iBAAA;AAEZ,QAAM,UAAU,4BAAW,IAAI;AAC/B,QAAM,QAAO,mCAAY,IAAI,aAAhB,YAA4B;AAEzC,MAAI,CAAC,WAAW,iBAAiB;AAC/B,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,OACR,8BAAYF,+BAAC,gBAAa,IAC1B,iEAAe,UAAA,CAAA,CAAS;AAE7B,wCACGG,SAAAA,SAAA,EAAQ,OAAO,SAAS,OAAK,MAC5B,yCAAC,QAAA,EACC,UAAAH,2BAAAA;AAAAA,IAACI,SAAAA;AAAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,OAAM;AAAA,MACN,cAAY,gCAAa;AAAA,MACzB,SAAS;AAAA,MACT,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,MAEC,UAAA;AAAA,IAAA;AAAA,EAAA,GAEL,EAAA,CACF;AAEJ;;;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AppBarProps as MuiAppBarProps } from '@mui/material';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
export type AppBarPosition = 'fixed' | 'sticky' | 'static' | 'absolute' | 'relative';
|
|
5
|
+
export type AppBarColor = 'default' | 'primary' | 'secondary' | 'transparent' | 'inherit';
|
|
6
|
+
export interface AppBarProps {
|
|
7
|
+
/** Contenido del AppBar (típicamente sub-componentes + acciones custom). */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Posicionamiento. Default: `'sticky'`. */
|
|
10
|
+
position?: AppBarPosition;
|
|
11
|
+
/** Color. Default: `'default'`. */
|
|
12
|
+
color?: AppBarColor;
|
|
13
|
+
/** Nivel de sombra. Default: 1. */
|
|
14
|
+
elevation?: number;
|
|
15
|
+
/** Altura en px. Default: 64. */
|
|
16
|
+
height?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Handler del botón hamburguesa. Se expone vía AppBarContext para que el
|
|
19
|
+
* sub-componente `<AppBarMenuToggle>` lo consuma sin prop drilling.
|
|
20
|
+
*/
|
|
21
|
+
onMenuToggle?: () => void;
|
|
22
|
+
/** Estado del drawer asociado (para que el icono del toggle cambie). */
|
|
23
|
+
menuOpen?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Nombre del preset de estilo registrado en `theme.styles.AppBar`.
|
|
26
|
+
* - `"default"` (o ausente) = estilo built-in del paquete.
|
|
27
|
+
*/
|
|
28
|
+
preset?: string;
|
|
29
|
+
/** sx del root (se mergea después del preset). */
|
|
30
|
+
sx?: SxProps<Theme>;
|
|
31
|
+
/** sx del Toolbar interno. */
|
|
32
|
+
toolbarSx?: SxProps<Theme>;
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Otras props nativas del MuiAppBar (ej. `enableColorOnDark`). */
|
|
35
|
+
appBarProps?: Omit<MuiAppBarProps, 'position' | 'color' | 'elevation' | 'sx' | 'children' | 'className'>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* AppBar (header superior) del paquete. Se diseñó como un shell compositivo
|
|
39
|
+
* — el consumer arma el contenido libremente (logo, título, menú de usuario,
|
|
40
|
+
* etc.) y puede usar `<AppBarMenuToggle>` para el botón hamburguesa
|
|
41
|
+
* integrado con el contexto.
|
|
42
|
+
*
|
|
43
|
+
* Patrón recomendado para navegación en dashboards:
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <AppBar onMenuToggle={toggleDrawer}>
|
|
47
|
+
* <AppBarMenuToggle />
|
|
48
|
+
* <MyBrand />
|
|
49
|
+
* <Box sx={{ flex: 1 }} />
|
|
50
|
+
* <MyUserMenu />
|
|
51
|
+
* </AppBar>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function AppBar({ children, position, color, elevation, height, onMenuToggle, menuOpen, preset, sx, toolbarSx, appBarProps, }: AppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export default AppBar;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
import { createContext, useContext, useMemo } from "react";
|
|
22
|
+
import { AppBar as AppBar$1, Toolbar, Tooltip, IconButton } from "@mui/material";
|
|
23
|
+
import { useTheme } from "@mui/material/styles";
|
|
24
|
+
import { r as resolvePreset } from "../../resolvePreset-B-IB0ehH.js";
|
|
25
|
+
import MenuIcon from "@mui/icons-material/Menu";
|
|
26
|
+
import MenuOpenIcon from "@mui/icons-material/MenuOpen";
|
|
27
|
+
const AppBarContext = createContext(null);
|
|
28
|
+
function useAppBarContext() {
|
|
29
|
+
const ctx = useContext(AppBarContext);
|
|
30
|
+
return ctx != null ? ctx : {};
|
|
31
|
+
}
|
|
32
|
+
function buildAppBarSx({
|
|
33
|
+
height = 64,
|
|
34
|
+
transparent = false
|
|
35
|
+
}) {
|
|
36
|
+
return (theme) => __spreadProps(__spreadValues({
|
|
37
|
+
minHeight: height,
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
backgroundImage: "none"
|
|
40
|
+
}, transparent && {
|
|
41
|
+
backgroundColor: "transparent",
|
|
42
|
+
boxShadow: "none",
|
|
43
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
44
|
+
}), {
|
|
45
|
+
"& .MuiToolbar-root": {
|
|
46
|
+
minHeight: height,
|
|
47
|
+
gap: 1.5
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function AppBar({
|
|
52
|
+
children,
|
|
53
|
+
position = "sticky",
|
|
54
|
+
color = "default",
|
|
55
|
+
elevation = 1,
|
|
56
|
+
height = 64,
|
|
57
|
+
onMenuToggle,
|
|
58
|
+
menuOpen,
|
|
59
|
+
preset,
|
|
60
|
+
sx,
|
|
61
|
+
toolbarSx,
|
|
62
|
+
appBarProps
|
|
63
|
+
}) {
|
|
64
|
+
const theme = useTheme();
|
|
65
|
+
const presetSx = resolvePreset("AppBar", preset, theme);
|
|
66
|
+
const rootSx = [
|
|
67
|
+
buildAppBarSx({ height, transparent: color === "transparent" }),
|
|
68
|
+
...presetSx ? [presetSx] : [],
|
|
69
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
70
|
+
];
|
|
71
|
+
const contextValue = useMemo(
|
|
72
|
+
() => ({ onMenuToggle, menuOpen }),
|
|
73
|
+
[onMenuToggle, menuOpen]
|
|
74
|
+
);
|
|
75
|
+
return /* @__PURE__ */ jsx(AppBarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
76
|
+
AppBar$1,
|
|
77
|
+
__spreadProps(__spreadValues({
|
|
78
|
+
position,
|
|
79
|
+
color,
|
|
80
|
+
elevation,
|
|
81
|
+
sx: rootSx
|
|
82
|
+
}, appBarProps), {
|
|
83
|
+
children: /* @__PURE__ */ jsx(Toolbar, { sx: toolbarSx, children })
|
|
84
|
+
})
|
|
85
|
+
) });
|
|
86
|
+
}
|
|
87
|
+
function AppBarMenuToggle({
|
|
88
|
+
onClick,
|
|
89
|
+
menuOpen,
|
|
90
|
+
closedIcon,
|
|
91
|
+
openIcon,
|
|
92
|
+
tooltip = "Menú",
|
|
93
|
+
ariaLabel,
|
|
94
|
+
size = "medium",
|
|
95
|
+
hideIfNoHandler = true,
|
|
96
|
+
sx,
|
|
97
|
+
className
|
|
98
|
+
}) {
|
|
99
|
+
var _a;
|
|
100
|
+
const ctx = useAppBarContext();
|
|
101
|
+
const handler = onClick != null ? onClick : ctx.onMenuToggle;
|
|
102
|
+
const open = (_a = menuOpen != null ? menuOpen : ctx.menuOpen) != null ? _a : false;
|
|
103
|
+
if (!handler && hideIfNoHandler) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const icon = open ? openIcon != null ? openIcon : /* @__PURE__ */ jsx(MenuOpenIcon, {}) : closedIcon != null ? closedIcon : /* @__PURE__ */ jsx(MenuIcon, {});
|
|
107
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: tooltip, arrow: true, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
108
|
+
IconButton,
|
|
109
|
+
{
|
|
110
|
+
size,
|
|
111
|
+
edge: "start",
|
|
112
|
+
color: "inherit",
|
|
113
|
+
"aria-label": ariaLabel != null ? ariaLabel : tooltip,
|
|
114
|
+
onClick: handler,
|
|
115
|
+
disabled: !handler,
|
|
116
|
+
className,
|
|
117
|
+
sx,
|
|
118
|
+
children: icon
|
|
119
|
+
}
|
|
120
|
+
) }) });
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
AppBar,
|
|
124
|
+
AppBarContext,
|
|
125
|
+
AppBarMenuToggle,
|
|
126
|
+
AppBar as default,
|
|
127
|
+
useAppBarContext
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=AppBar.js.map
|