@grucloud/bau-ui 0.84.4 → 0.86.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.
@@ -92,7 +92,6 @@ export default function (context, options = {}) {
92
92
 
93
93
  const AccordionItem = (item) => {
94
94
  const { Header, Content, name } = item;
95
-
96
95
  const AccordionHeader = () =>
97
96
  h3(
98
97
  {
package/alert/alert.js CHANGED
@@ -7,8 +7,8 @@ const severityMap = {
7
7
  danger: "\u26A0",
8
8
  warning: "\u26A0",
9
9
  success: "\u2714",
10
- primary: "\u2139",
11
- neutral: "\u2139",
10
+ primary: "\u24D8",
11
+ neutral: "\u24D8",
12
12
  };
13
13
 
14
14
  const colorsToCss = () =>
@@ -16,25 +16,17 @@ const colorsToCss = () =>
16
16
  (color) =>
17
17
  `
18
18
  &.alert {
19
- &.sm {
20
- & .icon {
21
- font-size: 1.3rem;
22
- }
23
- }
24
- &.lg {
25
- & .icon {
26
- font-size: 2.5rem;
27
- }
28
- }
29
19
  &.plain.${color} {
30
20
  & .icon {
31
- color: var(--color-${color})
21
+ color: var(--color-${color});
22
+
32
23
  }
33
24
  }
34
25
  &.outline.${color} {
35
26
  & .icon {
36
- color: var(--color-${color})
27
+ color: var(--color-${color});
37
28
  }
29
+ border: 2px solid var(--color-${color});
38
30
  }
39
31
  }
40
32
  `
@@ -42,16 +34,26 @@ const colorsToCss = () =>
42
34
 
43
35
  export default function (context, options = {}) {
44
36
  const { bau, css } = context;
45
- const { div, i } = bau.tags;
37
+ const { div, span } = bau.tags;
46
38
 
47
39
  const className = css`
48
- display: flex;
40
+ display: inline-flex;
49
41
  max-width: 600px;
50
42
  justify-content: flex-start;
51
43
  align-items: center;
52
44
  font-weight: var(--font-weight-semibold);
53
45
  box-shadow: var(--shadow-m);
54
46
  border-radius: var(--global-radius);
47
+ &.sm {
48
+ & .icon {
49
+ font-size: 1.3rem;
50
+ }
51
+ }
52
+ &.lg {
53
+ & .icon {
54
+ font-size: 2.5rem;
55
+ }
56
+ }
55
57
  & .icon {
56
58
  padding: 0 0.5rem;
57
59
  font-size: 2rem;
@@ -108,7 +110,7 @@ export default function (context, options = {}) {
108
110
  ],
109
111
  role: "alert",
110
112
  },
111
- i({ class: "icon" }, severityMap[color]),
113
+ span({ class: "icon" }, severityMap[color]),
112
114
  div({ class: "content" }, ...children),
113
115
  onRemove && CloseIcon({ onclick: onRemove })
114
116
  );
package/context.js CHANGED
@@ -5,7 +5,7 @@ import globalStyle from "./globalStyle";
5
5
 
6
6
  export function createContext(extra) {
7
7
  const bau = Bau();
8
- const bauCss = BauCss();
8
+ const bauCss = BauCss({ target: window.document.getElementById("bau-css") });
9
9
  globalStyle(bauCss);
10
10
  return {
11
11
  bau,
@@ -224,8 +224,11 @@ export default function (context, options = {}) {
224
224
  };
225
225
 
226
226
  const pathFromHref = ({ target }) => {
227
- const href = target.closest("a").getAttribute("href");
228
- let path = href.replace(baseUrl, "");
227
+ let path = `${target
228
+ .closest("a")
229
+ .pathname.replace(".md", "")
230
+ .replace(baseUrl, "")}${target.hash}`;
231
+
229
232
  if (!hashBased) {
230
233
  path = path.replace(target.hash, "");
231
234
  }
@@ -257,7 +260,6 @@ export default function (context, options = {}) {
257
260
  const anchor = target.closest("a");
258
261
  if (!anchor) return;
259
262
  const href = anchor.getAttribute("href");
260
-
261
263
  if (
262
264
  href &&
263
265
  !href.startsWith("http") &&
@@ -98,12 +98,7 @@ export default function globalStyle(
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- h1,h2,h3,p {
102
- margin:0.3rem 0;
103
- }
104
- ul,ol {
105
- padding-left:1.3rem
106
- }
101
+
107
102
  :root {
108
103
  --color-scheme: light;
109
104
  --contrast-background-value: 90%;
@@ -17,7 +17,7 @@ export default function (context, options = {}) {
17
17
  .getPropertyValue(
18
18
  variant == "solid"
19
19
  ? `--font-color-inverse-secondary`
20
- : `--color-${color}`
20
+ : `--font-color-secondary`
21
21
  );
22
22
 
23
23
  const svgData = `url('data:image/svg+xml,<svg fill="${fillColor}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>')`;
package/modal/modal.js CHANGED
@@ -32,6 +32,21 @@ export default function (context, options = {}) {
32
32
  min-width: 400px;
33
33
  border: 0px;
34
34
  overflow: hidden;
35
+
36
+ &,
37
+ &::backdrop {
38
+ transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete,
39
+ opacity 0.3s;
40
+ opacity: 0;
41
+ }
42
+ &[open],
43
+ &[open]::backdrop {
44
+ opacity: 1;
45
+ @starting-style {
46
+ opacity: 0;
47
+ }
48
+ }
49
+
35
50
  > form {
36
51
  display: flex;
37
52
  flex-direction: column;
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.84.4",
4
+ "version": "0.86.0",
5
5
  "type": "module",
6
6
  "license": "BSD",
7
7
  "keywords": [
@@ -20,11 +20,11 @@
20
20
  "directory": "bau-ui"
21
21
  },
22
22
  "dependencies": {
23
- "@grucloud/bau": "^0.84.4",
24
- "@grucloud/bau-css": "^0.84.3"
23
+ "@grucloud/bau": "^0.86.0",
24
+ "@grucloud/bau-css": "^0.86.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "typedoc": "0.24.8"
28
28
  },
29
- "gitHead": "1eaaf08313fbced281334903e1e2d2dfc6710403"
29
+ "gitHead": "a611d39d05db892e5fe6d1effcd17dae38fa79e3"
30
30
  }
package/select/select.js CHANGED
@@ -10,8 +10,11 @@ const colorsToCss = () =>
10
10
  Colors.map(
11
11
  (color) =>
12
12
  `
13
+ & button.plain {
14
+ color: var(--font-color-secondary);
15
+ }
13
16
  & button.plain.${color}::after {
14
- color: var(--color-${color});
17
+ color: var(--font-color-secondary);
15
18
  }
16
19
  & button.outline.${color}::after {
17
20
  color: var(--color-${color});
@@ -31,8 +34,17 @@ export default function (context, componentOptions = {}) {
31
34
  width: 0;
32
35
  height: 0;
33
36
  opacity: 0;
37
+ border: 0;
38
+ }
39
+ dialog {
40
+ outline: none;
34
41
  }
35
42
  & button {
43
+ &.lg {
44
+ padding: 0.8rem;
45
+ }
46
+ box-shadow: var(--shadow-s);
47
+
36
48
  &::after {
37
49
  content: "\u25BC";
38
50
  }
@@ -103,6 +115,9 @@ export default function (context, componentOptions = {}) {
103
115
  };
104
116
 
105
117
  const onkeydown = (event) => {
118
+ if (!popoverEl.open) {
119
+ return;
120
+ }
106
121
  event.preventDefault();
107
122
  switch (event.key) {
108
123
  case "Escape":
@@ -126,6 +141,7 @@ export default function (context, componentOptions = {}) {
126
141
  if (popoverEl.open) {
127
142
  inputState.val = getOptionLabel(options[itemIndexActive.val]);
128
143
  selectEl.value = getOptionValue(option);
144
+ onSelect(options[itemIndexActive.val]);
129
145
  dialogClose();
130
146
  } else {
131
147
  dialogOpen();
@@ -175,7 +191,7 @@ export default function (context, componentOptions = {}) {
175
191
  });
176
192
  // Hidden select, required to save the value.
177
193
  const selectEl = select(
178
- { ...props, "aria-label": label },
194
+ { ...props, "aria-label": label, tabindex: "-1" },
179
195
  option({ value: "" }, "--Select Category--"),
180
196
  options.map((opt) =>
181
197
  option({ value: getOptionValue(opt) }, getOptionLabel(opt))
@@ -114,7 +114,6 @@ export default function (context, options = {}) {
114
114
  apply: (target, thisArg, argArray) => {
115
115
  target.apply(thisArg, argArray);
116
116
  const url = argArray[2] ?? "";
117
- console.log("stepper pushState ", url);
118
117
  if (["?", "#"].includes(url[0])) {
119
118
  hashchange();
120
119
  }
@@ -151,12 +150,10 @@ export default function (context, options = {}) {
151
150
  0
152
151
  );
153
152
  if (nextActiveStep < activeStepIndex.val) {
154
- console.log("remove last step");
155
153
  stepsCreatedState.val.pop();
156
154
  }
157
155
 
158
156
  if (!stepsCreatedState.val.some(({ name }) => stepNameInitial == name)) {
159
- console.log("add new step");
160
157
  stepsCreatedState.val.push(stepperDefs[nextActiveStep]);
161
158
  }
162
159
  activeStepIndex.val = nextActiveStep;
@@ -43,7 +43,7 @@ export default function (context, options = {}) {
43
43
 
44
44
  const className = css`
45
45
  position: relative;
46
- display: flex;
46
+ display: inline-flex;
47
47
  justify-content: center;
48
48
  align-items: center;
49
49
  border-radius: var(--global-radius);