@shohojdhara/atomix 0.2.3 → 0.2.5
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 +19 -0
- package/dist/atomix.css +1703 -1544
- package/dist/atomix.min.css +4 -4
- package/dist/index.d.ts +1465 -963
- package/dist/index.esm.js +16289 -25908
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15650 -21780
- 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/applemix.css +15008 -0
- package/dist/themes/applemix.min.css +72 -0
- package/dist/themes/boomdevs.css +1608 -1450
- package/dist/themes/boomdevs.min.css +5 -5
- package/dist/themes/esrar.css +1702 -1543
- package/dist/themes/esrar.min.css +4 -4
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1699 -1540
- package/dist/themes/mashroom.min.css +7 -7
- package/dist/themes/shaj-default.css +1693 -1534
- package/dist/themes/shaj-default.min.css +4 -4
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +662 -21
- package/src/components/Accordion/Accordion.tsx +21 -14
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
- package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
- package/src/components/AtomixGlass/README.md +124 -2
- package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
- package/src/components/AtomixGlass/glass-utils.ts +263 -0
- package/src/components/AtomixGlass/shader-utils.ts +792 -68
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
- package/src/components/AtomixGlass/utils.ts +3 -3
- package/src/components/Avatar/Avatar.tsx +3 -0
- package/src/components/Avatar/AvatarGroup.tsx +2 -1
- package/src/components/Badge/Badge.stories.tsx +76 -55
- package/src/components/Badge/Badge.tsx +12 -14
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.stories.tsx +501 -20
- package/src/components/Button/Button.tsx +5 -8
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +31 -9
- package/src/components/Card/Card.stories.tsx +565 -2
- package/src/components/Card/Card.tsx +15 -4
- package/src/components/Card/ElevationCard.tsx +2 -0
- package/src/components/Chart/AnimatedChart.tsx +179 -156
- package/src/components/Chart/AreaChart.tsx +123 -12
- package/src/components/Chart/BarChart.tsx +91 -100
- package/src/components/Chart/BaseChart.tsx +80 -0
- package/src/components/Chart/BubbleChart.tsx +114 -290
- package/src/components/Chart/CandlestickChart.tsx +282 -622
- package/src/components/Chart/Chart.stories.tsx +576 -179
- package/src/components/Chart/Chart.tsx +374 -75
- package/src/components/Chart/ChartRenderer.tsx +371 -220
- package/src/components/Chart/ChartToolbar.tsx +372 -61
- package/src/components/Chart/ChartTooltip.tsx +33 -18
- package/src/components/Chart/DonutChart.tsx +172 -254
- package/src/components/Chart/FunnelChart.tsx +169 -240
- package/src/components/Chart/GaugeChart.tsx +224 -392
- package/src/components/Chart/HeatmapChart.tsx +302 -440
- package/src/components/Chart/LineChart.tsx +148 -103
- package/src/components/Chart/MultiAxisChart.tsx +267 -395
- package/src/components/Chart/PieChart.tsx +114 -64
- package/src/components/Chart/RadarChart.tsx +202 -218
- package/src/components/Chart/ScatterChart.tsx +111 -97
- package/src/components/Chart/TreemapChart.tsx +147 -222
- package/src/components/Chart/WaterfallChart.tsx +253 -291
- package/src/components/Chart/index.ts +11 -9
- package/src/components/Chart/types.ts +85 -9
- package/src/components/Chart/utils.ts +66 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
- package/src/components/Countdown/Countdown.tsx +4 -0
- package/src/components/DataTable/DataTable.tsx +2 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
- package/src/components/DatePicker/DatePicker.tsx +3 -9
- package/src/components/DatePicker/types.ts +5 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
- package/src/components/Dropdown/Dropdown.tsx +26 -28
- package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
- package/src/components/EdgePanel/EdgePanel.tsx +101 -13
- package/src/components/Footer/Footer.stories.tsx +187 -60
- package/src/components/Footer/Footer.test.tsx +134 -0
- package/src/components/Footer/Footer.tsx +133 -34
- package/src/components/Footer/FooterLink.tsx +1 -1
- package/src/components/Footer/FooterSection.tsx +53 -36
- package/src/components/Footer/FooterSocialLink.tsx +32 -29
- package/src/components/Footer/README.md +82 -3
- package/src/components/Footer/index.ts +1 -1
- package/src/components/Form/Checkbox.stories.tsx +13 -5
- package/src/components/Form/Checkbox.tsx +3 -6
- package/src/components/Form/Form.stories.tsx +10 -3
- package/src/components/Form/Form.tsx +2 -0
- package/src/components/Form/FormGroup.tsx +2 -1
- package/src/components/Form/Input.stories.tsx +12 -11
- package/src/components/Form/Input.tsx +97 -95
- package/src/components/Form/Radio.stories.tsx +22 -7
- package/src/components/Form/Radio.tsx +3 -6
- package/src/components/Form/Select.stories.tsx +21 -6
- package/src/components/Form/Select.tsx +3 -5
- package/src/components/Form/Textarea.stories.tsx +13 -11
- package/src/components/Form/Textarea.tsx +88 -86
- package/src/components/Hero/Hero.stories.tsx +2 -3
- package/src/components/Hero/Hero.tsx +5 -6
- package/src/components/Icon/Icon.tsx +12 -1
- package/src/components/List/List.tsx +2 -1
- package/src/components/List/ListGroup.tsx +2 -1
- package/src/components/Messages/Messages.stories.tsx +113 -0
- package/src/components/Messages/Messages.tsx +52 -9
- package/src/components/Modal/Modal.stories.tsx +48 -32
- package/src/components/Modal/Modal.tsx +19 -24
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
- package/src/components/Navigation/Nav/Nav.tsx +22 -4
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
- package/src/components/Pagination/Pagination.stories.tsx +13 -6
- package/src/components/Pagination/Pagination.tsx +7 -6
- package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
- package/src/components/Popover/Popover.stories.tsx +32 -24
- package/src/components/Popover/Popover.tsx +4 -1
- package/src/components/ProductReview/ProductReview.tsx +8 -2
- package/src/components/Progress/Progress.tsx +19 -3
- package/src/components/Rating/Rating.stories.tsx +11 -6
- package/src/components/Rating/Rating.tsx +3 -5
- package/src/components/River/River.tsx +5 -5
- package/src/components/SectionIntro/SectionIntro.tsx +8 -2
- package/src/components/Slider/Slider.stories.tsx +4 -4
- package/src/components/Slider/Slider.tsx +4 -3
- package/src/components/Spinner/Spinner.tsx +19 -3
- package/src/components/Steps/Steps.stories.tsx +5 -4
- package/src/components/Steps/Steps.tsx +8 -5
- package/src/components/Tab/Tab.stories.tsx +4 -3
- package/src/components/Tab/Tab.tsx +8 -6
- package/src/components/Testimonial/Testimonial.tsx +8 -2
- package/src/components/Todo/Todo.tsx +2 -1
- package/src/components/Toggle/Toggle.stories.tsx +5 -4
- package/src/components/Toggle/Toggle.tsx +8 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
- package/src/components/Tooltip/Tooltip.tsx +9 -2
- package/src/components/Upload/Upload.stories.tsx +252 -0
- package/src/components/Upload/Upload.tsx +92 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
- package/src/components/index.ts +0 -4
- package/src/layouts/Grid/Grid.stories.tsx +10 -23
- package/src/layouts/Grid/Grid.tsx +20 -1
- package/src/layouts/Grid/GridCol.tsx +76 -48
- package/src/lib/composables/useAtomixGlass.ts +861 -44
- package/src/lib/composables/useBarChart.ts +21 -4
- package/src/lib/composables/useChart.ts +227 -370
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +11 -21
- package/src/lib/composables/useEdgePanel.ts +125 -71
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +11 -2
- package/src/lib/composables/usePieChart.ts +4 -14
- package/src/lib/composables/useRiver.ts +5 -0
- package/src/lib/composables/useSlider.ts +62 -24
- package/src/lib/composables/useVideoPlayer.ts +60 -63
- package/src/lib/constants/components.ts +147 -32
- package/src/lib/types/components.ts +355 -25
- package/src/lib/utils/displacement-generator.ts +55 -49
- package/src/lib/utils/icons.ts +1 -1
- package/src/lib/utils/index.ts +16 -10
- package/src/styles/01-settings/_settings.accordion.scss +19 -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 -17
- package/src/styles/01-settings/_settings.background.scss +0 -3
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
- package/src/styles/01-settings/_settings.card.scss +1 -1
- package/src/styles/01-settings/_settings.chart.scss +65 -2
- package/src/styles/01-settings/_settings.dropdown.scss +1 -1
- package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +35 -42
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.list.scss +1 -1
- package/src/styles/01-settings/_settings.rating.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +1 -1
- package/src/styles/01-settings/_settings.upload.scss +6 -5
- package/src/styles/02-tools/_tools.animations.scss +4 -5
- package/src/styles/02-tools/_tools.background.scss +1 -13
- package/src/styles/02-tools/_tools.glass.scss +0 -1
- package/src/styles/02-tools/_tools.utility-api.scss +91 -48
- package/src/styles/03-generic/_generic.root.scss +1 -4
- package/src/styles/04-elements/_elements.body.scss +0 -1
- package/src/styles/06-components/_components.atomix-glass.scss +249 -0
- package/src/styles/06-components/_components.badge.scss +8 -23
- package/src/styles/06-components/_components.button.scss +8 -3
- package/src/styles/06-components/_components.callout.scss +10 -5
- package/src/styles/06-components/_components.card.scss +2 -14
- package/src/styles/06-components/_components.chart.scss +969 -1449
- package/src/styles/06-components/_components.dropdown.scss +19 -7
- package/src/styles/06-components/_components.edge-panel.scss +103 -0
- package/src/styles/06-components/_components.footer.scss +166 -85
- package/src/styles/06-components/_components.input.scss +8 -9
- package/src/styles/06-components/_components.list.scss +1 -0
- package/src/styles/06-components/_components.messages.scss +176 -0
- package/src/styles/06-components/_components.modal.scss +16 -4
- package/src/styles/06-components/_components.navbar.scss +12 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -0
- package/src/styles/06-components/_components.skeleton.scss +8 -6
- package/src/styles/06-components/_components.upload.scss +219 -4
- package/src/styles/06-components/old.chart.styles.scss +1 -30
- package/src/styles/99-utilities/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
- package/src/components/Chart/AdvancedChart.tsx +0 -624
- package/src/components/Chart/LineChartNew.tsx +0 -167
- package/src/components/Chart/RealTimeChart.tsx +0 -436
- package/src/components/DatePicker/DatePicker copy.tsx +0 -551
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import { Button } from '../Button/Button';
|
|
4
5
|
import { EdgePanel } from './EdgePanel';
|
|
6
|
+
import { Card } from '../Card/Card';
|
|
5
7
|
|
|
6
8
|
const meta = {
|
|
7
9
|
title: 'Components/EdgePanel',
|
|
8
10
|
component: EdgePanel,
|
|
9
11
|
parameters: {
|
|
10
|
-
layout: '
|
|
12
|
+
layout: 'fullscreen',
|
|
11
13
|
docs: {
|
|
12
14
|
description: {
|
|
13
15
|
component:
|
|
@@ -49,7 +51,20 @@ const meta = {
|
|
|
49
51
|
},
|
|
50
52
|
decorators: [
|
|
51
53
|
Story => (
|
|
52
|
-
<div
|
|
54
|
+
<div
|
|
55
|
+
style={{
|
|
56
|
+
minHeight: '100vh',
|
|
57
|
+
width: '100%',
|
|
58
|
+
backgroundImage:
|
|
59
|
+
'url(https://images.unsplash.com/photo-1605440704530-cd6f40ecf5a9?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2670)',
|
|
60
|
+
backgroundSize: 'cover',
|
|
61
|
+
backgroundPosition: 'center',
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
padding: '2rem',
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
53
68
|
<Story />
|
|
54
69
|
</div>
|
|
55
70
|
),
|
|
@@ -122,6 +137,7 @@ const EdgePanelController = ({
|
|
|
122
137
|
closeOnBackdropClick,
|
|
123
138
|
closeOnEscape,
|
|
124
139
|
title,
|
|
140
|
+
glass,
|
|
125
141
|
}: any) => {
|
|
126
142
|
const [open, setOpen] = useState(false);
|
|
127
143
|
|
|
@@ -145,6 +161,7 @@ const EdgePanelController = ({
|
|
|
145
161
|
isOpen={open}
|
|
146
162
|
onOpenChange={isOpen => setOpen(isOpen)}
|
|
147
163
|
title={title || `Edge Panel (${position})`}
|
|
164
|
+
glass={glass}
|
|
148
165
|
>
|
|
149
166
|
<DemoPanelContent
|
|
150
167
|
position={position}
|
|
@@ -191,6 +208,7 @@ export const Top: Story = {
|
|
|
191
208
|
backdrop={true}
|
|
192
209
|
closeOnBackdropClick={true}
|
|
193
210
|
closeOnEscape={true}
|
|
211
|
+
glass={true}
|
|
194
212
|
/>
|
|
195
213
|
),
|
|
196
214
|
};
|
|
@@ -264,3 +282,456 @@ export const MobileNavigation: Story = {
|
|
|
264
282
|
/>
|
|
265
283
|
),
|
|
266
284
|
};
|
|
285
|
+
|
|
286
|
+
// Glass Variant Stories
|
|
287
|
+
export const GlassStart: Story = {
|
|
288
|
+
parameters: {
|
|
289
|
+
docs: {
|
|
290
|
+
description: {
|
|
291
|
+
story:
|
|
292
|
+
'Edge Panel with glass morphism effect from start position. The glass effect blurs and distorts the background content behind it.',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
render: () => {
|
|
297
|
+
const [open, setOpen] = useState(false);
|
|
298
|
+
|
|
299
|
+
useEffect(() => {
|
|
300
|
+
return () => {
|
|
301
|
+
document.body.classList.remove('is-edgepanel-open');
|
|
302
|
+
};
|
|
303
|
+
}, []);
|
|
304
|
+
|
|
305
|
+
return (
|
|
306
|
+
<div>
|
|
307
|
+
<Button label="Open Glass Panel (Start)" variant="primary" onClick={() => setOpen(true)} />
|
|
308
|
+
|
|
309
|
+
<EdgePanel
|
|
310
|
+
position="start"
|
|
311
|
+
mode="slide"
|
|
312
|
+
backdrop={true}
|
|
313
|
+
closeOnBackdropClick={true}
|
|
314
|
+
closeOnEscape={true}
|
|
315
|
+
isOpen={open}
|
|
316
|
+
onOpenChange={setOpen}
|
|
317
|
+
title="Glass Panel"
|
|
318
|
+
glass={
|
|
319
|
+
{
|
|
320
|
+
mode: 'standard',
|
|
321
|
+
displacementScale: 50,
|
|
322
|
+
blurAmount: 2,
|
|
323
|
+
saturation: 150,
|
|
324
|
+
} as any
|
|
325
|
+
}
|
|
326
|
+
>
|
|
327
|
+
<DemoPanelContent
|
|
328
|
+
position="start"
|
|
329
|
+
mode="slide"
|
|
330
|
+
backdrop={true}
|
|
331
|
+
closeOnBackdropClick={true}
|
|
332
|
+
closeOnEscape={true}
|
|
333
|
+
/>
|
|
334
|
+
</EdgePanel>
|
|
335
|
+
</div>
|
|
336
|
+
);
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export const GlassEnd: Story = {
|
|
341
|
+
parameters: {
|
|
342
|
+
docs: {
|
|
343
|
+
description: {
|
|
344
|
+
story:
|
|
345
|
+
'Edge Panel with glass morphism effect from end position. Notice how the background is visible through the glass.',
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
render: () => {
|
|
350
|
+
const [open, setOpen] = useState(false);
|
|
351
|
+
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
return () => {
|
|
354
|
+
document.body.classList.remove('is-edgepanel-open');
|
|
355
|
+
};
|
|
356
|
+
}, []);
|
|
357
|
+
|
|
358
|
+
return (
|
|
359
|
+
<div>
|
|
360
|
+
<Button label="Open Glass Panel (End)" variant="secondary" onClick={() => setOpen(true)} />
|
|
361
|
+
|
|
362
|
+
<EdgePanel
|
|
363
|
+
position="end"
|
|
364
|
+
mode="slide"
|
|
365
|
+
backdrop={true}
|
|
366
|
+
closeOnBackdropClick={true}
|
|
367
|
+
closeOnEscape={true}
|
|
368
|
+
isOpen={open}
|
|
369
|
+
onOpenChange={setOpen}
|
|
370
|
+
title="Glass Panel"
|
|
371
|
+
glass={
|
|
372
|
+
{
|
|
373
|
+
mode: 'polar',
|
|
374
|
+
displacementScale: 60,
|
|
375
|
+
blurAmount: 1.5,
|
|
376
|
+
saturation: 170,
|
|
377
|
+
} as any
|
|
378
|
+
}
|
|
379
|
+
>
|
|
380
|
+
<DemoPanelContent
|
|
381
|
+
position="end"
|
|
382
|
+
mode="slide"
|
|
383
|
+
backdrop={true}
|
|
384
|
+
closeOnBackdropClick={true}
|
|
385
|
+
closeOnEscape={true}
|
|
386
|
+
/>
|
|
387
|
+
</EdgePanel>
|
|
388
|
+
</div>
|
|
389
|
+
);
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
export const GlassCustom: Story = {
|
|
394
|
+
parameters: {
|
|
395
|
+
docs: {
|
|
396
|
+
description: {
|
|
397
|
+
story: 'Edge Panel with custom glass effect configuration using shader mode.',
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
render: () => {
|
|
402
|
+
const [open, setOpen] = useState(false);
|
|
403
|
+
|
|
404
|
+
useEffect(() => {
|
|
405
|
+
return () => {
|
|
406
|
+
document.body.classList.remove('is-edgepanel-open');
|
|
407
|
+
};
|
|
408
|
+
}, []);
|
|
409
|
+
|
|
410
|
+
return (
|
|
411
|
+
<div>
|
|
412
|
+
<Button label="Open Custom Glass Panel" variant="primary" onClick={() => setOpen(true)} />
|
|
413
|
+
|
|
414
|
+
<EdgePanel
|
|
415
|
+
position="end"
|
|
416
|
+
mode="slide"
|
|
417
|
+
backdrop={true}
|
|
418
|
+
closeOnBackdropClick={true}
|
|
419
|
+
closeOnEscape={true}
|
|
420
|
+
isOpen={open}
|
|
421
|
+
onOpenChange={setOpen}
|
|
422
|
+
title="Custom Glass Panel"
|
|
423
|
+
glass={
|
|
424
|
+
{
|
|
425
|
+
mode: 'shader',
|
|
426
|
+
shaderVariant: 'liquidGlass',
|
|
427
|
+
displacementScale: 70,
|
|
428
|
+
blurAmount: 1.8,
|
|
429
|
+
saturation: 170,
|
|
430
|
+
cornerRadius: 0,
|
|
431
|
+
} as any
|
|
432
|
+
}
|
|
433
|
+
>
|
|
434
|
+
<div>
|
|
435
|
+
<p className="u-mb-4">
|
|
436
|
+
This panel features a custom glass effect with shader mode for premium visual quality.
|
|
437
|
+
</p>
|
|
438
|
+
|
|
439
|
+
<Card
|
|
440
|
+
title="Glass Effect Settings"
|
|
441
|
+
text="The glass morphism uses liquid glass shader variant with custom displacement and saturation."
|
|
442
|
+
className="u-mb-3"
|
|
443
|
+
/>
|
|
444
|
+
|
|
445
|
+
<Card
|
|
446
|
+
title="Premium Visual Quality"
|
|
447
|
+
text="Shader-based glass effects provide the highest quality appearance with smooth transitions."
|
|
448
|
+
className="u-mb-3"
|
|
449
|
+
/>
|
|
450
|
+
|
|
451
|
+
<Button label="Action" variant="primary" className="u-w-full" />
|
|
452
|
+
</div>
|
|
453
|
+
</EdgePanel>
|
|
454
|
+
</div>
|
|
455
|
+
);
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
export const GlassPremium: Story = {
|
|
460
|
+
parameters: {
|
|
461
|
+
docs: {
|
|
462
|
+
description: {
|
|
463
|
+
story: 'Edge Panel with premium glass shader variant for high-end UI.',
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
render: () => {
|
|
468
|
+
const [open, setOpen] = useState(false);
|
|
469
|
+
|
|
470
|
+
useEffect(() => {
|
|
471
|
+
return () => {
|
|
472
|
+
document.body.classList.remove('is-edgepanel-open');
|
|
473
|
+
};
|
|
474
|
+
}, []);
|
|
475
|
+
|
|
476
|
+
return (
|
|
477
|
+
<div>
|
|
478
|
+
<Button label="Open Premium Glass Panel" variant="primary" onClick={() => setOpen(true)} />
|
|
479
|
+
|
|
480
|
+
<EdgePanel
|
|
481
|
+
position="start"
|
|
482
|
+
mode="slide"
|
|
483
|
+
backdrop={true}
|
|
484
|
+
closeOnBackdropClick={true}
|
|
485
|
+
closeOnEscape={true}
|
|
486
|
+
isOpen={open}
|
|
487
|
+
onOpenChange={setOpen}
|
|
488
|
+
title="Premium Glass"
|
|
489
|
+
glass={
|
|
490
|
+
{
|
|
491
|
+
mode: 'shader',
|
|
492
|
+
shaderVariant: 'premiumGlass',
|
|
493
|
+
displacementScale: 180,
|
|
494
|
+
blurAmount: 1,
|
|
495
|
+
saturation: 60,
|
|
496
|
+
cornerRadius: 0,
|
|
497
|
+
} as any
|
|
498
|
+
}
|
|
499
|
+
>
|
|
500
|
+
<div>
|
|
501
|
+
<h5 className="u-mb-3">Premium Features</h5>
|
|
502
|
+
|
|
503
|
+
<Card
|
|
504
|
+
title="Enhanced Visuals"
|
|
505
|
+
text="Premium glass shader provides the most refined appearance."
|
|
506
|
+
glass
|
|
507
|
+
className="u-mb-3"
|
|
508
|
+
/>
|
|
509
|
+
|
|
510
|
+
<Card
|
|
511
|
+
title="Perfect for Modern Apps"
|
|
512
|
+
text="Ideal for applications requiring sophisticated UI design."
|
|
513
|
+
glass
|
|
514
|
+
className="u-mb-3"
|
|
515
|
+
/>
|
|
516
|
+
|
|
517
|
+
<div className="u-mt-4">
|
|
518
|
+
<Button label="Get Started" variant="primary" className="u-w-full u-mb-2" />
|
|
519
|
+
<Button label="Learn More" variant="secondary" className="u-w-full" />
|
|
520
|
+
</div>
|
|
521
|
+
</div>
|
|
522
|
+
</EdgePanel>
|
|
523
|
+
</div>
|
|
524
|
+
);
|
|
525
|
+
},
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
export const GlassShowcase: Story = {
|
|
529
|
+
parameters: {
|
|
530
|
+
docs: {
|
|
531
|
+
description: {
|
|
532
|
+
story: 'Comprehensive showcase of all glass modes and variants for Edge Panel.',
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
},
|
|
536
|
+
render: () => {
|
|
537
|
+
const [openPanels, setOpenPanels] = useState({
|
|
538
|
+
standard: false,
|
|
539
|
+
polar: false,
|
|
540
|
+
prominent: false,
|
|
541
|
+
liquid: false,
|
|
542
|
+
premium: false,
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
useEffect(() => {
|
|
546
|
+
return () => {
|
|
547
|
+
document.body.classList.remove('is-edgepanel-open');
|
|
548
|
+
};
|
|
549
|
+
}, []);
|
|
550
|
+
|
|
551
|
+
const togglePanel = (panel: string) => {
|
|
552
|
+
setOpenPanels(prev => ({
|
|
553
|
+
...prev,
|
|
554
|
+
[panel]: !prev[panel as keyof typeof prev],
|
|
555
|
+
}));
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
return (
|
|
559
|
+
<div>
|
|
560
|
+
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
|
|
561
|
+
<Button
|
|
562
|
+
label="Standard Glass"
|
|
563
|
+
variant="primary"
|
|
564
|
+
onClick={() => togglePanel('standard')}
|
|
565
|
+
/>
|
|
566
|
+
<Button label="Polar Glass" variant="secondary" onClick={() => togglePanel('polar')} />
|
|
567
|
+
<Button
|
|
568
|
+
label="Prominent Glass"
|
|
569
|
+
variant="tertiary"
|
|
570
|
+
onClick={() => togglePanel('prominent')}
|
|
571
|
+
/>
|
|
572
|
+
<Button label="Liquid Glass" variant="info" onClick={() => togglePanel('liquid')} />
|
|
573
|
+
<Button label="Premium Glass" variant="success" onClick={() => togglePanel('premium')} />
|
|
574
|
+
|
|
575
|
+
{/* Standard Glass Mode */}
|
|
576
|
+
<EdgePanel
|
|
577
|
+
position="start"
|
|
578
|
+
mode="slide"
|
|
579
|
+
backdrop={true}
|
|
580
|
+
closeOnBackdropClick={true}
|
|
581
|
+
closeOnEscape={true}
|
|
582
|
+
isOpen={openPanels.standard}
|
|
583
|
+
onOpenChange={isOpen => setOpenPanels(prev => ({ ...prev, standard: isOpen }))}
|
|
584
|
+
title="Standard Glass Mode"
|
|
585
|
+
glass={
|
|
586
|
+
{
|
|
587
|
+
mode: 'standard',
|
|
588
|
+
displacementScale: 25,
|
|
589
|
+
blurAmount: 1.2,
|
|
590
|
+
saturation: 140,
|
|
591
|
+
cornerRadius: 0,
|
|
592
|
+
} as any
|
|
593
|
+
}
|
|
594
|
+
>
|
|
595
|
+
<div>
|
|
596
|
+
<h5 className="u-mb-3">Standard Glass Effect</h5>
|
|
597
|
+
<p className="u-mb-4">
|
|
598
|
+
Classic glass morphism with balanced displacement and blur for general use.
|
|
599
|
+
</p>
|
|
600
|
+
<Card title="Balanced Design" text="Perfect for everyday applications." glass />
|
|
601
|
+
</div>
|
|
602
|
+
</EdgePanel>
|
|
603
|
+
|
|
604
|
+
{/* Polar Glass Mode */}
|
|
605
|
+
<EdgePanel
|
|
606
|
+
position="end"
|
|
607
|
+
mode="slide"
|
|
608
|
+
backdrop={true}
|
|
609
|
+
closeOnBackdropClick={true}
|
|
610
|
+
closeOnEscape={true}
|
|
611
|
+
isOpen={openPanels.polar}
|
|
612
|
+
onOpenChange={isOpen => setOpenPanels(prev => ({ ...prev, polar: isOpen }))}
|
|
613
|
+
title="Polar Glass Mode"
|
|
614
|
+
glass={
|
|
615
|
+
{
|
|
616
|
+
mode: 'polar',
|
|
617
|
+
displacementScale: 35,
|
|
618
|
+
blurAmount: 1.5,
|
|
619
|
+
saturation: 160,
|
|
620
|
+
cornerRadius: 0,
|
|
621
|
+
} as any
|
|
622
|
+
}
|
|
623
|
+
>
|
|
624
|
+
<div>
|
|
625
|
+
<h5 className="u-mb-3">Polar Glass Effect</h5>
|
|
626
|
+
<p className="u-mb-4">
|
|
627
|
+
Enhanced polar distortion creates unique radial patterns from center.
|
|
628
|
+
</p>
|
|
629
|
+
<Card
|
|
630
|
+
title="Radial Distortion"
|
|
631
|
+
text="Creates circular displacement patterns."
|
|
632
|
+
glass
|
|
633
|
+
/>
|
|
634
|
+
</div>
|
|
635
|
+
</EdgePanel>
|
|
636
|
+
|
|
637
|
+
{/* Prominent Glass Mode */}
|
|
638
|
+
<EdgePanel
|
|
639
|
+
position="start"
|
|
640
|
+
mode="slide"
|
|
641
|
+
backdrop={true}
|
|
642
|
+
closeOnBackdropClick={true}
|
|
643
|
+
closeOnEscape={true}
|
|
644
|
+
isOpen={openPanels.prominent}
|
|
645
|
+
onOpenChange={isOpen => setOpenPanels(prev => ({ ...prev, prominent: isOpen }))}
|
|
646
|
+
title="Prominent Glass Mode"
|
|
647
|
+
glass={
|
|
648
|
+
{
|
|
649
|
+
mode: 'prominent',
|
|
650
|
+
displacementScale: 50,
|
|
651
|
+
blurAmount: 2,
|
|
652
|
+
saturation: 180,
|
|
653
|
+
cornerRadius: 0,
|
|
654
|
+
} as any
|
|
655
|
+
}
|
|
656
|
+
>
|
|
657
|
+
<div>
|
|
658
|
+
<h5 className="u-mb-3">Prominent Glass Effect</h5>
|
|
659
|
+
<p className="u-mb-4">
|
|
660
|
+
Stronger displacement and blur for bold, eye-catching interfaces.
|
|
661
|
+
</p>
|
|
662
|
+
<Card title="Bold Appearance" text="Maximum visual impact and depth." glass />
|
|
663
|
+
</div>
|
|
664
|
+
</EdgePanel>
|
|
665
|
+
|
|
666
|
+
{/* Liquid Glass Shader */}
|
|
667
|
+
<EdgePanel
|
|
668
|
+
position="end"
|
|
669
|
+
mode="slide"
|
|
670
|
+
backdrop={true}
|
|
671
|
+
closeOnBackdropClick={true}
|
|
672
|
+
closeOnEscape={true}
|
|
673
|
+
isOpen={openPanels.liquid}
|
|
674
|
+
onOpenChange={isOpen => setOpenPanels(prev => ({ ...prev, liquid: isOpen }))}
|
|
675
|
+
title="Liquid Glass Shader"
|
|
676
|
+
glass={
|
|
677
|
+
{
|
|
678
|
+
mode: 'shader',
|
|
679
|
+
shaderVariant: 'liquidGlass',
|
|
680
|
+
displacementScale: 70,
|
|
681
|
+
blurAmount: 1.8,
|
|
682
|
+
saturation: 170,
|
|
683
|
+
cornerRadius: 0,
|
|
684
|
+
} as any
|
|
685
|
+
}
|
|
686
|
+
>
|
|
687
|
+
<div>
|
|
688
|
+
<h5 className="u-mb-3">Liquid Glass Shader</h5>
|
|
689
|
+
<p className="u-mb-4">
|
|
690
|
+
GPU-accelerated shader-based glass with fluid, organic distortion patterns.
|
|
691
|
+
</p>
|
|
692
|
+
<Card
|
|
693
|
+
title="Premium Quality"
|
|
694
|
+
text="Smooth, flowing distortions powered by WebGL shaders."
|
|
695
|
+
glass
|
|
696
|
+
/>
|
|
697
|
+
</div>
|
|
698
|
+
</EdgePanel>
|
|
699
|
+
|
|
700
|
+
{/* Premium Glass Shader */}
|
|
701
|
+
<EdgePanel
|
|
702
|
+
position="start"
|
|
703
|
+
mode="slide"
|
|
704
|
+
backdrop={true}
|
|
705
|
+
closeOnBackdropClick={true}
|
|
706
|
+
closeOnEscape={true}
|
|
707
|
+
isOpen={openPanels.premium}
|
|
708
|
+
onOpenChange={isOpen => setOpenPanels(prev => ({ ...prev, premium: isOpen }))}
|
|
709
|
+
title="Premium Glass Shader"
|
|
710
|
+
glass={
|
|
711
|
+
{
|
|
712
|
+
mode: 'shader',
|
|
713
|
+
shaderVariant: 'premiumGlass',
|
|
714
|
+
displacementScale: 180,
|
|
715
|
+
blurAmount: 1,
|
|
716
|
+
saturation: 60,
|
|
717
|
+
cornerRadius: 0,
|
|
718
|
+
} as any
|
|
719
|
+
}
|
|
720
|
+
>
|
|
721
|
+
<div>
|
|
722
|
+
<h5 className="u-mb-3">Premium Glass Shader</h5>
|
|
723
|
+
<p className="u-mb-4">
|
|
724
|
+
Highest quality glass effect with refined, sophisticated appearance.
|
|
725
|
+
</p>
|
|
726
|
+
<Card
|
|
727
|
+
title="Elite Design"
|
|
728
|
+
text="The pinnacle of glass morphism for luxury applications."
|
|
729
|
+
glass
|
|
730
|
+
/>
|
|
731
|
+
</div>
|
|
732
|
+
</EdgePanel>
|
|
733
|
+
</div>
|
|
734
|
+
</div>
|
|
735
|
+
);
|
|
736
|
+
},
|
|
737
|
+
};
|
|
@@ -1,9 +1,55 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
2
|
import { EdgePanelProps } from '../../lib/types/components';
|
|
3
3
|
import { useEdgePanel } from '../../lib/composables/useEdgePanel';
|
|
4
4
|
import { EDGE_PANEL } from '../../lib/constants/components';
|
|
5
5
|
import { Icon } from '../Icon/Icon';
|
|
6
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* EdgePanel - A sliding panel component that appears from any screen edge
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Basic usage
|
|
15
|
+
* <EdgePanel
|
|
16
|
+
* title="My Panel"
|
|
17
|
+
* isOpen={isOpen}
|
|
18
|
+
* onOpenChange={setIsOpen}
|
|
19
|
+
* position="start"
|
|
20
|
+
* >
|
|
21
|
+
* <p>Panel content</p>
|
|
22
|
+
* </EdgePanel>
|
|
23
|
+
*
|
|
24
|
+
* // With glass effect
|
|
25
|
+
* <EdgePanel
|
|
26
|
+
* title="Glass Panel"
|
|
27
|
+
* isOpen={isOpen}
|
|
28
|
+
* onOpenChange={setIsOpen}
|
|
29
|
+
* position="end"
|
|
30
|
+
* glass={true}
|
|
31
|
+
* >
|
|
32
|
+
* <p>Panel with glass morphism</p>
|
|
33
|
+
* </EdgePanel>
|
|
34
|
+
*
|
|
35
|
+
* // With custom glass configuration
|
|
36
|
+
* <EdgePanel
|
|
37
|
+
* title="Custom Glass"
|
|
38
|
+
* isOpen={isOpen}
|
|
39
|
+
* onOpenChange={setIsOpen}
|
|
40
|
+
* position="start"
|
|
41
|
+
* glass={{
|
|
42
|
+
* mode: 'shader',
|
|
43
|
+
* shaderVariant: 'liquidGlass',
|
|
44
|
+
* displacementScale: 70,
|
|
45
|
+
* blurAmount: 1.8,
|
|
46
|
+
* saturation: 170,
|
|
47
|
+
* }}
|
|
48
|
+
* >
|
|
49
|
+
* <p>Panel with custom glass effect</p>
|
|
50
|
+
* </EdgePanel>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
7
53
|
export const EdgePanel: React.FC<EdgePanelProps> = ({
|
|
8
54
|
title,
|
|
9
55
|
children,
|
|
@@ -15,6 +61,8 @@ export const EdgePanel: React.FC<EdgePanelProps> = ({
|
|
|
15
61
|
closeOnBackdropClick = true,
|
|
16
62
|
closeOnEscape = true,
|
|
17
63
|
className = '',
|
|
64
|
+
style,
|
|
65
|
+
glass,
|
|
18
66
|
}) => {
|
|
19
67
|
const {
|
|
20
68
|
isOpen: isOpenState,
|
|
@@ -31,12 +79,16 @@ export const EdgePanel: React.FC<EdgePanelProps> = ({
|
|
|
31
79
|
backdrop,
|
|
32
80
|
closeOnBackdropClick,
|
|
33
81
|
closeOnEscape,
|
|
82
|
+
glass,
|
|
34
83
|
});
|
|
35
84
|
|
|
85
|
+
// Moved useRef outside of conditional rendering to fix hook order issue
|
|
86
|
+
const glassContentRef = useRef<HTMLDivElement>(null);
|
|
87
|
+
|
|
36
88
|
const panelClass = generateEdgePanelClass({
|
|
37
89
|
position,
|
|
38
90
|
isOpen,
|
|
39
|
-
className,
|
|
91
|
+
className: glass ? `${className} c-edge-panel--glass` : className,
|
|
40
92
|
});
|
|
41
93
|
|
|
42
94
|
// If not open and not controlled by parent, don't render
|
|
@@ -44,23 +96,59 @@ export const EdgePanel: React.FC<EdgePanelProps> = ({
|
|
|
44
96
|
return null;
|
|
45
97
|
}
|
|
46
98
|
|
|
99
|
+
const defaultGlassProps = {
|
|
100
|
+
elasticity: 0,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
104
|
+
|
|
105
|
+
const panelContent = (
|
|
106
|
+
<>
|
|
107
|
+
<div className="c-edge-panel__header">
|
|
108
|
+
<h4>{title}</h4>
|
|
109
|
+
<button
|
|
110
|
+
className="c-edge-panel__close c-btn c-btn--icon"
|
|
111
|
+
onClick={() => closePanel()}
|
|
112
|
+
aria-label="Close panel"
|
|
113
|
+
>
|
|
114
|
+
<Icon name="X" />
|
|
115
|
+
</button>
|
|
116
|
+
</div>
|
|
117
|
+
<div className="c-edge-panel__body">{children}</div>
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
|
|
47
121
|
return (
|
|
48
|
-
<div className={panelClass} data-position={position} data-mode={mode}>
|
|
122
|
+
<div className={panelClass} data-position={position} data-mode={mode} style={style}>
|
|
49
123
|
{backdrop && (
|
|
50
124
|
<div ref={backdropRef} className="c-edge-panel__backdrop" onClick={handleBackdropClick} />
|
|
51
125
|
)}
|
|
52
126
|
<div ref={containerRef} className="c-edge-panel__container">
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
className="c-edge-
|
|
57
|
-
|
|
58
|
-
|
|
127
|
+
{glass ? (
|
|
128
|
+
<AtomixGlass
|
|
129
|
+
{...glassProps}
|
|
130
|
+
className="c-edge-panel__glass-wrapper"
|
|
131
|
+
style={{
|
|
132
|
+
position: 'fixed',
|
|
133
|
+
width: glassContentRef.current?.offsetWidth,
|
|
134
|
+
height: glassContentRef.current?.offsetHeight,
|
|
135
|
+
top: containerRef.current?.offsetTop,
|
|
136
|
+
left: containerRef.current?.offsetLeft,
|
|
137
|
+
bottom: containerRef.current?.style.bottom,
|
|
138
|
+
right: containerRef.current?.style.right,
|
|
139
|
+
}}
|
|
59
140
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
141
|
+
<div
|
|
142
|
+
ref={glassContentRef}
|
|
143
|
+
className="c-edge-panel__glass-content"
|
|
144
|
+
style={{ borderRadius: containerRef.current?.style.borderRadius }}
|
|
145
|
+
>
|
|
146
|
+
{panelContent}
|
|
147
|
+
</div>
|
|
148
|
+
</AtomixGlass>
|
|
149
|
+
) : (
|
|
150
|
+
panelContent
|
|
151
|
+
)}
|
|
64
152
|
</div>
|
|
65
153
|
</div>
|
|
66
154
|
);
|