this.gui 1.0.18 → 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.
- package/.storybook/main.js +40 -0
- package/.storybook/manager-head.html +13 -0
- package/.storybook/manager.js +15 -0
- package/.storybook/preview.tsx +54 -0
- package/.storybook/vitest.setup.js +6 -0
- package/.storybook/withLayout.tsx +18 -0
- package/README.md +1 -220
- package/dist/GUI.png +0 -0
- package/dist/GUI2.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/this-gui.es.js +108493 -5056
- package/dist/this-gui.umd.js +239 -44
- package/dist/this.GUI.png +0 -0
- package/nodes/overall approach.md +93 -0
- package/notes/Proyect.md +109 -0
- package/package.json +71 -54
- package/public/GUI.png +0 -0
- package/public/GUI2.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/this.GUI.png +0 -0
- package/src/components/generics/Cards/Gridme.jsx +52 -0
- package/src/components/generics/Cards/LilBox.jsx +65 -0
- package/src/components/generics/Cards/ModuleCard.jsx +106 -0
- package/src/components/generics/Chats/FullChatBot.jsx +223 -0
- package/src/components/generics/Code/CodeBlock.jsx +33 -0
- package/src/components/generics/Feedback/Callout.jsx +92 -0
- package/src/components/generics/Layout/GridX.jsx +29 -0
- package/src/components/generics/Layout/Hero2.jsx +132 -0
- package/src/components/generics/Layout/PageContainer.jsx +29 -0
- package/src/components/generics/Layout/PageDivider.jsx +20 -0
- package/src/components/generics/Layout/Section.jsx +43 -0
- package/src/components/generics/Layout/SectionHeader.jsx +21 -0
- package/src/components/generics/Media/Img.jsx +58 -0
- package/src/components/generics/Media/VideoEmbed.jsx +51 -0
- package/src/components/generics/Organization/TableOfContents.jsx +51 -0
- package/src/components/generics/Organization/Tabs.jsx +45 -0
- package/src/components/generics/Text/TextList.jsx +41 -0
- package/src/components/generics/Text/TextParagraph.jsx +28 -0
- package/src/components/generics/Text/TextQuote.jsx +23 -0
- package/src/components/generics/Text/TextTitle.jsx +44 -0
- package/src/components/this.me/MeActive.jsx +24 -0
- package/src/components/this.me/MeFloating.jsx +183 -0
- package/src/components/this.me/MeInactive.jsx +21 -0
- package/src/components/this.me/MeListUs.jsx +40 -0
- package/src/components/this.me/MeState.jsx +25 -0
- package/src/components/this.me/hooks/useMe.js +43 -0
- package/src/context/GuiProvider.tsx +243 -0
- package/src/gui/atoms/AppBar/AppBar.resolver.tsx +77 -0
- package/src/gui/atoms/AppBar/AppBar.stories.tsx +232 -0
- package/src/gui/atoms/AppBar/AppBar.tsx +10 -0
- package/src/gui/atoms/Box/Box.resolver.tsx +171 -0
- package/src/gui/atoms/Box/Box.stories.tsx +271 -0
- package/src/gui/atoms/Box/Box.tsx +15 -0
- package/src/gui/atoms/Button/Button.resolver.tsx +98 -0
- package/src/gui/atoms/Button/Button.stories.tsx +225 -0
- package/src/gui/atoms/Button/Button.tsx +40 -0
- package/src/gui/atoms/Collapse/Collapse.resolver.tsx +85 -0
- package/src/gui/atoms/Collapse/Collapse.stories.tsx +136 -0
- package/src/gui/atoms/Collapse/Collapse.tsx +17 -0
- package/src/gui/atoms/Divider/Divider.resolver.tsx +95 -0
- package/src/gui/atoms/Divider/Divider.stories.tsx +109 -0
- package/src/gui/atoms/Divider/Divider.tsx +14 -0
- package/src/gui/atoms/Drawer/Drawer.resolver.tsx +116 -0
- package/src/gui/atoms/Drawer/Drawer.stories.tsx +229 -0
- package/src/gui/atoms/Drawer/Drawer.tsx +8 -0
- package/src/gui/atoms/IconButton/IconButton.resolver.tsx +135 -0
- package/src/gui/atoms/IconButton/IconButton.stories.tsx +141 -0
- package/src/gui/atoms/IconButton/IconButton.tsx +22 -0
- package/src/gui/atoms/Link/Link.resolver.tsx +75 -0
- package/src/gui/atoms/Link/Link.stories.tsx +164 -0
- package/src/gui/atoms/Link/Link.tsx +14 -0
- package/src/gui/atoms/List/List.resolver.tsx +95 -0
- package/src/gui/atoms/List/List.stories.tsx +143 -0
- package/src/gui/atoms/List/List.tsx +20 -0
- package/src/gui/atoms/ListItem/ListItem.resolver.tsx +88 -0
- package/src/gui/atoms/ListItem/ListItem.stories.tsx +157 -0
- package/src/gui/atoms/ListItem/ListItem.tsx +19 -0
- package/src/gui/atoms/ListItemButton/ListItemButton.resolver.tsx +208 -0
- package/src/gui/atoms/ListItemButton/ListItemButton.stories.tsx +161 -0
- package/src/gui/atoms/ListItemButton/ListItemButton.tsx +15 -0
- package/src/gui/atoms/ListItemIcon/ListItemIcon.resolver.tsx +102 -0
- package/src/gui/atoms/ListItemIcon/ListItemIcon.stories.tsx +135 -0
- package/src/gui/atoms/ListItemIcon/ListItemIcon.tsx +11 -0
- package/src/gui/atoms/ListItemText/ListItemText.resolver.tsx +112 -0
- package/src/gui/atoms/ListItemText/ListItemText.stories.tsx +162 -0
- package/src/gui/atoms/ListItemText/ListItemText.tsx +15 -0
- package/src/gui/atoms/Menu/Menu.resolver.tsx +112 -0
- package/src/gui/atoms/Menu/Menu.stories.tsx +168 -0
- package/src/gui/atoms/Menu/Menu.tsx +17 -0
- package/src/gui/atoms/MenuItem/MenuItem.resolver.tsx +183 -0
- package/src/gui/atoms/MenuItem/MenuItem.stories.tsx +138 -0
- package/src/gui/atoms/MenuItem/MenuItem.tsx +14 -0
- package/src/gui/atoms/Paper/Paper.resolver.tsx +98 -0
- package/src/gui/atoms/Paper/Paper.stories.tsx +191 -0
- package/src/gui/atoms/Paper/Paper.tsx +17 -0
- package/src/gui/atoms/Stack/Stack.resolver.tsx +94 -0
- package/src/gui/atoms/Stack/Stack.stories.tsx +166 -0
- package/src/gui/atoms/Stack/Stack.tsx +15 -0
- package/src/gui/atoms/Switch/Switch.resolver.tsx +53 -0
- package/src/gui/atoms/Switch/Switch.stories.tsx +242 -0
- package/src/gui/atoms/Switch/Switch.tsx +22 -0
- package/src/gui/atoms/Toolbar/Toolbar.resolver.tsx +60 -0
- package/src/gui/atoms/Toolbar/Toolbar.stories.tsx +163 -0
- package/src/gui/atoms/Toolbar/Toolbar.tsx +16 -0
- package/src/gui/atoms/Tooltip/Tooltip.resolver.tsx +142 -0
- package/src/gui/atoms/Tooltip/Tooltip.stories.tsx +118 -0
- package/src/gui/atoms/Tooltip/Tooltip.tsx +78 -0
- package/src/gui/atoms/Typography/Typography.resolver.tsx +158 -0
- package/src/gui/atoms/Typography/Typography.stories.tsx +228 -0
- package/src/gui/atoms/Typography/Typography.tsx +27 -0
- package/src/gui/atoms.tsx +129 -0
- package/src/gui/index.ts +69 -0
- package/src/gui/molecules/AppBars/Footer/Footer.resolver.tsx +104 -0
- package/src/gui/molecules/AppBars/Footer/Footer.stories.tsx +499 -0
- package/src/gui/molecules/AppBars/Footer/Footer.tsx +307 -0
- package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.resolver.tsx +75 -0
- package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.stories.tsx +61 -0
- package/src/gui/molecules/AppBars/LeftSidebar/LeftSidebar.tsx +511 -0
- package/src/gui/molecules/AppBars/LeftSidebar/SidebarToggleButton.tsx +51 -0
- package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.resolver.tsx +97 -0
- package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.stories.tsx +294 -0
- package/src/gui/molecules/AppBars/RightSidebar/RightSidebar.tsx +295 -0
- package/src/gui/molecules/AppBars/StickyOptions/StickyOptionsTop.stories.tsx +480 -0
- package/src/gui/molecules/AppBars/StickyOptions/StickyOptionsTop.tsx +484 -0
- package/src/gui/molecules/AppBars/TopBar/TopBar.resolver.tsx +84 -0
- package/src/gui/molecules/AppBars/TopBar/TopBar.stories.tsx +297 -0
- package/src/gui/molecules/AppBars/TopBar/TopBar.tsx +299 -0
- package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.resolver.tsx +72 -0
- package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.stories.tsx +154 -0
- package/src/gui/molecules/Utilities/ThemeModeToggle/ThemeModeToggle.tsx +100 -0
- package/src/gui/molecules/Utilities/ThemeSelector.jsx +281 -0
- package/src/gui/utils/nodeID.ts +8 -0
- package/src/index.js +111 -0
- package/src/registry/GuiRegistry.ts +19 -0
- package/src/registry/factory.ts +12 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/types.ts +6 -0
- package/src/stories/01.Home.mdx +22 -0
- package/src/stories/02.Understanding.This.GUI.md +149 -0
- package/src/stories/03.Themes.mdx +235 -0
- package/src/stories/04.GuiProvider.md +126 -0
- package/src/stories/04.GuiProvider.mdx +129 -0
- package/src/stories/Theme/BreakPointsAndGrids.stories.jsx +185 -0
- package/src/stories/Theme/Colors.stories.jsx +245 -0
- package/src/stories/Theme/Icons.stories.jsx +313 -0
- package/src/stories/Theme/Motion.stories.jsx +206 -0
- package/src/stories/Theme/ShadowAndElevation.stories.jsx +95 -0
- package/src/stories/Theme/SpacingAndRadius.stories.jsx +129 -0
- package/src/stories/Theme/Typography.stories.jsx +211 -0
- package/src/stories/assets/this.GUI.png +0 -0
- package/src/templates/BrowserExtension.jsx +56 -0
- package/src/templates/Layout.tsx +36 -0
- package/src/templates/Minimal.jsx +123 -0
- package/src/templates/Shell/Shell.jsx +107 -0
- package/src/themes/fromTokens.ts +352 -0
- package/src/themes/icons/Icon.tsx +137 -0
- package/src/themes/icons/packs/Lucide.ts +72 -0
- package/src/themes/icons/packs/Material.ts +87 -0
- package/src/themes/icons/registry.tsx +178 -0
- package/src/themes/index.js +116 -0
- package/src/themes/theme.d.ts +116 -0
- package/src/themes/tokens/global.tokens.json +107 -0
- package/src/themes/tokens/neurons/dark.tokens.json +45 -0
- package/src/themes/tokens/neurons/light.tokens.json +51 -0
- package/src/themes/tokens/neurons/manifest.json +23 -0
- package/src/types/theme.d.ts +32 -0
- package/src/types/viewport.ts +132 -0
- package/tsconfig.json +24 -0
- package/vite.config.js +74 -0
- package/dist/style.css +0 -1
- package/src/App.jsx +0 -39
- package/src/CreatePage.jsx +0 -61
- package/src/MDXEditor.jsx +0 -51
- package/src/MdxProvider.jsx +0 -20
- package/src/Page.jsx +0 -28
- package/src/PageDashboard.jsx +0 -56
- package/src/SiteBuilder.jsx +0 -108
- package/src/example.json +0 -43
- package/src/index.mdx +0 -164
- package/src/main.jsx +0 -15
- package/src/scripts/ComponentRegistry.js +0 -70
- package/src/scripts/logASCIIArt.js +0 -12
- package/src/scripts/postinstall.js +0 -111
- package/src/scripts/renderComponents.js +0 -11
- package/src/stories/Atoms/Alert/Alert.css +0 -211
- package/src/stories/Atoms/Alert/Alert.jsx +0 -56
- package/src/stories/Atoms/Alert/Alert.stories.jsx +0 -167
- package/src/stories/Atoms/Audio/Audio.css +0 -259
- package/src/stories/Atoms/Audio/Audio.jsx +0 -216
- package/src/stories/Atoms/Audio/Audio.stories.jsx +0 -191
- package/src/stories/Atoms/Badge/Badge.css +0 -249
- package/src/stories/Atoms/Badge/Badge.jsx +0 -54
- package/src/stories/Atoms/Badge/Badge.stories.jsx +0 -121
- package/src/stories/Atoms/Button/Button.css +0 -332
- package/src/stories/Atoms/Button/Button.jsx +0 -44
- package/src/stories/Atoms/Button/Button.stories.jsx +0 -209
- package/src/stories/Atoms/Caption/Caption.css +0 -169
- package/src/stories/Atoms/Caption/Caption.jsx +0 -72
- package/src/stories/Atoms/Caption/Caption.stories.jsx +0 -207
- package/src/stories/Atoms/Checkbox/Checkbox.css +0 -182
- package/src/stories/Atoms/Checkbox/Checkbox.jsx +0 -83
- package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +0 -112
- package/src/stories/Atoms/Container/Container.css +0 -470
- package/src/stories/Atoms/Container/Container.jsx +0 -116
- package/src/stories/Atoms/Container/Container.stories.jsx +0 -145
- package/src/stories/Atoms/Divider/Divider.css +0 -147
- package/src/stories/Atoms/Divider/Divider.jsx +0 -62
- package/src/stories/Atoms/Divider/Divider.stories.jsx +0 -105
- package/src/stories/Atoms/Grid/Grid.css +0 -160
- package/src/stories/Atoms/Grid/Grid.jsx +0 -43
- package/src/stories/Atoms/Grid/Grid.stories.jsx +0 -84
- package/src/stories/Atoms/Heading/Heading.css +0 -112
- package/src/stories/Atoms/Heading/Heading.jsx +0 -69
- package/src/stories/Atoms/Heading/Heading.stories.jsx +0 -130
- package/src/stories/Atoms/Icon/Icon.css +0 -240
- package/src/stories/Atoms/Icon/Icon.jsx +0 -80
- package/src/stories/Atoms/Icon/Icon.stories.jsx +0 -177
- package/src/stories/Atoms/Image/Image.css +0 -245
- package/src/stories/Atoms/Image/Image.jsx +0 -175
- package/src/stories/Atoms/Image/Image.stories.jsx +0 -332
- package/src/stories/Atoms/Label/Label.css +0 -171
- package/src/stories/Atoms/Label/Label.jsx +0 -71
- package/src/stories/Atoms/Label/Label.stories.jsx +0 -180
- package/src/stories/Atoms/Link/Link.css +0 -51
- package/src/stories/Atoms/Link/Link.jsx +0 -72
- package/src/stories/Atoms/Link/Link.stories.jsx +0 -153
- package/src/stories/Atoms/Loader/Loader.css +0 -106
- package/src/stories/Atoms/Loader/Loader.jsx +0 -58
- package/src/stories/Atoms/Loader/Loader.stories.jsx +0 -99
- package/src/stories/Atoms/Logo/Logo.css +0 -94
- package/src/stories/Atoms/Logo/Logo.jsx +0 -53
- package/src/stories/Atoms/Logo/Logo.stories.jsx +0 -120
- package/src/stories/Atoms/Paragraph/Paragraph.css +0 -180
- package/src/stories/Atoms/Paragraph/Paragraph.jsx +0 -77
- package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +0 -143
- package/src/stories/Atoms/ProgressBar/ProgressBar.css +0 -127
- package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +0 -40
- package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +0 -86
- package/src/stories/Atoms/RadioButton/RadioButton.css +0 -130
- package/src/stories/Atoms/RadioButton/RadioButton.jsx +0 -87
- package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +0 -113
- package/src/stories/Atoms/Range/Range.css +0 -169
- package/src/stories/Atoms/Range/Range.jsx +0 -87
- package/src/stories/Atoms/Range/Range.stories.jsx +0 -110
- package/src/stories/Atoms/Section/Section.css +0 -268
- package/src/stories/Atoms/Section/Section.jsx +0 -63
- package/src/stories/Atoms/Section/Section.stories.jsx +0 -46
- package/src/stories/Atoms/Select/Select.css +0 -87
- package/src/stories/Atoms/Select/Select.jsx +0 -73
- package/src/stories/Atoms/Select/Select.stories.jsx +0 -109
- package/src/stories/Atoms/Slider/Slider.css +0 -90
- package/src/stories/Atoms/Slider/Slider.jsx +0 -129
- package/src/stories/Atoms/Slider/Slider.stories.jsx +0 -90
- package/src/stories/Atoms/Snackbar/Snackbar.css +0 -313
- package/src/stories/Atoms/Snackbar/Snackbar.jsx +0 -72
- package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +0 -78
- package/src/stories/Atoms/Spacer/Spacer.css +0 -114
- package/src/stories/Atoms/Spacer/Spacer.jsx +0 -35
- package/src/stories/Atoms/Spacer/Spacer.stories.jsx +0 -61
- package/src/stories/Atoms/Spinner/Spinner.css +0 -110
- package/src/stories/Atoms/Spinner/Spinner.jsx +0 -65
- package/src/stories/Atoms/Spinner/Spinner.stories.jsx +0 -58
- package/src/stories/Atoms/Tag/Tag.css +0 -112
- package/src/stories/Atoms/Tag/Tag.jsx +0 -75
- package/src/stories/Atoms/Tag/Tag.stories.jsx +0 -67
- package/src/stories/Atoms/TextArea/TextArea.css +0 -99
- package/src/stories/Atoms/TextArea/TextArea.jsx +0 -118
- package/src/stories/Atoms/TextArea/TextArea.stories.jsx +0 -36
- package/src/stories/Atoms/TextInput/TextInput.css +0 -102
- package/src/stories/Atoms/TextInput/TextInput.jsx +0 -133
- package/src/stories/Atoms/TextInput/TextInput.stories.jsx +0 -69
- package/src/stories/Atoms/Toggle/Toggle.css +0 -118
- package/src/stories/Atoms/Toggle/Toggle.jsx +0 -69
- package/src/stories/Atoms/Toggle/Toggle.stories.jsx +0 -35
- package/src/stories/Atoms/Tooltip/Tooltip.css +0 -383
- package/src/stories/Atoms/Tooltip/Tooltip.jsx +0 -46
- package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +0 -52
- package/src/stories/Atoms/Video/Video.css +0 -39
- package/src/stories/Atoms/Video/Video.jsx +0 -78
- package/src/stories/Atoms/Video/Video.stories.jsx +0 -41
- package/src/stories/Atoms/index.js +0 -72
- package/src/stories/Atoms/meta_Atoms.js +0 -51
- package/src/stories/Components.js +0 -198
- package/src/stories/Getting Started.mdx +0 -239
- package/src/stories/Layouts/Accordion/Accordion.css +0 -293
- package/src/stories/Layouts/Accordion/Accordion.jsx +0 -74
- package/src/stories/Layouts/Accordion/Accordion.stories.jsx +0 -39
- package/src/stories/Layouts/Flexbox/Flexbox.css +0 -16
- package/src/stories/Layouts/Flexbox/Flexbox.jsx +0 -11
- package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +0 -28
- package/src/stories/Layouts/Footer/Footer.css +0 -16
- package/src/stories/Layouts/Footer/Footer.jsx +0 -31
- package/src/stories/Layouts/Footer/Footer.stories.jsx +0 -28
- package/src/stories/Layouts/Header/Header.css +0 -16
- package/src/stories/Layouts/Header/Header.jsx +0 -31
- package/src/stories/Layouts/Header/Header.stories.jsx +0 -28
- package/src/stories/Layouts/HeroBanner/HeroBanner.css +0 -16
- package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +0 -31
- package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +0 -28
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +0 -16
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +0 -31
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +0 -28
- package/src/stories/Layouts/Pagination/Pagination.css +0 -16
- package/src/stories/Layouts/Pagination/Pagination.jsx +0 -31
- package/src/stories/Layouts/Pagination/Pagination.stories.jsx +0 -28
- package/src/stories/Layouts/Sidebar/Sidebar.css +0 -16
- package/src/stories/Layouts/Sidebar/Sidebar.jsx +0 -71
- package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +0 -28
- package/src/stories/Layouts/Tabs/Tabs.css +0 -16
- package/src/stories/Layouts/Tabs/Tabs.jsx +0 -31
- package/src/stories/Layouts/Tabs/Tabs.stories.jsx +0 -28
- package/src/stories/Layouts/index.js +0 -25
- package/src/stories/Layouts/meta_Layouts.js +0 -28
- package/src/stories/MDX.mdx +0 -118
- package/src/stories/Miscellaneous/Miscellaneous.js +0 -24
- package/src/stories/Molecules/Accordion/Accordion.css +0 -4
- package/src/stories/Molecules/Accordion/Accordion.jsx +0 -25
- package/src/stories/Molecules/Accordion/Accordion.stories.jsx +0 -20
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +0 -97
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +0 -244
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +0 -55
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +0 -130
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +0 -80
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +0 -20
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +0 -147
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +0 -51
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +0 -36
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +0 -465
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +0 -47
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +0 -44
- package/src/stories/Molecules/Card/Card.css +0 -41
- package/src/stories/Molecules/Card/Card.jsx +0 -92
- package/src/stories/Molecules/Card/Card.stories.jsx +0 -34
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +0 -35
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +0 -104
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +0 -81
- package/src/stories/Molecules/DataTable/DataTable.css +0 -4
- package/src/stories/Molecules/DataTable/DataTable.jsx +0 -25
- package/src/stories/Molecules/DataTable/DataTable.stories.jsx +0 -20
- package/src/stories/Molecules/Dropdown/Dropdown.css +0 -192
- package/src/stories/Molecules/Dropdown/Dropdown.jsx +0 -96
- package/src/stories/Molecules/Dropdown/Dropdown.stories.jsx +0 -45
- package/src/stories/Molecules/FileUpload/FileUpload.css +0 -4
- package/src/stories/Molecules/FileUpload/FileUpload.jsx +0 -25
- package/src/stories/Molecules/FileUpload/FileUpload.stories.jsx +0 -20
- package/src/stories/Molecules/FormField/FormField.css +0 -4
- package/src/stories/Molecules/FormField/FormField.jsx +0 -25
- package/src/stories/Molecules/FormField/FormField.stories.jsx +0 -20
- package/src/stories/Molecules/Header/Header.css +0 -35
- package/src/stories/Molecules/Header/Header.jsx +0 -76
- package/src/stories/Molecules/Header/Header.stories.jsx +0 -28
- package/src/stories/Molecules/IconButton/IconButton.css +0 -4
- package/src/stories/Molecules/IconButton/IconButton.jsx +0 -25
- package/src/stories/Molecules/IconButton/IconButton.stories.jsx +0 -20
- package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.css +0 -4
- package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.jsx +0 -25
- package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.stories.jsx +0 -20
- package/src/stories/Molecules/InputGroup/InputGroup.css +0 -4
- package/src/stories/Molecules/InputGroup/InputGroup.jsx +0 -25
- package/src/stories/Molecules/InputGroup/InputGroup.stories.jsx +0 -20
- package/src/stories/Molecules/InputWithLabel/InputWithLabel.css +0 -4
- package/src/stories/Molecules/InputWithLabel/InputWithLabel.jsx +0 -25
- package/src/stories/Molecules/InputWithLabel/InputWithLabel.stories.jsx +0 -20
- package/src/stories/Molecules/List/List.css +0 -4
- package/src/stories/Molecules/List/List.jsx +0 -25
- package/src/stories/Molecules/List/List.stories.jsx +0 -20
- package/src/stories/Molecules/MediaCard/MediaCard.css +0 -4
- package/src/stories/Molecules/MediaCard/MediaCard.jsx +0 -25
- package/src/stories/Molecules/MediaCard/MediaCard.stories.jsx +0 -20
- package/src/stories/Molecules/Modal/Modal.css +0 -4
- package/src/stories/Molecules/Modal/Modal.jsx +0 -25
- package/src/stories/Molecules/Modal/Modal.stories.jsx +0 -20
- package/src/stories/Molecules/Navbar/Navbar.css +0 -91
- package/src/stories/Molecules/Navbar/Navbar.jsx +0 -82
- package/src/stories/Molecules/Navbar/Navbar.stories.jsx +0 -70
- package/src/stories/Molecules/Notification/Notification.css +0 -4
- package/src/stories/Molecules/Notification/Notification.jsx +0 -25
- package/src/stories/Molecules/Notification/Notification.stories.jsx +0 -20
- package/src/stories/Molecules/PricingTable/PricingTable.css +0 -4
- package/src/stories/Molecules/PricingTable/PricingTable.jsx +0 -25
- package/src/stories/Molecules/PricingTable/PricingTable.stories.jsx +0 -20
- package/src/stories/Molecules/SearchBar/SearchBar.css +0 -69
- package/src/stories/Molecules/SearchBar/SearchBar.jsx +0 -73
- package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +0 -29
- package/src/stories/Molecules/SelectTheme/SelectTheme.css +0 -25
- package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +0 -22
- package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +0 -24
- package/src/stories/Molecules/Sidebar/Sidebar.css +0 -67
- package/src/stories/Molecules/Sidebar/Sidebar.jsx +0 -80
- package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +0 -35
- package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.css +0 -4
- package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.jsx +0 -25
- package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.stories.jsx +0 -20
- package/src/stories/Molecules/index.js +0 -58
- package/src/stories/Molecules/meta_Molecules.js +0 -47
- package/src/stories/Organisms/Profile/UserFriends/UserFriends.context.jsx +0 -15
- package/src/stories/Organisms/Profile/UserFriends/UserFriends.css +0 -4
- package/src/stories/Organisms/Profile/UserFriends/UserFriends.jsx +0 -13
- package/src/stories/Organisms/Profile/UserFriends/UserFriends.stories.jsx +0 -26
- package/src/stories/Organisms/Profile/UserPosts/UserPosts.context.jsx +0 -15
- package/src/stories/Organisms/Profile/UserPosts/UserPosts.css +0 -4
- package/src/stories/Organisms/Profile/UserPosts/UserPosts.jsx +0 -13
- package/src/stories/Organisms/Profile/UserPosts/UserPosts.stories.jsx +0 -26
- package/src/stories/Organisms/Profile/UserProfile/UserProfile.context.jsx +0 -15
- package/src/stories/Organisms/Profile/UserProfile/UserProfile.css +0 -4
- package/src/stories/Organisms/Profile/UserProfile/UserProfile.jsx +0 -13
- package/src/stories/Organisms/Profile/UserProfile/UserProfile.stories.jsx +0 -26
- package/src/stories/Organisms/meta_Organisms.js +0 -39
- package/src/stories/Pages/Page/Page.css +0 -69
- package/src/stories/Pages/Page/Page.jsx +0 -69
- package/src/stories/Pages/Page/Page.stories.js +0 -26
- package/src/stories/Pages/Page/Pages.js +0 -31
- package/src/stories/Templates/AdminDashboard/AdminDashboard.css +0 -7
- package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +0 -24
- package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +0 -20
- package/src/stories/Templates/CallToAction/CallToAction.css +0 -7
- package/src/stories/Templates/CallToAction/CallToAction.jsx +0 -24
- package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +0 -20
- package/src/stories/Templates/FeaturesList/FeaturesList.css +0 -7
- package/src/stories/Templates/FeaturesList/FeaturesList.jsx +0 -24
- package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +0 -20
- package/src/stories/Templates/FormSection/FormSection.css +0 -7
- package/src/stories/Templates/FormSection/FormSection.jsx +0 -24
- package/src/stories/Templates/FormSection/FormSection.stories.jsx +0 -20
- package/src/stories/Templates/HeroSection/HeroSection.css +0 -7
- package/src/stories/Templates/HeroSection/HeroSection.jsx +0 -24
- package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +0 -20
- package/src/stories/Templates/LocationInfo/LocationInfo.css +0 -7
- package/src/stories/Templates/LocationInfo/LocationInfo.jsx +0 -24
- package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +0 -20
- package/src/stories/Templates/ProductPage/ProductPage.css +0 -7
- package/src/stories/Templates/ProductPage/ProductPage.jsx +0 -24
- package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +0 -20
- package/src/stories/Templates/RegistrationPage/RegistrationPage.css +0 -7
- package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +0 -24
- package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +0 -20
- package/src/stories/Templates/ShoppingCart/ShoppingCart.css +0 -7
- package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +0 -24
- package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +0 -20
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +0 -7
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +0 -24
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +0 -20
- package/src/stories/Templates/SignInPage/SignInPage.css +0 -7
- package/src/stories/Templates/SignInPage/SignInPage.jsx +0 -24
- package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +0 -20
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +0 -7
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +0 -24
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +0 -20
- package/src/stories/Templates/Testimonials/Testimonials.css +0 -7
- package/src/stories/Templates/Testimonials/Testimonials.jsx +0 -24
- package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +0 -20
- package/src/stories/Templates/index.js +0 -33
- package/src/stories/Templates/meta_Templates.js +0 -29
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/logo.png +0 -0
- package/src/stories/assets/logo.svg +0 -106
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/test.svg +0 -3
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/themes/README_Styles.md +0 -301
- package/src/themes/ThemeProvider.jsx +0 -61
- package/src/themes/styles/github/dark.css +0 -0
- package/src/themes/styles/github/light.css +0 -0
- package/src/themes/styles/neurons/dark.css +0 -247
- package/src/themes/styles/neurons/light.css +0 -170
- /package/{src/themes/styles/dracula/dark.css → .storybook/preview-head.html} +0 -0
- /package/src/{themes/styles/dracula/light.css → components/this.me/MeCard.jsx} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import IconButton from './IconButton';
|
|
4
|
+
import Icon from '@/themes/icons/Icon';
|
|
5
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
6
|
+
import GuiProvider from '@/context/GuiProvider';
|
|
7
|
+
const meta: Meta<typeof IconButton> = {
|
|
8
|
+
title: 'Atoms/IconButton',
|
|
9
|
+
component: IconButton,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => (
|
|
13
|
+
<MemoryRouter>
|
|
14
|
+
<GuiProvider>
|
|
15
|
+
<div style={{ padding: 16, minHeight: 200 }}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
</GuiProvider>
|
|
19
|
+
</MemoryRouter>
|
|
20
|
+
),
|
|
21
|
+
],
|
|
22
|
+
parameters: {
|
|
23
|
+
docs: {
|
|
24
|
+
description: {
|
|
25
|
+
component: `
|
|
26
|
+
The **IconButton** atom is a thin wrapper around MUI's \`MuiIconButton\`, staying faithful to its API and polymorphism (\`component\`).
|
|
27
|
+
|
|
28
|
+
In **declarative** mode (resolver), you can pass an \`icon\` token (e.g., \`"lucide:menu"\`, \`"mui:Close"\`) and it will render through the Icon registry. You can also style the icon with \`iconSx\` while using \`sx\` for the button root.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
## React usage
|
|
32
|
+
~~~jsx
|
|
33
|
+
<IconButton color="primary" size="medium" aria-label="open menu">
|
|
34
|
+
<Icon name="lucide:menu" />
|
|
35
|
+
</IconButton>
|
|
36
|
+
~~~
|
|
37
|
+
|
|
38
|
+
## Declarative JSON / Resolver
|
|
39
|
+
~~~json
|
|
40
|
+
{
|
|
41
|
+
"type": "IconButton",
|
|
42
|
+
"props": {
|
|
43
|
+
"color": "primary",
|
|
44
|
+
"size": "medium",
|
|
45
|
+
"icon": "lucide:menu",
|
|
46
|
+
"sx": { "border": "1px solid", "borderColor": "divider" },
|
|
47
|
+
"iconSx": { "opacity": 0.9 }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
~~~
|
|
51
|
+
`,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
controls: {
|
|
55
|
+
exclude: ['component', 'children'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
argTypes: {
|
|
59
|
+
color: {
|
|
60
|
+
control: { type: 'select' },
|
|
61
|
+
options: ['inherit', 'default', 'primary', 'secondary', 'success', 'error', 'info', 'warning'],
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
control: { type: 'radio' },
|
|
65
|
+
options: ['small', 'medium', 'large'],
|
|
66
|
+
},
|
|
67
|
+
edge: {
|
|
68
|
+
control: { type: 'radio' },
|
|
69
|
+
options: ['start', 'end', false],
|
|
70
|
+
},
|
|
71
|
+
disabled: { control: 'boolean' },
|
|
72
|
+
sx: { control: 'object' },
|
|
73
|
+
},
|
|
74
|
+
args: {
|
|
75
|
+
color: 'default',
|
|
76
|
+
size: 'medium',
|
|
77
|
+
edge: false,
|
|
78
|
+
disabled: false,
|
|
79
|
+
sx: {},
|
|
80
|
+
children: undefined,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default meta;
|
|
85
|
+
type Story = StoryObj<typeof IconButton>;
|
|
86
|
+
export const Playground: Story = {
|
|
87
|
+
render: (args) => (
|
|
88
|
+
<IconButton {...args} aria-label="menu">
|
|
89
|
+
<Icon name="lucide:menu" />
|
|
90
|
+
</IconButton>
|
|
91
|
+
),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const Colors: Story = {
|
|
95
|
+
render: () => (
|
|
96
|
+
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
97
|
+
{(['default', 'primary', 'secondary', 'success', 'info', 'warning', 'error'] as const).map((c) => (
|
|
98
|
+
<IconButton key={c} color={c} aria-label={c}>
|
|
99
|
+
<Icon name="mui:Favorite" />
|
|
100
|
+
</IconButton>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Sizes: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
|
|
109
|
+
<IconButton size="small" aria-label="small">
|
|
110
|
+
<Icon name="lucide:bell" />
|
|
111
|
+
</IconButton>
|
|
112
|
+
<IconButton size="medium" aria-label="medium">
|
|
113
|
+
<Icon name="lucide:bell" />
|
|
114
|
+
</IconButton>
|
|
115
|
+
<IconButton size="large" aria-label="large">
|
|
116
|
+
<Icon name="lucide:bell" />
|
|
117
|
+
</IconButton>
|
|
118
|
+
</div>
|
|
119
|
+
),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const WithEdge: Story = {
|
|
123
|
+
render: () => (
|
|
124
|
+
<div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
|
|
125
|
+
<IconButton edge="start" aria-label="start">
|
|
126
|
+
<Icon name="lucide:chevron-left" />
|
|
127
|
+
</IconButton>
|
|
128
|
+
<IconButton edge="end" aria-label="end">
|
|
129
|
+
<Icon name="lucide:chevron-right" />
|
|
130
|
+
</IconButton>
|
|
131
|
+
</div>
|
|
132
|
+
),
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const WithSx: Story = {
|
|
136
|
+
render: () => (
|
|
137
|
+
<IconButton sx={{ border: '1px solid', borderColor: 'divider' }} aria-label="styled">
|
|
138
|
+
<Icon name="mui:Close" />
|
|
139
|
+
</IconButton>
|
|
140
|
+
),
|
|
141
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This.GUI — IconButton
|
|
3
|
+
* ----------------------------------------
|
|
4
|
+
* Thin wrapper around MUI’s IconButton.
|
|
5
|
+
*
|
|
6
|
+
* Fidelity:
|
|
7
|
+
* - Directly re-exports MUI’s IconButton so all typing and props remain intact.
|
|
8
|
+
* - Preserves polymorphism (`component` prop) via OverridableComponent.
|
|
9
|
+
* - Supports granular styling via the standard `sx` prop (MUI System).
|
|
10
|
+
*
|
|
11
|
+
* Why wrap?
|
|
12
|
+
* - Consistency with This.GUI’s atom pattern (every MUI primitive wrapped).
|
|
13
|
+
* - Provides a clean declarative/resolver entry point.
|
|
14
|
+
*/
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import MuiIconButton from '@mui/material/IconButton';
|
|
17
|
+
import type { OverridableComponent } from '@mui/material/OverridableComponent';
|
|
18
|
+
import type { IconButtonTypeMap } from '@mui/material/IconButton';
|
|
19
|
+
const IconButton = MuiIconButton as OverridableComponent<IconButtonTypeMap<{}, 'button'>>;
|
|
20
|
+
export type IconButtonProps = React.ComponentProps<typeof IconButton>;
|
|
21
|
+
(IconButton as any).displayName = 'Gui.IconButton';
|
|
22
|
+
export default IconButton;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/gui/atoms/Link/Link.resolver.tsx
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { RegistryEntry } from '@/registry/types';
|
|
4
|
+
import Link, { LinkProps as GuiLinkProps } from './Link';
|
|
5
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
6
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
7
|
+
|
|
8
|
+
/** Declarative spec for Link (JSON-friendly) */
|
|
9
|
+
type LinkSpec = {
|
|
10
|
+
type: 'Link';
|
|
11
|
+
props?: {
|
|
12
|
+
label?: React.ReactNode; // convenience: text content
|
|
13
|
+
children?: React.ReactNode; // explicit children (wins over label)
|
|
14
|
+
|
|
15
|
+
href?: string; // external
|
|
16
|
+
to?: string; // internal (react-router)
|
|
17
|
+
external?: boolean; // force anchor + target/rel
|
|
18
|
+
underline?: 'none' | 'hover' | 'always';
|
|
19
|
+
|
|
20
|
+
// pass-through styling/attrs
|
|
21
|
+
sx?: SxProps<Theme>;
|
|
22
|
+
className?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
target?: string;
|
|
25
|
+
rel?: string;
|
|
26
|
+
color?: GuiLinkProps['color'];
|
|
27
|
+
variant?: GuiLinkProps['variant'];
|
|
28
|
+
// ...cualquier otro prop permitido por tu Link
|
|
29
|
+
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const LinkResolver: RegistryEntry = {
|
|
36
|
+
type: 'Link',
|
|
37
|
+
resolve(spec: LinkSpec) {
|
|
38
|
+
const p = spec.props ?? {};
|
|
39
|
+
const nodeId = ensureNodeId('link', p.id as string | undefined);
|
|
40
|
+
|
|
41
|
+
// Routing / destino
|
|
42
|
+
const routingProps: Partial<GuiLinkProps> =
|
|
43
|
+
p.external
|
|
44
|
+
? {
|
|
45
|
+
href: p.href,
|
|
46
|
+
...(p.target ? { target: p.target } : { target: '_blank' }),
|
|
47
|
+
...(p.rel ? { rel: p.rel } : { rel: 'noopener noreferrer' }),
|
|
48
|
+
}
|
|
49
|
+
: p.to
|
|
50
|
+
? { to: p.to }
|
|
51
|
+
: p.href
|
|
52
|
+
? { href: p.href }
|
|
53
|
+
: {};
|
|
54
|
+
|
|
55
|
+
const children = p.children ?? p.label ?? null;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Link
|
|
59
|
+
underline={p.underline ?? 'hover'}
|
|
60
|
+
color={p.color}
|
|
61
|
+
variant={p.variant}
|
|
62
|
+
sx={p.sx}
|
|
63
|
+
className={p.className}
|
|
64
|
+
id={nodeId}
|
|
65
|
+
data-testid={p['data-testid']}
|
|
66
|
+
{...(p.ariaLabel ? { 'aria-label': p.ariaLabel } : {})}
|
|
67
|
+
{...routingProps}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</Link>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default LinkResolver;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Link, Button } from '@/gui/atoms';
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
4
|
+
import GuiProvider from '@/context/GuiProvider';
|
|
5
|
+
|
|
6
|
+
// ======================= Meta =======================
|
|
7
|
+
const meta: Meta<typeof Link> = {
|
|
8
|
+
title: 'Atoms/Link',
|
|
9
|
+
component: Link,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => (
|
|
13
|
+
<MemoryRouter>
|
|
14
|
+
<GuiProvider>
|
|
15
|
+
<div style={{ padding: 16, minHeight: 240 }}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
</GuiProvider>
|
|
19
|
+
</MemoryRouter>
|
|
20
|
+
),
|
|
21
|
+
],
|
|
22
|
+
parameters: {
|
|
23
|
+
docs: {
|
|
24
|
+
description: {
|
|
25
|
+
component: `
|
|
26
|
+
The **Link** primitive is a thin wrapper over MUI's \`MuiLink\` that supports **both** external links (\`href\`) and internal routing (\`to\`) using **react-router-dom**. It integrates with **This.GUI** theming via \`GuiProvider\`.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
## Features
|
|
30
|
+
- External links with \`href\` (renders an anchor).
|
|
31
|
+
- Internal navigation with \`to\` (renders a RouterLink under the hood).
|
|
32
|
+
- Works seamlessly as a child or as a render target for other primitives (e.g. \`<Button component={Link} to="/docs"/>\`).
|
|
33
|
+
- Inherits typography and color from the theme tokens.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
## Key Props
|
|
37
|
+
- \`href?: string\` — external URL.
|
|
38
|
+
- \`to?: string | LocationDescriptor\` — internal route (react-router-dom).
|
|
39
|
+
- \`underline?: 'none' | 'hover' | 'always'\` — underline behavior.
|
|
40
|
+
- \`color?: 'primary' | 'secondary' | 'inherit' | 'textPrimary' | 'textSecondary' | 'error' | 'info' | 'success' | 'warning'\`.
|
|
41
|
+
|
|
42
|
+
> Note: \`to\` and \`href\` are demonstrated in dedicated stories rather than Storybook controls.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
## Basic Usage
|
|
46
|
+
~~~jsx
|
|
47
|
+
import { Link } from '@/gui/primitives';
|
|
48
|
+
|
|
49
|
+
<Link href="https://neurons.me" target="_blank" rel="noreferrer">Visit neurons.me</Link>
|
|
50
|
+
~~~
|
|
51
|
+
|
|
52
|
+
## Internal Routing
|
|
53
|
+
~~~jsx
|
|
54
|
+
import { Link } from '@/gui/primitives';
|
|
55
|
+
|
|
56
|
+
<Link to="/docs">Go to docs</Link>
|
|
57
|
+
~~~
|
|
58
|
+
|
|
59
|
+
## As render target for Button
|
|
60
|
+
~~~jsx
|
|
61
|
+
import { Button, Link } from '@/gui/primitives';
|
|
62
|
+
|
|
63
|
+
<Button component={Link} to="/docs">Docs</Button>
|
|
64
|
+
~~~
|
|
65
|
+
|
|
66
|
+
## Declarative JSON / Config usage
|
|
67
|
+
~~~json
|
|
68
|
+
{
|
|
69
|
+
"type": "Link",
|
|
70
|
+
"props": {
|
|
71
|
+
"to": "/docs",
|
|
72
|
+
"children": "Go to docs"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
~~~
|
|
76
|
+
|
|
77
|
+
Another example with an external URL:
|
|
78
|
+
~~~json
|
|
79
|
+
{
|
|
80
|
+
"type": "Link",
|
|
81
|
+
"props": {
|
|
82
|
+
"href": "https://neurons.me",
|
|
83
|
+
"target": "_blank",
|
|
84
|
+
"rel": "noreferrer",
|
|
85
|
+
"children": "Visit neurons.me"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
~~~
|
|
89
|
+
`,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
argTypes: {
|
|
94
|
+
underline: {
|
|
95
|
+
control: { type: 'radio' },
|
|
96
|
+
options: ['none', 'hover', 'always'],
|
|
97
|
+
},
|
|
98
|
+
color: {
|
|
99
|
+
control: { type: 'select' },
|
|
100
|
+
options: ['primary', 'secondary', 'inherit', 'textPrimary', 'textSecondary', 'error', 'info', 'success', 'warning'],
|
|
101
|
+
},
|
|
102
|
+
// Do not expose component/to/href as controls — they are shown in dedicated stories
|
|
103
|
+
component: { table: { disable: true } },
|
|
104
|
+
},
|
|
105
|
+
args: {
|
|
106
|
+
underline: 'hover',
|
|
107
|
+
color: 'primary',
|
|
108
|
+
children: 'Example link',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
export default meta;
|
|
112
|
+
|
|
113
|
+
type Story = StoryObj<typeof Link>;
|
|
114
|
+
|
|
115
|
+
// ======================= Stories =======================
|
|
116
|
+
export const Playground: Story = {};
|
|
117
|
+
|
|
118
|
+
export const ExternalHref: Story = {
|
|
119
|
+
name: 'External (href)',
|
|
120
|
+
render: () => (
|
|
121
|
+
<Link href="https://neurons.me" target="_blank" rel="noreferrer">
|
|
122
|
+
Visit neurons.me
|
|
123
|
+
</Link>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const InternalTo: Story = {
|
|
128
|
+
name: 'Internal (to)',
|
|
129
|
+
render: () => <Link to="/docs">Go to docs</Link>,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const Colors: Story = {
|
|
133
|
+
render: (args) => {
|
|
134
|
+
const colors: Array<any> = ['primary', 'secondary', 'success', 'info', 'warning', 'error'];
|
|
135
|
+
return (
|
|
136
|
+
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
|
137
|
+
{colors.map((c) => (
|
|
138
|
+
<Link key={c} {...args} color={c} href="#">
|
|
139
|
+
{c[0].toUpperCase() + c.slice(1)}
|
|
140
|
+
</Link>
|
|
141
|
+
))}
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const UnderlineVariants: Story = {
|
|
148
|
+
render: (args) => (
|
|
149
|
+
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
|
|
150
|
+
<Link {...args} underline="none" href="#">None</Link>
|
|
151
|
+
<Link {...args} underline="hover" href="#">Hover</Link>
|
|
152
|
+
<Link {...args} underline="always" href="#">Always</Link>
|
|
153
|
+
</div>
|
|
154
|
+
),
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const AsButtonTarget: Story = {
|
|
158
|
+
name: 'As Button component',
|
|
159
|
+
render: () => (
|
|
160
|
+
<Button component={Link} to="/docs">
|
|
161
|
+
Docs via Link
|
|
162
|
+
</Button>
|
|
163
|
+
),
|
|
164
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Link as MuiLink, LinkProps as MuiLinkProps } from '@mui/material';
|
|
3
|
+
import { Link as RouterLink, LinkProps as RouterLinkProps } from 'react-router-dom';
|
|
4
|
+
type GuiLinkProps = MuiLinkProps & { to?: RouterLinkProps['to'] };
|
|
5
|
+
const Link = forwardRef<HTMLAnchorElement, GuiLinkProps>(function Link(props, ref) {
|
|
6
|
+
const { to, ...rest } = props;
|
|
7
|
+
if (to) {
|
|
8
|
+
return <MuiLink component={RouterLink} to={to} ref={ref} {...rest} />;
|
|
9
|
+
}
|
|
10
|
+
return <MuiLink ref={ref} {...rest} />;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default Link;
|
|
14
|
+
export type { GuiLinkProps as LinkProps };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// src/gui/atoms/List/List.resolver.tsx
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import List from './List';
|
|
4
|
+
import ListSubheader from '@mui/material/ListSubheader';
|
|
5
|
+
import Link from '../Link/Link';
|
|
6
|
+
import type { RegistryEntry, ResolveCtx } from '@/registry/types';
|
|
7
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
8
|
+
import { ensureNodeId } from '@/gui/utils/nodeID';
|
|
9
|
+
/**
|
|
10
|
+
* Declarative resolver for List
|
|
11
|
+
*
|
|
12
|
+
* Fidelity
|
|
13
|
+
* - Forwards MUI props faithfully (dense, disablePadding, subheader, etc.).
|
|
14
|
+
* - Supports polymorphism via `component` (and alias `as`).
|
|
15
|
+
* - Provides **granular styling** via `sx` (root) and optional `subheaderSx`.
|
|
16
|
+
* - Generates a stable id via `ensureNodeId`.
|
|
17
|
+
*
|
|
18
|
+
* Sugar
|
|
19
|
+
* - `subheaderText`: if provided (and `subheader` not provided), we render
|
|
20
|
+
* a `<ListSubheader />` with that text. You can style it via `subheaderSx`.
|
|
21
|
+
*
|
|
22
|
+
* Note: Routing props (`href`, `to`, `external`) are not handled at the List level.
|
|
23
|
+
*/
|
|
24
|
+
export type ListSpec = {
|
|
25
|
+
type: 'List';
|
|
26
|
+
props?: {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
// Polymorphism
|
|
29
|
+
component?: any;
|
|
30
|
+
as?: any; // alias of component
|
|
31
|
+
// MUI props (subset; others passthrough)
|
|
32
|
+
dense?: boolean;
|
|
33
|
+
disablePadding?: boolean;
|
|
34
|
+
subheader?: React.ReactNode;
|
|
35
|
+
// Sugar
|
|
36
|
+
subheaderText?: React.ReactNode;
|
|
37
|
+
subheaderSx?: SxProps<Theme>;
|
|
38
|
+
// Styling
|
|
39
|
+
sx?: SxProps<Theme>; // root styles
|
|
40
|
+
className?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
'data-testid'?: string;
|
|
43
|
+
// Arbitrary passthrough
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const ListResolver: RegistryEntry = {
|
|
49
|
+
type: 'List',
|
|
50
|
+
resolve(spec: ListSpec, _ctx?: ResolveCtx) {
|
|
51
|
+
const p = spec.props ?? {};
|
|
52
|
+
const id = ensureNodeId('list', p.id);
|
|
53
|
+
const component = p.component ?? p.as;
|
|
54
|
+
const {
|
|
55
|
+
children,
|
|
56
|
+
subheader,
|
|
57
|
+
subheaderText,
|
|
58
|
+
subheaderSx,
|
|
59
|
+
// strip resolver-only alias
|
|
60
|
+
as: _as,
|
|
61
|
+
// passthrough rest (dense, disablePadding, sx, etc.)
|
|
62
|
+
...rest
|
|
63
|
+
} = p;
|
|
64
|
+
const effectiveSubheader =
|
|
65
|
+
subheader != null
|
|
66
|
+
? subheader
|
|
67
|
+
: subheaderText != null
|
|
68
|
+
? (
|
|
69
|
+
<ListSubheader component="div" sx={subheaderSx}>
|
|
70
|
+
{subheaderText}
|
|
71
|
+
</ListSubheader>
|
|
72
|
+
)
|
|
73
|
+
: undefined;
|
|
74
|
+
|
|
75
|
+
const rootProps: any = {
|
|
76
|
+
...rest,
|
|
77
|
+
sx: p.sx,
|
|
78
|
+
className: p.className,
|
|
79
|
+
id,
|
|
80
|
+
'data-testid': p['data-testid'],
|
|
81
|
+
subheader: effectiveSubheader,
|
|
82
|
+
};
|
|
83
|
+
if (component !== undefined) {
|
|
84
|
+
rootProps.component = component;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<List {...rootProps}>
|
|
89
|
+
{children}
|
|
90
|
+
</List>
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default ListResolver;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import List from './List';
|
|
4
|
+
import ListItem from '../ListItem/ListItem';
|
|
5
|
+
import ListItemIcon from '../ListItemIcon/ListItemIcon';
|
|
6
|
+
import ListItemText from '../ListItemText/ListItemText';
|
|
7
|
+
import Icon from '@/themes/icons/Icon';
|
|
8
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
9
|
+
import GuiProvider from '@/context/GuiProvider';
|
|
10
|
+
import ListSubheader from '@mui/material/ListSubheader';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof List> = {
|
|
13
|
+
title: 'Atoms/List',
|
|
14
|
+
component: List,
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<MemoryRouter>
|
|
19
|
+
<GuiProvider>
|
|
20
|
+
<div style={{ padding: 16, minHeight: 260, maxWidth: 560 }}>
|
|
21
|
+
<Story />
|
|
22
|
+
</div>
|
|
23
|
+
</GuiProvider>
|
|
24
|
+
</MemoryRouter>
|
|
25
|
+
),
|
|
26
|
+
],
|
|
27
|
+
parameters: {
|
|
28
|
+
docs: {
|
|
29
|
+
description: {
|
|
30
|
+
component: `
|
|
31
|
+
The **List** atom is a thin wrapper around MUI's \`MuiList\`, staying faithful to its API and polymorphism.
|
|
32
|
+
|
|
33
|
+
In **declarative** mode (resolver), it forwards MUI props and supports granular styling via \`sx\`.
|
|
34
|
+
It also provides sugar: \`subheaderText\` (and \`subheaderSx\`) to easily render a \`<ListSubheader/>\` when you don't pass \`subheader\` explicitly.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
## React usage
|
|
38
|
+
~~~jsx
|
|
39
|
+
<List dense subheader={<li />}> // arbitrary subheader (from MUI API)
|
|
40
|
+
<ListItem>
|
|
41
|
+
<ListItemIcon>
|
|
42
|
+
<Icon name="lucide:inbox" />
|
|
43
|
+
</ListItemIcon>
|
|
44
|
+
<ListItemText primary="Inbox" />
|
|
45
|
+
</ListItem>
|
|
46
|
+
</List>
|
|
47
|
+
~~~
|
|
48
|
+
|
|
49
|
+
## Declarative JSON / Resolver
|
|
50
|
+
~~~json
|
|
51
|
+
{
|
|
52
|
+
"type": "List",
|
|
53
|
+
"props": {
|
|
54
|
+
"dense": true,
|
|
55
|
+
"disablePadding": false,
|
|
56
|
+
"subheaderText": "Shortcuts",
|
|
57
|
+
"subheaderSx": { "fontWeight": 600 },
|
|
58
|
+
"sx": { "bgcolor": "background.paper", "borderRadius": 8 }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
~~~
|
|
62
|
+
*Note:* \`subheaderText\`/\`subheaderSx\` are **resolver-only** sugar; they are not MUI props.
|
|
63
|
+
`,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
controls: {
|
|
67
|
+
exclude: ['component', 'children', 'subheader'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
argTypes: {
|
|
71
|
+
dense: { control: 'boolean' },
|
|
72
|
+
disablePadding: { control: 'boolean' },
|
|
73
|
+
sx: { control: 'object', table: { category: 'Style' } },
|
|
74
|
+
},
|
|
75
|
+
args: {
|
|
76
|
+
dense: false,
|
|
77
|
+
disablePadding: false,
|
|
78
|
+
sx: { bgcolor: 'background.paper', borderRadius: 1, border: '1px solid', borderColor: 'divider' },
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default meta;
|
|
83
|
+
|
|
84
|
+
type Story = StoryObj<typeof List>;
|
|
85
|
+
|
|
86
|
+
const SampleRows: React.FC = () => (
|
|
87
|
+
<>
|
|
88
|
+
<ListItem>
|
|
89
|
+
<ListItemIcon>
|
|
90
|
+
<Icon name="lucide:inbox" />
|
|
91
|
+
</ListItemIcon>
|
|
92
|
+
<ListItemText primary="Inbox" />
|
|
93
|
+
</ListItem>
|
|
94
|
+
<ListItem>
|
|
95
|
+
<ListItemIcon>
|
|
96
|
+
<Icon name="lucide:send" />
|
|
97
|
+
</ListItemIcon>
|
|
98
|
+
<ListItemText primary="Sent" />
|
|
99
|
+
</ListItem>
|
|
100
|
+
<ListItem>
|
|
101
|
+
<ListItemIcon>
|
|
102
|
+
<Icon name="lucide:star" />
|
|
103
|
+
</ListItemIcon>
|
|
104
|
+
<ListItemText primary="Starred" />
|
|
105
|
+
</ListItem>
|
|
106
|
+
</>
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// ======================= Stories =======================
|
|
110
|
+
export const Playground: Story = {
|
|
111
|
+
render: (args) => (
|
|
112
|
+
<List {...args}>
|
|
113
|
+
<SampleRows />
|
|
114
|
+
</List>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const WithSubheader: Story = {
|
|
119
|
+
name: 'With subheader (MUI prop)',
|
|
120
|
+
render: () => (
|
|
121
|
+
<List subheader={<ListSubheader component="div" sx={{ fontWeight: 600 }}>Shortcuts</ListSubheader>}>
|
|
122
|
+
<SampleRows />
|
|
123
|
+
</List>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const DenseAndNoPadding: Story = {
|
|
128
|
+
args: { dense: true, disablePadding: true },
|
|
129
|
+
render: (args) => (
|
|
130
|
+
<List {...args}>
|
|
131
|
+
<SampleRows />
|
|
132
|
+
</List>
|
|
133
|
+
),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const StyledWithSx: Story = {
|
|
137
|
+
args: { sx: { bgcolor: 'background.paper', borderRadius: 2, boxShadow: 1 } },
|
|
138
|
+
render: (args) => (
|
|
139
|
+
<List {...args}>
|
|
140
|
+
<SampleRows />
|
|
141
|
+
</List>
|
|
142
|
+
),
|
|
143
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This.GUI — List
|
|
3
|
+
* Thin wrapper around MUI’s List that preserves MUI props & typing.
|
|
4
|
+
*
|
|
5
|
+
* Fidelity
|
|
6
|
+
* - We directly re-export MUI’s component so all behavior/typing remain intact.
|
|
7
|
+
* - Granular styling is supported via the standard `sx` prop (MUI System).
|
|
8
|
+
*
|
|
9
|
+
* Why wrap it?
|
|
10
|
+
* - Consistency with This.GUI’s atom pattern (each atom in its own module).
|
|
11
|
+
* - Provides a clean surface for a resolver (declarative mode) without
|
|
12
|
+
* altering React usage.
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import MuiList from '@mui/material/List';
|
|
16
|
+
const List = MuiList;
|
|
17
|
+
export type ListProps = React.ComponentProps<typeof List>;
|
|
18
|
+
// Helpful display name in React DevTools
|
|
19
|
+
(List as any).displayName = 'Gui.List';
|
|
20
|
+
export default List;
|