@grucloud/bau-ui 0.42.0 → 0.43.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 (297) hide show
  1. package/README.md +2 -2
  2. package/accordion/accordion.js +32 -62
  3. package/accordion/index.d.ts +5 -7
  4. package/alert/alert.js +33 -30
  5. package/animate/animate.js +1 -1
  6. package/autocomplete/autocomplete.js +14 -11
  7. package/avatar/avatar.js +5 -2
  8. package/bau-ui.d.ts +3 -1
  9. package/breadcrumbs/breadcrumbs.js +2 -5
  10. package/button/button.js +59 -61
  11. package/buttonGroup/buttonGroup.js +4 -3
  12. package/carousel/carousel.js +105 -0
  13. package/carousel/index.d.ts +22 -0
  14. package/carousel/index.js +1 -0
  15. package/chip/chip.js +8 -8
  16. package/collapsible/collapsible.js +121 -0
  17. package/collapsible/index.d.ts +10 -0
  18. package/collapsible/index.js +1 -0
  19. package/constants.d.ts +8 -2
  20. package/constants.js +8 -1
  21. package/context.d.ts +2 -0
  22. package/docs/.nojekyll +1 -0
  23. package/docs/assets/highlight.css +22 -0
  24. package/docs/assets/main.js +58 -0
  25. package/docs/assets/search.js +1 -0
  26. package/docs/assets/style.css +1367 -0
  27. package/docs/functions/accordion.default.html +100 -0
  28. package/docs/functions/alert.default.html +97 -0
  29. package/docs/functions/alertStack.default.html +97 -0
  30. package/docs/functions/animate.default.html +93 -0
  31. package/docs/functions/autocomplete.default.html +97 -0
  32. package/docs/functions/avatar.default.html +97 -0
  33. package/docs/functions/badge.default.html +97 -0
  34. package/docs/functions/breadcrumbs.default.html +98 -0
  35. package/docs/functions/button.default.html +97 -0
  36. package/docs/functions/buttonGroup.default.html +97 -0
  37. package/docs/functions/calendar.default.html +97 -0
  38. package/docs/functions/checkbox.default.html +97 -0
  39. package/docs/functions/chip.default.html +97 -0
  40. package/docs/functions/context.createContext.html +92 -0
  41. package/docs/functions/drawer.default.html +97 -0
  42. package/docs/functions/drillDownMenu.default.html +100 -0
  43. package/docs/functions/fileInput.default.html +97 -0
  44. package/docs/functions/form.default.html +97 -0
  45. package/docs/functions/globalStyle.default.html +96 -0
  46. package/docs/functions/input.default.html +97 -0
  47. package/docs/functions/list.default.html +97 -0
  48. package/docs/functions/modal.default.html +97 -0
  49. package/docs/functions/paper.default.html +97 -0
  50. package/docs/functions/popover.default.html +97 -0
  51. package/docs/functions/select.default.html +97 -0
  52. package/docs/functions/slider.default.html +97 -0
  53. package/docs/functions/spinner.default.html +97 -0
  54. package/docs/functions/switch.default.html +97 -0
  55. package/docs/functions/tableContainer.default.html +96 -0
  56. package/docs/functions/tablePagination.default.html +97 -0
  57. package/docs/functions/tabs.default.html +101 -0
  58. package/docs/functions/themeSwitch.default.html +96 -0
  59. package/docs/functions/tooltip.default.html +97 -0
  60. package/docs/functions/treeView.default.html +100 -0
  61. package/docs/index.html +82 -0
  62. package/docs/modules/accordion.html +104 -0
  63. package/docs/modules/alert.html +98 -0
  64. package/docs/modules/alertStack.html +98 -0
  65. package/docs/modules/animate.html +94 -0
  66. package/docs/modules/autocomplete.html +98 -0
  67. package/docs/modules/avatar.html +98 -0
  68. package/docs/modules/badge.html +98 -0
  69. package/docs/modules/bau_ui.html +97 -0
  70. package/docs/modules/breadcrumbs.html +100 -0
  71. package/docs/modules/button.html +98 -0
  72. package/docs/modules/buttonGroup.html +98 -0
  73. package/docs/modules/calendar.html +98 -0
  74. package/docs/modules/checkbox.html +98 -0
  75. package/docs/modules/chip.html +98 -0
  76. package/docs/modules/constants.html +102 -0
  77. package/docs/modules/context.html +92 -0
  78. package/docs/modules/drawer.html +98 -0
  79. package/docs/modules/drillDownMenu.html +104 -0
  80. package/docs/modules/fileInput.html +98 -0
  81. package/docs/modules/form.html +98 -0
  82. package/docs/modules/globalStyle.html +96 -0
  83. package/docs/modules/input.html +98 -0
  84. package/docs/modules/list.html +98 -0
  85. package/docs/modules/modal.html +98 -0
  86. package/docs/modules/paper.html +98 -0
  87. package/docs/modules/popover.html +98 -0
  88. package/docs/modules/select.html +98 -0
  89. package/docs/modules/slider.html +98 -0
  90. package/docs/modules/spinner.html +98 -0
  91. package/docs/modules/switch.html +98 -0
  92. package/docs/modules/tableContainer.html +96 -0
  93. package/docs/modules/tablePagination.html +98 -0
  94. package/docs/modules/tabs.html +106 -0
  95. package/docs/modules/themeSwitch.html +96 -0
  96. package/docs/modules/tooltip.html +98 -0
  97. package/docs/modules/treeView.html +104 -0
  98. package/docs/types/accordion.Accordion.html +96 -0
  99. package/docs/types/accordion.AccordionItem.html +89 -0
  100. package/docs/types/accordion.AccordionItemPropBase.html +94 -0
  101. package/docs/types/accordion.AccordionProps.html +94 -0
  102. package/docs/types/accordion.Component.html +89 -0
  103. package/docs/types/accordion.ComponentOption.html +89 -0
  104. package/docs/types/accordion.DefaultDesignProps.html +89 -0
  105. package/docs/types/alert.AnimateProps.html +91 -0
  106. package/docs/types/alert.Component.html +86 -0
  107. package/docs/types/alert.ComponentOption.html +86 -0
  108. package/docs/types/alert.DefaultDesignProps.html +86 -0
  109. package/docs/types/alertStack.AlertStack.html +86 -0
  110. package/docs/types/alertStack.AlertStackProps.html +89 -0
  111. package/docs/types/alertStack.ComponentOption.html +86 -0
  112. package/docs/types/alertStack.DefaultDesignProps.html +86 -0
  113. package/docs/types/animate.AnimateProps.html +103 -0
  114. package/docs/types/animate.Component.html +84 -0
  115. package/docs/types/autocomplete.Autocomplete.html +125 -0
  116. package/docs/types/autocomplete.Component.html +86 -0
  117. package/docs/types/autocomplete.ComponentOption.html +86 -0
  118. package/docs/types/autocomplete.DefaultDesignProps.html +86 -0
  119. package/docs/types/avatar.AvatarProps.html +99 -0
  120. package/docs/types/avatar.Component.html +86 -0
  121. package/docs/types/avatar.ComponentOption.html +86 -0
  122. package/docs/types/avatar.DefaultDesignProps.html +86 -0
  123. package/docs/types/badge.BadgeProps.html +91 -0
  124. package/docs/types/badge.Component.html +86 -0
  125. package/docs/types/badge.ComponentOption.html +86 -0
  126. package/docs/types/badge.DefaultDesignProps.html +86 -0
  127. package/docs/types/bau_ui.ChildDom.html +87 -0
  128. package/docs/types/bau_ui.Component.html +111 -0
  129. package/docs/types/bau_ui.ComponentGeneric.html +102 -0
  130. package/docs/types/bau_ui.ComponentOneChild.html +109 -0
  131. package/docs/types/bau_ui.ComponentOption.html +92 -0
  132. package/docs/types/bau_ui.ComponentWithProp.html +109 -0
  133. package/docs/types/breadcrumbs.BreadcrumbsProps.html +94 -0
  134. package/docs/types/breadcrumbs.Component.html +87 -0
  135. package/docs/types/breadcrumbs.ComponentGeneric.html +87 -0
  136. package/docs/types/breadcrumbs.ComponentOption.html +87 -0
  137. package/docs/types/breadcrumbs.DefaultDesignProps.html +87 -0
  138. package/docs/types/button.ButtonProps.html +93 -0
  139. package/docs/types/button.Component.html +86 -0
  140. package/docs/types/button.ComponentOption.html +86 -0
  141. package/docs/types/button.DefaultDesignProps.html +86 -0
  142. package/docs/types/buttonGroup.ButtonGroupProps.html +89 -0
  143. package/docs/types/buttonGroup.Component.html +86 -0
  144. package/docs/types/buttonGroup.ComponentOption.html +86 -0
  145. package/docs/types/buttonGroup.DefaultDesignProps.html +86 -0
  146. package/docs/types/calendar.CalendarProps.html +89 -0
  147. package/docs/types/calendar.Component.html +86 -0
  148. package/docs/types/calendar.ComponentOption.html +86 -0
  149. package/docs/types/calendar.DefaultDesignProps.html +86 -0
  150. package/docs/types/checkbox.CheckboxProps.html +89 -0
  151. package/docs/types/checkbox.Component.html +86 -0
  152. package/docs/types/checkbox.ComponentOption.html +86 -0
  153. package/docs/types/checkbox.DefaultDesignProps.html +86 -0
  154. package/docs/types/chip.ChipProps.html +89 -0
  155. package/docs/types/chip.Component.html +86 -0
  156. package/docs/types/chip.ComponentOption.html +86 -0
  157. package/docs/types/chip.DefaultDesignProps.html +86 -0
  158. package/docs/types/constants.Color.html +88 -0
  159. package/docs/types/constants.DefaultDesignProps.html +97 -0
  160. package/docs/types/constants.Size.html +88 -0
  161. package/docs/types/constants.Variant.html +88 -0
  162. package/docs/types/context.Context.html +107 -0
  163. package/docs/types/drawer.Component.html +86 -0
  164. package/docs/types/drawer.ComponentOption.html +86 -0
  165. package/docs/types/drawer.DefaultDesignProps.html +86 -0
  166. package/docs/types/drawer.DrawerProps.html +89 -0
  167. package/docs/types/drillDownMenu.Component.html +89 -0
  168. package/docs/types/drillDownMenu.ComponentGeneric.html +89 -0
  169. package/docs/types/drillDownMenu.ComponentOption.html +89 -0
  170. package/docs/types/drillDownMenu.DefaultDesignProps.html +89 -0
  171. package/docs/types/drillDownMenu.Option.html +116 -0
  172. package/docs/types/drillDownMenu.Tree.html +96 -0
  173. package/docs/types/drillDownMenu.TreeViewProps.html +94 -0
  174. package/docs/types/fileInput.Component.html +86 -0
  175. package/docs/types/fileInput.ComponentOption.html +86 -0
  176. package/docs/types/fileInput.DefaultDesignProps.html +86 -0
  177. package/docs/types/fileInput.FileInputProps.html +91 -0
  178. package/docs/types/form.Component.html +86 -0
  179. package/docs/types/form.ComponentOption.html +86 -0
  180. package/docs/types/form.DefaultDesignProps.html +86 -0
  181. package/docs/types/form.FormProps.html +89 -0
  182. package/docs/types/globalStyle.ColorDefs.html +85 -0
  183. package/docs/types/globalStyle.HSL.html +94 -0
  184. package/docs/types/globalStyle.StyleOption.html +90 -0
  185. package/docs/types/input.Component.html +86 -0
  186. package/docs/types/input.ComponentOption.html +86 -0
  187. package/docs/types/input.DefaultDesignProps.html +86 -0
  188. package/docs/types/input.InputProps.html +89 -0
  189. package/docs/types/list.Component.html +86 -0
  190. package/docs/types/list.ComponentOption.html +86 -0
  191. package/docs/types/list.DefaultDesignProps.html +86 -0
  192. package/docs/types/list.ListProps.html +89 -0
  193. package/docs/types/modal.Component.html +86 -0
  194. package/docs/types/modal.ComponentOption.html +86 -0
  195. package/docs/types/modal.DefaultDesignProps.html +86 -0
  196. package/docs/types/modal.ModalProps.html +89 -0
  197. package/docs/types/paper.Component.html +86 -0
  198. package/docs/types/paper.ComponentOption.html +86 -0
  199. package/docs/types/paper.DefaultDesignProps.html +86 -0
  200. package/docs/types/paper.PaperProps.html +89 -0
  201. package/docs/types/popover.Action.html +105 -0
  202. package/docs/types/popover.Component.html +86 -0
  203. package/docs/types/popover.ComponentOption.html +86 -0
  204. package/docs/types/popover.PopoverProps.html +89 -0
  205. package/docs/types/select.Component.html +86 -0
  206. package/docs/types/select.ComponentOption.html +86 -0
  207. package/docs/types/select.DefaultDesignProps.html +86 -0
  208. package/docs/types/select.SelectProps.html +121 -0
  209. package/docs/types/slider.Component.html +86 -0
  210. package/docs/types/slider.ComponentOption.html +86 -0
  211. package/docs/types/slider.DefaultDesignProps.html +86 -0
  212. package/docs/types/slider.SliderProps.html +89 -0
  213. package/docs/types/spinner.Component.html +86 -0
  214. package/docs/types/spinner.ComponentOption.html +86 -0
  215. package/docs/types/spinner.DefaultDesignProps.html +86 -0
  216. package/docs/types/spinner.SpinnerProps.html +91 -0
  217. package/docs/types/switch.Component.html +86 -0
  218. package/docs/types/switch.ComponentOption.html +86 -0
  219. package/docs/types/switch.DefaultDesignProps.html +86 -0
  220. package/docs/types/switch.SwitchProps.html +89 -0
  221. package/docs/types/tableContainer.Component.html +85 -0
  222. package/docs/types/tableContainer.ComponentOption.html +85 -0
  223. package/docs/types/tableContainer.TableProps.html +88 -0
  224. package/docs/types/tablePagination.Component.html +86 -0
  225. package/docs/types/tablePagination.ComponentOption.html +86 -0
  226. package/docs/types/tablePagination.TablePaginationProps.html +99 -0
  227. package/docs/types/tablePagination.onPageChange.html +110 -0
  228. package/docs/types/tabs.Component.html +90 -0
  229. package/docs/types/tabs.ComponentOption.html +90 -0
  230. package/docs/types/tabs.ComponentTab.html +90 -0
  231. package/docs/types/tabs.Option.html +95 -0
  232. package/docs/types/tabs.Tab.html +97 -0
  233. package/docs/types/tabs.TabPropBase.html +101 -0
  234. package/docs/types/tabs.Tabs.html +90 -0
  235. package/docs/types/tabs.TabsProps.html +93 -0
  236. package/docs/types/themeSwitch.Component.html +85 -0
  237. package/docs/types/themeSwitch.ComponentOption.html +85 -0
  238. package/docs/types/themeSwitch.ThemeSwitchProps.html +88 -0
  239. package/docs/types/tooltip.Component.html +86 -0
  240. package/docs/types/tooltip.ComponentOption.html +86 -0
  241. package/docs/types/tooltip.DefaultDesignProps.html +86 -0
  242. package/docs/types/tooltip.TooltipProps.html +91 -0
  243. package/docs/types/treeView.Component.html +89 -0
  244. package/docs/types/treeView.ComponentGeneric.html +89 -0
  245. package/docs/types/treeView.ComponentOption.html +89 -0
  246. package/docs/types/treeView.DefaultDesignProps.html +89 -0
  247. package/docs/types/treeView.Option.html +94 -0
  248. package/docs/types/treeView.Tree.html +98 -0
  249. package/docs/types/treeView.TreeViewProps.html +94 -0
  250. package/docs/variables/constants.Colors.html +88 -0
  251. package/docs/variables/constants.Sizes.html +88 -0
  252. package/docs/variables/constants.Variants.html +88 -0
  253. package/drillDownMenu/drillDownMenu.js +59 -26
  254. package/drillDownMenu/index.d.ts +1 -0
  255. package/fileInput/fileInput.js +3 -5
  256. package/form/form.js +32 -1
  257. package/globalStyle/globalStyle.js +1 -1
  258. package/input/input.js +13 -13
  259. package/linearProgress/index.d.ts +12 -0
  260. package/linearProgress/index.js +1 -0
  261. package/linearProgress/linearProgress.js +84 -0
  262. package/list/list.js +3 -11
  263. package/loadingButton/index.d.ts +12 -0
  264. package/loadingButton/index.js +1 -0
  265. package/loadingButton/loadingButton.js +70 -0
  266. package/modal/modal.js +25 -27
  267. package/package.json +10 -5
  268. package/paginationNavigation/index.d.ts +10 -0
  269. package/paginationNavigation/index.js +1 -0
  270. package/paginationNavigation/paginationNavigation.js +78 -0
  271. package/paper/index.d.ts +10 -0
  272. package/paper/index.js +1 -0
  273. package/paper/paper.js +51 -0
  274. package/popover/popover.js +14 -3
  275. package/radioButton/index.d.ts +15 -0
  276. package/radioButton/index.js +1 -0
  277. package/radioButton/radioButton.js +49 -0
  278. package/select/select.js +21 -8
  279. package/spinner/index.d.ts +1 -3
  280. package/spinner/spinner.js +98 -55
  281. package/stepper/index.d.ts +28 -0
  282. package/stepper/index.js +1 -0
  283. package/stepper/stepper.js +159 -0
  284. package/tableContainer/tableContainer.js +2 -3
  285. package/tableOfContent/index.d.ts +10 -0
  286. package/tableOfContent/index.js +1 -0
  287. package/tableOfContent/tableOfContent.js +159 -0
  288. package/tabs/tabs.js +56 -56
  289. package/toggle/index.d.ts +10 -0
  290. package/toggle/index.js +1 -0
  291. package/toggle/toggle.js +106 -0
  292. package/toggleGroup/index.d.ts +13 -0
  293. package/toggleGroup/index.js +1 -0
  294. package/toggleGroup/toggleGroup.js +94 -0
  295. package/tooltip/tooltip.js +1 -6
  296. package/treeView/treeView.js +30 -88
  297. package/tsconfig.json +23 -0
@@ -0,0 +1,84 @@
1
+ import classNames from "@grucloud/bau-css/classNames.js";
2
+ import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
+ import { Colors } from "../constants.js";
4
+
5
+ export default function (context, options) {
6
+ const { bau, css, keyframes } = context;
7
+ const { div } = bau.tags;
8
+
9
+ const colorsToCss = () =>
10
+ Colors.map(
11
+ (color) =>
12
+ `
13
+ &.${color}{
14
+ background-color: var(--color-${color});
15
+ }
16
+ `
17
+ ).join("\n");
18
+
19
+ const stripes = keyframes`
20
+ 0% {
21
+ background-position: 0rem 0;
22
+ }
23
+ 100% {
24
+ background-position: 1rem 0;
25
+ }
26
+ `;
27
+
28
+ const className = css`
29
+ width: 100%;
30
+ height: 5px;
31
+ background-image: linear-gradient(
32
+ 45deg,
33
+ rgba(255, 255, 255, 0.15) 25%,
34
+ transparent 25%,
35
+ transparent 50%,
36
+ rgba(255, 255, 255, 0.15) 50%,
37
+ rgba(255, 255, 255, 0.15) 75%,
38
+ transparent 75%,
39
+ transparent
40
+ );
41
+ background-size: 1rem 1rem;
42
+ transition: all 0.3s linear;
43
+ opacity: 0;
44
+ &.running {
45
+ opacity: 1;
46
+ animation: ${stripes} 1s linear infinite;
47
+ }
48
+ &.sm {
49
+ height: 0.2rem;
50
+ }
51
+ &.md {
52
+ height: 0.5rem;
53
+ }
54
+ &.lg {
55
+ height: 1rem;
56
+ }
57
+
58
+ ${colorsToCss()}
59
+ `;
60
+
61
+ return function LinearProgress(...args) {
62
+ let [
63
+ { color = "neutral", variant = "plain", size = "md", running, ...props },
64
+ ] = toPropsAndChildren(args);
65
+
66
+ return div({
67
+ ...props,
68
+ role: "progressbar",
69
+ class: {
70
+ deps: [running],
71
+ renderProp: () => (running) =>
72
+ classNames(
73
+ "linearProgress",
74
+ size,
75
+ color,
76
+ className,
77
+ running && "running",
78
+ options?.class,
79
+ props?.class
80
+ ),
81
+ },
82
+ });
83
+ };
84
+ }
package/list/list.js CHANGED
@@ -1,19 +1,13 @@
1
1
  import classNames from "@grucloud/bau-css/classNames.js";
2
2
  import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
- import { Colors } from "../constants.js";
4
3
 
5
4
  export default function (context, options) {
6
5
  const { bau, css } = context;
7
6
  const { ul } = bau.tags;
8
7
 
9
- const colorsToCss = () =>
10
- Colors.map(
11
- (color) =>
12
- `
13
- `
14
- ).join("\n");
15
-
16
8
  const className = css`
9
+ display: flex;
10
+ flex-direction: column;
17
11
  list-style: none;
18
12
  padding: 0;
19
13
  margin: 0 0;
@@ -25,13 +19,12 @@ export default function (context, options) {
25
19
  filter: brightness(var(--brightness-active-always));
26
20
  }
27
21
  }
28
- & li {
22
+ & > li {
29
23
  padding: 0.4rem;
30
24
  cursor: pointer;
31
25
  background-color: inherit;
32
26
  transition: all var(--transition-slow) ease-out;
33
27
  display: flex;
34
- align-items: center;
35
28
  &:hover {
36
29
  filter: brightness(var(--brightness-hover));
37
30
  }
@@ -39,7 +32,6 @@ export default function (context, options) {
39
32
  filter: brightness(var(--brightness-active));
40
33
  }
41
34
  }
42
- ${colorsToCss()}
43
35
  `;
44
36
 
45
37
  return function List(...args) {
@@ -0,0 +1,12 @@
1
+ declare module "@grucloud/bau-ui/loadingButton" {
2
+ type DefaultDesignProps = import("../constants").DefaultDesignProps;
3
+ type ComponentOption = import("../bau-ui").ComponentOption;
4
+
5
+ export type LoadingButtonProps = {
6
+ loading: boolean | import("@grucloud/bau").State<boolean>;
7
+ } & DefaultDesignProps;
8
+
9
+ type Component = import("../bau-ui").Component<LoadingButtonProps>;
10
+
11
+ export default function (context: any, option?: ComponentOption): Component;
12
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./loadingButton";
@@ -0,0 +1,70 @@
1
+ import classNames from "@grucloud/bau-css/classNames.js";
2
+ import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
+ import button from "../button";
4
+ import spinner from "../spinner";
5
+
6
+ export default function (context, options) {
7
+ const { bau, css, keyframes } = context;
8
+ const { span } = bau.tags;
9
+
10
+ const fadeOut = keyframes`
11
+ 0% {
12
+ opacity: 1;
13
+ }
14
+ 100% {
15
+ opacity: 0;
16
+ }
17
+ `;
18
+
19
+ const className = css`
20
+ position: relative;
21
+ &:hover.loading {
22
+ cursor: default;
23
+ }
24
+ & .spinner {
25
+ position: absolute;
26
+ }
27
+ & span {
28
+ &.loading {
29
+ animation: ${fadeOut} 0.5s;
30
+ opacity: 0;
31
+ }
32
+ }
33
+ &.md {
34
+ padding-left: 0.5rem;
35
+ padding-right: 0.5rem;
36
+ }
37
+ `;
38
+
39
+ return function LoadingButton(...args) {
40
+ let [
41
+ { color, variant = "plain", size = "md", loading, ...props },
42
+ ...children
43
+ ] = toPropsAndChildren(args);
44
+
45
+ const Button = button(context);
46
+ const Spinner = spinner(context);
47
+
48
+ return bau.bind({
49
+ deps: [loading],
50
+ render: () => (loading) =>
51
+ Button(
52
+ {
53
+ ...props,
54
+ class: classNames(
55
+ "loadingButton",
56
+ size,
57
+ variant,
58
+ color,
59
+ className,
60
+ loading && "loading",
61
+ options?.class,
62
+ props?.class
63
+ ),
64
+ },
65
+ Spinner({ size, variant, color, visibility: loading }),
66
+ span({ class: loading && "loading" }, children)
67
+ ),
68
+ });
69
+ };
70
+ }
package/modal/modal.js CHANGED
@@ -4,7 +4,7 @@ import { Colors } from "../constants.js";
4
4
 
5
5
  export default function (context, options) {
6
6
  const { bau, css } = context;
7
- const { dialog } = bau.tags;
7
+ const { dialog, div } = bau.tags;
8
8
 
9
9
  const colorsToCss = () =>
10
10
  Colors.map(
@@ -20,7 +20,6 @@ export default function (context, options) {
20
20
  color: inherit;
21
21
  }
22
22
  &.modal.solid.${color} {
23
-
24
23
  }
25
24
  `
26
25
  ).join("\n");
@@ -28,34 +27,33 @@ export default function (context, options) {
28
27
  const className = css`
29
28
  box-shadow: var(--shadow-s);
30
29
  background-color: var(--background-color);
31
- top: 0;
32
- left: 0;
33
- max-height: 90vh;
34
- max-width: 95vw;
35
- transition: transform 0.3s ease-out;
36
- border-radius: 10px;
30
+ border-radius: var(--global-radius);
37
31
  min-width: 400px;
38
- padding: 0px;
32
+ padding: 1rem;
39
33
  border: 0px;
40
- & header {
41
- padding: 1rem;
42
- font-size: 1.8rem;
43
- font-weight: 800;
44
- text-align: center;
45
- }
46
- & footer {
34
+ > div {
47
35
  display: flex;
48
- justify-content: flex-end;
49
- margin: 0px;
50
- box-shadow: var(--shadow-s);
51
- padding: 1rem;
52
- gap: 1rem;
53
- }
54
- & > main {
55
- margin: 12px;
56
- flex-grow: 1;
57
- overflow: scroll;
36
+ flex-direction: column;
37
+ overflow: hidden;
38
+ max-height: 90vh;
39
+ max-width: 95vw;
40
+ & > header {
41
+ font-size: 1.5rem;
42
+ font-weight: 500;
43
+ }
44
+ & > main,
45
+ > section {
46
+ flex-grow: 1;
47
+ overflow-y: auto;
48
+ }
49
+ & > footer {
50
+ display: flex;
51
+ justify-content: flex-end;
52
+ padding: 1rem;
53
+ gap: 1rem;
54
+ }
58
55
  }
56
+
59
57
  ${colorsToCss()}
60
58
  `;
61
59
 
@@ -77,7 +75,7 @@ export default function (context, options) {
77
75
  props?.class
78
76
  ),
79
77
  },
80
- ...children
78
+ div(...children)
81
79
  );
82
80
  };
83
81
  }
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.42.0",
4
+ "version": "0.43.0",
5
5
  "type": "module",
6
6
  "license": "BSD",
7
7
  "keywords": [
@@ -11,15 +11,20 @@
11
11
  "CSS in JS"
12
12
  ],
13
13
  "author": "Frederic Heem",
14
- "scripts": {},
14
+ "scripts": {
15
+ "typedoc": "typedoc --exclude myComponent/index.d.ts *.d.ts **/*.d.ts "
16
+ },
15
17
  "repository": {
16
18
  "type": "git",
17
19
  "url": "git@github.com:grucloud/bau.git",
18
20
  "directory": "bau-ui"
19
21
  },
20
22
  "dependencies": {
21
- "@grucloud/bau": "^0.42.0",
22
- "@grucloud/bau-css": "^0.42.0"
23
+ "@grucloud/bau": "^0.43.0",
24
+ "@grucloud/bau-css": "^0.43.0"
25
+ },
26
+ "devDependencies": {
27
+ "typedoc": "0.24.8"
23
28
  },
24
- "gitHead": "35376e3c8ba424c0adceca4b3928dbf9e7931676"
29
+ "gitHead": "a94355d33ce24d2db1fd729b632360144d6565c2"
25
30
  }
@@ -0,0 +1,10 @@
1
+ declare module "@grucloud/bau-ui/paginationNavigation" {
2
+ type DefaultDesignProps = import("../constants").DefaultDesignProps;
3
+ type ComponentOption = import("../bau-ui").ComponentOption;
4
+
5
+ export type PaginationNavigationProps = {} & DefaultDesignProps;
6
+
7
+ type Component = import("../bau-ui").Component<PaginationNavigationProps>;
8
+
9
+ export default function (context: any, option?: ComponentOption): Component;
10
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./paginationNavigation";
@@ -0,0 +1,78 @@
1
+ import classNames from "@grucloud/bau-css/classNames.js";
2
+ import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
+
4
+ export default function (context, options) {
5
+ const { bau, css, config } = context;
6
+ const { div, a, span, nav } = bau.tags;
7
+
8
+ const className = css`
9
+ margin-top: 3rem;
10
+ margin-bottom: 1rem;
11
+ display: grid;
12
+ grid-area: paginationnav;
13
+ gap: var(--spacing-horizontal);
14
+ grid-template-columns: repeat(2, 1fr);
15
+ & > a {
16
+ padding: 0.5rem 1rem;
17
+ text-decoration: none;
18
+ border: 1px solid var(--color-emphasis-300);
19
+ border-radius: var(--global-radius);
20
+ transition: border-color var(--transition-slow);
21
+ &:hover {
22
+ border-color: var(--color-primary);
23
+ }
24
+ .sublabel {
25
+ color: var(--color-content-secondary);
26
+ font-size: 0.8rem;
27
+ font-weight: var(--font-weight-semibold);
28
+ margin-bottom: 0.25rem;
29
+ }
30
+ .label {
31
+ color: var(--link-color);
32
+ font-size: 1rem;
33
+ font-weight: var(--font-weight-bold);
34
+ }
35
+ .Previous {
36
+ &::before {
37
+ content: "« ";
38
+ }
39
+ }
40
+ .Next {
41
+ &::after {
42
+ content: " »";
43
+ }
44
+ }
45
+ }
46
+ `;
47
+
48
+ const Link =
49
+ ({ text }) =>
50
+ ({ name, label, href }) =>
51
+ a(
52
+ { href: `${config.base}${href}` },
53
+ span({ class: "sublabel" }, text),
54
+ div({ class: `label ${text}` }, label ?? name)
55
+ );
56
+
57
+ return function PaginationNavigation(...args) {
58
+ let [{ color, variant = "plain", size = "md", data = {}, ...props }] =
59
+ toPropsAndChildren(args);
60
+ const { next, previous } = data;
61
+ return nav(
62
+ {
63
+ "data-paginationnav": JSON.stringify(data),
64
+ "aria-label": "pages navigation",
65
+ ...props,
66
+ class: classNames(
67
+ "paginationNavigation",
68
+ size,
69
+ className,
70
+ options?.class,
71
+ props?.class
72
+ ),
73
+ },
74
+ previous?.href && Link({ text: "Previous" })(previous),
75
+ next?.href && Link({ text: "Next" })(next)
76
+ );
77
+ };
78
+ }
@@ -0,0 +1,10 @@
1
+ declare module "@grucloud/bau-ui/paper" {
2
+ type DefaultDesignProps = import("../constants").DefaultDesignProps;
3
+ type ComponentOption = import("../bau-ui").ComponentOption;
4
+
5
+ export type PaperProps = {} & DefaultDesignProps;
6
+
7
+ type Component = import("../bau-ui").Component<PaperProps>;
8
+
9
+ export default function (context: any, option?: ComponentOption): Component;
10
+ }
package/paper/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default } from "./paper";
package/paper/paper.js ADDED
@@ -0,0 +1,51 @@
1
+ import classNames from "@grucloud/bau-css/classNames.js";
2
+ import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
+
4
+ export default function (context, options) {
5
+ const { bau, css } = context;
6
+ const { div } = bau.tags;
7
+ const className = css`
8
+ border: 1px solid transparent;
9
+ height: fit-content;
10
+ border-radius: var(--global-radius);
11
+ &.sm {
12
+ box-shadow: var(--shadow-s);
13
+ background-image: linear-gradient(
14
+ rgba(255, 255, 255, 0.03),
15
+ rgba(255, 255, 255, 0.03)
16
+ );
17
+ }
18
+ &.md {
19
+ box-shadow: var(--shadow-m);
20
+ background-image: linear-gradient(
21
+ rgba(255, 255, 255, 0.05),
22
+ rgba(255, 255, 255, 0.05)
23
+ );
24
+ }
25
+ &.lg {
26
+ box-shadow: var(--shadow-lg);
27
+ background-image: linear-gradient(
28
+ rgba(255, 255, 255, 0.1),
29
+ rgba(255, 255, 255, 0.1)
30
+ );
31
+ }
32
+ `;
33
+
34
+ return function Paper(...args) {
35
+ let [{ color, variant = "outline", size = "md", ...props }, ...children] =
36
+ toPropsAndChildren(args);
37
+ return div(
38
+ {
39
+ ...props,
40
+ class: classNames(
41
+ "paper",
42
+ size,
43
+ className,
44
+ options?.class,
45
+ props?.class
46
+ ),
47
+ },
48
+ ...children
49
+ );
50
+ };
51
+ }
@@ -1,9 +1,17 @@
1
+ import paper from "../paper";
1
2
  import classNames from "@grucloud/bau-css/classNames.js";
2
3
  import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
4
 
4
5
  export default function (context, options) {
5
6
  const { bau, css, window } = context;
6
7
  const { dialog } = bau.tags;
8
+ const Paper = paper(context, {
9
+ class: css`
10
+ &.paper {
11
+ padding: 0;
12
+ }
13
+ `,
14
+ });
7
15
 
8
16
  const className = css`
9
17
  width: fit-content;
@@ -34,11 +42,14 @@ export default function (context, options) {
34
42
  } else {
35
43
  dialogEl.style.left = rectAnchor.right - rectDialog.width + "px";
36
44
  }
37
-
38
45
  if (rectAnchor.y < window.innerHeight / 2) {
39
46
  dialogEl.style.top = rectAnchor.top + rectAnchor.height + "px";
40
47
  } else {
41
- dialogEl.style.top = rectAnchor.top - rectDialog.height + "px";
48
+ dialogEl.style.top =
49
+ Math.max(0, rectAnchor.top - rectDialog.height) + "px";
50
+ if (rectDialog.height > rectAnchor.top) {
51
+ dialogEl.style.height = rectAnchor.top + "px";
52
+ }
42
53
  }
43
54
  };
44
55
 
@@ -58,7 +69,7 @@ export default function (context, options) {
58
69
  onclick: (event) =>
59
70
  event.target === dialogEl && (closeDialog(), onClose?.call()),
60
71
  },
61
- contentEl
72
+ Paper(contentEl)
62
73
  );
63
74
 
64
75
  dialogEl.closeDialog = closeDialog;
@@ -0,0 +1,15 @@
1
+ declare module "@grucloud/bau-ui/radioButton" {
2
+ type DefaultDesignProps = import("../constants").DefaultDesignProps;
3
+ type ComponentOption = import("../bau-ui").ComponentOption;
4
+
5
+ export type RadioButtonProps = {
6
+ value: string | import("@grucloud/bau").State<string>;
7
+ } & DefaultDesignProps;
8
+
9
+ type Component = import("../bau-ui").Component<
10
+ RadioButtonProps,
11
+ HTMLInputElement
12
+ >;
13
+
14
+ export default function (context: any, option?: ComponentOption): Component;
15
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./radioButton";
@@ -0,0 +1,49 @@
1
+ import classNames from "@grucloud/bau-css/classNames.js";
2
+ import { toPropsAndChildren } from "@grucloud/bau/bau.js";
3
+ import { Colors } from "../constants.js";
4
+
5
+ export default function (context, options) {
6
+ const { bau, css } = context;
7
+ const { input } = bau.tags;
8
+
9
+ const colorsToCss = () =>
10
+ Colors.map(
11
+ (color) =>
12
+ `
13
+ &.radio-button.${color} {
14
+ accent-color: var(--color-${color});
15
+ }
16
+ `
17
+ ).join("\n");
18
+
19
+ const className = css`
20
+ &.sm {
21
+ transform: scale(0.8);
22
+ }
23
+ &.md {
24
+ }
25
+ &.lg {
26
+ transform: scale(1.5);
27
+ }
28
+ ${colorsToCss()}
29
+ `;
30
+
31
+ return function RadioButton(...args) {
32
+ let [{ color = "neutral", variant = "plain", size = "md", ...props }] =
33
+ toPropsAndChildren(args);
34
+
35
+ return input({
36
+ ...props,
37
+ type: "radio",
38
+ class: classNames(
39
+ "radio-button",
40
+ size,
41
+ color,
42
+ variant,
43
+ className,
44
+ options?.class,
45
+ props?.class
46
+ ),
47
+ });
48
+ };
49
+ }
package/select/select.js CHANGED
@@ -21,12 +21,16 @@ const colorsToCss = () =>
21
21
 
22
22
  export default function (context, componentOptions) {
23
23
  const { bau, css } = context;
24
- const { div, li } = bau.tags;
24
+ const { div, li, select, option } = bau.tags;
25
25
  const Button = button(context);
26
26
  const Popover = popover(context);
27
27
  const List = list(context);
28
28
 
29
29
  const className = css`
30
+ & select {
31
+ width: 0;
32
+ height: 0;
33
+ }
30
34
  & button {
31
35
  &::after {
32
36
  content: "\u25BC";
@@ -36,17 +40,12 @@ export default function (context, componentOptions) {
36
40
  ${colorsToCss()}
37
41
  `;
38
42
 
39
- const inputState = bau.state("");
40
- const openState = bau.state(false);
41
- const itemIndexActive = bau.state(0);
42
-
43
43
  return function Select(...args) {
44
44
  let [
45
45
  {
46
46
  color = "neutral",
47
47
  variant = "outline",
48
48
  size = "md",
49
- id,
50
49
  label,
51
50
  Option,
52
51
  options,
@@ -56,6 +55,10 @@ export default function (context, componentOptions) {
56
55
  ...children
57
56
  ] = toPropsAndChildren(args);
58
57
 
58
+ const inputState = bau.state("");
59
+ const openState = bau.state(false);
60
+ const itemIndexActive = bau.state(0);
61
+
59
62
  const dialogOpen = () => {
60
63
  popoverEl.openDialog();
61
64
  popoverEl.focus();
@@ -77,15 +80,18 @@ export default function (context, componentOptions) {
77
80
  } else {
78
81
  dialogClose();
79
82
  }
83
+ event.preventDefault();
80
84
  };
81
85
 
82
86
  const onclickItem =
83
87
  ({ option, index }) =>
84
88
  (event) => {
85
89
  inputState.val = getOptionLabel(option);
90
+ selectEl.value = inputState.val;
91
+ selectEl.setCustomValidity("");
86
92
  itemIndexActive.val = index;
87
-
88
93
  dialogClose();
94
+ event.preventDefault();
89
95
  };
90
96
 
91
97
  const onkeydown = (event) => {
@@ -150,11 +156,17 @@ export default function (context, componentOptions) {
150
156
  );
151
157
 
152
158
  const popoverEl = Popover({
153
- id,
159
+ // id,
154
160
  triggerEl: buttonEl,
155
161
  contentEl: Content(),
156
162
  onClose,
157
163
  });
164
+ // Hidden select, required to save the value.
165
+ const selectEl = select(
166
+ props,
167
+ option({ value: "" }, "--Select Category--"),
168
+ options.map((opt) => option(getOptionLabel(opt)))
169
+ );
158
170
 
159
171
  return div(
160
172
  {
@@ -169,6 +181,7 @@ export default function (context, componentOptions) {
169
181
  ),
170
182
  onkeydown,
171
183
  },
184
+ selectEl,
172
185
  buttonEl,
173
186
  popoverEl
174
187
  );