@cgi-learning-hub/ui 1.6.0-dev.1747921171 → 1.6.0-dev.1749207390
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/{Alert-CBW5GoJI.js → Alert-DdmE0EMo.js} +11 -11
- package/dist/{Alert-DHG4SpUx.cjs → Alert-p6jIgCWU.cjs} +1 -1
- package/dist/{Autocomplete-E2lL4isp.cjs → Autocomplete-CpRv6_iv.cjs} +1 -1
- package/dist/{Autocomplete-BY5PBnFO.js → Autocomplete-XmIFWgiQ.js} +14 -14
- package/dist/{Backdrop-B8Ka5yhn.cjs → Backdrop-0xfsnuri.cjs} +1 -1
- package/dist/{Backdrop-DUGb_yNd.js → Backdrop-BSLhsv85.js} +4 -4
- package/dist/{Badge-DqMmgJeU.js → Badge-D9BY47ln.js} +5 -5
- package/dist/{Badge-CFFO4PIE.cjs → Badge-Dpxa8BPA.cjs} +1 -1
- package/dist/{Box-o7Tjjyko.js → Box-DjbKEblU.js} +3 -3
- package/dist/{Box-DYD6q-6M.cjs → Box-xgRKDOV1.cjs} +1 -1
- package/dist/{Button-D974vesA.js → Button-WTdCmXYm.js} +6 -6
- package/dist/{Button-y1LmxqGA.cjs → Button-qSgmSSw2.cjs} +1 -1
- package/dist/{ButtonBase-Chb99sDQ.js → ButtonBase-Cog6rzwh.js} +3 -3
- package/dist/{ButtonBase-Cteo-mSC.cjs → ButtonBase-CsJxPLAx.cjs} +1 -1
- package/dist/{CardContent-DfNASczU.cjs → CardContent-BTTU3lDd.cjs} +1 -1
- package/dist/{CardContent-BiCWtbyk.js → CardContent-rIQGzMEo.js} +3 -3
- package/dist/{Checkbox-TS65wodp.js → Checkbox-DUMc8-SB.js} +8 -8
- package/dist/{Checkbox-l0TyVwps.cjs → Checkbox-jecO0f9-.cjs} +1 -1
- package/dist/{Chip-Bpcd3tnL.cjs → Chip-CkonlDiW.cjs} +1 -1
- package/dist/{Chip-CPR3r42q.js → Chip-DUN-Fb_U.js} +6 -6
- package/dist/{CircularProgress-Wqx0-T36.cjs → CircularProgress-Bvcr-mus.cjs} +1 -1
- package/dist/{CircularProgress-DVKNRMKq.js → CircularProgress-DnqwyXnx.js} +4 -4
- package/dist/{Close-m-MX3rFn.js → Close-BD-KPNgj.js} +1 -1
- package/dist/{Close-DyRqry3p.cjs → Close-BFNngmx-.cjs} +1 -1
- package/dist/{CloseRounded-CjjQdrNy.js → CloseRounded-BvDxY6j7.js} +1 -1
- package/dist/{CloseRounded-Bpxbxvyb.cjs → CloseRounded-e-a3RxlE.cjs} +1 -1
- package/dist/{CustomTreeItem-DQSQGINJ.cjs → CustomTreeItem-Bo6LVL2g.cjs} +1 -1
- package/dist/{CustomTreeItem-DhYdedkD.js → CustomTreeItem-D-Fd2rf4.js} +11 -11
- package/dist/{DatePicker-CwDmetzW.js → DatePicker-CTAJnIvu.js} +29 -29
- package/dist/{DatePicker-BBFC1Zoi.cjs → DatePicker-DDYXqvgA.cjs} +1 -1
- package/dist/{DefaultPropsProvider-hFv1J_xl.js → DefaultPropsProvider-CRQ3Gr22.js} +21 -19
- package/dist/DefaultPropsProvider-CsTuCVNC.cjs +1 -0
- package/dist/{Delete-9fJbdRit.js → Delete-Cy45hwCy.js} +1 -1
- package/dist/{Delete-CEX2hq0f.cjs → Delete-fIZ9JoWy.cjs} +1 -1
- package/dist/{Dialog-CdrDjE9Y.cjs → Dialog-ByiFxqo3.cjs} +1 -1
- package/dist/{Dialog-i7-wUv6w.js → Dialog-sYVRMluM.js} +9 -9
- package/dist/{DialogContent-BbCu_OEw.cjs → DialogContent-0WzVi_CB.cjs} +1 -1
- package/dist/{DialogContent-B41jvlMn.js → DialogContent-Bnuj13Sv.js} +3 -3
- package/dist/{DialogTitle-DRNVW7R2.js → DialogTitle-BT0ckfTq.js} +5 -5
- package/dist/{DialogTitle-CjrNCn9F.cjs → DialogTitle-Dq5hCek2.cjs} +1 -1
- package/dist/{Divider-CJwnMdVg.js → Divider-Bsr4YOx4.js} +4 -4
- package/dist/{Divider-Cshcr5kR.cjs → Divider-DPIWZuaX.cjs} +1 -1
- package/dist/{Folder-7plrMkOp.cjs → Folder-BvPvb5St.cjs} +1 -1
- package/dist/{Folder-CutUz0bW.js → Folder-cn5kD2Zm.js} +1 -1
- package/dist/{FormLabel-0LbNeQQU.cjs → FormLabel-BPReGp6x.cjs} +1 -1
- package/dist/{FormLabel-DSi2pGSZ.js → FormLabel-C_NeUysJ.js} +4 -4
- package/dist/Grid-CpuW2Xrl.js +419 -0
- package/dist/Grid-D0L0VF_j.cjs +2 -0
- package/dist/{Grow-aEgTOewU.cjs → Grow-CxV2Td_c.cjs} +1 -1
- package/dist/{Grow-FFFqe81C.js → Grow-DrWDr0WD.js} +1 -1
- package/dist/{IconButton-BKwDNYJl.cjs → IconButton-BzvVYvTv.cjs} +1 -1
- package/dist/{IconButton-CgwURB2g.js → IconButton-ZOYYBKrY.js} +6 -6
- package/dist/{InputAdornment-C7e-kyf7.cjs → InputAdornment-CiGypDyN.cjs} +1 -1
- package/dist/{InputAdornment-DgWvMLgR.js → InputAdornment-mPJEEW62.js} +5 -5
- package/dist/{InputBase-pYQWRFK2.cjs → InputBase-D7cWCjsM.cjs} +1 -1
- package/dist/{InputBase-DxLqRpcl.js → InputBase-wf6Sq2-d.js} +6 -6
- package/dist/{Link-DUtuCYMx.cjs → Link-6MI2s97g.cjs} +1 -1
- package/dist/{Link-rb-SwfiY.js → Link-CPIGW37d.js} +6 -6
- package/dist/{List-BjfdkeEI.js → List-4Tnjo8WV.js} +2 -2
- package/dist/{List-BH_S4Hqm.cjs → List-DNAAO5Md.cjs} +1 -1
- package/dist/{ListItem-B0EiObKw.js → ListItem-CeosJHtu.js} +4 -4
- package/dist/{ListItem-D33t-hkx.cjs → ListItem-DNNO5emo.cjs} +1 -1
- package/dist/ListItemText-BlTklQGT.js +441 -0
- package/dist/ListItemText-DTJBvetJ.cjs +1 -0
- package/dist/{Menu-B5k8imF-.cjs → Menu-BD7yr5c5.cjs} +1 -1
- package/dist/{Menu-BBziZ0k7.js → Menu-CtyhzSeU.js} +11 -11
- package/dist/{MenuItem-Cz_x60jl.cjs → MenuItem-BnxRQgzx.cjs} +1 -1
- package/dist/{MenuItem-B1FTx8Uo.js → MenuItem-Cpp55CvO.js} +8 -8
- package/dist/{Modal-DheFVbb9.cjs → Modal-Dpz2n_rl.cjs} +1 -1
- package/dist/{Modal-GbNoYWDt.js → Modal-WaX5c2ks.js} +8 -8
- package/dist/{MoreVert-DC6HBf1h.cjs → MoreVert-B37dOc0h.cjs} +1 -1
- package/dist/{MoreVert-DJ8sAY3o.js → MoreVert-DcA_LRP8.js} +1 -1
- package/dist/{Paper-DWhwBCNx.cjs → Paper-Dy4nClba.cjs} +1 -1
- package/dist/{Paper-fiQZbcci.js → Paper-yeP8q4RO.js} +4 -4
- package/dist/{Popper-Bzo9-6GK.cjs → Popper-Dx7Ddmig.cjs} +1 -1
- package/dist/{Popper-CpecBTnq.js → Popper-IzGPRFl_.js} +5 -5
- package/dist/{Portal-ChC9wmMZ.js → Portal-DTB-35pe.js} +1 -1
- package/dist/{Radio-CcP--hXF.js → Radio-DQq7Mj29.js} +8 -8
- package/dist/{Radio-DyOcq-qZ.cjs → Radio-TCZTDRDq.cjs} +1 -1
- package/dist/{RadioGroup-CfxZyChX.cjs → RadioGroup-BlhT0LTh.cjs} +1 -1
- package/dist/{RadioGroup-CYy8kuyP.js → RadioGroup-D-KO9Ylf.js} +3 -3
- package/dist/{Select-B7uzsMmD.js → Select-CHo4cwj1.js} +8 -8
- package/dist/{Select-C1DzOJfC.cjs → Select-YiRsvCtO.cjs} +1 -1
- package/dist/{Stack-CMUWQxQn.js → Stack-B_iq0mhq.js} +5 -5
- package/dist/{Stack-BVWbOqY_.cjs → Stack-CiqSL-ss.cjs} +1 -1
- package/dist/{Stepper-Dk1iWstN.cjs → Stepper-Bp48LpKw.cjs} +1 -1
- package/dist/{Stepper-DOTvtRRL.js → Stepper-Co2LRzY9.js} +7 -7
- package/dist/{Switch-CFOFmdXw.js → Switch-B0HwIwIM.js} +6 -6
- package/dist/{Switch-Bsi_5s-3.cjs → Switch-CmP4YhdJ.cjs} +1 -1
- package/dist/{SwitchBase-BAC5BgOW.cjs → SwitchBase-D-Pz73oW.cjs} +1 -1
- package/dist/{SwitchBase-BznD_7MN.js → SwitchBase-DrxqSNew.js} +5 -5
- package/dist/{Tab-zTI8Z8pR.cjs → Tab-DaJQbLHr.cjs} +1 -1
- package/dist/{Tab-DXSeiuQu.js → Tab-fionqt7a.js} +11 -11
- package/dist/{TextField-C8gcAU1R.cjs → TextField-BD5v4wWW.cjs} +1 -1
- package/dist/{TextField-EWjMXgtu.js → TextField-CbcJBZMa.js} +7 -7
- package/dist/{ToggleButtonGroup-C0m6y9pL.js → ToggleButtonGroup-C2VnPpq_.js} +1728 -1474
- package/dist/{ToggleButtonGroup-Cy8vvvij.cjs → ToggleButtonGroup-cWPBztiH.cjs} +39 -39
- package/dist/{Tooltip-DXI1DHeO.cjs → Tooltip-B-G3ZA40.cjs} +1 -1
- package/dist/{Tooltip-Cl2Ew6vp.js → Tooltip-KsV9NFU9.js} +9 -9
- package/dist/{Typography-De-21leI.cjs → Typography-CTc5xI5k.cjs} +1 -1
- package/dist/{Typography-DwMlN0K5.js → Typography-CYUXO-Vm.js} +5 -5
- package/dist/{capitalize-BHFotl9B.js → capitalize-3mO2QYxZ.js} +1 -1
- package/dist/{capitalize-CKLkSyDO.cjs → capitalize-jkeaHv-a.cjs} +1 -1
- package/dist/components/Alert/Alert.cjs.js +1 -1
- package/dist/components/Alert/Alert.es.js +3 -3
- package/dist/components/Alert/index.cjs.js +1 -1
- package/dist/components/Alert/index.es.js +1 -1
- package/dist/components/Button/Button.cjs.js +1 -1
- package/dist/components/Button/Button.es.js +2 -2
- package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker/DatePicker.es.js +1 -1
- package/dist/components/DatePicker/index.cjs.js +1 -1
- package/dist/components/DatePicker/index.es.js +1 -1
- package/dist/components/Dialog/Dialog.cjs.js +1 -1
- package/dist/components/Dialog/Dialog.es.js +2 -2
- package/dist/components/Dropzone/Dropzone.cjs.js +1 -1
- package/dist/components/Dropzone/Dropzone.es.js +3 -3
- package/dist/components/EmptyState/EmptyState.cjs.js +1 -1
- package/dist/components/EmptyState/EmptyState.es.js +3 -3
- package/dist/components/FileList/FileIcon.cjs.js +1 -1
- package/dist/components/FileList/FileIcon.es.js +1 -1
- package/dist/components/FileList/FileListItem.cjs.js +1 -1
- package/dist/components/FileList/FileListItem.es.js +4 -4
- package/dist/components/FolderCard/FolderCard.cjs.js +1 -1
- package/dist/components/FolderCard/FolderCard.es.js +2 -2
- package/dist/components/Heading/Heading.cjs.js +1 -1
- package/dist/components/Heading/Heading.es.js +2 -2
- package/dist/components/ImagePicker/ImagePicker.cjs.js +1 -1
- package/dist/components/ImagePicker/ImagePicker.es.js +4 -4
- package/dist/components/Loader/Loader.cjs.js +1 -1
- package/dist/components/Loader/Loader.es.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
- package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
- package/dist/components/ResourceCard/ResourceCard.cjs.js +1 -1
- package/dist/components/ResourceCard/ResourceCard.es.js +1 -1
- package/dist/components/SearchInput/SearchInput.cjs.js +1 -1
- package/dist/components/SearchInput/SearchInput.es.js +4 -4
- package/dist/components/SwitchView/SwitchView.cjs.js +1 -0
- package/dist/components/SwitchView/SwitchView.d.ts +3 -0
- package/dist/components/SwitchView/SwitchView.es.js +35 -0
- package/dist/components/SwitchView/index.cjs.js +1 -0
- package/dist/components/SwitchView/index.d.ts +2 -0
- package/dist/components/SwitchView/index.es.js +4 -0
- package/dist/components/SwitchView/style.cjs.js +1 -0
- package/dist/components/SwitchView/style.es.js +29 -0
- package/dist/components/SwitchView/types.cjs.js +1 -0
- package/dist/components/SwitchView/types.d.ts +21 -0
- package/dist/components/SwitchView/types.es.js +1 -0
- package/dist/components/TreeView/TreeView.cjs.js +1 -1
- package/dist/components/TreeView/TreeView.es.js +8 -8
- package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -1
- package/dist/components/TreeView/components/CustomTreeItem.es.js +2 -2
- package/dist/components/TreeView/utils.cjs.js +1 -1
- package/dist/components/TreeView/utils.es.js +3 -3
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.es.js +407 -401
- package/dist/components/stories/Alert.stories.cjs.js +1 -1
- package/dist/components/stories/Alert.stories.es.js +1 -1
- package/dist/components/stories/Autocomplete.stories.cjs.js +1 -1
- package/dist/components/stories/Autocomplete.stories.es.js +2 -2
- package/dist/components/stories/Badge.stories.cjs.js +1 -1
- package/dist/components/stories/Badge.stories.es.js +2 -2
- package/dist/components/stories/Button.stories.cjs.js +1 -1
- package/dist/components/stories/Button.stories.es.js +1 -1
- package/dist/components/stories/Card.stories.cjs.js +1 -1
- package/dist/components/stories/Card.stories.es.js +2 -2
- package/dist/components/stories/Checkbox.stories.cjs.js +1 -1
- package/dist/components/stories/Checkbox.stories.es.js +1 -1
- package/dist/components/stories/Chip.stories.cjs.js +1 -1
- package/dist/components/stories/Chip.stories.es.js +1 -1
- package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
- package/dist/components/stories/DatePicker.stories.es.js +1 -1
- package/dist/components/stories/Dialog.stories.cjs.js +1 -1
- package/dist/components/stories/Dialog.stories.es.js +2 -2
- package/dist/components/stories/Divider.stories.cjs.js +1 -1
- package/dist/components/stories/Divider.stories.es.js +1 -1
- package/dist/components/stories/FormControlLabel.stories.cjs.js +1 -1
- package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
- package/dist/components/stories/Heading.stories.cjs.js +1 -1
- package/dist/components/stories/Heading.stories.es.js +2 -2
- package/dist/components/stories/IconButton.stories.cjs.js +1 -1
- package/dist/components/stories/IconButton.stories.es.js +2 -2
- package/dist/components/stories/Link.stories.cjs.js +1 -1
- package/dist/components/stories/Link.stories.es.js +1 -1
- package/dist/components/stories/Menu.stories.cjs.js +1 -1
- package/dist/components/stories/Menu.stories.es.js +2 -2
- package/dist/components/stories/Paper.stories.cjs.js +1 -1
- package/dist/components/stories/Paper.stories.es.js +1 -1
- package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
- package/dist/components/stories/RadioGroup.stories.es.js +3 -3
- package/dist/components/stories/ResourceCard.stories.cjs.js +1 -1
- package/dist/components/stories/ResourceCard.stories.es.js +1 -1
- package/dist/components/stories/Select.stories.cjs.js +1 -1
- package/dist/components/stories/Select.stories.es.js +3 -3
- package/dist/components/stories/Stepper.stories.cjs.js +1 -1
- package/dist/components/stories/Stepper.stories.es.js +4 -4
- package/dist/components/stories/SwitchView.stories.cjs.js +143 -0
- package/dist/components/stories/SwitchView.stories.d.ts +16 -0
- package/dist/components/stories/SwitchView.stories.es.js +1135 -0
- package/dist/components/stories/TabList.stories.cjs.js +1 -1
- package/dist/components/stories/TabList.stories.es.js +1 -1
- package/dist/components/stories/TextField.stories.cjs.js +1 -1
- package/dist/components/stories/TextField.stories.es.js +1 -1
- package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
- package/dist/components/stories/Tooltip.stories.es.js +2 -2
- package/dist/components/stories/TreeView.stories.cjs.js +3 -3
- package/dist/components/stories/TreeView.stories.es.js +38 -37
- package/dist/components/stories/Typography.stories.cjs.js +1 -1
- package/dist/components/stories/Typography.stories.es.js +1 -1
- package/dist/{composeClasses-CWgX5SFD.cjs → composeClasses-6Jh42fnW.cjs} +1 -1
- package/dist/{composeClasses-CJKlIaRn.js → composeClasses-PwLhKFRx.js} +1 -1
- package/dist/{createSvgIcon-BlKmtOkV.js → createSvgIcon-BWru5SCV.js} +4 -4
- package/dist/{createSvgIcon-BgBODH2F.cjs → createSvgIcon-r-LuM8rr.cjs} +1 -1
- package/dist/{dividerClasses-Glz8RJdF.js → dividerClasses-Brli9oB2.js} +1 -1
- package/dist/{dividerClasses-D3gnW6kZ.cjs → dividerClasses-MIs6pQ1h.cjs} +1 -1
- package/dist/{extendSxProp-BouzOuB6.js → extendSxProp-DPYS2LeU.js} +1 -1
- package/dist/{extendSxProp-Cm-DtZe3.cjs → extendSxProp-DjoHuUqk.cjs} +1 -1
- package/dist/{generateUtilityClasses-DngCqveO.js → generateUtilityClasses-BbL5PyhJ.js} +1 -1
- package/dist/{generateUtilityClasses-CMlilM6r.cjs → generateUtilityClasses-CEM-EnA0.cjs} +1 -1
- package/dist/{index-l8yqod25.js → index-Blgqpey-.js} +4 -4
- package/dist/{index-BzsuDIEl.cjs → index-dnUj5rrV.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +407 -401
- package/dist/{listItemTextClasses-BJFgw1ah.cjs → listItemTextClasses-BbeGMaIS.cjs} +1 -1
- package/dist/{listItemTextClasses-BRj19IXv.js → listItemTextClasses-x9hDn3Oc.js} +1 -1
- package/dist/{memoTheme-BAbn60Cb.cjs → memoTheme-BvyhrtrO.cjs} +1 -1
- package/dist/{memoTheme-nmt7i1dS.js → memoTheme-C2ZnVSVg.js} +1 -1
- package/dist/{mergeSlotProps-BBciKnr4.js → mergeSlotProps-Cy3pJiFs.js} +1 -1
- package/dist/{mergeSlotProps-Z5-o9vSe.cjs → mergeSlotProps-DTB2qS-_.cjs} +1 -1
- package/dist/{resolveComponentProps-DWSW1fip.cjs → resolveComponentProps-CUWj-pue.cjs} +1 -1
- package/dist/{resolveComponentProps-GCsHjsGW.js → resolveComponentProps-DBhzJW60.js} +1 -1
- package/dist/{useEventCallback-Yoj9nCug.js → useEventCallback-Y2KwRxBw.js} +2 -2
- package/dist/{useSlot-DhqI4pZ8.cjs → useSlot-CVpYSDNX.cjs} +1 -1
- package/dist/{useSlot-WWh43uDP.js → useSlot-PbukIIii.js} +1 -1
- package/dist/{useSlotProps-CSfMm_AK.js → useSlotProps-Bvolo5qn.js} +1 -1
- package/dist/{useSlotProps-CrmlYV9C.cjs → useSlotProps-DOS62OUK.cjs} +1 -1
- package/dist/useTheme-B0omzE6M.js +11 -0
- package/dist/{useTheme-CqYtLDbs.cjs → useTheme-CwVFTV8w.cjs} +1 -1
- package/dist/{useTheme-D9cVynB-.js → useTheme-DlWqSSQs.js} +1 -1
- package/dist/{useTheme-ClhInrO2.cjs → useTheme-zxjGe7nF.cjs} +1 -1
- package/dist/useThemeProps-Bel8apgw.js +17 -0
- package/dist/{useThemeProps-DQOn-ezC.cjs → useThemeProps-Bf2NCpA_.cjs} +1 -1
- package/dist/useThemeProps-C4zuxIb5.cjs +1 -0
- package/dist/{useThemeProps-ggw56DH-.js → useThemeProps-CHx0N1SM.js} +2 -2
- package/package.json +1 -1
- package/dist/DefaultPropsProvider-B1crdkTC.cjs +0 -1
- package/dist/ListItemText-C4HujomF.cjs +0 -2
- package/dist/ListItemText-CpNLkk9h.js +0 -853
- package/dist/useTheme-C59wIJ3-.js +0 -11
- package/dist/useThemeProps-BFQ8ndnj.js +0 -17
- package/dist/useThemeProps-DYpozGhe.cjs +0 -1
|
@@ -0,0 +1,1135 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as z } from "../../createSvgIcon-BWru5SCV.js";
|
|
3
|
+
import { useState as u, useCallback as V } from "react";
|
|
4
|
+
import m from "../SwitchView/SwitchView.es.js";
|
|
5
|
+
import { B as d } from "../../Box-DjbKEblU.js";
|
|
6
|
+
import { T as n } from "../../Typography-CYUXO-Vm.js";
|
|
7
|
+
import { G as l } from "../../Grid-CpuW2Xrl.js";
|
|
8
|
+
import { B as y } from "../../Button-WTdCmXYm.js";
|
|
9
|
+
import { P as s } from "../../Paper-yeP8q4RO.js";
|
|
10
|
+
const I = z(/* @__PURE__ */ e("path", {
|
|
11
|
+
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"
|
|
12
|
+
}), "CalendarViewMonth"), S = z(/* @__PURE__ */ e("path", {
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
d: "M3 3v8h8V3zm6 6H5V5h4zm-6 4v8h8v-8zm6 6H5v-4h4zm4-16v8h8V3zm6 6h-4V5h4zm-6 4v8h8v-8zm6 6h-4v-4h4z"
|
|
15
|
+
}), "GridView"), w = z(/* @__PURE__ */ e("path", {
|
|
16
|
+
d: "M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"
|
|
17
|
+
}), "List"), f = z(/* @__PURE__ */ e("path", {
|
|
18
|
+
d: "M21 8H3V4h18zm0 2H3v4h18zm0 6H3v4h18z"
|
|
19
|
+
}), "TableRows"), T = z(/* @__PURE__ */ e("path", {
|
|
20
|
+
d: "M2 4v7h20V4zm8 16h12v-7H10zm-8 0h6v-7H2z"
|
|
21
|
+
}), "ViewComfy"), B = z(/* @__PURE__ */ e("path", {
|
|
22
|
+
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"
|
|
23
|
+
}), "ViewModule"), G = {
|
|
24
|
+
title: "Components/SwitchView",
|
|
25
|
+
component: m,
|
|
26
|
+
argTypes: {
|
|
27
|
+
toggleButtonList: {
|
|
28
|
+
description: "**[Requis]** Liste des boutons à afficher dans le SwitchView.",
|
|
29
|
+
control: "object",
|
|
30
|
+
table: {
|
|
31
|
+
required: !0,
|
|
32
|
+
type: { summary: "readonly ToggleButtonItem[]" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
viewMode: {
|
|
36
|
+
description: "**[Requis]** Valeur actuellement sélectionnée.",
|
|
37
|
+
control: "text",
|
|
38
|
+
table: {
|
|
39
|
+
required: !0,
|
|
40
|
+
type: { summary: "T[number]['value']" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
onChange: {
|
|
44
|
+
description: "**[Requis]** Fonction appelée lorsqu'un bouton est sélectionné.",
|
|
45
|
+
table: {
|
|
46
|
+
required: !0,
|
|
47
|
+
type: {
|
|
48
|
+
summary: "(value: T[number]['value']) => void"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
colorVariant: {
|
|
53
|
+
description: "**[Optionnel]** Variante de couleur des boutons.",
|
|
54
|
+
control: "select",
|
|
55
|
+
options: ["primary", "secondary"],
|
|
56
|
+
defaultValue: "primary",
|
|
57
|
+
table: {
|
|
58
|
+
required: !1,
|
|
59
|
+
type: { summary: "ColorVariant" },
|
|
60
|
+
defaultValue: { summary: "primary" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
description: "**[Optionnel]** Taille des boutons.",
|
|
65
|
+
control: "select",
|
|
66
|
+
options: ["small", "medium", "large"],
|
|
67
|
+
defaultValue: "small",
|
|
68
|
+
table: {
|
|
69
|
+
required: !1,
|
|
70
|
+
type: { summary: "string" },
|
|
71
|
+
defaultValue: { summary: "small" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
orientation: {
|
|
75
|
+
description: "**[Optionnel]** Orientation du groupe de boutons.",
|
|
76
|
+
control: "select",
|
|
77
|
+
options: ["horizontal", "vertical"],
|
|
78
|
+
defaultValue: "horizontal",
|
|
79
|
+
table: {
|
|
80
|
+
required: !1,
|
|
81
|
+
type: { summary: "string" },
|
|
82
|
+
defaultValue: { summary: "horizontal" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
parameters: {
|
|
87
|
+
docs: {
|
|
88
|
+
description: {
|
|
89
|
+
component: `
|
|
90
|
+
## SwitchView
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
### 🔥 Typage générique et sécurité des types
|
|
95
|
+
|
|
96
|
+
Le SwitchView 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 !
|
|
97
|
+
|
|
98
|
+
**Point clé** : Utilisez toujours \`as const\` après votre tableau de boutons pour permettre l'inférence de type littéral.
|
|
99
|
+
|
|
100
|
+
### 🎯 Utilisation recommandée pour éviter les types 'any'
|
|
101
|
+
|
|
102
|
+
\`\`\`typescript
|
|
103
|
+
// ✅ CORRECT : Définition avec 'as const' pour l'inférence de type
|
|
104
|
+
const viewButtons = [
|
|
105
|
+
{ value: "cards", icon: <ViewModuleIcon /> },
|
|
106
|
+
{ value: "table", icon: <TableRowsIcon /> },
|
|
107
|
+
{ value: "list", icon: <ListIcon /> }
|
|
108
|
+
] as const; // ← IMPORTANT : ne pas oublier 'as const'
|
|
109
|
+
|
|
110
|
+
// ✅ CORRECT : Typage explicite pour le state et le handler
|
|
111
|
+
type ViewType = (typeof viewButtons)[number]["value"]; // "cards" | "table" | "list"
|
|
112
|
+
|
|
113
|
+
const [currentView, setCurrentView] = useState<ViewType>("cards");
|
|
114
|
+
|
|
115
|
+
const handleViewChange = useCallback((value: ViewType) => {
|
|
116
|
+
console.log(\`Vue sélectionnée: \${value}\`); // ← value est typé correctement
|
|
117
|
+
setCurrentView(value);
|
|
118
|
+
}, []);
|
|
119
|
+
|
|
120
|
+
<SwitchView
|
|
121
|
+
toggleButtonList={viewButtons}
|
|
122
|
+
viewMode={currentView}
|
|
123
|
+
onChange={handleViewChange} // ← Pas d'erreur 'any' !
|
|
124
|
+
/>
|
|
125
|
+
\`\`\`
|
|
126
|
+
|
|
127
|
+
### ❌ À éviter : patterns qui causent des types 'any'
|
|
128
|
+
|
|
129
|
+
\`\`\`typescript
|
|
130
|
+
// ❌ INCORRECT : Sans 'as const'
|
|
131
|
+
const viewButtons = [
|
|
132
|
+
{ value: "cards", icon: <ViewModuleIcon /> },
|
|
133
|
+
{ value: "table", icon: <TableRowsIcon /> }
|
|
134
|
+
]; // ← types inférés comme 'string' au lieu de littéraux
|
|
135
|
+
|
|
136
|
+
// ❌ INCORRECT : Handler sans typage explicite
|
|
137
|
+
const handleViewChange = (value) => { // ← 'value' aura le type 'any'
|
|
138
|
+
setCurrentView(value);
|
|
139
|
+
};
|
|
140
|
+
\`\`\`
|
|
141
|
+
|
|
142
|
+
### 🛠️ Personnalisation
|
|
143
|
+
|
|
144
|
+
- \`colorVariant\`: Choix entre les palettes "primary" et "secondary"
|
|
145
|
+
- \`size\`: Contrôle la taille des boutons ("small", "medium", "large")
|
|
146
|
+
- \`orientation\`: Affichage horizontal ou vertical du groupe de boutons
|
|
147
|
+
- \`disabled\`: Possibilité de désactiver individuellement certains boutons
|
|
148
|
+
|
|
149
|
+
### 📋 Structure des données
|
|
150
|
+
|
|
151
|
+
Le composant attend un tableau d'objets \`ToggleButtonItem\` typé de manière générique :
|
|
152
|
+
|
|
153
|
+
\`\`\`typescript
|
|
154
|
+
interface ToggleButtonItem<T extends string = string> {
|
|
155
|
+
value: T; // Valeur unique pour ce bouton (obligatoire)
|
|
156
|
+
icon: ReactNode; // Icône à afficher (obligatoire)
|
|
157
|
+
disabled?: boolean; // Désactiver ce bouton spécifique (facultatif)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Le composant infère automatiquement T à partir de votre tableau
|
|
161
|
+
type SwitchViewProps<T extends readonly ToggleButtonItem<string>[]> = {
|
|
162
|
+
toggleButtonList: T;
|
|
163
|
+
viewMode: T[number]["value"]; // Type inféré automatiquement
|
|
164
|
+
onChange: (value: T[number]["value"]) => void; // Type inféré automatiquement
|
|
165
|
+
// ... autres props
|
|
166
|
+
}
|
|
167
|
+
\`\`\`
|
|
168
|
+
|
|
169
|
+
### 🎉 Avantages du typage générique
|
|
170
|
+
|
|
171
|
+
1. **Auto-complétion** : IDE suggère automatiquement les valeurs possibles
|
|
172
|
+
2. **Vérification à la compilation** : Erreurs détectées avant l'exécution
|
|
173
|
+
3. **Refactoring sûr** : Renommer une valeur met à jour toutes les références
|
|
174
|
+
4. **Documentation vivante** : Les types servent de documentation
|
|
175
|
+
|
|
176
|
+
### 💡 Conseils pour une utilisation optimale
|
|
177
|
+
|
|
178
|
+
1. **Utilisez des types helper** pour éviter la répétition :
|
|
179
|
+
\`\`\`typescript
|
|
180
|
+
type ViewConfig = typeof viewButtons;
|
|
181
|
+
type ViewType = ViewConfig[number]["value"];
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
2. **Créez des constantes réutilisables** :
|
|
185
|
+
\`\`\`typescript
|
|
186
|
+
export const VIEW_MODES = {
|
|
187
|
+
CARDS: "cards",
|
|
188
|
+
TABLE: "table",
|
|
189
|
+
LIST: "list"
|
|
190
|
+
} as const;
|
|
191
|
+
|
|
192
|
+
const viewButtons = [
|
|
193
|
+
{ value: VIEW_MODES.CARDS, icon: <ViewModuleIcon /> },
|
|
194
|
+
// ...
|
|
195
|
+
] as const;
|
|
196
|
+
\`\`\`
|
|
197
|
+
|
|
198
|
+
3. **Utilisez des factory functions** pour des configurations complexes :
|
|
199
|
+
\`\`\`typescript
|
|
200
|
+
const createViewButton = <T extends string>(value: T, icon: ReactNode) =>
|
|
201
|
+
({ value, icon } as const);
|
|
202
|
+
\`\`\`
|
|
203
|
+
`
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}, x = [
|
|
208
|
+
{ value: "cards", icon: /* @__PURE__ */ e(B, {}) },
|
|
209
|
+
{ value: "table", icon: /* @__PURE__ */ e(f, {}) },
|
|
210
|
+
{ value: "list", icon: /* @__PURE__ */ e(w, {}) }
|
|
211
|
+
], M = [
|
|
212
|
+
{ value: "grid", icon: /* @__PURE__ */ e(S, {}) },
|
|
213
|
+
{ value: "cards", icon: /* @__PURE__ */ e(T, {}) },
|
|
214
|
+
{ value: "table", icon: /* @__PURE__ */ e(f, {}) },
|
|
215
|
+
{ value: "list", icon: /* @__PURE__ */ e(w, {}) },
|
|
216
|
+
{ value: "calendar", icon: /* @__PURE__ */ e(I, {}) }
|
|
217
|
+
], q = [
|
|
218
|
+
{ value: "cards", icon: /* @__PURE__ */ e(B, {}) },
|
|
219
|
+
{ value: "table", icon: /* @__PURE__ */ e(f, {}), disabled: !0 },
|
|
220
|
+
{ value: "list", icon: /* @__PURE__ */ e(w, {}) }
|
|
221
|
+
], j = {
|
|
222
|
+
render: () => {
|
|
223
|
+
const [o, r] = u("cards"), c = V((i) => {
|
|
224
|
+
console.log(`Vue sélectionnée: ${i}`), r(i);
|
|
225
|
+
}, []);
|
|
226
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
227
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Sélecteur de vue standard" }),
|
|
228
|
+
/* @__PURE__ */ e(
|
|
229
|
+
m,
|
|
230
|
+
{
|
|
231
|
+
toggleButtonList: x,
|
|
232
|
+
viewMode: o,
|
|
233
|
+
onChange: c
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
237
|
+
"Vue actuelle: ",
|
|
238
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
239
|
+
] })
|
|
240
|
+
] });
|
|
241
|
+
},
|
|
242
|
+
parameters: {
|
|
243
|
+
controls: { disable: !0 },
|
|
244
|
+
actions: { disable: !0 },
|
|
245
|
+
docs: {
|
|
246
|
+
description: {
|
|
247
|
+
story: "Sélecteur de vue basique permettant de basculer entre trois modes d'affichage : cartes, tableau et liste."
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}, N = {
|
|
252
|
+
render: () => {
|
|
253
|
+
const [o, r] = u("table"), [c, i] = u(
|
|
254
|
+
"primary"
|
|
255
|
+
), [h, a] = u("small"), [v, g] = u(
|
|
256
|
+
"horizontal"
|
|
257
|
+
);
|
|
258
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
259
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Personnalisation en temps réel" }),
|
|
260
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 2, sx: { mb: 3 }, children: [
|
|
261
|
+
/* @__PURE__ */ t(l, { size: { xs: 12, sm: 6, md: 3 }, children: [
|
|
262
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "Couleur" }),
|
|
263
|
+
/* @__PURE__ */ t(d, { sx: { display: "flex", gap: 1 }, children: [
|
|
264
|
+
/* @__PURE__ */ e(
|
|
265
|
+
y,
|
|
266
|
+
{
|
|
267
|
+
size: "small",
|
|
268
|
+
variant: c === "primary" ? "contained" : "outlined",
|
|
269
|
+
onClick: () => i("primary"),
|
|
270
|
+
children: "Primary"
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ e(
|
|
274
|
+
y,
|
|
275
|
+
{
|
|
276
|
+
size: "small",
|
|
277
|
+
variant: c === "secondary" ? "contained" : "outlined",
|
|
278
|
+
onClick: () => i("secondary"),
|
|
279
|
+
children: "Secondary"
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
] })
|
|
283
|
+
] }),
|
|
284
|
+
/* @__PURE__ */ t(l, { size: { xs: 12, sm: 6, md: 3 }, children: [
|
|
285
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "Taille" }),
|
|
286
|
+
/* @__PURE__ */ e(d, { sx: { display: "flex", gap: 1 }, children: ["small", "medium", "large"].map((b) => /* @__PURE__ */ e(
|
|
287
|
+
y,
|
|
288
|
+
{
|
|
289
|
+
size: "small",
|
|
290
|
+
variant: h === b ? "contained" : "outlined",
|
|
291
|
+
onClick: () => a(b),
|
|
292
|
+
children: b
|
|
293
|
+
},
|
|
294
|
+
b
|
|
295
|
+
)) })
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ t(l, { size: { xs: 12, sm: 6, md: 3 }, children: [
|
|
298
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "Orientation" }),
|
|
299
|
+
/* @__PURE__ */ t(d, { sx: { display: "flex", gap: 1 }, children: [
|
|
300
|
+
/* @__PURE__ */ e(
|
|
301
|
+
y,
|
|
302
|
+
{
|
|
303
|
+
size: "small",
|
|
304
|
+
variant: v === "horizontal" ? "contained" : "outlined",
|
|
305
|
+
onClick: () => g("horizontal"),
|
|
306
|
+
children: "Horizontal"
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
/* @__PURE__ */ e(
|
|
310
|
+
y,
|
|
311
|
+
{
|
|
312
|
+
size: "small",
|
|
313
|
+
variant: v === "vertical" ? "contained" : "outlined",
|
|
314
|
+
onClick: () => g("vertical"),
|
|
315
|
+
children: "Vertical"
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
] })
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ t(l, { size: { xs: 12, sm: 6, md: 3 }, children: [
|
|
321
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "Vue actuelle" }),
|
|
322
|
+
/* @__PURE__ */ e(n, { variant: "body2", color: "primary", children: /* @__PURE__ */ e("strong", { children: o }) })
|
|
323
|
+
] })
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ e(s, { sx: { p: 3, display: "inline-block" }, children: /* @__PURE__ */ e(
|
|
326
|
+
m,
|
|
327
|
+
{
|
|
328
|
+
toggleButtonList: x,
|
|
329
|
+
viewMode: o,
|
|
330
|
+
onChange: (b) => {
|
|
331
|
+
console.log(`Vue sélectionnée: ${b}`), r(b);
|
|
332
|
+
},
|
|
333
|
+
colorVariant: c,
|
|
334
|
+
size: h,
|
|
335
|
+
orientation: v
|
|
336
|
+
}
|
|
337
|
+
) })
|
|
338
|
+
] });
|
|
339
|
+
},
|
|
340
|
+
parameters: {
|
|
341
|
+
controls: { disable: !0 },
|
|
342
|
+
// Désactiver les contrôles automatiques
|
|
343
|
+
actions: { disable: !0 },
|
|
344
|
+
docs: {
|
|
345
|
+
description: {
|
|
346
|
+
story: "Interface de démonstration permettant de tester toutes les options de personnalisation disponibles : couleur, taille et orientation des boutons."
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}, W = {
|
|
351
|
+
render: () => {
|
|
352
|
+
const o = [
|
|
353
|
+
{ value: "on", icon: /* @__PURE__ */ e(B, {}) },
|
|
354
|
+
{ value: "off", icon: /* @__PURE__ */ e(f, {}) }
|
|
355
|
+
], r = [
|
|
356
|
+
{ value: "active", icon: /* @__PURE__ */ e(T, {}) },
|
|
357
|
+
{ value: "inactive", icon: /* @__PURE__ */ e(w, {}) },
|
|
358
|
+
{ value: "pending", icon: /* @__PURE__ */ e(S, {}) }
|
|
359
|
+
], c = [
|
|
360
|
+
{ value: "edit", icon: /* @__PURE__ */ e(B, {}) },
|
|
361
|
+
{ value: "view", icon: /* @__PURE__ */ e(f, {}) },
|
|
362
|
+
{ value: "preview", icon: /* @__PURE__ */ e(w, {}) }
|
|
363
|
+
], [i, h] = u("on"), [a, v] = u("active"), [g, b] = u("edit");
|
|
364
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
365
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Différents contextes d'utilisation" }),
|
|
366
|
+
/* @__PURE__ */ e(n, { variant: "body2", color: "text.secondary", paragraph: !0, children: "Le même composant s'adapte automatiquement à différents types de données." }),
|
|
367
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 3, children: [
|
|
368
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
369
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Mode binaire" }),
|
|
370
|
+
/* @__PURE__ */ e(
|
|
371
|
+
n,
|
|
372
|
+
{
|
|
373
|
+
variant: "caption",
|
|
374
|
+
color: "text.secondary",
|
|
375
|
+
display: "block",
|
|
376
|
+
sx: { mb: 2 },
|
|
377
|
+
children: "Activation/Désactivation simple"
|
|
378
|
+
}
|
|
379
|
+
),
|
|
380
|
+
/* @__PURE__ */ e(
|
|
381
|
+
m,
|
|
382
|
+
{
|
|
383
|
+
toggleButtonList: o,
|
|
384
|
+
viewMode: i,
|
|
385
|
+
onChange: (p) => {
|
|
386
|
+
console.log("Simple:", p), h(p);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
391
|
+
"État: ",
|
|
392
|
+
i
|
|
393
|
+
] })
|
|
394
|
+
] }) }),
|
|
395
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
396
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Statut système" }),
|
|
397
|
+
/* @__PURE__ */ e(
|
|
398
|
+
n,
|
|
399
|
+
{
|
|
400
|
+
variant: "caption",
|
|
401
|
+
color: "text.secondary",
|
|
402
|
+
display: "block",
|
|
403
|
+
sx: { mb: 2 },
|
|
404
|
+
children: "Gestion d'états métier"
|
|
405
|
+
}
|
|
406
|
+
),
|
|
407
|
+
/* @__PURE__ */ e(
|
|
408
|
+
m,
|
|
409
|
+
{
|
|
410
|
+
toggleButtonList: r,
|
|
411
|
+
viewMode: a,
|
|
412
|
+
onChange: (p) => {
|
|
413
|
+
console.log("Status:", p), v(p);
|
|
414
|
+
},
|
|
415
|
+
colorVariant: "secondary"
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
419
|
+
"Statut: ",
|
|
420
|
+
a
|
|
421
|
+
] })
|
|
422
|
+
] }) }),
|
|
423
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
424
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Mode d'édition" }),
|
|
425
|
+
/* @__PURE__ */ e(
|
|
426
|
+
n,
|
|
427
|
+
{
|
|
428
|
+
variant: "caption",
|
|
429
|
+
color: "text.secondary",
|
|
430
|
+
display: "block",
|
|
431
|
+
sx: { mb: 2 },
|
|
432
|
+
children: "Interface utilisateur adaptative"
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
/* @__PURE__ */ e(
|
|
436
|
+
m,
|
|
437
|
+
{
|
|
438
|
+
toggleButtonList: c,
|
|
439
|
+
viewMode: g,
|
|
440
|
+
onChange: (p) => {
|
|
441
|
+
console.log("Mode:", p), b(p);
|
|
442
|
+
},
|
|
443
|
+
size: "medium"
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
447
|
+
"Mode: ",
|
|
448
|
+
g
|
|
449
|
+
] })
|
|
450
|
+
] }) })
|
|
451
|
+
] }),
|
|
452
|
+
/* @__PURE__ */ t(
|
|
453
|
+
s,
|
|
454
|
+
{
|
|
455
|
+
sx: {
|
|
456
|
+
p: 2,
|
|
457
|
+
mt: 3,
|
|
458
|
+
backgroundColor: "info.light",
|
|
459
|
+
color: "info.contrastText"
|
|
460
|
+
},
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "🎯 Flexibilité du composant" }),
|
|
463
|
+
/* @__PURE__ */ e(n, { variant: "body2", children: "Un seul composant peut gérer n'importe quel ensemble d'options, s'adaptant automatiquement au contexte d'utilisation." })
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
] });
|
|
468
|
+
},
|
|
469
|
+
parameters: {
|
|
470
|
+
controls: { disable: !0 },
|
|
471
|
+
actions: { disable: !0 },
|
|
472
|
+
docs: {
|
|
473
|
+
description: {
|
|
474
|
+
story: "Démonstration de la polyvalence du composant avec différents ensembles d'options : mode binaire, statuts système et modes d'édition."
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}, _ = {
|
|
479
|
+
render: () => {
|
|
480
|
+
const o = ["primary", "secondary"], [r, c] = u({
|
|
481
|
+
primary: "cards",
|
|
482
|
+
secondary: "table"
|
|
483
|
+
});
|
|
484
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
485
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Comparaison des variantes de couleurs" }),
|
|
486
|
+
/* @__PURE__ */ e(l, { container: !0, spacing: 3, children: o.map((i) => /* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
487
|
+
/* @__PURE__ */ t(n, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
488
|
+
"Variante ",
|
|
489
|
+
i
|
|
490
|
+
] }),
|
|
491
|
+
/* @__PURE__ */ e(
|
|
492
|
+
m,
|
|
493
|
+
{
|
|
494
|
+
toggleButtonList: x,
|
|
495
|
+
viewMode: r[i],
|
|
496
|
+
onChange: (h) => {
|
|
497
|
+
c((a) => ({ ...a, [i]: h }));
|
|
498
|
+
},
|
|
499
|
+
colorVariant: i
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
503
|
+
"Sélectionné: ",
|
|
504
|
+
r[i]
|
|
505
|
+
] })
|
|
506
|
+
] }) }, i)) })
|
|
507
|
+
] });
|
|
508
|
+
},
|
|
509
|
+
parameters: {
|
|
510
|
+
controls: { disable: !0 },
|
|
511
|
+
actions: { disable: !0 },
|
|
512
|
+
docs: {
|
|
513
|
+
description: {
|
|
514
|
+
story: "Démonstration des deux variantes de couleurs disponibles : primary et secondary."
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}, $ = {
|
|
519
|
+
render: () => {
|
|
520
|
+
const o = [
|
|
521
|
+
"small",
|
|
522
|
+
"medium",
|
|
523
|
+
"large"
|
|
524
|
+
], [r, c] = u({
|
|
525
|
+
small: "cards",
|
|
526
|
+
medium: "table",
|
|
527
|
+
large: "list"
|
|
528
|
+
});
|
|
529
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
530
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Comparaison des tailles" }),
|
|
531
|
+
/* @__PURE__ */ e(l, { container: !0, spacing: 3, children: o.map((i) => /* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
532
|
+
/* @__PURE__ */ t(n, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
533
|
+
"Taille ",
|
|
534
|
+
i
|
|
535
|
+
] }),
|
|
536
|
+
/* @__PURE__ */ e(
|
|
537
|
+
m,
|
|
538
|
+
{
|
|
539
|
+
toggleButtonList: x,
|
|
540
|
+
viewMode: r[i],
|
|
541
|
+
onChange: (h) => {
|
|
542
|
+
c((a) => ({ ...a, [i]: h }));
|
|
543
|
+
},
|
|
544
|
+
size: i
|
|
545
|
+
}
|
|
546
|
+
),
|
|
547
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
548
|
+
"Sélectionné: ",
|
|
549
|
+
r[i]
|
|
550
|
+
] })
|
|
551
|
+
] }) }, i)) })
|
|
552
|
+
] });
|
|
553
|
+
},
|
|
554
|
+
parameters: {
|
|
555
|
+
controls: { disable: !0 },
|
|
556
|
+
actions: { disable: !0 },
|
|
557
|
+
docs: {
|
|
558
|
+
description: {
|
|
559
|
+
story: "Démonstration des trois tailles disponibles : small, medium et large."
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}, J = {
|
|
564
|
+
render: () => {
|
|
565
|
+
const [o, r] = u("grid"), c = V((i) => {
|
|
566
|
+
r(i);
|
|
567
|
+
}, []);
|
|
568
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
569
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Orientation verticale" }),
|
|
570
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 3, children: [
|
|
571
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
572
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Orientation verticale - Taille medium" }),
|
|
573
|
+
/* @__PURE__ */ e(
|
|
574
|
+
m,
|
|
575
|
+
{
|
|
576
|
+
toggleButtonList: M,
|
|
577
|
+
viewMode: o,
|
|
578
|
+
onChange: c,
|
|
579
|
+
orientation: "vertical",
|
|
580
|
+
size: "medium"
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
] }) }),
|
|
584
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
585
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Orientation horizontale (comparaison)" }),
|
|
586
|
+
/* @__PURE__ */ e(
|
|
587
|
+
m,
|
|
588
|
+
{
|
|
589
|
+
toggleButtonList: M,
|
|
590
|
+
viewMode: o,
|
|
591
|
+
onChange: c,
|
|
592
|
+
orientation: "horizontal",
|
|
593
|
+
size: "medium"
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
] }) })
|
|
597
|
+
] }),
|
|
598
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
599
|
+
"Vue actuelle: ",
|
|
600
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
601
|
+
] })
|
|
602
|
+
] });
|
|
603
|
+
},
|
|
604
|
+
parameters: {
|
|
605
|
+
controls: { disable: !0 },
|
|
606
|
+
actions: { disable: !0 },
|
|
607
|
+
docs: {
|
|
608
|
+
description: {
|
|
609
|
+
story: "Démonstration de l'orientation verticale comparée à l'orientation horizontale avec plus d'options."
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}, K = {
|
|
614
|
+
render: () => {
|
|
615
|
+
const [o, r] = u("cards"), c = V((i) => {
|
|
616
|
+
r(i);
|
|
617
|
+
}, []);
|
|
618
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
619
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Gestion des boutons désactivés" }),
|
|
620
|
+
/* @__PURE__ */ t(s, { sx: { p: 3 }, children: [
|
|
621
|
+
/* @__PURE__ */ e(
|
|
622
|
+
m,
|
|
623
|
+
{
|
|
624
|
+
toggleButtonList: q,
|
|
625
|
+
viewMode: o,
|
|
626
|
+
onChange: c,
|
|
627
|
+
size: "medium"
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
631
|
+
"Vue actuelle: ",
|
|
632
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
633
|
+
] }),
|
|
634
|
+
/* @__PURE__ */ e(n, { variant: "body2", color: "text.secondary", sx: { mt: 1 }, children: 'Le bouton "Table" est désactivé dans cet exemple' }),
|
|
635
|
+
/* @__PURE__ */ t(d, { sx: { mt: 2 }, children: [
|
|
636
|
+
/* @__PURE__ */ e(
|
|
637
|
+
y,
|
|
638
|
+
{
|
|
639
|
+
variant: "outlined",
|
|
640
|
+
size: "small",
|
|
641
|
+
onClick: () => r("list"),
|
|
642
|
+
sx: { mr: 1 },
|
|
643
|
+
children: "Sélectionner Liste"
|
|
644
|
+
}
|
|
645
|
+
),
|
|
646
|
+
/* @__PURE__ */ e(
|
|
647
|
+
y,
|
|
648
|
+
{
|
|
649
|
+
variant: "outlined",
|
|
650
|
+
size: "small",
|
|
651
|
+
onClick: () => r("cards"),
|
|
652
|
+
children: "Sélectionner Cartes"
|
|
653
|
+
}
|
|
654
|
+
)
|
|
655
|
+
] })
|
|
656
|
+
] })
|
|
657
|
+
] });
|
|
658
|
+
},
|
|
659
|
+
parameters: {
|
|
660
|
+
controls: { disable: !0 },
|
|
661
|
+
actions: { disable: !0 },
|
|
662
|
+
docs: {
|
|
663
|
+
description: {
|
|
664
|
+
story: "Exemple montrant comment désactiver individuellement certains boutons en utilisant la propriété `disabled` dans les éléments du tableau."
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}, Q = {
|
|
669
|
+
render: () => {
|
|
670
|
+
const [o, r] = u("grid"), c = V((i) => {
|
|
671
|
+
r(i);
|
|
672
|
+
}, []);
|
|
673
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
674
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Plus d'options d'affichage" }),
|
|
675
|
+
/* @__PURE__ */ t(s, { sx: { p: 3 }, children: [
|
|
676
|
+
/* @__PURE__ */ e(
|
|
677
|
+
m,
|
|
678
|
+
{
|
|
679
|
+
toggleButtonList: M,
|
|
680
|
+
viewMode: o,
|
|
681
|
+
onChange: c,
|
|
682
|
+
colorVariant: "secondary",
|
|
683
|
+
size: "large"
|
|
684
|
+
}
|
|
685
|
+
),
|
|
686
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
687
|
+
"Vue actuelle: ",
|
|
688
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
689
|
+
] }),
|
|
690
|
+
/* @__PURE__ */ e(n, { variant: "body2", color: "text.secondary", sx: { mt: 1 }, children: "Cet exemple montre un SwitchView avec 5 options différentes en variante secondary et taille large" })
|
|
691
|
+
] })
|
|
692
|
+
] });
|
|
693
|
+
},
|
|
694
|
+
parameters: {
|
|
695
|
+
controls: { disable: !0 },
|
|
696
|
+
actions: { disable: !0 },
|
|
697
|
+
docs: {
|
|
698
|
+
description: {
|
|
699
|
+
story: "Exemple avec davantage d'options pour montrer la flexibilité du composant avec plusieurs modes d'affichage."
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}, X = {
|
|
704
|
+
render: () => {
|
|
705
|
+
const [o, r] = u("cards"), c = V((a) => {
|
|
706
|
+
console.log("Changement de vue:", a), r(a);
|
|
707
|
+
}, []), i = V((a) => {
|
|
708
|
+
console.log("Changement externe:", a), r(a);
|
|
709
|
+
}, []);
|
|
710
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
711
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Synchronisation avec d'autres composants" }),
|
|
712
|
+
/* @__PURE__ */ t(n, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
713
|
+
"Vue actuelle: ",
|
|
714
|
+
/* @__PURE__ */ e("strong", { children: o })
|
|
715
|
+
] }),
|
|
716
|
+
/* @__PURE__ */ e(n, { variant: "body2", color: "text.secondary", paragraph: !0, children: (() => {
|
|
717
|
+
switch (o) {
|
|
718
|
+
case "cards":
|
|
719
|
+
return "Affichage en cartes - Idéal pour une vue d'ensemble visuelle";
|
|
720
|
+
case "table":
|
|
721
|
+
return "Affichage en tableau - Parfait pour comparer des données";
|
|
722
|
+
case "list":
|
|
723
|
+
return "Affichage en liste - Optimal pour parcourir rapidement";
|
|
724
|
+
default:
|
|
725
|
+
return "Mode d'affichage inconnu";
|
|
726
|
+
}
|
|
727
|
+
})() }),
|
|
728
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 3, children: [
|
|
729
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
730
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "SwitchView Principal" }),
|
|
731
|
+
/* @__PURE__ */ e(
|
|
732
|
+
m,
|
|
733
|
+
{
|
|
734
|
+
toggleButtonList: x,
|
|
735
|
+
viewMode: o,
|
|
736
|
+
onChange: c,
|
|
737
|
+
size: "medium"
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
] }) }),
|
|
741
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
742
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Contrôles externes" }),
|
|
743
|
+
/* @__PURE__ */ e(d, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: x.map((a) => /* @__PURE__ */ t(
|
|
744
|
+
y,
|
|
745
|
+
{
|
|
746
|
+
variant: o === a.value ? "contained" : "outlined",
|
|
747
|
+
onClick: () => i(a.value),
|
|
748
|
+
size: "small",
|
|
749
|
+
startIcon: a.icon,
|
|
750
|
+
children: [
|
|
751
|
+
"Mode ",
|
|
752
|
+
a.value
|
|
753
|
+
]
|
|
754
|
+
},
|
|
755
|
+
a.value
|
|
756
|
+
)) })
|
|
757
|
+
] }) })
|
|
758
|
+
] }),
|
|
759
|
+
/* @__PURE__ */ t(s, { sx: { p: 2, mt: 2, backgroundColor: "grey.50" }, children: [
|
|
760
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "Actions rapides" }),
|
|
761
|
+
/* @__PURE__ */ e(
|
|
762
|
+
y,
|
|
763
|
+
{
|
|
764
|
+
variant: "text",
|
|
765
|
+
size: "small",
|
|
766
|
+
onClick: () => {
|
|
767
|
+
const a = ["cards", "table", "list"], v = a[Math.floor(Math.random() * a.length)];
|
|
768
|
+
i(v);
|
|
769
|
+
},
|
|
770
|
+
sx: { mr: 1 },
|
|
771
|
+
children: "Vue aléatoire"
|
|
772
|
+
}
|
|
773
|
+
),
|
|
774
|
+
/* @__PURE__ */ e(
|
|
775
|
+
y,
|
|
776
|
+
{
|
|
777
|
+
variant: "text",
|
|
778
|
+
size: "small",
|
|
779
|
+
onClick: () => {
|
|
780
|
+
const v = (x.findIndex(
|
|
781
|
+
(g) => g.value === o
|
|
782
|
+
) + 1) % x.length;
|
|
783
|
+
i(x[v].value);
|
|
784
|
+
},
|
|
785
|
+
children: "Vue suivante"
|
|
786
|
+
}
|
|
787
|
+
)
|
|
788
|
+
] })
|
|
789
|
+
] });
|
|
790
|
+
},
|
|
791
|
+
parameters: {
|
|
792
|
+
controls: { disable: !0 },
|
|
793
|
+
actions: { disable: !0 },
|
|
794
|
+
docs: {
|
|
795
|
+
description: {
|
|
796
|
+
story: "Démonstration de la synchronisation entre le SwitchView et d'autres composants. Cette story montre comment le SwitchView peut être intégré dans une interface complexe où la sélection peut provenir de différentes sources mais reste synchronisée."
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}, Y = {
|
|
801
|
+
render: () => {
|
|
802
|
+
const o = [
|
|
803
|
+
{ value: "overview", icon: /* @__PURE__ */ e(T, {}) },
|
|
804
|
+
{ value: "detailed", icon: /* @__PURE__ */ e(f, {}) },
|
|
805
|
+
{ value: "analytics", icon: /* @__PURE__ */ e(S, {}) }
|
|
806
|
+
], r = [
|
|
807
|
+
{ value: "grid", icon: /* @__PURE__ */ e(S, {}) },
|
|
808
|
+
{ value: "list", icon: /* @__PURE__ */ e(w, {}) },
|
|
809
|
+
{ value: "tree", icon: /* @__PURE__ */ e(B, {}) }
|
|
810
|
+
], c = [
|
|
811
|
+
{ value: "chart", icon: /* @__PURE__ */ e(I, {}) },
|
|
812
|
+
{ value: "table", icon: /* @__PURE__ */ e(f, {}) },
|
|
813
|
+
{ value: "raw", icon: /* @__PURE__ */ e(w, {}), disabled: !0 }
|
|
814
|
+
], [i, h] = u("overview"), [a, v] = u("grid"), [g, b] = u("chart");
|
|
815
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
816
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "Cas d'utilisation dans une interface complexe" }),
|
|
817
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 3, children: [
|
|
818
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2, height: "100%" }, children: [
|
|
819
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Dashboard" }),
|
|
820
|
+
/* @__PURE__ */ e(
|
|
821
|
+
m,
|
|
822
|
+
{
|
|
823
|
+
toggleButtonList: o,
|
|
824
|
+
viewMode: i,
|
|
825
|
+
onChange: (p) => h(p),
|
|
826
|
+
colorVariant: "primary",
|
|
827
|
+
size: "small",
|
|
828
|
+
orientation: "vertical"
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
832
|
+
"Mode: ",
|
|
833
|
+
i
|
|
834
|
+
] })
|
|
835
|
+
] }) }),
|
|
836
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2, height: "100%" }, children: [
|
|
837
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Explorateur de fichiers" }),
|
|
838
|
+
/* @__PURE__ */ e(
|
|
839
|
+
m,
|
|
840
|
+
{
|
|
841
|
+
toggleButtonList: r,
|
|
842
|
+
viewMode: a,
|
|
843
|
+
onChange: (p) => v(p),
|
|
844
|
+
colorVariant: "secondary",
|
|
845
|
+
size: "medium"
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
849
|
+
"Affichage: ",
|
|
850
|
+
a
|
|
851
|
+
] })
|
|
852
|
+
] }) }),
|
|
853
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 4 }, children: /* @__PURE__ */ t(s, { sx: { p: 2, height: "100%" }, children: [
|
|
854
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Visualisation de données" }),
|
|
855
|
+
/* @__PURE__ */ e(
|
|
856
|
+
m,
|
|
857
|
+
{
|
|
858
|
+
toggleButtonList: c,
|
|
859
|
+
viewMode: g,
|
|
860
|
+
onChange: (p) => b(p),
|
|
861
|
+
colorVariant: "primary",
|
|
862
|
+
size: "large"
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 2 }, children: [
|
|
866
|
+
"Format: ",
|
|
867
|
+
g
|
|
868
|
+
] }),
|
|
869
|
+
/* @__PURE__ */ e(n, { variant: "caption", color: "text.secondary", children: '(Le mode "raw" est temporairement désactivé)' })
|
|
870
|
+
] }) })
|
|
871
|
+
] }),
|
|
872
|
+
/* @__PURE__ */ t(
|
|
873
|
+
s,
|
|
874
|
+
{
|
|
875
|
+
sx: {
|
|
876
|
+
p: 2,
|
|
877
|
+
mt: 3,
|
|
878
|
+
backgroundColor: "info.light",
|
|
879
|
+
color: "info.contrastText"
|
|
880
|
+
},
|
|
881
|
+
children: [
|
|
882
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "📊 Résumé des sélections (tous typés !)" }),
|
|
883
|
+
/* @__PURE__ */ t(n, { variant: "body2", children: [
|
|
884
|
+
"Dashboard: ",
|
|
885
|
+
/* @__PURE__ */ e("strong", { children: i }),
|
|
886
|
+
" | Fichiers:",
|
|
887
|
+
" ",
|
|
888
|
+
/* @__PURE__ */ e("strong", { children: a }),
|
|
889
|
+
" | Données: ",
|
|
890
|
+
/* @__PURE__ */ e("strong", { children: g })
|
|
891
|
+
] })
|
|
892
|
+
]
|
|
893
|
+
}
|
|
894
|
+
),
|
|
895
|
+
/* @__PURE__ */ t(
|
|
896
|
+
s,
|
|
897
|
+
{
|
|
898
|
+
sx: {
|
|
899
|
+
p: 2,
|
|
900
|
+
mt: 2,
|
|
901
|
+
backgroundColor: "warning.light",
|
|
902
|
+
color: "warning.contrastText"
|
|
903
|
+
},
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "🔍 Inspection des types" }),
|
|
906
|
+
/* @__PURE__ */ t(n, { variant: "body2", component: "div", children: [
|
|
907
|
+
/* @__PURE__ */ e("code", { children: "DashboardType:" }),
|
|
908
|
+
" ",
|
|
909
|
+
'"overview" | "detailed" | "analytics"',
|
|
910
|
+
/* @__PURE__ */ e("br", {}),
|
|
911
|
+
/* @__PURE__ */ e("code", { children: "FileType:" }),
|
|
912
|
+
" ",
|
|
913
|
+
'"grid" | "list" | "tree"',
|
|
914
|
+
/* @__PURE__ */ e("br", {}),
|
|
915
|
+
/* @__PURE__ */ e("code", { children: "DataType:" }),
|
|
916
|
+
" ",
|
|
917
|
+
'"chart" | "table" | "raw"'
|
|
918
|
+
] }),
|
|
919
|
+
/* @__PURE__ */ e(n, { variant: "caption", sx: { mt: 1, display: "block" }, children: "Chaque callback reçoit exactement le bon type, aucune configuration supplémentaire requise !" })
|
|
920
|
+
]
|
|
921
|
+
}
|
|
922
|
+
)
|
|
923
|
+
] });
|
|
924
|
+
},
|
|
925
|
+
parameters: {
|
|
926
|
+
controls: { disable: !0 },
|
|
927
|
+
actions: { disable: !0 },
|
|
928
|
+
docs: {
|
|
929
|
+
description: {
|
|
930
|
+
story: "Exemple d'utilisation complexe montrant comment le SwitchView 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."
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}, Z = {
|
|
935
|
+
render: () => {
|
|
936
|
+
const o = {
|
|
937
|
+
CARDS: "cards",
|
|
938
|
+
TABLE: "table",
|
|
939
|
+
LIST: "list"
|
|
940
|
+
}, r = (C, L, D = !1) => ({ value: C, icon: L, disabled: D }), c = [
|
|
941
|
+
r(o.CARDS, /* @__PURE__ */ e(B, {})),
|
|
942
|
+
r(o.TABLE, /* @__PURE__ */ e(f, {})),
|
|
943
|
+
r(o.LIST, /* @__PURE__ */ e(w, {}))
|
|
944
|
+
], i = [
|
|
945
|
+
r("dashboard", /* @__PURE__ */ e(S, {})),
|
|
946
|
+
r("users", /* @__PURE__ */ e(T, {})),
|
|
947
|
+
r("settings", /* @__PURE__ */ e(I, {})),
|
|
948
|
+
r("logs", /* @__PURE__ */ e(w, {}), !0)
|
|
949
|
+
// désactivé
|
|
950
|
+
], [h, a] = u(
|
|
951
|
+
o.CARDS
|
|
952
|
+
), [v, g] = u("dashboard"), b = V((C) => {
|
|
953
|
+
console.log("Vue commune changée:", C), a(C);
|
|
954
|
+
}, []), p = V((C) => {
|
|
955
|
+
console.log("Vue admin changée:", C), g(C);
|
|
956
|
+
}, []);
|
|
957
|
+
return /* @__PURE__ */ t(d, { sx: { p: 2 }, children: [
|
|
958
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "🚀 Bonnes pratiques pour le typage" }),
|
|
959
|
+
/* @__PURE__ */ t(l, { container: !0, spacing: 3, children: [
|
|
960
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
961
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Configuration standard" }),
|
|
962
|
+
/* @__PURE__ */ e(
|
|
963
|
+
n,
|
|
964
|
+
{
|
|
965
|
+
variant: "caption",
|
|
966
|
+
color: "text.secondary",
|
|
967
|
+
display: "block",
|
|
968
|
+
sx: { mb: 2 },
|
|
969
|
+
children: "Utilisation de constantes et factory functions"
|
|
970
|
+
}
|
|
971
|
+
),
|
|
972
|
+
/* @__PURE__ */ e(
|
|
973
|
+
m,
|
|
974
|
+
{
|
|
975
|
+
toggleButtonList: c,
|
|
976
|
+
viewMode: h,
|
|
977
|
+
onChange: b,
|
|
978
|
+
size: "medium"
|
|
979
|
+
}
|
|
980
|
+
),
|
|
981
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
982
|
+
"Sélection: ",
|
|
983
|
+
h
|
|
984
|
+
] })
|
|
985
|
+
] }) }),
|
|
986
|
+
/* @__PURE__ */ e(l, { size: { xs: 12, md: 6 }, children: /* @__PURE__ */ t(s, { sx: { p: 2 }, children: [
|
|
987
|
+
/* @__PURE__ */ e(n, { variant: "subtitle1", gutterBottom: !0, children: "Configuration avancée" }),
|
|
988
|
+
/* @__PURE__ */ e(
|
|
989
|
+
n,
|
|
990
|
+
{
|
|
991
|
+
variant: "caption",
|
|
992
|
+
color: "text.secondary",
|
|
993
|
+
display: "block",
|
|
994
|
+
sx: { mb: 2 },
|
|
995
|
+
children: "Types spécialisés avec bouton désactivé"
|
|
996
|
+
}
|
|
997
|
+
),
|
|
998
|
+
/* @__PURE__ */ e(
|
|
999
|
+
m,
|
|
1000
|
+
{
|
|
1001
|
+
toggleButtonList: i,
|
|
1002
|
+
viewMode: v,
|
|
1003
|
+
onChange: p,
|
|
1004
|
+
colorVariant: "secondary",
|
|
1005
|
+
size: "medium"
|
|
1006
|
+
}
|
|
1007
|
+
),
|
|
1008
|
+
/* @__PURE__ */ t(n, { variant: "body2", sx: { mt: 1 }, children: [
|
|
1009
|
+
"Admin: ",
|
|
1010
|
+
v
|
|
1011
|
+
] })
|
|
1012
|
+
] }) })
|
|
1013
|
+
] }),
|
|
1014
|
+
/* @__PURE__ */ t(s, { sx: { p: 3, mt: 3, backgroundColor: "success.light" }, children: [
|
|
1015
|
+
/* @__PURE__ */ e(n, { variant: "h6", gutterBottom: !0, children: "📚 Code examples - Bonnes pratiques" }),
|
|
1016
|
+
/* @__PURE__ */ t(d, { sx: { mb: 2 }, children: [
|
|
1017
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "1. ✅ Utilisation de constantes réutilisables" }),
|
|
1018
|
+
/* @__PURE__ */ e(s, { sx: { p: 2, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
|
|
1019
|
+
"pre",
|
|
1020
|
+
{
|
|
1021
|
+
style: { margin: 0, fontSize: "0.875rem", overflow: "auto" },
|
|
1022
|
+
children: `const VIEW_MODES = {
|
|
1023
|
+
CARDS: "cards",
|
|
1024
|
+
TABLE: "table",
|
|
1025
|
+
LIST: "list"
|
|
1026
|
+
} as const;
|
|
1027
|
+
|
|
1028
|
+
const buttons = [
|
|
1029
|
+
{ value: VIEW_MODES.CARDS, icon: <Icon /> }
|
|
1030
|
+
] as const;`
|
|
1031
|
+
}
|
|
1032
|
+
) })
|
|
1033
|
+
] }),
|
|
1034
|
+
/* @__PURE__ */ t(d, { sx: { mb: 2 }, children: [
|
|
1035
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "2. ✅ Factory functions pour la réutilisabilité" }),
|
|
1036
|
+
/* @__PURE__ */ e(s, { sx: { p: 2, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
|
|
1037
|
+
"pre",
|
|
1038
|
+
{
|
|
1039
|
+
style: { margin: 0, fontSize: "0.875rem", overflow: "auto" },
|
|
1040
|
+
children: `const createViewButton = <T extends string>(
|
|
1041
|
+
value: T,
|
|
1042
|
+
icon: ReactNode,
|
|
1043
|
+
disabled = false
|
|
1044
|
+
) => ({ value, icon, disabled } as const);
|
|
1045
|
+
|
|
1046
|
+
const buttons = [
|
|
1047
|
+
createViewButton("cards", <CardsIcon />),
|
|
1048
|
+
createViewButton("table", <TableIcon />, true)
|
|
1049
|
+
] as const;`
|
|
1050
|
+
}
|
|
1051
|
+
) })
|
|
1052
|
+
] }),
|
|
1053
|
+
/* @__PURE__ */ t(d, { sx: { mb: 2 }, children: [
|
|
1054
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "3. ✅ Types helper pour éviter la répétition" }),
|
|
1055
|
+
/* @__PURE__ */ e(s, { sx: { p: 2, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
|
|
1056
|
+
"pre",
|
|
1057
|
+
{
|
|
1058
|
+
style: { margin: 0, fontSize: "0.875rem", overflow: "auto" },
|
|
1059
|
+
children: `type ViewType = (typeof buttons)[number]["value"];
|
|
1060
|
+
|
|
1061
|
+
const [view, setView] = useState<ViewType>("cards");
|
|
1062
|
+
|
|
1063
|
+
const handleChange = useCallback((value: ViewType) => {
|
|
1064
|
+
// value est automatiquement typé !
|
|
1065
|
+
setView(value);
|
|
1066
|
+
}, []);`
|
|
1067
|
+
}
|
|
1068
|
+
) })
|
|
1069
|
+
] }),
|
|
1070
|
+
/* @__PURE__ */ t(d, { children: [
|
|
1071
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "4. ✅ Handler avec typage explicite" }),
|
|
1072
|
+
/* @__PURE__ */ e(s, { sx: { p: 2, backgroundColor: "grey.100" }, children: /* @__PURE__ */ e(
|
|
1073
|
+
"pre",
|
|
1074
|
+
{
|
|
1075
|
+
style: { margin: 0, fontSize: "0.875rem", overflow: "auto" },
|
|
1076
|
+
children: `<SwitchView
|
|
1077
|
+
toggleButtonList={buttons}
|
|
1078
|
+
viewMode={view}
|
|
1079
|
+
onChange={handleChange} // ← Pas de type 'any' !
|
|
1080
|
+
/>`
|
|
1081
|
+
}
|
|
1082
|
+
) })
|
|
1083
|
+
] })
|
|
1084
|
+
] }),
|
|
1085
|
+
/* @__PURE__ */ t(
|
|
1086
|
+
s,
|
|
1087
|
+
{
|
|
1088
|
+
sx: {
|
|
1089
|
+
p: 2,
|
|
1090
|
+
mt: 2,
|
|
1091
|
+
backgroundColor: "error.light",
|
|
1092
|
+
color: "error.contrastText"
|
|
1093
|
+
},
|
|
1094
|
+
children: [
|
|
1095
|
+
/* @__PURE__ */ e(n, { variant: "subtitle2", gutterBottom: !0, children: "❌ À éviter" }),
|
|
1096
|
+
/* @__PURE__ */ t(n, { variant: "body2", component: "div", children: [
|
|
1097
|
+
"• Oublier ",
|
|
1098
|
+
/* @__PURE__ */ e("code", { children: "as const" }),
|
|
1099
|
+
" après les tableaux",
|
|
1100
|
+
/* @__PURE__ */ e("br", {}),
|
|
1101
|
+
"• Utiliser des handlers sans typage explicite",
|
|
1102
|
+
/* @__PURE__ */ e("br", {}),
|
|
1103
|
+
"• Définir des valeurs en dur sans constantes",
|
|
1104
|
+
/* @__PURE__ */ e("br", {}),
|
|
1105
|
+
"• Ignorer les warnings TypeScript"
|
|
1106
|
+
] })
|
|
1107
|
+
]
|
|
1108
|
+
}
|
|
1109
|
+
)
|
|
1110
|
+
] });
|
|
1111
|
+
},
|
|
1112
|
+
parameters: {
|
|
1113
|
+
controls: { disable: !0 },
|
|
1114
|
+
actions: { disable: !0 },
|
|
1115
|
+
docs: {
|
|
1116
|
+
description: {
|
|
1117
|
+
story: "Cette story présente les meilleures pratiques pour utiliser le SwitchView avec un typage TypeScript optimal. Elle montre comment structurer votre code pour éviter les types 'any' et maximiser la sécurité de type."
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
export {
|
|
1123
|
+
K as AvecBoutonsDesactives,
|
|
1124
|
+
Z as BonnesPratiques,
|
|
1125
|
+
Y as CasUtilisationComplexe,
|
|
1126
|
+
N as Controlable,
|
|
1127
|
+
j as Default,
|
|
1128
|
+
Q as OptionsEtendues,
|
|
1129
|
+
J as OrientationVerticale,
|
|
1130
|
+
X as Synchronisation,
|
|
1131
|
+
$ as TaillesDifferentes,
|
|
1132
|
+
W as TypageGenerique,
|
|
1133
|
+
_ as VariantesDecouleurs,
|
|
1134
|
+
G as default
|
|
1135
|
+
};
|