react-restyle-components 0.4.22 → 0.4.24
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/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts +4 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.js +45 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.js +233 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts +3 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/index.js +2 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts +46 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/types.js +10 -0
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-selected-top-display/auto-complete-filter-multi-select-selected-top-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multi-select-selected-top-display/auto-complete-filter-multi-select-selected-top-display.component.js +40 -3
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +26 -1
- package/lib/src/core-components/src/components/Badge/Badge.d.ts +33 -33
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts +28 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.js +83 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts +44 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.js +370 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.js +3 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts +14 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.js +3 -0
- package/lib/src/core-components/src/components/Button/Button.spec.js +1 -1
- package/lib/src/core-components/src/components/Button/button.component.js +1 -1
- package/lib/src/core-components/src/components/Chip/Chip.d.ts +5 -0
- package/lib/src/core-components/src/components/Chip/Chip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/Chip.js +64 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/elements.js +253 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/index.js +2 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts +54 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/types.js +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/Divider.js +25 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts +22 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/elements.js +103 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/index.js +2 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts +30 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/types.js +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts +6 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.js +147 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts +12 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.js +89 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts +49 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.js +409 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.js +3 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts +173 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.js +28 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts +65 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.js +193 -0
- package/lib/src/core-components/src/components/FormField/FormField.d.ts +1 -1
- package/lib/src/core-components/src/components/Icon/Icon.js +1 -1
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts +7 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.js +73 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts +31 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/elements.js +122 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts +21 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/hooks.js +100 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/index.js +3 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts +117 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/types.js +1 -0
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.d.ts +3 -3
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.js +1 -1
- package/lib/src/core-components/src/components/Picker/color-picker-modal/color-picker-modal.component.js +1 -1
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts +8 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.js +51 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/elements.js +238 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/index.js +2 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts +80 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/types.js +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.js +128 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts +57 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.js +299 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts +3 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/index.js +2 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts +149 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/types.js +3 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts +4 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/Switch.js +26 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/elements.js +167 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/index.js +2 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts +32 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/types.js +3 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts +7 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/Table.js +357 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts +89 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/elements.js +604 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts +23 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/filters.js +181 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts +107 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/hooks.js +451 -0
- package/lib/src/core-components/src/components/Table/index.d.ts +5 -0
- package/lib/src/core-components/src/components/Table/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/index.js +4 -0
- package/lib/src/core-components/src/components/Table/types.d.ts +358 -0
- package/lib/src/core-components/src/components/Table/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/types.js +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts +5 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.js +50 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts +28 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/elements.js +272 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/index.js +2 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts +52 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/types.js +9 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts +7 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.js +200 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts +19 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/elements.js +195 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/index.js +2 -0
- package/lib/src/core-components/src/components/Tooltip/types.d.ts +81 -17
- package/lib/src/core-components/src/components/Tooltip/types.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tooltip/types.js +17 -1
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts +26 -0
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/utils.js +140 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts +5 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.js +303 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts +74 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.js +494 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts +57 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.js +252 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts +4 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/index.js +3 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts +205 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/types.js +1 -0
- package/lib/src/core-components/src/components/index.d.ts +13 -1
- package/lib/src/core-components/src/components/index.d.ts.map +1 -1
- package/lib/src/core-components/src/components/index.js +14 -1
- package/lib/src/core-components/src/core-components/CoreButton/CoreButton.d.ts +2 -2
- package/lib/src/core-components/src/tc.global.css +13 -3
- package/lib/src/core-components/src/tc.module.css +2 -2
- package/package.json +1 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts +0 -29
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts.map +0 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.js +0 -10
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { styled, css, keyframes } from 'styled-components';
|
|
2
|
+
import { breakpoints } from '../../utils/abstracts';
|
|
3
|
+
import { tokens } from '../../utils/designTokens';
|
|
4
|
+
// Animation keyframes
|
|
5
|
+
const fadeIn = keyframes `
|
|
6
|
+
from {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
to {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const slideIn = keyframes `
|
|
14
|
+
from {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
transform: translateY(20px);
|
|
17
|
+
}
|
|
18
|
+
to {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
transform: translateY(0);
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const scaleIn = keyframes `
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: scale(0.9);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
transform: scale(1);
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
const shimmer = keyframes `
|
|
34
|
+
0% {
|
|
35
|
+
background-position: -200% 0;
|
|
36
|
+
}
|
|
37
|
+
100% {
|
|
38
|
+
background-position: 200% 0;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
// Get animation based on type
|
|
42
|
+
const getAnimation = (type, duration) => {
|
|
43
|
+
switch (type) {
|
|
44
|
+
case 'fade':
|
|
45
|
+
return css `
|
|
46
|
+
animation: ${fadeIn} ${duration}ms ease-out forwards;
|
|
47
|
+
`;
|
|
48
|
+
case 'slide':
|
|
49
|
+
return css `
|
|
50
|
+
animation: ${slideIn} ${duration}ms ease-out forwards;
|
|
51
|
+
`;
|
|
52
|
+
case 'scale':
|
|
53
|
+
return css `
|
|
54
|
+
animation: ${scaleIn} ${duration}ms ease-out forwards;
|
|
55
|
+
`;
|
|
56
|
+
default:
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
// Main grid container
|
|
61
|
+
export const GridWrapper = styled.div `
|
|
62
|
+
position: relative;
|
|
63
|
+
width: 100%;
|
|
64
|
+
|
|
65
|
+
/* Variant: contained */
|
|
66
|
+
${({ $variant }) => $variant === 'contained' &&
|
|
67
|
+
css `
|
|
68
|
+
background: linear-gradient(
|
|
69
|
+
135deg,
|
|
70
|
+
${tokens.surface || '#ffffff'} 0%,
|
|
71
|
+
#f8f9fa 100%
|
|
72
|
+
);
|
|
73
|
+
border: 1px solid ${tokens.outline || '#e9ecef'};
|
|
74
|
+
border-radius: ${tokens.borderRadius100 || '8px'};
|
|
75
|
+
padding: ${tokens.spacing200 || '1rem'};
|
|
76
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
77
|
+
`}
|
|
78
|
+
|
|
79
|
+
/* Variant: card */
|
|
80
|
+
${({ $variant }) => $variant === 'card' &&
|
|
81
|
+
css `
|
|
82
|
+
background: ${tokens.surface || '#ffffff'};
|
|
83
|
+
border-radius: ${tokens.borderRadius200 || '16px'};
|
|
84
|
+
padding: ${tokens.spacing300 || '1.5rem'};
|
|
85
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
|
|
86
|
+
`}
|
|
87
|
+
`;
|
|
88
|
+
// Grid container with all layout logic
|
|
89
|
+
export const GridContainer = styled.div `
|
|
90
|
+
display: grid;
|
|
91
|
+
width: 100%;
|
|
92
|
+
gap: ${({ $gap, $rowGap, $columnGap }) => $rowGap || $columnGap
|
|
93
|
+
? `${$rowGap || $gap} ${$columnGap || $gap}`
|
|
94
|
+
: $gap};
|
|
95
|
+
|
|
96
|
+
/* Grid alignment */
|
|
97
|
+
${({ $alignItems }) => $alignItems &&
|
|
98
|
+
css `
|
|
99
|
+
align-items: ${$alignItems};
|
|
100
|
+
`}
|
|
101
|
+
|
|
102
|
+
${({ $justifyItems }) => $justifyItems &&
|
|
103
|
+
css `
|
|
104
|
+
justify-items: ${$justifyItems};
|
|
105
|
+
`}
|
|
106
|
+
|
|
107
|
+
${({ $alignContent }) => $alignContent &&
|
|
108
|
+
css `
|
|
109
|
+
align-content: ${$alignContent};
|
|
110
|
+
`}
|
|
111
|
+
|
|
112
|
+
${({ $justifyContent }) => $justifyContent &&
|
|
113
|
+
css `
|
|
114
|
+
justify-content: ${$justifyContent};
|
|
115
|
+
`}
|
|
116
|
+
|
|
117
|
+
/* Grid template columns */
|
|
118
|
+
${({ $minWidth, $maxWidth, $columns, $autoFit }) => css `
|
|
119
|
+
grid-template-columns: repeat(
|
|
120
|
+
${$autoFit ? 'auto-fit' : $columns},
|
|
121
|
+
minmax(${$minWidth}rem, ${$maxWidth ? `${$maxWidth}rem` : '1fr'})
|
|
122
|
+
);
|
|
123
|
+
`}
|
|
124
|
+
|
|
125
|
+
/* Auto-fit single child centering */
|
|
126
|
+
${({ $autoFit, $columns, $gap }) => $autoFit &&
|
|
127
|
+
css `
|
|
128
|
+
& > *:only-child {
|
|
129
|
+
width: 100%;
|
|
130
|
+
max-width: calc((100% - ${$columns - 1} * ${$gap}) / ${$columns});
|
|
131
|
+
}
|
|
132
|
+
`}
|
|
133
|
+
|
|
134
|
+
/* Max rows limit (hide overflow) */
|
|
135
|
+
${({ $maxRows, $columns, $scroll }) => $maxRows &&
|
|
136
|
+
!$scroll?.enabled &&
|
|
137
|
+
css `
|
|
138
|
+
& > *:nth-child(n + ${$columns * $maxRows + 1}) {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
`}
|
|
142
|
+
|
|
143
|
+
/* Scroll mode */
|
|
144
|
+
${({ $scroll, $minWidth, $columns, $gap, $maxRows }) => $scroll?.enabled &&
|
|
145
|
+
css `
|
|
146
|
+
scroll-behavior: ${$scroll.smoothScroll !== false ? 'smooth' : 'auto'};
|
|
147
|
+
overflow-x: auto;
|
|
148
|
+
scroll-snap-type: x mandatory;
|
|
149
|
+
grid-auto-flow: column;
|
|
150
|
+
-webkit-overflow-scrolling: touch;
|
|
151
|
+
|
|
152
|
+
/* Prevent overflow from hiding focus outline */
|
|
153
|
+
& > *:focus,
|
|
154
|
+
& > li > *:focus {
|
|
155
|
+
outline-offset: -2px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Hide scrollbar if configured */
|
|
159
|
+
${$scroll.hideScrollbar &&
|
|
160
|
+
css `
|
|
161
|
+
scrollbar-width: none;
|
|
162
|
+
-ms-overflow-style: none;
|
|
163
|
+
|
|
164
|
+
&::-webkit-scrollbar {
|
|
165
|
+
display: none;
|
|
166
|
+
height: 0;
|
|
167
|
+
background: transparent;
|
|
168
|
+
}
|
|
169
|
+
`}
|
|
170
|
+
|
|
171
|
+
/* Custom scrollbar styling */
|
|
172
|
+
${!$scroll.hideScrollbar &&
|
|
173
|
+
css `
|
|
174
|
+
scrollbar-width: thin;
|
|
175
|
+
scrollbar-color: ${tokens.outline || '#dee2e6'} transparent;
|
|
176
|
+
|
|
177
|
+
&::-webkit-scrollbar {
|
|
178
|
+
height: 6px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&::-webkit-scrollbar-track {
|
|
182
|
+
background: transparent;
|
|
183
|
+
border-radius: 3px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&::-webkit-scrollbar-thumb {
|
|
187
|
+
background: ${tokens.outline || '#dee2e6'};
|
|
188
|
+
border-radius: 3px;
|
|
189
|
+
|
|
190
|
+
&:hover {
|
|
191
|
+
background: ${tokens.primary || '#454cbf'};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`}
|
|
195
|
+
|
|
196
|
+
grid-template-columns: unset;
|
|
197
|
+
grid-template-rows: repeat(${$maxRows || 1}, max-content);
|
|
198
|
+
grid-auto-columns: max(
|
|
199
|
+
calc(
|
|
200
|
+
(100% - ${$columns + ($scroll.scrollHint || 0) - 1} * ${$gap}) /
|
|
201
|
+
${$columns + ($scroll.scrollHint || 0)}
|
|
202
|
+
),
|
|
203
|
+
${$minWidth}rem
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
& > * {
|
|
207
|
+
scroll-snap-align: ${$scroll.scrollSnapAlign || 'start'};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
& > *:first-child {
|
|
211
|
+
scroll-snap-align: start;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
& > *:last-child {
|
|
215
|
+
scroll-snap-align: end;
|
|
216
|
+
}
|
|
217
|
+
`}
|
|
218
|
+
|
|
219
|
+
/* List item styling */
|
|
220
|
+
& > li {
|
|
221
|
+
display: flex;
|
|
222
|
+
box-sizing: border-box;
|
|
223
|
+
list-style: none;
|
|
224
|
+
|
|
225
|
+
& > * {
|
|
226
|
+
width: 100%;
|
|
227
|
+
height: auto;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
`;
|
|
231
|
+
// Grid item wrapper with animations
|
|
232
|
+
export const GridItem = styled.div `
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
236
|
+
|
|
237
|
+
${({ $colSpan }) => $colSpan &&
|
|
238
|
+
css `
|
|
239
|
+
grid-column: span ${$colSpan};
|
|
240
|
+
`}
|
|
241
|
+
|
|
242
|
+
${({ $rowSpan }) => $rowSpan &&
|
|
243
|
+
css `
|
|
244
|
+
grid-row: span ${$rowSpan};
|
|
245
|
+
`}
|
|
246
|
+
|
|
247
|
+
${({ $order }) => $order !== undefined &&
|
|
248
|
+
css `
|
|
249
|
+
order: ${$order};
|
|
250
|
+
`}
|
|
251
|
+
|
|
252
|
+
${({ $alignSelf }) => $alignSelf &&
|
|
253
|
+
css `
|
|
254
|
+
align-self: ${$alignSelf};
|
|
255
|
+
`}
|
|
256
|
+
|
|
257
|
+
${({ $justifySelf }) => $justifySelf &&
|
|
258
|
+
css `
|
|
259
|
+
justify-self: ${$justifySelf};
|
|
260
|
+
`}
|
|
261
|
+
|
|
262
|
+
${({ $borderRadius }) => $borderRadius &&
|
|
263
|
+
css `
|
|
264
|
+
border-radius: ${$borderRadius};
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
`}
|
|
267
|
+
|
|
268
|
+
${({ $padding }) => $padding &&
|
|
269
|
+
css `
|
|
270
|
+
padding: ${$padding};
|
|
271
|
+
`}
|
|
272
|
+
|
|
273
|
+
${({ $aspectRatio }) => $aspectRatio &&
|
|
274
|
+
css `
|
|
275
|
+
aspect-ratio: ${$aspectRatio};
|
|
276
|
+
`}
|
|
277
|
+
|
|
278
|
+
/* Animation */
|
|
279
|
+
${({ $animation, $animationIndex = 0 }) => $animation?.enabled &&
|
|
280
|
+
$animation.type !== 'none' &&
|
|
281
|
+
css `
|
|
282
|
+
opacity: 0;
|
|
283
|
+
animation-delay: ${$animationIndex * ($animation.staggerDelay || 50)}ms;
|
|
284
|
+
${getAnimation($animation.type, $animation.duration || 300)}
|
|
285
|
+
`}
|
|
286
|
+
|
|
287
|
+
& > * {
|
|
288
|
+
width: 100%;
|
|
289
|
+
height: 100%;
|
|
290
|
+
}
|
|
291
|
+
`;
|
|
292
|
+
// Skeleton loader
|
|
293
|
+
export const SkeletonItem = styled.div `
|
|
294
|
+
background: linear-gradient(
|
|
295
|
+
90deg,
|
|
296
|
+
${tokens.surface || '#f0f0f0'} 25%,
|
|
297
|
+
#e8e8e8 50%,
|
|
298
|
+
${tokens.surface || '#f0f0f0'} 75%
|
|
299
|
+
);
|
|
300
|
+
background-size: 200% 100%;
|
|
301
|
+
animation: ${shimmer} 1.5s infinite;
|
|
302
|
+
border-radius: ${({ $borderRadius }) => $borderRadius || tokens.borderRadius100 || '8px'};
|
|
303
|
+
min-height: 100px;
|
|
304
|
+
|
|
305
|
+
${({ $aspectRatio }) => $aspectRatio &&
|
|
306
|
+
css `
|
|
307
|
+
aspect-ratio: ${$aspectRatio};
|
|
308
|
+
`}
|
|
309
|
+
`;
|
|
310
|
+
// Empty state container
|
|
311
|
+
export const EmptyState = styled.div `
|
|
312
|
+
grid-column: 1 / -1;
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: center;
|
|
317
|
+
padding: ${tokens.spacing400 || '2rem'};
|
|
318
|
+
text-align: center;
|
|
319
|
+
color: ${tokens.onSurface ? `${tokens.onSurface}80` : '#6c757d'};
|
|
320
|
+
|
|
321
|
+
svg {
|
|
322
|
+
width: 64px;
|
|
323
|
+
height: 64px;
|
|
324
|
+
margin-bottom: ${tokens.spacing200 || '1rem'};
|
|
325
|
+
opacity: 0.5;
|
|
326
|
+
}
|
|
327
|
+
`;
|
|
328
|
+
// Navigation arrows for scroll mode
|
|
329
|
+
export const ScrollArrow = styled.button `
|
|
330
|
+
position: absolute;
|
|
331
|
+
top: 50%;
|
|
332
|
+
${({ $direction }) => ($direction === 'left' ? 'left: -16px;' : 'right: -16px;')}
|
|
333
|
+
transform: translateY(-50%);
|
|
334
|
+
width: 40px;
|
|
335
|
+
height: 40px;
|
|
336
|
+
border-radius: 50%;
|
|
337
|
+
background: ${tokens.surface || '#ffffff'};
|
|
338
|
+
border: 1px solid ${tokens.outline || '#e9ecef'};
|
|
339
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
color: ${tokens.onSurface || '#1a1a2e'};
|
|
345
|
+
opacity: ${({ $visible }) => ($visible ? 1 : 0)};
|
|
346
|
+
visibility: ${({ $visible }) => ($visible ? 'visible' : 'hidden')};
|
|
347
|
+
transition: all 0.2s ease;
|
|
348
|
+
z-index: 10;
|
|
349
|
+
|
|
350
|
+
&:hover {
|
|
351
|
+
background: ${tokens.primary || '#454cbf'};
|
|
352
|
+
color: ${tokens.white || '#ffffff'};
|
|
353
|
+
border-color: ${tokens.primary || '#454cbf'};
|
|
354
|
+
transform: translateY(-50%) scale(1.05);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&:focus-visible {
|
|
358
|
+
outline: 2px solid ${tokens.primary || '#454cbf'};
|
|
359
|
+
outline-offset: 2px;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
&:disabled {
|
|
363
|
+
opacity: 0.3;
|
|
364
|
+
cursor: not-allowed;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* Hide on mobile */
|
|
368
|
+
${breakpoints.xs} {
|
|
369
|
+
display: none;
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
// Pagination dots for scroll mode
|
|
373
|
+
export const ScrollDots = styled.div `
|
|
374
|
+
display: flex;
|
|
375
|
+
justify-content: center;
|
|
376
|
+
gap: ${tokens.spacing100 || '0.5rem'};
|
|
377
|
+
margin-top: ${tokens.spacing200 || '1rem'};
|
|
378
|
+
`;
|
|
379
|
+
export const ScrollDot = styled.button `
|
|
380
|
+
width: 8px;
|
|
381
|
+
height: 8px;
|
|
382
|
+
border-radius: 50%;
|
|
383
|
+
border: none;
|
|
384
|
+
background: ${({ $active }) => $active ? tokens.primary || '#454cbf' : tokens.outline || '#dee2e6'};
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
transition: all 0.2s ease;
|
|
387
|
+
padding: 0;
|
|
388
|
+
|
|
389
|
+
&:hover {
|
|
390
|
+
background: ${tokens.primary || '#454cbf'};
|
|
391
|
+
transform: scale(1.2);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
&:focus-visible {
|
|
395
|
+
outline: 2px solid ${tokens.primary || '#454cbf'};
|
|
396
|
+
outline-offset: 2px;
|
|
397
|
+
}
|
|
398
|
+
`;
|
|
399
|
+
// Loading overlay
|
|
400
|
+
export const LoadingOverlay = styled.div `
|
|
401
|
+
position: absolute;
|
|
402
|
+
inset: 0;
|
|
403
|
+
background: rgba(255, 255, 255, 0.8);
|
|
404
|
+
display: flex;
|
|
405
|
+
align-items: center;
|
|
406
|
+
justify-content: center;
|
|
407
|
+
border-radius: inherit;
|
|
408
|
+
z-index: 20;
|
|
409
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/DynamicGrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC3E,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const GAP_SIZES: readonly ["none", "xs", "sm", "md", "lg", "xl", "2xl"];
|
|
3
|
+
export type GapSize = (typeof GAP_SIZES)[number];
|
|
4
|
+
export declare const gapSizeValues: Record<GapSize, string>;
|
|
5
|
+
export type LegacyGapSize = 0 | 1 | 2 | 3 | 4;
|
|
6
|
+
export declare const gapSizes: Record<LegacyGapSize, string>;
|
|
7
|
+
export declare const GRID_VARIANTS: readonly ["default", "contained", "card", "masonry"];
|
|
8
|
+
export type GridVariant = (typeof GRID_VARIANTS)[number];
|
|
9
|
+
export declare const GRID_ALIGNMENTS: readonly ["start", "center", "end", "stretch"];
|
|
10
|
+
export type GridAlignment = (typeof GRID_ALIGNMENTS)[number];
|
|
11
|
+
export declare const GRID_JUSTIFY: readonly ["start", "center", "end", "space-between", "space-around", "space-evenly"];
|
|
12
|
+
export type GridJustify = (typeof GRID_JUSTIFY)[number];
|
|
13
|
+
export declare const SCROLL_SNAP_TYPES: readonly ["start", "center", "end"];
|
|
14
|
+
export type ScrollSnapType = (typeof SCROLL_SNAP_TYPES)[number];
|
|
15
|
+
export declare const GRID_ROLES: readonly ["none", "list", "grid"];
|
|
16
|
+
export type GridRole = (typeof GRID_ROLES)[number];
|
|
17
|
+
export interface ResponsiveColumns {
|
|
18
|
+
/** Columns for extra small screens (< 375px) */
|
|
19
|
+
xs?: number;
|
|
20
|
+
/** Columns for small screens (≥ 375px) */
|
|
21
|
+
sm?: number;
|
|
22
|
+
/** Columns for medium screens (≥ 768px) */
|
|
23
|
+
md?: number;
|
|
24
|
+
/** Columns for large screens (≥ 1024px) */
|
|
25
|
+
lg?: number;
|
|
26
|
+
/** Columns for extra large screens (≥ 1280px) */
|
|
27
|
+
xl?: number;
|
|
28
|
+
/** Columns for 2xl screens (≥ 1440px) */
|
|
29
|
+
'2xl'?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ScrollConfig {
|
|
32
|
+
/** Enable horizontal scroll mode */
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/** Amount of next item visible as scroll hint (0-1) */
|
|
35
|
+
scrollHint?: number;
|
|
36
|
+
/** Hide the scrollbar */
|
|
37
|
+
hideScrollbar?: boolean;
|
|
38
|
+
/** Scroll snap alignment */
|
|
39
|
+
scrollSnapAlign?: ScrollSnapType;
|
|
40
|
+
/** Enable smooth scrolling */
|
|
41
|
+
smoothScroll?: boolean;
|
|
42
|
+
/** Show navigation arrows */
|
|
43
|
+
showArrows?: boolean;
|
|
44
|
+
/** Show pagination dots */
|
|
45
|
+
showDots?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface AnimationConfig {
|
|
48
|
+
/** Enable item animations */
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/** Animation type */
|
|
51
|
+
type?: 'fade' | 'slide' | 'scale' | 'none';
|
|
52
|
+
/** Animation duration in ms */
|
|
53
|
+
duration?: number;
|
|
54
|
+
/** Stagger delay between items in ms */
|
|
55
|
+
staggerDelay?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface GridItemConfig {
|
|
58
|
+
/** Minimum width of each item (in rem) */
|
|
59
|
+
minWidth?: number;
|
|
60
|
+
/** Maximum width of each item (in rem) */
|
|
61
|
+
maxWidth?: number;
|
|
62
|
+
/** Aspect ratio (e.g., '16/9', '1/1', '4/3') */
|
|
63
|
+
aspectRatio?: string;
|
|
64
|
+
/** Item padding */
|
|
65
|
+
padding?: string;
|
|
66
|
+
/** Item border radius */
|
|
67
|
+
borderRadius?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface DynamicGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
70
|
+
/** Children elements */
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
/** Minimum width of grid items (in rem) */
|
|
73
|
+
minWidth?: number;
|
|
74
|
+
/** Maximum width of grid items (in rem) */
|
|
75
|
+
maxWidth?: number;
|
|
76
|
+
/** Fixed number of columns (overrides responsive) */
|
|
77
|
+
columns?: number;
|
|
78
|
+
/** Responsive column configuration */
|
|
79
|
+
responsiveColumns?: ResponsiveColumns;
|
|
80
|
+
/** Maximum number of columns */
|
|
81
|
+
maxColumns?: number;
|
|
82
|
+
/** Maximum number of rows to display */
|
|
83
|
+
maxRows?: number;
|
|
84
|
+
/** Use auto-fit for flexible column sizing */
|
|
85
|
+
autoFit?: boolean;
|
|
86
|
+
/** Column modulo (columns must be divisible by this) */
|
|
87
|
+
modulo?: number;
|
|
88
|
+
/** Gap between items */
|
|
89
|
+
gap?: GapSize | LegacyGapSize;
|
|
90
|
+
/** Row gap (overrides gap for rows) */
|
|
91
|
+
rowGap?: GapSize;
|
|
92
|
+
/** Column gap (overrides gap for columns) */
|
|
93
|
+
columnGap?: GapSize;
|
|
94
|
+
/** Visual variant */
|
|
95
|
+
variant?: GridVariant;
|
|
96
|
+
/** Item alignment */
|
|
97
|
+
alignItems?: GridAlignment;
|
|
98
|
+
/** Item justification */
|
|
99
|
+
justifyItems?: GridAlignment;
|
|
100
|
+
/** Content alignment */
|
|
101
|
+
alignContent?: GridAlignment;
|
|
102
|
+
/** Content justification */
|
|
103
|
+
justifyContent?: GridJustify;
|
|
104
|
+
/** Scroll configuration */
|
|
105
|
+
scroll?: ScrollConfig;
|
|
106
|
+
/** @deprecated Use scroll.enabled instead */
|
|
107
|
+
scrollEnabled?: boolean;
|
|
108
|
+
/** Animation configuration */
|
|
109
|
+
animation?: AnimationConfig;
|
|
110
|
+
/** Grid item configuration */
|
|
111
|
+
itemConfig?: GridItemConfig;
|
|
112
|
+
/** ARIA role for the grid */
|
|
113
|
+
role?: GridRole;
|
|
114
|
+
/** @deprecated Use role instead */
|
|
115
|
+
elementRole?: GridRole;
|
|
116
|
+
/** ARIA label */
|
|
117
|
+
ariaLabel?: string;
|
|
118
|
+
/** Loading state */
|
|
119
|
+
isLoading?: boolean;
|
|
120
|
+
/** Number of skeleton items to show when loading */
|
|
121
|
+
skeletonCount?: number;
|
|
122
|
+
/** Custom skeleton component */
|
|
123
|
+
renderSkeleton?: () => React.ReactNode;
|
|
124
|
+
/** Empty state content */
|
|
125
|
+
emptyState?: React.ReactNode;
|
|
126
|
+
/** Called when grid layout changes */
|
|
127
|
+
onLayoutChange?: (columns: number, rows: number) => void;
|
|
128
|
+
/** Called when scroll position changes */
|
|
129
|
+
onScrollChange?: (scrollLeft: number, scrollWidth: number) => void;
|
|
130
|
+
/** Additional class name */
|
|
131
|
+
className?: string;
|
|
132
|
+
/** Custom styles */
|
|
133
|
+
style?: React.CSSProperties;
|
|
134
|
+
/** Container class name */
|
|
135
|
+
containerClassName?: string;
|
|
136
|
+
/** Item wrapper class name */
|
|
137
|
+
itemClassName?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface GridContextValue {
|
|
140
|
+
columns: number;
|
|
141
|
+
gap: string;
|
|
142
|
+
variant: GridVariant;
|
|
143
|
+
itemConfig?: GridItemConfig;
|
|
144
|
+
}
|
|
145
|
+
export interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
146
|
+
/** Span multiple columns */
|
|
147
|
+
colSpan?: number;
|
|
148
|
+
/** Span multiple rows */
|
|
149
|
+
rowSpan?: number;
|
|
150
|
+
/** Order in the grid */
|
|
151
|
+
order?: number;
|
|
152
|
+
/** Self alignment */
|
|
153
|
+
alignSelf?: GridAlignment;
|
|
154
|
+
/** Self justification */
|
|
155
|
+
justifySelf?: GridAlignment;
|
|
156
|
+
}
|
|
157
|
+
export interface ScrollProps {
|
|
158
|
+
/** Enable horizontal scroll mode */
|
|
159
|
+
enabled?: boolean;
|
|
160
|
+
/** Amount of next item visible as scroll hint (0-1) */
|
|
161
|
+
scrollHint?: number;
|
|
162
|
+
/** Hide the scrollbar */
|
|
163
|
+
hideScrollbar?: boolean;
|
|
164
|
+
/** Scroll snap alignment */
|
|
165
|
+
scrollSnapAlign?: ScrollSnapType;
|
|
166
|
+
/** Enable smooth scrolling */
|
|
167
|
+
smoothScroll?: boolean;
|
|
168
|
+
/** Show navigation arrows */
|
|
169
|
+
showArrows?: boolean;
|
|
170
|
+
/** Show pagination dots */
|
|
171
|
+
showDots?: boolean;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/DynamicGrid/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,SAAS,wDAAyD,CAAC;AAChF,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAQjD,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9C,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAMlD,CAAC;AAGF,eAAO,MAAM,aAAa,sDAAuD,CAAC;AAClF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAGzD,eAAO,MAA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AAC,EAAE,MAAM,CAAC;IAC5B,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAGD,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,yBAAyB;IACzB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAGD,MAAM,WAAW,WAAW;IAC1B,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,8BAA8B;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Gap sizes with semantic naming
|
|
2
|
+
export const GAP_SIZES = ['none', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'];
|
|
3
|
+
export const gapSizeValues = {
|
|
4
|
+
none: '0',
|
|
5
|
+
xs: '0.25rem',
|
|
6
|
+
sm: '0.5rem',
|
|
7
|
+
md: '0.75rem',
|
|
8
|
+
lg: '1rem',
|
|
9
|
+
xl: '1.5rem',
|
|
10
|
+
'2xl': '2rem', // 32px
|
|
11
|
+
};
|
|
12
|
+
export const gapSizes = {
|
|
13
|
+
0: '0.5rem',
|
|
14
|
+
1: '0.75rem',
|
|
15
|
+
2: '1rem',
|
|
16
|
+
3: '1.5rem',
|
|
17
|
+
4: '2rem',
|
|
18
|
+
};
|
|
19
|
+
// Grid variants
|
|
20
|
+
export const GRID_VARIANTS = ['default', 'contained', 'card', 'masonry'];
|
|
21
|
+
// Grid alignment options
|
|
22
|
+
export const GRID_ALIGNMENTS = ['start', 'center', 'end', 'stretch'];
|
|
23
|
+
// Grid justify options
|
|
24
|
+
export const GRID_JUSTIFY = ['start', 'center', 'end', 'space-between', 'space-around', 'space-evenly'];
|
|
25
|
+
// Scroll snap types
|
|
26
|
+
export const SCROLL_SNAP_TYPES = ['start', 'center', 'end'];
|
|
27
|
+
// Grid role types
|
|
28
|
+
export const GRID_ROLES = ['none', 'list', 'grid'];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { ResponsiveColumns, GapSize, LegacyGapSize, ScrollConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Convert pixels to rem
|
|
5
|
+
*/
|
|
6
|
+
export declare const pxToRem: (px: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
* Convert rem to pixels
|
|
9
|
+
*/
|
|
10
|
+
export declare const remToPx: (rem: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Get gap value from GapSize or LegacyGapSize
|
|
13
|
+
*/
|
|
14
|
+
export declare const getGapValue: (gap: GapSize | LegacyGapSize) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate columns based on container width and configuration
|
|
17
|
+
*/
|
|
18
|
+
interface CalcColumnsConfig {
|
|
19
|
+
minWidth: number;
|
|
20
|
+
elementWidth: number;
|
|
21
|
+
gap: string;
|
|
22
|
+
modulo: number;
|
|
23
|
+
maxColumns: number;
|
|
24
|
+
scrollHint?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const calcColumns: ({ minWidth, elementWidth, gap, modulo, maxColumns, scrollHint, }: CalcColumnsConfig) => number;
|
|
27
|
+
/**
|
|
28
|
+
* Get responsive columns based on window width
|
|
29
|
+
*/
|
|
30
|
+
export declare const getResponsiveColumns: (responsiveColumns: ResponsiveColumns, windowWidth: number) => number;
|
|
31
|
+
/**
|
|
32
|
+
* Hook to get current window width
|
|
33
|
+
*/
|
|
34
|
+
export declare const useWindowWidth: () => number;
|
|
35
|
+
/**
|
|
36
|
+
* Hook to observe element resize
|
|
37
|
+
*/
|
|
38
|
+
export declare const useElementResize: (ref: RefObject<HTMLElement>, callback: (width: number, height: number) => void) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Hook to handle keyboard focus scrolling in scroll mode
|
|
41
|
+
*/
|
|
42
|
+
export declare const useScrollToKeyboardFocus: (ref: RefObject<HTMLElement>, scroll?: ScrollConfig) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Hook for scroll navigation (arrows and dots)
|
|
45
|
+
*/
|
|
46
|
+
interface UseScrollNavigationReturn {
|
|
47
|
+
canScrollLeft: boolean;
|
|
48
|
+
canScrollRight: boolean;
|
|
49
|
+
currentPage: number;
|
|
50
|
+
totalPages: number;
|
|
51
|
+
scrollTo: (index: number) => void;
|
|
52
|
+
scrollLeft: () => void;
|
|
53
|
+
scrollRight: () => void;
|
|
54
|
+
}
|
|
55
|
+
export declare const useScrollNavigation: (ref: RefObject<HTMLElement>, itemCount: number, columns: number) => UseScrollNavigationReturn;
|
|
56
|
+
/**
|
|
57
|
+
* Get item count from children
|
|
58
|
+
*/
|
|
59
|
+
export declare const getItemCount: (children: React.ReactNode) => number;
|
|
60
|
+
/**
|
|
61
|
+
* Generate unique ID for accessibility
|
|
62
|
+
*/
|
|
63
|
+
export declare const generateGridId: () => string;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=utils.d.ts.map
|