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,29 +1,313 @@
1
+ /* src/stories/Atoms/Snackbar/Snackbar.css */
1
2
 
3
+ /* Base Snackbar Styles */
2
4
  .snackbar {
5
+ position: fixed;
6
+ bottom: 20px;
7
+ left: 50%;
8
+ transform: translateX(-50%);
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: space-between;
3
12
  padding: 16px;
4
- border-radius: 8px;
5
- background-color: #f0f0f0;
6
- border: 1px solid #ddd;
13
+ border-radius: var(--border-radius);
14
+ font-family: var(--font-family);
15
+ font-size: var(--font-size-base);
16
+ box-shadow: var(--box-shadow);
17
+ transition: opacity 0.3s ease, bottom 0.3s ease;
18
+ opacity: 0;
19
+ z-index: var(--z-index-modal);
7
20
  }
8
21
 
22
+ .snackbar--visible {
23
+ opacity: 1;
24
+ bottom: 40px;
25
+ }
26
+
27
+ .snackbar--hidden {
28
+ opacity: 0;
29
+ bottom: 20px;
30
+ }
31
+
32
+ /* Snackbar Variants */
9
33
  .snackbar--primary {
10
- background-color: #e3f2fd;
11
- border-color: #1e88e5;
34
+ background-color: var(--primary-color);
35
+ color: var(--text-color-inverse);
12
36
  }
13
37
 
14
38
  .snackbar--secondary {
15
- background-color: #fff;
16
- border-color: #ccc;
39
+ background-color: transparent;
40
+ border: 2px solid var(--primary-color);
41
+ color: var(--primary-color);
17
42
  }
18
43
 
19
- .snackbar--small {
20
- padding: 8px;
44
+ /* Dynamic Color Classes */
45
+ .snackbar--primary.snackbar--info {
46
+ background-color: var(--info-color);
21
47
  }
22
48
 
23
- .snackbar--medium {
24
- padding: 16px;
49
+ .snackbar--secondary.snackbar--info {
50
+ border-color: var(--info-color);
51
+ color: var(--info-color);
52
+ }
53
+
54
+ /* Add all the color classes in the same pattern as above for 'warning', 'alert', 'success', etc.
55
+ 'info', 'warning', 'alert', 'success', 'neutral', 'dark',
56
+ 'classy-color-1', 'classy-color-2', 'classy-color-3', 'classy-color-4', 'classy-color-5',
57
+ 'small-switch-color-1', 'small-switch-color-2', 'natural-color-1', 'natural-color-2', 'natural-color-3',
58
+ 'grey-friend-1', 'grey-friend-2', 'shade-1', 'shade-2', 'shade-3', 'shade-4',*/
59
+ /* Primary Snackbar (with background) */
60
+ .snackbar--primary.snackbar--info {
61
+ background-color: var(--info-color);
62
+ }
63
+
64
+ .snackbar--primary.snackbar--warning {
65
+ background-color: var(--warning-color);
66
+ }
67
+
68
+ .snackbar--primary.snackbar--alert {
69
+ background-color: var(--alert-color);
70
+ }
71
+
72
+ .snackbar--primary.snackbar--success {
73
+ background-color: var(--success-color);
74
+ }
75
+
76
+ .snackbar--primary.snackbar--neutral {
77
+ background-color: var(--neutral-color);
78
+ }
79
+
80
+ .snackbar--primary.snackbar--dark {
81
+ background-color: var(--dark-color);
82
+ }
83
+
84
+ /* Classy Palette Colors for Primary Variant */
85
+ .snackbar--primary.snackbar--classy-color-1 {
86
+ background-color: var(--classy-color-1);
87
+ }
88
+
89
+ .snackbar--primary.snackbar--classy-color-2 {
90
+ background-color: var(--classy-color-2);
91
+ }
92
+
93
+ .snackbar--primary.snackbar--classy-color-3 {
94
+ background-color: var(--classy-color-3);
95
+ }
96
+
97
+ .snackbar--primary.snackbar--classy-color-4 {
98
+ background-color: var(--classy-color-4);
99
+ }
100
+
101
+ .snackbar--primary.snackbar--classy-color-5 {
102
+ background-color: var(--classy-color-5);
103
+ }
104
+
105
+ /* Small Switch Palette Colors for Primary Variant */
106
+ .snackbar--primary.snackbar--small-switch-color-1 {
107
+ background-color: var(--small-switch-color-1);
108
+ }
109
+
110
+ .snackbar--primary.snackbar--small-switch-color-2 {
111
+ background-color: var(--small-switch-color-2);
112
+ }
113
+
114
+ /* Natural Palette Colors for Primary Variant */
115
+ .snackbar--primary.snackbar--natural-color-1 {
116
+ background-color: var(--natural-color-1);
117
+ }
118
+
119
+ .snackbar--primary.snackbar--natural-color-2 {
120
+ background-color: var(--natural-color-2);
121
+ }
122
+
123
+ .snackbar--primary.snackbar--natural-color-3 {
124
+ background-color: var(--natural-color-3);
125
+ }
126
+
127
+ /* Grey Friends for Primary Variant */
128
+ .snackbar--primary.snackbar--grey-friend-1 {
129
+ background-color: var(--grey-friend-1);
130
+ }
131
+
132
+ .snackbar--primary.snackbar--grey-friend-2 {
133
+ background-color: var(--grey-friend-2);
134
+ }
135
+
136
+ /* Shades for Primary Variant */
137
+ .snackbar--primary.snackbar--shade-1 {
138
+ background-color: var(--shade-1);
139
+ }
140
+
141
+ .snackbar--primary.snackbar--shade-2 {
142
+ background-color: var(--shade-2);
143
+ }
144
+
145
+ .snackbar--primary.snackbar--shade-3 {
146
+ background-color: var(--shade-3);
147
+ }
148
+
149
+ .snackbar--primary.snackbar--shade-4 {
150
+ background-color: var(--shade-4);
151
+ }
152
+
153
+ /* Secondary Snackbar (border only) */
154
+ .snackbar--secondary.snackbar--info {
155
+ border-color: var(--info-color);
156
+ color: var(--info-color);
157
+ }
158
+
159
+ .snackbar--secondary.snackbar--warning {
160
+ border-color: var(--warning-color);
161
+ color: var(--warning-color);
162
+ }
163
+
164
+ .snackbar--secondary.snackbar--alert {
165
+ border-color: var(--alert-color);
166
+ color: var(--alert-color);
167
+ }
168
+
169
+ .snackbar--secondary.snackbar--success {
170
+ border-color: var(--success-color);
171
+ color: var(--success-color);
172
+ }
173
+
174
+ .snackbar--secondary.snackbar--neutral {
175
+ border-color: var(--neutral-color);
176
+ color: var(--neutral-color);
177
+ }
178
+
179
+ .snackbar--secondary.snackbar--dark {
180
+ border-color: var(--dark-color);
181
+ color: var(--dark-color);
182
+ }
183
+
184
+ /* Classy Palette Colors for Secondary Variant */
185
+ .snackbar--secondary.snackbar--classy-color-1 {
186
+ border-color: var(--classy-color-1);
187
+ color: var(--classy-color-1);
188
+ }
189
+
190
+ .snackbar--secondary.snackbar--classy-color-2 {
191
+ border-color: var(--classy-color-2);
192
+ color: var(--classy-color-2);
193
+ }
194
+
195
+ .snackbar--secondary.snackbar--classy-color-3 {
196
+ border-color: var(--classy-color-3);
197
+ color: var(--classy-color-3);
198
+ }
199
+
200
+ .snackbar--secondary.snackbar--classy-color-4 {
201
+ border-color: var(--classy-color-4);
202
+ color: var(--classy-color-4);
203
+ }
204
+
205
+ .snackbar--secondary.snackbar--classy-color-5 {
206
+ border-color: var(--classy-color-5);
207
+ color: var(--classy-color-5);
208
+ }
209
+
210
+ /* Small Switch Palette Colors for Secondary Variant */
211
+ .snackbar--secondary.snackbar--small-switch-color-1 {
212
+ border-color: var(--small-switch-color-1);
213
+ color: var(--small-switch-color-1);
214
+ }
215
+
216
+ .snackbar--secondary.snackbar--small-switch-color-2 {
217
+ border-color: var(--small-switch-color-2);
218
+ color: var(--small-switch-color-2);
219
+ }
220
+
221
+ /* Natural Palette Colors for Secondary Variant */
222
+ .snackbar--secondary.snackbar--natural-color-1 {
223
+ border-color: var(--natural-color-1);
224
+ color: var(--natural-color-1);
225
+ }
226
+
227
+ .snackbar--secondary.snackbar--natural-color-2 {
228
+ border-color: var(--natural-color-2);
229
+ color: var(--natural-color-2);
230
+ }
231
+
232
+ .snackbar--secondary.snackbar--natural-color-3 {
233
+ border-color: var(--natural-color-3);
234
+ color: var(--natural-color-3);
235
+ }
236
+
237
+ /* Grey Friends for Secondary Variant */
238
+ .snackbar--secondary.snackbar--grey-friend-1 {
239
+ border-color: var(--grey-friend-1);
240
+ color: var(--grey-friend-1);
241
+ }
242
+
243
+ .snackbar--secondary.snackbar--grey-friend-2 {
244
+ border-color: var(--grey-friend-2);
245
+ color: var(--grey-friend-2);
246
+ }
247
+
248
+ /* Shades for Secondary Variant */
249
+ .snackbar--secondary.snackbar--shade-1 {
250
+ border-color: var(--shade-1);
251
+ color: var(--shade-1);
252
+ }
253
+
254
+ .snackbar--secondary.snackbar--shade-2 {
255
+ border-color: var(--shade-2);
256
+ color: var(--shade-2);
257
+ }
258
+
259
+ .snackbar--secondary.snackbar--shade-3 {
260
+ border-color: var(--shade-3);
261
+ color: var(--shade-3);
262
+ }
263
+
264
+ .snackbar--secondary.snackbar--shade-4 {
265
+ border-color: var(--shade-4);
266
+ color: var(--shade-4);
267
+ }
268
+
269
+
270
+ .snackbar__message {
271
+ flex-grow: 1;
272
+ margin-right: 16px;
273
+ }
274
+
275
+ .snackbar__action {
276
+ background: none;
277
+ border: none;
278
+ color: var(--text-color-inverse);
279
+ cursor: pointer;
280
+ font-weight: bold;
281
+ margin-right: 16px;
282
+ }
283
+
284
+ .snackbar__action:hover {
285
+ text-decoration: underline;
286
+ }
287
+
288
+ .snackbar__close {
289
+ background: none;
290
+ border: none;
291
+ font-size: 20px;
292
+ cursor: pointer;
293
+ color: var(--text-color-inverse);
294
+ }
295
+
296
+ .snackbar__close:hover {
297
+ color: var(--text-color-inverse);
298
+ }
299
+
300
+ /* Responsive Adjustments */
301
+ @media (max-width: 768px) {
302
+ .snackbar {
303
+ width: 90%;
304
+ left: 5%;
305
+ transform: none;
306
+ }
25
307
  }
26
308
 
27
- .snackbar--large {
28
- padding: 32px;
309
+ @media (max-width: 480px) {
310
+ .snackbar {
311
+ padding: 12px;
312
+ }
29
313
  }
@@ -1,41 +1,72 @@
1
-
2
- import React from 'react';
1
+ // src/stories/Atoms/Snackbar/Snackbar.jsx
2
+ import React, { useEffect, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
+ import classNames from 'classnames';
4
5
  import './Snackbar.css';
5
6
 
6
- /**
7
- * Snackbar component for user interaction
8
- */
9
- export const Snackbar = ({ primary, size, children, ...props }) => {
10
- const mode = primary ? 'snackbar--primary' : 'snackbar--secondary';
7
+ export const Snackbar = ({
8
+ message,
9
+ duration = 3000,
10
+ actionLabel = '',
11
+ onActionClick = null,
12
+ onClose,
13
+ variant = 'primary', // 'primary' (with background) or 'secondary' (border only)
14
+ color = 'primary', // Global theme color for background/border/text
15
+ className = '',
16
+ }) => {
17
+ const [visible, setVisible] = useState(true);
18
+
19
+ useEffect(() => {
20
+ const timer = setTimeout(() => {
21
+ setVisible(false);
22
+ if (onClose) onClose();
23
+ }, duration);
24
+
25
+ return () => clearTimeout(timer);
26
+ }, [duration, onClose]);
27
+
28
+ const snackbarClasses = classNames('snackbar', className, {
29
+ [`snackbar--${variant}`]: variant,
30
+ [`snackbar--${color}`]: color,
31
+ 'snackbar--visible': visible,
32
+ 'snackbar--hidden': !visible,
33
+ });
34
+
11
35
  return (
12
- <div
13
- className={['snackbar', `snackbar--${size}`, mode].join(' ')}
14
- {...props}
15
- >
16
- {children}
36
+ <div className={snackbarClasses}>
37
+ <span className="snackbar__message">{message}</span>
38
+ {actionLabel && (
39
+ <button className="snackbar__action" onClick={onActionClick}>
40
+ {actionLabel}
41
+ </button>
42
+ )}
43
+ <button className="snackbar__close" onClick={() => setVisible(false)}>
44
+ &times;
45
+ </button>
17
46
  </div>
18
47
  );
19
48
  };
20
49
 
21
50
  Snackbar.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,
34
- };
35
-
36
- Snackbar.defaultProps = {
37
- primary: false,
38
- size: 'medium',
51
+ /** Message to be displayed in the snackbar */
52
+ message: PropTypes.string.isRequired,
53
+ /** Duration before the snackbar disappears */
54
+ duration: PropTypes.number,
55
+ /** Label for the action button */
56
+ actionLabel: PropTypes.string,
57
+ /** Function to be called when action button is clicked */
58
+ onActionClick: PropTypes.func,
59
+ /** Function to be called when the snackbar is closed */
60
+ onClose: PropTypes.func,
61
+ /** Variant of the snackbar: 'primary' (background) or 'secondary' (border only) */
62
+ variant: PropTypes.oneOf(['primary', 'secondary']),
63
+ /** Color for background, border, and text */
64
+ color: PropTypes.oneOf([
65
+ 'primary', 'secondary', 'info', 'warning', 'alert', 'success', 'neutral', 'dark',
66
+ 'classy-color-1', 'classy-color-2', 'classy-color-3', 'classy-color-4', 'classy-color-5',
67
+ 'small-switch-color-1', 'small-switch-color-2', 'natural-color-1', 'natural-color-2', 'natural-color-3',
68
+ 'grey-friend-1', 'grey-friend-2', 'shade-1', 'shade-2', 'shade-3', 'shade-4',
69
+ ]),
70
+ /** Additional CSS classes */
71
+ className: PropTypes.string,
39
72
  };
40
-
41
- export default Snackbar;
@@ -1,41 +1,78 @@
1
-
1
+ // src/stories/Atoms/Snackbar/Snackbar.stories.jsx
2
+ import React from 'react';
2
3
  import { Snackbar } from './Snackbar';
3
4
 
4
- // Storybook configuration for Snackbar component
5
5
  export default {
6
6
  title: 'Atoms/Feedback/Snackbar',
7
7
  component: Snackbar,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
8
  argTypes: {
12
- children: { control: 'text' },
9
+ message: {
10
+ control: 'text',
11
+ defaultValue: 'This is a snackbar message.',
12
+ },
13
+ duration: {
14
+ control: 'number',
15
+ defaultValue: 3000,
16
+ },
17
+ actionLabel: {
18
+ control: 'text',
19
+ defaultValue: 'Undo',
20
+ },
21
+ onActionClick: {
22
+ action: 'action clicked',
23
+ },
24
+ onClose: {
25
+ action: 'closed',
26
+ },
27
+ variant: {
28
+ control: {
29
+ type: 'select',
30
+ options: ['primary', 'secondary'],
31
+ },
32
+ },
33
+ color: {
34
+ control: {
35
+ type: 'select',
36
+ options: [
37
+ 'primary', 'secondary', 'info', 'warning', 'alert', 'success', 'neutral', 'dark',
38
+ 'classy-color-1', 'classy-color-2', 'classy-color-3', 'classy-color-4', 'classy-color-5',
39
+ 'small-switch-color-1', 'small-switch-color-2', 'natural-color-1', 'natural-color-2', 'natural-color-3',
40
+ 'grey-friend-1', 'grey-friend-2', 'shade-1', 'shade-2', 'shade-3', 'shade-4',
41
+ ],
42
+ },
43
+ },
13
44
  },
14
45
  };
15
46
 
16
- export const Primary = {
17
- args: {
18
- primary: true,
19
- children: 'This is a primary Snackbar',
20
- },
21
- };
47
+ const Template = (args) => <Snackbar {...args} />;
22
48
 
23
- export const Secondary = {
24
- args: {
25
- children: 'This is a secondary Snackbar',
26
- },
49
+ export const PrimarySnackbar = Template.bind({});
50
+ PrimarySnackbar.args = {
51
+ message: 'This is a primary snackbar.',
52
+ duration: 3000,
53
+ actionLabel: 'Undo',
54
+ variant: 'primary',
55
+ color: 'primary',
27
56
  };
28
57
 
29
- export const Large = {
30
- args: {
31
- size: 'large',
32
- children: 'This is a large Snackbar',
33
- },
58
+ export const SecondarySnackbar = Template.bind({});
59
+ SecondarySnackbar.args = {
60
+ message: 'This is a secondary snackbar with border.',
61
+ duration: 3000,
62
+ actionLabel: 'Dismiss',
63
+ variant: 'secondary',
64
+ color: 'success',
34
65
  };
35
66
 
36
- export const Small = {
37
- args: {
38
- size: 'small',
39
- children: 'This is a small Snackbar',
40
- },
67
+ // Interactive Snackbar Example
68
+ export const InteractiveSnackbar = Template.bind({});
69
+ InteractiveSnackbar.args = {
70
+ message: 'This is a customizable snackbar.',
71
+ duration: 3000,
72
+ actionLabel: 'Dismiss',
73
+ variant: 'primary',
74
+ color: 'primary',
75
+ onActionClick: () => alert('Action clicked!'),
76
+ onClose: () => alert('Snackbar closed!'),
41
77
  };
78
+ InteractiveSnackbar.storyName = 'Interactive Snackbar';
@@ -1,29 +1,114 @@
1
+ /* src/stories/Atoms/Spacer/Spacer.css */
1
2
 
3
+ /* Base Styles for Spacer */
2
4
  .spacer {
3
- padding: 16px;
4
- border-radius: 8px;
5
- background-color: #f0f0f0;
6
- border: 1px solid #ddd;
5
+ display: block;
6
+ flex-shrink: 0;
7
7
  }
8
8
 
9
- .spacer--primary {
10
- background-color: #e3f2fd;
11
- border-color: #1e88e5;
9
+ /* Vertical Spacers (Height) */
10
+ .spacer--vertical {
11
+ width: 100%;
12
12
  }
13
13
 
14
- .spacer--secondary {
15
- background-color: #fff;
16
- border-color: #ccc;
14
+ .spacer--xs.spacer--vertical {
15
+ height: 4px;
17
16
  }
18
17
 
19
- .spacer--small {
20
- padding: 8px;
18
+ .spacer--sm.spacer--vertical {
19
+ height: 8px;
21
20
  }
22
21
 
23
- .spacer--medium {
24
- padding: 16px;
22
+ .spacer--md.spacer--vertical {
23
+ height: 16px;
25
24
  }
26
25
 
27
- .spacer--large {
28
- padding: 32px;
26
+ .spacer--lg.spacer--vertical {
27
+ height: 32px;
28
+ }
29
+
30
+ .spacer--xl.spacer--vertical {
31
+ height: 64px;
32
+ }
33
+
34
+ /* Horizontal Spacers (Width) */
35
+ .spacer--horizontal {
36
+ height: 100%;
37
+ }
38
+
39
+ .spacer--xs.spacer--horizontal {
40
+ width: 4px;
41
+ }
42
+
43
+ .spacer--sm.spacer--horizontal {
44
+ width: 8px;
45
+ }
46
+
47
+ .spacer--md.spacer--horizontal {
48
+ width: 16px;
49
+ }
50
+
51
+ .spacer--lg.spacer--horizontal {
52
+ width: 32px;
53
+ }
54
+
55
+ .spacer--xl.spacer--horizontal {
56
+ width: 64px;
57
+ }
58
+
59
+ /* Responsive Spacers (adjust size on different screen sizes) */
60
+ .spacer--responsive {
61
+ @media (max-width: 768px) {
62
+ .spacer--xs {
63
+ height: 2px;
64
+ width: 2px;
65
+ }
66
+
67
+ .spacer--sm {
68
+ height: 4px;
69
+ width: 4px;
70
+ }
71
+
72
+ .spacer--md {
73
+ height: 8px;
74
+ width: 8px;
75
+ }
76
+
77
+ .spacer--lg {
78
+ height: 16px;
79
+ width: 16px;
80
+ }
81
+
82
+ .spacer--xl {
83
+ height: 32px;
84
+ width: 32px;
85
+ }
86
+ }
87
+
88
+ @media (max-width: 480px) {
89
+ .spacer--xs {
90
+ height: 1px;
91
+ width: 1px;
92
+ }
93
+
94
+ .spacer--sm {
95
+ height: 2px;
96
+ width: 2px;
97
+ }
98
+
99
+ .spacer--md {
100
+ height: 4px;
101
+ width: 4px;
102
+ }
103
+
104
+ .spacer--lg {
105
+ height: 8px;
106
+ width: 8px;
107
+ }
108
+
109
+ .spacer--xl {
110
+ height: 16px;
111
+ width: 16px;
112
+ }
113
+ }
29
114
  }