@shohojdhara/atomix 0.2.4 → 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 +1266 -1412
- package/dist/atomix.min.css +3 -3
- package/dist/index.d.ts +1232 -876
- package/dist/index.esm.js +16212 -26364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15652 -22298
- 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 +1266 -1413
- package/dist/themes/boomdevs.min.css +3 -3
- package/dist/themes/esrar.css +1267 -1413
- package/dist/themes/esrar.min.css +3 -3
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1264 -1410
- package/dist/themes/mashroom.min.css +5 -5
- package/dist/themes/shaj-default.css +1266 -1412
- package/dist/themes/shaj-default.min.css +3 -3
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +4 -26
- package/src/components/Accordion/Accordion.tsx +21 -12
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +487 -1215
- 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 +404 -236
- package/src/components/AtomixGlass/{AtomixGlass.stories.tsx → stories/AtomixGlass.stories.tsx} +55 -35
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +57 -89
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +149 -149
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +95 -32
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +0 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +9 -18
- 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 +74 -54
- package/src/components/Badge/Badge.tsx +8 -12
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.tsx +3 -5
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +4 -0
- package/src/components/Card/Card.stories.tsx +89 -85
- 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 +0 -11
- 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 +13 -15
- package/src/components/EdgePanel/EdgePanel.tsx +20 -5
- 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.tsx +3 -2
- package/src/components/Modal/Modal.stories.tsx +48 -34
- package/src/components/Modal/Modal.tsx +19 -23
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.tsx +6 -1
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.tsx +4 -1
- package/src/components/Navigation/SideMenu/SideMenu.tsx +3 -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 +2 -1
- 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 +2 -1
- 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 +13 -6
- package/src/lib/composables/useChart.ts +17 -13
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +0 -1
- package/src/lib/composables/useEdgePanel.ts +111 -103
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +8 -1
- 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 +146 -32
- package/src/lib/types/components.ts +258 -10
- 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 +1 -4
- 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.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 +42 -34
- 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 +216 -39
- package/src/styles/06-components/_components.badge.scss +6 -8
- package/src/styles/06-components/_components.button.scss +8 -3
- 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 +4 -2
- 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.modal.scss +5 -3
- 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/_utilities.opacity.scss +1 -1
- package/src/styles/99-utilities/_utilities.scss +1 -1
- 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,5 +1,179 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// AtomixGlass Types
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Displacement mode for glass effect
|
|
9
|
+
*/
|
|
10
|
+
export type DisplacementMode = 'standard' | 'polar' | 'prominent' | 'shader';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mouse position coordinates
|
|
14
|
+
*/
|
|
15
|
+
export interface MousePosition {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Glass component size dimensions
|
|
22
|
+
*/
|
|
23
|
+
export interface GlassSize {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* OverLight configuration - can be boolean, 'auto', or object with settings
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Boolean - explicit control
|
|
33
|
+
* overLight={true}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Auto-detection - automatically detects background brightness
|
|
37
|
+
* overLight="auto"
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Object config - auto-detection with custom settings
|
|
41
|
+
* overLight={{
|
|
42
|
+
* threshold: 0.8,
|
|
43
|
+
* opacity: 0.6,
|
|
44
|
+
* contrast: 1.8,
|
|
45
|
+
* brightness: 1.0,
|
|
46
|
+
* saturationBoost: 1.5
|
|
47
|
+
* }}
|
|
48
|
+
*/
|
|
49
|
+
export type OverLightConfig =
|
|
50
|
+
| boolean
|
|
51
|
+
| 'auto'
|
|
52
|
+
| OverLightObjectConfig;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* OverLight object configuration
|
|
56
|
+
*
|
|
57
|
+
* When using object mode, the component will auto-detect background brightness
|
|
58
|
+
* and apply the custom settings. All properties are optional and will use
|
|
59
|
+
* sensible defaults if not provided.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Minimal config - only threshold
|
|
63
|
+
* overLight={{ threshold: 0.8 }}
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Full config with all properties
|
|
67
|
+
* overLight={{
|
|
68
|
+
* threshold: 0.75,
|
|
69
|
+
* opacity: 0.6,
|
|
70
|
+
* contrast: 1.8,
|
|
71
|
+
* brightness: 1.1,
|
|
72
|
+
* saturationBoost: 1.5
|
|
73
|
+
* }}
|
|
74
|
+
*/
|
|
75
|
+
export interface OverLightObjectConfig {
|
|
76
|
+
/**
|
|
77
|
+
* Luminance threshold for auto-detection (0.1 - 1.0)
|
|
78
|
+
*
|
|
79
|
+
* Backgrounds with average luminance above this threshold will be
|
|
80
|
+
* considered "light" and trigger overLight mode.
|
|
81
|
+
*
|
|
82
|
+
* @default 0.7
|
|
83
|
+
* @minimum 0.1
|
|
84
|
+
* @maximum 1.0
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // More sensitive detection (triggers on lighter backgrounds)
|
|
88
|
+
* threshold: 0.6
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // Less sensitive detection (only very light backgrounds)
|
|
92
|
+
* threshold: 0.85
|
|
93
|
+
*/
|
|
94
|
+
threshold?: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Base opacity for overLight layers (0.1 - 1.0)
|
|
98
|
+
*
|
|
99
|
+
* Controls the opacity of the base and overlay layers when overLight
|
|
100
|
+
* mode is active. This value is multiplied by hover/active intensity
|
|
101
|
+
* multipliers for dynamic effects.
|
|
102
|
+
*
|
|
103
|
+
* @default 0.5 (dynamic, depends on hover/active state)
|
|
104
|
+
* @minimum 0.1
|
|
105
|
+
* @maximum 1.0
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* // Subtle overlay
|
|
109
|
+
* opacity: 0.3
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Strong overlay
|
|
113
|
+
* opacity: 0.7
|
|
114
|
+
*/
|
|
115
|
+
opacity?: number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Contrast enhancement multiplier (0.5 - 2.5)
|
|
119
|
+
*
|
|
120
|
+
* Increases the contrast of the glass effect for better visibility
|
|
121
|
+
* on light backgrounds. Higher values create more dramatic effects.
|
|
122
|
+
*
|
|
123
|
+
* @default 1.4 (dynamic, includes mouse influence)
|
|
124
|
+
* @minimum 0.5
|
|
125
|
+
* @maximum 2.5
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Subtle contrast boost
|
|
129
|
+
* contrast: 1.2
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* // High contrast for maximum visibility
|
|
133
|
+
* contrast: 2.0
|
|
134
|
+
*/
|
|
135
|
+
contrast?: number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Brightness adjustment multiplier (0.5 - 2.0)
|
|
139
|
+
*
|
|
140
|
+
* Adjusts the overall brightness of the glass effect. Values above 1.0
|
|
141
|
+
* brighten the effect, while values below 1.0 darken it.
|
|
142
|
+
*
|
|
143
|
+
* @default 0.85 (dynamic, includes mouse influence)
|
|
144
|
+
* @minimum 0.5
|
|
145
|
+
* @maximum 2.0
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* // Neutral brightness
|
|
149
|
+
* brightness: 1.0
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* // Brighter effect
|
|
153
|
+
* brightness: 1.2
|
|
154
|
+
*/
|
|
155
|
+
brightness?: number;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Saturation boost multiplier (0.5 - 3.0)
|
|
159
|
+
*
|
|
160
|
+
* Enhances color saturation for more vibrant glass effects on light
|
|
161
|
+
* backgrounds. This works in conjunction with the base saturation prop.
|
|
162
|
+
*
|
|
163
|
+
* @default 1.3 (dynamic, includes mouse influence)
|
|
164
|
+
* @minimum 0.5
|
|
165
|
+
* @maximum 3.0
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* // Moderate saturation boost
|
|
169
|
+
* saturationBoost: 1.2
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* // High saturation for vivid effects
|
|
173
|
+
* saturationBoost: 2.0
|
|
174
|
+
*/
|
|
175
|
+
saturationBoost?: number;
|
|
176
|
+
}
|
|
3
177
|
|
|
4
178
|
/**
|
|
5
179
|
* AtomixGlass component props interface
|
|
@@ -12,14 +186,14 @@ export interface AtomixGlassProps {
|
|
|
12
186
|
aberrationIntensity?: number;
|
|
13
187
|
elasticity?: number;
|
|
14
188
|
cornerRadius?: number;
|
|
15
|
-
|
|
16
|
-
mouseOffset?:
|
|
189
|
+
globalMousePosition?: MousePosition;
|
|
190
|
+
mouseOffset?: MousePosition;
|
|
17
191
|
mouseContainer?: React.RefObject<HTMLElement | null> | null;
|
|
18
192
|
className?: string;
|
|
19
193
|
padding?: string;
|
|
20
194
|
style?: React.CSSProperties;
|
|
21
|
-
overLight?:
|
|
22
|
-
mode?:
|
|
195
|
+
overLight?: OverLightConfig;
|
|
196
|
+
mode?: DisplacementMode;
|
|
23
197
|
onClick?: () => void;
|
|
24
198
|
|
|
25
199
|
/**
|
|
@@ -41,11 +215,38 @@ export interface AtomixGlassProps {
|
|
|
41
215
|
reducedMotion?: boolean;
|
|
42
216
|
highContrast?: boolean;
|
|
43
217
|
disableEffects?: boolean;
|
|
218
|
+
enableLiquidBlur?: boolean;
|
|
219
|
+
enableBorderEffect?: boolean;
|
|
220
|
+
enableOverLightLayers?: boolean;
|
|
44
221
|
|
|
45
222
|
/**
|
|
46
223
|
* Performance monitoring
|
|
47
224
|
*/
|
|
48
225
|
enablePerformanceMonitoring?: boolean;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Debug mode for cornerRadius extraction
|
|
229
|
+
*/
|
|
230
|
+
debugCornerRadius?: boolean;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Debug mode for overLight detection and configuration
|
|
234
|
+
*
|
|
235
|
+
* When enabled, logs detailed information about:
|
|
236
|
+
* - Auto-detection results (luminance values, threshold comparison)
|
|
237
|
+
* - Final overLight configuration values
|
|
238
|
+
* - Detection timing and performance
|
|
239
|
+
*
|
|
240
|
+
* Useful for debugging auto-detection issues and fine-tuning thresholds.
|
|
241
|
+
*
|
|
242
|
+
* @default false
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* <AtomixGlass overLight="auto" debugOverLight={true}>
|
|
246
|
+
* Content
|
|
247
|
+
* </AtomixGlass>
|
|
248
|
+
*/
|
|
249
|
+
debugOverLight?: boolean;
|
|
49
250
|
}
|
|
50
251
|
|
|
51
252
|
/**
|
|
@@ -111,6 +312,11 @@ export interface BaseComponentProps {
|
|
|
111
312
|
* Component children
|
|
112
313
|
*/
|
|
113
314
|
children?: ReactNode;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Inline style for the component root element
|
|
318
|
+
*/
|
|
319
|
+
style?: React.CSSProperties;
|
|
114
320
|
}
|
|
115
321
|
|
|
116
322
|
/**
|
|
@@ -227,6 +433,11 @@ export interface ButtonProps extends BaseComponentProps {
|
|
|
227
433
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
228
434
|
*/
|
|
229
435
|
glass?: AtomixGlassProps | boolean;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Custom style for the button
|
|
439
|
+
*/
|
|
440
|
+
style?: React.CSSProperties;
|
|
230
441
|
}
|
|
231
442
|
|
|
232
443
|
/**
|
|
@@ -258,6 +469,11 @@ export interface BadgeProps extends BaseComponentProps {
|
|
|
258
469
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
259
470
|
*/
|
|
260
471
|
glass?: AtomixGlassProps | boolean;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Custom style for the badge
|
|
475
|
+
*/
|
|
476
|
+
style?: React.CSSProperties;
|
|
261
477
|
}
|
|
262
478
|
|
|
263
479
|
/**
|
|
@@ -309,6 +525,11 @@ export interface CalloutProps extends BaseComponentProps {
|
|
|
309
525
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
310
526
|
*/
|
|
311
527
|
glass?: AtomixGlassProps | boolean;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Custom style for the callout
|
|
531
|
+
*/
|
|
532
|
+
style?: React.CSSProperties;
|
|
312
533
|
}
|
|
313
534
|
|
|
314
535
|
/**
|
|
@@ -1447,7 +1668,7 @@ export interface InputProps extends BaseComponentProps {
|
|
|
1447
1668
|
/**
|
|
1448
1669
|
* Glass morphism effect
|
|
1449
1670
|
*/
|
|
1450
|
-
glass?: boolean | Omit<
|
|
1671
|
+
glass?: boolean | Omit<AtomixGlassProps, 'children'>;
|
|
1451
1672
|
}
|
|
1452
1673
|
|
|
1453
1674
|
/**
|
|
@@ -1800,7 +2021,7 @@ export interface TextareaProps extends BaseComponentProps {
|
|
|
1800
2021
|
/**
|
|
1801
2022
|
* Glass morphism effect
|
|
1802
2023
|
*/
|
|
1803
|
-
glass?: boolean | Omit<
|
|
2024
|
+
glass?: boolean | Omit<AtomixGlassProps, 'children'>;
|
|
1804
2025
|
}
|
|
1805
2026
|
|
|
1806
2027
|
/**
|
|
@@ -1852,6 +2073,11 @@ export interface AvatarProps extends BaseComponentProps {
|
|
|
1852
2073
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
1853
2074
|
*/
|
|
1854
2075
|
glass?: AtomixGlassProps | boolean;
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* Custom style for the avatar
|
|
2079
|
+
*/
|
|
2080
|
+
style?: React.CSSProperties;
|
|
1855
2081
|
}
|
|
1856
2082
|
|
|
1857
2083
|
/**
|
|
@@ -2169,6 +2395,11 @@ export interface PopoverProps {
|
|
|
2169
2395
|
*/
|
|
2170
2396
|
className?: string;
|
|
2171
2397
|
|
|
2398
|
+
/**
|
|
2399
|
+
* Inline style for the popover
|
|
2400
|
+
*/
|
|
2401
|
+
style?: React.CSSProperties;
|
|
2402
|
+
|
|
2172
2403
|
/**
|
|
2173
2404
|
* Delay before showing the popover (in milliseconds)
|
|
2174
2405
|
*/
|
|
@@ -2805,7 +3036,7 @@ export interface CardProps extends BaseComponentProps {
|
|
|
2805
3036
|
* Applies a glass morphism effect to the card.
|
|
2806
3037
|
* Can be a boolean to enable with default settings, or an object with `AtomixGlassProps` to customize the effect.
|
|
2807
3038
|
*/
|
|
2808
|
-
glass?: boolean | Omit<
|
|
3039
|
+
glass?: boolean | Omit<AtomixGlassProps, 'children'>;
|
|
2809
3040
|
|
|
2810
3041
|
cardAppearance?: boolean;
|
|
2811
3042
|
/**
|
|
@@ -2816,7 +3047,7 @@ export interface CardProps extends BaseComponentProps {
|
|
|
2816
3047
|
/**
|
|
2817
3048
|
* Card styles
|
|
2818
3049
|
*/
|
|
2819
|
-
|
|
3050
|
+
style?: React.CSSProperties;
|
|
2820
3051
|
|
|
2821
3052
|
/**
|
|
2822
3053
|
* Card className
|
|
@@ -5026,7 +5257,14 @@ export interface CodeBlockProps extends BaseComponentProps {
|
|
|
5026
5257
|
/**
|
|
5027
5258
|
* Footer layout options
|
|
5028
5259
|
*/
|
|
5029
|
-
export type FooterLayout =
|
|
5260
|
+
export type FooterLayout =
|
|
5261
|
+
| 'columns'
|
|
5262
|
+
| 'centered'
|
|
5263
|
+
| 'minimal'
|
|
5264
|
+
| 'stacked'
|
|
5265
|
+
| 'flexible'
|
|
5266
|
+
| 'sidebar'
|
|
5267
|
+
| 'wide';
|
|
5030
5268
|
|
|
5031
5269
|
/**
|
|
5032
5270
|
* Social media platform types
|
|
@@ -5182,6 +5420,11 @@ export interface FooterProps extends BaseComponentProps {
|
|
|
5182
5420
|
* Footer sections content
|
|
5183
5421
|
*/
|
|
5184
5422
|
children?: ReactNode;
|
|
5423
|
+
|
|
5424
|
+
/**
|
|
5425
|
+
* Whether footer should be glass
|
|
5426
|
+
*/
|
|
5427
|
+
glass?: boolean;
|
|
5185
5428
|
}
|
|
5186
5429
|
|
|
5187
5430
|
/**
|
|
@@ -5208,6 +5451,11 @@ export interface FooterSectionProps extends BaseComponentProps {
|
|
|
5208
5451
|
*/
|
|
5209
5452
|
defaultCollapsed?: boolean;
|
|
5210
5453
|
|
|
5454
|
+
/**
|
|
5455
|
+
* Whether newsletter is shown in the footer
|
|
5456
|
+
*/
|
|
5457
|
+
showNewsletter?: boolean;
|
|
5458
|
+
|
|
5211
5459
|
/**
|
|
5212
5460
|
* Section content
|
|
5213
5461
|
*/
|
|
@@ -1,86 +1,92 @@
|
|
|
1
1
|
export interface Vec2 {
|
|
2
|
-
x: number
|
|
3
|
-
y: number
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export interface ShaderOptions {
|
|
7
|
-
width: number
|
|
8
|
-
height: number
|
|
9
|
-
fragment: (uv: Vec2) => Vec2
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
fragment: (uv: Vec2) => Vec2;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function smoothStep(a: number, b: number, t: number): number {
|
|
13
|
-
t = Math.max(0, Math.min(1, (t - a) / (b - a)))
|
|
14
|
-
return t * t * (3 - 2 * t)
|
|
13
|
+
t = Math.max(0, Math.min(1, (t - a) / (b - a)));
|
|
14
|
+
return t * t * (3 - 2 * t);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function length(x: number, y: number): number {
|
|
18
|
-
return Math.sqrt(x * x + y * y)
|
|
18
|
+
return Math.sqrt(x * x + y * y);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function roundedRectSDF(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function roundedRectSDF(
|
|
22
|
+
x: number,
|
|
23
|
+
y: number,
|
|
24
|
+
width: number,
|
|
25
|
+
height: number,
|
|
26
|
+
radius: number
|
|
27
|
+
): number {
|
|
28
|
+
const qx = Math.abs(x) - width + radius;
|
|
29
|
+
const qy = Math.abs(y) - height + radius;
|
|
30
|
+
return Math.min(Math.max(qx, qy), 0) + length(Math.max(qx, 0), Math.max(qy, 0)) - radius;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export const fragmentShaders = {
|
|
28
34
|
liquidGlass: (uv: Vec2): Vec2 => {
|
|
29
|
-
const ix = uv.x - 0.5
|
|
30
|
-
const iy = uv.y - 0.5
|
|
31
|
-
const distanceToEdge = roundedRectSDF(ix, iy, 0.3, 0.2, 0.6)
|
|
32
|
-
const displacement = smoothStep(0.8, 0, distanceToEdge - 0.15)
|
|
33
|
-
const scaled = smoothStep(0, 1, displacement)
|
|
34
|
-
return { x: ix * scaled + 0.5, y: iy * scaled + 0.5 }
|
|
35
|
+
const ix = uv.x - 0.5;
|
|
36
|
+
const iy = uv.y - 0.5;
|
|
37
|
+
const distanceToEdge = roundedRectSDF(ix, iy, 0.3, 0.2, 0.6);
|
|
38
|
+
const displacement = smoothStep(0.8, 0, distanceToEdge - 0.15);
|
|
39
|
+
const scaled = smoothStep(0, 1, displacement);
|
|
40
|
+
return { x: ix * scaled + 0.5, y: iy * scaled + 0.5 };
|
|
35
41
|
},
|
|
36
|
-
}
|
|
42
|
+
};
|
|
37
43
|
|
|
38
44
|
export class ShaderDisplacementGenerator {
|
|
39
|
-
private canvas: HTMLCanvasElement
|
|
40
|
-
private context: CanvasRenderingContext2D
|
|
45
|
+
private canvas: HTMLCanvasElement;
|
|
46
|
+
private context: CanvasRenderingContext2D;
|
|
41
47
|
|
|
42
48
|
constructor(private options: ShaderOptions) {
|
|
43
|
-
this.canvas = document.createElement(
|
|
44
|
-
this.canvas.width = options.width
|
|
45
|
-
this.canvas.height = options.height
|
|
46
|
-
this.canvas.style.display =
|
|
49
|
+
this.canvas = document.createElement('canvas');
|
|
50
|
+
this.canvas.width = options.width;
|
|
51
|
+
this.canvas.height = options.height;
|
|
52
|
+
this.canvas.style.display = 'none';
|
|
47
53
|
|
|
48
|
-
const context = this.canvas.getContext(
|
|
54
|
+
const context = this.canvas.getContext('2d');
|
|
49
55
|
if (!context) {
|
|
50
|
-
throw new Error(
|
|
56
|
+
throw new Error('Could not get 2D context');
|
|
51
57
|
}
|
|
52
|
-
this.context = context
|
|
58
|
+
this.context = context;
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
updateShader(): string {
|
|
56
|
-
const { width, height } = this.options
|
|
57
|
-
const imageData = this.context.createImageData(width, height)
|
|
58
|
-
const data = imageData.data
|
|
62
|
+
const { width, height } = this.options;
|
|
63
|
+
const imageData = this.context.createImageData(width, height);
|
|
64
|
+
const data = imageData.data;
|
|
59
65
|
|
|
60
66
|
for (let y = 0; y < height; y++) {
|
|
61
67
|
for (let x = 0; x < width; x++) {
|
|
62
|
-
const uv: Vec2 = { x: x / width, y: y / height }
|
|
63
|
-
const pos = this.options.fragment(uv)
|
|
64
|
-
|
|
65
|
-
const dx = pos.x * width - x
|
|
66
|
-
const dy = pos.y * height - y
|
|
67
|
-
|
|
68
|
-
const r =
|
|
69
|
-
const g =
|
|
70
|
-
|
|
71
|
-
const pixelIndex = (y * width + x) * 4
|
|
72
|
-
data[pixelIndex] = Math.max(0, Math.min(255, r * 255))
|
|
73
|
-
data[pixelIndex + 1] = Math.max(0, Math.min(255, g * 255))
|
|
74
|
-
data[pixelIndex + 2] = Math.max(0, Math.min(255, g * 255))
|
|
75
|
-
data[pixelIndex + 3] = 255
|
|
68
|
+
const uv: Vec2 = { x: x / width, y: y / height };
|
|
69
|
+
const pos = this.options.fragment(uv);
|
|
70
|
+
|
|
71
|
+
const dx = pos.x * width - x;
|
|
72
|
+
const dy = pos.y * height - y;
|
|
73
|
+
|
|
74
|
+
const r = dx / 10 + 0.5;
|
|
75
|
+
const g = dy / 10 + 0.5;
|
|
76
|
+
|
|
77
|
+
const pixelIndex = (y * width + x) * 4;
|
|
78
|
+
data[pixelIndex] = Math.max(0, Math.min(255, r * 255));
|
|
79
|
+
data[pixelIndex + 1] = Math.max(0, Math.min(255, g * 255));
|
|
80
|
+
data[pixelIndex + 2] = Math.max(0, Math.min(255, g * 255));
|
|
81
|
+
data[pixelIndex + 3] = 255;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
this.context.putImageData(imageData, 0, 0)
|
|
80
|
-
return this.canvas.toDataURL()
|
|
85
|
+
this.context.putImageData(imageData, 0, 0);
|
|
86
|
+
return this.canvas.toDataURL();
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
destroy(): void {
|
|
84
|
-
this.canvas.remove()
|
|
90
|
+
this.canvas.remove();
|
|
85
91
|
}
|
|
86
|
-
}
|
|
92
|
+
}
|
package/src/lib/utils/icons.ts
CHANGED
|
@@ -35,7 +35,7 @@ export function createPhosphorIcon(name: string, size: number = 16): string {
|
|
|
35
35
|
const path = ICON_PATHS[name] || '';
|
|
36
36
|
|
|
37
37
|
if (!path) {
|
|
38
|
-
console.warn(
|
|
38
|
+
console.warn('Icon not found in icon library:', typeof name === 'string' ? name.replace(/[^a-zA-Z0-9_-]/g, '_') : 'invalid_name');
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="currentColor" viewBox="0 0 256 256">
|
package/src/lib/utils/index.ts
CHANGED
|
@@ -6,18 +6,24 @@ export * from './dom';
|
|
|
6
6
|
// Export icon utilities
|
|
7
7
|
export * from './icons';
|
|
8
8
|
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
|
-
* Class name utility function to conditionally join classNames together
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* Class name utility function to conditionally join classNames together.
|
|
13
|
+
* This is a wrapper around the 'classnames' library and supports all its features:
|
|
14
|
+
* - Strings and numbers
|
|
15
|
+
* - Arrays (including nested arrays)
|
|
16
|
+
* - Objects (keys are class names, values are truthy/falsy conditions)
|
|
17
|
+
* - Mixed types
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* cn('foo', 'bar'); // 'foo bar'
|
|
21
|
+
* cn('foo', { bar: true }); // 'foo bar'
|
|
22
|
+
* cn({ 'foo-bar': true }); // 'foo-bar'
|
|
23
|
+
* cn(['foo', { bar: true }]); // 'foo bar'
|
|
13
24
|
*/
|
|
14
25
|
export function cn(...args: any[]): string {
|
|
15
|
-
return args
|
|
16
|
-
.filter(Boolean)
|
|
17
|
-
.flat()
|
|
18
|
-
.map(arg => String(arg).trim())
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.join(' ');
|
|
26
|
+
return classNames(...args);
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
/**
|
|
@@ -26,7 +32,7 @@ export function cn(...args: any[]): string {
|
|
|
26
32
|
* @returns A UUID v4 compatible string
|
|
27
33
|
*/
|
|
28
34
|
export function generateUUID(): string {
|
|
29
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,
|
|
35
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
30
36
|
const r = (Math.random() * 16) | 0;
|
|
31
37
|
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
32
38
|
return v.toString(16);
|
|
@@ -4,29 +4,29 @@
|
|
|
4
4
|
@use './settings.spacing' as *;
|
|
5
5
|
@use './settings.colors' as *;
|
|
6
6
|
|
|
7
|
-
$accordion-width:
|
|
8
|
-
$accordion-padding-x:
|
|
9
|
-
$accordion-padding-y:
|
|
7
|
+
$accordion-width: 100% !default;
|
|
8
|
+
$accordion-padding-x: map.get($spacing-sizes, 5) !default;
|
|
9
|
+
$accordion-padding-y: map.get($spacing-sizes, 4) !default;
|
|
10
10
|
|
|
11
|
-
$accordion-border-width:
|
|
12
|
-
$accordion-border-color:
|
|
13
|
-
$accordion-border-radius:
|
|
11
|
+
$accordion-border-width: calc(var(--#{config.$prefix}border-width) * 2) !default;
|
|
12
|
+
$accordion-border-color: transparent !default;
|
|
13
|
+
$accordion-border-radius: radius.$border-radius-sm !default;
|
|
14
14
|
|
|
15
|
-
$accordion-body-padding-x:
|
|
16
|
-
$accordion-body-padding-y:
|
|
17
|
-
$accordion-body-color:
|
|
18
|
-
$accordion-body-bg:
|
|
15
|
+
$accordion-body-padding-x: $accordion-padding-x !default;
|
|
16
|
+
$accordion-body-padding-y: map.get($spacing-sizes, 2) !default;
|
|
17
|
+
$accordion-body-color: var(--#{config.$prefix}body-color) !default;
|
|
18
|
+
$accordion-body-bg: var(--#{config.$prefix}body-bg) !default;
|
|
19
19
|
|
|
20
|
-
$accordion-header-padding-x:
|
|
21
|
-
$accordion-header-padding-y:
|
|
22
|
-
$accordion-header-color:
|
|
23
|
-
$accordion-header-bg:
|
|
20
|
+
$accordion-header-padding-x: $accordion-padding-x !default;
|
|
21
|
+
$accordion-header-padding-y: $accordion-padding-y !default;
|
|
22
|
+
$accordion-header-color: var(--#{config.$prefix}body-color) !default;
|
|
23
|
+
$accordion-header-bg: var(--#{config.$prefix}body-bg) !default;
|
|
24
24
|
|
|
25
|
-
$accordion-header-bg-hover:
|
|
25
|
+
$accordion-header-bg-hover: var(--#{config.$prefix}body-bg) !default;
|
|
26
26
|
|
|
27
|
-
$accordion-icon-size:
|
|
28
|
-
$accordion-icon-color:
|
|
27
|
+
$accordion-icon-size: map.get($spacing-sizes, 5) !default;
|
|
28
|
+
$accordion-icon-color: var(--#{config.$prefix}body-color) !default;
|
|
29
29
|
|
|
30
|
-
$accordion-icon-transform:
|
|
30
|
+
$accordion-icon-transform: 180deg !default;
|
|
31
31
|
|
|
32
|
-
$accordion-disable-color:
|
|
32
|
+
$accordion-disable-color: var(--#{config.$prefix}tertiary-text-emphasis) !default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
$transition-duration:
|
|
2
|
-
$easing:
|
|
1
|
+
$transition-duration: 0.3s !default;
|
|
2
|
+
$easing: cubic-bezier(0.23, 1, 0.32, 1) !default;
|
|
3
3
|
|
|
4
4
|
// Transition variables
|
|
5
|
-
$transition-base:
|
|
6
|
-
$transition-fast:
|
|
7
|
-
$transition-slow:
|
|
5
|
+
$transition-base: all $transition-duration $easing !default;
|
|
6
|
+
$transition-fast: all 0.15s $easing !default;
|
|
7
|
+
$transition-slow: all 0.5s $easing !default;
|
|
@@ -20,4 +20,4 @@ $avatar-group-more-border-color: var(--#{config.$prefix}primary-border-subtle) !
|
|
|
20
20
|
|
|
21
21
|
// Avatar group transitions
|
|
22
22
|
$avatar-group-transition-duration: 0.2s !default;
|
|
23
|
-
$avatar-group-transition-timing: ease-in-out !default;
|
|
23
|
+
$avatar-group-transition-timing: ease-in-out !default;
|