@soyfri/shared-library 1.5.0-beta.4 → 1.5.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/.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 +102 -0
- package/chromatic.config.json +5 -0
- package/cleanDirectories.js +40 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +109 -0
- package/dist/components/Autocomplete/Autocomplete.cjs.map +1 -0
- package/dist/components/Autocomplete/Autocomplete.js +109 -0
- package/dist/components/Autocomplete/Autocomplete.js.map +1 -0
- package/dist/styles.css +112 -0
- package/package.json +43 -134
- package/rollup.config.cjs +87 -0
- package/src/components/Autocomplete/Autocomplete.definitions.ts +254 -0
- package/src/components/Autocomplete/Autocomplete.stories.tsx +387 -0
- package/src/components/Autocomplete/Autocomplete.tsx +139 -0
- package/src/components/Autocomplete/index.ts +1 -0
- package/src/components/Avatar/Avatar.stories.tsx +54 -0
- package/src/components/Avatar/Avatar.tsx +143 -0
- package/src/components/Avatar/index.ts +1 -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 +67 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/Card.definition.ts +5 -0
- package/src/components/Card/Card.stories.tsx +32 -0
- package/src/components/Card/Card.tsx +44 -0
- package/src/components/Card/index.ts +1 -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 +1 -0
- package/src/components/Column/Column.tsx +29 -0
- package/src/components/Column/index.ts +1 -0
- package/src/components/DatePicker/DatePicker.definitions.ts +205 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +282 -0
- package/src/components/DatePicker/DatePicker.tsx +165 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/DateRangePicker/DateRangePicker.definitions.ts +191 -0
- package/src/components/DateRangePicker/DateRangePicker.stories.tsx +252 -0
- package/src/components/DateRangePicker/DateRangePicker.tsx +56 -0
- package/src/components/DateRangePicker/index.ts +1 -0
- package/src/components/DateTimePicker/DateTimePicker.definitions.ts +232 -0
- package/src/components/DateTimePicker/DateTimePicker.stories.tsx +390 -0
- package/src/components/DateTimePicker/DateTimePicker.tsx +191 -0
- package/src/components/DateTimePicker/index.ts +1 -0
- package/src/components/Flyout/Flyout.stories.tsx +274 -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 +118 -0
- package/src/components/Gallery/GalleryLightbox.tsx +170 -0
- package/src/components/Gallery/GalleryMain.tsx +84 -0
- package/src/components/Gallery/GalleryThumbnails.tsx +106 -0
- package/src/components/Gallery/index.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +54 -0
- package/src/components/Icon/Icon.tsx +94 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Input/Input.definitions.ts +252 -0
- package/src/components/Input/Input.stories.tsx +387 -0
- package/src/components/Input/Input.tsx +186 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +136 -0
- package/src/components/InputGroup/InputGroup.tsx +136 -0
- package/src/components/InputGroup/index.ts +1 -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 +293 -0
- package/src/components/Modal/Modal.tsx +173 -0
- package/src/components/Modal/ModalBody.tsx +16 -0
- package/src/components/Modal/ModalFooter.tsx +61 -0
- package/src/components/Modal/ModalHeader.tsx +18 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Select/Select.definitions.ts +488 -0
- package/src/components/Select/Select.stories.tsx +569 -0
- package/src/components/Select/Select.tsx +468 -0
- package/src/components/Select/index.ts +1 -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 +130 -0
- package/src/components/StatusMessage/StatusMessage.tsx +162 -0
- package/src/components/StatusMessage/index.ts +2 -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 +122 -0
- package/src/components/Stepper/Stepper.tsx +59 -0
- package/src/components/Stepper/index.ts +2 -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 +495 -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 +99 -0
- package/src/components/Tabs/_tabUtils.tsx +4 -0
- package/src/components/Tabs/index.ts +2 -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 +49 -0
- package/src/components/Timeline/TimelineItem.tsx +31 -0
- package/src/components/Timeline/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +117 -0
- package/src/components/Tooltip/Tooltip.tsx +58 -0
- package/src/components/Tooltip/index.ts +1 -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 +1 -0
- package/src/styles.css +3 -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/components/Autocomplete/Autocomplete.cjs +0 -132
- package/components/Autocomplete/Autocomplete.cjs.map +0 -1
- package/components/Autocomplete/Autocomplete.js +0 -132
- package/components/Autocomplete/Autocomplete.js.map +0 -1
- /package/{README.md → Readme.md} +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/{DatePicker-BSNboVhN.js → dist/DatePicker-BSNboVhN.js} +0 -0
- /package/{DatePicker-BSNboVhN.js.map → dist/DatePicker-BSNboVhN.js.map} +0 -0
- /package/{DatePicker-BoqxWAhj.cjs → dist/DatePicker-BoqxWAhj.cjs} +0 -0
- /package/{DatePicker-BoqxWAhj.cjs.map → dist/DatePicker-BoqxWAhj.cjs.map} +0 -0
- /package/{Input-DFHs7cJ_.js → dist/Input-DFHs7cJ_.js} +0 -0
- /package/{Input-DFHs7cJ_.js.map → dist/Input-DFHs7cJ_.js.map} +0 -0
- /package/{Input-c8MwNNPg.cjs → dist/Input-c8MwNNPg.cjs} +0 -0
- /package/{Input-c8MwNNPg.cjs.map → dist/Input-c8MwNNPg.cjs.map} +0 -0
- /package/{Select-BO2N56sm.cjs → dist/Select-BO2N56sm.cjs} +0 -0
- /package/{Select-BO2N56sm.cjs.map → dist/Select-BO2N56sm.cjs.map} +0 -0
- /package/{Select-BcLkyHSE.js → dist/Select-BcLkyHSE.js} +0 -0
- /package/{Select-BcLkyHSE.js.map → dist/Select-BcLkyHSE.js.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/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.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/index.d.ts +0 -0
- /package/{components → dist/components}/Card.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 +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.js +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}/DateRangePicker/DateRangePicker.cjs +0 -0
- /package/{components → dist/components}/DateRangePicker/DateRangePicker.cjs.map +0 -0
- /package/{components → dist/components}/DateRangePicker/DateRangePicker.d.ts +0 -0
- /package/{components → dist/components}/DateRangePicker/DateRangePicker.definitions.d.ts +0 -0
- /package/{components → dist/components}/DateRangePicker/DateRangePicker.js +0 -0
- /package/{components → dist/components}/DateRangePicker/DateRangePicker.js.map +0 -0
- /package/{components → dist/components}/DateRangePicker/index.d.ts +0 -0
- /package/{components → dist/components}/DateRangePicker.d.ts +0 -0
- /package/{components → dist/components}/DateTimePicker/DateTimePicker.cjs +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.js +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}/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 +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.js +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.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}/Select/Select.cjs +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.definitions.d.ts +0 -0
- /package/{components → dist/components}/Select/Select.js +0 -0
- /package/{components → dist/components}/Select/Select.js.map +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/index.d.ts +0 -0
- /package/{components → dist/components}/Stepper.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/{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.cjs → dist/index.cjs} +0 -0
- /package/{index.cjs.map → dist/index.cjs.map} +0 -0
- /package/{index.css → dist/index.css} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{index.js.map → dist/index.js.map} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Avatar as MuiAvatar, Tooltip } from '@mui/material';
|
|
2
|
+
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export interface AvatarItem {
|
|
6
|
+
text?: string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
badge?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AvatarProps {
|
|
14
|
+
type?: string;
|
|
15
|
+
items: AvatarItem[];
|
|
16
|
+
displayedAvatars?: number;
|
|
17
|
+
size?: 'sm' | 'xl';
|
|
18
|
+
trustUrls?: boolean;
|
|
19
|
+
showText?: boolean;
|
|
20
|
+
showTooltip?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const sizes = {
|
|
24
|
+
sm: {
|
|
25
|
+
avatar: { width: 35, height: 35, borderWidth: 3, marginTop: '.5rem' },
|
|
26
|
+
icon: { width: 42, height: 42, marginTop: '.5rem', fontSize: 42 },
|
|
27
|
+
badge: { width: 35, height: 35, borderWidth: 3, marginTop: '.5rem', fontSize: 16 },
|
|
28
|
+
},
|
|
29
|
+
xl: {
|
|
30
|
+
avatar: { width: 105, height: 105, borderWidth: 10, marginTop: '0' },
|
|
31
|
+
icon: { width: 126, height: 126, marginTop: '0', fontSize: 126 },
|
|
32
|
+
badge: { width: 105, height: 105, borderWidth: 10, marginTop: '0', fontSize: 64 },
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Avatar: React.FC<AvatarProps> = ({
|
|
37
|
+
items,
|
|
38
|
+
type,
|
|
39
|
+
displayedAvatars = 4,
|
|
40
|
+
size = 'sm',
|
|
41
|
+
trustUrls = false,
|
|
42
|
+
showText = true,
|
|
43
|
+
showTooltip = false,
|
|
44
|
+
}) => {
|
|
45
|
+
const [errorIndex, setErrorIndex] = useState<Set<number>>(new Set());
|
|
46
|
+
|
|
47
|
+
const handleImageError = (index: number) => {
|
|
48
|
+
setErrorIndex((prev) => new Set(prev).add(index));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div data-testid="avatar-container" className="flex items-center leading-2 h-full w-full">
|
|
53
|
+
{items.slice(0, displayedAvatars).map((item, i) => {
|
|
54
|
+
const commonStyle = {
|
|
55
|
+
zIndex: displayedAvatars - i,
|
|
56
|
+
marginLeft: i > 0 ? -22 : 0,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const style = sizes[size];
|
|
60
|
+
|
|
61
|
+
const imgSrc = trustUrls ? item.imageUrl : item.imageUrl;
|
|
62
|
+
|
|
63
|
+
const showFallbackIcon = (!item.imageUrl && !item.badge) || (errorIndex.has(i) && !item.badge);
|
|
64
|
+
const showBadge = (item.badge && !item.imageUrl) || (item.badge && errorIndex.has(i));
|
|
65
|
+
|
|
66
|
+
const content = (
|
|
67
|
+
<span key={i} data-testid="avatar" style={commonStyle}>
|
|
68
|
+
{item.imageUrl && !errorIndex.has(i) ? (
|
|
69
|
+
<img
|
|
70
|
+
data-testid="image"
|
|
71
|
+
alt={item.text || 'User avatar'}
|
|
72
|
+
src={imgSrc}
|
|
73
|
+
onError={() => handleImageError(i)}
|
|
74
|
+
style={{
|
|
75
|
+
...style.avatar,
|
|
76
|
+
color: item.color || '#667688',
|
|
77
|
+
border: `${style.avatar.borderWidth}px solid white`,
|
|
78
|
+
borderRadius: '9999px',
|
|
79
|
+
marginTop: style.avatar.marginTop,
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
) : showFallbackIcon ? (
|
|
83
|
+
<AccountCircleIcon
|
|
84
|
+
data-testid="icon"
|
|
85
|
+
aria-label={item.text}
|
|
86
|
+
sx={{
|
|
87
|
+
...style.icon,
|
|
88
|
+
fontSize: style.icon.fontSize,
|
|
89
|
+
marginTop: style.icon.marginTop,
|
|
90
|
+
borderRadius: '9999px',
|
|
91
|
+
backgroundColor: '#fff',
|
|
92
|
+
color: item.color || '#667688',
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
) : null}
|
|
96
|
+
|
|
97
|
+
{showBadge && (
|
|
98
|
+
<span
|
|
99
|
+
data-testid="badge"
|
|
100
|
+
aria-label={item.text}
|
|
101
|
+
style={{
|
|
102
|
+
...style.badge,
|
|
103
|
+
display: 'inline-block',
|
|
104
|
+
backgroundColor: item.backgroundColor || '#c8d5e9',
|
|
105
|
+
color: item.color || '#667688',
|
|
106
|
+
fontWeight: 700,
|
|
107
|
+
textAlign: 'center',
|
|
108
|
+
borderRadius: '9999px',
|
|
109
|
+
border: `${style.badge.borderWidth}px solid white`,
|
|
110
|
+
lineHeight: style.badge.height,
|
|
111
|
+
fontSize: style.badge.fontSize,
|
|
112
|
+
marginTop: style.badge.marginTop,
|
|
113
|
+
marginBottom: style.badge.marginTop,
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
{item.badge}
|
|
117
|
+
</span>
|
|
118
|
+
)}
|
|
119
|
+
</span>
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return showTooltip && item.text ? (
|
|
123
|
+
<Tooltip key={i} title={item.text}>
|
|
124
|
+
{content}
|
|
125
|
+
</Tooltip>
|
|
126
|
+
) : (
|
|
127
|
+
content
|
|
128
|
+
);
|
|
129
|
+
})}
|
|
130
|
+
|
|
131
|
+
{showText && (
|
|
132
|
+
<span data-testid="text" className="ml-2 text-xs font-normal">
|
|
133
|
+
{type && items.length === 1 && (
|
|
134
|
+
<span data-testid="type">{type}: </span>
|
|
135
|
+
)}
|
|
136
|
+
{items[0].text} {items.length > 2 && `+${items.length - 1}`}
|
|
137
|
+
</span>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default Avatar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Avatar} from './Avatar'
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const DefaultButtonDefinition = `
|
|
2
|
+
<Button variant="text">
|
|
3
|
+
Button
|
|
4
|
+
</Button>
|
|
5
|
+
`
|
|
6
|
+
|
|
7
|
+
export const OutlinedButtonDefinition = `
|
|
8
|
+
<Button variant="outlined">
|
|
9
|
+
Button
|
|
10
|
+
</Button>
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const ContainedButtonDefinition = `
|
|
14
|
+
<Button variant="contained">
|
|
15
|
+
Button
|
|
16
|
+
</Button>
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export const WithStartIconButtonDefinition = `
|
|
20
|
+
<Button
|
|
21
|
+
data-testid="button"
|
|
22
|
+
startIcon={<NotificationsIcon/>}
|
|
23
|
+
variant="contained"
|
|
24
|
+
>
|
|
25
|
+
Button
|
|
26
|
+
</Button>
|
|
27
|
+
`
|
|
28
|
+
|
|
29
|
+
export const WithEndIconButtonDefinition = `
|
|
30
|
+
<Button
|
|
31
|
+
data-testid="button"
|
|
32
|
+
endIcon={<NotificationsIcon/>}
|
|
33
|
+
variant="contained"
|
|
34
|
+
>
|
|
35
|
+
Button
|
|
36
|
+
</Button>
|
|
37
|
+
`
|
|
38
|
+
|
|
39
|
+
export const WithSmallSizeButtonDefinition = `
|
|
40
|
+
<Button
|
|
41
|
+
data-testid="button"
|
|
42
|
+
size="small"
|
|
43
|
+
variant="contained"
|
|
44
|
+
>
|
|
45
|
+
Button
|
|
46
|
+
</Button>
|
|
47
|
+
`
|
|
48
|
+
|
|
49
|
+
export const WithLargeSizeButtonDefinition = `
|
|
50
|
+
<Button
|
|
51
|
+
data-testid="button"
|
|
52
|
+
size="large"
|
|
53
|
+
variant="contained"
|
|
54
|
+
>
|
|
55
|
+
Button
|
|
56
|
+
</Button>
|
|
57
|
+
`
|
|
58
|
+
|
|
59
|
+
export const DisabledStateButtonDefinition = `
|
|
60
|
+
<Button
|
|
61
|
+
data-testid="button"
|
|
62
|
+
disabled
|
|
63
|
+
variant="contained"
|
|
64
|
+
>
|
|
65
|
+
Button
|
|
66
|
+
</Button>`
|
|
67
|
+
|
|
68
|
+
export const LoadingButtonDefinition = `
|
|
69
|
+
<Button
|
|
70
|
+
data-testid="button"
|
|
71
|
+
loading
|
|
72
|
+
variant="contained"
|
|
73
|
+
>
|
|
74
|
+
Button
|
|
75
|
+
</Button>
|
|
76
|
+
`
|
|
77
|
+
|
|
78
|
+
export const LoadingIndicatorStartButtonDefinition = `
|
|
79
|
+
<Button
|
|
80
|
+
data-testid="button"
|
|
81
|
+
loading
|
|
82
|
+
loadingPosition="start"
|
|
83
|
+
variant="contained"
|
|
84
|
+
>
|
|
85
|
+
Button
|
|
86
|
+
</Button>
|
|
87
|
+
`
|
|
88
|
+
|
|
89
|
+
export const LoadingIndicatorEndButtonDefinition = `
|
|
90
|
+
<Button
|
|
91
|
+
data-testid="button"
|
|
92
|
+
loading
|
|
93
|
+
loadingPosition="end"
|
|
94
|
+
variant="contained"
|
|
95
|
+
>
|
|
96
|
+
Button
|
|
97
|
+
</Button>`
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Button } from "./Button";
|
|
3
|
+
import NotificationsIcon from "@mui/icons-material/Notifications";
|
|
4
|
+
import { expect, within } from "storybook/test";
|
|
5
|
+
import {
|
|
6
|
+
ContainedButtonDefinition,
|
|
7
|
+
DefaultButtonDefinition,
|
|
8
|
+
DisabledStateButtonDefinition,
|
|
9
|
+
LoadingButtonDefinition,
|
|
10
|
+
LoadingIndicatorEndButtonDefinition,
|
|
11
|
+
LoadingIndicatorStartButtonDefinition,
|
|
12
|
+
OutlinedButtonDefinition,
|
|
13
|
+
WithEndIconButtonDefinition,
|
|
14
|
+
WithLargeSizeButtonDefinition,
|
|
15
|
+
WithSmallSizeButtonDefinition,
|
|
16
|
+
WithStartIconButtonDefinition
|
|
17
|
+
} from "./Button.definition";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof Button> = {
|
|
21
|
+
title: "Components/Button",
|
|
22
|
+
component: Button,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "centered"
|
|
25
|
+
},
|
|
26
|
+
tags: ["autodocs"]
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof Button>;
|
|
32
|
+
|
|
33
|
+
export const Default: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
children: "Button",
|
|
36
|
+
variant: "text"
|
|
37
|
+
},
|
|
38
|
+
parameters: {
|
|
39
|
+
docs: {
|
|
40
|
+
description: {
|
|
41
|
+
story: "Boton con el texto \"Button\" y el estilo \"default\"."
|
|
42
|
+
},
|
|
43
|
+
source: {
|
|
44
|
+
code: DefaultButtonDefinition.trim()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Outlined: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
children: "Button",
|
|
53
|
+
variant: "outlined"
|
|
54
|
+
},
|
|
55
|
+
parameters: {
|
|
56
|
+
docs: {
|
|
57
|
+
description: {
|
|
58
|
+
story: "Boton con el texto \"Button\" y el estilo \"outlined\"."
|
|
59
|
+
},
|
|
60
|
+
source: {
|
|
61
|
+
code: OutlinedButtonDefinition.trim()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Contained: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
children: "Button",
|
|
70
|
+
variant: "contained"
|
|
71
|
+
},
|
|
72
|
+
parameters: {
|
|
73
|
+
docs: {
|
|
74
|
+
description: {
|
|
75
|
+
story: "Boton con el texto \"Button\" y el estilo \"contained\"."
|
|
76
|
+
},
|
|
77
|
+
source: {
|
|
78
|
+
code: ContainedButtonDefinition.trim()
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
export const WithStartIcon: Story = {
|
|
86
|
+
args: {
|
|
87
|
+
children: "Button",
|
|
88
|
+
variant: "contained",
|
|
89
|
+
startIcon: <NotificationsIcon />,
|
|
90
|
+
"data-testid": "button"
|
|
91
|
+
},
|
|
92
|
+
parameters: {
|
|
93
|
+
docs: {
|
|
94
|
+
description: {
|
|
95
|
+
story: "Boton con el texto \"Button\", el estilo \"contained\" y un icono al inicio."
|
|
96
|
+
},
|
|
97
|
+
source: {
|
|
98
|
+
code: WithStartIconButtonDefinition.trim()
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
play: async ({ canvasElement }) => {
|
|
103
|
+
const canvas = within(canvasElement);
|
|
104
|
+
const button = canvas.getByTestId("button");
|
|
105
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
export const WithEndIcon: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
children: "Button",
|
|
113
|
+
variant: "contained",
|
|
114
|
+
endIcon: <NotificationsIcon />,
|
|
115
|
+
"data-testid": "button"
|
|
116
|
+
},
|
|
117
|
+
parameters: {
|
|
118
|
+
docs: {
|
|
119
|
+
description: {
|
|
120
|
+
story: "Boton con el texto \"Button\", el estilo \"contained\" y un icono al final."
|
|
121
|
+
},
|
|
122
|
+
source: {
|
|
123
|
+
code: WithEndIconButtonDefinition.trim()
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
play: async ({ canvasElement }) => {
|
|
128
|
+
const canvas = within(canvasElement);
|
|
129
|
+
const button = canvas.getByTestId("button");
|
|
130
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const WithSmallSize: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
children: "Button",
|
|
137
|
+
variant: "contained",
|
|
138
|
+
size: "small",
|
|
139
|
+
"data-testid": "button"
|
|
140
|
+
},
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story: "Boton tamaño \"small\"."
|
|
145
|
+
},
|
|
146
|
+
source: {
|
|
147
|
+
code: WithSmallSizeButtonDefinition.trim()
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
play: async ({ canvasElement }) => {
|
|
152
|
+
const canvas = within(canvasElement);
|
|
153
|
+
const button = canvas.getByTestId("button");
|
|
154
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
export const WithLargeSize: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
children: "Button",
|
|
162
|
+
variant: "contained",
|
|
163
|
+
size: "large",
|
|
164
|
+
"data-testid": "button"
|
|
165
|
+
},
|
|
166
|
+
parameters: {
|
|
167
|
+
docs: {
|
|
168
|
+
description: {
|
|
169
|
+
story: "Boton tamaño \"large\"."
|
|
170
|
+
},
|
|
171
|
+
source: {
|
|
172
|
+
code: WithLargeSizeButtonDefinition.trim()
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
play: async ({ canvasElement }) => {
|
|
177
|
+
const canvas = within(canvasElement);
|
|
178
|
+
const button = canvas.getByTestId("button");
|
|
179
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const Disabled: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
children: "Button",
|
|
186
|
+
variant: "contained",
|
|
187
|
+
"data-testid": "button",
|
|
188
|
+
disabled: true
|
|
189
|
+
},
|
|
190
|
+
parameters: {
|
|
191
|
+
docs: {
|
|
192
|
+
description: {
|
|
193
|
+
story: "Boton deshabilitado."
|
|
194
|
+
},
|
|
195
|
+
source: {
|
|
196
|
+
code: DisabledStateButtonDefinition.trim()
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
play: async ({ canvasElement }) => {
|
|
201
|
+
const canvas = within(canvasElement);
|
|
202
|
+
const button = canvas.getByTestId("button");
|
|
203
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
204
|
+
expect(button).toBeDisabled();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
export const Loading: Story = {
|
|
210
|
+
args: {
|
|
211
|
+
children: "Button",
|
|
212
|
+
variant: "contained",
|
|
213
|
+
loading: true,
|
|
214
|
+
"data-testid": "button"
|
|
215
|
+
},
|
|
216
|
+
parameters: {
|
|
217
|
+
docs: {
|
|
218
|
+
description: {
|
|
219
|
+
story: "Boton con loader."
|
|
220
|
+
},
|
|
221
|
+
source: {
|
|
222
|
+
code: LoadingButtonDefinition.trim()
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
play: async ({ canvasElement }) => {
|
|
227
|
+
const canvas = within(canvasElement);
|
|
228
|
+
const button = canvas.getByTestId("button");
|
|
229
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
230
|
+
expect(button).toBeDisabled();
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export const LoadingStart: Story = {
|
|
235
|
+
args: {
|
|
236
|
+
children: "Button",
|
|
237
|
+
variant: "contained",
|
|
238
|
+
loading: true,
|
|
239
|
+
loadingPosition: "start",
|
|
240
|
+
"data-testid": "button"
|
|
241
|
+
},
|
|
242
|
+
parameters: {
|
|
243
|
+
docs: {
|
|
244
|
+
description: {
|
|
245
|
+
story: "Boton con al inicio loader."
|
|
246
|
+
},
|
|
247
|
+
source: {
|
|
248
|
+
code: LoadingIndicatorStartButtonDefinition.trim()
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
play: async ({ canvasElement }) => {
|
|
253
|
+
const canvas = within(canvasElement);
|
|
254
|
+
const button = canvas.getByTestId("button");
|
|
255
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
256
|
+
expect(button).toBeDisabled();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
export const LoadingEnd: Story = {
|
|
262
|
+
args: {
|
|
263
|
+
children: "Button",
|
|
264
|
+
variant: "contained",
|
|
265
|
+
loading: true,
|
|
266
|
+
loadingPosition: "end",
|
|
267
|
+
"data-testid": "button"
|
|
268
|
+
},
|
|
269
|
+
parameters: {
|
|
270
|
+
docs: {
|
|
271
|
+
description: {
|
|
272
|
+
story: "Boton con al inicio loader."
|
|
273
|
+
},
|
|
274
|
+
source: {
|
|
275
|
+
code: LoadingIndicatorEndButtonDefinition.trim()
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
play: async ({ canvasElement }) => {
|
|
280
|
+
const canvas = within(canvasElement);
|
|
281
|
+
const button = canvas.getByTestId("button");
|
|
282
|
+
expect(within(button).getByText("Button")).toBeInTheDocument();
|
|
283
|
+
expect(button).toBeDisabled();
|
|
284
|
+
}
|
|
285
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Button as MuiButton } from "@mui/material";
|
|
2
|
+
import type { ButtonProps } from "@mui/material/Button";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
type PickButtonProps = Pick<ButtonProps, "href" | "children" | "onClick" | "color" | "disabled" | "className" | "endIcon" | "startIcon" | "loading" | "loadingIndicator" | "variant" | "size" | "loadingPosition" | "type" | "sx">;
|
|
6
|
+
|
|
7
|
+
export interface MyButtonProps extends PickButtonProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
variant?: "text" | "outlined" | "contained";
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
endIcon?: React.ReactNode;
|
|
12
|
+
startIcon?: React.ReactNode;
|
|
13
|
+
size?: "small" | "medium" | "large";
|
|
14
|
+
className?: string;
|
|
15
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingIndicator?: React.ReactNode;
|
|
18
|
+
loadingPosition?: "start" | "end" | "center";
|
|
19
|
+
color?: "primary" | "success" | "error" | "info" | "warning"; //change for tailwind class colors
|
|
20
|
+
href?: string;
|
|
21
|
+
"data-testid"?: string;
|
|
22
|
+
type?: "button" | "submit" ;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Button: React.FC<MyButtonProps> = ({
|
|
26
|
+
children,
|
|
27
|
+
variant,
|
|
28
|
+
disabled,
|
|
29
|
+
startIcon,
|
|
30
|
+
endIcon,
|
|
31
|
+
size,
|
|
32
|
+
className,
|
|
33
|
+
onClick,
|
|
34
|
+
loading,
|
|
35
|
+
loadingPosition,
|
|
36
|
+
loadingIndicator,
|
|
37
|
+
color,
|
|
38
|
+
href,
|
|
39
|
+
"data-testid": dataTestId,
|
|
40
|
+
type,
|
|
41
|
+
sx
|
|
42
|
+
}) => {
|
|
43
|
+
return (
|
|
44
|
+
<MuiButton
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
variant={variant}
|
|
47
|
+
startIcon={startIcon}
|
|
48
|
+
endIcon={endIcon}
|
|
49
|
+
size={size}
|
|
50
|
+
className={className}
|
|
51
|
+
onClick={onClick}
|
|
52
|
+
loading={loading}
|
|
53
|
+
loadingPosition={loadingPosition}
|
|
54
|
+
loadingIndicator={loadingIndicator}
|
|
55
|
+
sx={{ textTransform: "none", ...sx }}
|
|
56
|
+
disableRipple={true}
|
|
57
|
+
disableElevation={true}
|
|
58
|
+
color={color}
|
|
59
|
+
data-testid={dataTestId}
|
|
60
|
+
href={href}
|
|
61
|
+
type={type}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</MuiButton>);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DefaultCardDefinition } from "./Card.definition";
|
|
2
|
+
import Card from "./Card";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Card> = {
|
|
6
|
+
title: "Components/Card",
|
|
7
|
+
component: Card,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered"
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"]
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof Card>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
children: "Card",
|
|
21
|
+
},
|
|
22
|
+
parameters: {
|
|
23
|
+
docs: {
|
|
24
|
+
description: {
|
|
25
|
+
story: "Tarjeta con el texto \"Card\" y el estilo \"default\"."
|
|
26
|
+
},
|
|
27
|
+
source: {
|
|
28
|
+
code: DefaultCardDefinition.trim()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CardActions, Card as MuiCard } from "@mui/material";
|
|
2
|
+
import type { CardProps } from "@mui/material/Card";
|
|
3
|
+
import { CardContent as MuiCardContent } from "@mui/material";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
type PickCardProps = Pick<CardProps, 'children' | 'raised' | 'sx' | 'className' | 'sx'>;
|
|
7
|
+
|
|
8
|
+
export interface MyCardProps extends PickCardProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
raised?: boolean;
|
|
11
|
+
className?: string
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
"data-testid"?: string;
|
|
15
|
+
sx?: object;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Card: React.FC<MyCardProps> = ({
|
|
19
|
+
children,
|
|
20
|
+
raised,
|
|
21
|
+
sx,
|
|
22
|
+
className,
|
|
23
|
+
onClick,
|
|
24
|
+
onBlur,
|
|
25
|
+
"data-testid": dataTestId
|
|
26
|
+
}) => {
|
|
27
|
+
return (
|
|
28
|
+
<MuiCard
|
|
29
|
+
raised={raised}
|
|
30
|
+
sx={sx}
|
|
31
|
+
className={className}
|
|
32
|
+
data-testid={dataTestId}
|
|
33
|
+
onClick={onClick}
|
|
34
|
+
onBlur={onBlur}
|
|
35
|
+
|
|
36
|
+
>
|
|
37
|
+
|
|
38
|
+
{children}
|
|
39
|
+
|
|
40
|
+
</MuiCard>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default Card;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Card } from './Card';
|