@grucloud/bau-ui 0.26.0 → 0.28.0
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/avatar/avatar.js +2 -12
- package/button/button.js +1 -1
- package/drawer/drawer.js +2 -8
- package/globalStyle/globalStyle.js +4 -2
- package/modal/modal.js +1 -1
- package/package.json +4 -4
- package/tabs/tabs.js +6 -16
- package/treeView/treeView.js +13 -16
package/avatar/avatar.js
CHANGED
|
@@ -17,18 +17,8 @@ export default function (context, options = {}) {
|
|
|
17
17
|
return function Avatar({ width = 60, height = 60, ...props }, ...children) {
|
|
18
18
|
return span(
|
|
19
19
|
{ class: classNames(options.cssOverride, props.class) },
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
render: () => (loading) => {
|
|
23
|
-
if (loading) {
|
|
24
|
-
return "Loading...";
|
|
25
|
-
} else return "";
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
bau.bind({
|
|
29
|
-
deps: [errorState],
|
|
30
|
-
render: () => (error) => error ? "Error" : "",
|
|
31
|
-
}),
|
|
20
|
+
() => (loadingState.val ? "Loading..." : ""),
|
|
21
|
+
() => errorState.val && "Error",
|
|
32
22
|
img({ width, height, onload, onerror, ...props })
|
|
33
23
|
);
|
|
34
24
|
};
|
package/button/button.js
CHANGED
package/drawer/drawer.js
CHANGED
|
@@ -52,10 +52,7 @@ export default function (context) {
|
|
|
52
52
|
{ class: cn(style, otherProps.class) },
|
|
53
53
|
// Overlay
|
|
54
54
|
div({
|
|
55
|
-
class:
|
|
56
|
-
deps: [openState],
|
|
57
|
-
renderProp: () => (open) => cn("overlay", open && "overlay-open"),
|
|
58
|
-
},
|
|
55
|
+
class: () => cn("overlay", openState.val && "overlay-open"),
|
|
59
56
|
onclick: () => {
|
|
60
57
|
openState.val = false;
|
|
61
58
|
},
|
|
@@ -63,10 +60,7 @@ export default function (context) {
|
|
|
63
60
|
// Content
|
|
64
61
|
div(
|
|
65
62
|
{
|
|
66
|
-
class:
|
|
67
|
-
deps: [openState],
|
|
68
|
-
renderProp: () => (open) => cn("content", open && "content-open"),
|
|
69
|
-
},
|
|
63
|
+
class: () => cn("content", openState.val && "content-open"),
|
|
70
64
|
},
|
|
71
65
|
...children
|
|
72
66
|
)
|
|
@@ -73,7 +73,7 @@ export default function globalStyle(
|
|
|
73
73
|
${buildEmphasis()}
|
|
74
74
|
--color-content: hsl(0, 0%, 10%);
|
|
75
75
|
--color-content-inverse: hsl(0, 0%, 90%);
|
|
76
|
-
--color-content-secondary:
|
|
76
|
+
--color-content-secondary: hsl(0, 0%, 30%);
|
|
77
77
|
--background-color: var(--color-white);
|
|
78
78
|
--background-surface-color: var(--color-content-inverse);
|
|
79
79
|
--global-border-width: 1px;
|
|
@@ -97,12 +97,14 @@ export default function globalStyle(
|
|
|
97
97
|
--global-shadow-md: 0 5px 40px rgba(0, 0, 0, 0.2);
|
|
98
98
|
--global-shadow-tl: 0 12px 28px 0 rgba(0, 0, 0, 0.2),
|
|
99
99
|
0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
|
100
|
+
--font-size-base: 100%;
|
|
101
|
+
--line-height-base: 1.65;
|
|
100
102
|
}
|
|
101
|
-
@custom-media --narrow-window (max-width: 996px);
|
|
102
103
|
:root {
|
|
103
104
|
font-family: var(--font-family);
|
|
104
105
|
color-scheme: var(--color-scheme);
|
|
105
106
|
color: var(--color-content);
|
|
107
|
+
font: var(--font-size-base) / var(--line-height-base) var(--font-family)
|
|
106
108
|
}
|
|
107
109
|
body {
|
|
108
110
|
margin: 0;
|
package/modal/modal.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grucloud/bau-ui",
|
|
3
3
|
"description": "Components library built with Bau",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD",
|
|
7
7
|
"keywords": [
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"url": "git@github.com:grucloud/bau.git"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@grucloud/bau": "^0.
|
|
21
|
-
"@grucloud/bau-css": "^0.
|
|
20
|
+
"@grucloud/bau": "^0.28.0",
|
|
21
|
+
"@grucloud/bau-css": "^0.28.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "2084471d726ce1b9e9987f559db5e16723eae7b4"
|
|
24
24
|
}
|
package/tabs/tabs.js
CHANGED
|
@@ -79,15 +79,11 @@ export default function (context, { tabDefs }) {
|
|
|
79
79
|
const { Header, disabled, name } = tab;
|
|
80
80
|
return li(
|
|
81
81
|
{
|
|
82
|
-
class:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
disabled && "disabled"
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
},
|
|
82
|
+
class: () =>
|
|
83
|
+
classNames(
|
|
84
|
+
tabCurrentState.val.name == name && "active",
|
|
85
|
+
disabled && "disabled"
|
|
86
|
+
),
|
|
91
87
|
onclick: (event) =>
|
|
92
88
|
event.srcElement.dispatchEvent(
|
|
93
89
|
new CustomEvent("tab.select", {
|
|
@@ -112,13 +108,7 @@ export default function (context, { tabDefs }) {
|
|
|
112
108
|
renderItem: () => TabHeader,
|
|
113
109
|
}),
|
|
114
110
|
// Content
|
|
115
|
-
|
|
116
|
-
deps: [tabCurrentState],
|
|
117
|
-
render:
|
|
118
|
-
() =>
|
|
119
|
-
({ Content }) =>
|
|
120
|
-
Content ? Content({}) : "",
|
|
121
|
-
})
|
|
111
|
+
() => (tabCurrentState.val.Content ? tabCurrentState.val.Content({}) : "")
|
|
122
112
|
);
|
|
123
113
|
|
|
124
114
|
rootEl.addEventListener(
|
package/treeView/treeView.js
CHANGED
|
@@ -49,7 +49,6 @@ const createStyles = ({ css, createGlobalStyles }) => {
|
|
|
49
49
|
&::before {
|
|
50
50
|
transition: transform var(--transition-fast) linear;
|
|
51
51
|
background: var(--menu-link-sublist-icon) 50% / 2rem 2rem;
|
|
52
|
-
height: 1.25rem;
|
|
53
52
|
width: 1.25rem;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
@@ -92,13 +91,14 @@ export default function (context, { renderMenuItem }) {
|
|
|
92
91
|
const closeState = bau.state(true);
|
|
93
92
|
return li(
|
|
94
93
|
{
|
|
95
|
-
class:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
class: () =>
|
|
95
|
+
classNames(
|
|
96
|
+
children
|
|
97
|
+
? closeState.val
|
|
98
|
+
? styles.collapsable
|
|
99
|
+
: styles.collapsed
|
|
100
|
+
: ""
|
|
101
|
+
),
|
|
102
102
|
onclick: (event) => {
|
|
103
103
|
closeState.val = !closeState.val;
|
|
104
104
|
event.preventDefault();
|
|
@@ -108,14 +108,11 @@ export default function (context, { renderMenuItem }) {
|
|
|
108
108
|
children &&
|
|
109
109
|
ul(
|
|
110
110
|
{
|
|
111
|
-
"aria-expanded": {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
close ? collapseSection(element) : expandSection(element);
|
|
117
|
-
return !close;
|
|
118
|
-
},
|
|
111
|
+
"aria-expanded": ({ element }) => {
|
|
112
|
+
closeState.val
|
|
113
|
+
? collapseSection(element)
|
|
114
|
+
: expandSection(element);
|
|
115
|
+
return !closeState.val;
|
|
119
116
|
},
|
|
120
117
|
},
|
|
121
118
|
children.map(Tree({ depth: depth + 1 }))
|