boxwood 2.4.4 → 2.4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ui/grid/index.js +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/ui/grid/index.js CHANGED
@@ -24,13 +24,18 @@ function Grid({ className, columns = 3, gap, breakpoint, style }, children) {
24
24
  }),
25
25
  ...(typeof columns === "object" &&
26
26
  Object.keys(columns).reduce((object, key) => {
27
+ const value =
28
+ typeof columns[key] === "number"
29
+ ? `repeat(${columns[key]}, 1fr)`
30
+ : columns[key]
27
31
  if (key === "default") {
28
- object["grid-template-columns"] = columns[key]
32
+ object["grid-template-columns"] = value
29
33
  } else if (typeof key === "string") {
30
- const value =
34
+ const maxWidth =
31
35
  BREAKPOINTS[key] || (key.endsWith("px") ? key : `${key}px`)
32
- object[`@media (max-width: ${value})`] = {
33
- "grid-template-columns": columns[key],
36
+
37
+ object[`@media (max-width: ${maxWidth})`] = {
38
+ "grid-template-columns": value,
34
39
  }
35
40
  }
36
41
  return object