boxwood 2.4.2 → 2.4.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 - 2024 buxlabs
3
+ Copyright (c) buxlabs
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/index.js CHANGED
@@ -320,7 +320,20 @@ const attributes = (options) => {
320
320
  continue
321
321
  }
322
322
  const result = value[param]
323
- if (result) {
323
+ if (
324
+ (param === "padding" || param === "margin") &&
325
+ typeof result === "object"
326
+ ) {
327
+ const top = result.top || "0"
328
+ const right = result.right || "0"
329
+ const bottom = result.bottom || "0"
330
+ const left = result.left || "0"
331
+ styles.push(
332
+ `${decamelize(param)}:${escapeHTML(
333
+ `${top} ${right} ${bottom} ${left}`
334
+ )}`
335
+ )
336
+ } else if (typeof result === "string" || typeof result === "number") {
324
337
  styles.push(`${decamelize(param)}:${escapeHTML(result)}`)
325
338
  }
326
339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boxwood",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Compile HTML templates into JS",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -48,9 +48,9 @@
48
48
  "devDependencies": {
49
49
  "benchmark": "2.1.4",
50
50
  "c8": "^10.1.3",
51
- "express": "^5.1.0",
51
+ "express": "^5.2.1",
52
52
  "handlebars": "^4.7.8",
53
- "jsdom": "^26.1.0",
53
+ "jsdom": "^27.2.0",
54
54
  "mustache": "^4.2.0",
55
55
  "underscore": "^1.13.7"
56
56
  },
package/ui/grid/index.js CHANGED
@@ -1,6 +1,13 @@
1
1
  const { component, css, Div } = require("../..")
2
2
  const { normalizeGap, normalizeBreakpoint } = require("../normalize")
3
3
 
4
+ const BREAKPOINTS = {
5
+ xl: "1199px",
6
+ lg: "1023px",
7
+ md: "767px",
8
+ sm: "575px",
9
+ }
10
+
4
11
  function Grid({ className, columns = 3, gap, breakpoint, style }, children) {
5
12
  gap = normalizeGap(gap)
6
13
  breakpoint = normalizeBreakpoint(breakpoint)
@@ -19,8 +26,10 @@ function Grid({ className, columns = 3, gap, breakpoint, style }, children) {
19
26
  Object.keys(columns).reduce((object, key) => {
20
27
  if (key === "default") {
21
28
  object["grid-template-columns"] = columns[key]
22
- } else {
23
- object[`@media (min-width: ${key}px)`] = {
29
+ } else if (typeof key === "string") {
30
+ const value =
31
+ BREAKPOINTS[key] || (key.endsWith("px") ? key : `${key}px`)
32
+ object[`@media (max-width: ${value})`] = {
24
33
  "grid-template-columns": columns[key],
25
34
  }
26
35
  }