@codesinger0/shared-components 1.1.102 → 1.1.104
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/dist/components/IconGrid.jsx +22 -7
- package/package.json +1 -1
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Users, Monitor, Smartphone, ThumbsUp, Paintbrush } from 'lucide-react';
|
|
3
3
|
|
|
4
|
-
const IconGrid = ({
|
|
4
|
+
const IconGrid = ({
|
|
5
|
+
items = [],
|
|
6
|
+
className = '',
|
|
7
|
+
itemWidth = '',
|
|
8
|
+
itemHeight = '',
|
|
9
|
+
itemMinWidth = '',
|
|
10
|
+
itemMinHeight = '',
|
|
11
|
+
itemMaxWidth = 'max-w-sm',
|
|
12
|
+
itemMaxHeight = ''
|
|
13
|
+
}) => {
|
|
5
14
|
if (!items || items.length === 0) {
|
|
6
15
|
return null;
|
|
7
16
|
}
|
|
@@ -10,7 +19,7 @@ const IconGrid = ({ items = [], className = '' }) => {
|
|
|
10
19
|
const totalItems = items.length;
|
|
11
20
|
const isEven = totalItems % 2 === 0;
|
|
12
21
|
const itemsPerRow = Math.ceil(totalItems / 2);
|
|
13
|
-
|
|
22
|
+
|
|
14
23
|
// Split items into rows
|
|
15
24
|
const topRowCount = isEven ? itemsPerRow : itemsPerRow;
|
|
16
25
|
const topRow = items.slice(0, topRowCount);
|
|
@@ -37,9 +46,9 @@ const IconGrid = ({ items = [], className = '' }) => {
|
|
|
37
46
|
</div>
|
|
38
47
|
|
|
39
48
|
{/* Desktop: Smart grid */}
|
|
40
|
-
<div className="hidden md:block space-y-4 mt-
|
|
49
|
+
<div className="hidden md:block space-y-4 mt-0 mb-0">
|
|
41
50
|
{/* Top row */}
|
|
42
|
-
<div
|
|
51
|
+
<div
|
|
43
52
|
className="grid gap-4 mb-4"
|
|
44
53
|
style={{
|
|
45
54
|
gridTemplateColumns: `repeat(${topRowCount}, 1fr)`,
|
|
@@ -47,7 +56,10 @@ const IconGrid = ({ items = [], className = '' }) => {
|
|
|
47
56
|
}}
|
|
48
57
|
>
|
|
49
58
|
{topRow.map((item, index) => (
|
|
50
|
-
<div
|
|
59
|
+
<div
|
|
60
|
+
key={index}
|
|
61
|
+
className={`w-full ${itemMaxWidth} ${itemWidth} ${itemMinWidth} ${itemHeight} ${itemMinHeight} ${itemMaxHeight}`.trim()}
|
|
62
|
+
>
|
|
51
63
|
<GridItem {...item} />
|
|
52
64
|
</div>
|
|
53
65
|
))}
|
|
@@ -55,7 +67,7 @@ const IconGrid = ({ items = [], className = '' }) => {
|
|
|
55
67
|
|
|
56
68
|
{/* Bottom row - centered if fewer items */}
|
|
57
69
|
{bottomRow.length > 0 && (
|
|
58
|
-
<div
|
|
70
|
+
<div
|
|
59
71
|
className="grid gap-4"
|
|
60
72
|
style={{
|
|
61
73
|
gridTemplateColumns: `repeat(${bottomRow.length}, 1fr)`,
|
|
@@ -65,7 +77,10 @@ const IconGrid = ({ items = [], className = '' }) => {
|
|
|
65
77
|
}}
|
|
66
78
|
>
|
|
67
79
|
{bottomRow.map((item, index) => (
|
|
68
|
-
<div
|
|
80
|
+
<div
|
|
81
|
+
key={index}
|
|
82
|
+
className={`w-full ${itemMaxWidth} ${itemWidth} ${itemMinWidth} ${itemHeight} ${itemMinHeight} ${itemMaxHeight}`.trim()}
|
|
83
|
+
>
|
|
69
84
|
<GridItem {...item} />
|
|
70
85
|
</div>
|
|
71
86
|
))}
|