@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
|
@@ -7,6 +7,11 @@ export interface UploadProps {
|
|
|
7
7
|
*/
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Size variant of the upload component
|
|
12
|
+
*/
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
|
|
10
15
|
/**
|
|
11
16
|
* Maximum file size in MB
|
|
12
17
|
*/
|
|
@@ -71,6 +76,11 @@ export interface UploadProps {
|
|
|
71
76
|
* Additional CSS class
|
|
72
77
|
*/
|
|
73
78
|
className?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Custom style for the upload component
|
|
82
|
+
*/
|
|
83
|
+
style?: React.CSSProperties;
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
/**
|
|
@@ -83,6 +93,7 @@ type UploadStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
|
83
93
|
*/
|
|
84
94
|
export const Upload: React.FC<UploadProps> = ({
|
|
85
95
|
disabled = false,
|
|
96
|
+
size = 'md',
|
|
86
97
|
maxSizeInMB = 5,
|
|
87
98
|
acceptedFileTypes = [
|
|
88
99
|
'application/pdf',
|
|
@@ -102,6 +113,7 @@ export const Upload: React.FC<UploadProps> = ({
|
|
|
102
113
|
onFileUploadComplete,
|
|
103
114
|
onFileUploadError,
|
|
104
115
|
className = '',
|
|
116
|
+
style,
|
|
105
117
|
}) => {
|
|
106
118
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
107
119
|
|
|
@@ -272,15 +284,42 @@ export const Upload: React.FC<UploadProps> = ({
|
|
|
272
284
|
setSuccessMessage(null);
|
|
273
285
|
};
|
|
274
286
|
|
|
287
|
+
// Build CSS classes
|
|
288
|
+
const uploadClasses = [
|
|
289
|
+
'c-upload',
|
|
290
|
+
size !== 'md' && `c-upload--${size}`,
|
|
291
|
+
isDragging && UPLOAD.CLASSES.DRAGGING,
|
|
292
|
+
disabled && UPLOAD.CLASSES.DISABLED,
|
|
293
|
+
status === 'loading' && 'c-upload--loading',
|
|
294
|
+
status === 'success' && 'c-upload--success',
|
|
295
|
+
status === 'error' && 'c-upload--error',
|
|
296
|
+
className,
|
|
297
|
+
]
|
|
298
|
+
.filter(Boolean)
|
|
299
|
+
.join(' ');
|
|
300
|
+
|
|
275
301
|
return (
|
|
276
302
|
<div
|
|
277
|
-
className={
|
|
303
|
+
className={uploadClasses}
|
|
304
|
+
style={style}
|
|
278
305
|
onDragEnter={handleDragEnter}
|
|
279
306
|
onDragLeave={handleDragLeave}
|
|
280
307
|
onDragOver={handleDragOver}
|
|
281
308
|
onDrop={handleDrop}
|
|
282
309
|
>
|
|
283
|
-
<div
|
|
310
|
+
<div
|
|
311
|
+
className="c-upload__inner"
|
|
312
|
+
role="button"
|
|
313
|
+
tabIndex={disabled ? -1 : 0}
|
|
314
|
+
aria-label={`${title}. ${supportedFilesText}. ${helperText}`}
|
|
315
|
+
aria-disabled={disabled}
|
|
316
|
+
onKeyDown={e => {
|
|
317
|
+
if ((e.key === 'Enter' || e.key === ' ') && !disabled) {
|
|
318
|
+
e.preventDefault();
|
|
319
|
+
handleButtonClick();
|
|
320
|
+
}
|
|
321
|
+
}}
|
|
322
|
+
>
|
|
284
323
|
{/* Hidden file input */}
|
|
285
324
|
<input
|
|
286
325
|
type="file"
|
|
@@ -290,62 +329,62 @@ export const Upload: React.FC<UploadProps> = ({
|
|
|
290
329
|
disabled={disabled}
|
|
291
330
|
accept={acceptedFileTypes.join(',')}
|
|
292
331
|
multiple={multiple}
|
|
332
|
+
aria-hidden="true"
|
|
293
333
|
/>
|
|
294
334
|
|
|
295
|
-
{/* Drag and drop area */}
|
|
296
|
-
<div className="c-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
</button>
|
|
309
|
-
|
|
310
|
-
<p className="c-upload__helper-text">{helperText}</p>
|
|
311
|
-
</div>
|
|
335
|
+
{/* Drag and drop area content */}
|
|
336
|
+
<div className="c-upload__icon">{icon}</div>
|
|
337
|
+
<h3 className="c-upload__title">{title}</h3>
|
|
338
|
+
<p className="c-upload__text">{supportedFilesText}</p>
|
|
339
|
+
|
|
340
|
+
<button
|
|
341
|
+
type="button"
|
|
342
|
+
className="c-upload__btn c-btn"
|
|
343
|
+
onClick={handleButtonClick}
|
|
344
|
+
disabled={disabled}
|
|
345
|
+
>
|
|
346
|
+
{buttonText}
|
|
347
|
+
</button>
|
|
312
348
|
|
|
313
|
-
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
349
|
+
<p className="c-upload__helper-text">{helperText}</p>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
{/* Progress and status area */}
|
|
353
|
+
{status !== 'idle' && (
|
|
354
|
+
<div
|
|
355
|
+
className="c-upload__loader"
|
|
356
|
+
style={{ '--upload-loader-percentage': uploadProgress } as React.CSSProperties}
|
|
357
|
+
>
|
|
358
|
+
{currentFile && (
|
|
359
|
+
<div className="c-upload__loader-status">
|
|
360
|
+
<h5 className="c-upload__loader-title">{currentFile.name}</h5>
|
|
361
|
+
<div className="c-upload__loader-progress">
|
|
362
|
+
<div className="c-upload__loader-par">{uploadProgress}%</div>
|
|
363
|
+
<div className="c-upload__loader-time">{timeLeft}</div>
|
|
326
364
|
</div>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
</
|
|
337
|
-
<button
|
|
338
|
-
type="button"
|
|
339
|
-
className="c-upload__loader-close c-btn"
|
|
340
|
-
onClick={resetUpload}
|
|
341
|
-
>
|
|
342
|
-
<i className="icon-lux-x"></i>
|
|
343
|
-
</button>
|
|
365
|
+
</div>
|
|
366
|
+
)}
|
|
367
|
+
|
|
368
|
+
{(status === 'loading' || status === 'error' || status === 'success') && (
|
|
369
|
+
<div className="c-upload__loader-control">
|
|
370
|
+
<div className="c-upload__loader-bar">
|
|
371
|
+
<svg>
|
|
372
|
+
<circle cx="10" cy="10" r="10"></circle>
|
|
373
|
+
<circle cx="10" cy="10" r="10"></circle>
|
|
374
|
+
</svg>
|
|
344
375
|
</div>
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
376
|
+
<button
|
|
377
|
+
type="button"
|
|
378
|
+
className="c-upload__loader-close"
|
|
379
|
+
onClick={resetUpload}
|
|
380
|
+
aria-label="Close upload progress"
|
|
381
|
+
>
|
|
382
|
+
<i className="icon-lux-x"></i>
|
|
383
|
+
</button>
|
|
384
|
+
</div>
|
|
385
|
+
)}
|
|
386
|
+
</div>
|
|
387
|
+
)}
|
|
349
388
|
</div>
|
|
350
389
|
);
|
|
351
390
|
};
|
|
@@ -55,6 +55,7 @@ export const VideoPlayer = forwardRef<HTMLVideoElement, VideoPlayerProps>(
|
|
|
55
55
|
glass = false,
|
|
56
56
|
glassOpacity = 1,
|
|
57
57
|
glassContent,
|
|
58
|
+
style,
|
|
58
59
|
...props
|
|
59
60
|
},
|
|
60
61
|
ref
|
|
@@ -170,7 +171,7 @@ export const VideoPlayer = forwardRef<HTMLVideoElement, VideoPlayerProps>(
|
|
|
170
171
|
const video = videoRef.current;
|
|
171
172
|
if (video) {
|
|
172
173
|
const tracks = video.textTracks;
|
|
173
|
-
console.log('Setting subtitle:', subtitleLang, 'Available tracks:', tracks.length);
|
|
174
|
+
console.log('Setting subtitle:', subtitleLang ? 'enabled' : 'disabled', 'Available tracks:', tracks.length);
|
|
174
175
|
|
|
175
176
|
// Hide all tracks first
|
|
176
177
|
for (let i = 0; i < tracks.length; i++) {
|
|
@@ -380,6 +381,7 @@ export const VideoPlayer = forwardRef<HTMLVideoElement, VideoPlayerProps>(
|
|
|
380
381
|
width,
|
|
381
382
|
height,
|
|
382
383
|
aspectRatio: aspectRatio ? aspectRatio.replace(':', '/') : undefined,
|
|
384
|
+
...style,
|
|
383
385
|
}}
|
|
384
386
|
tabIndex={0}
|
|
385
387
|
onClick={handleContainerClick}
|
package/src/components/index.ts
CHANGED
|
@@ -11,7 +11,6 @@ export { default as Button, type ButtonProps } from './Button/Button';
|
|
|
11
11
|
export { default as Callout, type CalloutProps } from './Callout/Callout';
|
|
12
12
|
export { default as Card, type CardProps } from './Card/Card';
|
|
13
13
|
export {
|
|
14
|
-
AdvancedChart,
|
|
15
14
|
AnimatedChart,
|
|
16
15
|
AreaChart,
|
|
17
16
|
BarChart,
|
|
@@ -27,11 +26,9 @@ export {
|
|
|
27
26
|
MultiAxisChart,
|
|
28
27
|
PieChart,
|
|
29
28
|
RadarChart,
|
|
30
|
-
RealTimeChart,
|
|
31
29
|
ScatterChart,
|
|
32
30
|
TreemapChart,
|
|
33
31
|
WaterfallChart,
|
|
34
|
-
type AdvancedChartProps,
|
|
35
32
|
type AnimatedChartProps,
|
|
36
33
|
type AreaChartProps,
|
|
37
34
|
type BarChartProps,
|
|
@@ -50,7 +47,6 @@ export {
|
|
|
50
47
|
type MultiAxisChartProps,
|
|
51
48
|
type PieChartProps,
|
|
52
49
|
type RadarChartProps,
|
|
53
|
-
type RealTimeChartProps,
|
|
54
50
|
type ScatterChartProps,
|
|
55
51
|
type ScatterDataPoint,
|
|
56
52
|
type TreemapChartProps,
|
|
@@ -59,10 +59,7 @@ const DemoCard: React.FC<{
|
|
|
59
59
|
variant === 'secondary' ? 'u-bg-success-subtle' : ''
|
|
60
60
|
} ${variant === 'accent' ? 'u-bg-info-subtle' : ''}`}
|
|
61
61
|
>
|
|
62
|
-
<div
|
|
63
|
-
className="u-d-flex u-flex-column u-h-100"
|
|
64
|
-
style={{ minHeight: heightStyles[height] }}
|
|
65
|
-
>
|
|
62
|
+
<div className="u-d-flex u-flex-column u-h-100" style={{ minHeight: heightStyles[height] }}>
|
|
66
63
|
<div className="u-flex-grow-1 u-d-flex u-align-items-center u-justify-content-center">
|
|
67
64
|
<div className="u-text-center">{children}</div>
|
|
68
65
|
</div>
|
|
@@ -170,7 +167,9 @@ export const GettingStarted: Story = {
|
|
|
170
167
|
export const LayoutPatterns: Story = {
|
|
171
168
|
render: () => (
|
|
172
169
|
<div className="u-mb-8">
|
|
173
|
-
<h1 className="u-mb-6 u-text-brand-emphasis u-border-bottom u-pb-2">
|
|
170
|
+
<h1 className="u-mb-6 u-text-brand-emphasis u-border-bottom u-pb-2">
|
|
171
|
+
Common Layout Patterns
|
|
172
|
+
</h1>
|
|
174
173
|
|
|
175
174
|
{/* Sidebar Layout */}
|
|
176
175
|
<div className="u-mb-8">
|
|
@@ -243,9 +242,7 @@ export const LayoutPatterns: Story = {
|
|
|
243
242
|
{/* Article Layout */}
|
|
244
243
|
<div className="u-mb-8">
|
|
245
244
|
<h2 className="u-mb-4 u-text-brand-emphasis">Article Layout</h2>
|
|
246
|
-
<p className="u-mb-4 u-text-secondary-emphasis">
|
|
247
|
-
Centered content with optional sidebar:
|
|
248
|
-
</p>
|
|
245
|
+
<p className="u-mb-4 u-text-secondary-emphasis">Centered content with optional sidebar:</p>
|
|
249
246
|
|
|
250
247
|
<Grid className="u-mb-4">
|
|
251
248
|
<GridCol xs={12} md={8} offsetMd={2}>
|
|
@@ -275,9 +272,7 @@ export const ColumnSizing: Story = {
|
|
|
275
272
|
{/* Fixed Sizes */}
|
|
276
273
|
<div className="u-mb-8">
|
|
277
274
|
<h2 className="u-mb-4 u-text-brand-emphasis">Fixed Column Sizes</h2>
|
|
278
|
-
<p className="u-mb-4 u-text-secondary-emphasis">
|
|
279
|
-
Specify exact column widths (1-12):
|
|
280
|
-
</p>
|
|
275
|
+
<p className="u-mb-4 u-text-secondary-emphasis">Specify exact column widths (1-12):</p>
|
|
281
276
|
|
|
282
277
|
<Grid className="u-mb-4">
|
|
283
278
|
<GridCol xs={2}>
|
|
@@ -384,9 +379,7 @@ export const ColumnOffsets: Story = {
|
|
|
384
379
|
{/* Basic Offsets */}
|
|
385
380
|
<div className="u-mb-8">
|
|
386
381
|
<h2 className="u-mb-4 u-text-brand-emphasis">Basic Offsets</h2>
|
|
387
|
-
<p className="u-mb-4 u-text-secondary-emphasis">
|
|
388
|
-
Push columns to the right using offsets:
|
|
389
|
-
</p>
|
|
382
|
+
<p className="u-mb-4 u-text-secondary-emphasis">Push columns to the right using offsets:</p>
|
|
390
383
|
|
|
391
384
|
<Grid className="u-mb-4">
|
|
392
385
|
<GridCol xs={4}>
|
|
@@ -410,9 +403,7 @@ export const ColumnOffsets: Story = {
|
|
|
410
403
|
{/* Centering */}
|
|
411
404
|
<div className="u-mb-8">
|
|
412
405
|
<h2 className="u-mb-4 u-text-brand-emphasis">Centering Content</h2>
|
|
413
|
-
<p className="u-mb-4 u-text-secondary-emphasis">
|
|
414
|
-
Center columns using equal offsets:
|
|
415
|
-
</p>
|
|
406
|
+
<p className="u-mb-4 u-text-secondary-emphasis">Center columns using equal offsets:</p>
|
|
416
407
|
|
|
417
408
|
<Grid className="u-mb-4">
|
|
418
409
|
<GridCol xs={6} offsetXs={3}>
|
|
@@ -484,9 +475,7 @@ export const Containers: Story = {
|
|
|
484
475
|
<Container type="fluid" className="u-mb-4">
|
|
485
476
|
<DemoCard variant="secondary" height="md">
|
|
486
477
|
<div className="u-fs-lg u-fw-bold">Fluid Container</div>
|
|
487
|
-
<div className="u-fs-sm u-text-secondary-emphasis u-mt-2">
|
|
488
|
-
Full viewport width
|
|
489
|
-
</div>
|
|
478
|
+
<div className="u-fs-sm u-text-secondary-emphasis u-mt-2">Full viewport width</div>
|
|
490
479
|
</DemoCard>
|
|
491
480
|
</Container>
|
|
492
481
|
</div>
|
|
@@ -678,9 +667,7 @@ export const AlignmentAndSpacing: Story = {
|
|
|
678
667
|
{/* No Gutters */}
|
|
679
668
|
<div className="u-mb-8">
|
|
680
669
|
<h2 className="u-mb-4 u-text-brand-emphasis">No Gutters</h2>
|
|
681
|
-
<p className="u-mb-4 u-text-secondary-emphasis">
|
|
682
|
-
Remove spacing between columns:
|
|
683
|
-
</p>
|
|
670
|
+
<p className="u-mb-4 u-text-secondary-emphasis">Remove spacing between columns:</p>
|
|
684
671
|
|
|
685
672
|
<div className="u-mb-6">
|
|
686
673
|
<h3 className="u-mb-3 u-text-secondary-emphasis u-fw-medium">With gutters (default)</h3>
|
|
@@ -21,6 +21,14 @@ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
21
21
|
* No gutters between columns
|
|
22
22
|
*/
|
|
23
23
|
noGutters?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Flex direction
|
|
26
|
+
*/
|
|
27
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
28
|
+
/**
|
|
29
|
+
* Wrap behavior
|
|
30
|
+
*/
|
|
31
|
+
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
/**
|
|
@@ -37,7 +45,10 @@ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
37
45
|
* ```
|
|
38
46
|
*/
|
|
39
47
|
export const Grid = forwardRef<HTMLDivElement, GridProps>(
|
|
40
|
-
(
|
|
48
|
+
(
|
|
49
|
+
{ children, className = '', justifyContent, alignItems, noGutters, direction, wrap, ...props },
|
|
50
|
+
ref
|
|
51
|
+
) => {
|
|
41
52
|
const classes = ['o-grid'];
|
|
42
53
|
|
|
43
54
|
if (justifyContent) {
|
|
@@ -52,6 +63,14 @@ export const Grid = forwardRef<HTMLDivElement, GridProps>(
|
|
|
52
63
|
classes.push('o-grid--no-gutters');
|
|
53
64
|
}
|
|
54
65
|
|
|
66
|
+
if (direction) {
|
|
67
|
+
classes.push(`u-flex-direction-${direction}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (wrap) {
|
|
71
|
+
classes.push(`u-flex-wrap-${wrap}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
55
74
|
if (className) {
|
|
56
75
|
classes.push(className);
|
|
57
76
|
}
|
|
@@ -12,27 +12,27 @@ export interface GridColProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
/**
|
|
13
13
|
* Number of columns to span at extra small breakpoint (default)
|
|
14
14
|
*/
|
|
15
|
-
xs?: number | 'auto';
|
|
15
|
+
xs?: number | 'auto' | boolean;
|
|
16
16
|
/**
|
|
17
17
|
* Number of columns to span at small breakpoint
|
|
18
18
|
*/
|
|
19
|
-
sm?: number | 'auto';
|
|
19
|
+
sm?: number | 'auto' | boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Number of columns to span at medium breakpoint
|
|
22
22
|
*/
|
|
23
|
-
md?: number | 'auto';
|
|
23
|
+
md?: number | 'auto' | boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Number of columns to span at large breakpoint
|
|
26
26
|
*/
|
|
27
|
-
lg?: number | 'auto';
|
|
27
|
+
lg?: number | 'auto' | boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Number of columns to span at extra large breakpoint
|
|
30
30
|
*/
|
|
31
|
-
xl?: number | 'auto';
|
|
31
|
+
xl?: number | 'auto' | boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Number of columns to span at extra extra large breakpoint
|
|
34
34
|
*/
|
|
35
|
-
xxl?: number | 'auto';
|
|
35
|
+
xxl?: number | 'auto' | boolean;
|
|
36
36
|
/**
|
|
37
37
|
* Offset at extra small breakpoint
|
|
38
38
|
*/
|
|
@@ -57,6 +57,22 @@ export interface GridColProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
57
57
|
* Offset at extra extra large breakpoint
|
|
58
58
|
*/
|
|
59
59
|
offsetXxl?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Flex grow property
|
|
62
|
+
*/
|
|
63
|
+
grow?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Flex shrink property
|
|
66
|
+
*/
|
|
67
|
+
shrink?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Flex basis property
|
|
70
|
+
*/
|
|
71
|
+
basis?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Alignment of the column
|
|
74
|
+
*/
|
|
75
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
60
76
|
}
|
|
61
77
|
|
|
62
78
|
/**
|
|
@@ -80,6 +96,10 @@ export const GridCol = forwardRef<HTMLDivElement, GridColProps>(
|
|
|
80
96
|
offsetLg,
|
|
81
97
|
offsetXl,
|
|
82
98
|
offsetXxl,
|
|
99
|
+
grow,
|
|
100
|
+
shrink,
|
|
101
|
+
basis,
|
|
102
|
+
align,
|
|
83
103
|
...props
|
|
84
104
|
},
|
|
85
105
|
ref
|
|
@@ -88,56 +108,47 @@ export const GridCol = forwardRef<HTMLDivElement, GridColProps>(
|
|
|
88
108
|
const isDefaultAuto = !xs && !sm && !md && !lg && !xl && !xxl;
|
|
89
109
|
const classes = isDefaultAuto ? ['o-grid__col', 'o-grid__col--auto'] : ['o-grid__col'];
|
|
90
110
|
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
classes.push(`o-grid__col--${xs}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
111
|
+
// Helper function to process responsive props
|
|
112
|
+
const processResponsiveProp = (
|
|
113
|
+
value: number | 'auto' | boolean | undefined,
|
|
114
|
+
breakpoint: string
|
|
115
|
+
) => {
|
|
116
|
+
if (value === undefined) return;
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
} else {
|
|
106
|
-
classes.push(`o-grid__col--sm-${sm}`);
|
|
118
|
+
// Handle boolean values
|
|
119
|
+
if (value === true) {
|
|
120
|
+
classes.push(breakpoint === 'xs' ? 'o-grid__col--auto' : `o-grid__col--${breakpoint}-auto`);
|
|
121
|
+
return;
|
|
107
122
|
}
|
|
108
|
-
}
|
|
109
123
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
} else {
|
|
114
|
-
classes.push(`o-grid__col--md-${md}`);
|
|
124
|
+
if (value === false) {
|
|
125
|
+
// False means don't apply any class for this breakpoint
|
|
126
|
+
return;
|
|
115
127
|
}
|
|
116
|
-
}
|
|
117
128
|
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
129
|
+
// Handle string/number values
|
|
130
|
+
if (breakpoint === 'xs') {
|
|
131
|
+
if (value === 'auto') {
|
|
132
|
+
classes.push('o-grid__col--auto');
|
|
133
|
+
} else {
|
|
134
|
+
classes.push(`o-grid__col--${value}`);
|
|
135
|
+
}
|
|
121
136
|
} else {
|
|
122
|
-
|
|
137
|
+
if (value === 'auto') {
|
|
138
|
+
classes.push(`o-grid__col--${breakpoint}-auto`);
|
|
139
|
+
} else {
|
|
140
|
+
classes.push(`o-grid__col--${breakpoint}-${value}`);
|
|
141
|
+
}
|
|
123
142
|
}
|
|
124
|
-
}
|
|
143
|
+
};
|
|
125
144
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (xxl) {
|
|
135
|
-
if (xxl === 'auto') {
|
|
136
|
-
classes.push('o-grid__col--xxl-auto');
|
|
137
|
-
} else {
|
|
138
|
-
classes.push(`o-grid__col--xxl-${xxl}`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
145
|
+
// Add column size classes based on the exact SCSS pattern
|
|
146
|
+
processResponsiveProp(xs, 'xs');
|
|
147
|
+
processResponsiveProp(sm, 'sm');
|
|
148
|
+
processResponsiveProp(md, 'md');
|
|
149
|
+
processResponsiveProp(lg, 'lg');
|
|
150
|
+
processResponsiveProp(xl, 'xl');
|
|
151
|
+
processResponsiveProp(xxl, 'xxl');
|
|
141
152
|
|
|
142
153
|
// Add offset classes based on the exact SCSS pattern
|
|
143
154
|
if (offsetXs) classes.push(`o-grid__offset--${offsetXs}`);
|
|
@@ -147,6 +158,23 @@ export const GridCol = forwardRef<HTMLDivElement, GridColProps>(
|
|
|
147
158
|
if (offsetXl) classes.push(`o-grid__offset--xl-${offsetXl}`);
|
|
148
159
|
if (offsetXxl) classes.push(`o-grid__offset--xxl-${offsetXxl}`);
|
|
149
160
|
|
|
161
|
+
// Add flex properties
|
|
162
|
+
if (grow !== undefined) {
|
|
163
|
+
classes.push(grow ? 'u-flex-grow-1' : 'u-flex-grow-0');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (shrink !== undefined) {
|
|
167
|
+
classes.push(shrink ? 'u-flex-shrink-1' : 'u-flex-shrink-0');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (basis) {
|
|
171
|
+
classes.push(`u-flex-basis-${basis}`);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (align) {
|
|
175
|
+
classes.push(`u-align-self-${align}`);
|
|
176
|
+
}
|
|
177
|
+
|
|
150
178
|
if (className) classes.push(className);
|
|
151
179
|
|
|
152
180
|
return (
|