this.gui 1.0.17 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/.storybook/main.js +40 -0
  2. package/.storybook/manager-head.html +13 -0
  3. package/.storybook/manager.js +15 -0
  4. package/.storybook/preview.tsx +54 -0
  5. package/.storybook/vitest.setup.js +6 -0
  6. package/.storybook/withLayout.tsx +18 -0
  7. package/README.md +1 -220
  8. package/dist/GUI.png +0 -0
  9. package/dist/GUI2.png +0 -0
  10. package/dist/favicon.ico +0 -0
  11. package/dist/this-gui.es.js +108493 -4976
  12. package/dist/this-gui.umd.js +239 -44
  13. package/dist/this.GUI.png +0 -0
  14. package/nodes/overall approach.md +93 -0
  15. package/notes/Proyect.md +109 -0
  16. package/package.json +71 -53
  17. package/public/GUI.png +0 -0
  18. package/public/GUI2.png +0 -0
  19. package/public/favicon.ico +0 -0
  20. package/public/this.GUI.png +0 -0
  21. package/src/components/generics/Cards/Gridme.jsx +52 -0
  22. package/src/components/generics/Cards/LilBox.jsx +65 -0
  23. package/src/components/generics/Cards/ModuleCard.jsx +106 -0
  24. package/src/components/generics/Chats/FullChatBot.jsx +223 -0
  25. package/src/components/generics/Code/CodeBlock.jsx +33 -0
  26. package/src/components/generics/Feedback/Callout.jsx +92 -0
  27. package/src/components/generics/Layout/GridX.jsx +29 -0
  28. package/src/components/generics/Layout/Hero2.jsx +132 -0
  29. package/src/components/generics/Layout/PageContainer.jsx +29 -0
  30. package/src/components/generics/Layout/PageDivider.jsx +20 -0
  31. package/src/components/generics/Layout/Section.jsx +43 -0
  32. package/src/components/generics/Layout/SectionHeader.jsx +21 -0
  33. package/src/components/generics/Media/Img.jsx +58 -0
  34. package/src/components/generics/Media/VideoEmbed.jsx +51 -0
  35. package/src/components/generics/Organization/TableOfContents.jsx +51 -0
  36. package/src/components/generics/Organization/Tabs.jsx +45 -0
  37. package/src/components/generics/Text/TextList.jsx +41 -0
  38. package/src/components/generics/Text/TextParagraph.jsx +28 -0
  39. package/src/components/generics/Text/TextQuote.jsx +23 -0
  40. package/src/components/generics/Text/TextTitle.jsx +44 -0
  41. package/src/components/this.me/MeActive.jsx +24 -0
  42. package/src/components/this.me/MeFloating.jsx +183 -0
  43. package/src/components/this.me/MeInactive.jsx +21 -0
  44. package/src/components/this.me/MeListUs.jsx +40 -0
  45. package/src/components/this.me/MeState.jsx +25 -0
  46. package/src/components/this.me/hooks/useMe.js +43 -0
  47. package/src/context/GuiProvider.tsx +243 -0
  48. package/src/gui/atoms/AppBar/AppBar.resolver.tsx +77 -0
  49. package/src/gui/atoms/AppBar/AppBar.stories.tsx +232 -0
  50. package/src/gui/atoms/AppBar/AppBar.tsx +10 -0
  51. package/src/gui/atoms/Box/Box.resolver.tsx +171 -0
  52. package/src/gui/atoms/Box/Box.stories.tsx +271 -0
  53. package/src/gui/atoms/Box/Box.tsx +15 -0
  54. package/src/gui/atoms/Button/Button.resolver.tsx +98 -0
  55. package/src/gui/atoms/Button/Button.stories.tsx +225 -0
  56. package/src/gui/atoms/Button/Button.tsx +40 -0
  57. package/src/gui/atoms/Collapse/Collapse.resolver.tsx +85 -0
  58. package/src/gui/atoms/Collapse/Collapse.stories.tsx +136 -0
  59. package/src/gui/atoms/Collapse/Collapse.tsx +17 -0
  60. package/src/gui/atoms/Divider/Divider.resolver.tsx +95 -0
  61. package/src/gui/atoms/Divider/Divider.stories.tsx +109 -0
  62. package/src/gui/atoms/Divider/Divider.tsx +14 -0
  63. package/src/gui/atoms/Drawer/Drawer.resolver.tsx +116 -0
  64. package/src/gui/atoms/Drawer/Drawer.stories.tsx +229 -0
  65. package/src/gui/atoms/Drawer/Drawer.tsx +8 -0
  66. package/src/gui/atoms/IconButton/IconButton.resolver.tsx +135 -0
  67. package/src/gui/atoms/IconButton/IconButton.stories.tsx +141 -0
  68. package/src/gui/atoms/IconButton/IconButton.tsx +22 -0
  69. package/src/gui/atoms/Link/Link.resolver.tsx +75 -0
  70. package/src/gui/atoms/Link/Link.stories.tsx +164 -0
  71. package/src/gui/atoms/Link/Link.tsx +14 -0
  72. package/src/gui/atoms/List/List.resolver.tsx +95 -0
  73. package/src/gui/atoms/List/List.stories.tsx +143 -0
  74. package/src/gui/atoms/List/List.tsx +20 -0
  75. package/src/gui/atoms/ListItem/ListItem.resolver.tsx +88 -0
  76. package/src/gui/atoms/ListItem/ListItem.stories.tsx +157 -0
  77. package/src/gui/atoms/ListItem/ListItem.tsx +19 -0
  78. package/src/gui/atoms/ListItemButton/ListItemButton.resolver.tsx +208 -0
  79. package/src/gui/atoms/ListItemButton/ListItemButton.stories.tsx +161 -0
  80. package/src/gui/atoms/ListItemButton/ListItemButton.tsx +15 -0
  81. package/src/gui/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
  82. package/src/gui/atoms/ListItemIcon/ListItemIcon.stories.tsx +135 -0
  83. package/src/gui/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
  84. package/src/gui/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
  85. package/src/gui/atoms/ListItemText/ListItemText.stories.tsx +162 -0
  86. package/src/gui/atoms/ListItemText/ListItemText.tsx +15 -0
  87. package/src/gui/atoms/Menu/Menu.resolver.tsx +112 -0
  88. package/src/gui/atoms/Menu/Menu.stories.tsx +168 -0
  89. package/src/gui/atoms/Menu/Menu.tsx +17 -0
  90. package/src/gui/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
  91. package/src/gui/atoms/MenuItem/MenuItem.stories.tsx +138 -0
  92. package/src/gui/atoms/MenuItem/MenuItem.tsx +14 -0
  93. package/src/gui/atoms/Paper/Paper.resolver.tsx +98 -0
  94. package/src/gui/atoms/Paper/Paper.stories.tsx +191 -0
  95. package/src/gui/atoms/Paper/Paper.tsx +17 -0
  96. package/src/gui/atoms/Stack/Stack.resolver.tsx +94 -0
  97. package/src/gui/atoms/Stack/Stack.stories.tsx +166 -0
  98. package/src/gui/atoms/Stack/Stack.tsx +15 -0
  99. package/src/gui/atoms/Switch/Switch.resolver.tsx +53 -0
  100. package/src/gui/atoms/Switch/Switch.stories.tsx +242 -0
  101. package/src/gui/atoms/Switch/Switch.tsx +22 -0
  102. package/src/gui/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
  103. package/src/gui/atoms/Toolbar/Toolbar.stories.tsx +163 -0
  104. package/src/gui/atoms/Toolbar/Toolbar.tsx +16 -0
  105. package/src/gui/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
  106. package/src/gui/atoms/Tooltip/Tooltip.stories.tsx +118 -0
  107. package/src/gui/atoms/Tooltip/Tooltip.tsx +78 -0
  108. package/src/gui/atoms/Typography/Typography.resolver.tsx +158 -0
  109. package/src/gui/atoms/Typography/Typography.stories.tsx +228 -0
  110. package/src/gui/atoms/Typography/Typography.tsx +27 -0
  111. package/src/gui/atoms.tsx +129 -0
  112. package/src/gui/index.ts +69 -0
  113. package/src/gui/molecules/AppBars/Footer/Footer.resolver.tsx +104 -0
  114. package/src/gui/molecules/AppBars/Footer/Footer.stories.tsx +499 -0
  115. package/src/gui/molecules/AppBars/Footer/Footer.tsx +307 -0
  116. package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.resolver.tsx +75 -0
  117. package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.stories.tsx +61 -0
  118. package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.tsx +511 -0
  119. package/src/gui/molecules/AppBars/LeftSidebar/SidebarToggleButton.tsx +51 -0
  120. package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.resolver.tsx +97 -0
  121. package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.stories.tsx +294 -0
  122. package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.tsx +295 -0
  123. package/src/gui/molecules/AppBars/StickyOptions/StickyOptionsTop.stories.tsx +480 -0
  124. package/src/gui/molecules/AppBars/StickyOptions/StickyOptionsTop.tsx +484 -0
  125. package/src/gui/molecules/AppBars/TopBar/TopBar.resolver.tsx +84 -0
  126. package/src/gui/molecules/AppBars/TopBar/TopBar.stories.tsx +297 -0
  127. package/src/gui/molecules/AppBars/TopBar/TopBar.tsx +299 -0
  128. package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.resolver.tsx +72 -0
  129. package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.stories.tsx +154 -0
  130. package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.tsx +100 -0
  131. package/src/gui/molecules/Utilities/ThemeSelector.jsx +281 -0
  132. package/src/gui/utils/nodeID.ts +8 -0
  133. package/src/index.js +111 -0
  134. package/src/registry/GuiRegistry.ts +19 -0
  135. package/src/registry/factory.ts +12 -0
  136. package/src/registry/index.ts +3 -0
  137. package/src/registry/types.ts +6 -0
  138. package/src/stories/01.Home.mdx +22 -0
  139. package/src/stories/02.Understanding.This.GUI.md +149 -0
  140. package/src/stories/03.Themes.mdx +235 -0
  141. package/src/stories/04.GuiProvider.md +126 -0
  142. package/src/stories/04.GuiProvider.mdx +129 -0
  143. package/src/stories/Theme/BreakPointsAndGrids.stories.jsx +185 -0
  144. package/src/stories/Theme/Colors.stories.jsx +245 -0
  145. package/src/stories/Theme/Icons.stories.jsx +313 -0
  146. package/src/stories/Theme/Motion.stories.jsx +206 -0
  147. package/src/stories/Theme/ShadowAndElevation.stories.jsx +95 -0
  148. package/src/stories/Theme/SpacingAndRadius.stories.jsx +129 -0
  149. package/src/stories/Theme/Typography.stories.jsx +211 -0
  150. package/src/stories/assets/this.GUI.png +0 -0
  151. package/src/templates/BrowserExtension.jsx +56 -0
  152. package/src/templates/Layout.tsx +36 -0
  153. package/src/templates/Minimal.jsx +123 -0
  154. package/src/templates/Shell/Shell.jsx +107 -0
  155. package/src/themes/fromTokens.ts +352 -0
  156. package/src/themes/icons/Icon.tsx +137 -0
  157. package/src/themes/icons/packs/Lucide.ts +72 -0
  158. package/src/themes/icons/packs/Material.ts +87 -0
  159. package/src/themes/icons/registry.tsx +178 -0
  160. package/src/themes/index.js +116 -0
  161. package/src/themes/theme.d.ts +116 -0
  162. package/src/themes/tokens/global.tokens.json +107 -0
  163. package/src/themes/tokens/neurons/dark.tokens.json +45 -0
  164. package/src/themes/tokens/neurons/light.tokens.json +51 -0
  165. package/src/themes/tokens/neurons/manifest.json +23 -0
  166. package/src/types/theme.d.ts +32 -0
  167. package/src/types/viewport.ts +132 -0
  168. package/tsconfig.json +24 -0
  169. package/vite.config.js +74 -0
  170. package/dist/style.css +0 -1
  171. package/src/App.jsx +0 -63
  172. package/src/MdxProvider.jsx +0 -20
  173. package/src/Page.jsx +0 -28
  174. package/src/SiteBuilder.jsx +0 -39
  175. package/src/example.json +0 -43
  176. package/src/index.mdx +0 -164
  177. package/src/main.jsx +0 -15
  178. package/src/scripts/ComponentRegistry.js +0 -70
  179. package/src/scripts/logASCIIArt.js +0 -12
  180. package/src/scripts/postinstall.js +0 -100
  181. package/src/scripts/renderComponents.js +0 -11
  182. package/src/stories/Atoms/Alert/Alert.css +0 -211
  183. package/src/stories/Atoms/Alert/Alert.jsx +0 -56
  184. package/src/stories/Atoms/Alert/Alert.stories.jsx +0 -167
  185. package/src/stories/Atoms/Audio/Audio.css +0 -259
  186. package/src/stories/Atoms/Audio/Audio.jsx +0 -216
  187. package/src/stories/Atoms/Audio/Audio.stories.jsx +0 -191
  188. package/src/stories/Atoms/Badge/Badge.css +0 -249
  189. package/src/stories/Atoms/Badge/Badge.jsx +0 -54
  190. package/src/stories/Atoms/Badge/Badge.stories.jsx +0 -121
  191. package/src/stories/Atoms/Button/Button.css +0 -131
  192. package/src/stories/Atoms/Button/Button.jsx +0 -47
  193. package/src/stories/Atoms/Button/Button.stories.jsx +0 -184
  194. package/src/stories/Atoms/Caption/Caption.css +0 -169
  195. package/src/stories/Atoms/Caption/Caption.jsx +0 -72
  196. package/src/stories/Atoms/Caption/Caption.stories.jsx +0 -207
  197. package/src/stories/Atoms/Checkbox/Checkbox.css +0 -182
  198. package/src/stories/Atoms/Checkbox/Checkbox.jsx +0 -83
  199. package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +0 -112
  200. package/src/stories/Atoms/Container/Container.css +0 -89
  201. package/src/stories/Atoms/Container/Container.jsx +0 -54
  202. package/src/stories/Atoms/Container/Container.stories.jsx +0 -104
  203. package/src/stories/Atoms/Divider/Divider.css +0 -147
  204. package/src/stories/Atoms/Divider/Divider.jsx +0 -62
  205. package/src/stories/Atoms/Divider/Divider.stories.jsx +0 -105
  206. package/src/stories/Atoms/Grid/Grid.css +0 -160
  207. package/src/stories/Atoms/Grid/Grid.jsx +0 -43
  208. package/src/stories/Atoms/Grid/Grid.stories.jsx +0 -84
  209. package/src/stories/Atoms/Heading/Heading.css +0 -112
  210. package/src/stories/Atoms/Heading/Heading.jsx +0 -69
  211. package/src/stories/Atoms/Heading/Heading.stories.jsx +0 -130
  212. package/src/stories/Atoms/Icon/Icon.css +0 -240
  213. package/src/stories/Atoms/Icon/Icon.jsx +0 -80
  214. package/src/stories/Atoms/Icon/Icon.stories.jsx +0 -177
  215. package/src/stories/Atoms/Image/Image.css +0 -245
  216. package/src/stories/Atoms/Image/Image.jsx +0 -175
  217. package/src/stories/Atoms/Image/Image.stories.jsx +0 -332
  218. package/src/stories/Atoms/Label/Label.css +0 -171
  219. package/src/stories/Atoms/Label/Label.jsx +0 -71
  220. package/src/stories/Atoms/Label/Label.stories.jsx +0 -180
  221. package/src/stories/Atoms/Link/Link.css +0 -71
  222. package/src/stories/Atoms/Link/Link.jsx +0 -82
  223. package/src/stories/Atoms/Link/Link.stories.jsx +0 -153
  224. package/src/stories/Atoms/Loader/Loader.css +0 -106
  225. package/src/stories/Atoms/Loader/Loader.jsx +0 -58
  226. package/src/stories/Atoms/Loader/Loader.stories.jsx +0 -99
  227. package/src/stories/Atoms/Logo/Logo.css +0 -94
  228. package/src/stories/Atoms/Logo/Logo.jsx +0 -53
  229. package/src/stories/Atoms/Logo/Logo.stories.jsx +0 -120
  230. package/src/stories/Atoms/Paragraph/Paragraph.css +0 -180
  231. package/src/stories/Atoms/Paragraph/Paragraph.jsx +0 -77
  232. package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +0 -143
  233. package/src/stories/Atoms/ProgressBar/ProgressBar.css +0 -127
  234. package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +0 -40
  235. package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +0 -86
  236. package/src/stories/Atoms/RadioButton/RadioButton.css +0 -130
  237. package/src/stories/Atoms/RadioButton/RadioButton.jsx +0 -87
  238. package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +0 -113
  239. package/src/stories/Atoms/Range/Range.css +0 -169
  240. package/src/stories/Atoms/Range/Range.jsx +0 -87
  241. package/src/stories/Atoms/Range/Range.stories.jsx +0 -110
  242. package/src/stories/Atoms/Section/Section.css +0 -268
  243. package/src/stories/Atoms/Section/Section.jsx +0 -63
  244. package/src/stories/Atoms/Section/Section.stories.jsx +0 -46
  245. package/src/stories/Atoms/Select/Select.css +0 -87
  246. package/src/stories/Atoms/Select/Select.jsx +0 -73
  247. package/src/stories/Atoms/Select/Select.stories.jsx +0 -109
  248. package/src/stories/Atoms/Slider/Slider.css +0 -90
  249. package/src/stories/Atoms/Slider/Slider.jsx +0 -129
  250. package/src/stories/Atoms/Slider/Slider.stories.jsx +0 -90
  251. package/src/stories/Atoms/Snackbar/Snackbar.css +0 -313
  252. package/src/stories/Atoms/Snackbar/Snackbar.jsx +0 -72
  253. package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +0 -78
  254. package/src/stories/Atoms/Spacer/Spacer.css +0 -114
  255. package/src/stories/Atoms/Spacer/Spacer.jsx +0 -35
  256. package/src/stories/Atoms/Spacer/Spacer.stories.jsx +0 -61
  257. package/src/stories/Atoms/Spinner/Spinner.css +0 -110
  258. package/src/stories/Atoms/Spinner/Spinner.jsx +0 -65
  259. package/src/stories/Atoms/Spinner/Spinner.stories.jsx +0 -58
  260. package/src/stories/Atoms/Tag/Tag.css +0 -112
  261. package/src/stories/Atoms/Tag/Tag.jsx +0 -75
  262. package/src/stories/Atoms/Tag/Tag.stories.jsx +0 -67
  263. package/src/stories/Atoms/TextArea/TextArea.css +0 -99
  264. package/src/stories/Atoms/TextArea/TextArea.jsx +0 -118
  265. package/src/stories/Atoms/TextArea/TextArea.stories.jsx +0 -36
  266. package/src/stories/Atoms/TextInput/TextInput.css +0 -102
  267. package/src/stories/Atoms/TextInput/TextInput.jsx +0 -133
  268. package/src/stories/Atoms/TextInput/TextInput.stories.jsx +0 -69
  269. package/src/stories/Atoms/Toggle/Toggle.css +0 -118
  270. package/src/stories/Atoms/Toggle/Toggle.jsx +0 -69
  271. package/src/stories/Atoms/Toggle/Toggle.stories.jsx +0 -35
  272. package/src/stories/Atoms/Tooltip/Tooltip.css +0 -383
  273. package/src/stories/Atoms/Tooltip/Tooltip.jsx +0 -46
  274. package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +0 -52
  275. package/src/stories/Atoms/Video/Video.css +0 -39
  276. package/src/stories/Atoms/Video/Video.jsx +0 -78
  277. package/src/stories/Atoms/Video/Video.stories.jsx +0 -41
  278. package/src/stories/Atoms/index.js +0 -72
  279. package/src/stories/Atoms/meta_Atoms.js +0 -51
  280. package/src/stories/Components.js +0 -198
  281. package/src/stories/Getting Started.mdx +0 -239
  282. package/src/stories/Layouts/Accordion/Accordion.css +0 -293
  283. package/src/stories/Layouts/Accordion/Accordion.jsx +0 -74
  284. package/src/stories/Layouts/Accordion/Accordion.stories.jsx +0 -39
  285. package/src/stories/Layouts/Flexbox/Flexbox.css +0 -16
  286. package/src/stories/Layouts/Flexbox/Flexbox.jsx +0 -11
  287. package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +0 -28
  288. package/src/stories/Layouts/Footer/Footer.css +0 -16
  289. package/src/stories/Layouts/Footer/Footer.jsx +0 -31
  290. package/src/stories/Layouts/Footer/Footer.stories.jsx +0 -28
  291. package/src/stories/Layouts/Header/Header.css +0 -16
  292. package/src/stories/Layouts/Header/Header.jsx +0 -31
  293. package/src/stories/Layouts/Header/Header.stories.jsx +0 -28
  294. package/src/stories/Layouts/HeroBanner/HeroBanner.css +0 -16
  295. package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +0 -31
  296. package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +0 -28
  297. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +0 -16
  298. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +0 -31
  299. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +0 -28
  300. package/src/stories/Layouts/Pagination/Pagination.css +0 -16
  301. package/src/stories/Layouts/Pagination/Pagination.jsx +0 -31
  302. package/src/stories/Layouts/Pagination/Pagination.stories.jsx +0 -28
  303. package/src/stories/Layouts/Sidebar/Sidebar.css +0 -16
  304. package/src/stories/Layouts/Sidebar/Sidebar.jsx +0 -71
  305. package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +0 -28
  306. package/src/stories/Layouts/Tabs/Tabs.css +0 -16
  307. package/src/stories/Layouts/Tabs/Tabs.jsx +0 -31
  308. package/src/stories/Layouts/Tabs/Tabs.stories.jsx +0 -28
  309. package/src/stories/Layouts/index.js +0 -25
  310. package/src/stories/Layouts/meta_Layouts.js +0 -28
  311. package/src/stories/MDX.mdx +0 -118
  312. package/src/stories/Miscellaneous/Miscellaneous.js +0 -24
  313. package/src/stories/Molecules/Accordion/Accordion.css +0 -4
  314. package/src/stories/Molecules/Accordion/Accordion.jsx +0 -25
  315. package/src/stories/Molecules/Accordion/Accordion.stories.jsx +0 -20
  316. package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +0 -97
  317. package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +0 -244
  318. package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +0 -55
  319. package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +0 -130
  320. package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +0 -80
  321. package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +0 -20
  322. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +0 -147
  323. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +0 -51
  324. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +0 -36
  325. package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +0 -465
  326. package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +0 -47
  327. package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +0 -44
  328. package/src/stories/Molecules/Card/Card.css +0 -41
  329. package/src/stories/Molecules/Card/Card.jsx +0 -92
  330. package/src/stories/Molecules/Card/Card.stories.jsx +0 -34
  331. package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +0 -35
  332. package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +0 -104
  333. package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +0 -81
  334. package/src/stories/Molecules/DataTable/DataTable.css +0 -4
  335. package/src/stories/Molecules/DataTable/DataTable.jsx +0 -25
  336. package/src/stories/Molecules/DataTable/DataTable.stories.jsx +0 -20
  337. package/src/stories/Molecules/Dropdown/Dropdown.css +0 -192
  338. package/src/stories/Molecules/Dropdown/Dropdown.jsx +0 -96
  339. package/src/stories/Molecules/Dropdown/Dropdown.stories.jsx +0 -45
  340. package/src/stories/Molecules/FileUpload/FileUpload.css +0 -4
  341. package/src/stories/Molecules/FileUpload/FileUpload.jsx +0 -25
  342. package/src/stories/Molecules/FileUpload/FileUpload.stories.jsx +0 -20
  343. package/src/stories/Molecules/FormField/FormField.css +0 -4
  344. package/src/stories/Molecules/FormField/FormField.jsx +0 -25
  345. package/src/stories/Molecules/FormField/FormField.stories.jsx +0 -20
  346. package/src/stories/Molecules/Header/Header.css +0 -35
  347. package/src/stories/Molecules/Header/Header.jsx +0 -76
  348. package/src/stories/Molecules/Header/Header.stories.jsx +0 -28
  349. package/src/stories/Molecules/IconButton/IconButton.css +0 -4
  350. package/src/stories/Molecules/IconButton/IconButton.jsx +0 -25
  351. package/src/stories/Molecules/IconButton/IconButton.stories.jsx +0 -20
  352. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.css +0 -4
  353. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.jsx +0 -25
  354. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.stories.jsx +0 -20
  355. package/src/stories/Molecules/InputGroup/InputGroup.css +0 -4
  356. package/src/stories/Molecules/InputGroup/InputGroup.jsx +0 -25
  357. package/src/stories/Molecules/InputGroup/InputGroup.stories.jsx +0 -20
  358. package/src/stories/Molecules/InputWithLabel/InputWithLabel.css +0 -4
  359. package/src/stories/Molecules/InputWithLabel/InputWithLabel.jsx +0 -25
  360. package/src/stories/Molecules/InputWithLabel/InputWithLabel.stories.jsx +0 -20
  361. package/src/stories/Molecules/List/List.css +0 -4
  362. package/src/stories/Molecules/List/List.jsx +0 -25
  363. package/src/stories/Molecules/List/List.stories.jsx +0 -20
  364. package/src/stories/Molecules/MediaCard/MediaCard.css +0 -4
  365. package/src/stories/Molecules/MediaCard/MediaCard.jsx +0 -25
  366. package/src/stories/Molecules/MediaCard/MediaCard.stories.jsx +0 -20
  367. package/src/stories/Molecules/Modal/Modal.css +0 -4
  368. package/src/stories/Molecules/Modal/Modal.jsx +0 -25
  369. package/src/stories/Molecules/Modal/Modal.stories.jsx +0 -20
  370. package/src/stories/Molecules/Navbar/Navbar.css +0 -91
  371. package/src/stories/Molecules/Navbar/Navbar.jsx +0 -82
  372. package/src/stories/Molecules/Navbar/Navbar.stories.jsx +0 -70
  373. package/src/stories/Molecules/Notification/Notification.css +0 -4
  374. package/src/stories/Molecules/Notification/Notification.jsx +0 -25
  375. package/src/stories/Molecules/Notification/Notification.stories.jsx +0 -20
  376. package/src/stories/Molecules/PricingTable/PricingTable.css +0 -4
  377. package/src/stories/Molecules/PricingTable/PricingTable.jsx +0 -25
  378. package/src/stories/Molecules/PricingTable/PricingTable.stories.jsx +0 -20
  379. package/src/stories/Molecules/SearchBar/SearchBar.css +0 -69
  380. package/src/stories/Molecules/SearchBar/SearchBar.jsx +0 -73
  381. package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +0 -29
  382. package/src/stories/Molecules/SelectTheme/SelectTheme.css +0 -25
  383. package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +0 -22
  384. package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +0 -24
  385. package/src/stories/Molecules/Sidebar/Sidebar.css +0 -67
  386. package/src/stories/Molecules/Sidebar/Sidebar.jsx +0 -80
  387. package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +0 -35
  388. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.css +0 -4
  389. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.jsx +0 -25
  390. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.stories.jsx +0 -20
  391. package/src/stories/Molecules/index.js +0 -58
  392. package/src/stories/Molecules/meta_Molecules.js +0 -47
  393. package/src/stories/Organisms/Profile/UserFriends/UserFriends.context.jsx +0 -15
  394. package/src/stories/Organisms/Profile/UserFriends/UserFriends.css +0 -4
  395. package/src/stories/Organisms/Profile/UserFriends/UserFriends.jsx +0 -13
  396. package/src/stories/Organisms/Profile/UserFriends/UserFriends.stories.jsx +0 -26
  397. package/src/stories/Organisms/Profile/UserPosts/UserPosts.context.jsx +0 -15
  398. package/src/stories/Organisms/Profile/UserPosts/UserPosts.css +0 -4
  399. package/src/stories/Organisms/Profile/UserPosts/UserPosts.jsx +0 -13
  400. package/src/stories/Organisms/Profile/UserPosts/UserPosts.stories.jsx +0 -26
  401. package/src/stories/Organisms/Profile/UserProfile/UserProfile.context.jsx +0 -15
  402. package/src/stories/Organisms/Profile/UserProfile/UserProfile.css +0 -4
  403. package/src/stories/Organisms/Profile/UserProfile/UserProfile.jsx +0 -13
  404. package/src/stories/Organisms/Profile/UserProfile/UserProfile.stories.jsx +0 -26
  405. package/src/stories/Organisms/meta_Organisms.js +0 -39
  406. package/src/stories/Pages/Page/Page.css +0 -69
  407. package/src/stories/Pages/Page/Page.jsx +0 -69
  408. package/src/stories/Pages/Page/Page.stories.js +0 -26
  409. package/src/stories/Pages/Page/Pages.js +0 -31
  410. package/src/stories/Templates/AdminDashboard/AdminDashboard.css +0 -7
  411. package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +0 -24
  412. package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +0 -20
  413. package/src/stories/Templates/CallToAction/CallToAction.css +0 -7
  414. package/src/stories/Templates/CallToAction/CallToAction.jsx +0 -24
  415. package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +0 -20
  416. package/src/stories/Templates/FeaturesList/FeaturesList.css +0 -7
  417. package/src/stories/Templates/FeaturesList/FeaturesList.jsx +0 -24
  418. package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +0 -20
  419. package/src/stories/Templates/FormSection/FormSection.css +0 -7
  420. package/src/stories/Templates/FormSection/FormSection.jsx +0 -24
  421. package/src/stories/Templates/FormSection/FormSection.stories.jsx +0 -20
  422. package/src/stories/Templates/HeroSection/HeroSection.css +0 -7
  423. package/src/stories/Templates/HeroSection/HeroSection.jsx +0 -24
  424. package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +0 -20
  425. package/src/stories/Templates/LocationInfo/LocationInfo.css +0 -7
  426. package/src/stories/Templates/LocationInfo/LocationInfo.jsx +0 -24
  427. package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +0 -20
  428. package/src/stories/Templates/ProductPage/ProductPage.css +0 -7
  429. package/src/stories/Templates/ProductPage/ProductPage.jsx +0 -24
  430. package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +0 -20
  431. package/src/stories/Templates/RegistrationPage/RegistrationPage.css +0 -7
  432. package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +0 -24
  433. package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +0 -20
  434. package/src/stories/Templates/ShoppingCart/ShoppingCart.css +0 -7
  435. package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +0 -24
  436. package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +0 -20
  437. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +0 -7
  438. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +0 -24
  439. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +0 -20
  440. package/src/stories/Templates/SignInPage/SignInPage.css +0 -7
  441. package/src/stories/Templates/SignInPage/SignInPage.jsx +0 -24
  442. package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +0 -20
  443. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +0 -7
  444. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +0 -24
  445. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +0 -20
  446. package/src/stories/Templates/Testimonials/Testimonials.css +0 -7
  447. package/src/stories/Templates/Testimonials/Testimonials.jsx +0 -24
  448. package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +0 -20
  449. package/src/stories/Templates/index.js +0 -33
  450. package/src/stories/Templates/meta_Templates.js +0 -29
  451. package/src/stories/assets/accessibility.png +0 -0
  452. package/src/stories/assets/accessibility.svg +0 -1
  453. package/src/stories/assets/addon-library.png +0 -0
  454. package/src/stories/assets/assets.png +0 -0
  455. package/src/stories/assets/avif-test-image.avif +0 -0
  456. package/src/stories/assets/context.png +0 -0
  457. package/src/stories/assets/discord.svg +0 -1
  458. package/src/stories/assets/docs.png +0 -0
  459. package/src/stories/assets/figma-plugin.png +0 -0
  460. package/src/stories/assets/github.svg +0 -1
  461. package/src/stories/assets/logo.png +0 -0
  462. package/src/stories/assets/logo.svg +0 -106
  463. package/src/stories/assets/share.png +0 -0
  464. package/src/stories/assets/styling.png +0 -0
  465. package/src/stories/assets/test.svg +0 -3
  466. package/src/stories/assets/testing.png +0 -0
  467. package/src/stories/assets/theming.png +0 -0
  468. package/src/stories/assets/tutorials.svg +0 -1
  469. package/src/stories/assets/youtube.svg +0 -1
  470. package/src/themes/README_Styles.md +0 -301
  471. package/src/themes/ThemeProvider.jsx +0 -61
  472. package/src/themes/styles/github/dark.css +0 -0
  473. package/src/themes/styles/github/light.css +0 -0
  474. package/src/themes/styles/neurons/dark.css +0 -247
  475. package/src/themes/styles/neurons/light.css +0 -280
  476. /package/{src/themes/styles/dracula/dark.css → .storybook/preview-head.html} +0 -0
  477. /package/src/{themes/styles/dracula/light.css → components/this.me/MeCard.jsx} +0 -0
@@ -0,0 +1,352 @@
1
+ // src/themes/fromTokens.ts
2
+ import { createTheme, type Theme } from '@mui/material/styles';
3
+ // Manifest support ---------------------------------------------------------
4
+ export type ThemeAuthor = { name?: string; url?: string };
5
+ export type ThemeRepository = string | { url: string; type?: string };
6
+ export type ThemeModeKey = 'light' | 'dark' | string;
7
+ export type ThemeManifest = {
8
+ id?: string;
9
+ name?: string;
10
+ version?: string;
11
+ description?: string;
12
+ license?: string;
13
+ homepage?: string;
14
+ repository?: ThemeRepository;
15
+ keywords?: string[];
16
+ author?: ThemeAuthor | string;
17
+ createdAt?: string;
18
+ updatedAt?: string;
19
+ /** Optional global (shared) tokens applied to every mode */
20
+ global?: any;
21
+ /** Which mode to prefer when none is provided */
22
+ defaultMode?: ThemeModeKey;
23
+ /** Modes map (at minimum, usually `light` and/or `dark`) */
24
+ modes: Record<ThemeModeKey, { tokens?: any }>;
25
+ };
26
+ // Helpers ------------------------------------------------------------
27
+ export const pxToRem = (n: number): string => `${n / 16}rem`;
28
+ const pick = <T = any,>(obj: any, path: Array<string | number>, fallback?: T): T => {
29
+ // Safely read nested token value supporting Tokens Studio shape { $value }
30
+ const raw =
31
+ path.reduce<any>((acc, k) => (acc && acc[k] !== undefined ? acc[k] : undefined), obj) ??
32
+ undefined;
33
+ if (raw && typeof raw === 'object' && '$value' in raw) return (raw as any).$value as T;
34
+ return (raw ?? fallback) as T;
35
+ };
36
+
37
+ const readNumber = (v: unknown, fb: number): number => {
38
+ if (v === undefined || v === null) return fb;
39
+ const n = typeof v === 'string' ? parseFloat(v) : (v as number);
40
+ return Number.isFinite(n) ? (n as number) : fb;
41
+ };
42
+
43
+ const ensureArrayLen = <T,>(arr: T[] | unknown, len: number, filler: T): T[] => {
44
+ const a = Array.isArray(arr) ? ([...arr] as T[]) : [];
45
+ for (let i = a.length; i < len; i++) a.push(filler);
46
+ return a.slice(0, len);
47
+ };
48
+
49
+ // Build MUI shadows (length 25). Accepts either an array or a map {0..24}
50
+ const buildShadows = (shadowTokens: any, mode: 'light' | 'dark'): Theme['shadows'] => {
51
+ const DEFAULT_SHADOWS: string[] =
52
+ mode === 'dark'
53
+ ? [
54
+ 'none',
55
+ '0px 1px 2px rgba(0,0,0,0.6)',
56
+ '0px 2px 4px rgba(0,0,0,0.55)',
57
+ '0px 3px 6px rgba(0,0,0,0.5)',
58
+ '0px 4px 8px rgba(0,0,0,0.45)',
59
+ '0px 5px 10px rgba(0,0,0,0.4)',
60
+ '0px 6px 12px rgba(0,0,0,0.38)',
61
+ '0px 7px 14px rgba(0,0,0,0.36)',
62
+ '0px 8px 16px rgba(0,0,0,0.34)',
63
+ '0px 9px 18px rgba(0,0,0,0.32)',
64
+ '0px 10px 20px rgba(0,0,0,0.3)',
65
+ '0px 11px 22px rgba(0,0,0,0.28)',
66
+ '0px 12px 24px rgba(0,0,0,0.26)',
67
+ '0px 13px 26px rgba(0,0,0,0.24)',
68
+ '0px 14px 28px rgba(0,0,0,0.22)',
69
+ '0px 15px 30px rgba(0,0,0,0.2)',
70
+ '0px 16px 32px rgba(0,0,0,0.19)',
71
+ '0px 17px 34px rgba(0,0,0,0.18)',
72
+ '0px 18px 36px rgba(0,0,0,0.17)',
73
+ '0px 19px 38px rgba(0,0,0,0.16)',
74
+ '0px 20px 40px rgba(0,0,0,0.15)',
75
+ '0px 22px 44px rgba(0,0,0,0.14)',
76
+ '0px 24px 48px rgba(0,0,0,0.13)',
77
+ '0px 26px 52px rgba(0,0,0,0.12)',
78
+ '0px 28px 56px rgba(0,0,0,0.11)',
79
+ ]
80
+ : [
81
+ 'none',
82
+ '0px 1px 2px rgba(0,0,0,0.08)',
83
+ '0px 2px 4px rgba(0,0,0,0.1)',
84
+ '0px 3px 6px rgba(0,0,0,0.12)',
85
+ '0px 4px 8px rgba(0,0,0,0.14)',
86
+ '0px 5px 10px rgba(0,0,0,0.15)',
87
+ '0px 6px 12px rgba(0,0,0,0.16)',
88
+ '0px 7px 14px rgba(0,0,0,0.17)',
89
+ '0px 8px 16px rgba(0,0,0,0.18)',
90
+ '0px 9px 18px rgba(0,0,0,0.19)',
91
+ '0px 10px 20px rgba(0,0,0,0.2)',
92
+ '0px 11px 22px rgba(0,0,0,0.21)',
93
+ '0px 12px 24px rgba(0,0,0,0.22)',
94
+ '0px 13px 26px rgba(0,0,0,0.23)',
95
+ '0px 14px 28px rgba(0,0,0,0.24)',
96
+ '0px 15px 30px rgba(0,0,0,0.25)',
97
+ '0px 16px 32px rgba(0,0,0,0.26)',
98
+ '0px 17px 34px rgba(0,0,0,0.27)',
99
+ '0px 18px 36px rgba(0,0,0,0.28)',
100
+ '0px 19px 38px rgba(0,0,0,0.29)',
101
+ '0px 20px 40px rgba(0,0,0,0.3)',
102
+ '0px 22px 44px rgba(0,0,0,0.31)',
103
+ '0px 24px 48px rgba(0,0,0,0.32)',
104
+ '0px 26px 52px rgba(0,0,0,0.33)',
105
+ '0px 28px 56px rgba(0,0,0,0.34)',
106
+ ];
107
+ // If tokens is array: normalize; if map: read values "0..24" or "s0..s24".
108
+ if (Array.isArray(shadowTokens)) {
109
+ return ensureArrayLen<string>(shadowTokens as string[], 25, DEFAULT_SHADOWS[0]) as unknown as Theme['shadows'];
110
+ }
111
+ if (shadowTokens && typeof shadowTokens === 'object') {
112
+ const arr: string[] = [];
113
+ for (let i = 0; i < 25; i++) {
114
+ const v =
115
+ pick<string | undefined>(shadowTokens, [String(i)], undefined) ??
116
+ pick<string | undefined>(shadowTokens, [`s${i}`], undefined);
117
+ arr.push(v ?? DEFAULT_SHADOWS[i] ?? DEFAULT_SHADOWS[0]);
118
+ }
119
+ return arr as unknown as Theme['shadows'];
120
+ }
121
+ return DEFAULT_SHADOWS as unknown as Theme['shadows'];
122
+ };
123
+
124
+ const toAuthor = (a: unknown): ThemeAuthor | undefined => {
125
+ if (!a) return undefined;
126
+ if (typeof a === 'string') return { name: a };
127
+ if (typeof a === 'object') return a as ThemeAuthor;
128
+ return undefined;
129
+ };
130
+
131
+ // Main compiler ------------------------------------------------------
132
+ export function makeMuiTheme(globalTokens: any, themeTokens: any, mode: 'light' | 'dark' = 'light'): Theme {
133
+ const g = globalTokens || {};
134
+ const c = themeTokens?.color || {};
135
+ // Core primitives
136
+ const radius = readNumber(pick(g, ['radius', 'md'], 10), 10);
137
+ const spacing = readNumber(pick(g, ['spacing', 'base'], 8), 8);
138
+ const fontFamily = pick<string>(g, ['font', 'family'], 'Roboto, sans-serif');
139
+ const borderDefault =
140
+ pick<string | undefined>(g, ['border', 'default'], undefined) ??
141
+ (mode === 'dark' ? 'rgb(45,45,55)' : 'rgba(0,0,0,0.08)');
142
+ // Extended tokens
143
+ const semantic = themeTokens?.extendedColors || themeTokens?.semantic || {};
144
+ const gradients = semantic?.gradients || {};
145
+ const overlays = semantic?.overlays || {};
146
+ const zIndexTokens = g.zIndex || {};
147
+ const breakpointsTokens = g.breakpoints || {};
148
+ const motion = g.motion || {};
149
+ const opacity = g.opacity || {};
150
+ const iconSizes = g.iconSizes || {};
151
+ const lineHeights = g.lineHeights || {};
152
+ const shadowsTokens = g.shadows;
153
+ // Build MUI theme
154
+ const theme = createTheme({
155
+ // Palette accepts custom keys like `link` and `background.nav` in our design system,
156
+ // so we cast to any to avoid fighting MUI's strict palette types.
157
+ palette: {
158
+ mode,
159
+ primary: { main: pick(c, ['primary'], '#1976d2') },
160
+ secondary: { main: pick(c, ['secondary'], '#9c27b0') },
161
+ icon: { main: pick(c, ['icon'], '#5e5e5e') },
162
+ background: {
163
+ default: pick(c, ['background','default'], mode === 'dark' ? '#121214' : '#f8f9fa'),
164
+ paper: pick(c, ['background','paper'], mode === 'dark' ? '#181a1c' : '#fff'),
165
+ nav: pick(c, ['background','nav'], mode === 'dark' ? '#16181a' : '#fdfdfd'),
166
+ },
167
+ text: {
168
+ primary: pick(c, ['textPrimary'], mode === 'dark' ? '#fff' : '#111'),
169
+ secondary: pick(
170
+ c,
171
+ ['textSecondary'],
172
+ mode === 'dark' ? 'rgba(255,255,255,0.7)' : '#444'
173
+ ),
174
+ },
175
+ link: {
176
+ main: pick(c, ['link'], mode === 'dark' ? '#00aa96' : '#008c7d'),
177
+ visited: pick(c, ['linkVisited'], mode === 'dark' ? '#008278' : '#006e64'),
178
+ },
179
+ error: { main: pick(semantic, ['error'], mode === 'dark' ? '#ef5350' : '#d32f2f') },
180
+ warning: { main: pick(semantic, ['warning'], '#ed6c02') },
181
+ info: { main: pick(semantic, ['info'], '#0288d1') },
182
+ success: { main: pick(semantic, ['success'], '#2e7d32') },
183
+ divider: pick(c, ['border'], borderDefault),
184
+ action: {
185
+ hoverOpacity: readNumber(pick(opacity, ['hover'], 0.08), 0.08),
186
+ selectedOpacity: readNumber(pick(opacity, ['selected'], 0.12), 0.12),
187
+ disabledOpacity: readNumber(pick(opacity, ['disabled'], 0.38), 0.38),
188
+ focusOpacity: readNumber(pick(opacity, ['focus'], 0.12), 0.12),
189
+ activatedOpacity: readNumber(pick(opacity, ['activated'], 0.12), 0.12),
190
+ },
191
+ },
192
+ // All tokens exposed under theme.custom for easy access
193
+ custom: {
194
+ border: pick(c, ['border'], borderDefault),
195
+ gradients,
196
+ overlays,
197
+ iconSizes,
198
+ lineHeights,
199
+ },
200
+ shape: { borderRadius: Number.isFinite(radius) ? (radius as number) : 10 },
201
+ spacing: Number.isFinite(spacing) ? (spacing as number) : 8,
202
+ breakpoints: {
203
+ values: {
204
+ xs: readNumber(pick(breakpointsTokens, ['values', 'xs'], 0), 0),
205
+ sm: readNumber(pick(breakpointsTokens, ['values', 'sm'], 600), 600),
206
+ md: readNumber(pick(breakpointsTokens, ['values', 'md'], 900), 900),
207
+ lg: readNumber(pick(breakpointsTokens, ['values', 'lg'], 1200), 1200),
208
+ xl: readNumber(pick(breakpointsTokens, ['values', 'xl'], 1536), 1536),
209
+ },
210
+ },
211
+ zIndex: {
212
+ appBar: readNumber(pick(zIndexTokens, ['appBar'], 1100), 1100),
213
+ drawer: readNumber(pick(zIndexTokens, ['drawer'], 1200), 1200),
214
+ modal: readNumber(pick(zIndexTokens, ['modal'], 1300), 1300),
215
+ snackbar: readNumber(pick(zIndexTokens, ['snackbar'], 1400), 1400),
216
+ tooltip: readNumber(pick(zIndexTokens, ['tooltip'], 1500), 1500),
217
+ },
218
+ transitions: {
219
+ easing: {
220
+ easeInOut: pick(motion, ['easing', 'standard'], 'cubic-bezier(0.4, 0, 0.2, 1)'),
221
+ easeOut: pick(motion, ['easing', 'decelerate'], 'cubic-bezier(0.0, 0, 0.2, 1)'),
222
+ easeIn: pick(motion, ['easing', 'accelerate'], 'cubic-bezier(0.4, 0, 1, 1)'),
223
+ sharp: pick(motion, ['easing', 'sharp'], 'cubic-bezier(0.4, 0, 0.6, 1)'),
224
+ },
225
+ duration: {
226
+ shortest: readNumber(pick(motion, ['duration', 'shortest'], 150), 150),
227
+ shorter: readNumber(pick(motion, ['duration', 'shorter'], 200), 200),
228
+ short: readNumber(pick(motion, ['duration', 'short'], 250), 250),
229
+ standard: readNumber(pick(motion, ['duration', 'standard'], 300), 300),
230
+ complex: readNumber(pick(motion, ['duration', 'complex'], 375), 375),
231
+ enteringScreen: readNumber(pick(motion, ['duration', 'entering'], 225), 225),
232
+ leavingScreen: readNumber(pick(motion, ['duration', 'leaving'], 195), 195),
233
+ },
234
+ },
235
+ typography: {
236
+ fontFamily,
237
+ // existing variants
238
+ h1: { fontSize: pxToRem(40), fontWeight: 600, lineHeight: 1.2, letterSpacing: '-0.01em' },
239
+ h2: { fontSize: pxToRem(32), fontWeight: 600, lineHeight: 1.25 },
240
+ h3: { fontSize: pxToRem(26), fontWeight: 600, lineHeight: 1.3 },
241
+ h4: { fontSize: pxToRem(21), fontWeight: 600, lineHeight: 1.35 },
242
+ h5: { fontSize: pxToRem(18), fontWeight: 600, lineHeight: 1.35 },
243
+ subtitle1: { fontSize: pxToRem(16), fontWeight: 600, lineHeight: 1.4 },
244
+ body1: { fontSize: pxToRem(16), lineHeight: 1.6 },
245
+ body2: { fontSize: pxToRem(14), lineHeight: 1.6 },
246
+ button: { textTransform: 'none', fontWeight: 700, letterSpacing: '0.02em' },
247
+ },
248
+ shadows: buildShadows(shadowsTokens, mode),
249
+ layout: {
250
+ insets: {
251
+ left: readNumber(pick(g, ['layout', 'insets', 'left'], 0), 0),
252
+ right: readNumber(pick(g, ['layout', 'insets', 'right'], 0), 0),
253
+ nav: readNumber(pick(g, ['layout', 'insets', 'nav'], 0), 0),
254
+ },
255
+ },
256
+ components: {
257
+ MuiButton: {
258
+ defaultProps: { disableElevation: true },
259
+ styleOverrides: {
260
+ root: ({ theme }) => ({ borderRadius: theme.shape.borderRadius }),
261
+ sizeLarge: { padding: '12px 20px' },
262
+ sizeMedium: { padding: '10px 18px' },
263
+ sizeSmall: { padding: '8px 14px' },
264
+ },
265
+ },
266
+ MuiPaper: { styleOverrides: { rounded: { borderRadius: 14 } } },
267
+ MuiTextField: { defaultProps: { size: 'small' } },
268
+ MuiCssBaseline: {
269
+ styleOverrides: (theme) => ({
270
+ ':root': {
271
+ '--gui-primary': theme.palette.primary.main,
272
+ '--gui-secondary': theme.palette.secondary.main,
273
+ '--gui-bg-default': theme.palette.background.default,
274
+ '--gui-bg-paper': theme.palette.background.paper,
275
+ '--gui-bg-nav': theme.palette.background.nav || theme.palette.background.paper,
276
+ '--gui-text-primary': theme.palette.text.primary,
277
+ '--gui-text-secondary': theme.palette.text.secondary,
278
+ '--gui-link': theme.palette.link.main,
279
+ '--gui-link-visited': theme.palette.link.visited || theme.palette.link.main,
280
+ '--gui-border': theme.custom?.border || theme.palette.divider,
281
+ // Motion / opacity / icon sizes CSS vars for non-MUI DOM
282
+ '--gui-ease-standard': theme.transitions.easing.easeInOut,
283
+ '--gui-duration-standard': `${theme.transitions.duration.standard}ms`,
284
+ '--gui-opacity-hover': theme.palette.action.hoverOpacity,
285
+ '--gui-opacity-disabled': theme.palette.action.disabledOpacity,
286
+ '--gui-icon-size-sm': (iconSizes as any).sm ?? '16px',
287
+ '--gui-icon-size-md': (iconSizes as any).md ?? '20px',
288
+ '--gui-icon-size-lg': (iconSizes as any).lg ?? '24px',
289
+ '--gui-radius': `${theme.shape.borderRadius}px`,
290
+ '--gui-font-family': theme.typography.fontFamily,
291
+ '--gui-spacing': typeof theme.spacing === 'function' ? theme.spacing(1) : `${(theme as any).spacing}px`,
292
+ '--gui-inset-left': theme.layout.insets.left + 'px',
293
+ '--gui-inset-right': theme.layout.insets.right + 'px',
294
+ },
295
+ body: {
296
+ fontFamily: theme.typography.fontFamily,
297
+ backgroundColor: theme.palette.background.default,
298
+ color: theme.palette.text.primary,
299
+ },
300
+ a: {
301
+ color: theme.palette.link.main,
302
+ textDecoration: 'none',
303
+ '&:hover': { textDecoration: 'underline' },
304
+ '&:visited': { color: theme.palette.link.visited || theme.palette.link.main },
305
+ },
306
+ }),
307
+ },
308
+ },
309
+ });
310
+ return theme;
311
+ }
312
+ // ========================= Manifest-based API =============================
313
+ /** Returns the list of modes declared in a manifest (e.g., ['light','dark']). */
314
+ export function getAvailableModes(manifest: ThemeManifest): ThemeModeKey[] {
315
+ return Object.keys(manifest?.modes || {});
316
+ }
317
+
318
+ /** Picks a mode honoring explicit arg, manifest.defaultMode, or sensible fallback. */
319
+ function pickMode(manifest: ThemeManifest, prefer?: ThemeModeKey): ThemeModeKey {
320
+ const modes = getAvailableModes(manifest);
321
+ if (prefer && modes.includes(prefer)) return prefer;
322
+ if (manifest.defaultMode && modes.includes(manifest.defaultMode)) return manifest.defaultMode;
323
+ // Prefer 'light' or 'dark' when present; otherwise first key
324
+ if (modes.includes('light')) return 'light';
325
+ if (modes.includes('dark')) return 'dark';
326
+ return modes[0] as ThemeModeKey;
327
+ }
328
+
329
+ /**
330
+ * Create a MUI theme from a ThemeManifest.
331
+ * - `manifest.global` is merged conceptually into `globalTokens`.
332
+ * - Mode tokens are taken from `manifest.modes[mode].tokens`.
333
+ * - `mode` is coerced to 'light'/'dark' for MUI's palette.mode; non-binary keys are supported
334
+ * but will map to 'light' unless explicitly equal to 'dark'.
335
+ */
336
+ export function makeMuiThemeFromManifest(
337
+ manifest: ThemeManifest,
338
+ options?: { mode?: ThemeModeKey }
339
+ ): Theme {
340
+ if (!manifest || typeof manifest !== 'object') {
341
+ throw new Error('makeMuiThemeFromManifest: invalid manifest');
342
+ }
343
+ const chosen = pickMode(manifest, options?.mode);
344
+ const entry = manifest.modes?.[chosen] || {};
345
+ const tokens = (entry as any).tokens || {};
346
+ const globalTokens = manifest.global || {};
347
+
348
+ // Coerce to MUI palette mode ('light' | 'dark')
349
+ const muiMode: 'light' | 'dark' = (String(chosen).toLowerCase() === 'dark' ? 'dark' : 'light');
350
+
351
+ return makeMuiTheme(globalTokens, tokens, muiMode);
352
+ }
@@ -0,0 +1,137 @@
1
+ // src/themes/icons/Icon.tsx
2
+ import * as React from 'react';
3
+ import { Suspense } from 'react';
4
+ import { useTheme } from '@mui/material/styles';
5
+ import { lazyIcon } from './registry';
6
+
7
+ /**
8
+ * Icon
9
+ * ----
10
+ * Minimal, but smarter color handling so icons react to theme changes.
11
+ *
12
+ * Props:
13
+ * - name: string → e.g. 'mui:Settings' | 'lucide:camera'
14
+ * - iconColor?: string | palette token
15
+ * * MUI: accepts palette keys ('primary', 'secondary', 'error', 'info', 'success', 'warning', 'inherit', 'action', 'disabled')
16
+ * OR palette paths like 'text.primary', 'action.active'
17
+ * * Lucide: accepts palette keys/paths too; we resolve to hex via theme and pass as `color`
18
+ * - color/htmlColor: still supported (if you pass these explicitly we won't override)
19
+ * - ...rest: forwarded to the underlying icon component
20
+ *
21
+ * Behavior:
22
+ * - If you pass `iconColor` (preferred) or `color` with a palette token, we map it to the right prop:
23
+ * * MUI → `color="primary"` for known keys; otherwise `htmlColor="#hex"`
24
+ * * Lucide → `color="#hex"`
25
+ * - If you pass a raw CSS color (e.g., "#4caf50"), we forward it directly:
26
+ * * MUI → `htmlColor`
27
+ * * Lucide → `color`
28
+ * - If no color provided, the icon inherits `currentColor` (theme-reactive by default).
29
+ */
30
+
31
+ const MUI_COLOR_KEYS = new Set<string>([
32
+ 'inherit',
33
+ 'primary',
34
+ 'secondary',
35
+ 'error',
36
+ 'info',
37
+ 'success',
38
+ 'warning',
39
+ 'action',
40
+ 'disabled',
41
+ ]);
42
+
43
+ function isCssColor(value: unknown): value is string {
44
+ if (typeof value !== 'string') return false;
45
+ const v = value.trim().toLowerCase();
46
+ return (
47
+ v.startsWith('#') ||
48
+ v.startsWith('rgb(') ||
49
+ v.startsWith('rgba(') ||
50
+ v.startsWith('hsl(') ||
51
+ v.startsWith('hsla(')
52
+ );
53
+ }
54
+
55
+ function getFromPath(obj: any, path: string): any {
56
+ if (!obj || !path) return undefined;
57
+ const parts = String(path).split('.');
58
+ let cur: any = obj;
59
+ for (const p of parts) {
60
+ if (cur && Object.prototype.hasOwnProperty.call(cur, p)) {
61
+ cur = cur[p];
62
+ } else {
63
+ return undefined;
64
+ }
65
+ }
66
+ return cur;
67
+ }
68
+
69
+ export type IconProps = {
70
+ name: string;
71
+ fallback?: React.ReactNode;
72
+ /**
73
+ * Preferred way to specify color. Can be a CSS color ("#fff") or a palette token ("primary", "text.secondary").
74
+ */
75
+ iconColor?: string;
76
+ /**
77
+ * Any additional props are forwarded to the underlying icon component (MUI/Lucide).
78
+ */
79
+ [key: string]: any;
80
+ };
81
+
82
+ export default function Icon({ name, fallback = null, iconColor, ...rest }: IconProps) {
83
+ const theme = useTheme();
84
+ const Lazy: React.ComponentType<any> = lazyIcon(name);
85
+
86
+ // If consumer already passed exact coloring props, don't interfere.
87
+ const userSpecifiedHtmlColor = Object.prototype.hasOwnProperty.call(rest, 'htmlColor');
88
+ const userSpecifiedColor = Object.prototype.hasOwnProperty.call(rest, 'color') && !iconColor;
89
+
90
+ // Decide provider by prefix
91
+ const pref = String(name || '').split(/[:/]/)[0].toLowerCase();
92
+ const isMUI = pref === 'mui';
93
+ const isLucide = pref === 'lucide';
94
+
95
+ const desired = iconColor ?? (userSpecifiedColor ? (rest as any).color : undefined);
96
+
97
+ let mappedColorProps: Record<string, any> = {};
98
+ if (!userSpecifiedHtmlColor && !userSpecifiedColor && desired) {
99
+ // 1) Raw CSS color → forward directly
100
+ if (isCssColor(desired)) {
101
+ mappedColorProps = isMUI ? { htmlColor: desired } : { color: desired };
102
+ } else {
103
+ // 2) Palette keys / paths
104
+ if (isMUI && MUI_COLOR_KEYS.has(desired)) {
105
+ // Use semantic MUI color prop for reactivity
106
+ mappedColorProps = { color: desired };
107
+ } else {
108
+ // Resolve palette paths and top-level keys safely
109
+ // e.g. 'text.secondary' -> string, 'primary' -> palette object -> use .main
110
+ const candidate =
111
+ getFromPath((theme as any)?.palette, desired) ??
112
+ (((theme as any)?.palette?.[desired]) ? (theme as any).palette[desired] : undefined);
113
+
114
+ const resolved =
115
+ (candidate && typeof candidate === 'object' && (candidate.main || candidate.default)) ||
116
+ (typeof candidate === 'string' ? candidate : undefined);
117
+
118
+ if (resolved) {
119
+ mappedColorProps = isMUI ? { htmlColor: resolved } : { color: resolved };
120
+ } else {
121
+ // Fallback: forward token as-is
122
+ mappedColorProps = isMUI ? { htmlColor: String(desired) } : { color: String(desired) };
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ return (
129
+ <Suspense
130
+ fallback={
131
+ fallback ?? <span style={{ width: 1, height: 1, display: 'inline-block' }} />
132
+ }
133
+ >
134
+ <Lazy {...rest} {...mappedColorProps} />
135
+ </Suspense>
136
+ );
137
+ }
@@ -0,0 +1,72 @@
1
+ // src/icons/packs/lucide.js
2
+ // Unified Lucide adapter for This.GUI icon registry.
3
+ // Usage:
4
+ // import { getLucideIcon } from '../packs/lucide';
5
+ // const Camera = getLucideIcon('Camera'); // or 'lucide:Camera'
6
+ // <Camera size={18} />
7
+ import * as Lucide from 'lucide-react';
8
+ const LucideLib: Record<string, any> = ((Lucide as any)?.default ?? Lucide) as any;
9
+ import { FC } from 'react';
10
+
11
+ const iconCache = new Map<string, LucideIconComp>();
12
+
13
+ export const LUCIDE_PREFIX = 'lucide';
14
+ export type LucideIconComp = FC<any>;
15
+
16
+ /**
17
+ * Normalize user-provided names to Lucide's PascalCase exports.
18
+ * Accepts formats like:
19
+ * - "Camera", "lucide:Camera"
20
+ * - "video-off", "lucide/video-off"
21
+ * - "video off", "Lucide:videoOff"
22
+ */
23
+ export function normalizeLucideName(name: string = ''): string {
24
+ if (typeof name !== 'string') return '';
25
+ // strip optional prefix and separators
26
+ let n = name.trim();
27
+ n = n.replace(/^lucide[:/.-]\s*/i, ''); // remove "lucide:" or "lucide/" etc
28
+ n = n.replace(/[^a-zA-Z0-9]+/g, ' '); // keep alnum, collapse others to spaces
29
+ // PascalCase it (Video Off -> VideoOff)
30
+ n = n
31
+ .split(' ')
32
+ .filter(Boolean)
33
+ .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1))
34
+ .join('');
35
+ return n;
36
+ }
37
+
38
+ /**
39
+ * Returns the Lucide React component for a given name. Falls back to HelpCircle.
40
+ * The returned component can be used directly as a React component.
41
+ */
42
+ export function getLucideIcon(name: string): LucideIconComp {
43
+ const key = normalizeLucideName(name);
44
+ if (!key) return LucideLib.HelpCircle;
45
+ if (iconCache.has(key)) return iconCache.get(key)!;
46
+ const Comp = typeof LucideLib[key] === 'function' ? LucideLib[key] : LucideLib.HelpCircle;
47
+ iconCache.set(key, Comp);
48
+ return Comp;
49
+ }
50
+
51
+ /**
52
+ * Boolean helper: does this icon exist in the Lucide map?
53
+ */
54
+ export function hasLucideIcon(name: string): boolean {
55
+ const key = normalizeLucideName(name);
56
+ return Boolean(key && typeof LucideLib[key] === 'function');
57
+ }
58
+
59
+ /**
60
+ * List all available Lucide icon export names (PascalCase).
61
+ * Useful for building pickers or debugging. Keep in mind it’s a big list.
62
+ */
63
+ export const lucideIconNames: string[] = Object.keys(LucideLib).filter((k) => /^[A-Z]/.test(k));
64
+
65
+ const lucidePack = {
66
+ prefix: LUCIDE_PREFIX,
67
+ get: getLucideIcon,
68
+ has: hasLucideIcon,
69
+ names: lucideIconNames,
70
+ };
71
+
72
+ export default lucidePack;
@@ -0,0 +1,87 @@
1
+ // src/themes/icons/packs/Material.ts
2
+ import * as React from 'react';
3
+ export const MUI_PREFIX = 'mui';
4
+ // A Material icon component resolved via React.lazy
5
+ export type MuiIconComp = React.LazyExoticComponent<React.ComponentType<any>>;
6
+ // Whitelist de MUI Icons (añade aquí los que uses)
7
+ export const MUI_MAP: Record<string, MuiIconComp> = {
8
+ BarChart: React.lazy(() => import('@mui/icons-material/BarChart')),
9
+ Memory: React.lazy(() => import('@mui/icons-material/Memory')),
10
+ Power: React.lazy(() => import('@mui/icons-material/Power')),
11
+ Email: React.lazy(() => import('@mui/icons-material/Email')),
12
+ ExpandLess: React.lazy(() => import('@mui/icons-material/ExpandLess')),
13
+ ExpandMore: React.lazy(() => import('@mui/icons-material/ExpandMore')),
14
+ Bolt: React.lazy(() => import('@mui/icons-material/Bolt')),
15
+ AttachMoney: React.lazy(() => import('@mui/icons-material/AttachMoney')),
16
+ Insights: React.lazy(() => import('@mui/icons-material/Insights')),
17
+ Settings: React.lazy(() => import('@mui/icons-material/Settings')),
18
+ CameraAlt: React.lazy(() => import('@mui/icons-material/CameraAlt')),
19
+ Help: React.lazy(() => import('@mui/icons-material/Help')),
20
+ SmartToy: React.lazy(() => import('@mui/icons-material/SmartToy')),
21
+ Chat: React.lazy(() => import('@mui/icons-material/Chat')),
22
+ ChatBubbleOutline: React.lazy(() => import('@mui/icons-material/ChatBubbleOutline')),
23
+ Psychology: React.lazy(() => import('@mui/icons-material/Psychology')),
24
+ SupportAgent: React.lazy(() => import('@mui/icons-material/SupportAgent')),
25
+ AutoAwesome: React.lazy(() => import('@mui/icons-material/AutoAwesome')),
26
+ Autorenew: React.lazy(() => import('@mui/icons-material/Autorenew')),
27
+ Sync: React.lazy(() => import('@mui/icons-material/Sync')),
28
+ Loop: React.lazy(() => import('@mui/icons-material/Loop')),
29
+ Cached: React.lazy(() => import('@mui/icons-material/Cached')),
30
+ Build: React.lazy(() => import('@mui/icons-material/Build')),
31
+ Schedule: React.lazy(() => import('@mui/icons-material/Schedule')),
32
+ CalendarMonth: React.lazy(() => import('@mui/icons-material/CalendarMonth')),
33
+ Message: React.lazy(() => import('@mui/icons-material/Message')),
34
+ Forum: React.lazy(() => import('@mui/icons-material/Forum')),
35
+ WhatsApp: React.lazy(() => import('@mui/icons-material/WhatsApp')),
36
+ Telegram: React.lazy(() => import('@mui/icons-material/Telegram')),
37
+ BusinessCenter: React.lazy(() => import('@mui/icons-material/BusinessCenter')),
38
+ TrendingUp: React.lazy(() => import('@mui/icons-material/TrendingUp')),
39
+ ShoppingCart: React.lazy(() => import('@mui/icons-material/ShoppingCart')),
40
+ Cloud: React.lazy(() => import('@mui/icons-material/Cloud')),
41
+ Code: React.lazy(() => import('@mui/icons-material/Code')),
42
+ Storage: React.lazy(() => import('@mui/icons-material/Storage')),
43
+ Dns: React.lazy(() => import('@mui/icons-material/Dns')),
44
+ Layers: React.lazy(() => import('@mui/icons-material/Layers')),
45
+ Security: React.lazy(() => import('@mui/icons-material/Security')),
46
+ Policy: React.lazy(() => import('@mui/icons-material/Policy')),
47
+ CalendarToday: React.lazy(() => import('@mui/icons-material/CalendarToday')),
48
+ VideoLibrary: React.lazy(() => import('@mui/icons-material/VideoLibrary')),
49
+ DeveloperMode: React.lazy(() => import('@mui/icons-material/DeveloperMode')),
50
+ CurrencyBitcoin: React.lazy(() => import('@mui/icons-material/CurrencyBitcoin')),
51
+ Brush: React.lazy(() => import('@mui/icons-material/Brush')),
52
+ Menu: React.lazy(() => import('@mui/icons-material/Menu')),
53
+ };
54
+
55
+ export function normalizeMuiName(name: string = ''): string {
56
+ if (typeof name !== 'string') return '';
57
+ let n = name.trim();
58
+ n = n.replace(/^mui[:/.-]\s*/i, '');
59
+ n = n
60
+ .replace(/[^a-zA-Z0-9]+/g, ' ')
61
+ .split(' ')
62
+ .filter(Boolean)
63
+ .map((s) => s.charAt(0).toUpperCase() + s.slice(1))
64
+ .join('');
65
+ return n;
66
+ }
67
+
68
+ export function getMuiIcon(name: string): MuiIconComp | null {
69
+ const key = normalizeMuiName(name);
70
+ return key && MUI_MAP[key] ? MUI_MAP[key] : null;
71
+ }
72
+
73
+ export function hasMuiIcon(name: string): boolean {
74
+ const key = normalizeMuiName(name);
75
+ return Boolean(key && MUI_MAP[key]);
76
+ }
77
+
78
+ // Default export following the pattern in Lucide.ts
79
+ const materialPack = {
80
+ prefix: MUI_PREFIX,
81
+ map: MUI_MAP,
82
+ normalize: normalizeMuiName,
83
+ get: getMuiIcon,
84
+ has: hasMuiIcon,
85
+ };
86
+
87
+ export default materialPack;