@cgi-learning-hub/ui 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +63417 -1
- package/dist/index.d.ts +773 -1
- package/dist/index.es.js +63394 -417
- package/dist/ui.css +151 -0
- package/package.json +26 -24
- package/dist/Alert-BH_3hKCB.cjs +0 -1
- package/dist/Alert-BeVYzSS-.js +0 -94
- package/dist/Alert-BoYBWOXe.cjs +0 -1
- package/dist/Alert-CEu3llDi.js +0 -369
- package/dist/Autocomplete-BKpavKFW.cjs +0 -6
- package/dist/Autocomplete-DBZYn4YL.js +0 -1881
- package/dist/Backdrop-BvL371G3.js +0 -360
- package/dist/Backdrop-qOBrabpf.cjs +0 -1
- package/dist/Badge-2Kgbx-Cs.js +0 -466
- package/dist/Badge-DXl0Da36.cjs +0 -1
- package/dist/Box-BaZ7KlAc.js +0 -59
- package/dist/Box-CYQlQqRB.cjs +0 -1
- package/dist/Button-BP-QmmUu.cjs +0 -1
- package/dist/Button-C1mKNW-c.js +0 -698
- package/dist/ButtonBase-C2jRC_V7.js +0 -883
- package/dist/ButtonBase-DSJojbNE.cjs +0 -74
- package/dist/CardContent-DVcUynuH.cjs +0 -1
- package/dist/CardContent-kIapWv4T.js +0 -225
- package/dist/Checkbox-DhhuvKO5.cjs +0 -1
- package/dist/Checkbox-RxHWtafR.js +0 -271
- package/dist/Chip-DgGmi9yn.js +0 -574
- package/dist/Chip-n1kY-Dsh.cjs +0 -1
- package/dist/CircularProgress-BOm4zz7e.cjs +0 -28
- package/dist/CircularProgress-CLq0Rl-1.js +0 -253
- package/dist/Close-DR9m6hv3.cjs +0 -1
- package/dist/Close-vu-MZYNA.js +0 -9
- package/dist/CloseRounded-Cpp6nWQi.cjs +0 -1
- package/dist/CloseRounded-DF05lCUu.js +0 -8
- package/dist/CustomTreeItem-AecanDDg.js +0 -2046
- package/dist/CustomTreeItem-BBMp0k4i.cjs +0 -41
- package/dist/DatePicker-Cd-Aj-F8.js +0 -10758
- package/dist/DatePicker-Dj7U52Mk.cjs +0 -16
- package/dist/DefaultPropsProvider-BrmlvPWg.js +0 -312
- package/dist/DefaultPropsProvider-C1g4BXET.cjs +0 -1
- package/dist/Delete-C36W48MB.cjs +0 -1
- package/dist/Delete-DXUljXzP.js +0 -8
- package/dist/Dialog-C2HYr67H.cjs +0 -1
- package/dist/Dialog-D__8rwpw.js +0 -469
- package/dist/DialogContent-MPwmUJQp.js +0 -195
- package/dist/DialogContent-lup2v_ab.cjs +0 -1
- package/dist/DialogTitle-B8jOk7ZE.cjs +0 -1
- package/dist/DialogTitle-Dly5D3Ud.js +0 -134
- package/dist/Divider-BN12gMv9.js +0 -297
- package/dist/Divider-wisA5Qp_.cjs +0 -1
- package/dist/Folder-BSZMyA2L.js +0 -8
- package/dist/Folder-aAI_w_uF.cjs +0 -1
- package/dist/FormLabel-ByYWZh7M.cjs +0 -2
- package/dist/FormLabel-DtxJI2CU.js +0 -408
- package/dist/Grid-C0LY-MbT.js +0 -419
- package/dist/Grid-CPXE25PR.cjs +0 -2
- package/dist/Grow-6zwoqUfO.cjs +0 -1
- package/dist/Grow-CeGwnQpw.js +0 -197
- package/dist/IconButton-BTN16gZi.cjs +0 -2
- package/dist/IconButton-DBjiNqOa.js +0 -299
- package/dist/InputAdornment-C1r1YutO.cjs +0 -1
- package/dist/InputAdornment-DuR35FtU.js +0 -173
- package/dist/InputBase-CxknnWV4.cjs +0 -4
- package/dist/InputBase-D5UJOJBu.js +0 -797
- package/dist/Link-T11NCxGd.cjs +0 -1
- package/dist/Link-hWCqsQiI.js +0 -281
- package/dist/List-CmJ1jCss.js +0 -131
- package/dist/List-eQ4D0MvJ.cjs +0 -1
- package/dist/ListItem-CgWgbZ_g.cjs +0 -1
- package/dist/ListItem-onoPfwb4.js +0 -423
- package/dist/ListItemText-B-dySXgz.cjs +0 -1
- package/dist/ListItemText-BjhXxIIV.js +0 -441
- package/dist/Menu-D7B383z4.cjs +0 -7
- package/dist/Menu-DGvAkF5F.js +0 -911
- package/dist/MenuItem-Cusmy5t2.js +0 -268
- package/dist/MenuItem-D-4xzo-S.cjs +0 -1
- package/dist/Modal-DB9K8sJI.cjs +0 -2
- package/dist/Modal-DtjScKxh.js +0 -744
- package/dist/MoreVert-BwfUF9pO.cjs +0 -1
- package/dist/MoreVert-woCQ0dNf.js +0 -8
- package/dist/Paper-CZXfHfN_.js +0 -158
- package/dist/Paper-DcVuAxq3.cjs +0 -2
- package/dist/Popper-BwuGO_Si.js +0 -1407
- package/dist/Popper-D5Cs38W_.cjs +0 -4
- package/dist/Portal-Cmv45gpL.cjs +0 -1
- package/dist/Portal-PkRJuFYN.js +0 -85
- package/dist/Radio-DiyDpiVL.js +0 -617
- package/dist/Radio-DzKwkI68.cjs +0 -1
- package/dist/RadioGroup-BlkHQVRF.cjs +0 -1
- package/dist/RadioGroup-CjUaFqjJ.js +0 -191
- package/dist/Select-BxH16ruJ.js +0 -2648
- package/dist/Select-CSQfbogA.cjs +0 -3
- package/dist/Stack-ChvZzNqc.cjs +0 -1
- package/dist/Stack-pMJEpL7k.js +0 -173
- package/dist/Stepper-BsfN7O-W.cjs +0 -1
- package/dist/Stepper-DyH4sgY5.js +0 -966
- package/dist/Switch-BgZUmsKc.js +0 -392
- package/dist/Switch-Dr2jgPGV.cjs +0 -1
- package/dist/SwitchBase-BP_I-APE.cjs +0 -1
- package/dist/SwitchBase-BWz31Ed6.js +0 -319
- package/dist/Tab-Bksf_S4K.js +0 -1454
- package/dist/Tab-D2mI5G0L.cjs +0 -4
- package/dist/TextField-C9AnzUpZ.cjs +0 -1
- package/dist/TextField-Ctx4aW6-.js +0 -560
- package/dist/ToggleButtonGroup-CBw2I124.cjs +0 -138
- package/dist/ToggleButtonGroup-DtjRqNbI.js +0 -9091
- package/dist/Tooltip-C5AffX17.js +0 -722
- package/dist/Tooltip-CUm8vKGq.cjs +0 -4
- package/dist/TransitionGroupContext-DbLioz_6.js +0 -24
- package/dist/TransitionGroupContext-Zt4NoR0u.cjs +0 -1
- package/dist/Typography-Cr-aIusw.js +0 -261
- package/dist/Typography-DHjq4GzQ.cjs +0 -1
- package/dist/assets/Loader.css +0 -1
- package/dist/assets/LoaderBackdrop.css +0 -1
- package/dist/capitalize-3OjkeP9i.cjs +0 -1
- package/dist/capitalize-BHEX83JQ.js +0 -9
- package/dist/chainPropTypes-CEUi6Jb4.cjs +0 -1
- package/dist/chainPropTypes-D9lkm76m.js +0 -8
- package/dist/client-error-CHkavqXs.cjs +0 -1
- package/dist/client-error-D0Ng5oOn.js +0 -393
- package/dist/components/ActionBar/ActionBar.cjs.js +0 -1
- package/dist/components/ActionBar/ActionBar.d.ts +0 -3
- package/dist/components/ActionBar/ActionBar.es.js +0 -63
- package/dist/components/ActionBar/index.cjs.js +0 -1
- package/dist/components/ActionBar/index.d.ts +0 -2
- package/dist/components/ActionBar/index.es.js +0 -4
- package/dist/components/ActionBar/style.cjs.js +0 -1
- package/dist/components/ActionBar/style.es.js +0 -61
- package/dist/components/ActionBar/types.cjs.js +0 -1
- package/dist/components/ActionBar/types.d.ts +0 -17
- package/dist/components/ActionBar/types.es.js +0 -1
- package/dist/components/Alert/Alert.cjs.js +0 -1
- package/dist/components/Alert/Alert.d.ts +0 -6
- package/dist/components/Alert/Alert.es.js +0 -8
- package/dist/components/Alert/index.cjs.js +0 -1
- package/dist/components/Alert/index.d.ts +0 -2
- package/dist/components/Alert/index.es.js +0 -4
- package/dist/components/Button/Button.cjs.js +0 -1
- package/dist/components/Button/Button.d.ts +0 -3
- package/dist/components/Button/Button.es.js +0 -44
- package/dist/components/Button/index.cjs.js +0 -1
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Button/index.es.js +0 -4
- package/dist/components/ButtonGroup/ButtonGroup.cjs.js +0 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +0 -3
- package/dist/components/ButtonGroup/ButtonGroup.es.js +0 -38
- package/dist/components/ButtonGroup/index.cjs.js +0 -1
- package/dist/components/ButtonGroup/index.d.ts +0 -2
- package/dist/components/ButtonGroup/index.es.js +0 -4
- package/dist/components/ButtonGroup/style.cjs.js +0 -1
- package/dist/components/ButtonGroup/style.es.js +0 -29
- package/dist/components/ButtonGroup/types.cjs.js +0 -1
- package/dist/components/ButtonGroup/types.d.ts +0 -22
- package/dist/components/ButtonGroup/types.es.js +0 -1
- package/dist/components/ColorPicker/ColorPicker.cjs.js +0 -27
- package/dist/components/ColorPicker/ColorPicker.d.ts +0 -4
- package/dist/components/ColorPicker/ColorPicker.es.js +0 -7960
- package/dist/components/ColorPicker/ColorPickerIcon.cjs.js +0 -1
- package/dist/components/ColorPicker/ColorPickerIcon.d.ts +0 -5
- package/dist/components/ColorPicker/ColorPickerIcon.es.js +0 -58
- package/dist/components/ColorPicker/index.cjs.js +0 -1
- package/dist/components/ColorPicker/index.d.ts +0 -3
- package/dist/components/ColorPicker/index.es.js +0 -4
- package/dist/components/ColorPicker/styles.cjs.js +0 -1
- package/dist/components/ColorPicker/styles.es.js +0 -28
- package/dist/components/ColorPicker/types.cjs.js +0 -1
- package/dist/components/ColorPicker/types.d.ts +0 -19
- package/dist/components/ColorPicker/types.es.js +0 -1
- package/dist/components/DatePicker/DatePicker.cjs.js +0 -1
- package/dist/components/DatePicker/DatePicker.d.ts +0 -6
- package/dist/components/DatePicker/DatePicker.es.js +0 -5
- package/dist/components/DatePicker/index.cjs.js +0 -1
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/DatePicker/index.es.js +0 -4
- package/dist/components/Dialog/Dialog.cjs.js +0 -1
- package/dist/components/Dialog/Dialog.d.ts +0 -6
- package/dist/components/Dialog/Dialog.es.js +0 -31
- package/dist/components/Dialog/index.cjs.js +0 -1
- package/dist/components/Dialog/index.d.ts +0 -2
- package/dist/components/Dialog/index.es.js +0 -4
- package/dist/components/Dropzone/Dropzone.cjs.js +0 -1
- package/dist/components/Dropzone/Dropzone.d.ts +0 -12
- package/dist/components/Dropzone/Dropzone.es.js +0 -55
- package/dist/components/Dropzone/index.cjs.js +0 -1
- package/dist/components/Dropzone/index.d.ts +0 -2
- package/dist/components/Dropzone/index.es.js +0 -4
- package/dist/components/Dropzone/types.cjs.js +0 -1
- package/dist/components/Dropzone/types.d.ts +0 -8
- package/dist/components/Dropzone/types.es.js +0 -1
- package/dist/components/EllipsisWithTooltip/EllipsisWithTooltip.cjs.js +0 -1
- package/dist/components/EllipsisWithTooltip/EllipsisWithTooltip.d.ts +0 -9
- package/dist/components/EllipsisWithTooltip/EllipsisWithTooltip.es.js +0 -45
- package/dist/components/EllipsisWithTooltip/index.cjs.js +0 -1
- package/dist/components/EllipsisWithTooltip/index.d.ts +0 -2
- package/dist/components/EllipsisWithTooltip/index.es.js +0 -4
- package/dist/components/EmptyState/EmptyState.cjs.js +0 -1
- package/dist/components/EmptyState/EmptyState.d.ts +0 -22
- package/dist/components/EmptyState/EmptyState.es.js +0 -34
- package/dist/components/EmptyState/index.cjs.js +0 -1
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/EmptyState/index.es.js +0 -4
- package/dist/components/FileList/FileIcon.cjs.js +0 -1
- package/dist/components/FileList/FileIcon.d.ts +0 -3
- package/dist/components/FileList/FileIcon.es.js +0 -56
- package/dist/components/FileList/FileInfosSeparator.cjs.js +0 -1
- package/dist/components/FileList/FileInfosSeparator.d.ts +0 -1
- package/dist/components/FileList/FileInfosSeparator.es.js +0 -14
- package/dist/components/FileList/FileList.cjs.js +0 -1
- package/dist/components/FileList/FileList.d.ts +0 -9
- package/dist/components/FileList/FileList.es.js +0 -24
- package/dist/components/FileList/FileListItem.cjs.js +0 -1
- package/dist/components/FileList/FileListItem.d.ts +0 -16
- package/dist/components/FileList/FileListItem.es.js +0 -122
- package/dist/components/FileList/index.cjs.js +0 -1
- package/dist/components/FileList/index.d.ts +0 -4
- package/dist/components/FileList/index.es.js +0 -6
- package/dist/components/FileList/utils.cjs.js +0 -1
- package/dist/components/FileList/utils.d.ts +0 -2
- package/dist/components/FileList/utils.es.js +0 -13
- package/dist/components/FolderCard/FolderCard.cjs.js +0 -1
- package/dist/components/FolderCard/FolderCard.d.ts +0 -12
- package/dist/components/FolderCard/FolderCard.es.js +0 -88
- package/dist/components/FolderCard/index.cjs.js +0 -1
- package/dist/components/FolderCard/index.d.ts +0 -2
- package/dist/components/FolderCard/index.es.js +0 -4
- package/dist/components/FolderCard/styles.cjs.js +0 -1
- package/dist/components/FolderCard/styles.d.ts +0 -24
- package/dist/components/FolderCard/styles.es.js +0 -27
- package/dist/components/FolderCard/types.cjs.js +0 -1
- package/dist/components/FolderCard/types.d.ts +0 -3
- package/dist/components/FolderCard/types.es.js +0 -14
- package/dist/components/Heading/Heading.cjs.js +0 -1
- package/dist/components/Heading/Heading.d.ts +0 -14
- package/dist/components/Heading/Heading.es.js +0 -39
- package/dist/components/Heading/index.cjs.js +0 -1
- package/dist/components/Heading/index.d.ts +0 -2
- package/dist/components/Heading/index.es.js +0 -4
- package/dist/components/ImagePicker/ImagePicker.cjs.js +0 -1
- package/dist/components/ImagePicker/ImagePicker.d.ts +0 -13
- package/dist/components/ImagePicker/ImagePicker.es.js +0 -203
- package/dist/components/ImagePicker/index.cjs.js +0 -1
- package/dist/components/ImagePicker/index.d.ts +0 -2
- package/dist/components/ImagePicker/index.es.js +0 -4
- package/dist/components/Loader/Loader.cjs.js +0 -1
- package/dist/components/Loader/Loader.d.ts +0 -3
- package/dist/components/Loader/Loader.es.js +0 -11
- package/dist/components/Loader/index.cjs.js +0 -1
- package/dist/components/Loader/index.d.ts +0 -2
- package/dist/components/Loader/index.es.js +0 -4
- package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +0 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.d.ts +0 -3
- package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +0 -12
- package/dist/components/LoaderBackdrop/index.cjs.js +0 -1
- package/dist/components/LoaderBackdrop/index.d.ts +0 -2
- package/dist/components/LoaderBackdrop/index.es.js +0 -4
- package/dist/components/PasswordInput/PasswordInput.cjs.js +0 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -5
- package/dist/components/PasswordInput/PasswordInput.es.js +0 -39
- package/dist/components/PasswordInput/index.cjs.js +0 -1
- package/dist/components/PasswordInput/index.d.ts +0 -2
- package/dist/components/PasswordInput/index.es.js +0 -4
- package/dist/components/QueryError/QueryError.cjs.js +0 -1
- package/dist/components/QueryError/QueryError.d.ts +0 -8
- package/dist/components/QueryError/QueryError.es.js +0 -46
- package/dist/components/QueryError/helpers.cjs.js +0 -1
- package/dist/components/QueryError/helpers.d.ts +0 -11
- package/dist/components/QueryError/helpers.es.js +0 -10
- package/dist/components/QueryError/index.cjs.js +0 -1
- package/dist/components/QueryError/index.d.ts +0 -2
- package/dist/components/QueryError/index.es.js +0 -4
- package/dist/components/ResourceCard/ResourceCard.cjs.js +0 -1
- package/dist/components/ResourceCard/ResourceCard.d.ts +0 -25
- package/dist/components/ResourceCard/ResourceCard.es.js +0 -128
- package/dist/components/ResourceCard/index.cjs.js +0 -1
- package/dist/components/ResourceCard/index.d.ts +0 -2
- package/dist/components/ResourceCard/index.es.js +0 -4
- package/dist/components/ResourceCard/style.cjs.js +0 -1
- package/dist/components/ResourceCard/style.es.js +0 -130
- package/dist/components/SearchInput/SearchInput.cjs.js +0 -1
- package/dist/components/SearchInput/SearchInput.d.ts +0 -4
- package/dist/components/SearchInput/SearchInput.es.js +0 -38
- package/dist/components/SearchInput/index.cjs.js +0 -1
- package/dist/components/SearchInput/index.d.ts +0 -2
- package/dist/components/SearchInput/index.es.js +0 -4
- package/dist/components/TreeView/TreeView.cjs.js +0 -5
- package/dist/components/TreeView/TreeView.d.ts +0 -4
- package/dist/components/TreeView/TreeView.es.js +0 -1663
- package/dist/components/TreeView/components/CustomTreeItem.cjs.js +0 -1
- package/dist/components/TreeView/components/CustomTreeItem.d.ts +0 -6
- package/dist/components/TreeView/components/CustomTreeItem.es.js +0 -9
- package/dist/components/TreeView/index.cjs.js +0 -1
- package/dist/components/TreeView/index.d.ts +0 -2
- package/dist/components/TreeView/index.es.js +0 -6
- package/dist/components/TreeView/style.cjs.js +0 -1
- package/dist/components/TreeView/style.es.js +0 -35
- package/dist/components/TreeView/types.cjs.js +0 -1
- package/dist/components/TreeView/types.d.ts +0 -45
- package/dist/components/TreeView/types.es.js +0 -4
- package/dist/components/TreeView/utils.cjs.js +0 -1
- package/dist/components/TreeView/utils.d.ts +0 -6
- package/dist/components/TreeView/utils.es.js +0 -50
- package/dist/components/index.cjs.js +0 -1
- package/dist/components/index.d.ts +0 -197
- package/dist/components/index.es.js +0 -419
- package/dist/components/stories/ActionBar.stories.cjs.js +0 -1
- package/dist/components/stories/ActionBar.stories.d.ts +0 -11
- package/dist/components/stories/ActionBar.stories.es.js +0 -206
- package/dist/components/stories/Alert.stories.cjs.js +0 -1
- package/dist/components/stories/Alert.stories.d.ts +0 -9
- package/dist/components/stories/Alert.stories.es.js +0 -32
- package/dist/components/stories/Autocomplete.stories.cjs.js +0 -3
- package/dist/components/stories/Autocomplete.stories.d.ts +0 -6
- package/dist/components/stories/Autocomplete.stories.es.js +0 -62
- package/dist/components/stories/Badge.stories.cjs.js +0 -1
- package/dist/components/stories/Badge.stories.d.ts +0 -17
- package/dist/components/stories/Badge.stories.es.js +0 -188
- package/dist/components/stories/Button.stories.cjs.js +0 -1
- package/dist/components/stories/Button.stories.d.ts +0 -8
- package/dist/components/stories/Button.stories.es.js +0 -61
- package/dist/components/stories/ButtonGroup.stories.cjs.js +0 -153
- package/dist/components/stories/ButtonGroup.stories.d.ts +0 -17
- package/dist/components/stories/ButtonGroup.stories.es.js +0 -1296
- package/dist/components/stories/Card.stories.cjs.js +0 -1
- package/dist/components/stories/Card.stories.d.ts +0 -7
- package/dist/components/stories/Card.stories.es.js +0 -42
- package/dist/components/stories/Checkbox.stories.cjs.js +0 -1
- package/dist/components/stories/Checkbox.stories.d.ts +0 -10
- package/dist/components/stories/Checkbox.stories.es.js +0 -57
- package/dist/components/stories/Chip.stories.cjs.js +0 -1
- package/dist/components/stories/Chip.stories.d.ts +0 -10
- package/dist/components/stories/Chip.stories.es.js +0 -77
- package/dist/components/stories/ColoPicker.stories.cjs.js +0 -1
- package/dist/components/stories/ColoPicker.stories.d.ts +0 -6
- package/dist/components/stories/ColoPicker.stories.es.js +0 -23
- package/dist/components/stories/DatePicker.stories.cjs.js +0 -1
- package/dist/components/stories/DatePicker.stories.d.ts +0 -6
- package/dist/components/stories/DatePicker.stories.es.js +0 -13
- package/dist/components/stories/Dialog.stories.cjs.js +0 -1
- package/dist/components/stories/Dialog.stories.d.ts +0 -7
- package/dist/components/stories/Dialog.stories.es.js +0 -65
- package/dist/components/stories/Divider.stories.cjs.js +0 -1
- package/dist/components/stories/Divider.stories.d.ts +0 -6
- package/dist/components/stories/Divider.stories.es.js +0 -41
- package/dist/components/stories/Dropzone.stories.cjs.js +0 -1
- package/dist/components/stories/Dropzone.stories.d.ts +0 -6
- package/dist/components/stories/Dropzone.stories.es.js +0 -14
- package/dist/components/stories/EllipsisWithTooltip.stories.cjs.js +0 -1
- package/dist/components/stories/EllipsisWithTooltip.stories.d.ts +0 -6
- package/dist/components/stories/EllipsisWithTooltip.stories.es.js +0 -36
- package/dist/components/stories/EmptyState.stories.cjs.js +0 -1
- package/dist/components/stories/EmptyState.stories.d.ts +0 -6
- package/dist/components/stories/EmptyState.stories.es.js +0 -30
- package/dist/components/stories/FileList.stories.cjs.js +0 -8
- package/dist/components/stories/FileList.stories.d.ts +0 -6
- package/dist/components/stories/FileList.stories.es.js +0 -150
- package/dist/components/stories/FolderCard.stories.cjs.js +0 -1
- package/dist/components/stories/FolderCard.stories.d.ts +0 -7
- package/dist/components/stories/FolderCard.stories.es.js +0 -71
- package/dist/components/stories/FormControlLabel.stories.cjs.js +0 -1
- package/dist/components/stories/FormControlLabel.stories.d.ts +0 -9
- package/dist/components/stories/FormControlLabel.stories.es.js +0 -55
- package/dist/components/stories/Heading.stories.cjs.js +0 -1
- package/dist/components/stories/Heading.stories.d.ts +0 -6
- package/dist/components/stories/Heading.stories.es.js +0 -20
- package/dist/components/stories/IconButton.stories.cjs.js +0 -1
- package/dist/components/stories/IconButton.stories.d.ts +0 -6
- package/dist/components/stories/IconButton.stories.es.js +0 -55
- package/dist/components/stories/ImagePicker.stories.cjs.js +0 -1
- package/dist/components/stories/ImagePicker.stories.d.ts +0 -6
- package/dist/components/stories/ImagePicker.stories.es.js +0 -57
- package/dist/components/stories/Link.stories.cjs.js +0 -1
- package/dist/components/stories/Link.stories.d.ts +0 -7
- package/dist/components/stories/Link.stories.es.js +0 -43
- package/dist/components/stories/Loader.stories.cjs.js +0 -1
- package/dist/components/stories/Loader.stories.d.ts +0 -6
- package/dist/components/stories/Loader.stories.es.js +0 -11
- package/dist/components/stories/LoaderBackdrop.stories.cjs.js +0 -1
- package/dist/components/stories/LoaderBackdrop.stories.d.ts +0 -6
- package/dist/components/stories/LoaderBackdrop.stories.es.js +0 -11
- package/dist/components/stories/Menu.stories.cjs.js +0 -1
- package/dist/components/stories/Menu.stories.d.ts +0 -7
- package/dist/components/stories/Menu.stories.es.js +0 -51
- package/dist/components/stories/Paper.stories.cjs.js +0 -1
- package/dist/components/stories/Paper.stories.d.ts +0 -7
- package/dist/components/stories/Paper.stories.es.js +0 -28
- package/dist/components/stories/PasswordInput.stories.cjs.js +0 -1
- package/dist/components/stories/PasswordInput.stories.d.ts +0 -6
- package/dist/components/stories/PasswordInput.stories.es.js +0 -13
- package/dist/components/stories/RadioGroup.stories.cjs.js +0 -1
- package/dist/components/stories/RadioGroup.stories.d.ts +0 -8
- package/dist/components/stories/RadioGroup.stories.es.js +0 -37
- package/dist/components/stories/ResourceCard.stories.cjs.js +0 -1
- package/dist/components/stories/ResourceCard.stories.d.ts +0 -9
- package/dist/components/stories/ResourceCard.stories.es.js +0 -141
- package/dist/components/stories/SearchInput.stories.cjs.js +0 -1
- package/dist/components/stories/SearchInput.stories.d.ts +0 -6
- package/dist/components/stories/SearchInput.stories.es.js +0 -13
- package/dist/components/stories/Select.stories.cjs.js +0 -1
- package/dist/components/stories/Select.stories.d.ts +0 -10
- package/dist/components/stories/Select.stories.es.js +0 -52
- package/dist/components/stories/Stepper.stories.cjs.js +0 -1
- package/dist/components/stories/Stepper.stories.d.ts +0 -7
- package/dist/components/stories/Stepper.stories.es.js +0 -161
- package/dist/components/stories/TabList.stories.cjs.js +0 -1
- package/dist/components/stories/TabList.stories.d.ts +0 -7
- package/dist/components/stories/TabList.stories.es.js +0 -73
- package/dist/components/stories/TextField.stories.cjs.js +0 -1
- package/dist/components/stories/TextField.stories.d.ts +0 -10
- package/dist/components/stories/TextField.stories.es.js +0 -69
- package/dist/components/stories/Tooltip.stories.cjs.js +0 -1
- package/dist/components/stories/Tooltip.stories.d.ts +0 -7
- package/dist/components/stories/Tooltip.stories.es.js +0 -46
- package/dist/components/stories/TreeView.stories.cjs.js +0 -69
- package/dist/components/stories/TreeView.stories.d.ts +0 -15
- package/dist/components/stories/TreeView.stories.es.js +0 -1036
- package/dist/components/stories/Typography.stories.cjs.js +0 -1
- package/dist/components/stories/Typography.stories.d.ts +0 -6
- package/dist/components/stories/Typography.stories.es.js +0 -65
- package/dist/composeClasses-BskurlZX.js +0 -51
- package/dist/composeClasses-vN5Almps.cjs +0 -1
- package/dist/createChainedFunction-C0nujS3O.js +0 -9
- package/dist/createChainedFunction-CJmlQuW8.cjs +0 -1
- package/dist/createSimplePaletteValueFilter-B7--0ryQ.js +0 -17
- package/dist/createSimplePaletteValueFilter-PTK3TAhW.cjs +0 -1
- package/dist/createSvgIcon-CcWpa9Le.cjs +0 -1
- package/dist/createSvgIcon-DFIM5PqN.js +0 -254
- package/dist/debounce-46wSf_lW.js +0 -15
- package/dist/debounce-DpCj7ugL.cjs +0 -1
- package/dist/dividerClasses-BEzQ_reA.js +0 -9
- package/dist/dividerClasses-BpVbhp8e.cjs +0 -1
- package/dist/elementAcceptingRef-CZLfau9O.js +0 -31
- package/dist/elementAcceptingRef-CuMilXz3.cjs +0 -1
- package/dist/elementTypeAcceptingRef-vRb2iI4O.js +0 -23
- package/dist/elementTypeAcceptingRef-vjR5jGLx.cjs +0 -1
- package/dist/error-CRNeivL7.js +0 -5
- package/dist/error-Dk3o6ber.cjs +0 -1
- package/dist/extendSxProp-DGsHTtAe.js +0 -37
- package/dist/extendSxProp-Dwd9vpYv.cjs +0 -1
- package/dist/formControlState-CuX6WjAX.cjs +0 -1
- package/dist/formControlState-vgaj2ksH.js +0 -10
- package/dist/generateUtilityClasses-B_xKAflz.js +0 -2703
- package/dist/generateUtilityClasses-CENS22bI.cjs +0 -55
- package/dist/hooks/lazySvgImport.cjs.js +0 -1
- package/dist/hooks/lazySvgImport.d.ts +0 -6
- package/dist/hooks/lazySvgImport.es.js +0 -34
- package/dist/index-B9vkf41S.js +0 -672
- package/dist/index-BPpGXp0s.cjs +0 -1
- package/dist/index-BS46Ff4t.cjs +0 -5
- package/dist/index-Ba4TEBpP.js +0 -22
- package/dist/index-CJMnfcQs.js +0 -2152
- package/dist/index-CwHv-blH.js +0 -97
- package/dist/index-D_kvDIOz.cjs +0 -1
- package/dist/index-kjfz41UI.cjs +0 -20
- package/dist/integerPropType-BihGt2aU.js +0 -31
- package/dist/integerPropType-CR7ytEJG.cjs +0 -1
- package/dist/isFocusVisible-CPZqtjv2.js +0 -12
- package/dist/isFocusVisible-DlSijby6.cjs +0 -2
- package/dist/isHostComponent-PydJW4A4.cjs +0 -1
- package/dist/isHostComponent-kiaBvYVo.js +0 -6
- package/dist/isMuiElement-BzDAj3yJ.cjs +0 -1
- package/dist/isMuiElement-DnSE4qG4.js +0 -13
- package/dist/listItemTextClasses-CEbo8A-K.js +0 -9
- package/dist/listItemTextClasses-wcJANWC3.cjs +0 -1
- package/dist/memoTheme-Bi1UNdyO.cjs +0 -1
- package/dist/memoTheme-C-PaH-Cy.js +0 -15
- package/dist/mergeSlotProps-CL6s5QgQ.cjs +0 -1
- package/dist/mergeSlotProps-DVtjofCS.js +0 -62
- package/dist/ownerDocument-4MViGo3k.cjs +0 -1
- package/dist/ownerDocument-CUrv0DIK.js +0 -6
- package/dist/ownerWindow-DDHucZi0.cjs +0 -1
- package/dist/ownerWindow-niciwP7I.js +0 -7
- package/dist/refType-8hihVLUh.js +0 -5
- package/dist/refType-DJyA--UV.cjs +0 -1
- package/dist/server-error-CqyYyPLN.cjs +0 -1
- package/dist/server-error-CvgIy7ap.js +0 -398
- package/dist/unsupportedProp-Bn6XWqwH.cjs +0 -1
- package/dist/unsupportedProp-BuVD30Gh.js +0 -9
- package/dist/useControlled-QrrYcKxm.cjs +0 -3
- package/dist/useControlled-nm4pBabJ.js +0 -31
- package/dist/useEventCallback-BxpcFap0.cjs +0 -1
- package/dist/useEventCallback-Y2KwRxBw.js +0 -15
- package/dist/useForkRef-CFhhTu-Q.cjs +0 -1
- package/dist/useForkRef-u29GSuCu.js +0 -27
- package/dist/useFormControl-CatNKXAi.js +0 -10
- package/dist/useFormControl-haP0iPhl.cjs +0 -1
- package/dist/useId-CK6Kn3Tn.js +0 -21
- package/dist/useId-DNXtOFeX.cjs +0 -1
- package/dist/usePreviousProps-ByGlbpJ6.js +0 -10
- package/dist/usePreviousProps-jC3PWcIp.cjs +0 -1
- package/dist/useSlot-BSkdRaZr.js +0 -125
- package/dist/useSlot-C-aMxEm0.cjs +0 -1
- package/dist/useSlotProps-BVVfeURp.cjs +0 -1
- package/dist/useSlotProps-CWTjRiRv.js +0 -25
- package/dist/useTheme-0AkY41zn.js +0 -11
- package/dist/useTheme-BT6SDKkk.cjs +0 -1
- package/dist/useTheme-BrGF2Vm0.cjs +0 -1
- package/dist/useTheme-DSA6Ir8k.js +0 -18
- package/dist/useThemeProps-BWsN0TEk.cjs +0 -1
- package/dist/useThemeProps-CAonvyKa.js +0 -27
- package/dist/useThemeProps-JozrkyA_.cjs +0 -1
- package/dist/useThemeProps-hSh1qhnc.js +0 -17
- package/dist/useTimeout-COCrDKz-.cjs +0 -1
- package/dist/useTimeout-CrCYVizI.js +0 -42
- package/dist/utils-BWx1W_q1.cjs +0 -1
- package/dist/utils-B_pVp6UZ.js +0 -363
- package/dist/utils-DWqc1kRF.js +0 -13
- package/dist/utils-XujN9ndp.cjs +0 -1
- package/dist/warning-C8W811fV.js +0 -11
- package/dist/warning-DMUNDgRg.cjs +0 -2
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),a=require("../../Autocomplete-BKpavKFW.cjs"),s=require("../../TextField-C9AnzUpZ.cjs"),i=t=>{const o=["Paris","Londres","Berlin","Madrid","Rome","Amsterdam","Bruxelles","Lisbonne","Vienne","Athènes"];return e.jsx(a.Autocomplete,{options:o,sx:{width:300},renderInput:l=>e.jsx(s.TextField,{...l,label:"Choisissez une ville"}),...t})},n={title:"Components/Autocomplete",component:i,parameters:{docs:{description:{component:`L'autocomplete est une saisie de texte normale enrichie d'un panel d'options suggérées.
|
|
2
|
-
|
|
3
|
-
Pour explorer les cas d'usage possibles : [Autocomplete component - Material UI](https://mui.com/material-ui/react-autocomplete)`}}},argTypes:{autoHighlight:{control:"boolean",description:"Met automatiquement en surbrillance la première option",table:{defaultValue:{summary:"false"}}},disableClearable:{control:"boolean",description:"Désactive la possibilité de vider le champ",table:{defaultValue:{summary:"false"}}},disabled:{control:"boolean",description:"Désactive le composant",table:{defaultValue:{summary:"false"}}}}},r={args:{autoHighlight:!1,disableClearable:!1,disabled:!1}};exports.Default=r;exports.default=n;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
declare const Autocomplete: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const meta: Meta<typeof Autocomplete>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Autocomplete>;
|
|
6
|
-
export declare const Default: Story;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { A as a } from "../../Autocomplete-DBZYn4YL.js";
|
|
3
|
-
import { T as l } from "../../TextField-Ctx4aW6-.js";
|
|
4
|
-
const s = (t) => /* @__PURE__ */ e(
|
|
5
|
-
a,
|
|
6
|
-
{
|
|
7
|
-
options: [
|
|
8
|
-
"Paris",
|
|
9
|
-
"Londres",
|
|
10
|
-
"Berlin",
|
|
11
|
-
"Madrid",
|
|
12
|
-
"Rome",
|
|
13
|
-
"Amsterdam",
|
|
14
|
-
"Bruxelles",
|
|
15
|
-
"Lisbonne",
|
|
16
|
-
"Vienne",
|
|
17
|
-
"Athènes"
|
|
18
|
-
],
|
|
19
|
-
sx: { width: 300 },
|
|
20
|
-
renderInput: (o) => /* @__PURE__ */ e(l, { ...o, label: "Choisissez une ville" }),
|
|
21
|
-
...t
|
|
22
|
-
}
|
|
23
|
-
), p = {
|
|
24
|
-
title: "Components/Autocomplete",
|
|
25
|
-
component: s,
|
|
26
|
-
parameters: {
|
|
27
|
-
docs: {
|
|
28
|
-
description: {
|
|
29
|
-
component: `L'autocomplete est une saisie de texte normale enrichie d'un panel d'options suggérées.
|
|
30
|
-
|
|
31
|
-
Pour explorer les cas d'usage possibles : [Autocomplete component - Material UI](https://mui.com/material-ui/react-autocomplete)`
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
argTypes: {
|
|
36
|
-
autoHighlight: {
|
|
37
|
-
control: "boolean",
|
|
38
|
-
description: "Met automatiquement en surbrillance la première option",
|
|
39
|
-
table: { defaultValue: { summary: "false" } }
|
|
40
|
-
},
|
|
41
|
-
disableClearable: {
|
|
42
|
-
control: "boolean",
|
|
43
|
-
description: "Désactive la possibilité de vider le champ",
|
|
44
|
-
table: { defaultValue: { summary: "false" } }
|
|
45
|
-
},
|
|
46
|
-
disabled: {
|
|
47
|
-
control: "boolean",
|
|
48
|
-
description: "Désactive le composant",
|
|
49
|
-
table: { defaultValue: { summary: "false" } }
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}, u = {
|
|
53
|
-
args: {
|
|
54
|
-
autoHighlight: !1,
|
|
55
|
-
disableClearable: !1,
|
|
56
|
-
disabled: !1
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export {
|
|
60
|
-
u as Default,
|
|
61
|
-
p as default
|
|
62
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),i=require("../../createSvgIcon-CcWpa9Le.cjs"),n=require("@mui/material"),t=require("../../Badge-DXl0Da36.cjs"),a=i.createSvgIcon(e.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Mail"),s={title:"Components/Badge",component:t.Badge,parameters:{docs:{description:{component:"Badge permet d'afficher des notifications peu invasives sur un élément parent."}}},argTypes:{color:{control:{type:"select"},options:["primary","secondary","error","info","success","warning"],description:"Couleur du badge"},variant:{control:{type:"select"},options:["standard","dot"],description:"Type de badge : standard ou dot"},showZero:{control:"boolean",description:"Affiche le badge même si badgeContent = 0"},invisible:{control:"boolean",description:"Masque complètement le badge"},max:{control:{type:"number",min:1},description:"Valeur maximale avant d'afficher max+"},overlap:{control:{type:"select"},options:["rectangular","circular"],description:"Forme de l'élément parent"},anchorOrigin:{control:{type:"object"},defaultValue:{vertical:"top",horizontal:"right"},description:"Position du badge par rapport à l'élément parent"},badgeContent:{control:{type:"number",min:0},description:"Contenu numérique du badge (indiqué si variant=standard)"}}},c={render:r=>e.jsx(n.Box,{sx:{display:"flex",gap:2,alignItems:"center"},children:["primary","secondary","error","info","success","warning"].map(o=>e.jsx(t.Badge,{...r,color:o,children:e.jsx(a,{})},o))}),args:{badgeContent:5,variant:"standard",showZero:!1,invisible:!1,max:99,overlap:"rectangular",anchorOrigin:{vertical:"top",horizontal:"right"}},parameters:{docs:{description:{story:"Montre toutes les couleurs prédéfinies de MUI Badge."}}}},l={args:{badgeContent:0,showZero:!0,color:"primary",variant:"standard",invisible:!1,max:99,overlap:"rectangular",anchorOrigin:{vertical:"top",horizontal:"right"},children:e.jsx(a,{})},parameters:{docs:{description:{story:"Utilise `showZero` pour afficher le badge même lorsque `badgeContent` est à 0."}}}},d={args:{variant:"dot",color:"error",invisible:!1,overlap:"circular",anchorOrigin:{vertical:"top",horizontal:"right"},children:e.jsx(a,{})},parameters:{docs:{description:{story:"Affiche un petit point rouge (`variant='dot'`) sur une icône."}}}},p={render:r=>e.jsxs(n.Box,{sx:{display:"flex",gap:4,alignItems:"center"},children:[e.jsx(t.Badge,{...r,variant:"dot",color:"error"}),e.jsx(t.Badge,{...r,variant:"standard",badgeContent:7,color:"primary"})]}),parameters:{docs:{description:{story:"Affiche `variant='dot'` et `variant='standard'` sans icônes."}}}},g={render:r=>e.jsx(n.Box,{sx:{display:"flex",gap:4,alignItems:"center"},children:[{vertical:"top",horizontal:"left"},{vertical:"top",horizontal:"right"},{vertical:"bottom",horizontal:"left"},{vertical:"bottom",horizontal:"right"}].map(o=>e.jsx(t.Badge,{...r,anchorOrigin:o,children:e.jsx(a,{})},`${o.vertical}-${o.horizontal}`))}),args:{badgeContent:10,color:"secondary",variant:"standard",invisible:!1,overlap:"rectangular",anchorOrigin:{vertical:"top",horizontal:"right"}},parameters:{docs:{description:{story:"Positionne le badge sur les quatre coins possibles."}}}},u={args:{badgeContent:120,max:99,color:"info",variant:"standard",showZero:!1,invisible:!1,overlap:"rectangular",anchorOrigin:{vertical:"top",horizontal:"right"},children:e.jsx(a,{})},parameters:{docs:{description:{story:"Limite l'affichage numérique avec la prop `max` (ex: 99+)."}}}};exports.Colors=c;exports.Dot=d;exports.MaxValue=u;exports.NoIcon=p;exports.Origin=g;exports.ShowZero=l;exports.default=s;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as Badge } from '@mui/material/Badge';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
-
declare const meta: Meta<typeof Badge>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Badge>;
|
|
6
|
-
/** 1. Plusieurs couleurs disponibles */
|
|
7
|
-
export declare const Colors: Story;
|
|
8
|
-
/** 2. Afficher un badge même à 0 */
|
|
9
|
-
export declare const ShowZero: Story;
|
|
10
|
-
/** 3. Variante “dot” avec une icône */
|
|
11
|
-
export declare const Dot: Story;
|
|
12
|
-
/** 4. Variante dot et standard sans icône */
|
|
13
|
-
export declare const NoIcon: Story;
|
|
14
|
-
/** 5. Démonstration de `anchorOrigin` */
|
|
15
|
-
export declare const Origin: Story;
|
|
16
|
-
/** 6. Démonstration de `max` */
|
|
17
|
-
export declare const MaxValue: Story;
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { c as s } from "../../createSvgIcon-DFIM5PqN.js";
|
|
3
|
-
import { Box as n } from "@mui/material";
|
|
4
|
-
import { B as t } from "../../Badge-2Kgbx-Cs.js";
|
|
5
|
-
const a = s(/* @__PURE__ */ r("path", {
|
|
6
|
-
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"
|
|
7
|
-
}), "Mail"), m = {
|
|
8
|
-
title: "Components/Badge",
|
|
9
|
-
component: t,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component: "Badge permet d'afficher des notifications peu invasives sur un élément parent."
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
color: {
|
|
19
|
-
control: { type: "select" },
|
|
20
|
-
options: ["primary", "secondary", "error", "info", "success", "warning"],
|
|
21
|
-
description: "Couleur du badge"
|
|
22
|
-
},
|
|
23
|
-
variant: {
|
|
24
|
-
control: { type: "select" },
|
|
25
|
-
options: ["standard", "dot"],
|
|
26
|
-
description: "Type de badge : standard ou dot"
|
|
27
|
-
},
|
|
28
|
-
showZero: {
|
|
29
|
-
control: "boolean",
|
|
30
|
-
description: "Affiche le badge même si badgeContent = 0"
|
|
31
|
-
},
|
|
32
|
-
invisible: {
|
|
33
|
-
control: "boolean",
|
|
34
|
-
description: "Masque complètement le badge"
|
|
35
|
-
},
|
|
36
|
-
max: {
|
|
37
|
-
control: { type: "number", min: 1 },
|
|
38
|
-
description: "Valeur maximale avant d'afficher max+"
|
|
39
|
-
},
|
|
40
|
-
overlap: {
|
|
41
|
-
control: { type: "select" },
|
|
42
|
-
options: ["rectangular", "circular"],
|
|
43
|
-
description: "Forme de l'élément parent"
|
|
44
|
-
},
|
|
45
|
-
anchorOrigin: {
|
|
46
|
-
control: { type: "object" },
|
|
47
|
-
defaultValue: { vertical: "top", horizontal: "right" },
|
|
48
|
-
description: "Position du badge par rapport à l'élément parent"
|
|
49
|
-
},
|
|
50
|
-
badgeContent: {
|
|
51
|
-
control: { type: "number", min: 0 },
|
|
52
|
-
description: "Contenu numérique du badge (indiqué si variant=standard)"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, g = {
|
|
56
|
-
render: (e) => /* @__PURE__ */ r(n, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: ["primary", "secondary", "error", "info", "success", "warning"].map(
|
|
57
|
-
(o) => /* @__PURE__ */ r(t, { ...e, color: o, children: /* @__PURE__ */ r(a, {}) }, o)
|
|
58
|
-
) }),
|
|
59
|
-
args: {
|
|
60
|
-
badgeContent: 5,
|
|
61
|
-
variant: "standard",
|
|
62
|
-
showZero: !1,
|
|
63
|
-
invisible: !1,
|
|
64
|
-
max: 99,
|
|
65
|
-
overlap: "rectangular",
|
|
66
|
-
anchorOrigin: { vertical: "top", horizontal: "right" }
|
|
67
|
-
},
|
|
68
|
-
parameters: {
|
|
69
|
-
docs: {
|
|
70
|
-
description: {
|
|
71
|
-
story: "Montre toutes les couleurs prédéfinies de MUI Badge."
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}, h = {
|
|
76
|
-
args: {
|
|
77
|
-
badgeContent: 0,
|
|
78
|
-
showZero: !0,
|
|
79
|
-
color: "primary",
|
|
80
|
-
variant: "standard",
|
|
81
|
-
invisible: !1,
|
|
82
|
-
max: 99,
|
|
83
|
-
overlap: "rectangular",
|
|
84
|
-
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
85
|
-
children: /* @__PURE__ */ r(a, {})
|
|
86
|
-
},
|
|
87
|
-
parameters: {
|
|
88
|
-
docs: {
|
|
89
|
-
description: {
|
|
90
|
-
story: "Utilise `showZero` pour afficher le badge même lorsque `badgeContent` est à 0."
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, u = {
|
|
95
|
-
args: {
|
|
96
|
-
variant: "dot",
|
|
97
|
-
color: "error",
|
|
98
|
-
invisible: !1,
|
|
99
|
-
overlap: "circular",
|
|
100
|
-
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
101
|
-
children: /* @__PURE__ */ r(a, {})
|
|
102
|
-
},
|
|
103
|
-
parameters: {
|
|
104
|
-
docs: {
|
|
105
|
-
description: {
|
|
106
|
-
story: "Affiche un petit point rouge (`variant='dot'`) sur une icône."
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}, v = {
|
|
111
|
-
render: (e) => /* @__PURE__ */ i(n, { sx: { display: "flex", gap: 4, alignItems: "center" }, children: [
|
|
112
|
-
/* @__PURE__ */ r(t, { ...e, variant: "dot", color: "error" }),
|
|
113
|
-
/* @__PURE__ */ r(
|
|
114
|
-
t,
|
|
115
|
-
{
|
|
116
|
-
...e,
|
|
117
|
-
variant: "standard",
|
|
118
|
-
badgeContent: 7,
|
|
119
|
-
color: "primary"
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
|
-
] }),
|
|
123
|
-
parameters: {
|
|
124
|
-
docs: {
|
|
125
|
-
description: {
|
|
126
|
-
story: "Affiche `variant='dot'` et `variant='standard'` sans icônes."
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}, f = {
|
|
131
|
-
render: (e) => /* @__PURE__ */ r(n, { sx: { display: "flex", gap: 4, alignItems: "center" }, children: [
|
|
132
|
-
{ vertical: "top", horizontal: "left" },
|
|
133
|
-
{ vertical: "top", horizontal: "right" },
|
|
134
|
-
{ vertical: "bottom", horizontal: "left" },
|
|
135
|
-
{ vertical: "bottom", horizontal: "right" }
|
|
136
|
-
].map((o) => /* @__PURE__ */ r(
|
|
137
|
-
t,
|
|
138
|
-
{
|
|
139
|
-
...e,
|
|
140
|
-
anchorOrigin: o,
|
|
141
|
-
children: /* @__PURE__ */ r(a, {})
|
|
142
|
-
},
|
|
143
|
-
`${o.vertical}-${o.horizontal}`
|
|
144
|
-
)) }),
|
|
145
|
-
args: {
|
|
146
|
-
badgeContent: 10,
|
|
147
|
-
color: "secondary",
|
|
148
|
-
variant: "standard",
|
|
149
|
-
invisible: !1,
|
|
150
|
-
overlap: "rectangular",
|
|
151
|
-
anchorOrigin: { vertical: "top", horizontal: "right" }
|
|
152
|
-
},
|
|
153
|
-
parameters: {
|
|
154
|
-
docs: {
|
|
155
|
-
description: {
|
|
156
|
-
story: "Positionne le badge sur les quatre coins possibles."
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}, b = {
|
|
161
|
-
args: {
|
|
162
|
-
badgeContent: 120,
|
|
163
|
-
max: 99,
|
|
164
|
-
color: "info",
|
|
165
|
-
variant: "standard",
|
|
166
|
-
showZero: !1,
|
|
167
|
-
invisible: !1,
|
|
168
|
-
overlap: "rectangular",
|
|
169
|
-
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
170
|
-
children: /* @__PURE__ */ r(a, {})
|
|
171
|
-
},
|
|
172
|
-
parameters: {
|
|
173
|
-
docs: {
|
|
174
|
-
description: {
|
|
175
|
-
story: "Limite l'affichage numérique avec la prop `max` (ex: 99+)."
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
export {
|
|
181
|
-
g as Colors,
|
|
182
|
-
u as Dot,
|
|
183
|
-
b as MaxValue,
|
|
184
|
-
v as NoIcon,
|
|
185
|
-
f as Origin,
|
|
186
|
-
h as ShowZero,
|
|
187
|
-
m as default
|
|
188
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("../../createSvgIcon-CcWpa9Le.cjs"),n=require("../Button/Button.cjs.js"),o=t.createSvgIcon(e.jsx("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonAdd"),r=t.createSvgIcon(e.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),c={title:"Components/Button",component:n,argTypes:{color:{control:"select",options:["inherit","default","primary","secondary","error","info","success","warning"]},disabled:{control:"boolean"}}},s={args:{children:"Enregistrer",color:"primary",disabled:!1,startIcon:e.jsx(r,{}),variant:"contained",onClick:()=>alert("Alert")}},a={args:{children:"Ajouter un utilisateur",color:"secondary",disabled:!1,startIcon:e.jsx(o,{}),variant:"outlined",onClick:()=>alert("Alert")}},l={args:{children:"Annuler",color:"secondary",disabled:!1,variant:"text",onClick:()=>alert("Alert")}};exports.Contained=s;exports.Outlined=a;exports.Text=l;exports.default=c;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Button } from '../Button';
|
|
3
|
-
declare const meta: Meta<typeof Button>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Button>;
|
|
6
|
-
export declare const Contained: Story;
|
|
7
|
-
export declare const Outlined: Story;
|
|
8
|
-
export declare const Text: Story;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as t } from "../../createSvgIcon-DFIM5PqN.js";
|
|
3
|
-
import r from "../Button/Button.es.js";
|
|
4
|
-
const e = t(/* @__PURE__ */ o("path", {
|
|
5
|
-
d: "M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V7H4v3H1v2h3v3h2v-3h3v-2zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"
|
|
6
|
-
}), "PersonAdd"), n = t(/* @__PURE__ */ o("path", {
|
|
7
|
-
d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"
|
|
8
|
-
}), "Save"), l = {
|
|
9
|
-
title: "Components/Button",
|
|
10
|
-
component: r,
|
|
11
|
-
argTypes: {
|
|
12
|
-
color: {
|
|
13
|
-
control: "select",
|
|
14
|
-
options: [
|
|
15
|
-
"inherit",
|
|
16
|
-
"default",
|
|
17
|
-
"primary",
|
|
18
|
-
"secondary",
|
|
19
|
-
"error",
|
|
20
|
-
"info",
|
|
21
|
-
"success",
|
|
22
|
-
"warning"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
control: "boolean"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, i = {
|
|
30
|
-
args: {
|
|
31
|
-
children: "Enregistrer",
|
|
32
|
-
color: "primary",
|
|
33
|
-
disabled: !1,
|
|
34
|
-
startIcon: /* @__PURE__ */ o(n, {}),
|
|
35
|
-
variant: "contained",
|
|
36
|
-
onClick: () => alert("Alert")
|
|
37
|
-
}
|
|
38
|
-
}, d = {
|
|
39
|
-
args: {
|
|
40
|
-
children: "Ajouter un utilisateur",
|
|
41
|
-
color: "secondary",
|
|
42
|
-
disabled: !1,
|
|
43
|
-
startIcon: /* @__PURE__ */ o(e, {}),
|
|
44
|
-
variant: "outlined",
|
|
45
|
-
onClick: () => alert("Alert")
|
|
46
|
-
}
|
|
47
|
-
}, m = {
|
|
48
|
-
args: {
|
|
49
|
-
children: "Annuler",
|
|
50
|
-
color: "secondary",
|
|
51
|
-
disabled: !1,
|
|
52
|
-
variant: "text",
|
|
53
|
-
onClick: () => alert("Alert")
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
i as Contained,
|
|
58
|
-
d as Outlined,
|
|
59
|
-
m as Text,
|
|
60
|
-
l as default
|
|
61
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),B=require("../../createSvgIcon-CcWpa9Le.cjs"),l=require("react"),p=require("../ButtonGroup/ButtonGroup.cjs.js"),u=require("../../Box-CYQlQqRB.cjs"),t=require("../../Typography-DHjq4GzQ.cjs"),a=require("../../Grid-CPXE25PR.cjs"),v=require("../../Button-BP-QmmUu.cjs"),o=require("../../Paper-DcVuAxq3.cjs"),C=B.createSvgIcon(e.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M8 11H4V6h4zm6 0h-4V6h4zm6 0h-4V6h4zM8 18H4v-5h4zm6 0h-4v-5h4zm6 0h-4v-5h4z"}),"CalendarViewMonth"),V=B.createSvgIcon(e.jsx("path",{fillRule:"evenodd",d:"M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"}),"GridView"),g=B.createSvgIcon(e.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),j=B.createSvgIcon(e.jsx("path",{d:"M21 8H3V4h18zm0 2H3v4h18zm0 6H3v4h18z"}),"TableRows"),w=B.createSvgIcon(e.jsx("path",{d:"M2 4v7h20V4zm8 16h12v-7H10zm-8 0h6v-7H2z"}),"ViewComfy"),f=B.createSvgIcon(e.jsx("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),I={title:"Components/ButtonGroup",component:p,argTypes:{buttonList:{description:"**[Requis]** Liste des boutons à afficher dans le ButtonGroup.",control:"object",table:{required:!0,type:{summary:"readonly ButtonItem[]"}}},viewMode:{description:"**[Requis]** Valeur actuellement sélectionnée.",control:"text",table:{required:!0,type:{summary:"T[number]['value']"}}},onChange:{description:"**[Requis]** Fonction appelée lorsqu'un bouton est sélectionné.",table:{required:!0,type:{summary:"(value: T[number]['value']) => void"}}},colorVariant:{description:"**[Optionnel]** Variante de couleur des boutons.",control:"select",options:["primary","secondary"],defaultValue:"primary",table:{required:!1,type:{summary:"ColorVariant"},defaultValue:{summary:"primary"}}},size:{description:"**[Optionnel]** Taille des boutons.",control:"select",options:["small","medium","large"],defaultValue:"small",table:{required:!1,type:{summary:"string"},defaultValue:{summary:"small"}}},orientation:{description:"**[Optionnel]** Orientation du groupe de boutons.",control:"select",options:["horizontal","vertical"],defaultValue:"horizontal",table:{required:!1,type:{summary:"string"},defaultValue:{summary:"horizontal"}}}},parameters:{docs:{description:{component:`
|
|
2
|
-
## ButtonGroup
|
|
3
|
-
|
|
4
|
-
Un composant générique TypeScript pour permettre à l'utilisateur de basculer entre différents modes d'affichage ou options avec une sécurité de type complète.
|
|
5
|
-
|
|
6
|
-
### 🔥 Typage générique et sécurité des types
|
|
7
|
-
|
|
8
|
-
Le ButtonGroup utilise TypeScript générique avancé pour inférer automatiquement les types des valeurs possibles à partir de la liste des boutons fournie. **Il n'est plus nécessaire de définir un enum**, les types sont déduits automatiquement grâce à la magie de TypeScript !
|
|
9
|
-
|
|
10
|
-
**Point clé** : Utilisez toujours \`as const\` après votre tableau de boutons pour permettre l'inférence de type littéral.
|
|
11
|
-
|
|
12
|
-
### 🎯 Utilisation recommandée pour éviter les types 'any'
|
|
13
|
-
|
|
14
|
-
\`\`\`typescript
|
|
15
|
-
// ✅ CORRECT : Définition avec 'as const' pour l'inférence de type
|
|
16
|
-
const viewButtons = [
|
|
17
|
-
{ value: "cards", icon: <ViewModuleIcon /> },
|
|
18
|
-
{ value: "table", icon: <TableRowsIcon /> },
|
|
19
|
-
{ value: "list", icon: <ListIcon /> }
|
|
20
|
-
] as const; // ← IMPORTANT : ne pas oublier 'as const'
|
|
21
|
-
|
|
22
|
-
// ✅ CORRECT : Typage explicite pour le state et le handler
|
|
23
|
-
type ViewType = (typeof viewButtons)[number]["value"]; // "cards" | "table" | "list"
|
|
24
|
-
|
|
25
|
-
const [currentView, setCurrentView] = useState<ViewType>("cards");
|
|
26
|
-
|
|
27
|
-
const handleViewChange = useCallback((value: ViewType) => {
|
|
28
|
-
console.log(\`Vue sélectionnée: \${value}\`); // ← value est typé correctement
|
|
29
|
-
setCurrentView(value);
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
<ButtonGroup
|
|
33
|
-
buttonList={viewButtons}
|
|
34
|
-
viewMode={currentView}
|
|
35
|
-
onChange={handleViewChange} // ← Pas d'erreur 'any' !
|
|
36
|
-
/>
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
### ❌ À éviter : patterns qui causent des types 'any'
|
|
40
|
-
|
|
41
|
-
\`\`\`typescript
|
|
42
|
-
// ❌ INCORRECT : Sans 'as const'
|
|
43
|
-
const viewButtons = [
|
|
44
|
-
{ value: "cards", icon: <ViewModuleIcon /> },
|
|
45
|
-
{ value: "table", icon: <TableRowsIcon /> }
|
|
46
|
-
]; // ← types inférés comme 'string' au lieu de littéraux
|
|
47
|
-
|
|
48
|
-
// ❌ INCORRECT : Handler sans typage explicite
|
|
49
|
-
const handleViewChange = (value) => { // ← 'value' aura le type 'any'
|
|
50
|
-
setCurrentView(value);
|
|
51
|
-
};
|
|
52
|
-
\`\`\`
|
|
53
|
-
|
|
54
|
-
### 🛠️ Personnalisation
|
|
55
|
-
|
|
56
|
-
- \`colorVariant\`: Choix entre les palettes "primary" et "secondary"
|
|
57
|
-
- \`size\`: Contrôle la taille des boutons ("small", "medium", "large")
|
|
58
|
-
- \`orientation\`: Affichage horizontal ou vertical du groupe de boutons
|
|
59
|
-
- \`disabled\`: Possibilité de désactiver individuellement certains boutons
|
|
60
|
-
|
|
61
|
-
### 📋 Structure des données
|
|
62
|
-
|
|
63
|
-
Le composant attend un tableau d'objets \`ButtonItem\` typé de manière générique :
|
|
64
|
-
|
|
65
|
-
\`\`\`typescript
|
|
66
|
-
interface ButtonItem<T extends string = string> {
|
|
67
|
-
value: T; // Valeur unique pour ce bouton (obligatoire)
|
|
68
|
-
icon: ReactNode; // Icône à afficher (obligatoire)
|
|
69
|
-
disabled?: boolean; // Désactiver ce bouton spécifique (facultatif)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Le composant infère automatiquement T à partir de votre tableau
|
|
73
|
-
type SwitchViewProps<T extends readonly ButtonItem<string>[]> = {
|
|
74
|
-
buttonList: T;
|
|
75
|
-
viewMode: T[number]["value"]; // Type inféré automatiquement
|
|
76
|
-
onChange: (value: T[number]["value"]) => void; // Type inféré automatiquement
|
|
77
|
-
// ... autres props
|
|
78
|
-
}
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
### 🎉 Avantages du typage générique
|
|
82
|
-
|
|
83
|
-
1. **Auto-complétion** : IDE suggère automatiquement les valeurs possibles
|
|
84
|
-
2. **Vérification à la compilation** : Erreurs détectées avant l'exécution
|
|
85
|
-
3. **Refactoring sûr** : Renommer une valeur met à jour toutes les références
|
|
86
|
-
4. **Documentation vivante** : Les types servent de documentation
|
|
87
|
-
|
|
88
|
-
### 💡 Conseils pour une utilisation optimale
|
|
89
|
-
|
|
90
|
-
1. **Utilisez des types helper** pour éviter la répétition :
|
|
91
|
-
\`\`\`typescript
|
|
92
|
-
type ViewConfig = typeof viewButtons;
|
|
93
|
-
type ViewType = ViewConfig[number]["value"];
|
|
94
|
-
\`\`\`
|
|
95
|
-
|
|
96
|
-
2. **Créez des constantes réutilisables** :
|
|
97
|
-
\`\`\`typescript
|
|
98
|
-
export const VIEW_MODES = {
|
|
99
|
-
CARDS: "cards",
|
|
100
|
-
TABLE: "table",
|
|
101
|
-
LIST: "list"
|
|
102
|
-
} as const;
|
|
103
|
-
|
|
104
|
-
const viewButtons = [
|
|
105
|
-
{ value: VIEW_MODES.CARDS, icon: <ViewModuleIcon /> },
|
|
106
|
-
// ...
|
|
107
|
-
] as const;
|
|
108
|
-
\`\`\`
|
|
109
|
-
|
|
110
|
-
3. **Utilisez des factory functions** pour des configurations complexes :
|
|
111
|
-
\`\`\`typescript
|
|
112
|
-
const createViewButton = <T extends string>(value: T, icon: ReactNode) =>
|
|
113
|
-
({ value, icon } as const);
|
|
114
|
-
\`\`\`
|
|
115
|
-
`}}}},b=[{value:"cards",icon:e.jsx(f,{})},{value:"table",icon:e.jsx(j,{})},{value:"list",icon:e.jsx(g,{})}],z=[{value:"grid",icon:e.jsx(V,{})},{value:"cards",icon:e.jsx(w,{})},{value:"table",icon:e.jsx(j,{})},{value:"list",icon:e.jsx(g,{})},{value:"calendar",icon:e.jsx(C,{})}],q=[{value:"cards",icon:e.jsx(f,{})},{value:"table",icon:e.jsx(j,{}),disabled:!0},{value:"list",icon:e.jsx(g,{})}],G={render:()=>{const[n,r]=l.useState("cards"),c=l.useCallback(s=>{console.log(`Vue sélectionnée: ${s}`),r(s)},[]);return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Sélecteur de vue standard"}),e.jsx(p,{buttonList:b,viewMode:n,onChange:c}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Vue actuelle: ",e.jsx("strong",{children:n})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Sélecteur de vue basique permettant de basculer entre trois modes d'affichage : cartes, tableau et liste."}}}},P={render:()=>{const[n,r]=l.useState("table"),[c,s]=l.useState("primary"),[x,i]=l.useState("small"),[h,m]=l.useState("horizontal");return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Personnalisation en temps réel"}),e.jsxs(a.Grid,{container:!0,spacing:2,sx:{mb:3},children:[e.jsxs(a.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Couleur"}),e.jsxs(u.Box,{sx:{display:"flex",gap:1},children:[e.jsx(v.Button,{size:"small",variant:c==="primary"?"contained":"outlined",onClick:()=>s("primary"),children:"Primary"}),e.jsx(v.Button,{size:"small",variant:c==="secondary"?"contained":"outlined",onClick:()=>s("secondary"),children:"Secondary"})]})]}),e.jsxs(a.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Taille"}),e.jsx(u.Box,{sx:{display:"flex",gap:1},children:["small","medium","large"].map(y=>e.jsx(v.Button,{size:"small",variant:x===y?"contained":"outlined",onClick:()=>i(y),children:y},y))})]}),e.jsxs(a.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Orientation"}),e.jsxs(u.Box,{sx:{display:"flex",gap:1},children:[e.jsx(v.Button,{size:"small",variant:h==="horizontal"?"contained":"outlined",onClick:()=>m("horizontal"),children:"Horizontal"}),e.jsx(v.Button,{size:"small",variant:h==="vertical"?"contained":"outlined",onClick:()=>m("vertical"),children:"Vertical"})]})]}),e.jsxs(a.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Vue actuelle"}),e.jsx(t.Typography,{variant:"body2",color:"primary",children:e.jsx("strong",{children:n})})]})]}),e.jsx(o.Paper,{sx:{p:3,display:"inline-block"},children:e.jsx(p,{buttonList:b,viewMode:n,onChange:y=>{console.log(`Vue sélectionnée: ${y}`),r(y)},colorVariant:c,size:x,orientation:h})})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Interface de démonstration permettant de tester toutes les options de personnalisation disponibles : couleur, taille et orientation des boutons."}}}},L={render:()=>{const n=[{value:"on",icon:e.jsx(f,{})},{value:"off",icon:e.jsx(j,{})}],r=[{value:"active",icon:e.jsx(w,{})},{value:"inactive",icon:e.jsx(g,{})},{value:"pending",icon:e.jsx(V,{})}],c=[{value:"edit",icon:e.jsx(f,{})},{value:"view",icon:e.jsx(j,{})},{value:"preview",icon:e.jsx(g,{})}],[s,x]=l.useState("on"),[i,h]=l.useState("active"),[m,y]=l.useState("edit");return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Différents contextes d'utilisation"}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",paragraph:!0,children:"Le même composant s'adapte automatiquement à différents types de données."}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Mode binaire"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Activation/Désactivation simple"}),e.jsx(p,{buttonList:n,viewMode:s,onChange:d=>{console.log("Simple:",d),x(d)}}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["État: ",s]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Statut système"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Gestion d'états métier"}),e.jsx(p,{buttonList:r,viewMode:i,onChange:d=>{console.log("Status:",d),h(d)},colorVariant:"secondary"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Statut: ",i]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Mode d'édition"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Interface utilisateur adaptative"}),e.jsx(p,{buttonList:c,viewMode:m,onChange:d=>{console.log("Mode:",d),y(d)},size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Mode: ",m]})]})})]}),e.jsxs(o.Paper,{sx:{p:2,mt:3,backgroundColor:"info.light",color:"info.contrastText"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"🎯 Flexibilité du composant"}),e.jsx(t.Typography,{variant:"body2",children:"Un seul composant peut gérer n'importe quel ensemble d'options, s'adaptant automatiquement au contexte d'utilisation."})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration de la polyvalence du composant avec différents ensembles d'options : mode binaire, statuts système et modes d'édition."}}}},k={render:()=>{const n=["primary","secondary"],[r,c]=l.useState({primary:"cards",secondary:"table"});return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Comparaison des variantes de couleurs"}),e.jsx(a.Grid,{container:!0,spacing:3,children:n.map(s=>e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsxs(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:["Variante ",s]}),e.jsx(p,{buttonList:b,viewMode:r[s],onChange:x=>{c(i=>({...i,[s]:x}))},colorVariant:s}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélectionné: ",r[s]]})]})},s))})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration des deux variantes de couleurs disponibles : primary et secondary."}}}},D={render:()=>{const n=["small","medium","large"],[r,c]=l.useState({small:"cards",medium:"table",large:"list"});return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Comparaison des tailles"}),e.jsx(a.Grid,{container:!0,spacing:3,children:n.map(s=>e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsxs(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:["Taille ",s]}),e.jsx(p,{buttonList:b,viewMode:r[s],onChange:x=>{c(i=>({...i,[s]:x}))},size:s}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélectionné: ",r[s]]})]})},s))})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration des trois tailles disponibles : small, medium et large."}}}},R={render:()=>{const[n,r]=l.useState("grid"),c=l.useCallback(s=>{r(s)},[]);return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Orientation verticale"}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Orientation verticale - Taille medium"}),e.jsx(p,{buttonList:z,viewMode:n,onChange:c,orientation:"vertical",size:"medium"})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Orientation horizontale (comparaison)"}),e.jsx(p,{buttonList:z,viewMode:n,onChange:c,orientation:"horizontal",size:"medium"})]})})]}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Vue actuelle: ",e.jsx("strong",{children:n})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration de l'orientation verticale comparée à l'orientation horizontale avec plus d'options."}}}},O={render:()=>{const n=[{value:"grid",icon:e.jsx(V,{}),text:"Grille"},{value:"table",icon:e.jsx(j,{}),text:"Tableau"},{value:"list",icon:e.jsx(g,{}),text:"Liste"}],r=[{value:"cards",icon:e.jsx(f,{})},{value:"comfort",icon:e.jsx(w,{})},{value:"calendar",icon:e.jsx(C,{})}],c=[{value:"overview",icon:e.jsx(V,{}),text:"Vue d'ensemble"},{value:"details",icon:e.jsx(w,{})},{value:"settings",icon:e.jsx(C,{}),text:"Paramètres"}],[s,x]=l.useState("grid"),[i,h]=l.useState("cards"),[m,y]=l.useState("overview");return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Texte optionnel dans les boutons"}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Avec texte"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Tous les boutons ont un texte explicatif"}),e.jsx(p,{buttonList:n,viewMode:s,onChange:d=>x(d),size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélection: ",s]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Icônes seulement"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Format classique avec icônes uniquement"}),e.jsx(p,{buttonList:r,viewMode:i,onChange:d=>h(d),colorVariant:"secondary",size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélection: ",i]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Format mixte"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Certains boutons avec texte, d'autres sans"}),e.jsx(p,{buttonList:c,viewMode:m,onChange:d=>y(d),size:"medium",orientation:"vertical"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélection: ",m]})]})})]}),e.jsxs(o.Paper,{sx:{p:3,mt:3,backgroundColor:"info.light"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"💡 Utilisation du texte optionnel"}),e.jsxs(t.Typography,{variant:"body2",component:"div",children:["• Le texte s'affiche automatiquement si la propriété"," ",e.jsx("code",{children:"text"})," est définie",e.jsx("br",{}),"• Compatible avec l'ancien format (icônes seules)",e.jsx("br",{}),"• Possibilité de mélanger boutons avec et sans texte",e.jsx("br",{}),"• L'espacement est automatiquement ajusté entre l'icône et le texte"]})]}),e.jsxs(o.Paper,{sx:{p:2,mt:2,backgroundColor:"grey.100"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Exemple de code"}),e.jsx("pre",{style:{margin:0,fontSize:"0.875rem",overflow:"auto"},children:`const buttons = [
|
|
116
|
-
{
|
|
117
|
-
value: "grid",
|
|
118
|
-
icon: <GridIcon />,
|
|
119
|
-
text: "Grille" // ← Texte optionnel
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
value: "list",
|
|
123
|
-
icon: <ListIcon /> // ← Pas de texte, seule l'icône
|
|
124
|
-
}
|
|
125
|
-
] as const;`})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration de l'utilisation du texte optionnel dans les boutons. Le texte s'affiche automatiquement si la propriété `text` est présente, permettant une grande flexibilité dans la présentation."}}}},A={render:()=>{const[n,r]=l.useState("cards"),c=l.useCallback(s=>{r(s)},[]);return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Gestion des boutons désactivés"}),e.jsxs(o.Paper,{sx:{p:3},children:[e.jsx(p,{buttonList:q,viewMode:n,onChange:c,size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Vue actuelle: ",e.jsx("strong",{children:n})]}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:'Le bouton "Table" est désactivé dans cet exemple'}),e.jsxs(u.Box,{sx:{mt:2},children:[e.jsx(v.Button,{variant:"outlined",size:"small",onClick:()=>r("list"),sx:{mr:1},children:"Sélectionner Liste"}),e.jsx(v.Button,{variant:"outlined",size:"small",onClick:()=>r("cards"),children:"Sélectionner Cartes"})]})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Exemple montrant comment désactiver individuellement certains boutons en utilisant la propriété `disabled` dans les éléments du tableau."}}}},E={render:()=>{const[n,r]=l.useState("grid"),c=l.useCallback(s=>{r(s)},[]);return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Plus d'options d'affichage"}),e.jsxs(o.Paper,{sx:{p:3},children:[e.jsx(p,{buttonList:z,viewMode:n,onChange:c,colorVariant:"secondary",size:"large"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Vue actuelle: ",e.jsx("strong",{children:n})]}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"Cet exemple montre un ButtonGroup avec 5 options différentes en variante secondary et taille large"})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Exemple avec davantage d'options pour montrer la flexibilité du composant avec plusieurs modes d'affichage."}}}},H={render:()=>{const[n,r]=l.useState("cards"),c=l.useCallback(i=>{console.log("Changement de vue:",i),r(i)},[]),s=l.useCallback(i=>{console.log("Changement externe:",i),r(i)},[]),x=()=>{switch(n){case"cards":return"Affichage en cartes - Idéal pour une vue d'ensemble visuelle";case"table":return"Affichage en tableau - Parfait pour comparer des données";case"list":return"Affichage en liste - Optimal pour parcourir rapidement";default:return"Mode d'affichage inconnu"}};return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Synchronisation avec d'autres composants"}),e.jsxs(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:["Vue actuelle: ",e.jsx("strong",{children:n})]}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",paragraph:!0,children:x()}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"ButtonGroup Principal"}),e.jsx(p,{buttonList:b,viewMode:n,onChange:c,size:"medium"})]})}),e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Contrôles externes"}),e.jsx(u.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:b.map(i=>e.jsxs(v.Button,{variant:n===i.value?"contained":"outlined",onClick:()=>s(i.value),size:"small",startIcon:i.icon,children:["Mode ",i.value]},i.value))})]})})]}),e.jsxs(o.Paper,{sx:{p:2,mt:2,backgroundColor:"grey.50"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Actions rapides"}),e.jsx(v.Button,{variant:"text",size:"small",onClick:()=>{const i=["cards","table","list"],h=i[Math.floor(Math.random()*i.length)];s(h)},sx:{mr:1},children:"Vue aléatoire"}),e.jsx(v.Button,{variant:"text",size:"small",onClick:()=>{const h=(b.findIndex(m=>m.value===n)+1)%b.length;s(b[h].value)},children:"Vue suivante"})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration de la synchronisation entre le ButtonGroup et d'autres composants. Cette story montre comment le ButtonGroup peut être intégré dans une interface complexe où la sélection peut provenir de différentes sources mais reste synchronisée."}}}},U={render:()=>{const n=[{value:"overview",icon:e.jsx(w,{})},{value:"detailed",icon:e.jsx(j,{})},{value:"analytics",icon:e.jsx(V,{})}],r=[{value:"grid",icon:e.jsx(V,{})},{value:"list",icon:e.jsx(g,{})},{value:"tree",icon:e.jsx(f,{})}],c=[{value:"chart",icon:e.jsx(C,{})},{value:"table",icon:e.jsx(j,{})},{value:"raw",icon:e.jsx(g,{}),disabled:!0}],[s,x]=l.useState("overview"),[i,h]=l.useState("grid"),[m,y]=l.useState("chart");return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Cas d'utilisation dans une interface complexe"}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2,height:"100%"},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Dashboard"}),e.jsx(p,{buttonList:n,viewMode:s,onChange:d=>x(d),colorVariant:"primary",size:"small",orientation:"vertical"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Mode: ",s]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2,height:"100%"},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Explorateur de fichiers"}),e.jsx(p,{buttonList:r,viewMode:i,onChange:d=>h(d),colorVariant:"secondary",size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Affichage: ",i]})]})}),e.jsx(a.Grid,{size:{xs:12,md:4},children:e.jsxs(o.Paper,{sx:{p:2,height:"100%"},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Visualisation de données"}),e.jsx(p,{buttonList:c,viewMode:m,onChange:d=>y(d),colorVariant:"primary",size:"large"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Format: ",m]}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",children:'(Le mode "raw" est temporairement désactivé)'})]})})]}),e.jsxs(o.Paper,{sx:{p:2,mt:3,backgroundColor:"info.light",color:"info.contrastText"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"📊 Résumé des sélections (tous typés !)"}),e.jsxs(t.Typography,{variant:"body2",children:["Dashboard: ",e.jsx("strong",{children:s})," | Fichiers:"," ",e.jsx("strong",{children:i})," | Données: ",e.jsx("strong",{children:m})]})]}),e.jsxs(o.Paper,{sx:{p:2,mt:2,backgroundColor:"warning.light",color:"warning.contrastText"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"🔍 Inspection des types"}),e.jsxs(t.Typography,{variant:"body2",component:"div",children:[e.jsx("code",{children:"DashboardType:"})," ",'"overview" | "detailed" | "analytics"',e.jsx("br",{}),e.jsx("code",{children:"FileType:"})," ",'"grid" | "list" | "tree"',e.jsx("br",{}),e.jsx("code",{children:"DataType:"})," ",'"chart" | "table" | "raw"']}),e.jsx(t.Typography,{variant:"caption",sx:{mt:1,display:"block"},children:"Chaque callback reçoit exactement le bon type, aucune configuration supplémentaire requise !"})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Exemple d'utilisation complexe montrant comment le ButtonGroup peut être utilisé dans différents contextes au sein d'une même interface, avec différentes configurations (tailles, couleurs, orientations) selon le besoin. Chaque instance a son propre type inféré automatiquement."}}}},F={render:()=>{const n={CARDS:"cards",TABLE:"table",LIST:"list"},r=(T,S,M=!1)=>({value:T,icon:S,disabled:M}),c=[r(n.CARDS,e.jsx(f,{})),r(n.TABLE,e.jsx(j,{})),r(n.LIST,e.jsx(g,{}))],s=[r("dashboard",e.jsx(V,{})),r("users",e.jsx(w,{})),r("settings",e.jsx(C,{})),r("logs",e.jsx(g,{}),!0)],[x,i]=l.useState(n.CARDS),[h,m]=l.useState("dashboard"),y=l.useCallback(T=>{console.log("Vue commune changée:",T),i(T)},[]),d=l.useCallback(T=>{console.log("Vue admin changée:",T),m(T)},[]);return e.jsxs(u.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"🚀 Bonnes pratiques pour le typage"}),e.jsxs(a.Grid,{container:!0,spacing:3,children:[e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Configuration standard"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Utilisation de constantes et factory functions"}),e.jsx(p,{buttonList:c,viewMode:x,onChange:y,size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélection: ",x]})]})}),e.jsx(a.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"Configuration avancée"}),e.jsx(t.Typography,{variant:"caption",color:"text.secondary",display:"block",sx:{mb:2},children:"Types spécialisés avec bouton désactivé"}),e.jsx(p,{buttonList:s,viewMode:h,onChange:d,colorVariant:"secondary",size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Admin: ",h]})]})})]}),e.jsxs(o.Paper,{sx:{p:3,mt:3,backgroundColor:"success.light"},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"📚 Code examples - Bonnes pratiques"}),e.jsxs(u.Box,{sx:{mb:2},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"1. ✅ Utilisation de constantes réutilisables"}),e.jsx(o.Paper,{sx:{p:2,backgroundColor:"grey.100"},children:e.jsx("pre",{style:{margin:0,fontSize:"0.875rem",overflow:"auto"},children:`const VIEW_MODES = {
|
|
126
|
-
CARDS: "cards",
|
|
127
|
-
TABLE: "table",
|
|
128
|
-
LIST: "list"
|
|
129
|
-
} as const;
|
|
130
|
-
|
|
131
|
-
const buttons = [
|
|
132
|
-
{ value: VIEW_MODES.CARDS, icon: <Icon /> }
|
|
133
|
-
] as const;`})})]}),e.jsxs(u.Box,{sx:{mb:2},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"2. ✅ Factory functions pour la réutilisabilité"}),e.jsx(o.Paper,{sx:{p:2,backgroundColor:"grey.100"},children:e.jsx("pre",{style:{margin:0,fontSize:"0.875rem",overflow:"auto"},children:`const createViewButton = <T extends string>(
|
|
134
|
-
value: T,
|
|
135
|
-
icon: ReactNode,
|
|
136
|
-
disabled = false
|
|
137
|
-
) => ({ value, icon, disabled } as const);
|
|
138
|
-
|
|
139
|
-
const buttons = [
|
|
140
|
-
createViewButton("cards", <CardsIcon />),
|
|
141
|
-
createViewButton("table", <TableIcon />, true)
|
|
142
|
-
] as const;`})})]}),e.jsxs(u.Box,{sx:{mb:2},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"3. ✅ Types helper pour éviter la répétition"}),e.jsx(o.Paper,{sx:{p:2,backgroundColor:"grey.100"},children:e.jsx("pre",{style:{margin:0,fontSize:"0.875rem",overflow:"auto"},children:`type ViewType = (typeof buttons)[number]["value"];
|
|
143
|
-
|
|
144
|
-
const [view, setView] = useState<ViewType>("cards");
|
|
145
|
-
|
|
146
|
-
const handleChange = useCallback((value: ViewType) => {
|
|
147
|
-
// value est automatiquement typé !
|
|
148
|
-
setView(value);
|
|
149
|
-
}, []);`})})]}),e.jsxs(u.Box,{children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"4. ✅ Handler avec typage explicite"}),e.jsx(o.Paper,{sx:{p:2,backgroundColor:"grey.100"},children:e.jsx("pre",{style:{margin:0,fontSize:"0.875rem",overflow:"auto"},children:`<ButtonGroup
|
|
150
|
-
buttonList={buttons}
|
|
151
|
-
viewMode={view}
|
|
152
|
-
onChange={handleChange} // ← Pas de type 'any' !
|
|
153
|
-
/>`})})]})]}),e.jsxs(o.Paper,{sx:{p:2,mt:2,backgroundColor:"error.light",color:"error.contrastText"},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"❌ À éviter"}),e.jsxs(t.Typography,{variant:"body2",component:"div",children:["• Oublier ",e.jsx("code",{children:"as const"})," après les tableaux",e.jsx("br",{}),"• Utiliser des handlers sans typage explicite",e.jsx("br",{}),"• Définir des valeurs en dur sans constantes",e.jsx("br",{}),"• Ignorer les warnings TypeScript"]})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Cette story présente les meilleures pratiques pour utiliser le ButtonGroup avec un typage TypeScript optimal. Elle montre comment structurer votre code pour éviter les types 'any' et maximiser la sécurité de type."}}}};exports.AvecBoutonsDesactives=A;exports.AvecTexteOptionnel=O;exports.BonnesPratiques=F;exports.CasUtilisationComplexe=U;exports.Controlable=P;exports.Default=G;exports.OptionsEtendues=E;exports.OrientationVerticale=R;exports.Synchronisation=H;exports.TaillesDifferentes=D;exports.TypageGenerique=L;exports.VariantesDecouleurs=k;exports.default=I;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { ButtonGroup } from '../ButtonGroup';
|
|
3
|
-
declare const meta: Meta<typeof ButtonGroup>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof ButtonGroup>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Controlable: Story;
|
|
8
|
-
export declare const TypageGenerique: Story;
|
|
9
|
-
export declare const VariantesDecouleurs: Story;
|
|
10
|
-
export declare const TaillesDifferentes: Story;
|
|
11
|
-
export declare const OrientationVerticale: Story;
|
|
12
|
-
export declare const AvecTexteOptionnel: Story;
|
|
13
|
-
export declare const AvecBoutonsDesactives: Story;
|
|
14
|
-
export declare const OptionsEtendues: Story;
|
|
15
|
-
export declare const Synchronisation: Story;
|
|
16
|
-
export declare const CasUtilisationComplexe: Story;
|
|
17
|
-
export declare const BonnesPratiques: Story;
|