@shohojdhara/atomix 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -28
- package/dist/atomix.css +1500 -241
- package/dist/atomix.min.css +6 -6
- package/dist/index.d.ts +1052 -194
- package/dist/index.esm.js +12201 -6066
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5481 -2827
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +1500 -301
- package/dist/themes/boomdevs.min.css +60 -8
- package/dist/themes/esrar.css +1500 -241
- package/dist/themes/esrar.min.css +6 -6
- package/dist/themes/mashroom.css +1496 -237
- package/dist/themes/mashroom.min.css +8 -8
- package/dist/themes/shaj-default.css +1451 -192
- package/dist/themes/shaj-default.min.css +6 -6
- package/package.json +66 -15
- package/src/components/Accordion/Accordion.stories.tsx +137 -0
- package/src/components/Accordion/Accordion.tsx +33 -3
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +3011 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +199 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +1281 -0
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +1369 -0
- package/src/components/AtomixGlass/README.md +134 -0
- package/src/components/AtomixGlass/index.ts +10 -0
- package/src/components/AtomixGlass/shader-utils.ts +140 -0
- package/src/components/AtomixGlass/utils.ts +8 -0
- package/src/components/Badge/Badge.stories.tsx +169 -0
- package/src/components/Badge/Badge.tsx +27 -2
- package/src/components/Button/Button.stories.tsx +345 -0
- package/src/components/Button/Button.tsx +35 -3
- package/src/components/Button/README.md +216 -0
- package/src/components/Callout/Callout.stories.tsx +813 -78
- package/src/components/Callout/Callout.test.tsx +368 -0
- package/src/components/Callout/Callout.tsx +26 -7
- package/src/components/Callout/README.md +409 -0
- package/src/components/Card/Card.stories.tsx +140 -0
- package/src/components/Card/Card.tsx +19 -3
- package/src/components/DatePicker/DatePicker copy.tsx +551 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +188 -0
- package/src/components/DatePicker/DatePicker.tsx +379 -332
- package/src/components/DatePicker/readme.md +110 -1
- package/src/components/DatePicker/types.ts +8 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +145 -0
- package/src/components/Dropdown/Dropdown.tsx +34 -5
- package/src/components/Footer/Footer.stories.tsx +388 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/FooterLink.tsx +72 -0
- package/src/components/Footer/FooterSection.tsx +87 -0
- package/src/components/Footer/FooterSocialLink.tsx +117 -0
- package/src/components/Footer/README.md +261 -0
- package/src/components/Footer/index.ts +13 -0
- package/src/components/Form/Checkbox.stories.tsx +101 -0
- package/src/components/Form/Checkbox.tsx +26 -2
- package/src/components/Form/Input.stories.tsx +124 -0
- package/src/components/Form/Input.tsx +36 -7
- package/src/components/Form/Radio.stories.tsx +139 -0
- package/src/components/Form/Radio.tsx +26 -2
- package/src/components/Form/Select.stories.tsx +110 -0
- package/src/components/Form/Select.tsx +26 -2
- package/src/components/Form/Textarea.stories.tsx +104 -0
- package/src/components/Form/Textarea.tsx +36 -7
- package/src/components/Hero/Hero.stories.tsx +54 -1
- package/src/components/Hero/Hero.tsx +70 -11
- package/src/components/Modal/Modal.stories.tsx +235 -0
- package/src/components/Modal/Modal.tsx +64 -35
- package/src/components/Pagination/Pagination.stories.tsx +101 -0
- package/src/components/Pagination/Pagination.tsx +25 -1
- package/src/components/Popover/Popover.stories.tsx +94 -0
- package/src/components/Popover/Popover.tsx +30 -4
- package/src/components/Rating/Rating.stories.tsx +112 -0
- package/src/components/Rating/Rating.tsx +25 -1
- package/src/components/SectionIntro/SectionIntro.tsx +9 -11
- package/src/components/Slider/Slider.stories.tsx +634 -50
- package/src/components/Slider/Slider.tsx +5 -3
- package/src/components/Steps/Steps.stories.tsx +119 -0
- package/src/components/Steps/Steps.tsx +32 -1
- package/src/components/Tab/Tab.stories.tsx +88 -0
- package/src/components/Tab/Tab.tsx +32 -1
- package/src/components/Toggle/Toggle.stories.tsx +92 -0
- package/src/components/Toggle/Toggle.tsx +32 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +131 -0
- package/src/components/Tooltip/Tooltip.tsx +43 -7
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +1002 -196
- package/src/components/VideoPlayer/VideoPlayer.tsx +161 -4
- package/src/components/index.ts +14 -0
- package/src/layouts/Grid/Grid.stories.tsx +226 -159
- package/src/lib/composables/index.ts +4 -0
- package/src/lib/composables/useAtomixGlass.ts +71 -0
- package/src/lib/composables/useButton.ts +3 -1
- package/src/lib/composables/useCallout.ts +4 -1
- package/src/lib/composables/useFooter.ts +85 -0
- package/src/lib/composables/useGlassContainer.ts +168 -0
- package/src/lib/composables/useSlider.ts +191 -4
- package/src/lib/constants/components.ts +173 -0
- package/src/lib/types/components.ts +622 -0
- package/src/lib/utils/displacement-generator.ts +86 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.accordion.scss +20 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
- package/src/styles/01-settings/_settings.avatar.scss +17 -18
- package/src/styles/01-settings/_settings.background.scss +10 -0
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +8 -2
- package/src/styles/01-settings/_settings.callout.scss +7 -7
- package/src/styles/01-settings/_settings.card.scss +2 -2
- package/src/styles/01-settings/_settings.chart.scss +7 -7
- package/src/styles/01-settings/_settings.checkbox-group.scss +5 -2
- package/src/styles/01-settings/_settings.checkbox.scss +10 -4
- package/src/styles/01-settings/_settings.countdown.scss +6 -4
- package/src/styles/01-settings/_settings.dropdown.scss +9 -7
- package/src/styles/01-settings/_settings.edge-panel.scss +3 -2
- package/src/styles/01-settings/_settings.footer.scss +125 -0
- package/src/styles/01-settings/_settings.form-group.scss +3 -1
- package/src/styles/01-settings/_settings.form.scss +4 -2
- package/src/styles/01-settings/_settings.hero.scss +9 -7
- package/src/styles/01-settings/_settings.input.scss +9 -7
- package/src/styles/01-settings/_settings.list-group.scss +4 -2
- package/src/styles/01-settings/_settings.list.scss +4 -2
- package/src/styles/01-settings/_settings.menu.scss +10 -8
- package/src/styles/01-settings/_settings.messages.scss +19 -17
- package/src/styles/01-settings/_settings.modal.scss +6 -4
- package/src/styles/01-settings/_settings.nav.scss +6 -4
- package/src/styles/01-settings/_settings.navbar.scss +8 -5
- package/src/styles/01-settings/_settings.pagination.scss +5 -3
- package/src/styles/01-settings/_settings.popover.scss +6 -4
- package/src/styles/01-settings/_settings.rating.scss +5 -3
- package/src/styles/01-settings/_settings.river.scss +8 -6
- package/src/styles/01-settings/_settings.sectionintro.scss +8 -6
- package/src/styles/01-settings/_settings.select.scss +7 -5
- package/src/styles/01-settings/_settings.side-menu.scss +15 -13
- package/src/styles/01-settings/_settings.spacing.scss +4 -0
- package/src/styles/01-settings/_settings.steps.scss +7 -5
- package/src/styles/01-settings/_settings.tabs.scss +7 -5
- package/src/styles/01-settings/_settings.testimonials.scss +6 -4
- package/src/styles/01-settings/_settings.toggle.scss +3 -1
- package/src/styles/01-settings/_settings.tooltip.scss +5 -3
- package/src/styles/01-settings/_settings.upload.scss +22 -20
- package/src/styles/02-tools/_tools.animations.scss +19 -0
- package/src/styles/02-tools/_tools.background.scss +87 -0
- package/src/styles/02-tools/_tools.glass.scss +1 -0
- package/src/styles/02-tools/_tools.rem.scss +18 -5
- package/src/styles/02-tools/_tools.utility-api.scss +32 -26
- package/src/styles/03-generic/_generic.root.scss +15 -2
- package/src/styles/04-elements/_elements.body.scss +6 -0
- package/src/styles/06-components/_components.accordion.scss +24 -4
- package/src/styles/06-components/_components.atomix-glass.scss +0 -0
- package/src/styles/06-components/_components.avatar-group.scss +2 -1
- package/src/styles/06-components/_components.avatar.scss +2 -1
- package/src/styles/06-components/_components.badge.scss +36 -1
- package/src/styles/06-components/_components.breadcrumb.scss +2 -1
- package/src/styles/06-components/_components.button.scss +14 -3
- package/src/styles/06-components/_components.callout.scss +44 -4
- package/src/styles/06-components/_components.card.scss +21 -2
- package/src/styles/06-components/_components.chart.scss +3 -2
- package/src/styles/06-components/_components.checkbox.scss +2 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -2
- package/src/styles/06-components/_components.countdown.scss +2 -1
- package/src/styles/06-components/_components.data-table.scss +7 -6
- package/src/styles/06-components/_components.datepicker.scss +20 -1
- package/src/styles/06-components/_components.dropdown.scss +11 -4
- package/src/styles/06-components/_components.edge-panel.scss +4 -3
- package/src/styles/06-components/_components.footer.scss +825 -0
- package/src/styles/06-components/_components.form-group.scss +1 -0
- package/src/styles/06-components/_components.hero.scss +4 -4
- package/src/styles/06-components/_components.image-gallery.scss +1 -0
- package/src/styles/06-components/_components.input.scss +33 -2
- package/src/styles/06-components/_components.list-group.scss +3 -2
- package/src/styles/06-components/_components.list.scss +2 -1
- package/src/styles/06-components/_components.menu.scss +5 -4
- package/src/styles/06-components/_components.messages.scss +8 -7
- package/src/styles/06-components/_components.modal.scss +3 -2
- package/src/styles/06-components/_components.nav.scss +6 -5
- package/src/styles/06-components/_components.navbar.scss +4 -3
- package/src/styles/06-components/_components.pagination.scss +2 -1
- package/src/styles/06-components/_components.photoviewer.scss +4 -3
- package/src/styles/06-components/_components.popover.scss +3 -2
- package/src/styles/06-components/_components.product-review.scss +3 -2
- package/src/styles/06-components/_components.progress.scss +3 -2
- package/src/styles/06-components/_components.river.scss +3 -2
- package/src/styles/06-components/_components.sectionintro.scss +2 -1
- package/src/styles/06-components/_components.select.scss +5 -4
- package/src/styles/06-components/_components.side-menu.scss +8 -7
- package/src/styles/06-components/_components.skeleton.scss +3 -2
- package/src/styles/06-components/_components.slider.scss +7 -6
- package/src/styles/06-components/_components.spinner.scss +1 -0
- package/src/styles/06-components/_components.steps.scss +3 -2
- package/src/styles/06-components/_components.tabs.scss +4 -3
- package/src/styles/06-components/_components.testimonials.scss +2 -1
- package/src/styles/06-components/_components.todo.scss +3 -2
- package/src/styles/06-components/_components.toggle.scss +5 -4
- package/src/styles/06-components/_components.tooltip.scss +3 -2
- package/src/styles/06-components/_components.upload.scss +4 -3
- package/src/styles/06-components/_components.video-player.scss +50 -27
- package/src/styles/06-components/_index.scss +2 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +48 -0
- package/dist/themes/yabai.css +0 -13711
- package/dist/themes/yabai.min.css +0 -189
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
1
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Button } from '../Button/Button';
|
|
4
4
|
import { Callout } from './Callout';
|
|
5
5
|
|
|
@@ -62,6 +62,14 @@ const meta: Meta<typeof Callout> = {
|
|
|
62
62
|
type: { summary: 'boolean' },
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
|
+
glass: {
|
|
66
|
+
control: 'boolean',
|
|
67
|
+
description: 'Enable glass morphism effect',
|
|
68
|
+
table: {
|
|
69
|
+
defaultValue: { summary: 'false' },
|
|
70
|
+
type: { summary: 'AtomixGlassProps | boolean' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
65
73
|
|
|
66
74
|
actions: {
|
|
67
75
|
control: false,
|
|
@@ -369,81 +377,135 @@ const ToastDemoTemplate = () => {
|
|
|
369
377
|
};
|
|
370
378
|
|
|
371
379
|
return (
|
|
372
|
-
<div
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
onClick={() => addToast('warning')}
|
|
391
|
-
/>
|
|
392
|
-
<Button
|
|
393
|
-
label="Add Error Toast"
|
|
394
|
-
variant="error"
|
|
395
|
-
size="sm"
|
|
396
|
-
onClick={() => addToast('error')}
|
|
397
|
-
/>
|
|
398
|
-
</div>
|
|
399
|
-
|
|
380
|
+
<div
|
|
381
|
+
style={{
|
|
382
|
+
background: `linear-gradient(135deg,
|
|
383
|
+
rgba(255, 107, 107, 0.15) 0%,
|
|
384
|
+
rgba(255, 142, 83, 0.15) 25%,
|
|
385
|
+
rgba(255, 193, 7, 0.15) 50%,
|
|
386
|
+
rgba(76, 175, 80, 0.15) 75%,
|
|
387
|
+
rgba(33, 150, 243, 0.15) 100%),
|
|
388
|
+
url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")`,
|
|
389
|
+
backgroundSize: 'cover, cover',
|
|
390
|
+
backgroundPosition: 'center, center',
|
|
391
|
+
backgroundBlendMode: 'overlay, normal',
|
|
392
|
+
padding: '2rem',
|
|
393
|
+
minHeight: '90vh',
|
|
394
|
+
position: 'relative',
|
|
395
|
+
}}
|
|
396
|
+
>
|
|
397
|
+
{/* Additional background layer for depth */}
|
|
400
398
|
<div
|
|
401
399
|
style={{
|
|
402
|
-
position: '
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
400
|
+
position: 'absolute',
|
|
401
|
+
top: 0,
|
|
402
|
+
left: 0,
|
|
403
|
+
right: 0,
|
|
404
|
+
bottom: 0,
|
|
405
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
406
|
+
backgroundSize: 'cover',
|
|
407
|
+
backgroundPosition: 'center',
|
|
408
|
+
opacity: 0.2,
|
|
409
|
+
zIndex: -1,
|
|
408
410
|
}}
|
|
409
|
-
|
|
411
|
+
/>
|
|
412
|
+
|
|
413
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', position: 'relative', zIndex: 1 }}>
|
|
414
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
415
|
+
<Button
|
|
416
|
+
label="Add Info Toast"
|
|
417
|
+
variant="primary"
|
|
418
|
+
size="sm"
|
|
419
|
+
onClick={() => addToast('info')}
|
|
420
|
+
/>
|
|
421
|
+
<Button
|
|
422
|
+
label="Add Success Toast"
|
|
423
|
+
variant="success"
|
|
424
|
+
size="sm"
|
|
425
|
+
onClick={() => addToast('success')}
|
|
426
|
+
/>
|
|
427
|
+
<Button
|
|
428
|
+
label="Add Warning Toast"
|
|
429
|
+
variant="warning"
|
|
430
|
+
size="sm"
|
|
431
|
+
onClick={() => addToast('warning')}
|
|
432
|
+
/>
|
|
433
|
+
<Button
|
|
434
|
+
label="Add Error Toast"
|
|
435
|
+
variant="error"
|
|
436
|
+
size="sm"
|
|
437
|
+
onClick={() => addToast('error')}
|
|
438
|
+
/>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
410
441
|
<div
|
|
411
442
|
style={{
|
|
412
|
-
position: '
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
443
|
+
position: 'relative',
|
|
444
|
+
height: '400px',
|
|
445
|
+
border: '2px solid rgba(255, 255, 255, 0.2)',
|
|
446
|
+
borderRadius: '16px',
|
|
447
|
+
padding: '20px',
|
|
448
|
+
overflow: 'hidden',
|
|
449
|
+
background: `linear-gradient(45deg,
|
|
450
|
+
rgba(255, 107, 107, 0.1) 0%,
|
|
451
|
+
rgba(255, 142, 83, 0.1) 25%,
|
|
452
|
+
rgba(255, 193, 7, 0.1) 50%,
|
|
453
|
+
rgba(76, 175, 80, 0.1) 75%,
|
|
454
|
+
rgba(33, 150, 243, 0.1) 100%),
|
|
455
|
+
url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
|
|
456
|
+
backgroundSize: 'cover, cover',
|
|
457
|
+
backgroundPosition: 'center, center',
|
|
458
|
+
backgroundBlendMode: 'overlay, normal',
|
|
459
|
+
backdropFilter: 'blur(1px)',
|
|
419
460
|
}}
|
|
420
461
|
>
|
|
421
|
-
{toasts.map(toast => (
|
|
422
|
-
<Callout
|
|
423
|
-
key={toast.id}
|
|
424
|
-
title={getTitle(toast.variant)}
|
|
425
|
-
variant={toast.variant as any}
|
|
426
|
-
icon={getIcon(toast.variant)}
|
|
427
|
-
toast={true}
|
|
428
|
-
onClose={() => removeToast(toast.id)}
|
|
429
|
-
>
|
|
430
|
-
{getMessage(toast.variant)}
|
|
431
|
-
</Callout>
|
|
432
|
-
))}
|
|
433
|
-
</div>
|
|
434
|
-
{toasts.length === 0 && (
|
|
435
462
|
<div
|
|
436
463
|
style={{
|
|
464
|
+
position: 'absolute',
|
|
465
|
+
top: '20px',
|
|
466
|
+
right: '20px',
|
|
437
467
|
display: 'flex',
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
color: '#666',
|
|
468
|
+
flexDirection: 'column',
|
|
469
|
+
gap: '12px',
|
|
470
|
+
maxWidth: '350px',
|
|
442
471
|
}}
|
|
443
472
|
>
|
|
444
|
-
|
|
473
|
+
{toasts.map(toast => (
|
|
474
|
+
<Callout
|
|
475
|
+
key={toast.id}
|
|
476
|
+
title={getTitle(toast.variant)}
|
|
477
|
+
variant={toast.variant as any}
|
|
478
|
+
icon={getIcon(toast.variant)}
|
|
479
|
+
toast={true}
|
|
480
|
+
onClose={() => removeToast(toast.id)}
|
|
481
|
+
>
|
|
482
|
+
{getMessage(toast.variant)}
|
|
483
|
+
</Callout>
|
|
484
|
+
))}
|
|
445
485
|
</div>
|
|
446
|
-
|
|
486
|
+
{toasts.length === 0 && (
|
|
487
|
+
<div
|
|
488
|
+
style={{
|
|
489
|
+
display: 'flex',
|
|
490
|
+
height: '100%',
|
|
491
|
+
alignItems: 'center',
|
|
492
|
+
justifyContent: 'center',
|
|
493
|
+
color: 'white',
|
|
494
|
+
textAlign: 'center',
|
|
495
|
+
textShadow: '0 2px 4px rgba(0, 0, 0, 0.5)',
|
|
496
|
+
fontSize: '18px',
|
|
497
|
+
fontWeight: '500',
|
|
498
|
+
}}
|
|
499
|
+
>
|
|
500
|
+
<div>
|
|
501
|
+
<div style={{ marginBottom: '8px' }}>🎨 Click a button above to show toast notifications here 🎨</div>
|
|
502
|
+
<small style={{ opacity: 0.8 }}>
|
|
503
|
+
Beautiful colorful backgrounds enhance the visual experience
|
|
504
|
+
</small>
|
|
505
|
+
</div>
|
|
506
|
+
</div>
|
|
507
|
+
)}
|
|
508
|
+
</div>
|
|
447
509
|
</div>
|
|
448
510
|
</div>
|
|
449
511
|
);
|
|
@@ -488,20 +550,55 @@ const AutoDismissTemplate = () => {
|
|
|
488
550
|
};
|
|
489
551
|
|
|
490
552
|
return (
|
|
491
|
-
<div
|
|
492
|
-
{
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
553
|
+
<div
|
|
554
|
+
style={{
|
|
555
|
+
background: `linear-gradient(135deg,
|
|
556
|
+
rgba(255, 107, 107, 0.2) 0%,
|
|
557
|
+
rgba(255, 142, 83, 0.2) 25%,
|
|
558
|
+
rgba(255, 193, 7, 0.2) 50%,
|
|
559
|
+
rgba(76, 175, 80, 0.2) 75%,
|
|
560
|
+
rgba(33, 150, 243, 0.2) 100%),
|
|
561
|
+
url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
|
|
562
|
+
backgroundSize: 'cover, cover',
|
|
563
|
+
backgroundPosition: 'center, center',
|
|
564
|
+
backgroundBlendMode: 'overlay, normal',
|
|
565
|
+
padding: '4rem',
|
|
566
|
+
minHeight: '400px',
|
|
567
|
+
position: 'relative',
|
|
568
|
+
}}
|
|
569
|
+
>
|
|
570
|
+
{/* Additional background layer for depth */}
|
|
571
|
+
<div
|
|
572
|
+
style={{
|
|
573
|
+
position: 'absolute',
|
|
574
|
+
top: 0,
|
|
575
|
+
left: 0,
|
|
576
|
+
right: 0,
|
|
577
|
+
bottom: 0,
|
|
578
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
|
|
579
|
+
backgroundSize: 'cover',
|
|
580
|
+
backgroundPosition: 'center',
|
|
581
|
+
opacity: 0.3,
|
|
582
|
+
zIndex: -1,
|
|
583
|
+
}}
|
|
584
|
+
/>
|
|
585
|
+
|
|
586
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', position: 'relative', zIndex: 1 }}>
|
|
587
|
+
{visible ? (
|
|
588
|
+
<Callout
|
|
589
|
+
title={`Auto-dismissing in ${countdown} seconds`}
|
|
590
|
+
variant="warning"
|
|
591
|
+
icon={<WarningIcon />}
|
|
592
|
+
glass
|
|
593
|
+
onClose={() => setVisible(false)}
|
|
594
|
+
>
|
|
595
|
+
This callout will automatically dismiss after the countdown. You can also dismiss it
|
|
596
|
+
manually. The glass effect looks beautiful against this colorful background!
|
|
597
|
+
</Callout>
|
|
598
|
+
) : (
|
|
599
|
+
<Button label="Show Auto-dismiss Callout" variant="primary" onClick={resetCallout} />
|
|
600
|
+
)}
|
|
601
|
+
</div>
|
|
505
602
|
</div>
|
|
506
603
|
);
|
|
507
604
|
};
|
|
@@ -534,7 +631,7 @@ const AllVariantsTemplate = () => {
|
|
|
534
631
|
};
|
|
535
632
|
|
|
536
633
|
return (
|
|
537
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px'
|
|
634
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px'}}>
|
|
538
635
|
{variants.map(variant => (
|
|
539
636
|
<Callout
|
|
540
637
|
key={variant}
|
|
@@ -586,3 +683,641 @@ export const CustomContent: Story = {
|
|
|
586
683
|
},
|
|
587
684
|
},
|
|
588
685
|
};
|
|
686
|
+
|
|
687
|
+
// Glass morphism variants
|
|
688
|
+
export const Glass: Story = {
|
|
689
|
+
args: {
|
|
690
|
+
title: 'Glass Morphism',
|
|
691
|
+
children: 'This callout uses glass morphism effect for a modern, translucent appearance.',
|
|
692
|
+
variant: 'primary',
|
|
693
|
+
icon: <InfoIcon />,
|
|
694
|
+
glass: true,
|
|
695
|
+
},
|
|
696
|
+
parameters: {
|
|
697
|
+
docs: {
|
|
698
|
+
description: {
|
|
699
|
+
story:
|
|
700
|
+
'Glass morphism callouts provide a modern, translucent appearance with backdrop blur effects.',
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
decorators: [
|
|
705
|
+
(Story) => (
|
|
706
|
+
<div
|
|
707
|
+
style={{
|
|
708
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
709
|
+
backgroundSize: 'cover',
|
|
710
|
+
backgroundPosition: 'center',
|
|
711
|
+
padding: '4rem',
|
|
712
|
+
minHeight: '300px',
|
|
713
|
+
}}
|
|
714
|
+
>
|
|
715
|
+
<Story />
|
|
716
|
+
</div>
|
|
717
|
+
),
|
|
718
|
+
],
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
export const GlassSuccess: Story = {
|
|
722
|
+
args: {
|
|
723
|
+
title: 'Success with Glass Effect',
|
|
724
|
+
children: 'Your changes have been saved successfully with a beautiful glass effect.',
|
|
725
|
+
variant: 'success',
|
|
726
|
+
icon: <SuccessIcon />,
|
|
727
|
+
glass: true,
|
|
728
|
+
},
|
|
729
|
+
parameters: {
|
|
730
|
+
docs: {
|
|
731
|
+
description: {
|
|
732
|
+
story: 'Success callouts with glass morphism effect for enhanced visual appeal.',
|
|
733
|
+
},
|
|
734
|
+
},
|
|
735
|
+
},
|
|
736
|
+
decorators: [
|
|
737
|
+
(Story) => (
|
|
738
|
+
<div
|
|
739
|
+
style={{
|
|
740
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
|
|
741
|
+
backgroundSize: 'cover',
|
|
742
|
+
backgroundPosition: 'center',
|
|
743
|
+
padding: '4rem',
|
|
744
|
+
minHeight: '300px',
|
|
745
|
+
}}
|
|
746
|
+
>
|
|
747
|
+
<Story />
|
|
748
|
+
</div>
|
|
749
|
+
),
|
|
750
|
+
],
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
export const GlassWarning: Story = {
|
|
754
|
+
args: {
|
|
755
|
+
title: 'Warning Glass',
|
|
756
|
+
children: 'Please review your information before proceeding. Glass effect adds elegance.',
|
|
757
|
+
variant: 'warning',
|
|
758
|
+
icon: <WarningIcon />,
|
|
759
|
+
glass: true,
|
|
760
|
+
},
|
|
761
|
+
parameters: {
|
|
762
|
+
docs: {
|
|
763
|
+
description: {
|
|
764
|
+
story:
|
|
765
|
+
'Warning callouts with glass effect maintain urgency while adding visual sophistication.',
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
decorators: [
|
|
770
|
+
(Story) => (
|
|
771
|
+
<div
|
|
772
|
+
style={{
|
|
773
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
774
|
+
backgroundSize: 'cover',
|
|
775
|
+
backgroundPosition: 'center',
|
|
776
|
+
padding: '4rem',
|
|
777
|
+
minHeight: '300px',
|
|
778
|
+
}}
|
|
779
|
+
>
|
|
780
|
+
<Story />
|
|
781
|
+
</div>
|
|
782
|
+
),
|
|
783
|
+
],
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
export const GlassError: Story = {
|
|
787
|
+
args: {
|
|
788
|
+
title: 'Error with Glass',
|
|
789
|
+
children: 'There was a problem processing your request. Glass effect softens the appearance.',
|
|
790
|
+
variant: 'error',
|
|
791
|
+
icon: <ErrorIcon />,
|
|
792
|
+
glass: true,
|
|
793
|
+
},
|
|
794
|
+
parameters: {
|
|
795
|
+
docs: {
|
|
796
|
+
description: {
|
|
797
|
+
story:
|
|
798
|
+
'Error callouts with glass morphism provide a softer, more approachable error presentation.',
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
decorators: [
|
|
803
|
+
(Story) => (
|
|
804
|
+
<div
|
|
805
|
+
style={{
|
|
806
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
807
|
+
backgroundSize: 'cover',
|
|
808
|
+
backgroundPosition: 'center',
|
|
809
|
+
padding: '4rem',
|
|
810
|
+
minHeight: '300px',
|
|
811
|
+
}}
|
|
812
|
+
>
|
|
813
|
+
<Story />
|
|
814
|
+
</div>
|
|
815
|
+
),
|
|
816
|
+
],
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
export const GlassDark: Story = {
|
|
820
|
+
args: {
|
|
821
|
+
title: 'Dark Glass Mode',
|
|
822
|
+
children: 'This dark variant with glass effect creates stunning visual depth.',
|
|
823
|
+
variant: 'dark',
|
|
824
|
+
icon: <InfoIcon />,
|
|
825
|
+
glass: true,
|
|
826
|
+
},
|
|
827
|
+
parameters: {
|
|
828
|
+
docs: {
|
|
829
|
+
description: {
|
|
830
|
+
story: 'Dark callouts with glass effect create dramatic visual depth and contrast.',
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
decorators: [
|
|
835
|
+
(Story) => (
|
|
836
|
+
<div
|
|
837
|
+
style={{
|
|
838
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
839
|
+
backgroundSize: 'cover',
|
|
840
|
+
backgroundPosition: 'center',
|
|
841
|
+
padding: '4rem',
|
|
842
|
+
minHeight: '300px',
|
|
843
|
+
}}
|
|
844
|
+
>
|
|
845
|
+
<Story />
|
|
846
|
+
</div>
|
|
847
|
+
),
|
|
848
|
+
],
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
export const GlassWithActions: Story = {
|
|
852
|
+
args: {
|
|
853
|
+
title: 'Glass Update Available',
|
|
854
|
+
children: 'A new version is available. The glass effect enhances the modern feel.',
|
|
855
|
+
variant: 'info',
|
|
856
|
+
icon: <InfoIcon />,
|
|
857
|
+
glass: true,
|
|
858
|
+
actions: (
|
|
859
|
+
<>
|
|
860
|
+
<Button label="Update Now" variant="primary" size="sm" />
|
|
861
|
+
<Button label="Later" variant="outline-primary" size="sm" />
|
|
862
|
+
</>
|
|
863
|
+
),
|
|
864
|
+
},
|
|
865
|
+
parameters: {
|
|
866
|
+
docs: {
|
|
867
|
+
description: {
|
|
868
|
+
story:
|
|
869
|
+
'Glass callouts with action buttons maintain full functionality while adding visual appeal.',
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
},
|
|
873
|
+
decorators: [
|
|
874
|
+
(Story) => (
|
|
875
|
+
<div
|
|
876
|
+
style={{
|
|
877
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
878
|
+
backgroundSize: 'cover',
|
|
879
|
+
backgroundPosition: 'center',
|
|
880
|
+
padding: '4rem',
|
|
881
|
+
minHeight: '300px',
|
|
882
|
+
}}
|
|
883
|
+
>
|
|
884
|
+
<Story />
|
|
885
|
+
</div>
|
|
886
|
+
),
|
|
887
|
+
],
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
export const GlassDismissible: Story = {
|
|
891
|
+
args: {
|
|
892
|
+
title: 'Glass Notification',
|
|
893
|
+
children:
|
|
894
|
+
'This dismissible glass callout can be closed while maintaining its elegant appearance.',
|
|
895
|
+
variant: 'primary',
|
|
896
|
+
icon: <InfoIcon />,
|
|
897
|
+
glass: true,
|
|
898
|
+
onClose: () => console.log('Glass callout closed'),
|
|
899
|
+
},
|
|
900
|
+
parameters: {
|
|
901
|
+
docs: {
|
|
902
|
+
description: {
|
|
903
|
+
story:
|
|
904
|
+
'Dismissible glass callouts combine functionality with modern glass morphism aesthetics.',
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
},
|
|
908
|
+
decorators: [
|
|
909
|
+
(Story) => (
|
|
910
|
+
<div
|
|
911
|
+
style={{
|
|
912
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
913
|
+
backgroundSize: 'cover',
|
|
914
|
+
backgroundPosition: 'center',
|
|
915
|
+
padding: '4rem',
|
|
916
|
+
minHeight: '300px',
|
|
917
|
+
}}
|
|
918
|
+
>
|
|
919
|
+
<Story />
|
|
920
|
+
</div>
|
|
921
|
+
),
|
|
922
|
+
],
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
export const GlassToast: Story = {
|
|
926
|
+
args: {
|
|
927
|
+
title: 'Glass Toast Notification',
|
|
928
|
+
children:
|
|
929
|
+
'This glass toast notification combines the elegance of glass morphism with toast functionality.',
|
|
930
|
+
variant: 'success',
|
|
931
|
+
icon: <SuccessIcon />,
|
|
932
|
+
toast: true,
|
|
933
|
+
glass: true,
|
|
934
|
+
onClose: () => console.log('Glass toast closed'),
|
|
935
|
+
},
|
|
936
|
+
parameters: {
|
|
937
|
+
docs: {
|
|
938
|
+
description: {
|
|
939
|
+
story:
|
|
940
|
+
'Glass toast notifications provide an elegant, floating appearance with enhanced visual depth.',
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
},
|
|
944
|
+
decorators: [
|
|
945
|
+
(Story) => (
|
|
946
|
+
<div
|
|
947
|
+
style={{
|
|
948
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
949
|
+
backgroundSize: 'cover',
|
|
950
|
+
backgroundPosition: 'center',
|
|
951
|
+
padding: '4rem',
|
|
952
|
+
minHeight: '300px',
|
|
953
|
+
}}
|
|
954
|
+
>
|
|
955
|
+
<Story />
|
|
956
|
+
</div>
|
|
957
|
+
),
|
|
958
|
+
],
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
export const GlassOneLine: Story = {
|
|
962
|
+
args: {
|
|
963
|
+
title: 'Glass one-line notification',
|
|
964
|
+
variant: 'info',
|
|
965
|
+
icon: <InfoIcon />,
|
|
966
|
+
oneLine: true,
|
|
967
|
+
glass: true,
|
|
968
|
+
},
|
|
969
|
+
parameters: {
|
|
970
|
+
docs: {
|
|
971
|
+
description: {
|
|
972
|
+
story: 'Compact one-line glass callouts maintain elegance in minimal space.',
|
|
973
|
+
},
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
decorators: [
|
|
977
|
+
(Story) => (
|
|
978
|
+
<div
|
|
979
|
+
style={{
|
|
980
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
981
|
+
backgroundSize: 'cover',
|
|
982
|
+
backgroundPosition: 'center',
|
|
983
|
+
padding: '4rem',
|
|
984
|
+
minHeight: '300px',
|
|
985
|
+
}}
|
|
986
|
+
>
|
|
987
|
+
<Story />
|
|
988
|
+
</div>
|
|
989
|
+
),
|
|
990
|
+
],
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
const GlassVariantsTemplate = () => {
|
|
994
|
+
const variants = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'];
|
|
995
|
+
|
|
996
|
+
const getIcon = (variant: string) => {
|
|
997
|
+
switch (variant) {
|
|
998
|
+
case 'success':
|
|
999
|
+
return <SuccessIcon />;
|
|
1000
|
+
case 'warning':
|
|
1001
|
+
return <WarningIcon />;
|
|
1002
|
+
case 'error':
|
|
1003
|
+
return <ErrorIcon />;
|
|
1004
|
+
default:
|
|
1005
|
+
return <InfoIcon />;
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
const backgrounds = [
|
|
1010
|
+
'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80', // Mountain landscape
|
|
1011
|
+
'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80', // Forest
|
|
1012
|
+
'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80', // Ocean
|
|
1013
|
+
'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80', // Sunset
|
|
1014
|
+
'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80', // City lights
|
|
1015
|
+
'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80', // Desert
|
|
1016
|
+
'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80', // Aurora
|
|
1017
|
+
'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80', // Space
|
|
1018
|
+
];
|
|
1019
|
+
|
|
1020
|
+
return (
|
|
1021
|
+
<div
|
|
1022
|
+
style={{
|
|
1023
|
+
background: `linear-gradient(135deg,
|
|
1024
|
+
rgba(255, 107, 107, 0.1) 0%,
|
|
1025
|
+
rgba(255, 142, 83, 0.1) 25%,
|
|
1026
|
+
rgba(255, 193, 7, 0.1) 50%,
|
|
1027
|
+
rgba(76, 175, 80, 0.1) 75%,
|
|
1028
|
+
rgba(33, 150, 243, 0.1) 100%)`,
|
|
1029
|
+
backgroundSize: 'cover',
|
|
1030
|
+
backgroundPosition: 'center',
|
|
1031
|
+
padding: '4rem',
|
|
1032
|
+
minHeight: '100vh',
|
|
1033
|
+
position: 'relative',
|
|
1034
|
+
}}
|
|
1035
|
+
>
|
|
1036
|
+
{/* Multiple background layers for depth */}
|
|
1037
|
+
<div
|
|
1038
|
+
style={{
|
|
1039
|
+
position: 'absolute',
|
|
1040
|
+
top: 0,
|
|
1041
|
+
left: 0,
|
|
1042
|
+
right: 0,
|
|
1043
|
+
bottom: 0,
|
|
1044
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")',
|
|
1045
|
+
backgroundSize: 'cover',
|
|
1046
|
+
backgroundPosition: 'center',
|
|
1047
|
+
opacity: 0.3,
|
|
1048
|
+
zIndex: -1,
|
|
1049
|
+
}}
|
|
1050
|
+
/>
|
|
1051
|
+
<div
|
|
1052
|
+
style={{
|
|
1053
|
+
position: 'absolute',
|
|
1054
|
+
top: 0,
|
|
1055
|
+
left: 0,
|
|
1056
|
+
right: 0,
|
|
1057
|
+
bottom: 0,
|
|
1058
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
|
|
1059
|
+
backgroundSize: 'cover',
|
|
1060
|
+
backgroundPosition: 'center',
|
|
1061
|
+
backgroundAttachment: 'fixed',
|
|
1062
|
+
opacity: 0.2,
|
|
1063
|
+
zIndex: -2,
|
|
1064
|
+
}}
|
|
1065
|
+
/>
|
|
1066
|
+
|
|
1067
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '32px', position: 'relative', zIndex: 1 }}>
|
|
1068
|
+
{variants.map((variant, index) => (
|
|
1069
|
+
<div
|
|
1070
|
+
key={variant}
|
|
1071
|
+
style={{
|
|
1072
|
+
backgroundImage: `url("${backgrounds[index % backgrounds.length]}")`,
|
|
1073
|
+
backgroundSize: 'cover',
|
|
1074
|
+
backgroundPosition: 'center',
|
|
1075
|
+
padding: '2rem',
|
|
1076
|
+
borderRadius: '16px',
|
|
1077
|
+
position: 'relative',
|
|
1078
|
+
overflow: 'hidden',
|
|
1079
|
+
backgroundAttachment: 'fixed',
|
|
1080
|
+
}}
|
|
1081
|
+
>
|
|
1082
|
+
<div
|
|
1083
|
+
style={{
|
|
1084
|
+
position: 'absolute',
|
|
1085
|
+
top: 0,
|
|
1086
|
+
left: 0,
|
|
1087
|
+
right: 0,
|
|
1088
|
+
bottom: 0,
|
|
1089
|
+
background: 'rgba(0, 0, 0, 0.1)',
|
|
1090
|
+
zIndex: -1,
|
|
1091
|
+
}}
|
|
1092
|
+
/>
|
|
1093
|
+
<Callout
|
|
1094
|
+
title={`${variant.charAt(0).toUpperCase() + variant.slice(1)} Glass Variant`}
|
|
1095
|
+
variant={variant as any}
|
|
1096
|
+
icon={getIcon(variant)}
|
|
1097
|
+
glass
|
|
1098
|
+
>
|
|
1099
|
+
This is an example of the {variant} callout variant with glass morphism effect against a beautiful {index % 2 === 0 ? 'mountain' : 'forest'} background.
|
|
1100
|
+
</Callout>
|
|
1101
|
+
</div>
|
|
1102
|
+
))}
|
|
1103
|
+
</div>
|
|
1104
|
+
</div>
|
|
1105
|
+
);
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
export const AllGlassVariants: Story = {
|
|
1109
|
+
render: () => <GlassVariantsTemplate />,
|
|
1110
|
+
parameters: {
|
|
1111
|
+
docs: {
|
|
1112
|
+
description: {
|
|
1113
|
+
story: 'Overview of all available callout variants with glass morphism effect.',
|
|
1114
|
+
},
|
|
1115
|
+
},
|
|
1116
|
+
},
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
const GlassToastDemoTemplate = () => {
|
|
1120
|
+
const [toasts, setToasts] = useState<{ id: string; variant: string }[]>([]);
|
|
1121
|
+
|
|
1122
|
+
const addToast = (variant: string) => {
|
|
1123
|
+
const id = Math.random().toString(36).substring(2, 9);
|
|
1124
|
+
setToasts([...toasts, { id, variant }]);
|
|
1125
|
+
|
|
1126
|
+
// Auto-remove after 5 seconds
|
|
1127
|
+
setTimeout(() => {
|
|
1128
|
+
setToasts(current => current.filter(toast => toast.id !== id));
|
|
1129
|
+
}, 5000);
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
const removeToast = (id: string) => {
|
|
1133
|
+
setToasts(current => current.filter(toast => toast.id !== id));
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
const getIcon = (variant: string) => {
|
|
1137
|
+
switch (variant) {
|
|
1138
|
+
case 'success':
|
|
1139
|
+
return <SuccessIcon />;
|
|
1140
|
+
case 'warning':
|
|
1141
|
+
return <WarningIcon />;
|
|
1142
|
+
case 'error':
|
|
1143
|
+
return <ErrorIcon />;
|
|
1144
|
+
default:
|
|
1145
|
+
return <InfoIcon />;
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
const getTitle = (variant: string) => {
|
|
1150
|
+
switch (variant) {
|
|
1151
|
+
case 'success':
|
|
1152
|
+
return 'Glass Success';
|
|
1153
|
+
case 'warning':
|
|
1154
|
+
return 'Glass Warning';
|
|
1155
|
+
case 'error':
|
|
1156
|
+
return 'Glass Error';
|
|
1157
|
+
default:
|
|
1158
|
+
return 'Glass Info';
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
const getMessage = (variant: string) => {
|
|
1163
|
+
switch (variant) {
|
|
1164
|
+
case 'success':
|
|
1165
|
+
return 'Glass operation completed successfully!';
|
|
1166
|
+
case 'warning':
|
|
1167
|
+
return 'Glass warning: Please review before continuing.';
|
|
1168
|
+
case 'error':
|
|
1169
|
+
return 'Glass error occurred. Please try again.';
|
|
1170
|
+
default:
|
|
1171
|
+
return 'This is a glass informational message.';
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
return (
|
|
1176
|
+
<div
|
|
1177
|
+
style={{
|
|
1178
|
+
background: `linear-gradient(135deg,
|
|
1179
|
+
rgba(255, 107, 107, 0.2) 0%,
|
|
1180
|
+
rgba(255, 142, 83, 0.2) 25%,
|
|
1181
|
+
rgba(255, 193, 7, 0.2) 50%,
|
|
1182
|
+
rgba(76, 175, 80, 0.2) 75%,
|
|
1183
|
+
rgba(33, 150, 243, 0.2) 100%),
|
|
1184
|
+
url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80")`,
|
|
1185
|
+
backgroundSize: 'cover, cover',
|
|
1186
|
+
backgroundPosition: 'center, center',
|
|
1187
|
+
backgroundBlendMode: 'overlay, normal',
|
|
1188
|
+
padding: '2rem',
|
|
1189
|
+
minHeight: '100vh',
|
|
1190
|
+
position: 'relative',
|
|
1191
|
+
}}
|
|
1192
|
+
>
|
|
1193
|
+
{/* Additional background layers for depth */}
|
|
1194
|
+
<div
|
|
1195
|
+
style={{
|
|
1196
|
+
position: 'absolute',
|
|
1197
|
+
top: 0,
|
|
1198
|
+
left: 0,
|
|
1199
|
+
right: 0,
|
|
1200
|
+
bottom: 0,
|
|
1201
|
+
backgroundImage: 'url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")',
|
|
1202
|
+
backgroundSize: 'cover',
|
|
1203
|
+
backgroundPosition: 'center',
|
|
1204
|
+
opacity: 0.3,
|
|
1205
|
+
zIndex: -1,
|
|
1206
|
+
backgroundAttachment: 'fixed',
|
|
1207
|
+
}}
|
|
1208
|
+
/>
|
|
1209
|
+
|
|
1210
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px', position: 'relative', zIndex: 1 }}>
|
|
1211
|
+
<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
|
1212
|
+
<Button
|
|
1213
|
+
label="Add Glass Info Toast"
|
|
1214
|
+
variant="primary"
|
|
1215
|
+
size="sm"
|
|
1216
|
+
onClick={() => addToast('info')}
|
|
1217
|
+
/>
|
|
1218
|
+
<Button
|
|
1219
|
+
label="Add Glass Success Toast"
|
|
1220
|
+
variant="success"
|
|
1221
|
+
size="sm"
|
|
1222
|
+
onClick={() => addToast('success')}
|
|
1223
|
+
/>
|
|
1224
|
+
<Button
|
|
1225
|
+
label="Add Glass Warning Toast"
|
|
1226
|
+
variant="warning"
|
|
1227
|
+
size="sm"
|
|
1228
|
+
onClick={() => addToast('warning')}
|
|
1229
|
+
/>
|
|
1230
|
+
<Button
|
|
1231
|
+
label="Add Glass Error Toast"
|
|
1232
|
+
variant="error"
|
|
1233
|
+
size="sm"
|
|
1234
|
+
onClick={() => addToast('error')}
|
|
1235
|
+
/>
|
|
1236
|
+
</div>
|
|
1237
|
+
|
|
1238
|
+
<div
|
|
1239
|
+
style={{
|
|
1240
|
+
position: 'relative',
|
|
1241
|
+
height: '400px',
|
|
1242
|
+
border: '2px solid rgba(255, 255, 255, 0.2)',
|
|
1243
|
+
borderRadius: '16px',
|
|
1244
|
+
padding: '20px',
|
|
1245
|
+
overflow: 'hidden',
|
|
1246
|
+
background: `linear-gradient(45deg,
|
|
1247
|
+
rgba(255, 107, 107, 0.1) 0%,
|
|
1248
|
+
rgba(255, 142, 83, 0.1) 25%,
|
|
1249
|
+
rgba(255, 193, 7, 0.1) 50%,
|
|
1250
|
+
rgba(76, 175, 80, 0.1) 75%,
|
|
1251
|
+
rgba(33, 150, 243, 0.1) 100%),
|
|
1252
|
+
url("https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80")`,
|
|
1253
|
+
backgroundSize: 'cover, cover',
|
|
1254
|
+
backgroundPosition: 'center, center',
|
|
1255
|
+
backgroundBlendMode: 'overlay, normal',
|
|
1256
|
+
backdropFilter: 'blur(2px)',
|
|
1257
|
+
backgroundAttachment: 'fixed',
|
|
1258
|
+
}}
|
|
1259
|
+
>
|
|
1260
|
+
<div
|
|
1261
|
+
style={{
|
|
1262
|
+
position: 'absolute',
|
|
1263
|
+
top: '20px',
|
|
1264
|
+
right: '20px',
|
|
1265
|
+
display: 'flex',
|
|
1266
|
+
flexDirection: 'column',
|
|
1267
|
+
gap: '12px',
|
|
1268
|
+
maxWidth: '350px',
|
|
1269
|
+
}}
|
|
1270
|
+
>
|
|
1271
|
+
{toasts.map(toast => (
|
|
1272
|
+
<Callout
|
|
1273
|
+
key={toast.id}
|
|
1274
|
+
title={getTitle(toast.variant)}
|
|
1275
|
+
variant={toast.variant as any}
|
|
1276
|
+
icon={getIcon(toast.variant)}
|
|
1277
|
+
toast={true}
|
|
1278
|
+
glass
|
|
1279
|
+
onClose={() => removeToast(toast.id)}
|
|
1280
|
+
>
|
|
1281
|
+
{getMessage(toast.variant)}
|
|
1282
|
+
</Callout>
|
|
1283
|
+
))}
|
|
1284
|
+
</div>
|
|
1285
|
+
{toasts.length === 0 && (
|
|
1286
|
+
<div
|
|
1287
|
+
style={{
|
|
1288
|
+
display: 'flex',
|
|
1289
|
+
height: '100%',
|
|
1290
|
+
alignItems: 'center',
|
|
1291
|
+
justifyContent: 'center',
|
|
1292
|
+
color: 'white',
|
|
1293
|
+
textAlign: 'center',
|
|
1294
|
+
textShadow: '0 2px 4px rgba(0, 0, 0, 0.5)',
|
|
1295
|
+
fontSize: '18px',
|
|
1296
|
+
fontWeight: '500',
|
|
1297
|
+
}}
|
|
1298
|
+
>
|
|
1299
|
+
<div>
|
|
1300
|
+
<div style={{ marginBottom: '8px' }}>✨ Click a button above to show glass toast notifications here ✨</div>
|
|
1301
|
+
<small style={{ opacity: 0.8 }}>
|
|
1302
|
+
Beautiful colorful backgrounds help visualize the glass morphism effect
|
|
1303
|
+
</small>
|
|
1304
|
+
</div>
|
|
1305
|
+
</div>
|
|
1306
|
+
)}
|
|
1307
|
+
</div>
|
|
1308
|
+
</div>
|
|
1309
|
+
</div>
|
|
1310
|
+
);
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
export const GlassToastDemo: Story = {
|
|
1314
|
+
render: () => <GlassToastDemoTemplate />,
|
|
1315
|
+
parameters: {
|
|
1316
|
+
docs: {
|
|
1317
|
+
description: {
|
|
1318
|
+
story:
|
|
1319
|
+
'Interactive demo showing glass toast notifications with enhanced visual appeal against a gradient background.',
|
|
1320
|
+
},
|
|
1321
|
+
},
|
|
1322
|
+
},
|
|
1323
|
+
};
|