@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
|
@@ -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 (
|