@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.
Files changed (79) hide show
  1. package/accordion/accordion.js +162 -0
  2. package/accordion/index.d.ts +26 -0
  3. package/accordion/index.js +1 -0
  4. package/alert/alert.js +65 -55
  5. package/alert/index.d.ts +8 -9
  6. package/alertStack/alertStack.js +5 -3
  7. package/alertStack/index.d.ts +5 -2
  8. package/autocomplete/autocomplete.js +222 -0
  9. package/autocomplete/index.d.ts +21 -0
  10. package/autocomplete/index.js +1 -0
  11. package/avatar/avatar.js +46 -6
  12. package/avatar/index.d.ts +5 -2
  13. package/badge/badge.js +43 -0
  14. package/badge/index.d.ts +16 -0
  15. package/badge/index.js +1 -0
  16. package/bau-ui.d.ts +14 -7
  17. package/breadcrumbs/breadcrumbs.js +30 -6
  18. package/breadcrumbs/index.d.ts +8 -2
  19. package/button/button.js +30 -106
  20. package/button/index.d.ts +4 -7
  21. package/buttonGroup/buttonGroup.js +68 -0
  22. package/buttonGroup/index.d.ts +10 -0
  23. package/buttonGroup/index.js +1 -0
  24. package/calendar/calendar.js +51 -0
  25. package/calendar/index.d.ts +13 -0
  26. package/calendar/index.js +1 -0
  27. package/checkbox/checkbox.js +66 -39
  28. package/checkbox/index.d.ts +5 -2
  29. package/chip/chip.js +60 -0
  30. package/chip/index.d.ts +10 -0
  31. package/chip/index.js +1 -0
  32. package/constants.d.ts +13 -0
  33. package/constants.js +3 -0
  34. package/context.d.ts +12 -0
  35. package/context.js +13 -0
  36. package/drawer/drawer.js +10 -5
  37. package/drawer/index.d.ts +5 -2
  38. package/drillDownMenu/drillDownMenu.js +117 -79
  39. package/drillDownMenu/index.d.ts +11 -3
  40. package/fileInput/fileInput.js +20 -10
  41. package/fileInput/index.d.ts +9 -3
  42. package/globalStyle/globalStyle.js +110 -60
  43. package/input/index.d.ts +6 -8
  44. package/input/input.js +78 -107
  45. package/list/index.d.ts +10 -0
  46. package/list/index.js +1 -0
  47. package/list/list.js +66 -0
  48. package/modal/index.d.ts +5 -2
  49. package/modal/modal.js +47 -10
  50. package/package.json +4 -4
  51. package/pages/login/index.d.ts +2 -0
  52. package/popover/index.d.ts +18 -0
  53. package/popover/index.js +1 -0
  54. package/popover/popover.js +69 -0
  55. package/select/index.d.ts +16 -0
  56. package/select/index.js +1 -0
  57. package/select/select.js +176 -0
  58. package/slider/index.d.ts +10 -0
  59. package/slider/index.js +1 -0
  60. package/slider/slider.js +47 -0
  61. package/spinner/index.d.ts +7 -4
  62. package/spinner/spinner.js +13 -5
  63. package/switch/index.d.ts +5 -2
  64. package/switch/switch.js +101 -18
  65. package/tableContainer/index.d.ts +9 -0
  66. package/tableContainer/index.js +1 -0
  67. package/tableContainer/tableContainer.js +78 -0
  68. package/tablePagination/index.d.ts +17 -0
  69. package/tablePagination/index.js +1 -0
  70. package/tablePagination/tablePagination.js +131 -0
  71. package/tabs/index.d.ts +3 -1
  72. package/tabs/tabs.js +34 -15
  73. package/themeSwitch/index.d.ts +3 -1
  74. package/themeSwitch/themeSwitch.js +58 -15
  75. package/tooltip/index.d.ts +24 -0
  76. package/tooltip/index.js +1 -0
  77. package/tooltip/tooltip.js +184 -0
  78. package/treeView/index.d.ts +7 -2
  79. package/treeView/treeView.js +37 -9
@@ -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: background-color var(--transition-fast) ease-in-out;
45
+ transition: all var(--transition-fast) ease-in-out;
46
+ background: inherit;
35
47
  &:hover {
36
- background: var(--color-emphasis-100);
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: var(--menu-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, { renderMenuItem }) {
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({ tree, maxDepth = Infinity, ...otherProps }) {
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(styles.nav, otherProps.class),
182
+ class: classNames(
183
+ styles.nav,
184
+ size,
185
+ variant,
186
+ color,
187
+ options?.class,
188
+ otherProps.class
189
+ ),
163
190
  },
164
- tree.children && ul(tree.children.map(Tree({ maxDepth })))
191
+ tree.children &&
192
+ ul(tree.children.map(Tree({ maxDepth, color, variant, size })))
165
193
  );
166
194
  };
167
195
  }