@grucloud/bau-ui 0.40.0 → 0.41.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/accordion/accordion.js +162 -0
- package/accordion/index.d.ts +26 -0
- package/accordion/index.js +1 -0
- package/alert/alert.js +65 -55
- package/alert/index.d.ts +8 -9
- package/alertStack/alertStack.js +5 -3
- package/alertStack/index.d.ts +5 -2
- package/autocomplete/autocomplete.js +222 -0
- package/autocomplete/index.d.ts +21 -0
- package/autocomplete/index.js +1 -0
- package/avatar/avatar.js +46 -6
- package/avatar/index.d.ts +5 -2
- package/badge/badge.js +43 -0
- package/badge/index.d.ts +16 -0
- package/badge/index.js +1 -0
- package/bau-ui.d.ts +14 -7
- package/breadcrumbs/breadcrumbs.js +30 -6
- package/breadcrumbs/index.d.ts +8 -2
- package/button/button.js +30 -106
- package/button/index.d.ts +4 -7
- package/buttonGroup/buttonGroup.js +68 -0
- package/buttonGroup/index.d.ts +10 -0
- package/buttonGroup/index.js +1 -0
- package/calendar/calendar.js +51 -0
- package/calendar/index.d.ts +13 -0
- package/calendar/index.js +1 -0
- package/checkbox/checkbox.js +66 -39
- package/checkbox/index.d.ts +5 -2
- package/chip/chip.js +60 -0
- package/chip/index.d.ts +10 -0
- package/chip/index.js +1 -0
- package/constants.d.ts +13 -0
- package/constants.js +3 -0
- package/context.d.ts +12 -0
- package/context.js +13 -0
- package/drawer/drawer.js +10 -5
- package/drawer/index.d.ts +5 -2
- package/drillDownMenu/drillDownMenu.js +117 -79
- package/drillDownMenu/index.d.ts +11 -3
- package/fileInput/fileInput.js +20 -10
- package/fileInput/index.d.ts +9 -3
- package/globalStyle/globalStyle.js +110 -60
- package/input/index.d.ts +6 -8
- package/input/input.js +78 -107
- package/list/index.d.ts +10 -0
- package/list/index.js +1 -0
- package/list/list.js +66 -0
- package/modal/index.d.ts +5 -2
- package/modal/modal.js +47 -10
- package/package.json +4 -4
- package/pages/login/index.d.ts +2 -0
- package/popover/index.d.ts +18 -0
- package/popover/index.js +1 -0
- package/popover/popover.js +69 -0
- package/select/index.d.ts +16 -0
- package/select/index.js +1 -0
- package/select/select.js +176 -0
- package/slider/index.d.ts +10 -0
- package/slider/index.js +1 -0
- package/slider/slider.js +47 -0
- package/spinner/index.d.ts +7 -4
- package/spinner/spinner.js +13 -5
- package/switch/index.d.ts +5 -2
- package/switch/switch.js +101 -18
- package/tableContainer/index.d.ts +9 -0
- package/tableContainer/index.js +1 -0
- package/tableContainer/tableContainer.js +78 -0
- package/tablePagination/index.d.ts +17 -0
- package/tablePagination/index.js +1 -0
- package/tablePagination/tablePagination.js +131 -0
- package/tabs/index.d.ts +3 -1
- package/tabs/tabs.js +34 -15
- package/themeSwitch/index.d.ts +3 -1
- package/themeSwitch/themeSwitch.js +58 -15
- package/tooltip/index.d.ts +24 -0
- package/tooltip/index.js +1 -0
- package/tooltip/tooltip.js +184 -0
- package/treeView/index.d.ts +7 -2
- package/treeView/treeView.js +37 -9
package/treeView/treeView.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
1
2
|
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
3
|
|
|
3
4
|
const createStyles = ({ css, createGlobalStyles }) => {
|
|
@@ -15,6 +16,12 @@ const createStyles = ({ css, createGlobalStyles }) => {
|
|
|
15
16
|
const nav = css`
|
|
16
17
|
font-weight: var(--font-weight-semibold);
|
|
17
18
|
overflow-x: hidden;
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
|
|
21
|
+
&.solid div:hover {
|
|
22
|
+
filter: brightness(var(--brightness-hover-always));
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
& ul {
|
|
19
26
|
display: block;
|
|
20
27
|
list-style: none;
|
|
@@ -23,18 +30,22 @@ const createStyles = ({ css, createGlobalStyles }) => {
|
|
|
23
30
|
overflow: hidden;
|
|
24
31
|
will-change: height;
|
|
25
32
|
transition: height var(--transition-fast) ease-out;
|
|
33
|
+
background: inherit;
|
|
34
|
+
|
|
26
35
|
& li {
|
|
27
36
|
padding-left: var(--menu-link-padding-horizontal);
|
|
28
37
|
border-radius: 0.25rem;
|
|
38
|
+
background: inherit;
|
|
39
|
+
|
|
29
40
|
> div {
|
|
30
41
|
width: 100%;
|
|
31
42
|
display: flex;
|
|
32
43
|
justify-content: space-between;
|
|
33
44
|
align-items: center;
|
|
34
|
-
transition:
|
|
45
|
+
transition: all var(--transition-fast) ease-in-out;
|
|
46
|
+
background: inherit;
|
|
35
47
|
&:hover {
|
|
36
|
-
|
|
37
|
-
cursor: pointer;
|
|
48
|
+
filter: brightness(var(--brightness-hover));
|
|
38
49
|
}
|
|
39
50
|
&::after {
|
|
40
51
|
transition: transform var(--transition-fast) linear;
|
|
@@ -46,7 +57,7 @@ const createStyles = ({ css, createGlobalStyles }) => {
|
|
|
46
57
|
display: flex;
|
|
47
58
|
flex-grow: 1;
|
|
48
59
|
text-decoration: none;
|
|
49
|
-
color:
|
|
60
|
+
color: inherit;
|
|
50
61
|
padding: var(--menu-link-padding-vertical)
|
|
51
62
|
var(--menu-link-padding-horizontal);
|
|
52
63
|
}
|
|
@@ -79,8 +90,9 @@ const createStyles = ({ css, createGlobalStyles }) => {
|
|
|
79
90
|
};
|
|
80
91
|
};
|
|
81
92
|
|
|
82
|
-
export default function (context,
|
|
93
|
+
export default function (context, options) {
|
|
83
94
|
const { bau, css, createGlobalStyles, window } = context;
|
|
95
|
+
const { renderMenuItem } = options;
|
|
84
96
|
const { ul, li, nav, div } = bau.tags;
|
|
85
97
|
|
|
86
98
|
const styles = createStyles({ css, createGlobalStyles });
|
|
@@ -111,7 +123,7 @@ export default function (context, { renderMenuItem }) {
|
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
const Tree =
|
|
114
|
-
({ depth = 1, maxDepth }) =>
|
|
126
|
+
({ depth = 1, maxDepth, color, variant, size }) =>
|
|
115
127
|
(item) => {
|
|
116
128
|
const { children, expanded } = item;
|
|
117
129
|
const closeState = bau.state(!expanded);
|
|
@@ -143,6 +155,7 @@ export default function (context, { renderMenuItem }) {
|
|
|
143
155
|
depth < maxDepth &&
|
|
144
156
|
ul(
|
|
145
157
|
{
|
|
158
|
+
class: classNames(color, size),
|
|
146
159
|
bauMounted: ({ element }) => {
|
|
147
160
|
closeState.val && (element.style.height = "0px");
|
|
148
161
|
},
|
|
@@ -156,12 +169,27 @@ export default function (context, { renderMenuItem }) {
|
|
|
156
169
|
);
|
|
157
170
|
};
|
|
158
171
|
|
|
159
|
-
return function TreeView({
|
|
172
|
+
return function TreeView({
|
|
173
|
+
tree,
|
|
174
|
+
maxDepth = Infinity,
|
|
175
|
+
size = "md",
|
|
176
|
+
variant = "plain",
|
|
177
|
+
color = "neutral",
|
|
178
|
+
...otherProps
|
|
179
|
+
}) {
|
|
160
180
|
return nav(
|
|
161
181
|
{
|
|
162
|
-
class: classNames(
|
|
182
|
+
class: classNames(
|
|
183
|
+
styles.nav,
|
|
184
|
+
size,
|
|
185
|
+
variant,
|
|
186
|
+
color,
|
|
187
|
+
options?.class,
|
|
188
|
+
otherProps.class
|
|
189
|
+
),
|
|
163
190
|
},
|
|
164
|
-
tree.children &&
|
|
191
|
+
tree.children &&
|
|
192
|
+
ul(tree.children.map(Tree({ maxDepth, color, variant, size })))
|
|
165
193
|
);
|
|
166
194
|
};
|
|
167
195
|
}
|