@moises.ai/design-system 4.21.13 → 4.21.14
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/package.json
CHANGED
|
@@ -54,7 +54,9 @@ function isItemSelected(value, itemValue) {
|
|
|
54
54
|
return value === itemValue
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
function gridGap(size) {
|
|
58
|
+
return size === 'medium' || size === 'large' ? 6 : 4
|
|
59
|
+
}
|
|
58
60
|
|
|
59
61
|
const TRACK_MIN = {
|
|
60
62
|
small: 140,
|
|
@@ -87,13 +89,15 @@ function resolveColumns(columns) {
|
|
|
87
89
|
function getGridStyle(orientation, size, columns, rows, itemCount) {
|
|
88
90
|
const min = TRACK_MIN[size] ?? TRACK_MIN.small
|
|
89
91
|
const max = TRACK_MAX[size]
|
|
92
|
+
const gap = gridGap(size)
|
|
90
93
|
const gaps = Math.max(columns - 1, 0)
|
|
91
|
-
const share = `calc((100% - ${
|
|
94
|
+
const share = `calc((100% - ${gap}px * ${gaps}) / ${columns})`
|
|
92
95
|
|
|
93
96
|
if (orientation === 'vertical') {
|
|
94
97
|
const rowCount = Math.max(rows ?? itemCount, 1)
|
|
95
98
|
return {
|
|
96
99
|
display: 'grid',
|
|
100
|
+
gap,
|
|
97
101
|
gridAutoFlow: 'column',
|
|
98
102
|
gridTemplateRows: `repeat(${rowCount}, auto)`,
|
|
99
103
|
gridTemplateColumns: 'unset',
|
|
@@ -111,8 +115,9 @@ function getGridStyle(orientation, size, columns, rows, itemCount) {
|
|
|
111
115
|
flexWrap: 'wrap',
|
|
112
116
|
alignItems: 'stretch',
|
|
113
117
|
justifyContent: 'flex-start',
|
|
118
|
+
gap,
|
|
114
119
|
width: '100%',
|
|
115
|
-
maxWidth: max ? `calc(${max}px * ${columns} + ${
|
|
120
|
+
maxWidth: max ? `calc(${max}px * ${columns} + ${gap}px * ${gaps})` : undefined,
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
123
|
|