boxwood 2.3.0 → 2.4.2
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/index.js +1 -1
- package/package.json +1 -1
- package/ui/center/index.js +25 -0
- package/ui/index.js +2 -0
- package/utilities/hash.js +7 -3
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { css, component, Div } = require("../..")
|
|
2
|
+
|
|
3
|
+
function Center({ className, style, height, width } = {}, children) {
|
|
4
|
+
const styleObject = {
|
|
5
|
+
display: "flex",
|
|
6
|
+
"justify-content": "center",
|
|
7
|
+
"align-items": "center",
|
|
8
|
+
"flex-direction": "column",
|
|
9
|
+
width: width || "100%",
|
|
10
|
+
height: height || "100dvh",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const styles = css`
|
|
14
|
+
.center {
|
|
15
|
+
${css.create(styleObject).toString()}
|
|
16
|
+
}
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
return [
|
|
20
|
+
Div({ className: [className, styles.center], style }, children),
|
|
21
|
+
styles.css,
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = component(Center)
|
package/ui/index.js
CHANGED
package/utilities/hash.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
if (!global.__boxwood_index__) {
|
|
2
|
+
global.__boxwood_index__ = 0
|
|
3
|
+
}
|
|
4
|
+
|
|
2
5
|
const map = new Map()
|
|
3
6
|
|
|
4
7
|
function createHash(string) {
|
|
5
8
|
if (map.has(string)) {
|
|
6
9
|
return map.get(string)
|
|
7
10
|
}
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
|
|
12
|
+
global.__boxwood_index__++
|
|
13
|
+
const hash = "c" + global.__boxwood_index__
|
|
10
14
|
map.set(string, hash)
|
|
11
15
|
return hash
|
|
12
16
|
}
|