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,332 @@
|
|
|
1
|
-
|
|
1
|
+
// src/stories/Atoms/Image/Image.stories.jsx
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { Image } from './Image';
|
|
4
|
+
import { FaHeart, FaShare, FaEdit, FaTrash, FaSearch } from 'react-icons/fa';
|
|
5
|
+
import './Image.css';
|
|
3
6
|
|
|
4
|
-
// Storybook configuration for Image component
|
|
5
7
|
export default {
|
|
6
8
|
title: 'Atoms/Media/Image',
|
|
7
9
|
component: Image,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
10
|
argTypes: {
|
|
12
|
-
|
|
11
|
+
src: {
|
|
12
|
+
control: 'text',
|
|
13
|
+
description: 'Source URL of the image.',
|
|
14
|
+
},
|
|
15
|
+
alt: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
description: 'Alternative text for the image.',
|
|
18
|
+
},
|
|
19
|
+
width: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Width of the image.',
|
|
22
|
+
},
|
|
23
|
+
height: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'Height of the image.',
|
|
26
|
+
},
|
|
27
|
+
loading: {
|
|
28
|
+
control: {
|
|
29
|
+
type: 'select',
|
|
30
|
+
options: ['lazy', 'eager'],
|
|
31
|
+
},
|
|
32
|
+
description: 'Loading behavior.',
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Tooltip text.',
|
|
37
|
+
},
|
|
38
|
+
caption: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Caption for the image.',
|
|
41
|
+
},
|
|
42
|
+
variant: {
|
|
43
|
+
control: {
|
|
44
|
+
type: 'select',
|
|
45
|
+
options: ['thumbnail', 'avatar', 'expanded', 'flat'],
|
|
46
|
+
},
|
|
47
|
+
description: 'Variant of the image.',
|
|
48
|
+
},
|
|
49
|
+
aspectRatio: {
|
|
50
|
+
control: {
|
|
51
|
+
type: 'select',
|
|
52
|
+
options: ['16by9', '4by3', '1by1'],
|
|
53
|
+
},
|
|
54
|
+
description: 'Aspect ratio of the image.',
|
|
55
|
+
},
|
|
56
|
+
crop: {
|
|
57
|
+
control: {
|
|
58
|
+
type: 'select',
|
|
59
|
+
options: ['center', 'top', 'left'],
|
|
60
|
+
},
|
|
61
|
+
description: 'Crop position of the image.',
|
|
62
|
+
},
|
|
63
|
+
fallbackSrc: {
|
|
64
|
+
control: 'text',
|
|
65
|
+
description: 'Fallback image source if the main image fails to load.',
|
|
66
|
+
},
|
|
67
|
+
srcSet: {
|
|
68
|
+
control: 'text',
|
|
69
|
+
description: 'srcSet for responsive images.',
|
|
70
|
+
},
|
|
71
|
+
sizes: {
|
|
72
|
+
control: 'text',
|
|
73
|
+
description: 'Sizes attribute for responsive images.',
|
|
74
|
+
},
|
|
75
|
+
lazyLoad: {
|
|
76
|
+
control: 'boolean',
|
|
77
|
+
description: 'Enable lazy loading.',
|
|
78
|
+
},
|
|
79
|
+
onClickExpand: {
|
|
80
|
+
action: 'clicked',
|
|
81
|
+
description: 'Function to handle expand action.',
|
|
82
|
+
},
|
|
83
|
+
hoverIcons: {
|
|
84
|
+
control: 'object',
|
|
85
|
+
description: 'Icons to display on hover.',
|
|
86
|
+
},
|
|
87
|
+
hoverCaption: {
|
|
88
|
+
control: 'text',
|
|
89
|
+
description: 'Caption to display on hover.',
|
|
90
|
+
},
|
|
91
|
+
hoverIconPosition: {
|
|
92
|
+
control: {
|
|
93
|
+
type: 'select',
|
|
94
|
+
options: ['center', 'top-right'],
|
|
95
|
+
},
|
|
96
|
+
description: 'Position of hover icons.',
|
|
97
|
+
},
|
|
98
|
+
size: {
|
|
99
|
+
control: {
|
|
100
|
+
type: 'select',
|
|
101
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
102
|
+
},
|
|
103
|
+
description: 'Size of the image.',
|
|
104
|
+
},
|
|
105
|
+
className: {
|
|
106
|
+
control: 'text',
|
|
107
|
+
description: 'Additional CSS classes.',
|
|
108
|
+
},
|
|
109
|
+
style: {
|
|
110
|
+
control: 'object',
|
|
111
|
+
description: 'Inline styles.',
|
|
112
|
+
},
|
|
13
113
|
},
|
|
14
114
|
};
|
|
15
115
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Thumbnail Variant
|
|
118
|
+
*/
|
|
119
|
+
export const Thumbnail = () => (
|
|
120
|
+
<Image
|
|
121
|
+
src="https://via.placeholder.com/300x200"
|
|
122
|
+
alt="Thumbnail Image"
|
|
123
|
+
variant="thumbnail"
|
|
124
|
+
caption="This is a thumbnail image."
|
|
125
|
+
size="md"
|
|
126
|
+
/>
|
|
127
|
+
);
|
|
22
128
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
129
|
+
/**
|
|
130
|
+
* Avatar Variant - 5 Sizes
|
|
131
|
+
*/
|
|
132
|
+
export const AvatarSizes = () => (
|
|
133
|
+
<div className="avatar-sizes" style={{ display: 'flex', gap: '16px' }}>
|
|
134
|
+
<Image
|
|
135
|
+
src="https://via.placeholder.com/30"
|
|
136
|
+
alt="Avatar XS"
|
|
137
|
+
variant="avatar"
|
|
138
|
+
size="xs"
|
|
139
|
+
caption="XS Avatar"
|
|
140
|
+
/>
|
|
141
|
+
<Image
|
|
142
|
+
src="https://via.placeholder.com/50"
|
|
143
|
+
alt="Avatar SM"
|
|
144
|
+
variant="avatar"
|
|
145
|
+
size="sm"
|
|
146
|
+
caption="SM Avatar"
|
|
147
|
+
/>
|
|
148
|
+
<Image
|
|
149
|
+
src="https://via.placeholder.com/70"
|
|
150
|
+
alt="Avatar MD"
|
|
151
|
+
variant="avatar"
|
|
152
|
+
size="md"
|
|
153
|
+
caption="MD Avatar"
|
|
154
|
+
/>
|
|
155
|
+
<Image
|
|
156
|
+
src="https://via.placeholder.com/90"
|
|
157
|
+
alt="Avatar LG"
|
|
158
|
+
variant="avatar"
|
|
159
|
+
size="lg"
|
|
160
|
+
caption="LG Avatar"
|
|
161
|
+
/>
|
|
162
|
+
<Image
|
|
163
|
+
src="https://via.placeholder.com/110"
|
|
164
|
+
alt="Avatar XL"
|
|
165
|
+
variant="avatar"
|
|
166
|
+
size="xl"
|
|
167
|
+
caption="XL Avatar"
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
28
171
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Expanded Variant
|
|
174
|
+
*/
|
|
175
|
+
export const Expanded = () => (
|
|
176
|
+
<Image
|
|
177
|
+
src="https://via.placeholder.com/800x600"
|
|
178
|
+
alt="Expanded Image"
|
|
179
|
+
variant="expanded"
|
|
180
|
+
caption="This is an expanded image."
|
|
181
|
+
onClickExpand={() => console.log('Image expanded')}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
35
184
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Flat Variant
|
|
187
|
+
*/
|
|
188
|
+
export const Flat = () => (
|
|
189
|
+
<Image
|
|
190
|
+
src="https://via.placeholder.com/400x300"
|
|
191
|
+
alt="Flat Image"
|
|
192
|
+
variant="flat"
|
|
193
|
+
caption="This is a flat image with no overlay."
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Image with Aspect Ratio
|
|
199
|
+
*/
|
|
200
|
+
export const ImageWithAspectRatio = () => (
|
|
201
|
+
<Image
|
|
202
|
+
src="https://via.placeholder.com/400x300"
|
|
203
|
+
alt="16 by 9 Image"
|
|
204
|
+
variant="thumbnail"
|
|
205
|
+
aspectRatio="16by9"
|
|
206
|
+
caption="Image with 16:9 aspect ratio."
|
|
207
|
+
size="lg"
|
|
208
|
+
/>
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Image with Crop
|
|
213
|
+
*/
|
|
214
|
+
export const ImageWithCrop = () => (
|
|
215
|
+
<Image
|
|
216
|
+
src="https://via.placeholder.com/400x300"
|
|
217
|
+
alt="Cropped Image"
|
|
218
|
+
variant="thumbnail"
|
|
219
|
+
crop="top"
|
|
220
|
+
caption="Image cropped from the top."
|
|
221
|
+
size="md"
|
|
222
|
+
/>
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Image with Fallback
|
|
227
|
+
*/
|
|
228
|
+
export const ImageWithFallback = () => (
|
|
229
|
+
<Image
|
|
230
|
+
src="https://invalid-url.com/image.jpg"
|
|
231
|
+
alt="Image with fallback"
|
|
232
|
+
variant="thumbnail"
|
|
233
|
+
fallbackSrc="https://via.placeholder.com/300x200?text=Fallback+Image"
|
|
234
|
+
caption="This image failed to load and shows a fallback."
|
|
235
|
+
size="md"
|
|
236
|
+
/>
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Responsive Image
|
|
241
|
+
*/
|
|
242
|
+
export const ResponsiveImage = () => (
|
|
243
|
+
<Image
|
|
244
|
+
src="https://via.placeholder.com/800x600"
|
|
245
|
+
alt="Responsive Image"
|
|
246
|
+
variant="thumbnail"
|
|
247
|
+
srcSet="
|
|
248
|
+
https://via.placeholder.com/400x300 400w,
|
|
249
|
+
https://via.placeholder.com/800x600 800w,
|
|
250
|
+
https://via.placeholder.com/1200x900 1200w
|
|
251
|
+
"
|
|
252
|
+
sizes="(max-width: 600px) 100vw, (max-width: 1200px) 50vw, 800px"
|
|
253
|
+
caption="This image is responsive using srcSet and sizes."
|
|
254
|
+
size="lg"
|
|
255
|
+
/>
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Click to Expand Image
|
|
260
|
+
*/
|
|
261
|
+
export const ClickToExpand = () => (
|
|
262
|
+
<Image
|
|
263
|
+
src="https://via.placeholder.com/600x400"
|
|
264
|
+
alt="Clickable Image"
|
|
265
|
+
variant="thumbnail"
|
|
266
|
+
caption="Clicking this image will expand it."
|
|
267
|
+
onClickExpand={() => alert('Image clicked to expand!')}
|
|
268
|
+
size="md"
|
|
269
|
+
/>
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* On Hover Show Icons at Center
|
|
274
|
+
*/
|
|
275
|
+
export const HoverIconsCenter = () => (
|
|
276
|
+
<Image
|
|
277
|
+
src="https://via.placeholder.com/300x200"
|
|
278
|
+
alt="Hover Icons Center"
|
|
279
|
+
variant="thumbnail"
|
|
280
|
+
caption="Hover to see icons at center."
|
|
281
|
+
hoverIcons={[FaHeart, FaShare]}
|
|
282
|
+
hoverIconPosition="center"
|
|
283
|
+
size="md"
|
|
284
|
+
/>
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* On Hover Show Caption Overlay
|
|
289
|
+
*/
|
|
290
|
+
export const HoverCaptionOverlay = () => (
|
|
291
|
+
<Image
|
|
292
|
+
src="https://via.placeholder.com/300x200"
|
|
293
|
+
alt="Hover Caption"
|
|
294
|
+
variant="thumbnail"
|
|
295
|
+
hoverCaption="This is an overlay caption."
|
|
296
|
+
size="md"
|
|
297
|
+
/>
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* On Hover Show Icons at Top Right
|
|
302
|
+
*/
|
|
303
|
+
export const HoverIconsTopRight = () => (
|
|
304
|
+
<Image
|
|
305
|
+
src="https://via.placeholder.com/300x200"
|
|
306
|
+
alt="Hover Icons Top Right"
|
|
307
|
+
variant="thumbnail"
|
|
308
|
+
hoverIcons={[FaEdit, FaTrash]}
|
|
309
|
+
hoverIconPosition="top-right"
|
|
310
|
+
caption="Hover to see icons at top right."
|
|
311
|
+
size="md"
|
|
312
|
+
/>
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Interactive Image
|
|
317
|
+
*/
|
|
318
|
+
const Template = (args) => <Image {...args} />;
|
|
319
|
+
|
|
320
|
+
export const InteractiveImage = Template.bind({});
|
|
321
|
+
InteractiveImage.args = {
|
|
322
|
+
src: 'https://via.placeholder.com/500x300',
|
|
323
|
+
alt: 'Interactive Image',
|
|
324
|
+
variant: 'thumbnail',
|
|
325
|
+
caption: 'This is an interactive image.',
|
|
326
|
+
aspectRatio: '4by3',
|
|
327
|
+
crop: 'center',
|
|
328
|
+
hoverIcons: [FaSearch],
|
|
329
|
+
hoverCaption: 'Search this image',
|
|
330
|
+
hoverIconPosition: 'center',
|
|
331
|
+
size: 'md',
|
|
41
332
|
};
|
|
@@ -1,29 +1,171 @@
|
|
|
1
|
+
/* src/stories/Atoms/Label/Label.css */
|
|
1
2
|
|
|
2
3
|
.label {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
border:
|
|
4
|
+
display: inline-block;
|
|
5
|
+
font-weight: 500;
|
|
6
|
+
text-align: center;
|
|
7
|
+
border-radius: 0.25rem;
|
|
8
|
+
transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
|
|
9
|
+
cursor: default;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
.label--
|
|
10
|
-
|
|
11
|
-
border-color: #1e88e5;
|
|
12
|
+
.label--background {
|
|
13
|
+
color: #fff;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
.label--
|
|
15
|
-
background-color:
|
|
16
|
-
border-color: #ccc;
|
|
16
|
+
.label--color-primary {
|
|
17
|
+
background-color: var(--primary-color);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
.label--
|
|
20
|
-
|
|
20
|
+
.label--color-secondary {
|
|
21
|
+
border: 1px solid var(--secondary-color);
|
|
22
|
+
color: var(--secondary-color);
|
|
23
|
+
background-color: transparent;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
.label--
|
|
24
|
-
|
|
26
|
+
.label--color-info {
|
|
27
|
+
background-color: var(--info-color);
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
.label--
|
|
28
|
-
|
|
30
|
+
.label--color-warning {
|
|
31
|
+
background-color: var(--warning-color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.label--color-alert {
|
|
35
|
+
background-color: var(--alert-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.label--color-success {
|
|
39
|
+
background-color: var(--success-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.label--color-neutral {
|
|
43
|
+
background-color: var(--neutral-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.label--color-dark {
|
|
47
|
+
background-color: var(--dark-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.label--color-classy-color-1 {
|
|
51
|
+
background-color: var(--classy-color-1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.label--color-classy-color-2 {
|
|
55
|
+
background-color: var(--classy-color-2);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.label--color-classy-color-3 {
|
|
59
|
+
background-color: var(--classy-color-3);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.label--color-classy-color-4 {
|
|
63
|
+
background-color: var(--classy-color-4);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.label--color-classy-color-5 {
|
|
67
|
+
background-color: var(--classy-color-5);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.label--color-small-switch-color-1 {
|
|
71
|
+
background-color: var(--small-switch-color-1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.label--color-small-switch-color-2 {
|
|
75
|
+
background-color: var(--small-switch-color-2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.label--color-natural-color-1 {
|
|
79
|
+
background-color: var(--natural-color-1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.label--color-natural-color-2 {
|
|
83
|
+
background-color: var(--natural-color-2);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.label--color-natural-color-3 {
|
|
87
|
+
background-color: var(--natural-color-3);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.label--color-grey-friend-1 {
|
|
91
|
+
background-color: var(--grey-friend-1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.label--color-grey-friend-2 {
|
|
95
|
+
background-color: var(--grey-friend-2);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.label--color-shade-1 {
|
|
99
|
+
background-color: var(--shade-1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.label--color-shade-2 {
|
|
103
|
+
background-color: var(--shade-2);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.label--color-shade-3 {
|
|
107
|
+
background-color: var(--shade-3);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.label--color-shade-4 {
|
|
111
|
+
background-color: var(--shade-4);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Secondary Labels (no background) */
|
|
115
|
+
.label--color-secondary:not(.label--background) {
|
|
116
|
+
border: 1px solid var(--secondary-color);
|
|
117
|
+
color: var(--secondary-color);
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Shape Variations */
|
|
122
|
+
.label--shape-rounded {
|
|
123
|
+
border-radius: 0.25rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.label--shape-square {
|
|
127
|
+
border-radius: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.label--shape-pill {
|
|
131
|
+
border-radius: 9999px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Size Variations */
|
|
135
|
+
.label--size-xs {
|
|
136
|
+
font-size: 0.6rem;
|
|
137
|
+
padding: 0.2em 0.4em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.label--size-sm {
|
|
141
|
+
font-size: 0.75rem;
|
|
142
|
+
padding: 0.25em 0.5em;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.label--size-md {
|
|
146
|
+
font-size: 0.875rem;
|
|
147
|
+
padding: 0.3em 0.6em;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.label--size-lg {
|
|
151
|
+
font-size: 1rem;
|
|
152
|
+
padding: 0.35em 0.7em;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.label--size-xl {
|
|
156
|
+
font-size: 1.125rem;
|
|
157
|
+
padding: 0.4em 0.8em;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Additional Styles */
|
|
161
|
+
.label-colors, .label-shapes, .label-sizes {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-wrap: wrap;
|
|
164
|
+
gap: var(--spacing-md);
|
|
165
|
+
align-items: center;
|
|
166
|
+
margin-bottom: var(--spacing-md);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.label-sizes .label {
|
|
170
|
+
margin-right: var(--spacing-sm);
|
|
29
171
|
}
|
|
@@ -1,41 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
// src/stories/Atoms/Label/Label.jsx
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import classNames from 'classnames';
|
|
4
5
|
import './Label.css';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const Label = ({
|
|
8
|
+
text,
|
|
9
|
+
color = 'neutral',
|
|
10
|
+
background = true,
|
|
11
|
+
shape = 'rounded', // 'rounded', 'square', 'pill'
|
|
12
|
+
size = 'md', // 'xs', 'sm', 'md', 'lg', 'xl'
|
|
13
|
+
className = '',
|
|
14
|
+
style = {},
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
const labelClasses = classNames('label', className, {
|
|
18
|
+
[`label--color-${color}`]: color,
|
|
19
|
+
[`label--background`]: background && color !== 'secondary',
|
|
20
|
+
[`label--shape-${shape}`]: shape,
|
|
21
|
+
[`label--size-${size}`]: size,
|
|
22
|
+
});
|
|
23
|
+
|
|
11
24
|
return (
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
{children}
|
|
17
|
-
</div>
|
|
25
|
+
<span className={labelClasses} style={style} {...props}>
|
|
26
|
+
{text}
|
|
27
|
+
</span>
|
|
18
28
|
);
|
|
19
29
|
};
|
|
20
30
|
|
|
21
31
|
Label.propTypes = {
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/** Text content of the label */
|
|
33
|
+
text: PropTypes.string.isRequired,
|
|
34
|
+
/** Color of the label */
|
|
35
|
+
color: PropTypes.oneOf([
|
|
36
|
+
'primary',
|
|
37
|
+
'secondary',
|
|
38
|
+
'info',
|
|
39
|
+
'warning',
|
|
40
|
+
'alert',
|
|
41
|
+
'success',
|
|
42
|
+
'neutral',
|
|
43
|
+
'dark',
|
|
44
|
+
'classy-color-1',
|
|
45
|
+
'classy-color-2',
|
|
46
|
+
'classy-color-3',
|
|
47
|
+
'classy-color-4',
|
|
48
|
+
'classy-color-5',
|
|
49
|
+
'small-switch-color-1',
|
|
50
|
+
'small-switch-color-2',
|
|
51
|
+
'natural-color-1',
|
|
52
|
+
'natural-color-2',
|
|
53
|
+
'natural-color-3',
|
|
54
|
+
'grey-friend-1',
|
|
55
|
+
'grey-friend-2',
|
|
56
|
+
'shade-1',
|
|
57
|
+
'shade-2',
|
|
58
|
+
'shade-3',
|
|
59
|
+
'shade-4',
|
|
60
|
+
]),
|
|
61
|
+
/** Whether the label has a background */
|
|
62
|
+
background: PropTypes.bool,
|
|
63
|
+
/** Shape of the label */
|
|
64
|
+
shape: PropTypes.oneOf(['rounded', 'square', 'pill']),
|
|
65
|
+
/** Size of the label */
|
|
66
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
67
|
+
/** Additional CSS classes */
|
|
68
|
+
className: PropTypes.string,
|
|
69
|
+
/** Inline styles */
|
|
70
|
+
style: PropTypes.object,
|
|
34
71
|
};
|
|
35
|
-
|
|
36
|
-
Label.defaultProps = {
|
|
37
|
-
primary: false,
|
|
38
|
-
size: 'medium',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Label;
|