@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
|
@@ -84,11 +84,16 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
84
84
|
autoplayRef.current = null;
|
|
85
85
|
}
|
|
86
86
|
setAutoplayRunning(false);
|
|
87
|
-
return;
|
|
87
|
+
return undefined;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
const autoplayParams = typeof autoplay === 'boolean' ? { delay: 3000 } : autoplay;
|
|
91
|
-
const {
|
|
91
|
+
const {
|
|
92
|
+
delay = 3000,
|
|
93
|
+
pauseOnMouseEnter = false,
|
|
94
|
+
disableOnInteraction = false,
|
|
95
|
+
reverseDirection = false,
|
|
96
|
+
} = autoplayParams;
|
|
92
97
|
|
|
93
98
|
// Clear any existing interval
|
|
94
99
|
if (autoplayRef.current) {
|
|
@@ -100,7 +105,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
100
105
|
// We need to use a functional update to get the latest values
|
|
101
106
|
setRealIndex(prevRealIndex => {
|
|
102
107
|
if (isTransitioning) return prevRealIndex;
|
|
103
|
-
|
|
108
|
+
|
|
104
109
|
// Stop autoplay on interaction if disableOnInteraction is true
|
|
105
110
|
if (disableOnInteraction && autoplayRef.current) {
|
|
106
111
|
clearInterval(autoplayRef.current);
|
|
@@ -114,11 +119,15 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
114
119
|
} else {
|
|
115
120
|
nextIndex = Math.min(prevRealIndex + 1, slides.length - slidesToShow);
|
|
116
121
|
}
|
|
117
|
-
|
|
122
|
+
|
|
118
123
|
// Trigger the slide change
|
|
119
124
|
if (reverseDirection) {
|
|
120
125
|
// For reverse direction, we would go to previous slide
|
|
121
|
-
const prevIndex = loop
|
|
126
|
+
const prevIndex = loop
|
|
127
|
+
? prevRealIndex === 0
|
|
128
|
+
? slides.length - 1
|
|
129
|
+
: prevRealIndex - 1
|
|
130
|
+
: Math.max(prevRealIndex - 1, 0);
|
|
122
131
|
setInternalIndex(loop ? slides.length + prevIndex : prevIndex);
|
|
123
132
|
setIsTransitioning(true);
|
|
124
133
|
setDragOffset(0);
|
|
@@ -127,7 +136,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
127
136
|
setIsTransitioning(false);
|
|
128
137
|
onSlideChange?.(prevIndex);
|
|
129
138
|
}, speed);
|
|
130
|
-
|
|
139
|
+
|
|
131
140
|
return prevIndex;
|
|
132
141
|
} else {
|
|
133
142
|
// Normal direction
|
|
@@ -138,7 +147,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
138
147
|
setTimeout(() => {
|
|
139
148
|
setIsTransitioning(false);
|
|
140
149
|
onSlideChange?.(nextIndex);
|
|
141
|
-
|
|
150
|
+
|
|
142
151
|
// Reposition after transition ends for looped sliders
|
|
143
152
|
if (loop && nextIndex >= slides.length * 2) {
|
|
144
153
|
repositioningRef.current = true;
|
|
@@ -148,12 +157,12 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
148
157
|
}, 0);
|
|
149
158
|
}
|
|
150
159
|
}, speed);
|
|
151
|
-
|
|
160
|
+
|
|
152
161
|
return nextIndex;
|
|
153
162
|
}
|
|
154
163
|
});
|
|
155
164
|
}, delay);
|
|
156
|
-
|
|
165
|
+
|
|
157
166
|
setAutoplayRunning(true);
|
|
158
167
|
|
|
159
168
|
// Handle pause on mouse enter/leave if enabled
|
|
@@ -165,24 +174,24 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
165
174
|
setAutoplayRunning(false);
|
|
166
175
|
}
|
|
167
176
|
};
|
|
168
|
-
|
|
177
|
+
|
|
169
178
|
const handleMouseLeave = () => {
|
|
170
179
|
// Restart autoplay
|
|
171
180
|
if (autoplayRef.current) {
|
|
172
181
|
clearInterval(autoplayRef.current);
|
|
173
182
|
}
|
|
174
|
-
|
|
183
|
+
|
|
175
184
|
autoplayRef.current = setInterval(() => {
|
|
176
185
|
setRealIndex(prevRealIndex => {
|
|
177
186
|
if (isTransitioning) return prevRealIndex;
|
|
178
|
-
|
|
187
|
+
|
|
179
188
|
let nextIndex;
|
|
180
189
|
if (loop) {
|
|
181
190
|
nextIndex = (prevRealIndex + 1) % slides.length;
|
|
182
191
|
} else {
|
|
183
192
|
nextIndex = Math.min(prevRealIndex + 1, slides.length - slidesToShow);
|
|
184
193
|
}
|
|
185
|
-
|
|
194
|
+
|
|
186
195
|
setInternalIndex(loop ? slides.length + nextIndex : nextIndex);
|
|
187
196
|
setIsTransitioning(true);
|
|
188
197
|
setDragOffset(0);
|
|
@@ -190,7 +199,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
190
199
|
setTimeout(() => {
|
|
191
200
|
setIsTransitioning(false);
|
|
192
201
|
onSlideChange?.(nextIndex);
|
|
193
|
-
|
|
202
|
+
|
|
194
203
|
if (loop) {
|
|
195
204
|
// Reposition after transition ends
|
|
196
205
|
if (nextIndex >= slides.length * 2) {
|
|
@@ -202,11 +211,11 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
202
211
|
}
|
|
203
212
|
}
|
|
204
213
|
}, speed);
|
|
205
|
-
|
|
214
|
+
|
|
206
215
|
return nextIndex;
|
|
207
216
|
});
|
|
208
217
|
}, delay);
|
|
209
|
-
|
|
218
|
+
|
|
210
219
|
setAutoplayRunning(true);
|
|
211
220
|
};
|
|
212
221
|
|
|
@@ -228,7 +237,16 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
228
237
|
}
|
|
229
238
|
setAutoplayRunning(false);
|
|
230
239
|
};
|
|
231
|
-
}, [
|
|
240
|
+
}, [
|
|
241
|
+
autoplay,
|
|
242
|
+
slides.length,
|
|
243
|
+
loop,
|
|
244
|
+
slidesToShow,
|
|
245
|
+
isTransitioning,
|
|
246
|
+
speed,
|
|
247
|
+
onSlideChange,
|
|
248
|
+
repositioningRef,
|
|
249
|
+
]);
|
|
232
250
|
|
|
233
251
|
// Initialize
|
|
234
252
|
useEffect(() => {
|
|
@@ -258,7 +276,12 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
258
276
|
if (isTransitioning) return;
|
|
259
277
|
|
|
260
278
|
// Stop autoplay on interaction if disableOnInteraction is true
|
|
261
|
-
if (
|
|
279
|
+
if (
|
|
280
|
+
autoplay &&
|
|
281
|
+
typeof autoplay === 'object' &&
|
|
282
|
+
autoplay.disableOnInteraction &&
|
|
283
|
+
autoplayRef.current
|
|
284
|
+
) {
|
|
262
285
|
clearInterval(autoplayRef.current);
|
|
263
286
|
autoplayRef.current = null;
|
|
264
287
|
setAutoplayRunning(false);
|
|
@@ -309,14 +332,19 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
309
332
|
onSlideChange,
|
|
310
333
|
allSlides.length,
|
|
311
334
|
loopedSlides,
|
|
312
|
-
autoplay
|
|
335
|
+
autoplay,
|
|
313
336
|
]);
|
|
314
337
|
|
|
315
338
|
const slidePrev = useCallback(() => {
|
|
316
339
|
if (isTransitioning) return;
|
|
317
340
|
|
|
318
341
|
// Stop autoplay on interaction if disableOnInteraction is true
|
|
319
|
-
if (
|
|
342
|
+
if (
|
|
343
|
+
autoplay &&
|
|
344
|
+
typeof autoplay === 'object' &&
|
|
345
|
+
autoplay.disableOnInteraction &&
|
|
346
|
+
autoplayRef.current
|
|
347
|
+
) {
|
|
320
348
|
clearInterval(autoplayRef.current);
|
|
321
349
|
autoplayRef.current = null;
|
|
322
350
|
setAutoplayRunning(false);
|
|
@@ -366,7 +394,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
366
394
|
onSlideChange,
|
|
367
395
|
allSlides.length,
|
|
368
396
|
loopedSlides,
|
|
369
|
-
autoplay
|
|
397
|
+
autoplay,
|
|
370
398
|
]);
|
|
371
399
|
|
|
372
400
|
const goToSlide = useCallback(
|
|
@@ -374,7 +402,12 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
374
402
|
if (isTransitioning || index === realIndex) return;
|
|
375
403
|
|
|
376
404
|
// Stop autoplay on interaction if disableOnInteraction is true
|
|
377
|
-
if (
|
|
405
|
+
if (
|
|
406
|
+
autoplay &&
|
|
407
|
+
typeof autoplay === 'object' &&
|
|
408
|
+
autoplay.disableOnInteraction &&
|
|
409
|
+
autoplayRef.current
|
|
410
|
+
) {
|
|
378
411
|
clearInterval(autoplayRef.current);
|
|
379
412
|
autoplayRef.current = null;
|
|
380
413
|
setAutoplayRunning(false);
|
|
@@ -399,7 +432,12 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
399
432
|
if (!allowTouchMove) return;
|
|
400
433
|
|
|
401
434
|
// Stop autoplay on interaction if disableOnInteraction is true
|
|
402
|
-
if (
|
|
435
|
+
if (
|
|
436
|
+
autoplay &&
|
|
437
|
+
typeof autoplay === 'object' &&
|
|
438
|
+
autoplay.disableOnInteraction &&
|
|
439
|
+
autoplayRef.current
|
|
440
|
+
) {
|
|
403
441
|
clearInterval(autoplayRef.current);
|
|
404
442
|
autoplayRef.current = null;
|
|
405
443
|
setAutoplayRunning(false);
|
|
@@ -523,4 +561,4 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
523
561
|
loopedSlides,
|
|
524
562
|
repositioningRef,
|
|
525
563
|
};
|
|
526
|
-
}
|
|
564
|
+
}
|
|
@@ -63,9 +63,11 @@ export function useVideoPlayer({
|
|
|
63
63
|
onPlay?.();
|
|
64
64
|
} catch (error) {
|
|
65
65
|
console.error('Error playing video:', error);
|
|
66
|
+
onError?.(error as Event);
|
|
67
|
+
setIsPlaying(false);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
}, [videoRef, onPlay]);
|
|
70
|
+
}, [videoRef, onPlay, onError]);
|
|
69
71
|
|
|
70
72
|
const pause = useCallback(() => {
|
|
71
73
|
if (videoRef.current) {
|
|
@@ -165,14 +167,18 @@ export function useVideoPlayer({
|
|
|
165
167
|
const currentTime = videoRef.current.currentTime;
|
|
166
168
|
const wasPlaying = !videoRef.current.paused;
|
|
167
169
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
// Validate and sanitize the source URL
|
|
171
|
+
const sanitizedSrc = String(newQuality.src).replace(/[<>"']/g, '');
|
|
172
|
+
if (sanitizedSrc && (sanitizedSrc.startsWith('http://') || sanitizedSrc.startsWith('https://') || sanitizedSrc.startsWith('blob:') || sanitizedSrc.startsWith('data:'))) {
|
|
173
|
+
videoRef.current.src = sanitizedSrc;
|
|
174
|
+
videoRef.current.currentTime = currentTime;
|
|
170
175
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
if (wasPlaying) {
|
|
177
|
+
videoRef.current.play();
|
|
178
|
+
}
|
|
174
179
|
|
|
175
|
-
|
|
180
|
+
setCurrentQuality(newQuality);
|
|
181
|
+
}
|
|
176
182
|
}
|
|
177
183
|
},
|
|
178
184
|
[videoRef, quality]
|
|
@@ -292,70 +298,61 @@ export function useVideoPlayer({
|
|
|
292
298
|
}, [onFullscreenChange]);
|
|
293
299
|
|
|
294
300
|
// Keyboard shortcuts
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
};
|
|
301
|
+
const handleKeyDown = useCallback((e: KeyboardEvent) => {
|
|
302
|
+
if (!containerRef.current?.contains(document.activeElement)) return;
|
|
303
|
+
|
|
304
|
+
switch (e.code) {
|
|
305
|
+
case 'Space':
|
|
306
|
+
e.preventDefault();
|
|
307
|
+
togglePlay();
|
|
308
|
+
break;
|
|
309
|
+
case 'ArrowLeft':
|
|
310
|
+
e.preventDefault();
|
|
311
|
+
seek(currentTime - 10);
|
|
312
|
+
break;
|
|
313
|
+
case 'ArrowRight':
|
|
314
|
+
e.preventDefault();
|
|
315
|
+
seek(currentTime + 10);
|
|
316
|
+
break;
|
|
317
|
+
case 'ArrowUp':
|
|
318
|
+
e.preventDefault();
|
|
319
|
+
setVolume(Math.min(1, volume + 0.1));
|
|
320
|
+
break;
|
|
321
|
+
case 'ArrowDown':
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
setVolume(Math.max(0, volume - 0.1));
|
|
324
|
+
break;
|
|
325
|
+
case 'KeyM':
|
|
326
|
+
e.preventDefault();
|
|
327
|
+
toggleMute();
|
|
328
|
+
break;
|
|
329
|
+
case 'KeyF':
|
|
330
|
+
e.preventDefault();
|
|
331
|
+
toggleFullscreen();
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}, [togglePlay, seek, currentTime, setVolume, volume, toggleMute, toggleFullscreen, containerRef]);
|
|
330
335
|
|
|
336
|
+
useEffect(() => {
|
|
331
337
|
document.addEventListener('keydown', handleKeyDown);
|
|
332
338
|
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
333
|
-
}, [
|
|
334
|
-
togglePlay,
|
|
335
|
-
seek,
|
|
336
|
-
currentTime,
|
|
337
|
-
setVolume,
|
|
338
|
-
volume,
|
|
339
|
-
toggleMute,
|
|
340
|
-
toggleFullscreen,
|
|
341
|
-
containerRef,
|
|
342
|
-
]);
|
|
339
|
+
}, [handleKeyDown]);
|
|
343
340
|
|
|
344
341
|
// Mouse movement for controls
|
|
342
|
+
const handleMouseMove = useCallback(() => resetControlsTimeout(), [resetControlsTimeout]);
|
|
343
|
+
const handleMouseLeave = useCallback(() => {
|
|
344
|
+
if (controlsTimeoutRef.current) {
|
|
345
|
+
clearTimeout(controlsTimeoutRef.current);
|
|
346
|
+
}
|
|
347
|
+
if (isPlaying) {
|
|
348
|
+
setShowControls(false);
|
|
349
|
+
}
|
|
350
|
+
}, [isPlaying]);
|
|
351
|
+
|
|
345
352
|
useEffect(() => {
|
|
346
353
|
const container = containerRef.current;
|
|
347
354
|
if (!container) return undefined;
|
|
348
355
|
|
|
349
|
-
const handleMouseMove = () => resetControlsTimeout();
|
|
350
|
-
const handleMouseLeave = () => {
|
|
351
|
-
if (controlsTimeoutRef.current) {
|
|
352
|
-
clearTimeout(controlsTimeoutRef.current);
|
|
353
|
-
}
|
|
354
|
-
if (isPlaying) {
|
|
355
|
-
setShowControls(false);
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
|
|
359
356
|
container.addEventListener('mousemove', handleMouseMove);
|
|
360
357
|
container.addEventListener('mouseleave', handleMouseLeave);
|
|
361
358
|
|
|
@@ -366,7 +363,7 @@ export function useVideoPlayer({
|
|
|
366
363
|
clearTimeout(controlsTimeoutRef.current);
|
|
367
364
|
}
|
|
368
365
|
};
|
|
369
|
-
}, [containerRef,
|
|
366
|
+
}, [containerRef, handleMouseMove, handleMouseLeave]);
|
|
370
367
|
|
|
371
368
|
return {
|
|
372
369
|
isPlaying,
|
|
@@ -1214,6 +1214,7 @@ export const CHART = {
|
|
|
1214
1214
|
EXPORT_GROUP_CLASS: 'c-chart__export-group',
|
|
1215
1215
|
EXPORT_DROPDOWN_CLASS: 'c-chart__export-dropdown',
|
|
1216
1216
|
EXPORT_OPTION_CLASS: 'c-chart__export-option',
|
|
1217
|
+
SETTINGS_MENU_CLASS: 'c-chart__settings-menu',
|
|
1217
1218
|
TOOLBAR_GROUP_CLASS: 'c-chart__toolbar-group',
|
|
1218
1219
|
TOOLBAR_SEPARATOR_CLASS: 'c-chart__toolbar-separator',
|
|
1219
1220
|
TOOLBAR_LABEL_CLASS: 'c-chart__toolbar-label',
|
|
@@ -1528,6 +1529,9 @@ export const FOOTER = {
|
|
|
1528
1529
|
CENTERED: 'c-footer--centered',
|
|
1529
1530
|
MINIMAL: 'c-footer--minimal',
|
|
1530
1531
|
STACKED: 'c-footer--stacked',
|
|
1532
|
+
FLEXIBLE: 'c-footer--flexible',
|
|
1533
|
+
SIDEBAR: 'c-footer--sidebar',
|
|
1534
|
+
WIDE: 'c-footer--wide',
|
|
1531
1535
|
// Size variants
|
|
1532
1536
|
SM: 'c-footer--sm',
|
|
1533
1537
|
MD: 'c-footer--md',
|
|
@@ -1556,35 +1560,35 @@ export const FOOTER = {
|
|
|
1556
1560
|
*/
|
|
1557
1561
|
export const ATOMIX_GLASS = {
|
|
1558
1562
|
BASE_CLASS: 'c-atomix-glass',
|
|
1559
|
-
|
|
1563
|
+
CONTAINER_CLASS: 'c-atomix-glass__container',
|
|
1564
|
+
INNER_CLASS: 'c-atomix-glass__inner',
|
|
1565
|
+
FILTER_CLASS: 'c-atomix-glass__filter',
|
|
1566
|
+
FILTER_OVERLAY_CLASS: 'c-atomix-glass__filter-overlay',
|
|
1567
|
+
FILTER_SHADOW_CLASS: 'c-atomix-glass__filter-shadow',
|
|
1560
1568
|
CONTENT_CLASS: 'c-atomix-glass__content',
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1569
|
+
BORDER_1_CLASS: 'c-atomix-glass__border-1',
|
|
1570
|
+
BORDER_2_CLASS: 'c-atomix-glass__border-2',
|
|
1571
|
+
HOVER_1_CLASS: 'c-atomix-glass__hover-1',
|
|
1572
|
+
HOVER_2_CLASS: 'c-atomix-glass__hover-2',
|
|
1573
|
+
HOVER_3_CLASS: 'c-atomix-glass__hover-3',
|
|
1574
|
+
BASE_LAYER_CLASS: 'c-atomix-glass__base',
|
|
1575
|
+
OVERLAY_LAYER_CLASS: 'c-atomix-glass__overlay',
|
|
1576
|
+
OVERLAY_HIGHLIGHT_CLASS: 'c-atomix-glass__overlay-highlight',
|
|
1577
|
+
BACKGROUND_LAYER_CLASS: 'c-atomix-glass__background-layer',
|
|
1578
|
+
BACKGROUND_LAYER_DARK_CLASS: 'c-atomix-glass__background-layer--dark',
|
|
1579
|
+
BACKGROUND_LAYER_BLACK_CLASS: 'c-atomix-glass__background-layer--black',
|
|
1580
|
+
BACKGROUND_LAYER_OVER_LIGHT_CLASS: 'c-atomix-glass__background-layer--over-light',
|
|
1581
|
+
BACKGROUND_LAYER_HIDDEN_CLASS: 'c-atomix-glass__background-layer--hidden',
|
|
1566
1582
|
VARIANT_PREFIX: 'c-atomix-glass--',
|
|
1567
1583
|
MODE_PREFIX: 'c-atomix-glass--',
|
|
1568
1584
|
CLASSES: {
|
|
1569
1585
|
BASE: 'c-atomix-glass',
|
|
1570
|
-
|
|
1586
|
+
CONTAINER: 'c-atomix-glass__container',
|
|
1587
|
+
INNER: 'c-atomix-glass__inner',
|
|
1588
|
+
FILTER: 'c-atomix-glass__filter',
|
|
1571
1589
|
CONTENT: 'c-atomix-glass__content',
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
OVER_LIGHT: 'c-atomix-glass__over-light',
|
|
1575
|
-
OVER_LIGHT_ACTIVE: 'c-atomix-glass__over-light--active',
|
|
1576
|
-
OVER_LIGHT_OVERLAY: 'c-atomix-glass__over-light--overlay',
|
|
1577
|
-
OVER_LIGHT_OVERLAY_ACTIVE: 'c-atomix-glass__over-light--overlay-active',
|
|
1578
|
-
HOVER_EFFECT: 'c-atomix-glass__hover-effect',
|
|
1579
|
-
HOVER_EFFECT_ACTIVE: 'c-atomix-glass__hover-effect--active',
|
|
1580
|
-
ACTIVE_EFFECT: 'c-atomix-glass__active-effect',
|
|
1581
|
-
ACTIVE_EFFECT_ACTIVE: 'c-atomix-glass__active-effect--active',
|
|
1582
|
-
GLOW_EFFECT: 'c-atomix-glass__glow-effect',
|
|
1583
|
-
GLOW_EFFECT_HOVER: 'c-atomix-glass__glow-effect--hover',
|
|
1584
|
-
GLOW_EFFECT_ACTIVE: 'c-atomix-glass__glow-effect--active',
|
|
1585
|
-
// Modifiers
|
|
1586
|
-
CLICKABLE: 'c-atomix-glass--clickable',
|
|
1587
|
-
ACTIVE: 'c-atomix-glass--active',
|
|
1590
|
+
ACTIVE: 'active',
|
|
1591
|
+
OVER_LIGHT: 'c-atomix-glass__container--over-light',
|
|
1588
1592
|
// Mode variants
|
|
1589
1593
|
STANDARD: 'c-atomix-glass--standard',
|
|
1590
1594
|
POLAR: 'c-atomix-glass--polar',
|
|
@@ -1592,15 +1596,126 @@ export const ATOMIX_GLASS = {
|
|
|
1592
1596
|
SHADER: 'c-atomix-glass--shader',
|
|
1593
1597
|
},
|
|
1594
1598
|
DEFAULTS: {
|
|
1595
|
-
DISPLACEMENT_SCALE:
|
|
1596
|
-
BLUR_AMOUNT:
|
|
1599
|
+
DISPLACEMENT_SCALE: 20,
|
|
1600
|
+
BLUR_AMOUNT: 1,
|
|
1597
1601
|
SATURATION: 140,
|
|
1598
|
-
ABERRATION_INTENSITY: 2,
|
|
1599
|
-
ELASTICITY: 0.
|
|
1600
|
-
CORNER_RADIUS:
|
|
1601
|
-
PADDING: '
|
|
1602
|
-
MODE: 'standard',
|
|
1603
|
-
OVER_LIGHT:
|
|
1604
|
-
|
|
1602
|
+
ABERRATION_INTENSITY: 2.5,
|
|
1603
|
+
ELASTICITY: 0.05,
|
|
1604
|
+
CORNER_RADIUS: 16, // Default border-radius matching design system
|
|
1605
|
+
PADDING: '0 0',
|
|
1606
|
+
MODE: 'standard' as const,
|
|
1607
|
+
OVER_LIGHT: 'auto' as const,
|
|
1608
|
+
ENABLE_OVER_LIGHT_LAYERS: true,
|
|
1609
|
+
},
|
|
1610
|
+
CONSTANTS: {
|
|
1611
|
+
ACTIVATION_ZONE: 200,
|
|
1612
|
+
MIN_BLUR: 0.1,
|
|
1613
|
+
MOUSE_INFLUENCE_DIVISOR: 100,
|
|
1614
|
+
EDGE_FADE_PIXELS: 2,
|
|
1615
|
+
DEFAULT_CORNER_RADIUS: 16, // Fallback value matching design system
|
|
1616
|
+
MAX_SIZE: 4096, // Maximum width/height for glass size
|
|
1617
|
+
|
|
1618
|
+
// Gradient calculation constants
|
|
1619
|
+
GRADIENT: {
|
|
1620
|
+
BASE_ANGLE: 135, // Base angle for border gradients (degrees)
|
|
1621
|
+
ANGLE_MULTIPLIER: 1.2, // Multiplier for mouse influence on angle
|
|
1622
|
+
BORDER_STOP_1: {
|
|
1623
|
+
MIN: 10, // Minimum percentage for border stop 1
|
|
1624
|
+
BASE: 33, // Base percentage for border stop 1
|
|
1625
|
+
MULTIPLIER: 0.3, // Multiplier for mouse Y influence
|
|
1626
|
+
},
|
|
1627
|
+
BORDER_STOP_2: {
|
|
1628
|
+
MAX: 90, // Maximum percentage for border stop 2
|
|
1629
|
+
BASE: 66, // Base percentage for border stop 2
|
|
1630
|
+
MULTIPLIER: 0.4, // Multiplier for mouse Y influence
|
|
1631
|
+
},
|
|
1632
|
+
BORDER_OPACITY: {
|
|
1633
|
+
BASE_1: 0.12, // Base opacity for border gradient 1
|
|
1634
|
+
BASE_2: 0.4, // Base opacity for border gradient 2
|
|
1635
|
+
BASE_3: 0.32, // Base opacity for border gradient 3
|
|
1636
|
+
BASE_4: 0.6, // Base opacity for border gradient 4
|
|
1637
|
+
MULTIPLIER_LOW: 0.008, // Low multiplier for mouse influence on opacity
|
|
1638
|
+
MULTIPLIER_HIGH: 0.012, // High multiplier for mouse influence on opacity
|
|
1639
|
+
},
|
|
1640
|
+
CENTER_POSITION: 50, // Center position percentage (50%)
|
|
1641
|
+
HOVER_POSITION: {
|
|
1642
|
+
DIVISOR_1: 2, // Divisor for hover 1 position calculation
|
|
1643
|
+
DIVISOR_2: 1.5, // Divisor for hover 2 position calculation
|
|
1644
|
+
MULTIPLIER_3: 1, // Direct multiplier for hover 3 (no division)
|
|
1645
|
+
},
|
|
1646
|
+
BASE_LAYER_MULTIPLIER: 0.5, // Multiplier for base layer position
|
|
1647
|
+
},
|
|
1648
|
+
|
|
1649
|
+
// Gradient opacity values for hover effects
|
|
1650
|
+
GRADIENT_OPACITY: {
|
|
1651
|
+
HOVER_1: {
|
|
1652
|
+
BLACK_START: 0.3, // Start opacity for black hover 1
|
|
1653
|
+
BLACK_MID: 0.1, // Mid opacity for black hover 1
|
|
1654
|
+
BLACK_STOP: 30, // Stop percentage for black hover 1
|
|
1655
|
+
BLACK_END: 60, // End percentage for black hover 1
|
|
1656
|
+
WHITE_START: 0.5, // Start opacity for white hover 1
|
|
1657
|
+
WHITE_STOP: 50, // Stop percentage for white hover 1
|
|
1658
|
+
},
|
|
1659
|
+
HOVER_2: {
|
|
1660
|
+
BLACK_START: 0.4, // Start opacity for black hover 2
|
|
1661
|
+
BLACK_MID: 0.15, // Mid opacity for black hover 2
|
|
1662
|
+
BLACK_STOP: 40, // Stop percentage for black hover 2
|
|
1663
|
+
BLACK_END: 80, // End percentage for black hover 2
|
|
1664
|
+
WHITE_START: 1, // Start opacity for white hover 2
|
|
1665
|
+
WHITE_STOP: 80, // Stop percentage for white hover 2
|
|
1666
|
+
},
|
|
1667
|
+
HOVER_3: {
|
|
1668
|
+
BLACK_START: 0.5, // Start opacity for black hover 3
|
|
1669
|
+
BLACK_MID: 0.2, // Mid opacity for black hover 3
|
|
1670
|
+
BLACK_STOP: 50, // Stop percentage for black hover 3
|
|
1671
|
+
BLACK_END: 100, // End percentage for black hover 3
|
|
1672
|
+
WHITE_START: 1, // Start opacity for white hover 3
|
|
1673
|
+
WHITE_STOP: 100, // Stop percentage for white hover 3
|
|
1674
|
+
},
|
|
1675
|
+
},
|
|
1676
|
+
|
|
1677
|
+
// Base and overlay gradient constants
|
|
1678
|
+
BASE_GRADIENT: {
|
|
1679
|
+
ANGLE: 135, // Gradient angle in degrees
|
|
1680
|
+
BLACK_START_BASE: 0.15, // Base start opacity for black
|
|
1681
|
+
BLACK_START_MULTIPLIER: 0.003, // Multiplier for mouse X influence on start
|
|
1682
|
+
BLACK_MID_BASE: 0.1, // Base mid opacity for black
|
|
1683
|
+
BLACK_MID_MULTIPLIER: 0.002, // Multiplier for mouse Y influence on mid
|
|
1684
|
+
BLACK_MID_STOP: 50, // Mid stop percentage
|
|
1685
|
+
BLACK_END_BASE: 0.18, // Base end opacity for black
|
|
1686
|
+
BLACK_END_MULTIPLIER: 0.004, // Multiplier for mouse X influence on end
|
|
1687
|
+
WHITE_OPACITY: 0.1, // White opacity for non-overlight mode
|
|
1688
|
+
},
|
|
1689
|
+
|
|
1690
|
+
OVERLAY_GRADIENT: {
|
|
1691
|
+
BLACK_START_BASE: 0.12, // Base start opacity for black overlay
|
|
1692
|
+
BLACK_START_MULTIPLIER: 0.003, // Multiplier for mouse X influence on start
|
|
1693
|
+
BLACK_MID: 0.06, // Mid opacity for black overlay
|
|
1694
|
+
BLACK_MID_STOP: 40, // Mid stop percentage
|
|
1695
|
+
BLACK_END_BASE: 0.15, // Base end opacity for black overlay
|
|
1696
|
+
BLACK_END_MULTIPLIER: 0.003, // Multiplier for mouse Y influence on end
|
|
1697
|
+
WHITE_OPACITY: 0.05, // White opacity for non-overlight mode
|
|
1698
|
+
},
|
|
1699
|
+
|
|
1700
|
+
// Overlay highlight constants
|
|
1701
|
+
OVERLAY_HIGHLIGHT: {
|
|
1702
|
+
POSITION_X: 20, // X position percentage
|
|
1703
|
+
POSITION_Y: 20, // Y position percentage
|
|
1704
|
+
WHITE_OPACITY: 0.4, // White opacity in gradient
|
|
1705
|
+
STOP: 60, // Stop percentage
|
|
1706
|
+
OPACITY_MULTIPLIER: 0.7, // Multiplier for overlay highlight opacity
|
|
1707
|
+
},
|
|
1708
|
+
|
|
1709
|
+
// Displacement and aberration multipliers
|
|
1710
|
+
MULTIPLIERS: {
|
|
1711
|
+
SHADER_DISPLACEMENT: 0.8, // Displacement scale multiplier for shader mode
|
|
1712
|
+
OVER_LIGHT_DISPLACEMENT: 0.6, // Displacement scale multiplier for over-light mode
|
|
1713
|
+
SHADER_ABERRATION: 0.7, // Aberration intensity multiplier for shader mode
|
|
1714
|
+
},
|
|
1715
|
+
|
|
1716
|
+
// Saturation constants
|
|
1717
|
+
SATURATION: {
|
|
1718
|
+
HIGH_CONTRAST: 200, // Saturation value for high contrast mode
|
|
1719
|
+
},
|
|
1605
1720
|
},
|
|
1606
1721
|
};
|