@aurora-ds/components 0.17.15 → 0.17.16

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/cjs/index.js CHANGED
@@ -1900,7 +1900,7 @@ Card.displayName = 'Card';
1900
1900
  * - auto-fill: keeps empty column tracks, items don't stretch to fill container
1901
1901
  * - auto-fit: collapses empty tracks, items stretch to fill available space
1902
1902
  */
1903
- const getGridTemplateColumns = (columns, minChildWidth) => {
1903
+ const getGridTemplateColumns = (columns, minChildWidth, columnGap) => {
1904
1904
  const minWidthValue = typeof minChildWidth === 'number' ? `${minChildWidth}px` : minChildWidth;
1905
1905
  if (minChildWidth && typeof columns === 'number') {
1906
1906
  // Responsive grid with max columns limit
@@ -1908,7 +1908,8 @@ const getGridTemplateColumns = (columns, minChildWidth) => {
1908
1908
  // The min value ensures items are at least minChildWidth
1909
1909
  // The max value is 1fr to distribute space evenly within the max columns constraint
1910
1910
  // The calc ensures we never exceed the specified number of columns
1911
- const minColumnWidth = `calc((100% - ${columns - 1} * var(--grid-gap, 0px)) / ${columns})`;
1911
+ const gapValue = columnGap || '0px';
1912
+ const minColumnWidth = `calc((100% - (${columns} - 1) * ${gapValue}) / ${columns})`;
1912
1913
  return `repeat(auto-fill, minmax(max(${minWidthValue}, ${minColumnWidth}), 1fr))`;
1913
1914
  }
1914
1915
  if (minChildWidth) {
@@ -1934,13 +1935,15 @@ const getGridTemplateRows = (rows) => {
1934
1935
  * Grid styles using createStyles from @aurora-ds/theme
1935
1936
  */
1936
1937
  const GRID_STYLES = theme.createStyles((theme) => ({
1937
- root: ({ columns, rows, columnGap = 'md', rowGap = 'md', width, height, minHeight, alignItems, justifyItems, alignContent, justifyContent, padding, minChildWidth, }) => {
1938
+ root: ({ columns, rows, columnGap, rowGap, width, height, minHeight, alignItems, justifyItems, alignContent, justifyContent, padding, minChildWidth, }) => {
1939
+ const columnGapValue = columnGap ? theme.spacing[columnGap] : undefined;
1940
+ const rowGapValue = rowGap ? theme.spacing[rowGap] : undefined;
1938
1941
  return {
1939
1942
  display: 'grid',
1940
- gridTemplateColumns: getGridTemplateColumns(columns, minChildWidth),
1943
+ gridTemplateColumns: getGridTemplateColumns(columns, minChildWidth, columnGapValue),
1941
1944
  gridTemplateRows: getGridTemplateRows(rows),
1942
- columnGap: theme.spacing[columnGap],
1943
- rowGap: theme.spacing[rowGap],
1945
+ columnGap: columnGapValue,
1946
+ rowGap: rowGapValue,
1944
1947
  width,
1945
1948
  height,
1946
1949
  minHeight,
@@ -1964,7 +1967,7 @@ const GRID_STYLES = theme.createStyles((theme) => ({
1964
1967
  * - Use `minChildWidth` for responsive auto-fill grids
1965
1968
  * - Combine `columns` + `minChildWidth` for responsive grid with max columns limit
1966
1969
  */
1967
- const Grid = ({ children, columns = 1, rows, columnGap, rowGap, width, height, minHeight, alignItems, justifyItems, alignContent, justifyContent, padding, minChildWidth, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
1970
+ const Grid = ({ children, columns = 1, rows, columnGap = 'md', rowGap = 'md', width, height, minHeight, alignItems, justifyItems, alignContent, justifyContent, padding, minChildWidth, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
1968
1971
  return (jsxRuntime.jsx("div", { className: GRID_STYLES.root({
1969
1972
  columns,
1970
1973
  rows,