@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.
Files changed (254) hide show
  1. package/dist/{Alert-CBW5GoJI.js → Alert-DdmE0EMo.js} +11 -11
  2. package/dist/{Alert-DHG4SpUx.cjs → Alert-p6jIgCWU.cjs} +1 -1
  3. package/dist/{Autocomplete-E2lL4isp.cjs → Autocomplete-CpRv6_iv.cjs} +1 -1
  4. package/dist/{Autocomplete-BY5PBnFO.js → Autocomplete-XmIFWgiQ.js} +14 -14
  5. package/dist/{Backdrop-B8Ka5yhn.cjs → Backdrop-0xfsnuri.cjs} +1 -1
  6. package/dist/{Backdrop-DUGb_yNd.js → Backdrop-BSLhsv85.js} +4 -4
  7. package/dist/{Badge-DqMmgJeU.js → Badge-D9BY47ln.js} +5 -5
  8. package/dist/{Badge-CFFO4PIE.cjs → Badge-Dpxa8BPA.cjs} +1 -1
  9. package/dist/{Box-o7Tjjyko.js → Box-DjbKEblU.js} +3 -3
  10. package/dist/{Box-DYD6q-6M.cjs → Box-xgRKDOV1.cjs} +1 -1
  11. package/dist/{Button-D974vesA.js → Button-WTdCmXYm.js} +6 -6
  12. package/dist/{Button-y1LmxqGA.cjs → Button-qSgmSSw2.cjs} +1 -1
  13. package/dist/{ButtonBase-Chb99sDQ.js → ButtonBase-Cog6rzwh.js} +3 -3
  14. package/dist/{ButtonBase-Cteo-mSC.cjs → ButtonBase-CsJxPLAx.cjs} +1 -1
  15. package/dist/{CardContent-DfNASczU.cjs → CardContent-BTTU3lDd.cjs} +1 -1
  16. package/dist/{CardContent-BiCWtbyk.js → CardContent-rIQGzMEo.js} +3 -3
  17. package/dist/{Checkbox-TS65wodp.js → Checkbox-DUMc8-SB.js} +8 -8
  18. package/dist/{Checkbox-l0TyVwps.cjs → Checkbox-jecO0f9-.cjs} +1 -1
  19. package/dist/{Chip-Bpcd3tnL.cjs → Chip-CkonlDiW.cjs} +1 -1
  20. package/dist/{Chip-CPR3r42q.js → Chip-DUN-Fb_U.js} +6 -6
  21. package/dist/{CircularProgress-Wqx0-T36.cjs → CircularProgress-Bvcr-mus.cjs} +1 -1
  22. package/dist/{CircularProgress-DVKNRMKq.js → CircularProgress-DnqwyXnx.js} +4 -4
  23. package/dist/{Close-m-MX3rFn.js → Close-BD-KPNgj.js} +1 -1
  24. package/dist/{Close-DyRqry3p.cjs → Close-BFNngmx-.cjs} +1 -1
  25. package/dist/{CloseRounded-CjjQdrNy.js → CloseRounded-BvDxY6j7.js} +1 -1
  26. package/dist/{CloseRounded-Bpxbxvyb.cjs → CloseRounded-e-a3RxlE.cjs} +1 -1
  27. package/dist/{CustomTreeItem-DQSQGINJ.cjs → CustomTreeItem-Bo6LVL2g.cjs} +1 -1
  28. package/dist/{CustomTreeItem-DhYdedkD.js → CustomTreeItem-D-Fd2rf4.js} +11 -11
  29. package/dist/{DatePicker-CwDmetzW.js → DatePicker-CTAJnIvu.js} +29 -29
  30. package/dist/{DatePicker-BBFC1Zoi.cjs → DatePicker-DDYXqvgA.cjs} +1 -1
  31. package/dist/{DefaultPropsProvider-hFv1J_xl.js → DefaultPropsProvider-CRQ3Gr22.js} +21 -19
  32. package/dist/DefaultPropsProvider-CsTuCVNC.cjs +1 -0
  33. package/dist/{Delete-9fJbdRit.js → Delete-Cy45hwCy.js} +1 -1
  34. package/dist/{Delete-CEX2hq0f.cjs → Delete-fIZ9JoWy.cjs} +1 -1
  35. package/dist/{Dialog-CdrDjE9Y.cjs → Dialog-ByiFxqo3.cjs} +1 -1
  36. package/dist/{Dialog-i7-wUv6w.js → Dialog-sYVRMluM.js} +9 -9
  37. package/dist/{DialogContent-BbCu_OEw.cjs → DialogContent-0WzVi_CB.cjs} +1 -1
  38. package/dist/{DialogContent-B41jvlMn.js → DialogContent-Bnuj13Sv.js} +3 -3
  39. package/dist/{DialogTitle-DRNVW7R2.js → DialogTitle-BT0ckfTq.js} +5 -5
  40. package/dist/{DialogTitle-CjrNCn9F.cjs → DialogTitle-Dq5hCek2.cjs} +1 -1
  41. package/dist/{Divider-CJwnMdVg.js → Divider-Bsr4YOx4.js} +4 -4
  42. package/dist/{Divider-Cshcr5kR.cjs → Divider-DPIWZuaX.cjs} +1 -1
  43. package/dist/{Folder-7plrMkOp.cjs → Folder-BvPvb5St.cjs} +1 -1
  44. package/dist/{Folder-CutUz0bW.js → Folder-cn5kD2Zm.js} +1 -1
  45. package/dist/{FormLabel-0LbNeQQU.cjs → FormLabel-BPReGp6x.cjs} +1 -1
  46. package/dist/{FormLabel-DSi2pGSZ.js → FormLabel-C_NeUysJ.js} +4 -4
  47. package/dist/Grid-CpuW2Xrl.js +419 -0
  48. package/dist/Grid-D0L0VF_j.cjs +2 -0
  49. package/dist/{Grow-aEgTOewU.cjs → Grow-CxV2Td_c.cjs} +1 -1
  50. package/dist/{Grow-FFFqe81C.js → Grow-DrWDr0WD.js} +1 -1
  51. package/dist/{IconButton-BKwDNYJl.cjs → IconButton-BzvVYvTv.cjs} +1 -1
  52. package/dist/{IconButton-CgwURB2g.js → IconButton-ZOYYBKrY.js} +6 -6
  53. package/dist/{InputAdornment-C7e-kyf7.cjs → InputAdornment-CiGypDyN.cjs} +1 -1
  54. package/dist/{InputAdornment-DgWvMLgR.js → InputAdornment-mPJEEW62.js} +5 -5
  55. package/dist/{InputBase-pYQWRFK2.cjs → InputBase-D7cWCjsM.cjs} +1 -1
  56. package/dist/{InputBase-DxLqRpcl.js → InputBase-wf6Sq2-d.js} +6 -6
  57. package/dist/{Link-DUtuCYMx.cjs → Link-6MI2s97g.cjs} +1 -1
  58. package/dist/{Link-rb-SwfiY.js → Link-CPIGW37d.js} +6 -6
  59. package/dist/{List-BjfdkeEI.js → List-4Tnjo8WV.js} +2 -2
  60. package/dist/{List-BH_S4Hqm.cjs → List-DNAAO5Md.cjs} +1 -1
  61. package/dist/{ListItem-B0EiObKw.js → ListItem-CeosJHtu.js} +4 -4
  62. package/dist/{ListItem-D33t-hkx.cjs → ListItem-DNNO5emo.cjs} +1 -1
  63. package/dist/ListItemText-BlTklQGT.js +441 -0
  64. package/dist/ListItemText-DTJBvetJ.cjs +1 -0
  65. package/dist/{Menu-B5k8imF-.cjs → Menu-BD7yr5c5.cjs} +1 -1
  66. package/dist/{Menu-BBziZ0k7.js → Menu-CtyhzSeU.js} +11 -11
  67. package/dist/{MenuItem-Cz_x60jl.cjs → MenuItem-BnxRQgzx.cjs} +1 -1
  68. package/dist/{MenuItem-B1FTx8Uo.js → MenuItem-Cpp55CvO.js} +8 -8
  69. package/dist/{Modal-DheFVbb9.cjs → Modal-Dpz2n_rl.cjs} +1 -1
  70. package/dist/{Modal-GbNoYWDt.js → Modal-WaX5c2ks.js} +8 -8
  71. package/dist/{MoreVert-DC6HBf1h.cjs → MoreVert-B37dOc0h.cjs} +1 -1
  72. package/dist/{MoreVert-DJ8sAY3o.js → MoreVert-DcA_LRP8.js} +1 -1
  73. package/dist/{Paper-DWhwBCNx.cjs → Paper-Dy4nClba.cjs} +1 -1
  74. package/dist/{Paper-fiQZbcci.js → Paper-yeP8q4RO.js} +4 -4
  75. package/dist/{Popper-Bzo9-6GK.cjs → Popper-Dx7Ddmig.cjs} +1 -1
  76. package/dist/{Popper-CpecBTnq.js → Popper-IzGPRFl_.js} +5 -5
  77. package/dist/{Portal-ChC9wmMZ.js → Portal-DTB-35pe.js} +1 -1
  78. package/dist/{Radio-CcP--hXF.js → Radio-DQq7Mj29.js} +8 -8
  79. package/dist/{Radio-DyOcq-qZ.cjs → Radio-TCZTDRDq.cjs} +1 -1
  80. package/dist/{RadioGroup-CfxZyChX.cjs → RadioGroup-BlhT0LTh.cjs} +1 -1
  81. package/dist/{RadioGroup-CYy8kuyP.js → RadioGroup-D-KO9Ylf.js} +3 -3
  82. package/dist/{Select-B7uzsMmD.js → Select-CHo4cwj1.js} +8 -8
  83. package/dist/{Select-C1DzOJfC.cjs → Select-YiRsvCtO.cjs} +1 -1
  84. package/dist/{Stack-CMUWQxQn.js → Stack-B_iq0mhq.js} +5 -5
  85. package/dist/{Stack-BVWbOqY_.cjs → Stack-CiqSL-ss.cjs} +1 -1
  86. package/dist/{Stepper-Dk1iWstN.cjs → Stepper-Bp48LpKw.cjs} +1 -1
  87. package/dist/{Stepper-DOTvtRRL.js → Stepper-Co2LRzY9.js} +7 -7
  88. package/dist/{Switch-CFOFmdXw.js → Switch-B0HwIwIM.js} +6 -6
  89. package/dist/{Switch-Bsi_5s-3.cjs → Switch-CmP4YhdJ.cjs} +1 -1
  90. package/dist/{SwitchBase-BAC5BgOW.cjs → SwitchBase-D-Pz73oW.cjs} +1 -1
  91. package/dist/{SwitchBase-BznD_7MN.js → SwitchBase-DrxqSNew.js} +5 -5
  92. package/dist/{Tab-zTI8Z8pR.cjs → Tab-DaJQbLHr.cjs} +1 -1
  93. package/dist/{Tab-DXSeiuQu.js → Tab-fionqt7a.js} +11 -11
  94. package/dist/{TextField-C8gcAU1R.cjs → TextField-BD5v4wWW.cjs} +1 -1
  95. package/dist/{TextField-EWjMXgtu.js → TextField-CbcJBZMa.js} +7 -7
  96. package/dist/{ToggleButtonGroup-C0m6y9pL.js → ToggleButtonGroup-C2VnPpq_.js} +1728 -1474
  97. package/dist/{ToggleButtonGroup-Cy8vvvij.cjs → ToggleButtonGroup-cWPBztiH.cjs} +39 -39
  98. package/dist/{Tooltip-DXI1DHeO.cjs → Tooltip-B-G3ZA40.cjs} +1 -1
  99. package/dist/{Tooltip-Cl2Ew6vp.js → Tooltip-KsV9NFU9.js} +9 -9
  100. package/dist/{Typography-De-21leI.cjs → Typography-CTc5xI5k.cjs} +1 -1
  101. package/dist/{Typography-DwMlN0K5.js → Typography-CYUXO-Vm.js} +5 -5
  102. package/dist/{capitalize-BHFotl9B.js → capitalize-3mO2QYxZ.js} +1 -1
  103. package/dist/{capitalize-CKLkSyDO.cjs → capitalize-jkeaHv-a.cjs} +1 -1
  104. package/dist/components/Alert/Alert.cjs.js +1 -1
  105. package/dist/components/Alert/Alert.es.js +3 -3
  106. package/dist/components/Alert/index.cjs.js +1 -1
  107. package/dist/components/Alert/index.es.js +1 -1
  108. package/dist/components/Button/Button.cjs.js +1 -1
  109. package/dist/components/Button/Button.es.js +2 -2
  110. package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
  111. package/dist/components/DatePicker/DatePicker.es.js +1 -1
  112. package/dist/components/DatePicker/index.cjs.js +1 -1
  113. package/dist/components/DatePicker/index.es.js +1 -1
  114. package/dist/components/Dialog/Dialog.cjs.js +1 -1
  115. package/dist/components/Dialog/Dialog.es.js +2 -2
  116. package/dist/components/Dropzone/Dropzone.cjs.js +1 -1
  117. package/dist/components/Dropzone/Dropzone.es.js +3 -3
  118. package/dist/components/EmptyState/EmptyState.cjs.js +1 -1
  119. package/dist/components/EmptyState/EmptyState.es.js +3 -3
  120. package/dist/components/FileList/FileIcon.cjs.js +1 -1
  121. package/dist/components/FileList/FileIcon.es.js +1 -1
  122. package/dist/components/FileList/FileListItem.cjs.js +1 -1
  123. package/dist/components/FileList/FileListItem.es.js +4 -4
  124. package/dist/components/FolderCard/FolderCard.cjs.js +1 -1
  125. package/dist/components/FolderCard/FolderCard.es.js +2 -2
  126. package/dist/components/Heading/Heading.cjs.js +1 -1
  127. package/dist/components/Heading/Heading.es.js +2 -2
  128. package/dist/components/ImagePicker/ImagePicker.cjs.js +1 -1
  129. package/dist/components/ImagePicker/ImagePicker.es.js +4 -4
  130. package/dist/components/Loader/Loader.cjs.js +1 -1
  131. package/dist/components/Loader/Loader.es.js +1 -1
  132. package/dist/components/LoaderBackdrop/LoaderBackdrop.cjs.js +1 -1
  133. package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
  134. package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
  135. package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
  136. package/dist/components/ResourceCard/ResourceCard.cjs.js +1 -1
  137. package/dist/components/ResourceCard/ResourceCard.es.js +1 -1
  138. package/dist/components/SearchInput/SearchInput.cjs.js +1 -1
  139. package/dist/components/SearchInput/SearchInput.es.js +4 -4
  140. package/dist/components/SwitchView/SwitchView.cjs.js +1 -0
  141. package/dist/components/SwitchView/SwitchView.d.ts +3 -0
  142. package/dist/components/SwitchView/SwitchView.es.js +35 -0
  143. package/dist/components/SwitchView/index.cjs.js +1 -0
  144. package/dist/components/SwitchView/index.d.ts +2 -0
  145. package/dist/components/SwitchView/index.es.js +4 -0
  146. package/dist/components/SwitchView/style.cjs.js +1 -0
  147. package/dist/components/SwitchView/style.es.js +29 -0
  148. package/dist/components/SwitchView/types.cjs.js +1 -0
  149. package/dist/components/SwitchView/types.d.ts +21 -0
  150. package/dist/components/SwitchView/types.es.js +1 -0
  151. package/dist/components/TreeView/TreeView.cjs.js +1 -1
  152. package/dist/components/TreeView/TreeView.es.js +8 -8
  153. package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -1
  154. package/dist/components/TreeView/components/CustomTreeItem.es.js +2 -2
  155. package/dist/components/TreeView/utils.cjs.js +1 -1
  156. package/dist/components/TreeView/utils.es.js +3 -3
  157. package/dist/components/index.cjs.js +1 -1
  158. package/dist/components/index.d.ts +3 -0
  159. package/dist/components/index.es.js +407 -401
  160. package/dist/components/stories/Alert.stories.cjs.js +1 -1
  161. package/dist/components/stories/Alert.stories.es.js +1 -1
  162. package/dist/components/stories/Autocomplete.stories.cjs.js +1 -1
  163. package/dist/components/stories/Autocomplete.stories.es.js +2 -2
  164. package/dist/components/stories/Badge.stories.cjs.js +1 -1
  165. package/dist/components/stories/Badge.stories.es.js +2 -2
  166. package/dist/components/stories/Button.stories.cjs.js +1 -1
  167. package/dist/components/stories/Button.stories.es.js +1 -1
  168. package/dist/components/stories/Card.stories.cjs.js +1 -1
  169. package/dist/components/stories/Card.stories.es.js +2 -2
  170. package/dist/components/stories/Checkbox.stories.cjs.js +1 -1
  171. package/dist/components/stories/Checkbox.stories.es.js +1 -1
  172. package/dist/components/stories/Chip.stories.cjs.js +1 -1
  173. package/dist/components/stories/Chip.stories.es.js +1 -1
  174. package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
  175. package/dist/components/stories/DatePicker.stories.es.js +1 -1
  176. package/dist/components/stories/Dialog.stories.cjs.js +1 -1
  177. package/dist/components/stories/Dialog.stories.es.js +2 -2
  178. package/dist/components/stories/Divider.stories.cjs.js +1 -1
  179. package/dist/components/stories/Divider.stories.es.js +1 -1
  180. package/dist/components/stories/FormControlLabel.stories.cjs.js +1 -1
  181. package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
  182. package/dist/components/stories/Heading.stories.cjs.js +1 -1
  183. package/dist/components/stories/Heading.stories.es.js +2 -2
  184. package/dist/components/stories/IconButton.stories.cjs.js +1 -1
  185. package/dist/components/stories/IconButton.stories.es.js +2 -2
  186. package/dist/components/stories/Link.stories.cjs.js +1 -1
  187. package/dist/components/stories/Link.stories.es.js +1 -1
  188. package/dist/components/stories/Menu.stories.cjs.js +1 -1
  189. package/dist/components/stories/Menu.stories.es.js +2 -2
  190. package/dist/components/stories/Paper.stories.cjs.js +1 -1
  191. package/dist/components/stories/Paper.stories.es.js +1 -1
  192. package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
  193. package/dist/components/stories/RadioGroup.stories.es.js +3 -3
  194. package/dist/components/stories/ResourceCard.stories.cjs.js +1 -1
  195. package/dist/components/stories/ResourceCard.stories.es.js +1 -1
  196. package/dist/components/stories/Select.stories.cjs.js +1 -1
  197. package/dist/components/stories/Select.stories.es.js +3 -3
  198. package/dist/components/stories/Stepper.stories.cjs.js +1 -1
  199. package/dist/components/stories/Stepper.stories.es.js +4 -4
  200. package/dist/components/stories/SwitchView.stories.cjs.js +143 -0
  201. package/dist/components/stories/SwitchView.stories.d.ts +16 -0
  202. package/dist/components/stories/SwitchView.stories.es.js +1135 -0
  203. package/dist/components/stories/TabList.stories.cjs.js +1 -1
  204. package/dist/components/stories/TabList.stories.es.js +1 -1
  205. package/dist/components/stories/TextField.stories.cjs.js +1 -1
  206. package/dist/components/stories/TextField.stories.es.js +1 -1
  207. package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
  208. package/dist/components/stories/Tooltip.stories.es.js +2 -2
  209. package/dist/components/stories/TreeView.stories.cjs.js +3 -3
  210. package/dist/components/stories/TreeView.stories.es.js +38 -37
  211. package/dist/components/stories/Typography.stories.cjs.js +1 -1
  212. package/dist/components/stories/Typography.stories.es.js +1 -1
  213. package/dist/{composeClasses-CWgX5SFD.cjs → composeClasses-6Jh42fnW.cjs} +1 -1
  214. package/dist/{composeClasses-CJKlIaRn.js → composeClasses-PwLhKFRx.js} +1 -1
  215. package/dist/{createSvgIcon-BlKmtOkV.js → createSvgIcon-BWru5SCV.js} +4 -4
  216. package/dist/{createSvgIcon-BgBODH2F.cjs → createSvgIcon-r-LuM8rr.cjs} +1 -1
  217. package/dist/{dividerClasses-Glz8RJdF.js → dividerClasses-Brli9oB2.js} +1 -1
  218. package/dist/{dividerClasses-D3gnW6kZ.cjs → dividerClasses-MIs6pQ1h.cjs} +1 -1
  219. package/dist/{extendSxProp-BouzOuB6.js → extendSxProp-DPYS2LeU.js} +1 -1
  220. package/dist/{extendSxProp-Cm-DtZe3.cjs → extendSxProp-DjoHuUqk.cjs} +1 -1
  221. package/dist/{generateUtilityClasses-DngCqveO.js → generateUtilityClasses-BbL5PyhJ.js} +1 -1
  222. package/dist/{generateUtilityClasses-CMlilM6r.cjs → generateUtilityClasses-CEM-EnA0.cjs} +1 -1
  223. package/dist/{index-l8yqod25.js → index-Blgqpey-.js} +4 -4
  224. package/dist/{index-BzsuDIEl.cjs → index-dnUj5rrV.cjs} +1 -1
  225. package/dist/index.cjs.js +1 -1
  226. package/dist/index.es.js +407 -401
  227. package/dist/{listItemTextClasses-BJFgw1ah.cjs → listItemTextClasses-BbeGMaIS.cjs} +1 -1
  228. package/dist/{listItemTextClasses-BRj19IXv.js → listItemTextClasses-x9hDn3Oc.js} +1 -1
  229. package/dist/{memoTheme-BAbn60Cb.cjs → memoTheme-BvyhrtrO.cjs} +1 -1
  230. package/dist/{memoTheme-nmt7i1dS.js → memoTheme-C2ZnVSVg.js} +1 -1
  231. package/dist/{mergeSlotProps-BBciKnr4.js → mergeSlotProps-Cy3pJiFs.js} +1 -1
  232. package/dist/{mergeSlotProps-Z5-o9vSe.cjs → mergeSlotProps-DTB2qS-_.cjs} +1 -1
  233. package/dist/{resolveComponentProps-DWSW1fip.cjs → resolveComponentProps-CUWj-pue.cjs} +1 -1
  234. package/dist/{resolveComponentProps-GCsHjsGW.js → resolveComponentProps-DBhzJW60.js} +1 -1
  235. package/dist/{useEventCallback-Yoj9nCug.js → useEventCallback-Y2KwRxBw.js} +2 -2
  236. package/dist/{useSlot-DhqI4pZ8.cjs → useSlot-CVpYSDNX.cjs} +1 -1
  237. package/dist/{useSlot-WWh43uDP.js → useSlot-PbukIIii.js} +1 -1
  238. package/dist/{useSlotProps-CSfMm_AK.js → useSlotProps-Bvolo5qn.js} +1 -1
  239. package/dist/{useSlotProps-CrmlYV9C.cjs → useSlotProps-DOS62OUK.cjs} +1 -1
  240. package/dist/useTheme-B0omzE6M.js +11 -0
  241. package/dist/{useTheme-CqYtLDbs.cjs → useTheme-CwVFTV8w.cjs} +1 -1
  242. package/dist/{useTheme-D9cVynB-.js → useTheme-DlWqSSQs.js} +1 -1
  243. package/dist/{useTheme-ClhInrO2.cjs → useTheme-zxjGe7nF.cjs} +1 -1
  244. package/dist/useThemeProps-Bel8apgw.js +17 -0
  245. package/dist/{useThemeProps-DQOn-ezC.cjs → useThemeProps-Bf2NCpA_.cjs} +1 -1
  246. package/dist/useThemeProps-C4zuxIb5.cjs +1 -0
  247. package/dist/{useThemeProps-ggw56DH-.js → useThemeProps-CHx0N1SM.js} +2 -2
  248. package/package.json +1 -1
  249. package/dist/DefaultPropsProvider-B1crdkTC.cjs +0 -1
  250. package/dist/ListItemText-C4HujomF.cjs +0 -2
  251. package/dist/ListItemText-CpNLkk9h.js +0 -853
  252. package/dist/useTheme-C59wIJ3-.js +0 -11
  253. package/dist/useThemeProps-BFQ8ndnj.js +0 -17
  254. package/dist/useThemeProps-DYpozGhe.cjs +0 -1
@@ -0,0 +1,143 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),T=require("../../createSvgIcon-r-LuM8rr.cjs"),a=require("react"),u=require("../SwitchView/SwitchView.cjs.js"),d=require("../../Box-xgRKDOV1.cjs"),t=require("../../Typography-CTc5xI5k.cjs"),l=require("../../Grid-D0L0VF_j.cjs"),y=require("../../Button-qSgmSSw2.cjs"),o=require("../../Paper-Dy4nClba.cjs"),S=T.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"),f=T.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"),j=T.createSvgIcon(e.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),b=T.createSvgIcon(e.jsx("path",{d:"M21 8H3V4h18zm0 2H3v4h18zm0 6H3v4h18z"}),"TableRows"),B=T.createSvgIcon(e.jsx("path",{d:"M2 4v7h20V4zm8 16h12v-7H10zm-8 0h6v-7H2z"}),"ViewComfy"),w=T.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/SwitchView",component:u,argTypes:{toggleButtonList:{description:"**[Requis]** Liste des boutons à afficher dans le SwitchView.",control:"object",table:{required:!0,type:{summary:"readonly ToggleButtonItem[]"}}},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
+ ## SwitchView
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 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 !
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
+ <SwitchView
33
+ toggleButtonList={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 \`ToggleButtonItem\` typé de manière générique :
64
+
65
+ \`\`\`typescript
66
+ interface ToggleButtonItem<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 ToggleButtonItem<string>[]> = {
74
+ toggleButtonList: 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
+ `}}}},v=[{value:"cards",icon:e.jsx(w,{})},{value:"table",icon:e.jsx(b,{})},{value:"list",icon:e.jsx(j,{})}],C=[{value:"grid",icon:e.jsx(f,{})},{value:"cards",icon:e.jsx(B,{})},{value:"table",icon:e.jsx(b,{})},{value:"list",icon:e.jsx(j,{})},{value:"calendar",icon:e.jsx(S,{})}],q=[{value:"cards",icon:e.jsx(w,{})},{value:"table",icon:e.jsx(b,{}),disabled:!0},{value:"list",icon:e.jsx(j,{})}],P={render:()=>{const[n,i]=a.useState("cards"),c=a.useCallback(s=>{console.log(`Vue sélectionnée: ${s}`),i(s)},[]);return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Sélecteur de vue standard"}),e.jsx(u,{toggleButtonList:v,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."}}}},D={render:()=>{const[n,i]=a.useState("table"),[c,s]=a.useState("primary"),[h,r]=a.useState("small"),[x,m]=a.useState("horizontal");return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Personnalisation en temps réel"}),e.jsxs(l.Grid,{container:!0,spacing:2,sx:{mb:3},children:[e.jsxs(l.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Couleur"}),e.jsxs(d.Box,{sx:{display:"flex",gap:1},children:[e.jsx(y.Button,{size:"small",variant:c==="primary"?"contained":"outlined",onClick:()=>s("primary"),children:"Primary"}),e.jsx(y.Button,{size:"small",variant:c==="secondary"?"contained":"outlined",onClick:()=>s("secondary"),children:"Secondary"})]})]}),e.jsxs(l.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Taille"}),e.jsx(d.Box,{sx:{display:"flex",gap:1},children:["small","medium","large"].map(g=>e.jsx(y.Button,{size:"small",variant:h===g?"contained":"outlined",onClick:()=>r(g),children:g},g))})]}),e.jsxs(l.Grid,{size:{xs:12,sm:6,md:3},children:[e.jsx(t.Typography,{variant:"subtitle2",gutterBottom:!0,children:"Orientation"}),e.jsxs(d.Box,{sx:{display:"flex",gap:1},children:[e.jsx(y.Button,{size:"small",variant:x==="horizontal"?"contained":"outlined",onClick:()=>m("horizontal"),children:"Horizontal"}),e.jsx(y.Button,{size:"small",variant:x==="vertical"?"contained":"outlined",onClick:()=>m("vertical"),children:"Vertical"})]})]}),e.jsxs(l.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(u,{toggleButtonList:v,viewMode:n,onChange:g=>{console.log(`Vue sélectionnée: ${g}`),i(g)},colorVariant:c,size:h,orientation:x})})]})},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(w,{})},{value:"off",icon:e.jsx(b,{})}],i=[{value:"active",icon:e.jsx(B,{})},{value:"inactive",icon:e.jsx(j,{})},{value:"pending",icon:e.jsx(f,{})}],c=[{value:"edit",icon:e.jsx(w,{})},{value:"view",icon:e.jsx(b,{})},{value:"preview",icon:e.jsx(j,{})}],[s,h]=a.useState("on"),[r,x]=a.useState("active"),[m,g]=a.useState("edit");return e.jsxs(d.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(l.Grid,{container:!0,spacing:3,children:[e.jsx(l.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(u,{toggleButtonList:n,viewMode:s,onChange:p=>{console.log("Simple:",p),h(p)}}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["État: ",s]})]})}),e.jsx(l.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(u,{toggleButtonList:i,viewMode:r,onChange:p=>{console.log("Status:",p),x(p)},colorVariant:"secondary"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Statut: ",r]})]})}),e.jsx(l.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(u,{toggleButtonList:c,viewMode:m,onChange:p=>{console.log("Mode:",p),g(p)},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"],[i,c]=a.useState({primary:"cards",secondary:"table"});return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Comparaison des variantes de couleurs"}),e.jsx(l.Grid,{container:!0,spacing:3,children:n.map(s=>e.jsx(l.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(u,{toggleButtonList:v,viewMode:i[s],onChange:h=>{c(r=>({...r,[s]:h}))},colorVariant:s}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélectionné: ",i[s]]})]})},s))})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{story:"Démonstration des deux variantes de couleurs disponibles : primary et secondary."}}}},G={render:()=>{const n=["small","medium","large"],[i,c]=a.useState({small:"cards",medium:"table",large:"list"});return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Comparaison des tailles"}),e.jsx(l.Grid,{container:!0,spacing:3,children:n.map(s=>e.jsx(l.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(u,{toggleButtonList:v,viewMode:i[s],onChange:h=>{c(r=>({...r,[s]:h}))},size:s}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélectionné: ",i[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,i]=a.useState("grid"),c=a.useCallback(s=>{i(s)},[]);return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Orientation verticale"}),e.jsxs(l.Grid,{container:!0,spacing:3,children:[e.jsx(l.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(u,{toggleButtonList:C,viewMode:n,onChange:c,orientation:"vertical",size:"medium"})]})}),e.jsx(l.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(u,{toggleButtonList:C,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."}}}},E={render:()=>{const[n,i]=a.useState("cards"),c=a.useCallback(s=>{i(s)},[]);return e.jsxs(d.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(u,{toggleButtonList: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(d.Box,{sx:{mt:2},children:[e.jsx(y.Button,{variant:"outlined",size:"small",onClick:()=>i("list"),sx:{mr:1},children:"Sélectionner Liste"}),e.jsx(y.Button,{variant:"outlined",size:"small",onClick:()=>i("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."}}}},A={render:()=>{const[n,i]=a.useState("grid"),c=a.useCallback(s=>{i(s)},[]);return e.jsxs(d.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(u,{toggleButtonList:C,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 SwitchView 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."}}}},O={render:()=>{const[n,i]=a.useState("cards"),c=a.useCallback(r=>{console.log("Changement de vue:",r),i(r)},[]),s=a.useCallback(r=>{console.log("Changement externe:",r),i(r)},[]),h=()=>{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(d.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:h()}),e.jsxs(l.Grid,{container:!0,spacing:3,children:[e.jsx(l.Grid,{size:{xs:12,md:6},children:e.jsxs(o.Paper,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,children:"SwitchView Principal"}),e.jsx(u,{toggleButtonList:v,viewMode:n,onChange:c,size:"medium"})]})}),e.jsx(l.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(d.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:v.map(r=>e.jsxs(y.Button,{variant:n===r.value?"contained":"outlined",onClick:()=>s(r.value),size:"small",startIcon:r.icon,children:["Mode ",r.value]},r.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(y.Button,{variant:"text",size:"small",onClick:()=>{const r=["cards","table","list"],x=r[Math.floor(Math.random()*r.length)];s(x)},sx:{mr:1},children:"Vue aléatoire"}),e.jsx(y.Button,{variant:"text",size:"small",onClick:()=>{const x=(v.findIndex(m=>m.value===n)+1)%v.length;s(v[x].value)},children:"Vue suivante"})]})]})},parameters:{controls:{disable:!0},actions:{disable:!0},docs:{description:{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."}}}},H={render:()=>{const n=[{value:"overview",icon:e.jsx(B,{})},{value:"detailed",icon:e.jsx(b,{})},{value:"analytics",icon:e.jsx(f,{})}],i=[{value:"grid",icon:e.jsx(f,{})},{value:"list",icon:e.jsx(j,{})},{value:"tree",icon:e.jsx(w,{})}],c=[{value:"chart",icon:e.jsx(S,{})},{value:"table",icon:e.jsx(b,{})},{value:"raw",icon:e.jsx(j,{}),disabled:!0}],[s,h]=a.useState("overview"),[r,x]=a.useState("grid"),[m,g]=a.useState("chart");return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"Cas d'utilisation dans une interface complexe"}),e.jsxs(l.Grid,{container:!0,spacing:3,children:[e.jsx(l.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(u,{toggleButtonList:n,viewMode:s,onChange:p=>h(p),colorVariant:"primary",size:"small",orientation:"vertical"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Mode: ",s]})]})}),e.jsx(l.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(u,{toggleButtonList:i,viewMode:r,onChange:p=>x(p),colorVariant:"secondary",size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:2},children:["Affichage: ",r]})]})}),e.jsx(l.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(u,{toggleButtonList:c,viewMode:m,onChange:p=>g(p),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:r})," | 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 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."}}}},U={render:()=>{const n={CARDS:"cards",TABLE:"table",LIST:"list"},i=(V,z,M=!1)=>({value:V,icon:z,disabled:M}),c=[i(n.CARDS,e.jsx(w,{})),i(n.TABLE,e.jsx(b,{})),i(n.LIST,e.jsx(j,{}))],s=[i("dashboard",e.jsx(f,{})),i("users",e.jsx(B,{})),i("settings",e.jsx(S,{})),i("logs",e.jsx(j,{}),!0)],[h,r]=a.useState(n.CARDS),[x,m]=a.useState("dashboard"),g=a.useCallback(V=>{console.log("Vue commune changée:",V),r(V)},[]),p=a.useCallback(V=>{console.log("Vue admin changée:",V),m(V)},[]);return e.jsxs(d.Box,{sx:{p:2},children:[e.jsx(t.Typography,{variant:"h6",gutterBottom:!0,children:"🚀 Bonnes pratiques pour le typage"}),e.jsxs(l.Grid,{container:!0,spacing:3,children:[e.jsx(l.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(u,{toggleButtonList:c,viewMode:h,onChange:g,size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Sélection: ",h]})]})}),e.jsx(l.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(u,{toggleButtonList:s,viewMode:x,onChange:p,colorVariant:"secondary",size:"medium"}),e.jsxs(t.Typography,{variant:"body2",sx:{mt:1},children:["Admin: ",x]})]})})]}),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(d.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 = {
116
+ CARDS: "cards",
117
+ TABLE: "table",
118
+ LIST: "list"
119
+ } as const;
120
+
121
+ const buttons = [
122
+ { value: VIEW_MODES.CARDS, icon: <Icon /> }
123
+ ] as const;`})})]}),e.jsxs(d.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>(
124
+ value: T,
125
+ icon: ReactNode,
126
+ disabled = false
127
+ ) => ({ value, icon, disabled } as const);
128
+
129
+ const buttons = [
130
+ createViewButton("cards", <CardsIcon />),
131
+ createViewButton("table", <TableIcon />, true)
132
+ ] as const;`})})]}),e.jsxs(d.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"];
133
+
134
+ const [view, setView] = useState<ViewType>("cards");
135
+
136
+ const handleChange = useCallback((value: ViewType) => {
137
+ // value est automatiquement typé !
138
+ setView(value);
139
+ }, []);`})})]}),e.jsxs(d.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:`<SwitchView
140
+ toggleButtonList={buttons}
141
+ viewMode={view}
142
+ onChange={handleChange} // ← Pas de type 'any' !
143
+ />`})})]})]}),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 SwitchView 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=E;exports.BonnesPratiques=U;exports.CasUtilisationComplexe=H;exports.Controlable=D;exports.Default=P;exports.OptionsEtendues=A;exports.OrientationVerticale=R;exports.Synchronisation=O;exports.TaillesDifferentes=G;exports.TypageGenerique=L;exports.VariantesDecouleurs=k;exports.default=I;
@@ -0,0 +1,16 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { SwitchView } from '../SwitchView';
3
+ declare const meta: Meta<typeof SwitchView>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SwitchView>;
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 AvecBoutonsDesactives: Story;
13
+ export declare const OptionsEtendues: Story;
14
+ export declare const Synchronisation: Story;
15
+ export declare const CasUtilisationComplexe: Story;
16
+ export declare const BonnesPratiques: Story;