@shohojdhara/atomix 0.3.14 → 0.4.0

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 (343) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build-tools/EXAMPLES.md +372 -0
  3. package/build-tools/README.md +242 -0
  4. package/build-tools/__tests__/error-handler.test.js +230 -0
  5. package/build-tools/__tests__/index.test.js +141 -0
  6. package/build-tools/__tests__/rollup-plugin.test.js +194 -0
  7. package/build-tools/__tests__/utils.test.js +161 -0
  8. package/build-tools/__tests__/vite-plugin.test.js +129 -0
  9. package/build-tools/__tests__/webpack-loader.test.js +190 -0
  10. package/build-tools/error-handler.js +308 -0
  11. package/build-tools/index.d.ts +44 -0
  12. package/build-tools/index.js +88 -0
  13. package/build-tools/package.json +50 -0
  14. package/build-tools/rollup-plugin.js +236 -0
  15. package/build-tools/types.d.ts +163 -0
  16. package/build-tools/utils.js +203 -0
  17. package/build-tools/vite-plugin.js +161 -0
  18. package/build-tools/webpack-loader.js +123 -0
  19. package/dist/atomix.css +21044 -2618
  20. package/dist/atomix.css.map +1 -1
  21. package/dist/atomix.min.css +77 -3
  22. package/dist/atomix.min.css.map +1 -1
  23. package/dist/build-tools/EXAMPLES.md +372 -0
  24. package/dist/build-tools/README.md +242 -0
  25. package/dist/build-tools/__tests__/error-handler.test.js +230 -0
  26. package/dist/build-tools/__tests__/index.test.js +141 -0
  27. package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
  28. package/dist/build-tools/__tests__/utils.test.js +161 -0
  29. package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
  30. package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
  31. package/dist/build-tools/error-handler.js +308 -0
  32. package/dist/build-tools/index.d.ts +44 -0
  33. package/dist/build-tools/index.js +88 -0
  34. package/dist/build-tools/package.json +50 -0
  35. package/dist/build-tools/rollup-plugin.js +236 -0
  36. package/dist/build-tools/types.d.ts +163 -0
  37. package/dist/build-tools/utils.js +203 -0
  38. package/dist/build-tools/vite-plugin.js +161 -0
  39. package/dist/build-tools/webpack-loader.js +123 -0
  40. package/dist/charts.d.ts +1 -1
  41. package/dist/charts.js +86 -57
  42. package/dist/charts.js.map +1 -1
  43. package/dist/core.d.ts +1 -1
  44. package/dist/core.js +136 -112
  45. package/dist/core.js.map +1 -1
  46. package/dist/forms.d.ts +2 -5
  47. package/dist/forms.js +140 -128
  48. package/dist/forms.js.map +1 -1
  49. package/dist/heavy.d.ts +1 -1
  50. package/dist/heavy.js +136 -112
  51. package/dist/heavy.js.map +1 -1
  52. package/dist/index.d.ts +152 -78
  53. package/dist/index.esm.js +346 -340
  54. package/dist/index.esm.js.map +1 -1
  55. package/dist/index.js +359 -353
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.min.js +1 -1
  58. package/dist/index.min.js.map +1 -1
  59. package/dist/layout.js.map +1 -1
  60. package/dist/theme.d.ts +9 -9
  61. package/dist/theme.js.map +1 -1
  62. package/package.json +23 -8
  63. package/scripts/atomix-cli.js +170 -73
  64. package/scripts/cli/__tests__/README.md +81 -0
  65. package/scripts/cli/__tests__/basic.test.js +115 -0
  66. package/scripts/cli/__tests__/component-generator.test.js +332 -0
  67. package/scripts/cli/__tests__/integration.test.js +327 -0
  68. package/scripts/cli/__tests__/test-setup.js +133 -0
  69. package/scripts/cli/__tests__/token-manager.test.js +251 -0
  70. package/scripts/cli/__tests__/utils.test.js +161 -0
  71. package/scripts/cli/component-generator.js +253 -299
  72. package/scripts/cli/dependency-checker.js +355 -0
  73. package/scripts/cli/interactive-init.js +46 -5
  74. package/scripts/cli/template-manager.js +0 -2
  75. package/scripts/cli/templates/common-templates.js +636 -0
  76. package/scripts/cli/templates/composable-templates.js +148 -126
  77. package/scripts/cli/templates/index.js +23 -16
  78. package/scripts/cli/templates/project-templates.js +151 -23
  79. package/scripts/cli/templates/react-templates.js +280 -210
  80. package/scripts/cli/templates/scss-templates.js +90 -91
  81. package/scripts/cli/templates/testing-templates.js +206 -27
  82. package/scripts/cli/templates/testing-utils.js +278 -0
  83. package/scripts/cli/templates/types-templates.js +70 -56
  84. package/scripts/cli/theme-bridge.js +8 -2
  85. package/scripts/cli/token-manager.js +318 -206
  86. package/scripts/cli/utils.js +0 -1
  87. package/src/components/Accordion/Accordion.stories.tsx +358 -850
  88. package/src/components/Accordion/Accordion.test.tsx +70 -50
  89. package/src/components/Accordion/Accordion.tsx +99 -94
  90. package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
  91. package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
  92. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
  93. package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
  94. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
  95. package/src/components/AtomixGlass/glass-utils.ts +6 -5
  96. package/src/components/AtomixGlass/shader-utils.ts +133 -52
  97. package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
  98. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
  99. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
  100. package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
  101. package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
  102. package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -36
  103. package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +2 -2
  104. package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
  105. package/src/components/Avatar/Avatar.stories.tsx +195 -0
  106. package/src/components/Avatar/Avatar.tsx +58 -56
  107. package/src/components/Badge/Badge.stories.tsx +122 -352
  108. package/src/components/Badge/Badge.test.tsx +41 -41
  109. package/src/components/Badge/Badge.tsx +64 -62
  110. package/src/components/Block/Block.stories.tsx +30 -11
  111. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +142 -23
  112. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
  113. package/src/components/Button/Button.stories.tsx +454 -1126
  114. package/src/components/Button/Button.test.tsx +123 -0
  115. package/src/components/Button/Button.tsx +88 -60
  116. package/src/components/Button/ButtonGroup.stories.tsx +376 -215
  117. package/src/components/Button/ButtonGroup.tsx +4 -15
  118. package/src/components/Callout/Callout.stories.tsx +316 -568
  119. package/src/components/Card/Card.stories.tsx +292 -81
  120. package/src/components/Card/Card.tsx +30 -14
  121. package/src/components/Chart/AreaChart.tsx +1 -1
  122. package/src/components/Chart/CandlestickChart.tsx +23 -16
  123. package/src/components/Chart/Chart.stories.tsx +153 -16
  124. package/src/components/Chart/Chart.tsx +40 -44
  125. package/src/components/Chart/ChartRenderer.tsx +39 -12
  126. package/src/components/Chart/ChartToolbar.tsx +21 -5
  127. package/src/components/Chart/DonutChart.tsx +1 -1
  128. package/src/components/Chart/FunnelChart.tsx +4 -1
  129. package/src/components/Chart/GaugeChart.tsx +3 -1
  130. package/src/components/Chart/HeatmapChart.tsx +50 -37
  131. package/src/components/Chart/LineChart.tsx +3 -2
  132. package/src/components/Chart/MultiAxisChart.tsx +24 -16
  133. package/src/components/Chart/RadarChart.tsx +19 -17
  134. package/src/components/Chart/ScatterChart.tsx +29 -21
  135. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +152 -66
  136. package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
  137. package/src/components/Countdown/Countdown.stories.tsx +114 -7
  138. package/src/components/DataTable/DataTable.stories.tsx +349 -144
  139. package/src/components/DataTable/DataTable.test.tsx +26 -148
  140. package/src/components/DataTable/DataTable.tsx +485 -456
  141. package/src/components/DatePicker/DatePicker.stories.tsx +310 -1066
  142. package/src/components/DatePicker/DatePicker.tsx +31 -26
  143. package/src/components/Dropdown/Dropdown.stories.tsx +153 -36
  144. package/src/components/Dropdown/Dropdown.tsx +313 -299
  145. package/src/components/EdgePanel/EdgePanel.stories.tsx +221 -25
  146. package/src/components/EdgePanel/EdgePanel.tsx +1 -3
  147. package/src/components/Footer/Footer.stories.tsx +396 -327
  148. package/src/components/Footer/Footer.tsx +130 -128
  149. package/src/components/Footer/FooterLink.tsx +2 -2
  150. package/src/components/Form/Checkbox.stories.tsx +140 -6
  151. package/src/components/Form/Checkbox.test.tsx +63 -0
  152. package/src/components/Form/Checkbox.tsx +122 -78
  153. package/src/components/Form/Form.stories.tsx +110 -19
  154. package/src/components/Form/FormGroup.stories.tsx +127 -4
  155. package/src/components/Form/Input.stories.tsx +22 -39
  156. package/src/components/Form/Input.test.tsx +38 -44
  157. package/src/components/Form/Radio.stories.tsx +146 -17
  158. package/src/components/Form/Radio.tsx +68 -66
  159. package/src/components/Form/Select.stories.tsx +140 -8
  160. package/src/components/Form/Select.tsx +184 -182
  161. package/src/components/Form/Textarea.stories.tsx +149 -6
  162. package/src/components/Form/Textarea.test.tsx +27 -32
  163. package/src/components/Hero/Hero.stories.tsx +372 -38
  164. package/src/components/Hero/Hero.tsx +201 -55
  165. package/src/components/Icon/index.ts +7 -1
  166. package/src/components/List/List.stories.tsx +141 -3
  167. package/src/components/List/List.tsx +19 -23
  168. package/src/components/Modal/Modal.stories.tsx +183 -43
  169. package/src/components/Modal/Modal.tsx +130 -127
  170. package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
  171. package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
  172. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
  173. package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
  174. package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
  175. package/src/components/Pagination/Pagination.stories.tsx +7 -4
  176. package/src/components/Pagination/Pagination.tsx +199 -202
  177. package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
  178. package/src/components/Popover/Popover.stories.tsx +354 -97
  179. package/src/components/Popover/Popover.tsx +41 -37
  180. package/src/components/Progress/Progress.stories.tsx +160 -7
  181. package/src/components/River/River.stories.tsx +3 -2
  182. package/src/components/SectionIntro/SectionIntro.stories.tsx +239 -47
  183. package/src/components/Slider/Slider.stories.tsx +12 -4
  184. package/src/components/Spinner/Spinner.stories.tsx +104 -8
  185. package/src/components/Spinner/Spinner.test.tsx +23 -23
  186. package/src/components/Spinner/Spinner.tsx +43 -46
  187. package/src/components/Steps/Steps.stories.tsx +173 -42
  188. package/src/components/Tabs/Tabs.stories.tsx +141 -12
  189. package/src/components/Tabs/Tabs.tsx +74 -72
  190. package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
  191. package/src/components/Todo/Todo.stories.tsx +198 -9
  192. package/src/components/Toggle/Toggle.stories.tsx +137 -36
  193. package/src/components/Toggle/Toggle.test.tsx +65 -70
  194. package/src/components/Toggle/Toggle.tsx +4 -1
  195. package/src/components/Tooltip/Tooltip.stories.tsx +194 -100
  196. package/src/components/Tooltip/Tooltip.tsx +104 -106
  197. package/src/components/Upload/Upload.stories.tsx +241 -150
  198. package/src/components/Upload/Upload.tsx +287 -283
  199. package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
  200. package/src/components/index.ts +13 -2
  201. package/src/layouts/Grid/Grid.stories.tsx +9 -3
  202. package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
  203. package/src/lib/README.md +2 -2
  204. package/src/lib/__tests__/theme-tools.test.ts +219 -0
  205. package/src/lib/composables/index.ts +2 -2
  206. package/src/lib/composables/shared-mouse-tracker.ts +13 -14
  207. package/src/lib/composables/useAtomixGlass.ts +126 -97
  208. package/src/lib/composables/useChartExport.ts +3 -8
  209. package/src/lib/composables/useDataTable.ts +72 -43
  210. package/src/lib/composables/useHero.ts +58 -14
  211. package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
  212. package/src/lib/composables/useInput.ts +10 -8
  213. package/src/lib/composables/useSideMenu.ts +6 -5
  214. package/src/lib/composables/useTooltip.ts +1 -2
  215. package/src/lib/composables/useVideoPlayer.ts +44 -35
  216. package/src/lib/config/index.ts +154 -154
  217. package/src/lib/constants/components.ts +9 -32
  218. package/src/lib/constants/cssVariables.ts +29 -29
  219. package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
  220. package/src/lib/hooks/index.ts +1 -1
  221. package/src/lib/hooks/useComponentCustomization.ts +11 -17
  222. package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
  223. package/src/lib/patterns/__tests__/slots.test.ts +1 -1
  224. package/src/lib/patterns/index.ts +1 -1
  225. package/src/lib/patterns/slots.tsx +8 -13
  226. package/src/lib/storybook/InteractiveDemo.tsx +13 -18
  227. package/src/lib/storybook/PreviewContainer.tsx +1 -1
  228. package/src/lib/storybook/VariantsGrid.tsx +3 -7
  229. package/src/lib/storybook/index.ts +1 -1
  230. package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
  231. package/src/lib/theme/adapters/index.ts +3 -9
  232. package/src/lib/theme/adapters/themeAdapter.ts +41 -26
  233. package/src/lib/theme/config/index.ts +1 -1
  234. package/src/lib/theme/config/types.ts +2 -2
  235. package/src/lib/theme/config/validator.ts +10 -5
  236. package/src/lib/theme/constants/constants.ts +2 -2
  237. package/src/lib/theme/constants/index.ts +1 -2
  238. package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
  239. package/src/lib/theme/core/composeTheme.ts +32 -26
  240. package/src/lib/theme/core/createTheme.ts +1 -1
  241. package/src/lib/theme/core/createThemeObject.ts +308 -301
  242. package/src/lib/theme/core/index.ts +3 -3
  243. package/src/lib/theme/devtools/CLI.ts +107 -105
  244. package/src/lib/theme/devtools/Comparator.tsx +50 -32
  245. package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
  246. package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
  247. package/src/lib/theme/devtools/Inspector.tsx +75 -60
  248. package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
  249. package/src/lib/theme/devtools/Preview.tsx +150 -106
  250. package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
  251. package/src/lib/theme/devtools/index.ts +3 -9
  252. package/src/lib/theme/devtools/useHistory.ts +23 -21
  253. package/src/lib/theme/errors/errors.ts +12 -11
  254. package/src/lib/theme/errors/index.ts +2 -7
  255. package/src/lib/theme/generators/generateCSS.ts +9 -13
  256. package/src/lib/theme/generators/generateCSSNested.ts +1 -6
  257. package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
  258. package/src/lib/theme/generators/index.ts +1 -4
  259. package/src/lib/theme/i18n/index.ts +1 -1
  260. package/src/lib/theme/i18n/rtl.ts +13 -13
  261. package/src/lib/theme/index.ts +7 -16
  262. package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
  263. package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
  264. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
  265. package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
  266. package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
  267. package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
  268. package/src/lib/theme/runtime/index.ts +2 -5
  269. package/src/lib/theme/runtime/useTheme.ts +18 -18
  270. package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
  271. package/src/lib/theme/test/testTheme.ts +15 -16
  272. package/src/lib/theme/tokens/index.ts +2 -7
  273. package/src/lib/theme/tokens/tokens.ts +25 -24
  274. package/src/lib/theme/types.ts +428 -411
  275. package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
  276. package/src/lib/theme/utils/componentTheming.ts +18 -18
  277. package/src/lib/theme/utils/domUtils.ts +277 -289
  278. package/src/lib/theme/utils/index.ts +1 -2
  279. package/src/lib/theme/utils/injectCSS.ts +10 -14
  280. package/src/lib/theme/utils/naming.ts +20 -16
  281. package/src/lib/theme/utils/themeHelpers.ts +10 -12
  282. package/src/lib/theme/utils/themeUtils.ts +85 -86
  283. package/src/lib/theme/utils/themeValidation.ts +82 -33
  284. package/src/lib/theme-tools.ts +8 -6
  285. package/src/lib/types/components.ts +172 -71
  286. package/src/lib/types/partProps.ts +1 -1
  287. package/src/lib/utils/__tests__/csv.test.ts +45 -0
  288. package/src/lib/utils/componentUtils.ts +8 -12
  289. package/src/lib/utils/csv.ts +19 -0
  290. package/src/lib/utils/dataTableExport.ts +2 -15
  291. package/src/lib/utils/fontPreloader.ts +10 -19
  292. package/src/lib/utils/icons.ts +4 -1
  293. package/src/lib/utils/index.ts +2 -6
  294. package/src/lib/utils/memoryMonitor.ts +10 -8
  295. package/src/lib/utils/themeNaming.ts +2 -2
  296. package/src/styles/01-settings/_index.scss +1 -1
  297. package/src/styles/01-settings/_settings.accordion.scss +28 -7
  298. package/src/styles/01-settings/_settings.colors.scss +11 -11
  299. package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
  300. package/src/styles/01-settings/_settings.navbar.scss +1 -1
  301. package/src/styles/01-settings/_settings.spacing.scss +3 -4
  302. package/src/styles/01-settings/_settings.tooltip.scss +1 -1
  303. package/src/styles/01-settings/_settings.typography.scss +4 -4
  304. package/src/styles/02-tools/_tools.button.scss +51 -21
  305. package/src/styles/02-tools/_tools.utility-api.scss +38 -12
  306. package/src/styles/03-generic/_generic.root.scss +4 -3
  307. package/src/styles/06-components/_components.accordion.scss +56 -14
  308. package/src/styles/06-components/_components.atomix-glass.scss +13 -9
  309. package/src/styles/06-components/_components.button.scss +16 -4
  310. package/src/styles/06-components/_components.callout.scss +27 -21
  311. package/src/styles/06-components/_components.card.scss +5 -14
  312. package/src/styles/06-components/_components.chart.scss +22 -19
  313. package/src/styles/06-components/_components.checkbox.scss +25 -17
  314. package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
  315. package/src/styles/06-components/_components.edge-panel.scss +9 -2
  316. package/src/styles/06-components/_components.footer.scss +1 -1
  317. package/src/styles/06-components/_components.side-menu.scss +5 -5
  318. package/src/styles/06-components/_components.toggle.scss +18 -0
  319. package/src/styles/06-components/_index.scss +1 -1
  320. package/src/styles/06-components/old.chart.styles.scss +0 -2
  321. package/src/styles/99-utilities/_index.scss +2 -0
  322. package/src/styles/99-utilities/_utilities.border.scss +69 -27
  323. package/src/styles/99-utilities/_utilities.display.scss +1 -1
  324. package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
  325. package/src/styles/99-utilities/_utilities.position.scss +16 -9
  326. package/src/styles/99-utilities/_utilities.scss +2 -0
  327. package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
  328. package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
  329. package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
  330. package/src/styles/99-utilities/_utilities.text.scss +67 -46
  331. package/themes/dark-complementary/README.md +98 -0
  332. package/themes/dark-complementary/index.scss +158 -0
  333. package/themes/default-light/README.md +81 -0
  334. package/themes/default-light/index.scss +154 -0
  335. package/themes/high-contrast/README.md +105 -0
  336. package/themes/high-contrast/index.scss +172 -0
  337. package/themes/test-theme/README.md +38 -0
  338. package/themes/test-theme/index.scss +47 -0
  339. package/scripts/cli/templates-original-backup.js +0 -1655
  340. package/scripts/cli/templates_backup.js +0 -684
  341. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
  342. package/src/lib/composables/useButton.ts +0 -93
  343. package/src/lib/composables/useCheckbox.ts +0 -70
@@ -52,7 +52,7 @@ const meta = {
52
52
  control: 'boolean',
53
53
  description: 'Display the callout in compact mode',
54
54
  table: {
55
- defaultValue: { summary: 'false' },
55
+ defaultValue: { summary: false },
56
56
  type: { summary: 'boolean' },
57
57
  },
58
58
  },
@@ -60,7 +60,7 @@ const meta = {
60
60
  control: 'boolean',
61
61
  description: 'Display the callout as a toast notification',
62
62
  table: {
63
- defaultValue: { summary: 'false' },
63
+ defaultValue: { summary: false },
64
64
  type: { summary: 'boolean' },
65
65
  },
66
66
  },
@@ -68,11 +68,10 @@ const meta = {
68
68
  control: 'boolean',
69
69
  description: 'Enable glass morphism effect',
70
70
  table: {
71
- defaultValue: { summary: 'false' },
71
+ defaultValue: { summary: false },
72
72
  type: { summary: 'AtomixGlassProps | boolean' },
73
73
  },
74
74
  },
75
-
76
75
  actions: {
77
76
  control: false,
78
77
  description: 'Optional action buttons to display in the callout',
@@ -87,6 +86,13 @@ const meta = {
87
86
  type: { summary: 'string' },
88
87
  },
89
88
  },
89
+ onClose: {
90
+ action: 'closed',
91
+ description: 'Callback when callout is dismissed',
92
+ table: {
93
+ type: { summary: '() => void' },
94
+ },
95
+ },
90
96
  },
91
97
  } satisfies Meta<typeof Callout>;
92
98
 
@@ -321,355 +327,48 @@ export const Light: Story = {
321
327
  },
322
328
  };
323
329
 
324
- // Interactive examples
325
- const ToastDemoTemplate = () => {
326
- const [toasts, setToasts] = useState<{ id: string; variant: string }[]>([]);
327
-
328
- const addToast = (variant: string) => {
329
- const id = Math.random().toString(36).substring(2, 9);
330
- setToasts([...toasts, { id, variant }]);
331
-
332
- // Auto-remove after 5 seconds
333
- setTimeout(() => {
334
- setToasts(current => current.filter(toast => toast.id !== id));
335
- }, 5000);
336
- };
337
-
338
- const removeToast = (id: string) => {
339
- setToasts(current => current.filter(toast => toast.id !== id));
340
- };
341
-
342
- const getIcon = (variant: string) => {
343
- switch (variant) {
344
- case 'success':
345
- return <SuccessIcon />;
346
- case 'warning':
347
- return <WarningIcon />;
348
- case 'error':
349
- return <ErrorIcon />;
350
- default:
351
- return <InfoIcon />;
352
- }
353
- };
354
-
355
- const getTitle = (variant: string) => {
356
- switch (variant) {
357
- case 'success':
358
- return 'Success';
359
- case 'warning':
360
- return 'Warning';
361
- case 'error':
362
- return 'Error';
363
- default:
364
- return 'Information';
365
- }
366
- };
367
-
368
- const getMessage = (variant: string) => {
369
- switch (variant) {
370
- case 'success':
371
- return 'Operation completed successfully!';
372
- case 'warning':
373
- return 'Please review before continuing.';
374
- case 'error':
375
- return 'An error occurred. Please try again.';
376
- default:
377
- return 'This is an informational message.';
378
- }
379
- };
380
-
381
- return (
382
- <div
383
- style={{
384
- background: `linear-gradient(135deg,
385
- rgba(255, 107, 107, 0.15) 0%,
386
- rgba(255, 142, 83, 0.15) 25%,
387
- rgba(255, 193, 7, 0.15) 50%,
388
- rgba(76, 175, 80, 0.15) 75%,
389
- rgba(33, 150, 243, 0.15) 100%),
390
- url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")`,
391
- backgroundSize: 'cover, cover',
392
- backgroundPosition: 'center, center',
393
- backgroundBlendMode: 'overlay, normal',
394
- padding: '2rem',
395
- minHeight: '90vh',
396
- position: 'relative',
397
- }}
398
- >
399
- {/* Additional background layer for depth */}
400
- <div
401
- style={{
402
- position: 'absolute',
403
- top: 0,
404
- left: 0,
405
- right: 0,
406
- bottom: 0,
407
- backgroundImage:
408
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
409
- backgroundSize: 'cover',
410
- backgroundPosition: 'center',
411
- opacity: 0.2,
412
- zIndex: -1,
413
- }}
414
- />
415
-
416
- <div
417
- style={{
418
- display: 'flex',
419
- flexDirection: 'column',
420
- gap: '16px',
421
- position: 'relative',
422
- zIndex: 1,
423
- }}
424
- >
425
- <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
426
- <Button
427
- label="Add Info Toast"
428
- variant="primary"
429
- size="sm"
430
- onClick={() => addToast('info')}
431
- />
432
- <Button
433
- label="Add Success Toast"
434
- variant="success"
435
- size="sm"
436
- onClick={() => addToast('success')}
437
- />
438
- <Button
439
- label="Add Warning Toast"
440
- variant="warning"
441
- size="sm"
442
- onClick={() => addToast('warning')}
443
- />
444
- <Button
445
- label="Add Error Toast"
446
- variant="error"
447
- size="sm"
448
- onClick={() => addToast('error')}
449
- />
450
- </div>
451
-
452
- <div
453
- style={{
454
- position: 'relative',
455
- height: '400px',
456
- border: '2px solid rgba(255, 255, 255, 0.2)',
457
- borderRadius: '16px',
458
- padding: '20px',
459
- overflow: 'hidden',
460
- background: `linear-gradient(45deg,
461
- rgba(255, 107, 107, 0.1) 0%,
462
- rgba(255, 142, 83, 0.1) 25%,
463
- rgba(255, 193, 7, 0.1) 50%,
464
- rgba(76, 175, 80, 0.1) 75%,
465
- rgba(33, 150, 243, 0.1) 100%),
466
- url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
467
- backgroundSize: 'cover, cover',
468
- backgroundPosition: 'center, center',
469
- backgroundBlendMode: 'overlay, normal',
470
- backdropFilter: 'blur(1px)',
471
- }}
472
- >
473
- <div
474
- style={{
475
- position: 'absolute',
476
- top: '20px',
477
- right: '20px',
478
- display: 'flex',
479
- flexDirection: 'column',
480
- gap: '12px',
481
- maxWidth: '350px',
482
- }}
483
- >
484
- {toasts.map(toast => (
485
- <Callout
486
- key={toast.id}
487
- title={getTitle(toast.variant)}
488
- variant={toast.variant as any}
489
- icon={getIcon(toast.variant)}
490
- isToast={true}
491
- onClose={() => removeToast(toast.id)}
492
- >
493
- {getMessage(toast.variant)}
494
- </Callout>
495
- ))}
496
- </div>
497
- {toasts.length === 0 && (
498
- <div
499
- style={{
500
- display: 'flex',
501
- height: '100%',
502
- alignItems: 'center',
503
- justifyContent: 'center',
504
- color: 'white',
505
- textAlign: 'center',
506
- textShadow: '0 2px 4px rgba(0, 0, 0, 0.5)',
507
- fontSize: '18px',
508
- fontWeight: '500',
509
- }}
510
- >
511
- <div>
512
- <div style={{ marginBottom: '8px' }}>
513
- 🎨 Click a button above to show toast notifications here 🎨
514
- </div>
515
- <small style={{ opacity: 0.8 }}>
516
- Beautiful colorful backgrounds enhance the visual experience
517
- </small>
518
- </div>
519
- </div>
520
- )}
521
- </div>
522
- </div>
523
- </div>
524
- );
525
- };
526
-
527
- export const ToastDemo: Story = {
528
- render: () => <ToastDemoTemplate />,
529
- parameters: {
530
- docs: {
531
- description: {
532
- story:
533
- 'Interactive demo showing how toast notifications can be triggered and displayed in different variants.',
534
- },
535
- },
536
- },
537
- };
538
-
539
- const AutoDismissTemplate = () => {
540
- const [visible, setVisible] = useState(true);
541
- const [countdown, setCountdown] = useState(5);
542
-
543
- useEffect(() => {
544
- if (!visible) return;
545
-
546
- const timer = setInterval(() => {
547
- setCountdown(prev => {
548
- if (prev <= 1) {
549
- clearInterval(timer);
550
- setVisible(false);
551
- return 0;
552
- }
553
- return prev - 1;
554
- });
555
- }, 1000);
556
-
557
- return () => clearInterval(timer);
558
- }, [visible]);
559
-
560
- const resetCallout = () => {
561
- setVisible(true);
562
- setCountdown(5);
563
- };
564
-
565
- return (
566
- <div
567
- style={{
568
- background: `linear-gradient(135deg,
569
- rgba(255, 107, 107, 0.2) 0%,
570
- rgba(255, 142, 83, 0.2) 25%,
571
- rgba(255, 193, 7, 0.2) 50%,
572
- rgba(76, 175, 80, 0.2) 75%,
573
- rgba(33, 150, 243, 0.2) 100%),
574
- url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
575
- backgroundSize: 'cover, cover',
576
- backgroundPosition: 'center, center',
577
- backgroundBlendMode: 'overlay, normal',
578
- padding: '4rem',
579
- minHeight: '400px',
580
- position: 'relative',
581
- }}
582
- >
583
- {/* Additional background layer for depth */}
584
- <div
585
- style={{
586
- position: 'absolute',
587
- top: 0,
588
- left: 0,
589
- right: 0,
590
- bottom: 0,
591
- backgroundImage:
592
- 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
593
- backgroundSize: 'cover',
594
- backgroundPosition: 'center',
595
- opacity: 0.3,
596
- zIndex: -1,
597
- }}
598
- />
599
-
600
- <div
601
- style={{
602
- display: 'flex',
603
- flexDirection: 'column',
604
- gap: '16px',
605
- position: 'relative',
606
- zIndex: 1,
607
- }}
608
- >
609
- {visible ? (
330
+ // All Variants
331
+ export const AllVariants: Story = {
332
+ render: () => {
333
+ const variants = [
334
+ 'primary',
335
+ 'secondary',
336
+ 'success',
337
+ 'info',
338
+ 'warning',
339
+ 'error',
340
+ 'light',
341
+ 'dark',
342
+ ];
343
+
344
+ const getIcon = (variant: string) => {
345
+ switch (variant) {
346
+ case 'success':
347
+ return <SuccessIcon />;
348
+ case 'warning':
349
+ return <WarningIcon />;
350
+ case 'error':
351
+ return <ErrorIcon />;
352
+ default:
353
+ return <InfoIcon />;
354
+ }
355
+ };
356
+
357
+ return (
358
+ <div className="u-flex u-flex-col u-gap-4">
359
+ {variants.map(variant => (
610
360
  <Callout
611
- title={`Auto-dismissing in ${countdown} seconds`}
612
- variant="warning"
613
- icon={<WarningIcon />}
614
- glass
615
- onClose={() => setVisible(false)}
361
+ key={variant}
362
+ title={`${variant.charAt(0).toUpperCase() + variant.slice(1)} Variant`}
363
+ variant={variant as any}
364
+ icon={getIcon(variant)}
616
365
  >
617
- This callout will automatically dismiss after the countdown. You can also dismiss it
618
- manually. The glass effect looks beautiful against this colorful background!
366
+ This is an example of the {variant} callout variant.
619
367
  </Callout>
620
- ) : (
621
- <Button label="Show Auto-dismiss Callout" variant="primary" onClick={resetCallout} />
622
- )}
368
+ ))}
623
369
  </div>
624
- </div>
625
- );
626
- };
627
-
628
- export const AutoDismiss: Story = {
629
- render: () => <AutoDismissTemplate />,
630
- parameters: {
631
- docs: {
632
- description: {
633
- story: 'Example of a callout that automatically dismisses after a countdown.',
634
- },
635
- },
370
+ );
636
371
  },
637
- };
638
-
639
- const AllVariantsTemplate = () => {
640
- const variants = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'];
641
-
642
- const getIcon = (variant: string) => {
643
- switch (variant) {
644
- case 'success':
645
- return <SuccessIcon />;
646
- case 'warning':
647
- return <WarningIcon />;
648
- case 'error':
649
- return <ErrorIcon />;
650
- default:
651
- return <InfoIcon />;
652
- }
653
- };
654
-
655
- return (
656
- <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
657
- {variants.map(variant => (
658
- <Callout
659
- key={variant}
660
- title={`${variant.charAt(0).toUpperCase() + variant.slice(1)} Variant`}
661
- variant={variant as any}
662
- icon={getIcon(variant)}
663
- >
664
- This is an example of the {variant} callout variant.
665
- </Callout>
666
- ))}
667
- </div>
668
- );
669
- };
670
-
671
- export const AllVariants: Story = {
672
- render: () => <AllVariantsTemplate />,
673
372
  parameters: {
674
373
  docs: {
675
374
  description: {
@@ -679,33 +378,6 @@ export const AllVariants: Story = {
679
378
  },
680
379
  };
681
380
 
682
- const CalloutWithCustomContentTemplate = () => (
683
- <Callout title="Custom Content Example" variant="primary" icon={<InfoIcon />}>
684
- <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
685
- <p>Callouts can contain rich content including:</p>
686
- <ul style={{ margin: 0, paddingLeft: '20px' }}>
687
- <li>Lists of items</li>
688
- <li>Formatted text</li>
689
- <li>Custom components</li>
690
- </ul>
691
- <div style={{ backgroundColor: 'rgba(0,0,0,0.05)', padding: '8px', borderRadius: '4px' }}>
692
- <code>This is a code example</code>
693
- </div>
694
- </div>
695
- </Callout>
696
- );
697
-
698
- export const CustomContent: Story = {
699
- render: () => <CalloutWithCustomContentTemplate />,
700
- parameters: {
701
- docs: {
702
- description: {
703
- story: 'Callouts can contain rich, custom content beyond simple text.',
704
- },
705
- },
706
- },
707
- };
708
-
709
381
  // Glass morphism variants
710
382
  export const Glass: Story = {
711
383
  args: {
@@ -726,13 +398,10 @@ export const Glass: Story = {
726
398
  decorators: [
727
399
  Story => (
728
400
  <div
401
+ className="u-bg-cover u-bg-center u-p-16"
729
402
  style={{
730
403
  backgroundImage:
731
404
  'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
732
- backgroundSize: 'cover',
733
- backgroundPosition: 'center',
734
- padding: '4rem',
735
- minHeight: '300px',
736
405
  }}
737
406
  >
738
407
  <Story />
@@ -759,13 +428,10 @@ export const GlassSuccess: Story = {
759
428
  decorators: [
760
429
  Story => (
761
430
  <div
431
+ className="u-bg-cover u-bg-center u-p-16"
762
432
  style={{
763
433
  backgroundImage:
764
434
  'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
765
- backgroundSize: 'cover',
766
- backgroundPosition: 'center',
767
- padding: '4rem',
768
- minHeight: '300px',
769
435
  }}
770
436
  >
771
437
  <Story />
@@ -793,13 +459,10 @@ export const GlassWarning: Story = {
793
459
  decorators: [
794
460
  Story => (
795
461
  <div
462
+ className="u-bg-cover u-bg-center u-p-16"
796
463
  style={{
797
464
  backgroundImage:
798
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
799
- backgroundSize: 'cover',
800
- backgroundPosition: 'center',
801
- padding: '4rem',
802
- minHeight: '300px',
465
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
803
466
  }}
804
467
  >
805
468
  <Story />
@@ -827,13 +490,10 @@ export const GlassError: Story = {
827
490
  decorators: [
828
491
  Story => (
829
492
  <div
493
+ className="u-bg-cover u-bg-center u-p-16"
830
494
  style={{
831
495
  backgroundImage:
832
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
833
- backgroundSize: 'cover',
834
- backgroundPosition: 'center',
835
- padding: '4rem',
836
- minHeight: '300px',
496
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
837
497
  }}
838
498
  >
839
499
  <Story />
@@ -860,13 +520,10 @@ export const GlassDark: Story = {
860
520
  decorators: [
861
521
  Story => (
862
522
  <div
523
+ className="u-bg-cover u-bg-center u-p-16"
863
524
  style={{
864
525
  backgroundImage:
865
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
866
- backgroundSize: 'cover',
867
- backgroundPosition: 'center',
868
- padding: '4rem',
869
- minHeight: '300px',
526
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
870
527
  }}
871
528
  >
872
529
  <Story />
@@ -900,13 +557,10 @@ export const GlassWithActions: Story = {
900
557
  decorators: [
901
558
  Story => (
902
559
  <div
560
+ className="u-bg-cover u-bg-center u-p-16"
903
561
  style={{
904
562
  backgroundImage:
905
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
906
- backgroundSize: 'cover',
907
- backgroundPosition: 'center',
908
- padding: '4rem',
909
- minHeight: '300px',
563
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
910
564
  }}
911
565
  >
912
566
  <Story />
@@ -936,13 +590,10 @@ export const GlassDismissible: Story = {
936
590
  decorators: [
937
591
  Story => (
938
592
  <div
593
+ className="u-bg-cover u-bg-center u-p-16"
939
594
  style={{
940
595
  backgroundImage:
941
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
942
- backgroundSize: 'cover',
943
- backgroundPosition: 'center',
944
- padding: '4rem',
945
- minHeight: '300px',
596
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
946
597
  }}
947
598
  >
948
599
  <Story />
@@ -973,13 +624,10 @@ export const GlassToast: Story = {
973
624
  decorators: [
974
625
  Story => (
975
626
  <div
627
+ className="u-bg-cover u-bg-center u-p-16"
976
628
  style={{
977
629
  backgroundImage:
978
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
979
- backgroundSize: 'cover',
980
- backgroundPosition: 'center',
981
- padding: '4rem',
982
- minHeight: '300px',
630
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
983
631
  }}
984
632
  >
985
633
  <Story />
@@ -1006,13 +654,10 @@ export const GlassOneLine: Story = {
1006
654
  decorators: [
1007
655
  Story => (
1008
656
  <div
657
+ className="u-bg-cover u-bg-center u-p-16"
1009
658
  style={{
1010
659
  backgroundImage:
1011
- 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
1012
- backgroundSize: 'cover',
1013
- backgroundPosition: 'center',
1014
- padding: '4rem',
1015
- minHeight: '300px',
660
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80',
1016
661
  }}
1017
662
  >
1018
663
  <Story />
@@ -1021,6 +666,242 @@ export const GlassOneLine: Story = {
1021
666
  ],
1022
667
  };
1023
668
 
669
+ // Interactive examples
670
+ const ToastDemoTemplate = () => {
671
+ const [toasts, setToasts] = useState<{ id: string; variant: string }[]>([]);
672
+
673
+ const addToast = (variant: string) => {
674
+ const id = Math.random().toString(36).substring(2, 9);
675
+ setToasts([...toasts, { id, variant }]);
676
+
677
+ // Auto-remove after 5 seconds
678
+ setTimeout(() => {
679
+ setToasts(current => current.filter(toast => toast.id !== id));
680
+ }, 5000);
681
+ };
682
+
683
+ const removeToast = (id: string) => {
684
+ setToasts(current => current.filter(toast => toast.id !== id));
685
+ };
686
+
687
+ const getIcon = (variant: string) => {
688
+ switch (variant) {
689
+ case 'success':
690
+ return <SuccessIcon />;
691
+ case 'warning':
692
+ return <WarningIcon />;
693
+ case 'error':
694
+ return <ErrorIcon />;
695
+ default:
696
+ return <InfoIcon />;
697
+ }
698
+ };
699
+
700
+ const getTitle = (variant: string) => {
701
+ switch (variant) {
702
+ case 'success':
703
+ return 'Success';
704
+ case 'warning':
705
+ return 'Warning';
706
+ case 'error':
707
+ return 'Error';
708
+ default:
709
+ return 'Information';
710
+ }
711
+ };
712
+
713
+ const getMessage = (variant: string) => {
714
+ switch (variant) {
715
+ case 'success':
716
+ return 'Operation completed successfully!';
717
+ case 'warning':
718
+ return 'Please review before continuing.';
719
+ case 'error':
720
+ return 'An error occurred. Please try again.';
721
+ default:
722
+ return 'This is an informational message.';
723
+ }
724
+ };
725
+
726
+ return (
727
+ <div className="u-relative u-min-h-90vh u-p-8 u-bg-gradient-to-br u-from-red-500/[0.15] u-via-orange-500/[0.15] u-to-blue-500/[0.15] u-overflow-hidden">
728
+ {/* Additional background layer for depth */}
729
+ <div
730
+ className="u-absolute u-inset-0 u-bg-cover u-bg-center u-opacity-20"
731
+ style={{
732
+ backgroundImage:
733
+ 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
734
+ }}
735
+ />
736
+
737
+ <div className="u-relative u-z-10 u-flex u-flex-col u-gap-4">
738
+ <div className="u-flex u-gap-2 u-flex-wrap">
739
+ <Button
740
+ label="Add Info Toast"
741
+ variant="primary"
742
+ size="sm"
743
+ onClick={() => addToast('info')}
744
+ />
745
+ <Button
746
+ label="Add Success Toast"
747
+ variant="success"
748
+ size="sm"
749
+ onClick={() => addToast('success')}
750
+ />
751
+ <Button
752
+ label="Add Warning Toast"
753
+ variant="warning"
754
+ size="sm"
755
+ onClick={() => addToast('warning')}
756
+ />
757
+ <Button
758
+ label="Add Error Toast"
759
+ variant="error"
760
+ size="sm"
761
+ onClick={() => addToast('error')}
762
+ />
763
+ </div>
764
+
765
+ <div className="u-relative u-h-96 u-border-2 u-border-white/[0.2] u-rounded-xl u-p-5 u-overflow-hidden u-bg-gradient-to-tr u-from-red-500/[0.1] u-via-yellow-500/[0.1] u-to-blue-500/[0.1] u-backdrop-blur-sm">
766
+ <div className="u-absolute u-top-5 u-right-5 u-flex u-flex-col u-gap-3 u-max-w-xs">
767
+ {toasts.map(toast => (
768
+ <Callout
769
+ key={toast.id}
770
+ title={getTitle(toast.variant)}
771
+ variant={toast.variant as any}
772
+ icon={getIcon(toast.variant)}
773
+ isToast={true}
774
+ onClose={() => removeToast(toast.id)}
775
+ >
776
+ {getMessage(toast.variant)}
777
+ </Callout>
778
+ ))}
779
+ </div>
780
+ {toasts.length === 0 && (
781
+ <div className="u-flex u-h-full u-items-center u-justify-center u-text-white u-text-center u-leading-tight u-font-medium">
782
+ <div>
783
+ <div className="u-mb-2">
784
+ 🎨 Click a button above to show toast notifications here 🎨
785
+ </div>
786
+ <small className="u-opacity-80">
787
+ Beautiful colorful backgrounds enhance the visual experience
788
+ </small>
789
+ </div>
790
+ </div>
791
+ )}
792
+ </div>
793
+ </div>
794
+ </div>
795
+ );
796
+ };
797
+
798
+ export const ToastDemo: Story = {
799
+ render: () => <ToastDemoTemplate />,
800
+ parameters: {
801
+ docs: {
802
+ description: {
803
+ story:
804
+ 'Interactive demo showing how toast notifications can be triggered and displayed in different variants.',
805
+ },
806
+ },
807
+ },
808
+ };
809
+
810
+ const AutoDismissTemplate = () => {
811
+ const [visible, setVisible] = useState(true);
812
+ const [countdown, setCountdown] = useState(5);
813
+
814
+ useEffect(() => {
815
+ if (!visible) return;
816
+
817
+ const timer = setInterval(() => {
818
+ setCountdown(prev => {
819
+ if (prev <= 1) {
820
+ clearInterval(timer);
821
+ setVisible(false);
822
+ return 0;
823
+ }
824
+ return prev - 1;
825
+ });
826
+ }, 1000);
827
+
828
+ return () => clearInterval(timer);
829
+ }, [visible]);
830
+
831
+ const resetCallout = () => {
832
+ setVisible(true);
833
+ setCountdown(5);
834
+ };
835
+
836
+ return (
837
+ <div className="u-relative u-min-h-90 u-p-16 u-bg-gradient-to-br u-from-red-500/[0.2] u-via-orange-500/[0.2] u-to-blue-500/[0.2]">
838
+ {/* Additional background layer for depth */}
839
+ <div
840
+ className="u-absolute u-inset-0 u-bg-cover u-bg-center u-opacity-30"
841
+ style={{
842
+ backgroundImage:
843
+ 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
844
+ }}
845
+ />
846
+
847
+ <div className="u-relative u-z-10 u-flex u-flex-col u-gap-4">
848
+ {visible ? (
849
+ <Callout
850
+ title={`Auto-dismissing in ${countdown} seconds`}
851
+ variant="warning"
852
+ icon={<WarningIcon />}
853
+ glass
854
+ onClose={() => setVisible(false)}
855
+ >
856
+ This callout will automatically dismiss after the countdown. You can also dismiss it
857
+ manually. The glass effect looks beautiful against this colorful background!
858
+ </Callout>
859
+ ) : (
860
+ <Button label="Show Auto-dismiss Callout" variant="primary" onClick={resetCallout} />
861
+ )}
862
+ </div>
863
+ </div>
864
+ );
865
+ };
866
+
867
+ export const AutoDismiss: Story = {
868
+ render: () => <AutoDismissTemplate />,
869
+ parameters: {
870
+ docs: {
871
+ description: {
872
+ story: 'Example of a callout that automatically dismisses after a countdown.',
873
+ },
874
+ },
875
+ },
876
+ };
877
+
878
+ const CalloutWithCustomContentTemplate = () => (
879
+ <Callout title="Custom Content Example" variant="primary" icon={<InfoIcon />}>
880
+ <div className="u-flex u-flex-col u-gap-3">
881
+ <p>Callouts can contain rich content including:</p>
882
+ <ul className="u-m-0 u-pl-5">
883
+ <li>Lists of items</li>
884
+ <li>Formatted text</li>
885
+ <li>Custom components</li>
886
+ </ul>
887
+ <div className="u-bg-black/[0.05] u-p-2 u-rounded u-text-sm">
888
+ <code>This is a code example</code>
889
+ </div>
890
+ </div>
891
+ </Callout>
892
+ );
893
+
894
+ export const CustomContent: Story = {
895
+ render: () => <CalloutWithCustomContentTemplate />,
896
+ parameters: {
897
+ docs: {
898
+ description: {
899
+ story: 'Callouts can contain rich, custom content beyond simple text.',
900
+ },
901
+ },
902
+ },
903
+ };
904
+
1024
905
  const GlassVariantsTemplate = () => {
1025
906
  const variants = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'];
1026
907
 
@@ -1049,88 +930,31 @@ const GlassVariantsTemplate = () => {
1049
930
  ];
1050
931
 
1051
932
  return (
1052
- <div
1053
- style={{
1054
- background: `linear-gradient(135deg,
1055
- rgba(255, 107, 107, 0.1) 0%,
1056
- rgba(255, 142, 83, 0.1) 25%,
1057
- rgba(255, 193, 7, 0.1) 50%,
1058
- rgba(76, 175, 80, 0.1) 75%,
1059
- rgba(33, 150, 243, 0.1) 100%)`,
1060
- backgroundSize: 'cover',
1061
- backgroundPosition: 'center',
1062
- padding: '4rem',
1063
- minHeight: '100vh',
1064
- position: 'relative',
1065
- }}
1066
- >
933
+ <div className="u-relative u-min-h-screen u-p-16 u-bg-gradient-to-br u-from-red-500/[0.1] u-via-orange-500/[0.1] u-to-blue-500/[0.1]">
1067
934
  {/* Multiple background layers for depth */}
1068
935
  <div
936
+ className="u-absolute u-inset-0 u-bg-cover u-bg-center u-opacity-30"
1069
937
  style={{
1070
- position: 'absolute',
1071
- top: 0,
1072
- left: 0,
1073
- right: 0,
1074
- bottom: 0,
1075
938
  backgroundImage:
1076
939
  'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
1077
- backgroundSize: 'cover',
1078
- backgroundPosition: 'center',
1079
- opacity: 0.3,
1080
- zIndex: -1,
1081
940
  }}
1082
941
  />
1083
942
  <div
943
+ className="u-absolute u-inset-0 u-bg-cover u-bg-center u-opacity-20"
1084
944
  style={{
1085
- position: 'absolute',
1086
- top: 0,
1087
- left: 0,
1088
- right: 0,
1089
- bottom: 0,
1090
945
  backgroundImage:
1091
946
  'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
1092
- backgroundSize: 'cover',
1093
- backgroundPosition: 'center',
1094
- backgroundAttachment: 'fixed',
1095
- opacity: 0.2,
1096
- zIndex: -2,
1097
947
  }}
1098
948
  />
1099
949
 
1100
- <div
1101
- style={{
1102
- display: 'flex',
1103
- flexDirection: 'column',
1104
- gap: '32px',
1105
- position: 'relative',
1106
- zIndex: 1,
1107
- }}
1108
- >
950
+ <div className="u-relative u-z-10 u-flex u-flex-col u-gap-8">
1109
951
  {variants.map((variant, index) => (
1110
952
  <div
1111
953
  key={variant}
1112
- style={{
1113
- backgroundImage: `url("${backgrounds[index % backgrounds.length]}")`,
1114
- backgroundSize: 'cover',
1115
- backgroundPosition: 'center',
1116
- padding: '2rem',
1117
- borderRadius: '16px',
1118
- position: 'relative',
1119
- overflow: 'hidden',
1120
- backgroundAttachment: 'fixed',
1121
- }}
954
+ className="u-bg-cover u-bg-center u-p-8 u-rounded-xl u-relative u-overflow-hidden"
955
+ style={{ backgroundImage: `url("${backgrounds[index % backgrounds.length]}")` }}
1122
956
  >
1123
- <div
1124
- style={{
1125
- position: 'absolute',
1126
- top: 0,
1127
- left: 0,
1128
- right: 0,
1129
- bottom: 0,
1130
- background: 'rgba(0, 0, 0, 0.1)',
1131
- zIndex: -1,
1132
- }}
1133
- />
957
+ <div className="u-absolute u-inset-0 u-bg-black/[0.1] u-z-n1" />
1134
958
  <Callout
1135
959
  title={`${variant.charAt(0).toUpperCase() + variant.slice(1)} Glass Variant`}
1136
960
  variant={variant as any}
@@ -1215,51 +1039,18 @@ const GlassToastDemoTemplate = () => {
1215
1039
  };
1216
1040
 
1217
1041
  return (
1218
- <div
1219
- style={{
1220
- background: `linear-gradient(135deg,
1221
- rgba(255, 107, 107, 0.2) 0%,
1222
- rgba(255, 142, 83, 0.2) 25%,
1223
- rgba(255, 193, 7, 0.2) 50%,
1224
- rgba(76, 175, 80, 0.2) 75%,
1225
- rgba(33, 150, 243, 0.2) 100%),
1226
- url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
1227
- backgroundSize: 'cover, cover',
1228
- backgroundPosition: 'center, center',
1229
- backgroundBlendMode: 'overlay, normal',
1230
- padding: '2rem',
1231
- minHeight: '100vh',
1232
- position: 'relative',
1233
- }}
1234
- >
1042
+ <div className="u-relative u-min-h-screen u-p-8 u-bg-gradient-to-br u-from-red-500/[0.2] u-via-orange-500/[0.2] u-to-blue-500/[0.2]">
1235
1043
  {/* Additional background layers for depth */}
1236
1044
  <div
1045
+ className="u-absolute u-inset-0 u-bg-cover u-bg-center u-opacity-30"
1237
1046
  style={{
1238
- position: 'absolute',
1239
- top: 0,
1240
- left: 0,
1241
- right: 0,
1242
- bottom: 0,
1243
1047
  backgroundImage:
1244
- 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
1245
- backgroundSize: 'cover',
1246
- backgroundPosition: 'center',
1247
- opacity: 0.3,
1248
- zIndex: -1,
1249
- backgroundAttachment: 'fixed',
1048
+ 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
1250
1049
  }}
1251
1050
  />
1252
1051
 
1253
- <div
1254
- style={{
1255
- display: 'flex',
1256
- flexDirection: 'column',
1257
- gap: '16px',
1258
- position: 'relative',
1259
- zIndex: 1,
1260
- }}
1261
- >
1262
- <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
1052
+ <div className="u-relative u-z-10 u-flex u-flex-col u-gap-4">
1053
+ <div className="u-flex u-gap-2 u-flex-wrap">
1263
1054
  <Button
1264
1055
  label="Add Glass Info Toast"
1265
1056
  variant="primary"
@@ -1286,39 +1077,8 @@ const GlassToastDemoTemplate = () => {
1286
1077
  />
1287
1078
  </div>
1288
1079
 
1289
- <div
1290
- style={{
1291
- position: 'relative',
1292
- height: '400px',
1293
- border: '2px solid rgba(255, 255, 255, 0.2)',
1294
- borderRadius: '16px',
1295
- padding: '20px',
1296
- overflow: 'hidden',
1297
- background: `linear-gradient(45deg,
1298
- rgba(255, 107, 107, 0.1) 0%,
1299
- rgba(255, 142, 83, 0.1) 25%,
1300
- rgba(255, 193, 7, 0.1) 50%,
1301
- rgba(76, 175, 80, 0.1) 75%,
1302
- rgba(33, 150, 243, 0.1) 100%),
1303
- url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")`,
1304
- backgroundSize: 'cover, cover',
1305
- backgroundPosition: 'center, center',
1306
- backgroundBlendMode: 'overlay, normal',
1307
- backdropFilter: 'blur(2px)',
1308
- backgroundAttachment: 'fixed',
1309
- }}
1310
- >
1311
- <div
1312
- style={{
1313
- position: 'absolute',
1314
- top: '20px',
1315
- right: '20px',
1316
- display: 'flex',
1317
- flexDirection: 'column',
1318
- gap: '12px',
1319
- maxWidth: '350px',
1320
- }}
1321
- >
1080
+ <div className="u-relative u-h-96 u-border-2 u-border-white/[0.2] u-rounded-xl u-p-5 u-overflow-hidden u-bg-gradient-to-tr u-from-red-500/[0.1] u-via-yellow-500/[0.1] u-to-blue-500/[0.1] u-backdrop-blur-sm">
1081
+ <div className="u-absolute u-top-5 u-right-5 u-flex u-flex-col u-gap-3 u-max-w-xs">
1322
1082
  {toasts.map(toast => (
1323
1083
  <Callout
1324
1084
  key={toast.id}
@@ -1334,24 +1094,12 @@ const GlassToastDemoTemplate = () => {
1334
1094
  ))}
1335
1095
  </div>
1336
1096
  {toasts.length === 0 && (
1337
- <div
1338
- style={{
1339
- display: 'flex',
1340
- height: '100%',
1341
- alignItems: 'center',
1342
- justifyContent: 'center',
1343
- color: 'white',
1344
- textAlign: 'center',
1345
- textShadow: '0 2px 4px rgba(0, 0, 0, 0.5)',
1346
- fontSize: '18px',
1347
- fontWeight: '500',
1348
- }}
1349
- >
1097
+ <div className="u-flex u-h-full u-items-center u-justify-center u-text-white u-text-center u-leading-tight u-font-medium">
1350
1098
  <div>
1351
- <div style={{ marginBottom: '8px' }}>
1099
+ <div className="u-mb-2">
1352
1100
  ✨ Click a button above to show glass toast notifications here ✨
1353
1101
  </div>
1354
- <small style={{ opacity: 0.8 }}>
1102
+ <small className="u-opacity-80">
1355
1103
  Beautiful colorful backgrounds help visualize the glass morphism effect
1356
1104
  </small>
1357
1105
  </div>