this.gui 1.0.14 → 1.0.16
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/README.md +0 -39
- package/dist/style.css +1 -1
- package/dist/this-gui.es.js +3751 -1882
- package/dist/this-gui.umd.js +34 -22
- package/package.json +14 -12
- package/src/App.jsx +50 -21
- package/src/SiteBuilder.jsx +39 -0
- package/src/index.mdx +10 -0
- package/src/main.jsx +11 -14
- package/src/scripts/postinstall.js +28 -31
- package/src/scripts/verifyLayouts.js +175 -0
- package/src/scripts/verifyTemplates.js +154 -0
- package/src/stories/Atoms/Alert/Alert.css +196 -14
- package/src/stories/Atoms/Alert/Alert.jsx +43 -28
- package/src/stories/Atoms/Alert/Alert.stories.jsx +154 -28
- package/src/stories/Atoms/Audio/Audio.css +246 -16
- package/src/stories/Atoms/Audio/Audio.jsx +204 -29
- package/src/stories/Atoms/Audio/Audio.stories.jsx +178 -28
- package/src/stories/Atoms/Badge/Badge.css +234 -15
- package/src/stories/Atoms/Badge/Badge.jsx +44 -31
- package/src/stories/Atoms/Badge/Badge.stories.jsx +108 -29
- package/src/stories/Atoms/Button/Button.css +106 -45
- package/src/stories/Atoms/Button/Button.jsx +31 -82
- package/src/stories/Atoms/Button/Button.stories.jsx +170 -40
- package/src/stories/Atoms/Caption/Caption.css +156 -16
- package/src/stories/Atoms/Caption/Caption.jsx +62 -31
- package/src/stories/Atoms/Caption/Caption.stories.jsx +194 -28
- package/src/stories/Atoms/Checkbox/Checkbox.css +168 -15
- package/src/stories/Atoms/Checkbox/Checkbox.jsx +73 -31
- package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +98 -27
- package/src/stories/Atoms/Container/Container.css +75 -15
- package/src/stories/Atoms/Container/Container.jsx +41 -28
- package/src/stories/Atoms/Container/Container.stories.jsx +92 -29
- package/src/stories/Atoms/Divider/Divider.css +131 -13
- package/src/stories/Atoms/Divider/Divider.jsx +54 -33
- package/src/stories/Atoms/Divider/Divider.stories.jsx +93 -29
- package/src/stories/Atoms/Heading/Heading.css +99 -16
- package/src/stories/Atoms/Heading/Heading.jsx +57 -29
- package/src/stories/Atoms/Heading/Heading.stories.jsx +117 -28
- package/src/stories/Atoms/Icon/Icon.css +219 -27
- package/src/stories/Atoms/Icon/Icon.jsx +67 -38
- package/src/stories/Atoms/Icon/Icon.stories.jsx +156 -51
- package/src/stories/Atoms/Image/Image.css +231 -15
- package/src/stories/Atoms/Image/Image.jsx +166 -32
- package/src/stories/Atoms/Image/Image.stories.jsx +319 -28
- package/src/stories/Atoms/Label/Label.css +158 -16
- package/src/stories/Atoms/Label/Label.jsx +61 -31
- package/src/stories/Atoms/Label/Label.stories.jsx +167 -28
- package/src/stories/Atoms/Link/Link.css +58 -16
- package/src/stories/Atoms/Link/Link.jsx +73 -32
- package/src/stories/Atoms/Link/Link.stories.jsx +141 -29
- package/src/stories/Atoms/Loader/Loader.css +93 -16
- package/src/stories/Atoms/Loader/Loader.jsx +47 -30
- package/src/stories/Atoms/Loader/Loader.stories.jsx +86 -28
- package/src/stories/Atoms/Logo/Logo.css +94 -0
- package/src/stories/Atoms/Logo/Logo.jsx +53 -0
- package/src/stories/Atoms/Logo/Logo.stories.jsx +120 -0
- package/src/stories/Atoms/Paragraph/Paragraph.css +167 -16
- package/src/stories/Atoms/Paragraph/Paragraph.jsx +67 -31
- package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +130 -28
- package/src/stories/Atoms/ProgressBar/ProgressBar.css +115 -17
- package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +30 -31
- package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +72 -27
- package/src/stories/Atoms/RadioButton/RadioButton.css +118 -17
- package/src/stories/Atoms/RadioButton/RadioButton.jsx +77 -31
- package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +99 -27
- package/src/stories/Atoms/Range/Range.css +169 -0
- package/src/stories/Atoms/Range/Range.jsx +87 -0
- package/src/stories/Atoms/Range/Range.stories.jsx +110 -0
- package/src/stories/Atoms/Select/Select.css +74 -16
- package/src/stories/Atoms/Select/Select.jsx +62 -30
- package/src/stories/Atoms/Select/Select.stories.jsx +95 -27
- package/src/stories/Atoms/Slider/Slider.css +77 -16
- package/src/stories/Atoms/Slider/Slider.jsx +119 -31
- package/src/stories/Atoms/Slider/Slider.stories.jsx +77 -28
- package/src/stories/Atoms/Snackbar/Snackbar.css +297 -13
- package/src/stories/Atoms/Snackbar/Snackbar.jsx +62 -31
- package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +63 -26
- package/src/stories/Atoms/Spacer/Spacer.css +101 -16
- package/src/stories/Atoms/Spacer/Spacer.jsx +26 -32
- package/src/stories/Atoms/Spacer/Spacer.stories.jsx +50 -30
- package/src/stories/Atoms/Spinner/Spinner.css +97 -16
- package/src/stories/Atoms/Spinner/Spinner.jsx +50 -26
- package/src/stories/Atoms/Spinner/Spinner.stories.jsx +47 -30
- package/src/stories/Atoms/Tag/Tag.css +97 -14
- package/src/stories/Atoms/Tag/Tag.jsx +58 -24
- package/src/stories/Atoms/Tag/Tag.stories.jsx +55 -29
- package/src/stories/Atoms/TextArea/TextArea.css +84 -15
- package/src/stories/Atoms/TextArea/TextArea.jsx +107 -31
- package/src/stories/Atoms/TextArea/TextArea.stories.jsx +24 -30
- package/src/stories/Atoms/TextInput/TextInput.css +89 -17
- package/src/stories/Atoms/TextInput/TextInput.jsx +118 -27
- package/src/stories/Atoms/TextInput/TextInput.stories.jsx +52 -25
- package/src/stories/Atoms/Toggle/Toggle.css +105 -17
- package/src/stories/Atoms/Toggle/Toggle.jsx +55 -28
- package/src/stories/Atoms/Toggle/Toggle.stories.jsx +23 -30
- package/src/stories/Atoms/Tooltip/Tooltip.css +367 -14
- package/src/stories/Atoms/Tooltip/Tooltip.jsx +32 -28
- package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +41 -31
- package/src/stories/Atoms/Video/Video.css +27 -18
- package/src/stories/Atoms/Video/Video.jsx +65 -29
- package/src/stories/Atoms/Video/Video.stories.jsx +29 -30
- package/src/stories/Atoms/index.js +5 -2
- package/src/stories/Atoms/meta_Atoms.js +3 -1
- package/src/stories/Layouts/Accordion/Accordion.css +16 -0
- package/src/stories/Layouts/Accordion/Accordion.jsx +31 -0
- package/src/stories/Layouts/Accordion/Accordion.stories.jsx +28 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.css +16 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.jsx +31 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.stories.jsx +28 -0
- package/src/stories/Layouts/Flexbox/Flexbox.css +16 -0
- package/src/stories/Layouts/Flexbox/Flexbox.jsx +11 -0
- package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +28 -0
- package/src/stories/Layouts/Footer/Footer.css +16 -0
- package/src/stories/Layouts/Footer/Footer.jsx +31 -0
- package/src/stories/Layouts/Footer/Footer.stories.jsx +28 -0
- package/src/stories/Layouts/Grid/Grid.jsx +2 -4
- package/src/stories/Layouts/Grid/Grid.stories.jsx +20 -18
- package/src/stories/Layouts/Header/Header.css +16 -0
- package/src/stories/Layouts/Header/Header.jsx +31 -0
- package/src/stories/Layouts/Header/Header.stories.jsx +28 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.css +16 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +31 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +28 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +16 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +31 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +28 -0
- package/src/stories/Layouts/Pagination/Pagination.css +16 -0
- package/src/stories/Layouts/Pagination/Pagination.jsx +31 -0
- package/src/stories/Layouts/Pagination/Pagination.stories.jsx +28 -0
- package/src/stories/Layouts/Section/Section.css +16 -0
- package/src/stories/Layouts/Section/Section.jsx +31 -0
- package/src/stories/Layouts/Section/Section.stories.jsx +28 -0
- package/src/stories/Layouts/Sidebar/Sidebar.css +16 -0
- package/src/stories/Layouts/Sidebar/Sidebar.jsx +71 -0
- package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +28 -0
- package/src/stories/Layouts/Tabs/Tabs.css +16 -0
- package/src/stories/Layouts/Tabs/Tabs.jsx +31 -0
- package/src/stories/Layouts/Tabs/Tabs.stories.jsx +28 -0
- package/src/stories/Layouts/index.js +31 -0
- package/src/stories/Layouts/meta_Layouts.js +31 -0
- package/src/stories/Molecules/Navbar/Navbar.css +63 -59
- package/src/stories/Molecules/Navbar/Navbar.jsx +43 -48
- package/src/stories/Molecules/Navbar/Navbar.stories.jsx +58 -8
- package/src/stories/Molecules/SearchBar/SearchBar.css +66 -1
- package/src/stories/Molecules/SearchBar/SearchBar.jsx +59 -11
- package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +16 -7
- package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +16 -38
- package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +1 -2
- package/src/stories/Molecules/Sidebar/Sidebar.css +65 -2
- package/src/stories/Molecules/Sidebar/Sidebar.jsx +66 -11
- package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +20 -5
- package/src/stories/Templates/AdminDashboard/AdminDashboard.css +7 -0
- package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +24 -0
- package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +20 -0
- package/src/stories/Templates/CallToAction/CallToAction.css +7 -0
- package/src/stories/Templates/CallToAction/CallToAction.jsx +24 -0
- package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +20 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.css +7 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.jsx +24 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +20 -0
- package/src/stories/Templates/FormSection/FormSection.css +7 -0
- package/src/stories/Templates/FormSection/FormSection.jsx +24 -0
- package/src/stories/Templates/FormSection/FormSection.stories.jsx +20 -0
- package/src/stories/Templates/HeroSection/HeroSection.css +7 -0
- package/src/stories/Templates/HeroSection/HeroSection.jsx +24 -0
- package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +20 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.css +7 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.jsx +24 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +20 -0
- package/src/stories/Templates/ProductPage/ProductPage.css +7 -0
- package/src/stories/Templates/ProductPage/ProductPage.jsx +24 -0
- package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +20 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.css +7 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +24 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +20 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.css +7 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +24 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +20 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +7 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +24 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +20 -0
- package/src/stories/Templates/SignInPage/SignInPage.css +7 -0
- package/src/stories/Templates/SignInPage/SignInPage.jsx +24 -0
- package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +20 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +7 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +24 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +20 -0
- package/src/stories/Templates/Testimonials/Testimonials.css +7 -0
- package/src/stories/Templates/Testimonials/Testimonials.jsx +24 -0
- package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +20 -0
- package/src/stories/Templates/index.js +33 -0
- package/src/stories/Templates/{Templates.js → meta_Templates.js} +3 -1
- package/src/stories/assets/logo.png +0 -0
- package/src/stories/assets/logo.svg +106 -0
- package/src/stories/assets/test.svg +3 -0
- package/src/themes/README.md +301 -0
- package/src/themes/ThemeProvider.jsx +47 -22
- package/src/themes/styles/dracula/dark.css +0 -0
- package/src/themes/styles/dracula/light.css +0 -0
- 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 +247 -0
- package/src/themes/styles/neurons/light.css +280 -0
- package/dist/github-3688a83a.js +0 -5
- package/dist/gothic-94a7ecd6.js +0 -5
- package/dist/newsprint-32bf94d9.js +0 -5
- package/dist/night-4a954853.js +0 -5
- package/dist/pixyll-94de4610.js +0 -5
- package/dist/whitey-db68723e.js +0 -5
- package/src/MDXEditor.jsx +0 -32
- package/src/stories/Atoms/RangeInput/RangeInput.css +0 -29
- package/src/stories/Atoms/RangeInput/RangeInput.jsx +0 -41
- package/src/stories/Atoms/RangeInput/RangeInput.stories.jsx +0 -41
- package/src/stories/Components.md +0 -189
- package/src/stories/Layouts/Layout.js +0 -28
- package/src/styles/Header.modules.css +0 -32
- package/src/styles/global.css +0 -59
- package/src/themes/Themes.js +0 -44
- package/src/themes/dark.js +0 -22
- package/src/themes/light.js +0 -22
- package/src/themes/typ/Readme.md +0 -4
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700italic.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-italic.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-regular.woff2 +0 -0
- package/src/themes/typ/github.css +0 -416
- package/src/themes/typ/gothic/GUST e-foundry License.txt +0 -29
- package/src/themes/typ/gothic/didact-gothic-c-ext.woff2 +0 -0
- package/src/themes/typ/gothic/didact-gothic-c.woff2 +0 -0
- package/src/themes/typ/gothic/texgyreadventor-bold.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-bolditalic.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-italic.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-regular.woff +0 -0
- package/src/themes/typ/gothic.css +0 -410
- package/src/themes/typ/newsprint/pt-serif-v11-latin-700.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-700italic.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-italic.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-regular.woff2 +0 -0
- package/src/themes/typ/newsprint.css +0 -622
- package/src/themes/typ/night/codeblock.dark.css +0 -113
- package/src/themes/typ/night/credit.html +0 -1
- package/src/themes/typ/night/cursor.png +0 -0
- package/src/themes/typ/night/cursor@2x.png +0 -0
- package/src/themes/typ/night/mermaid.dark.css +0 -7
- package/src/themes/typ/night/sourcemode.dark.css +0 -38
- package/src/themes/typ/night.css +0 -1032
- package/src/themes/typ/pixyll/lato-v14-latin-300.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-300italic.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-900.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-900italic.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-300.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-300italic.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-700.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-700italic.woff +0 -0
- package/src/themes/typ/pixyll.css +0 -528
- package/src/themes/typ/whitey.css +0 -299
- /package/src/stories/Molecules/{Molecules.js → meta_Molecules.js} +0 -0
- /package/src/stories/Organisms/{Organisms.js → meta_Organisms.js} +0 -0
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import './Tooltip.css';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const Tooltip = ({
|
|
6
|
+
content,
|
|
7
|
+
position = 'top',
|
|
8
|
+
variant = 'primary',
|
|
9
|
+
color = 'primary', // Ensure default color is "primary"
|
|
10
|
+
showArrow = true,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
const tooltipClasses = `
|
|
15
|
+
tooltip
|
|
16
|
+
tooltip--${position}
|
|
17
|
+
tooltip--${variant}
|
|
18
|
+
tooltip--primary-${color}
|
|
19
|
+
${variant === 'secondary' ? `tooltip--secondary-${color}` : ''}
|
|
20
|
+
`.trim(); // Ensuring the correct color class is applied
|
|
21
|
+
|
|
11
22
|
return (
|
|
12
|
-
<div
|
|
13
|
-
className={['tooltip', `tooltip--${size}`, mode].join(' ')}
|
|
14
|
-
{...props}
|
|
15
|
-
>
|
|
23
|
+
<div className="tooltip-wrapper" {...props}>
|
|
16
24
|
{children}
|
|
25
|
+
<div className={tooltipClasses}>
|
|
26
|
+
{content}
|
|
27
|
+
{showArrow && <div className="tooltip__arrow"></div>}
|
|
28
|
+
</div>
|
|
17
29
|
</div>
|
|
18
30
|
);
|
|
19
31
|
};
|
|
20
32
|
|
|
21
33
|
Tooltip.propTypes = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
34
|
+
content: PropTypes.node.isRequired,
|
|
35
|
+
position: PropTypes.oneOf(['top', 'bottom', 'left', 'right', 'north', 'south', 'east', 'west']),
|
|
36
|
+
variant: PropTypes.oneOf(['primary', 'secondary']),
|
|
37
|
+
color: PropTypes.oneOf([
|
|
38
|
+
'primary', 'info', 'warning', 'alert', 'success', 'neutral', 'dark',
|
|
39
|
+
'classy-color-1', 'classy-color-2', 'classy-color-3', 'classy-color-4', 'classy-color-5',
|
|
40
|
+
'small-switch-color-1', 'small-switch-color-2', 'natural-color-1', 'natural-color-2', 'natural-color-3',
|
|
41
|
+
'grey-friend-1', 'grey-friend-2', 'shade-1', 'shade-2', 'shade-3', 'shade-4'
|
|
42
|
+
]),
|
|
43
|
+
showArrow: PropTypes.bool,
|
|
33
44
|
children: PropTypes.node.isRequired,
|
|
34
45
|
};
|
|
35
|
-
|
|
36
|
-
Tooltip.defaultProps = {
|
|
37
|
-
primary: false,
|
|
38
|
-
size: 'medium',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Tooltip;
|
|
@@ -1,41 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Tooltip } from './Tooltip';
|
|
3
3
|
|
|
4
|
-
// Storybook configuration for Tooltip component
|
|
5
4
|
export default {
|
|
6
|
-
title: 'Atoms/
|
|
5
|
+
title: 'Atoms/Interactive/Tooltip',
|
|
7
6
|
component: Tooltip,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
7
|
argTypes: {
|
|
12
|
-
|
|
8
|
+
content: { control: 'text', defaultValue: 'Tooltip Content' },
|
|
9
|
+
position: {
|
|
10
|
+
control: { type: 'select', options: ['top', 'bottom', 'left', 'right', 'north', 'south', 'east', 'west'] },
|
|
11
|
+
defaultValue: 'top'
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
control: { type: 'select', options: [
|
|
15
|
+
'primary', 'info', 'warning', 'alert', 'success', 'neutral', 'dark',
|
|
16
|
+
'classy-color-1', 'classy-color-2', 'classy-color-3', 'classy-color-4', 'classy-color-5'
|
|
17
|
+
]},
|
|
18
|
+
defaultValue: 'primary'
|
|
19
|
+
},
|
|
20
|
+
variant: { control: { type: 'select', options: ['primary', 'secondary'] }, defaultValue: 'primary' },
|
|
21
|
+
showArrow: { control: 'boolean', defaultValue: true },
|
|
13
22
|
},
|
|
14
23
|
};
|
|
15
24
|
|
|
16
|
-
export const Primary = {
|
|
17
|
-
args: {
|
|
18
|
-
primary: true,
|
|
19
|
-
children: 'This is a primary Tooltip',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
25
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
26
|
+
export const ColorVariants = () => (
|
|
27
|
+
<div style={{ padding: '50px', display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '20px' }}>
|
|
28
|
+
{['primary', 'info', 'warning', 'alert', 'success', 'neutral', 'dark'].map((color) => (
|
|
29
|
+
<Tooltip key={color} content={`This is ${color}`} color={color}>
|
|
30
|
+
<button>Hover for {color}</button>
|
|
31
|
+
</Tooltip>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
28
35
|
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
export const InteractiveTooltip = (args) => (
|
|
37
|
+
<div style={{ padding: '100px', display: 'flex', justifyContent: 'space-around', alignItems: 'center' }}>
|
|
38
|
+
<Tooltip {...args} position="top">
|
|
39
|
+
<button>Hover Top</button>
|
|
40
|
+
</Tooltip>
|
|
41
|
+
<Tooltip {...args} position="bottom">
|
|
42
|
+
<button>Hover Bottom</button>
|
|
43
|
+
</Tooltip>
|
|
44
|
+
<Tooltip {...args} position="left">
|
|
45
|
+
<button>Hover Left</button>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
<Tooltip {...args} position="right">
|
|
48
|
+
<button>Hover Right</button>
|
|
49
|
+
</Tooltip>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
border: 1px solid #ddd;
|
|
1
|
+
.video-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
background-color: #000;
|
|
5
|
+
display: inline-block;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
video {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
.video
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
.video-controls {
|
|
14
|
+
position: absolute;
|
|
15
|
+
bottom: 10px;
|
|
16
|
+
left: 10px;
|
|
17
|
+
z-index: 10;
|
|
18
|
+
display: none;
|
|
19
|
+
transition: opacity 0.3s ease;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
.video
|
|
20
|
-
|
|
22
|
+
.video-container.show-controls .video-controls {
|
|
23
|
+
display: block;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
.video
|
|
24
|
-
|
|
26
|
+
.video-controls button {
|
|
27
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
28
|
+
border: none;
|
|
29
|
+
color: white;
|
|
30
|
+
padding: 8px 16px;
|
|
31
|
+
border-radius: 5px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
font-size: 14px;
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
.video
|
|
28
|
-
|
|
36
|
+
.video-controls button:hover {
|
|
37
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
29
38
|
}
|
|
@@ -1,41 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import './Video.css';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const Video = ({
|
|
6
|
+
src,
|
|
7
|
+
poster,
|
|
8
|
+
autoplay = false,
|
|
9
|
+
loop = false,
|
|
10
|
+
muted = false,
|
|
11
|
+
controls = true,
|
|
12
|
+
width = '100%',
|
|
13
|
+
height = 'auto',
|
|
14
|
+
onPlay,
|
|
15
|
+
onPause,
|
|
16
|
+
onEnd,
|
|
17
|
+
showControlsOnHover = true,
|
|
18
|
+
}) => {
|
|
19
|
+
const videoRef = useRef(null);
|
|
20
|
+
const [isPlaying, setIsPlaying] = useState(false);
|
|
21
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
22
|
+
|
|
23
|
+
const handlePlayPause = () => {
|
|
24
|
+
if (isPlaying) {
|
|
25
|
+
videoRef.current.pause();
|
|
26
|
+
} else {
|
|
27
|
+
videoRef.current.play();
|
|
28
|
+
}
|
|
29
|
+
setIsPlaying(!isPlaying);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const handleVideoHover = () => setIsHovering(true);
|
|
33
|
+
const handleVideoLeave = () => setIsHovering(false);
|
|
34
|
+
|
|
11
35
|
return (
|
|
12
36
|
<div
|
|
13
|
-
className={
|
|
14
|
-
{
|
|
37
|
+
className={`video-container ${showControlsOnHover && isHovering ? 'show-controls' : ''}`}
|
|
38
|
+
onMouseEnter={handleVideoHover}
|
|
39
|
+
onMouseLeave={handleVideoLeave}
|
|
40
|
+
style={{ width, height }}
|
|
15
41
|
>
|
|
16
|
-
|
|
42
|
+
<video
|
|
43
|
+
ref={videoRef}
|
|
44
|
+
src={src}
|
|
45
|
+
poster={poster}
|
|
46
|
+
autoPlay={autoplay}
|
|
47
|
+
loop={loop}
|
|
48
|
+
muted={muted}
|
|
49
|
+
controls={controls}
|
|
50
|
+
onPlay={onPlay}
|
|
51
|
+
onPause={onPause}
|
|
52
|
+
onEnded={onEnd}
|
|
53
|
+
style={{ width: '100%', height: '100%' }}
|
|
54
|
+
/>
|
|
55
|
+
<div className="video-controls">
|
|
56
|
+
<button onClick={handlePlayPause}>
|
|
57
|
+
{isPlaying ? 'Pause' : 'Play'}
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
17
60
|
</div>
|
|
18
61
|
);
|
|
19
62
|
};
|
|
20
63
|
|
|
21
64
|
Video.propTypes = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
src: PropTypes.string.isRequired,
|
|
66
|
+
poster: PropTypes.string,
|
|
67
|
+
autoplay: PropTypes.bool,
|
|
68
|
+
loop: PropTypes.bool,
|
|
69
|
+
muted: PropTypes.bool,
|
|
70
|
+
controls: PropTypes.bool,
|
|
71
|
+
width: PropTypes.string,
|
|
72
|
+
height: PropTypes.string,
|
|
73
|
+
onPlay: PropTypes.func,
|
|
74
|
+
onPause: PropTypes.func,
|
|
75
|
+
onEnd: PropTypes.func,
|
|
76
|
+
showControlsOnHover: PropTypes.bool,
|
|
34
77
|
};
|
|
35
|
-
|
|
36
|
-
Video.defaultProps = {
|
|
37
|
-
primary: false,
|
|
38
|
-
size: 'medium',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Video;
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Video } from './Video';
|
|
3
3
|
|
|
4
|
-
// Storybook configuration for Video component
|
|
5
4
|
export default {
|
|
6
5
|
title: 'Atoms/Media/Video',
|
|
7
6
|
component: Video,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
7
|
argTypes: {
|
|
12
|
-
|
|
8
|
+
src: { control: 'text', defaultValue: 'https://www.w3schools.com/html/mov_bbb.mp4' },
|
|
9
|
+
poster: { control: 'text', defaultValue: 'https://www.w3schools.com/html/pic_trulli.jpg' },
|
|
10
|
+
autoplay: { control: 'boolean', defaultValue: false },
|
|
11
|
+
loop: { control: 'boolean', defaultValue: false },
|
|
12
|
+
muted: { control: 'boolean', defaultValue: false },
|
|
13
|
+
controls: { control: 'boolean', defaultValue: true },
|
|
14
|
+
width: { control: 'text', defaultValue: '100%' },
|
|
15
|
+
height: { control: 'text', defaultValue: 'auto' },
|
|
16
|
+
showControlsOnHover: { control: 'boolean', defaultValue: true },
|
|
13
17
|
},
|
|
14
18
|
};
|
|
15
19
|
|
|
16
|
-
export const
|
|
17
|
-
args
|
|
18
|
-
|
|
19
|
-
children: 'This is a primary Video',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
20
|
+
export const DefaultVideo = (args) => (
|
|
21
|
+
<Video {...args} />
|
|
22
|
+
);
|
|
22
23
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
export const VideoWithCustomDimensions = () => (
|
|
25
|
+
<Video
|
|
26
|
+
src="https://www.w3schools.com/html/mov_bbb.mp4"
|
|
27
|
+
poster="https://www.w3schools.com/html/pic_trulli.jpg"
|
|
28
|
+
width="640px"
|
|
29
|
+
height="360px"
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
28
32
|
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
args: {
|
|
38
|
-
size: 'small',
|
|
39
|
-
children: 'This is a small Video',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
33
|
+
export const VideoAutoplayLoop = () => (
|
|
34
|
+
<Video
|
|
35
|
+
src="https://www.w3schools.com/html/mov_bbb.mp4"
|
|
36
|
+
autoplay
|
|
37
|
+
loop
|
|
38
|
+
muted
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//this.GUI/src/stories/Atoms/index.js
|
|
1
2
|
// Import all components directly
|
|
2
3
|
import { Heading } from './Heading/Heading';
|
|
3
4
|
import { Paragraph } from './Paragraph/Paragraph';
|
|
@@ -14,7 +15,7 @@ import { TextInput } from './TextInput/TextInput';
|
|
|
14
15
|
import { TextArea } from './TextArea/TextArea';
|
|
15
16
|
import { Select } from './Select/Select';
|
|
16
17
|
import { Slider } from './Slider/Slider';
|
|
17
|
-
import {
|
|
18
|
+
import { Range } from './Range/Range';
|
|
18
19
|
import { Image } from './Image/Image';
|
|
19
20
|
import { Video } from './Video/Video';
|
|
20
21
|
import { Audio } from './Audio/Audio';
|
|
@@ -28,6 +29,7 @@ import { Spinner } from './Spinner/Spinner';
|
|
|
28
29
|
import { ProgressBar } from './ProgressBar/ProgressBar';
|
|
29
30
|
import { Alert } from './Alert/Alert';
|
|
30
31
|
import { Snackbar } from './Snackbar/Snackbar';
|
|
32
|
+
import { Logo } from './Logo/Logo';
|
|
31
33
|
|
|
32
34
|
// Flattened export of all components
|
|
33
35
|
const Atoms = {
|
|
@@ -46,7 +48,7 @@ const Atoms = {
|
|
|
46
48
|
TextArea,
|
|
47
49
|
Select,
|
|
48
50
|
Slider,
|
|
49
|
-
|
|
51
|
+
Range,
|
|
50
52
|
Image,
|
|
51
53
|
Video,
|
|
52
54
|
Audio,
|
|
@@ -56,6 +58,7 @@ const Atoms = {
|
|
|
56
58
|
Badge,
|
|
57
59
|
Tag,
|
|
58
60
|
Loader,
|
|
61
|
+
Logo,
|
|
59
62
|
Spinner,
|
|
60
63
|
ProgressBar,
|
|
61
64
|
Alert,
|
|
@@ -6,8 +6,10 @@ const Atomic = {
|
|
|
6
6
|
{ name: "Label", paths: { css: "./Label/Label.css", globalCss: "styles/global.css", jsx: "./Label/Label.jsx", stories: "./Label/Label.stories.jsx" }},
|
|
7
7
|
{ name: "Caption", paths: { css: "./Caption/Caption.css", globalCss: "styles/global.css", jsx: "./Caption/Caption.jsx", stories: "./Caption/Caption.stories.jsx" }},
|
|
8
8
|
],
|
|
9
|
-
"
|
|
9
|
+
"Layout": [
|
|
10
10
|
{ name: " Container", paths: { css: "./Container/Container.css", globalCss: "styles/global.css", jsx: "./Container/Container.jsx", stories: "./Container/Container.stories.jsx" }},
|
|
11
|
+
],
|
|
12
|
+
"Interactive": [
|
|
11
13
|
{ name: "Button", paths: { css: "/Button/Button.css", globalCss: "styles/global.css", jsx: "./Button/Button.jsx", stories: "./Button/Button.stories.jsx" }},
|
|
12
14
|
{ name: "Link", paths: { css: "Atomic/Link/Link.css", globalCss: "styles/global.css", jsx: "./Link/Link.jsx", stories: "./Link/Link.stories.jsx" }},
|
|
13
15
|
{ name: "Icon", paths: { css: "/Atomic/Icon/Icon.css", globalCss: "styles/global.css", jsx: "./Icon/Icon.jsx", stories: "./Icon/Icon.stories.jsx" }},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import './Accordion.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Accordion layout component
|
|
8
|
+
*/
|
|
9
|
+
export const Accordion = ({ children, primary, ...props }) => {
|
|
10
|
+
const mode = primary ? 'accordion--primary' : 'accordion--secondary';
|
|
11
|
+
return (
|
|
12
|
+
<div className={['accordion', mode].join(' ')} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Accordion.propTypes = {
|
|
19
|
+
/**
|
|
20
|
+
* Primary style for the layout
|
|
21
|
+
*/
|
|
22
|
+
primary: PropTypes.bool,
|
|
23
|
+
/**
|
|
24
|
+
* Children components to be rendered inside the layout
|
|
25
|
+
*/
|
|
26
|
+
children: PropTypes.node.isRequired,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Accordion.defaultProps = {
|
|
30
|
+
primary: false,
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import { Accordion } from './Accordion';
|
|
3
|
+
|
|
4
|
+
// Storybook configuration for Accordion component
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Layouts/ContentOrganization/Accordion',
|
|
7
|
+
component: Accordion,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
children: { control: 'text' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Primary = {
|
|
17
|
+
args: {
|
|
18
|
+
primary: true,
|
|
19
|
+
children: 'This is a primary Accordion layout.',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary = {
|
|
24
|
+
args: {
|
|
25
|
+
primary: false,
|
|
26
|
+
children: 'This is a secondary Accordion layout.',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import './DropdownMenu.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DropdownMenu layout component
|
|
8
|
+
*/
|
|
9
|
+
export const DropdownMenu = ({ children, primary, ...props }) => {
|
|
10
|
+
const mode = primary ? 'dropdownmenu--primary' : 'dropdownmenu--secondary';
|
|
11
|
+
return (
|
|
12
|
+
<div className={['dropdownmenu', mode].join(' ')} {...props}>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
DropdownMenu.propTypes = {
|
|
19
|
+
/**
|
|
20
|
+
* Primary style for the layout
|
|
21
|
+
*/
|
|
22
|
+
primary: PropTypes.bool,
|
|
23
|
+
/**
|
|
24
|
+
* Children components to be rendered inside the layout
|
|
25
|
+
*/
|
|
26
|
+
children: PropTypes.node.isRequired,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
DropdownMenu.defaultProps = {
|
|
30
|
+
primary: false,
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import { DropdownMenu } from './DropdownMenu';
|
|
3
|
+
|
|
4
|
+
// Storybook configuration for DropdownMenu component
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Layouts/NavigationAndMenus/DropdownMenu',
|
|
7
|
+
component: DropdownMenu,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
children: { control: 'text' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Primary = {
|
|
17
|
+
args: {
|
|
18
|
+
primary: true,
|
|
19
|
+
children: 'This is a primary DropdownMenu layout.',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary = {
|
|
24
|
+
args: {
|
|
25
|
+
primary: false,
|
|
26
|
+
children: 'This is a secondary DropdownMenu layout.',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Flexbox.css';
|
|
3
|
+
|
|
4
|
+
export const Flexbox = ({ children, primary, ...props }) => {
|
|
5
|
+
const mode = primary ? 'flexbox--primary' : 'flexbox--secondary';
|
|
6
|
+
return (
|
|
7
|
+
<div className={['flexbox', mode].join(' ')} {...props}>
|
|
8
|
+
{children}
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import { Flexbox } from './Flexbox';
|
|
3
|
+
|
|
4
|
+
// Storybook configuration for Flexbox component
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Layouts/FlexboxLayout/Flexbox',
|
|
7
|
+
component: Flexbox,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
children: { control: 'text' },
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Primary = {
|
|
17
|
+
args: {
|
|
18
|
+
primary: true,
|
|
19
|
+
children: 'This is a primary Flexbox layout.',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Secondary = {
|
|
24
|
+
args: {
|
|
25
|
+
primary: false,
|
|
26
|
+
children: 'This is a secondary Flexbox layout.',
|
|
27
|
+
},
|
|
28
|
+
};
|