this.gui 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +178 -49
  2. package/dist/style.css +1 -1
  3. package/dist/this-gui.es.js +4645 -1922
  4. package/dist/this-gui.umd.js +34 -22
  5. package/package.json +14 -14
  6. package/src/App.jsx +53 -21
  7. package/src/Page.jsx +28 -0
  8. package/src/SiteBuilder.jsx +39 -0
  9. package/src/example.json +43 -0
  10. package/src/index.mdx +10 -0
  11. package/src/main.jsx +11 -14
  12. package/src/scripts/ComponentRegistry.js +70 -0
  13. package/src/scripts/postinstall.js +40 -1
  14. package/src/scripts/renderComponents.js +11 -0
  15. package/src/stories/Atoms/Alert/Alert.css +196 -14
  16. package/src/stories/Atoms/Alert/Alert.jsx +43 -28
  17. package/src/stories/Atoms/Alert/Alert.stories.jsx +154 -28
  18. package/src/stories/Atoms/Audio/Audio.css +246 -16
  19. package/src/stories/Atoms/Audio/Audio.jsx +204 -29
  20. package/src/stories/Atoms/Audio/Audio.stories.jsx +178 -28
  21. package/src/stories/Atoms/Badge/Badge.css +235 -15
  22. package/src/stories/Atoms/Badge/Badge.jsx +44 -31
  23. package/src/stories/Atoms/Badge/Badge.stories.jsx +109 -29
  24. package/src/stories/Atoms/Button/Button.css +106 -45
  25. package/src/stories/Atoms/Button/Button.jsx +31 -82
  26. package/src/stories/Atoms/Button/Button.stories.jsx +170 -40
  27. package/src/stories/Atoms/Caption/Caption.css +156 -16
  28. package/src/stories/Atoms/Caption/Caption.jsx +62 -31
  29. package/src/stories/Atoms/Caption/Caption.stories.jsx +194 -28
  30. package/src/stories/Atoms/Checkbox/Checkbox.css +168 -15
  31. package/src/stories/Atoms/Checkbox/Checkbox.jsx +73 -31
  32. package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +98 -27
  33. package/src/stories/Atoms/Container/Container.css +75 -15
  34. package/src/stories/Atoms/Container/Container.jsx +41 -28
  35. package/src/stories/Atoms/Container/Container.stories.jsx +92 -29
  36. package/src/stories/Atoms/Divider/Divider.css +131 -13
  37. package/src/stories/Atoms/Divider/Divider.jsx +54 -33
  38. package/src/stories/Atoms/Divider/Divider.stories.jsx +93 -29
  39. package/src/stories/Atoms/Grid/Grid.css +160 -0
  40. package/src/stories/Atoms/Grid/Grid.jsx +43 -0
  41. package/src/stories/Atoms/Grid/Grid.stories.jsx +84 -0
  42. package/src/stories/Atoms/Heading/Heading.css +99 -16
  43. package/src/stories/Atoms/Heading/Heading.jsx +57 -29
  44. package/src/stories/Atoms/Heading/Heading.stories.jsx +117 -28
  45. package/src/stories/Atoms/Icon/Icon.css +219 -27
  46. package/src/stories/Atoms/Icon/Icon.jsx +67 -38
  47. package/src/stories/Atoms/Icon/Icon.stories.jsx +156 -51
  48. package/src/stories/Atoms/Image/Image.css +231 -15
  49. package/src/stories/Atoms/Image/Image.jsx +166 -32
  50. package/src/stories/Atoms/Image/Image.stories.jsx +319 -28
  51. package/src/stories/Atoms/Label/Label.css +158 -16
  52. package/src/stories/Atoms/Label/Label.jsx +61 -31
  53. package/src/stories/Atoms/Label/Label.stories.jsx +167 -28
  54. package/src/stories/Atoms/Link/Link.css +58 -16
  55. package/src/stories/Atoms/Link/Link.jsx +73 -32
  56. package/src/stories/Atoms/Link/Link.stories.jsx +141 -29
  57. package/src/stories/Atoms/Loader/Loader.css +93 -16
  58. package/src/stories/Atoms/Loader/Loader.jsx +47 -30
  59. package/src/stories/Atoms/Loader/Loader.stories.jsx +86 -28
  60. package/src/stories/Atoms/Logo/Logo.css +94 -0
  61. package/src/stories/Atoms/Logo/Logo.jsx +53 -0
  62. package/src/stories/Atoms/Logo/Logo.stories.jsx +120 -0
  63. package/src/stories/Atoms/Paragraph/Paragraph.css +167 -16
  64. package/src/stories/Atoms/Paragraph/Paragraph.jsx +67 -31
  65. package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +130 -28
  66. package/src/stories/Atoms/ProgressBar/ProgressBar.css +115 -17
  67. package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +30 -31
  68. package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +72 -27
  69. package/src/stories/Atoms/RadioButton/RadioButton.css +118 -17
  70. package/src/stories/Atoms/RadioButton/RadioButton.jsx +77 -31
  71. package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +99 -27
  72. package/src/stories/Atoms/Range/Range.css +169 -0
  73. package/src/stories/Atoms/Range/Range.jsx +87 -0
  74. package/src/stories/Atoms/Range/Range.stories.jsx +110 -0
  75. package/src/stories/Atoms/Section/Section.css +268 -0
  76. package/src/stories/Atoms/Section/Section.jsx +63 -0
  77. package/src/stories/Atoms/Section/Section.stories.jsx +46 -0
  78. package/src/stories/Atoms/Select/Select.css +74 -16
  79. package/src/stories/Atoms/Select/Select.jsx +62 -30
  80. package/src/stories/Atoms/Select/Select.stories.jsx +95 -27
  81. package/src/stories/Atoms/Slider/Slider.css +77 -16
  82. package/src/stories/Atoms/Slider/Slider.jsx +119 -31
  83. package/src/stories/Atoms/Slider/Slider.stories.jsx +77 -28
  84. package/src/stories/Atoms/Snackbar/Snackbar.css +297 -13
  85. package/src/stories/Atoms/Snackbar/Snackbar.jsx +62 -31
  86. package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +63 -26
  87. package/src/stories/Atoms/Spacer/Spacer.css +101 -16
  88. package/src/stories/Atoms/Spacer/Spacer.jsx +26 -32
  89. package/src/stories/Atoms/Spacer/Spacer.stories.jsx +50 -30
  90. package/src/stories/Atoms/Spinner/Spinner.css +97 -16
  91. package/src/stories/Atoms/Spinner/Spinner.jsx +50 -26
  92. package/src/stories/Atoms/Spinner/Spinner.stories.jsx +47 -30
  93. package/src/stories/Atoms/Tag/Tag.css +97 -14
  94. package/src/stories/Atoms/Tag/Tag.jsx +58 -24
  95. package/src/stories/Atoms/Tag/Tag.stories.jsx +55 -29
  96. package/src/stories/Atoms/TextArea/TextArea.css +85 -15
  97. package/src/stories/Atoms/TextArea/TextArea.jsx +108 -31
  98. package/src/stories/Atoms/TextArea/TextArea.stories.jsx +25 -30
  99. package/src/stories/Atoms/TextInput/TextInput.css +90 -17
  100. package/src/stories/Atoms/TextInput/TextInput.jsx +119 -27
  101. package/src/stories/Atoms/TextInput/TextInput.stories.jsx +53 -25
  102. package/src/stories/Atoms/Toggle/Toggle.css +106 -17
  103. package/src/stories/Atoms/Toggle/Toggle.jsx +56 -28
  104. package/src/stories/Atoms/Toggle/Toggle.stories.jsx +24 -30
  105. package/src/stories/Atoms/Tooltip/Tooltip.css +368 -14
  106. package/src/stories/Atoms/Tooltip/Tooltip.jsx +33 -28
  107. package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +42 -31
  108. package/src/stories/Atoms/Video/Video.css +28 -18
  109. package/src/stories/Atoms/Video/Video.jsx +66 -29
  110. package/src/stories/Atoms/Video/Video.stories.jsx +30 -30
  111. package/src/stories/Atoms/index.js +9 -2
  112. package/src/stories/Atoms/meta_Atoms.js +6 -1
  113. package/src/stories/Layouts/Accordion/Accordion.css +293 -0
  114. package/src/stories/Layouts/Accordion/Accordion.jsx +74 -0
  115. package/src/stories/Layouts/Accordion/Accordion.stories.jsx +39 -0
  116. package/src/stories/Layouts/Flexbox/Flexbox.css +16 -0
  117. package/src/stories/Layouts/Flexbox/Flexbox.jsx +11 -0
  118. package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +28 -0
  119. package/src/stories/Layouts/Footer/Footer.css +16 -0
  120. package/src/stories/Layouts/Footer/Footer.jsx +31 -0
  121. package/src/stories/Layouts/Footer/Footer.stories.jsx +28 -0
  122. package/src/stories/Layouts/Header/Header.css +16 -0
  123. package/src/stories/Layouts/Header/Header.jsx +31 -0
  124. package/src/stories/Layouts/Header/Header.stories.jsx +28 -0
  125. package/src/stories/Layouts/HeroBanner/HeroBanner.css +16 -0
  126. package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +31 -0
  127. package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +28 -0
  128. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +16 -0
  129. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +31 -0
  130. package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +28 -0
  131. package/src/stories/Layouts/Pagination/Pagination.css +16 -0
  132. package/src/stories/Layouts/Pagination/Pagination.jsx +31 -0
  133. package/src/stories/Layouts/Pagination/Pagination.stories.jsx +28 -0
  134. package/src/stories/Layouts/Sidebar/Sidebar.css +16 -0
  135. package/src/stories/Layouts/Sidebar/Sidebar.jsx +71 -0
  136. package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +28 -0
  137. package/src/stories/Layouts/Tabs/Tabs.css +16 -0
  138. package/src/stories/Layouts/Tabs/Tabs.jsx +31 -0
  139. package/src/stories/Layouts/Tabs/Tabs.stories.jsx +28 -0
  140. package/src/stories/Layouts/index.js +25 -0
  141. package/src/stories/Layouts/meta_Layouts.js +28 -0
  142. package/src/stories/Molecules/Accordion/Accordion.css +1 -1
  143. package/src/stories/Molecules/Accordion/Accordion.jsx +1 -1
  144. package/src/stories/Molecules/Accordion/Accordion.stories.jsx +1 -1
  145. package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +95 -2
  146. package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +232 -13
  147. package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +46 -11
  148. package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +128 -2
  149. package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +69 -14
  150. package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +12 -12
  151. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +145 -2
  152. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +39 -13
  153. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +27 -11
  154. package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +463 -2
  155. package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +34 -12
  156. package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +36 -12
  157. package/src/stories/Molecules/Card/Card.css +39 -2
  158. package/src/stories/Molecules/Card/Card.jsx +80 -13
  159. package/src/stories/Molecules/Card/Card.stories.jsx +27 -13
  160. package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +33 -2
  161. package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +91 -12
  162. package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +73 -12
  163. package/src/stories/Molecules/Dropdown/Dropdown.css +192 -0
  164. package/src/stories/Molecules/Dropdown/Dropdown.jsx +96 -0
  165. package/src/stories/Molecules/Dropdown/Dropdown.stories.jsx +45 -0
  166. package/src/stories/Molecules/Navbar/Navbar.css +63 -59
  167. package/src/stories/Molecules/Navbar/Navbar.jsx +43 -48
  168. package/src/stories/Molecules/Navbar/Navbar.stories.jsx +58 -8
  169. package/src/stories/Molecules/SearchBar/SearchBar.css +66 -1
  170. package/src/stories/Molecules/SearchBar/SearchBar.jsx +59 -11
  171. package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +16 -7
  172. package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +16 -38
  173. package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +1 -2
  174. package/src/stories/Molecules/Sidebar/Sidebar.css +65 -2
  175. package/src/stories/Molecules/Sidebar/Sidebar.jsx +66 -11
  176. package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +20 -5
  177. package/src/stories/Molecules/index.js +2 -1
  178. package/src/stories/Molecules/{Molecules.js → meta_Molecules.js} +6 -3
  179. package/src/stories/Templates/AdminDashboard/AdminDashboard.css +7 -0
  180. package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +24 -0
  181. package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +20 -0
  182. package/src/stories/Templates/CallToAction/CallToAction.css +7 -0
  183. package/src/stories/Templates/CallToAction/CallToAction.jsx +24 -0
  184. package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +20 -0
  185. package/src/stories/Templates/FeaturesList/FeaturesList.css +7 -0
  186. package/src/stories/Templates/FeaturesList/FeaturesList.jsx +24 -0
  187. package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +20 -0
  188. package/src/stories/Templates/FormSection/FormSection.css +7 -0
  189. package/src/stories/Templates/FormSection/FormSection.jsx +24 -0
  190. package/src/stories/Templates/FormSection/FormSection.stories.jsx +20 -0
  191. package/src/stories/Templates/HeroSection/HeroSection.css +7 -0
  192. package/src/stories/Templates/HeroSection/HeroSection.jsx +24 -0
  193. package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +20 -0
  194. package/src/stories/Templates/LocationInfo/LocationInfo.css +7 -0
  195. package/src/stories/Templates/LocationInfo/LocationInfo.jsx +24 -0
  196. package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +20 -0
  197. package/src/stories/Templates/ProductPage/ProductPage.css +7 -0
  198. package/src/stories/Templates/ProductPage/ProductPage.jsx +24 -0
  199. package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +20 -0
  200. package/src/stories/Templates/RegistrationPage/RegistrationPage.css +7 -0
  201. package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +24 -0
  202. package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +20 -0
  203. package/src/stories/Templates/ShoppingCart/ShoppingCart.css +7 -0
  204. package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +24 -0
  205. package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +20 -0
  206. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +7 -0
  207. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +24 -0
  208. package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +20 -0
  209. package/src/stories/Templates/SignInPage/SignInPage.css +7 -0
  210. package/src/stories/Templates/SignInPage/SignInPage.jsx +24 -0
  211. package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +20 -0
  212. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +7 -0
  213. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +24 -0
  214. package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +20 -0
  215. package/src/stories/Templates/Testimonials/Testimonials.css +7 -0
  216. package/src/stories/Templates/Testimonials/Testimonials.jsx +24 -0
  217. package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +20 -0
  218. package/src/stories/Templates/index.js +33 -0
  219. package/src/stories/Templates/{Templates.js → meta_Templates.js} +3 -1
  220. package/src/stories/assets/logo.png +0 -0
  221. package/src/stories/assets/logo.svg +106 -0
  222. package/src/stories/assets/test.svg +3 -0
  223. package/src/themes/README_Styles.md +301 -0
  224. package/src/themes/ThemeProvider.jsx +47 -22
  225. package/src/themes/styles/dracula/dark.css +0 -0
  226. package/src/themes/styles/dracula/light.css +0 -0
  227. package/src/themes/styles/github/dark.css +0 -0
  228. package/src/themes/styles/github/light.css +0 -0
  229. package/src/themes/styles/neurons/dark.css +247 -0
  230. package/src/themes/styles/neurons/light.css +280 -0
  231. package/dist/Styles.md +0 -446
  232. package/dist/context.md +0 -942
  233. package/dist/github-3688a83a.js +0 -5
  234. package/dist/gothic-94a7ecd6.js +0 -5
  235. package/dist/newsprint-32bf94d9.js +0 -5
  236. package/dist/night-4a954853.js +0 -5
  237. package/dist/pixyll-94de4610.js +0 -5
  238. package/dist/whitey-db68723e.js +0 -5
  239. package/src/MDXEditor.jsx +0 -32
  240. package/src/Theme.jsx +0 -28
  241. package/src/components/CodeBlock.jsx +0 -22
  242. package/src/components/ComponentFactory.jsx +0 -36
  243. package/src/components/ComponentRegistry.js +0 -21
  244. package/src/scripts/generateComponents.js +0 -166
  245. package/src/scripts/verifyMolecules.js +0 -158
  246. package/src/scripts/verify_and_install_atoms.js +0 -211
  247. package/src/stories/Atoms/RangeInput/RangeInput.css +0 -29
  248. package/src/stories/Atoms/RangeInput/RangeInput.jsx +0 -41
  249. package/src/stories/Atoms/RangeInput/RangeInput.stories.jsx +0 -41
  250. package/src/stories/Components.md +0 -189
  251. package/src/stories/Layouts/Grid/Grid.css +0 -4
  252. package/src/stories/Layouts/Grid/Grid.jsx +0 -15
  253. package/src/stories/Layouts/Grid/Grid.stories.jsx +0 -26
  254. package/src/stories/Layouts/Layout.js +0 -28
  255. package/src/styles/Header.modules.css +0 -32
  256. package/src/styles/global.css +0 -59
  257. package/src/themes/Themes.js +0 -44
  258. package/src/themes/dark.js +0 -22
  259. package/src/themes/light.js +0 -22
  260. package/src/themes/typ/Readme.md +0 -4
  261. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700.woff2 +0 -0
  262. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700italic.woff2 +0 -0
  263. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-italic.woff2 +0 -0
  264. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-regular.woff2 +0 -0
  265. package/src/themes/typ/github.css +0 -416
  266. package/src/themes/typ/gothic/GUST e-foundry License.txt +0 -29
  267. package/src/themes/typ/gothic/didact-gothic-c-ext.woff2 +0 -0
  268. package/src/themes/typ/gothic/didact-gothic-c.woff2 +0 -0
  269. package/src/themes/typ/gothic/texgyreadventor-bold.woff +0 -0
  270. package/src/themes/typ/gothic/texgyreadventor-bolditalic.woff +0 -0
  271. package/src/themes/typ/gothic/texgyreadventor-italic.woff +0 -0
  272. package/src/themes/typ/gothic/texgyreadventor-regular.woff +0 -0
  273. package/src/themes/typ/gothic.css +0 -410
  274. package/src/themes/typ/newsprint/pt-serif-v11-latin-700.woff2 +0 -0
  275. package/src/themes/typ/newsprint/pt-serif-v11-latin-700italic.woff2 +0 -0
  276. package/src/themes/typ/newsprint/pt-serif-v11-latin-italic.woff2 +0 -0
  277. package/src/themes/typ/newsprint/pt-serif-v11-latin-regular.woff2 +0 -0
  278. package/src/themes/typ/newsprint.css +0 -622
  279. package/src/themes/typ/night/codeblock.dark.css +0 -113
  280. package/src/themes/typ/night/credit.html +0 -1
  281. package/src/themes/typ/night/cursor.png +0 -0
  282. package/src/themes/typ/night/cursor@2x.png +0 -0
  283. package/src/themes/typ/night/mermaid.dark.css +0 -7
  284. package/src/themes/typ/night/sourcemode.dark.css +0 -38
  285. package/src/themes/typ/night.css +0 -1032
  286. package/src/themes/typ/pixyll/lato-v14-latin-300.woff +0 -0
  287. package/src/themes/typ/pixyll/lato-v14-latin-300italic.woff +0 -0
  288. package/src/themes/typ/pixyll/lato-v14-latin-900.woff +0 -0
  289. package/src/themes/typ/pixyll/lato-v14-latin-900italic.woff +0 -0
  290. package/src/themes/typ/pixyll/merriweather-v19-latin-300.woff +0 -0
  291. package/src/themes/typ/pixyll/merriweather-v19-latin-300italic.woff +0 -0
  292. package/src/themes/typ/pixyll/merriweather-v19-latin-700.woff +0 -0
  293. package/src/themes/typ/pixyll/merriweather-v19-latin-700italic.woff +0 -0
  294. package/src/themes/typ/pixyll.css +0 -528
  295. package/src/themes/typ/whitey.css +0 -299
  296. /package/src/stories/Organisms/{Organisms.js → meta_Organisms.js} +0 -0
@@ -1,72 +1,177 @@
1
- // src/stories/atoms/Interactive/Icon/Icon.stories.jsx
2
-
1
+ // src/stories/Atoms/Icon/Icon.stories.jsx
3
2
  import React from 'react';
4
3
  import { Icon } from './Icon';
4
+ import { FaBeer, FaCoffee, FaApple, FaAndroid, FaReact, FaCheck, FaTimes, FaInfoCircle, FaExclamationTriangle, FaQuestionCircle } from 'react-icons/fa';
5
+ import './Icon.css';
5
6
 
6
7
  export default {
7
8
  title: 'Atoms/Media/Icon',
8
9
  component: Icon,
9
- parameters: {
10
- layout: 'centered',
11
- },
12
10
  argTypes: {
13
- name: {
14
- control: 'text',
15
- description: 'Name of the icon symbol to use.',
11
+ icon: {
12
+ control: 'object',
13
+ description: 'Icon component from react-icons or similar library.',
14
+ },
15
+ background: {
16
+ control: 'boolean',
17
+ description: 'Whether to display a background behind the icon.',
18
+ },
19
+ color: {
20
+ control: {
21
+ type: 'select',
22
+ options: [
23
+ 'info',
24
+ 'warning',
25
+ 'alert',
26
+ 'success',
27
+ 'neutral',
28
+ 'dark',
29
+ 'classy-color-1',
30
+ 'classy-color-2',
31
+ 'classy-color-3',
32
+ 'classy-color-4',
33
+ 'classy-color-5',
34
+ 'small-switch-color-1',
35
+ 'small-switch-color-2',
36
+ 'natural-color-1',
37
+ 'natural-color-2',
38
+ 'natural-color-3',
39
+ 'grey-friend-1',
40
+ 'grey-friend-2',
41
+ 'shade-1',
42
+ 'shade-2',
43
+ 'shade-3',
44
+ 'shade-4',
45
+ ],
46
+ },
47
+ description: 'Color of the icon or background.',
48
+ },
49
+ shape: {
50
+ control: {
51
+ type: 'select',
52
+ options: ['rounded', 'square'],
53
+ },
54
+ description: 'Shape of the icon background.',
16
55
  },
17
56
  size: {
18
- control: 'select',
19
- options: ['small', 'medium', 'large'],
57
+ control: {
58
+ type: 'select',
59
+ options: ['small', 'normal', 'big'],
60
+ },
20
61
  description: 'Size of the icon.',
21
62
  },
22
- color: {
23
- control: 'select',
24
- options: ['primary', 'secondary', 'success', 'danger', 'warning', 'info'],
25
- description: 'Color variant of the icon.',
63
+ align: {
64
+ control: {
65
+ type: 'select',
66
+ options: ['left', 'center', 'right'],
67
+ },
68
+ description: 'Alignment of the icon within its container.',
69
+ },
70
+ className: {
71
+ control: 'text',
72
+ description: 'Additional CSS classes.',
73
+ },
74
+ style: {
75
+ control: 'object',
76
+ description: 'Inline styles.',
26
77
  },
27
78
  },
28
79
  };
29
80
 
30
- const Template = (args) => <Icon {...args} />;
31
-
32
- export const Primary = Template.bind({});
33
- Primary.args = {
34
- name: 'home', // Replace 'home' with an actual icon name
35
- size: 'medium',
36
- color: 'primary',
81
+ const icons = {
82
+ FaBeer: FaBeer,
83
+ FaCoffee: FaCoffee,
84
+ FaApple: FaApple,
85
+ FaAndroid: FaAndroid,
86
+ FaReact: FaReact,
87
+ FaCheck: FaCheck,
88
+ FaTimes: FaTimes,
89
+ FaInfoCircle: FaInfoCircle,
90
+ FaExclamationTriangle: FaExclamationTriangle,
91
+ FaQuestionCircle: FaQuestionCircle,
37
92
  };
38
93
 
39
- export const Secondary = Template.bind({});
40
- Secondary.args = {
41
- name: 'settings',
42
- size: 'medium',
43
- color: 'secondary',
44
- };
94
+ /**
95
+ * All Icons Collection
96
+ */
97
+ export const AllIcons = () => (
98
+ <div className="icon-collection">
99
+ {Object.entries(icons).map(([name, IconComponent]) => (
100
+ <div key={name} className="icon-item">
101
+ <Icon
102
+ icon={IconComponent}
103
+ background={false}
104
+ color="neutral"
105
+ shape="square"
106
+ size="normal"
107
+ />
108
+ <p>{name}</p>
109
+ </div>
110
+ ))}
111
+ </div>
112
+ );
45
113
 
46
- export const Success = Template.bind({});
47
- Success.args = {
48
- name: 'check',
49
- size: 'medium',
50
- color: 'success',
51
- };
114
+ /**
115
+ * Icon with Background
116
+ */
117
+ export const IconWithBackground = () => (
118
+ <Icon
119
+ icon={FaBeer}
120
+ background
121
+ color="success"
122
+ shape="rounded"
123
+ size="big"
124
+ align="center"
125
+ />
126
+ );
52
127
 
53
- export const Danger = Template.bind({});
54
- Danger.args = {
55
- name: 'error',
56
- size: 'medium',
57
- color: 'danger',
58
- };
128
+ /**
129
+ * Icon without Background
130
+ */
131
+ export const IconWithoutBackground = () => (
132
+ <Icon
133
+ icon={FaCoffee}
134
+ background={false}
135
+ color="warning"
136
+ size="normal"
137
+ align="left"
138
+ />
139
+ );
59
140
 
60
- export const Large = Template.bind({});
61
- Large.args = {
62
- name: 'star',
63
- size: 'large',
64
- color: 'primary',
65
- };
141
+ /**
142
+ * Rounded Icon with Different Colors
143
+ */
144
+ export const RoundedIcons = () => (
145
+ <div className="icon-story">
146
+ <Icon icon={FaApple} background color="info" shape="rounded" size="small" />
147
+ <Icon icon={FaAndroid} background color="alert" shape="rounded" size="normal" />
148
+ <Icon icon={FaReact} background color="shade-3" shape="rounded" size="big" />
149
+ </div>
150
+ );
151
+
152
+ /**
153
+ * Square Icon with Different Colors
154
+ */
155
+ export const SquareIcons = () => (
156
+ <div className="icon-story">
157
+ <Icon icon={FaBeer} background color="neutral" shape="square" size="small" />
158
+ <Icon icon={FaCoffee} background color="dark" shape="square" size="normal" />
159
+ <Icon icon={FaApple} background color="classy-color-2" shape="square" size="big" />
160
+ </div>
161
+ );
66
162
 
67
- export const Small = Template.bind({});
68
- Small.args = {
69
- name: 'search',
70
- size: 'small',
71
- color: 'primary',
72
- };
163
+ /**
164
+ * Interactive Icon
165
+ */
166
+ const Template = (args) => <Icon {...args} />;
167
+
168
+ export const InteractiveIcon = Template.bind({});
169
+ InteractiveIcon.args = {
170
+ icon: FaReact,
171
+ background: false,
172
+ color: 'info',
173
+ shape: 'rounded',
174
+ size: 'normal',
175
+ align: 'center',
176
+ };
177
+ InteractiveIcon.storyName = 'Interactive Icon';
@@ -1,29 +1,245 @@
1
+ /* src/stories/Atoms/Image/Image.css */
2
+
3
+ .image-figure {
4
+ position: relative;
5
+ display: inline-block;
6
+ margin: 0;
7
+ }
8
+
9
+ .image__placeholder {
10
+ width: 100%;
11
+ height: 100%;
12
+ background-color: var(--neutral-color);
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ color: var(--background-color);
17
+ position: absolute;
18
+ top: 0;
19
+ left: 0;
20
+ }
1
21
 
2
22
  .image {
3
- padding: 16px;
4
- border-radius: 8px;
5
- background-color: #f0f0f0;
6
- border: 1px solid #ddd;
23
+ display: block;
24
+ width: 100%;
25
+ height: auto;
26
+ object-fit: cover;
27
+ cursor: pointer;
28
+ transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, opacity var(--transition-speed) ease;
29
+ opacity: 0;
30
+ }
31
+
32
+ .image--loaded {
33
+ opacity: 1;
34
+ }
35
+
36
+ .image--error {
37
+ opacity: 1;
38
+ }
39
+
40
+ .image--thumbnail {
41
+ max-width: 100%;
42
+ height: auto;
43
+ }
44
+
45
+ .image--avatar {
46
+ border-radius: 50%;
47
+ object-fit: cover;
48
+ max-width: 100%;
49
+ height: auto;
50
+ }
51
+
52
+ .image--expanded {
53
+ cursor: default;
54
+ }
55
+
56
+ .image--flat {
57
+ cursor: default;
58
+ max-width: none;
59
+ }
60
+
61
+ .image--16by9 {
62
+ aspect-ratio: 16 / 9;
63
+ }
64
+
65
+ .image--4by3 {
66
+ aspect-ratio: 4 / 3;
67
+ }
68
+
69
+ .image--1by1 {
70
+ aspect-ratio: 1 / 1;
71
+ }
72
+
73
+ .image--crop-center {
74
+ object-position: center;
75
+ }
76
+
77
+ .image--crop-top {
78
+ object-position: top;
79
+ }
80
+
81
+ .image--crop-left {
82
+ object-position: left;
83
+ }
84
+
85
+ .image--size-xs {
86
+ width: 30px;
87
+ height: 30px;
88
+ }
89
+
90
+ .image--size-sm {
91
+ width: 50px;
92
+ height: 50px;
7
93
  }
8
94
 
9
- .image--primary {
10
- background-color: #e3f2fd;
11
- border-color: #1e88e5;
95
+ .image--size-md {
96
+ width: 100px;
97
+ height: 100px;
12
98
  }
13
99
 
14
- .image--secondary {
100
+ .image--size-lg {
101
+ width: 150px;
102
+ height: 150px;
103
+ }
104
+
105
+ .image--size-xl {
106
+ width: 200px;
107
+ height: 200px;
108
+ }
109
+
110
+ .image:hover {
111
+ transform: scale(1.05);
112
+ box-shadow: var(--box-shadow);
113
+ }
114
+
115
+ .image__caption {
116
+ text-align: center;
117
+ margin-top: var(--spacing-sm);
118
+ font-size: var(--font-size-small);
119
+ color: var(--muted-text-color);
120
+ }
121
+
122
+ /* Overlay Styles */
123
+ .image__overlay {
124
+ position: absolute;
125
+ top: 0;
126
+ left: 0;
127
+ width: 100%;
128
+ height: 100%;
129
+ background-color: rgba(0, 0, 0, 0.5);
130
+ opacity: 0;
131
+ transition: opacity var(--transition-speed) ease;
132
+ display: flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ }
136
+
137
+ .image-figure:hover .image__overlay {
138
+ opacity: 1;
139
+ }
140
+
141
+ .image__overlay-caption {
142
+ color: #fff;
143
+ font-size: var(--font-size-base);
144
+ text-align: center;
145
+ }
146
+
147
+ .image__overlay-icons {
148
+ display: flex;
149
+ gap: 10px;
150
+ }
151
+
152
+ .image__overlay-icons--center {
153
+ justify-content: center;
154
+ }
155
+
156
+ .image__overlay-icons--top-right {
157
+ position: absolute;
158
+ top: var(--spacing-sm);
159
+ right: var(--spacing-sm);
160
+ }
161
+
162
+ .image__overlay-icon {
163
+ color: #fff;
164
+ font-size: 1.5em;
165
+ cursor: pointer;
166
+ }
167
+
168
+ /* Modal Styles */
169
+ .image__modal {
170
+ position: fixed;
171
+ top: 0;
172
+ left: 0;
173
+ width: 100%;
174
+ height: 100%;
175
+ background-color: rgba(0, 0, 0, 0.8);
176
+ display: flex;
177
+ align-items: center;
178
+ justify-content: center;
179
+ z-index: var(--z-index-modal);
180
+ }
181
+
182
+ .image__modal-content {
183
+ position: relative;
184
+ width: 90%;
185
+ max-width: 700px;
186
+ height: 90%;
187
+ max-height: 500px;
15
188
  background-color: #fff;
16
- border-color: #ccc;
189
+ border-radius: var(--border-radius);
190
+ box-shadow: var(--box-shadow);
191
+ overflow: hidden;
17
192
  }
18
193
 
19
- .image--small {
20
- padding: 8px;
194
+ .image__modal-img {
195
+ width: 100%;
196
+ height: auto;
197
+ border-radius: var(--border-radius);
21
198
  }
22
199
 
23
- .image--medium {
24
- padding: 16px;
200
+ .image__modal-caption {
201
+ margin-top: var(--spacing-sm);
202
+ text-align: center;
203
+ color: var(--text-color);
204
+ font-size: var(--font-size-small);
205
+ }
206
+
207
+ .image__modal-close {
208
+ position: absolute;
209
+ top: var(--spacing-xs);
210
+ right: var(--spacing-xs);
211
+ background: none;
212
+ border: none;
213
+ color: var(--dark-color);
214
+ font-size: 2rem;
215
+ cursor: pointer;
216
+ }
217
+
218
+ /* Responsive Styles */
219
+ @media (max-width: 768px) {
220
+ .image--avatar {
221
+ width: 80px;
222
+ height: 80px;
223
+ }
224
+
225
+ .image__modal-content {
226
+ width: 95%;
227
+ height: 80%;
228
+ max-width: 90%;
229
+ max-height: 400px;
230
+ }
231
+
232
+ .image__overlay-caption {
233
+ font-size: var(--font-size-small);
234
+ }
235
+
236
+ .image__overlay-icon {
237
+ font-size: 1.2em;
238
+ }
25
239
  }
26
240
 
27
- .image--large {
28
- padding: 32px;
241
+ /* Flat Image Styles */
242
+ .image--flat:hover {
243
+ transform: none;
244
+ box-shadow: none;
29
245
  }
@@ -1,41 +1,175 @@
1
-
2
- import React from 'react';
1
+ // src/stories/Atoms/Image/Image.jsx
2
+ import React, { useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
+ import classNames from 'classnames';
4
5
  import './Image.css';
5
6
 
6
- /**
7
- * Image component for user interaction
8
- */
9
- export const Image = ({ primary, size, children, ...props }) => {
10
- const mode = primary ? 'image--primary' : 'image--secondary';
7
+ export const Image = ({
8
+ src,
9
+ alt,
10
+ width,
11
+ height,
12
+ loading = 'lazy',
13
+ title,
14
+ caption,
15
+ variant = 'thumbnail', // 'thumbnail', 'avatar', 'expanded', 'flat'
16
+ aspectRatio,
17
+ crop = 'center', // 'center', 'top', 'left'
18
+ fallbackSrc = '/fallback.jpg',
19
+ srcSet,
20
+ sizes,
21
+ lazyLoad = true,
22
+ onClickExpand,
23
+ hoverIcons = [],
24
+ hoverCaption,
25
+ hoverIconPosition = 'center', // 'center', 'top-right'
26
+ size = 'md', // 'xs', 'sm', 'md', 'lg', 'xl'
27
+ className = '',
28
+ style = {},
29
+ ...props
30
+ }) => {
31
+ const [isLoaded, setIsLoaded] = useState(false);
32
+ const [isError, setIsError] = useState(false);
33
+ const [isExpanded, setIsExpanded] = useState(false);
34
+
35
+ const handleImageLoad = () => {
36
+ setIsLoaded(true);
37
+ };
38
+
39
+ const handleImageError = () => {
40
+ setIsError(true);
41
+ };
42
+
43
+ const handleExpand = () => {
44
+ if (variant !== 'expanded' && variant !== 'flat') {
45
+ setIsExpanded(true);
46
+ }
47
+ if (onClickExpand) {
48
+ onClickExpand();
49
+ }
50
+ };
51
+
52
+ const handleCloseExpand = () => {
53
+ setIsExpanded(false);
54
+ };
55
+
56
+ const imageClasses = classNames('image', className, {
57
+ [`image--${variant}`]: variant,
58
+ [`image--${aspectRatio}`]: aspectRatio,
59
+ [`image--${crop}`]: crop,
60
+ [`image--size-${size}`]: size,
61
+ 'image--loaded': isLoaded,
62
+ 'image--error': isError,
63
+ });
64
+
65
+ const showOverlay = variant !== 'flat' && (hoverIcons.length > 0 || hoverCaption);
66
+
11
67
  return (
12
- <div
13
- className={['image', `image--${size}`, mode].join(' ')}
14
- {...props}
15
- >
16
- {children}
17
- </div>
68
+ <>
69
+ <figure className="image-figure" style={style} {...props}>
70
+ {!isLoaded && !isError && <div className="image__placeholder">Loading...</div>}
71
+ <img
72
+ src={isError ? fallbackSrc : src}
73
+ alt={alt}
74
+ width={width}
75
+ height={height}
76
+ loading={lazyLoad ? loading : 'eager'}
77
+ title={title}
78
+ className={imageClasses}
79
+ srcSet={srcSet}
80
+ sizes={sizes}
81
+ onLoad={handleImageLoad}
82
+ onError={handleImageError}
83
+ onClick={variant !== 'flat' ? handleExpand : undefined}
84
+ role={variant === 'expanded' ? 'img' : 'button'}
85
+ tabIndex={variant !== 'flat' ? '0' : undefined}
86
+ onKeyPress={(e) => {
87
+ if ((e.key === 'Enter' || e.key === ' ') && variant !== 'flat') {
88
+ handleExpand();
89
+ }
90
+ }}
91
+ />
92
+ {caption && <figcaption className="image__caption">{caption}</figcaption>}
93
+
94
+ {showOverlay && (
95
+ <div className="image__overlay">
96
+ {hoverCaption && (
97
+ <div className="image__overlay-caption">
98
+ {hoverCaption}
99
+ </div>
100
+ )}
101
+ {hoverIcons.length > 0 && (
102
+ <div
103
+ className={classNames('image__overlay-icons', {
104
+ 'image__overlay-icons--center': hoverIconPosition === 'center',
105
+ 'image__overlay-icons--top-right': hoverIconPosition === 'top-right',
106
+ })}
107
+ >
108
+ {hoverIcons.map((IconComponent, index) => (
109
+ <IconComponent key={index} className="image__overlay-icon" />
110
+ ))}
111
+ </div>
112
+ )}
113
+ </div>
114
+ )}
115
+ </figure>
116
+
117
+ {isExpanded && (
118
+ <div className="image__modal" onClick={handleCloseExpand} role="dialog" aria-modal="true">
119
+ <div className="image__modal-content" onClick={(e) => e.stopPropagation()}>
120
+ <button className="image__modal-close" onClick={handleCloseExpand} aria-label="Close">
121
+ &times;
122
+ </button>
123
+ <img src={src} alt={alt} className="image__modal-img" />
124
+ {caption && <div className="image__modal-caption">{caption}</div>}
125
+ </div>
126
+ </div>
127
+ )}
128
+ </>
18
129
  );
19
130
  };
20
131
 
21
132
  Image.propTypes = {
22
- /**
23
- * Is this the primary style for the component?
24
- */
25
- primary: PropTypes.bool,
26
- /**
27
- * Size of the component
28
- */
29
- size: PropTypes.oneOf(['small', 'medium', 'large']),
30
- /**
31
- * Content to be rendered inside the component
32
- */
33
- children: PropTypes.node.isRequired,
133
+ /** Source URL of the image */
134
+ src: PropTypes.string.isRequired,
135
+ /** Alternative text for the image */
136
+ alt: PropTypes.string.isRequired,
137
+ /** Width of the image */
138
+ width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
139
+ /** Height of the image */
140
+ height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
141
+ /** Loading behavior */
142
+ loading: PropTypes.oneOf(['lazy', 'eager']),
143
+ /** Tooltip text */
144
+ title: PropTypes.string,
145
+ /** Caption for the image */
146
+ caption: PropTypes.string,
147
+ /** Variant of the image */
148
+ variant: PropTypes.oneOf(['thumbnail', 'avatar', 'expanded', 'flat']),
149
+ /** Aspect ratio of the image */
150
+ aspectRatio: PropTypes.oneOf(['16by9', '4by3', '1by1']),
151
+ /** Crop position */
152
+ crop: PropTypes.oneOf(['center', 'top', 'left']),
153
+ /** Fallback image source */
154
+ fallbackSrc: PropTypes.string,
155
+ /** srcSet for responsive images */
156
+ srcSet: PropTypes.string,
157
+ /** sizes attribute for responsive images */
158
+ sizes: PropTypes.string,
159
+ /** Enable lazy loading */
160
+ lazyLoad: PropTypes.bool,
161
+ /** Function to handle expand action */
162
+ onClickExpand: PropTypes.func,
163
+ /** Icons to display on hover */
164
+ hoverIcons: PropTypes.arrayOf(PropTypes.elementType),
165
+ /** Caption to display on hover */
166
+ hoverCaption: PropTypes.string,
167
+ /** Position of hover icons */
168
+ hoverIconPosition: PropTypes.oneOf(['center', 'top-right']),
169
+ /** Size of the image */
170
+ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
171
+ /** Additional CSS classes */
172
+ className: PropTypes.string,
173
+ /** Inline styles */
174
+ style: PropTypes.object,
34
175
  };
35
-
36
- Image.defaultProps = {
37
- primary: false,
38
- size: 'medium',
39
- };
40
-
41
- export default Image;