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,54 +1,184 @@
|
|
|
1
|
+
// src/stories/Atoms/Button/Button.stories.jsx
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { Button } from './Button';
|
|
4
|
+
import './Button.css'; // Ensure styles are imported
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
title: 'Atoms/Interactive/Button',
|
|
5
8
|
component: Button,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: {
|
|
12
|
+
type: 'select',
|
|
13
|
+
options: ['primary', 'secondary'],
|
|
14
|
+
},
|
|
15
|
+
description: 'Variant of the button.',
|
|
16
|
+
table: {
|
|
17
|
+
type: { summary: 'primary | secondary' },
|
|
18
|
+
defaultValue: { summary: 'primary' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
control: {
|
|
23
|
+
type: 'select',
|
|
24
|
+
options: [
|
|
25
|
+
'info',
|
|
26
|
+
'warning',
|
|
27
|
+
'alert',
|
|
28
|
+
'success',
|
|
29
|
+
'neutral',
|
|
30
|
+
'dark',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
description: 'Semantic color accent of the button.',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: `'info' | 'warning' | 'alert' | 'success' | 'neutral' | 'dark'` },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
control: {
|
|
40
|
+
type: 'select',
|
|
41
|
+
options: ['small', 'medium', 'large'],
|
|
42
|
+
},
|
|
43
|
+
description: 'Size of the button.',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: 'small | medium | large' },
|
|
46
|
+
defaultValue: { summary: 'medium' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
label: {
|
|
50
|
+
control: 'text',
|
|
51
|
+
description: 'Text label of the button.',
|
|
52
|
+
table: {
|
|
53
|
+
type: { summary: 'string' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
noBorder: {
|
|
57
|
+
control: 'boolean',
|
|
58
|
+
description: 'Removes the border if set to true.',
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: 'boolean' },
|
|
61
|
+
defaultValue: { summary: false },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
onClick: {
|
|
65
|
+
action: 'clicked',
|
|
66
|
+
description: 'Button click handler.',
|
|
67
|
+
table: {
|
|
68
|
+
type: { summary: 'function' },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
children: {
|
|
72
|
+
control: 'text',
|
|
73
|
+
description: 'Button children elements.',
|
|
74
|
+
table: {
|
|
75
|
+
type: { summary: 'node' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
className: {
|
|
79
|
+
control: 'text',
|
|
80
|
+
description: 'Additional CSS classes.',
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: 'string' },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
style: {
|
|
86
|
+
control: 'object',
|
|
87
|
+
description: 'Inline styles.',
|
|
88
|
+
table: {
|
|
89
|
+
type: { summary: 'object' },
|
|
10
90
|
},
|
|
11
91
|
},
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
primary: { control: 'boolean', description: 'Is this the primary button?' },
|
|
15
|
-
size: { control: { type: 'select', options: ['small', 'medium', 'large'] }, description: 'Size of the button' },
|
|
16
|
-
noborder: { control: 'boolean', description: 'No border button style' },
|
|
17
|
-
label: { control: 'text', description: 'Text label for the button' },
|
|
18
|
-
children: { control: 'text', description: 'Content inside the button' },
|
|
19
92
|
},
|
|
20
93
|
};
|
|
21
94
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* Shows the default primary and secondary buttons without any semantic color accent.
|
|
98
|
+
*/
|
|
99
|
+
export const DefaultButtons = () => (
|
|
100
|
+
<div style={{ display: 'flex', gap: '10px', flexWrap: 'wrap' }}>
|
|
101
|
+
<Button variant="primary" size="medium">
|
|
102
|
+
Primary Default
|
|
103
|
+
</Button>
|
|
104
|
+
<Button variant="secondary" size="medium">
|
|
105
|
+
Secondary Default
|
|
106
|
+
</Button>
|
|
107
|
+
<Button variant="primary" size="medium" noBorder>
|
|
108
|
+
Primary No Border
|
|
109
|
+
</Button>
|
|
110
|
+
<Button variant="secondary" size="medium" noBorder>
|
|
111
|
+
Secondary No Border
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
28
115
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* Demonstrates primary buttons with all semantic colors and sizes.
|
|
119
|
+
*/
|
|
120
|
+
export const PrimaryButtons = () => (
|
|
121
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
122
|
+
<h3>Primary Buttons</h3>
|
|
123
|
+
{['info', 'warning', 'alert', 'success', 'neutral', 'dark'].map((color) => (
|
|
124
|
+
<div key={color} style={{ display: 'flex', gap: '10px', alignItems: 'center', flexWrap: 'wrap' }}>
|
|
125
|
+
<Button variant="primary" color={color} size="small">
|
|
126
|
+
Primary {color} Small
|
|
127
|
+
</Button>
|
|
128
|
+
<Button variant="primary" color={color} size="medium">
|
|
129
|
+
Primary {color} Medium
|
|
130
|
+
</Button>
|
|
131
|
+
<Button variant="primary" color={color} size="large">
|
|
132
|
+
Primary {color} Large
|
|
133
|
+
</Button>
|
|
134
|
+
<Button variant="primary" color={color} size="medium" noBorder>
|
|
135
|
+
Primary {color} No Border
|
|
136
|
+
</Button>
|
|
137
|
+
</div>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
34
141
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* Demonstrates secondary buttons with all semantic colors and sizes.
|
|
145
|
+
*/
|
|
146
|
+
export const SecondaryButtons = () => (
|
|
147
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
148
|
+
<h3>Secondary Buttons</h3>
|
|
149
|
+
{['info', 'warning', 'alert', 'success', 'neutral', 'dark'].map((color) => (
|
|
150
|
+
<div key={color} style={{ display: 'flex', gap: '10px', alignItems: 'center', flexWrap: 'wrap' }}>
|
|
151
|
+
<Button variant="secondary" color={color} size="small">
|
|
152
|
+
Secondary {color} Small
|
|
153
|
+
</Button>
|
|
154
|
+
<Button variant="secondary" color={color} size="medium">
|
|
155
|
+
Secondary {color} Medium
|
|
156
|
+
</Button>
|
|
157
|
+
<Button variant="secondary" color={color} size="large">
|
|
158
|
+
Secondary {color} Large
|
|
159
|
+
</Button>
|
|
160
|
+
<Button variant="secondary" color={color} size="medium" noBorder>
|
|
161
|
+
Secondary {color} No Border
|
|
162
|
+
</Button>
|
|
163
|
+
</div>
|
|
164
|
+
))}
|
|
165
|
+
</div>
|
|
166
|
+
);
|
|
41
167
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
168
|
+
/**
|
|
169
|
+
* ### Interactive Playground
|
|
170
|
+
*
|
|
171
|
+
* Allows dynamic interaction with the button props via Storybook controls.
|
|
172
|
+
*/
|
|
173
|
+
const Template = (args) => <Button {...args} />;
|
|
48
174
|
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
175
|
+
export const Playground = Template.bind({});
|
|
176
|
+
Playground.args = {
|
|
177
|
+
variant: 'primary',
|
|
178
|
+
color: 'info',
|
|
179
|
+
size: 'medium',
|
|
180
|
+
label: 'Click Me',
|
|
181
|
+
noBorder: false,
|
|
182
|
+
children: 'Click Me',
|
|
183
|
+
};
|
|
184
|
+
Playground.storyName = 'Interactive Playground';
|
|
@@ -1,29 +1,169 @@
|
|
|
1
|
+
/* src/stories/Atoms/Caption/Caption.css */
|
|
1
2
|
|
|
3
|
+
/* Base Caption Styles */
|
|
2
4
|
.caption {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
font-family: var(--font-family);
|
|
6
|
+
font-size: var(--font-size-small, 14px);
|
|
7
|
+
color: var(--text-color);
|
|
8
|
+
margin-top: var(--spacing-xs, 4px);
|
|
9
|
+
margin-bottom: var(--spacing-md, 16px);
|
|
10
|
+
display: block;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/* Size Variants */
|
|
14
|
+
/* Size Variants */
|
|
15
|
+
.caption--small {
|
|
16
|
+
font-size: var(--font-size-small);
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
.caption--
|
|
15
|
-
|
|
16
|
-
border-color: #ccc;
|
|
19
|
+
.caption--large {
|
|
20
|
+
font-size: var(--font-size-large);
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/* Type Variants */
|
|
24
|
+
|
|
25
|
+
/* 1. Image or Video Captions */
|
|
26
|
+
.caption--image {
|
|
27
|
+
font-style: italic;
|
|
28
|
+
text-align: center;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
|
-
.
|
|
24
|
-
|
|
31
|
+
/* 2. Table Captions */
|
|
32
|
+
.caption--table {
|
|
33
|
+
caption-side: top; /* Ensures the caption appears above the table */
|
|
34
|
+
font-weight: var(--font-weight-medium, 500);
|
|
25
35
|
}
|
|
26
36
|
|
|
27
|
-
.
|
|
28
|
-
|
|
37
|
+
/* 3. Form Element Captions */
|
|
38
|
+
.caption--form {
|
|
39
|
+
font-size: var(--font-size-small, 14px);
|
|
40
|
+
color: var(--text-color);
|
|
41
|
+
margin-top: var(--spacing-xs, 4px);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* 4. Chart or Graph Captions */
|
|
45
|
+
.caption--chart {
|
|
46
|
+
font-weight: var(--font-weight-bold, 600);
|
|
47
|
+
margin-top: var(--spacing-sm, 8px);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* 5. Audio or Video Transcriptions (Subtitles or Captions) */
|
|
51
|
+
.caption--transcription {
|
|
52
|
+
font-size: var(--font-size-small, 14px);
|
|
53
|
+
color: var(--text-color);
|
|
54
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
55
|
+
color: #ffffff;
|
|
56
|
+
padding: var(--spacing-xs, 4px) var(--spacing-sm, 8px);
|
|
57
|
+
border-radius: var(--border-radius, 4px);
|
|
58
|
+
position: absolute;
|
|
59
|
+
bottom: var(--spacing-xs, 4px);
|
|
60
|
+
left: 50%;
|
|
61
|
+
transform: translateX(-50%);
|
|
62
|
+
max-width: 90%;
|
|
63
|
+
text-align: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* 6. Content Descriptions or Explanations */
|
|
67
|
+
.caption--description {
|
|
68
|
+
font-size: var(--font-size-small, 14px);
|
|
69
|
+
color: var(--text-color);
|
|
70
|
+
margin-top: var(--spacing-xs, 4px);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 7. Captions for Interactive Elements */
|
|
74
|
+
.caption--interactive {
|
|
75
|
+
font-size: var(--font-size-small, 14px);
|
|
76
|
+
color: var(--text-color);
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--spacing-xs, 4px);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Color Classes */
|
|
83
|
+
.caption--info {
|
|
84
|
+
color: var(--info-color);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.caption--warning {
|
|
88
|
+
color: var(--warning-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.caption--alert {
|
|
92
|
+
color: var(--alert-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.caption--success {
|
|
96
|
+
color: var(--success-color);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.caption--neutral {
|
|
100
|
+
color: var(--neutral-color);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.caption--dark {
|
|
104
|
+
color: var(--dark-color);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.caption--classy-color-1 {
|
|
108
|
+
color: var(--classy-color-1);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.caption--classy-color-2 {
|
|
112
|
+
color: var(--classy-color-2);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.caption--classy-color-3 {
|
|
116
|
+
color: var(--classy-color-3);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.caption--classy-color-4 {
|
|
120
|
+
color: var(--classy-color-4);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.caption--classy-color-5 {
|
|
124
|
+
color: var(--classy-color-5);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.caption--small-switch-color-1 {
|
|
128
|
+
color: var(--small-switch-color-1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.caption--small-switch-color-2 {
|
|
132
|
+
color: var(--small-switch-color-2);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.caption--natural-color-1 {
|
|
136
|
+
color: var(--natural-color-1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.caption--natural-color-2 {
|
|
140
|
+
color: var(--natural-color-2);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.caption--natural-color-3 {
|
|
144
|
+
color: var(--natural-color-3);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.caption--grey-friend-1 {
|
|
148
|
+
color: var(--grey-friend-1);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.caption--grey-friend-2 {
|
|
152
|
+
color: var(--grey-friend-2);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.caption--shade-1 {
|
|
156
|
+
color: var(--shade-1);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.caption--shade-2 {
|
|
160
|
+
color: var(--shade-2);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.caption--shade-3 {
|
|
164
|
+
color: var(--shade-3);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.caption--shade-4 {
|
|
168
|
+
color: var(--shade-4);
|
|
29
169
|
}
|
|
@@ -1,41 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
// src/stories/Atoms/Caption/Caption.jsx
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import classNames from 'classnames';
|
|
4
5
|
import './Caption.css';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const Caption = ({
|
|
8
|
+
text,
|
|
9
|
+
variant = 'image', // 'image', 'table', 'form', 'chart', 'transcription', 'description', 'interactive'
|
|
10
|
+
size = 'normal', // 'small', 'normal', 'large'
|
|
11
|
+
color,
|
|
12
|
+
className = '',
|
|
13
|
+
style = {},
|
|
14
|
+
}) => {
|
|
15
|
+
const captionClasses = classNames('caption', {
|
|
16
|
+
[`caption--${variant}`]: variant,
|
|
17
|
+
[`caption--${size}`]: size !== 'normal',
|
|
18
|
+
[`caption--${color}`]: color, // Apply color class if provided
|
|
19
|
+
}, className);
|
|
20
|
+
|
|
11
21
|
return (
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
{children}
|
|
17
|
-
</div>
|
|
22
|
+
<span className={captionClasses} style={style}>
|
|
23
|
+
{text}
|
|
24
|
+
</span>
|
|
18
25
|
);
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
Caption.propTypes = {
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
/** Text content of the caption */
|
|
30
|
+
text: PropTypes.string.isRequired,
|
|
31
|
+
/** Variant/type of the caption */
|
|
32
|
+
variant: PropTypes.oneOf([
|
|
33
|
+
'image',
|
|
34
|
+
'table',
|
|
35
|
+
'form',
|
|
36
|
+
'chart',
|
|
37
|
+
'transcription',
|
|
38
|
+
'description',
|
|
39
|
+
'interactive',
|
|
40
|
+
]),
|
|
41
|
+
/** Size of the caption */
|
|
42
|
+
size: PropTypes.oneOf(['small', 'normal', 'large']),
|
|
43
|
+
/** Color of the caption (matches global theme colors) */
|
|
44
|
+
color: PropTypes.oneOf([
|
|
45
|
+
'info',
|
|
46
|
+
'warning',
|
|
47
|
+
'alert',
|
|
48
|
+
'success',
|
|
49
|
+
'neutral',
|
|
50
|
+
'dark',
|
|
51
|
+
'classy-color-1',
|
|
52
|
+
'classy-color-2',
|
|
53
|
+
'classy-color-3',
|
|
54
|
+
'classy-color-4',
|
|
55
|
+
'classy-color-5',
|
|
56
|
+
'small-switch-color-1',
|
|
57
|
+
'small-switch-color-2',
|
|
58
|
+
'natural-color-1',
|
|
59
|
+
'natural-color-2',
|
|
60
|
+
'natural-color-3',
|
|
61
|
+
'grey-friend-1',
|
|
62
|
+
'grey-friend-2',
|
|
63
|
+
'shade-1',
|
|
64
|
+
'shade-2',
|
|
65
|
+
'shade-3',
|
|
66
|
+
'shade-4',
|
|
67
|
+
]),
|
|
68
|
+
/** Additional CSS classes */
|
|
69
|
+
className: PropTypes.string,
|
|
70
|
+
/** Inline styles */
|
|
71
|
+
style: PropTypes.object,
|
|
34
72
|
};
|
|
35
|
-
|
|
36
|
-
Caption.defaultProps = {
|
|
37
|
-
primary: false,
|
|
38
|
-
size: 'medium',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Caption;
|