@grucloud/bau-ui 0.43.3 → 0.44.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/autocomplete/autocomplete.js +5 -8
- package/input/index.d.ts +2 -1
- package/input/input.js +2 -2
- package/package.json +4 -4
- package/select/select.js +1 -1
- package/selectNative/index.d.ts +13 -0
- package/selectNative/index.js +1 -0
- package/selectNative/selectNative.js +47 -0
|
@@ -24,11 +24,6 @@ export default function (context, componentOptions = {}) {
|
|
|
24
24
|
const { bau, css } = context;
|
|
25
25
|
const { div, li } = bau.tags;
|
|
26
26
|
|
|
27
|
-
const Popover = popover(context);
|
|
28
|
-
const Button = button(context);
|
|
29
|
-
const Input = input(context);
|
|
30
|
-
const List = list(context);
|
|
31
|
-
|
|
32
27
|
const className = css`
|
|
33
28
|
& button {
|
|
34
29
|
&::after {
|
|
@@ -67,6 +62,11 @@ export default function (context, componentOptions = {}) {
|
|
|
67
62
|
...children
|
|
68
63
|
] = toPropsAndChildren(args);
|
|
69
64
|
|
|
65
|
+
const Popover = popover(context);
|
|
66
|
+
const Button = button(context);
|
|
67
|
+
const Input = input(context, { variant, color, size });
|
|
68
|
+
const List = list(context);
|
|
69
|
+
|
|
70
70
|
const selectedState = bau.state("");
|
|
71
71
|
const inputState = bau.state("");
|
|
72
72
|
const openState = bau.state(false);
|
|
@@ -179,9 +179,6 @@ export default function (context, componentOptions = {}) {
|
|
|
179
179
|
"aria-expanded": openState,
|
|
180
180
|
oninput,
|
|
181
181
|
onkeydown,
|
|
182
|
-
variant,
|
|
183
|
-
color,
|
|
184
|
-
size,
|
|
185
182
|
});
|
|
186
183
|
|
|
187
184
|
const Content = () =>
|
package/input/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ declare module "@grucloud/bau-ui/input" {
|
|
|
2
2
|
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
3
|
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Bau comonent size (sm, md and lg) conflicts with the native html input size.
|
|
6
|
+
export type InputProps = { size?: Number } & Omit<DefaultDesignProps, "size">;
|
|
6
7
|
|
|
7
8
|
type Component = import("../bau-ui").Component<InputProps, HTMLInputElement>;
|
|
8
9
|
|
package/input/input.js
CHANGED
|
@@ -67,7 +67,7 @@ export default function (context, options = {}) {
|
|
|
67
67
|
|
|
68
68
|
return function Input(props) {
|
|
69
69
|
const {
|
|
70
|
-
|
|
70
|
+
// Use options to set the comonent size,
|
|
71
71
|
variant = options.variant ?? "outline",
|
|
72
72
|
color = options.color ?? "neutral",
|
|
73
73
|
...otherProps
|
|
@@ -79,7 +79,7 @@ export default function (context, options = {}) {
|
|
|
79
79
|
class: classNames(
|
|
80
80
|
"input",
|
|
81
81
|
options.class,
|
|
82
|
-
size,
|
|
82
|
+
options.size ?? "md",
|
|
83
83
|
color,
|
|
84
84
|
variant,
|
|
85
85
|
className,
|
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.44.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.
|
|
24
|
-
"@grucloud/bau-css": "^0.
|
|
23
|
+
"@grucloud/bau": "^0.44.0",
|
|
24
|
+
"@grucloud/bau-css": "^0.44.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"typedoc": "0.24.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1809e9d648d72112ef70235f0a8712f18df7c0ec"
|
|
30
30
|
}
|
package/select/select.js
CHANGED
|
@@ -44,7 +44,7 @@ export default function (context, componentOptions = {}) {
|
|
|
44
44
|
let [
|
|
45
45
|
{
|
|
46
46
|
size = componentOptions.size ?? "md",
|
|
47
|
-
variant = componentOptions.variant ?? "
|
|
47
|
+
variant = componentOptions.variant ?? "outline",
|
|
48
48
|
color = componentOptions.color ?? "neutral",
|
|
49
49
|
label,
|
|
50
50
|
Option,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/selectNative" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type SelectNativeProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<
|
|
8
|
+
SelectNativeProps,
|
|
9
|
+
HTMLSelectElement
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./selectNative";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import classNames from "@grucloud/bau-css/classNames.js";
|
|
2
|
+
import { toPropsAndChildren } from "@grucloud/bau/bau.js";
|
|
3
|
+
|
|
4
|
+
export default function (context, componentOptions = {}) {
|
|
5
|
+
const { bau, css } = context;
|
|
6
|
+
const { select } = bau.tags;
|
|
7
|
+
|
|
8
|
+
const className = css`
|
|
9
|
+
border-radius: var(--global-radius);
|
|
10
|
+
&.sm {
|
|
11
|
+
}
|
|
12
|
+
&.md {
|
|
13
|
+
padding: 0.5rem;
|
|
14
|
+
}
|
|
15
|
+
&.lg {
|
|
16
|
+
padding: 0.7rem;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
return function SelectNative(...args) {
|
|
21
|
+
let [
|
|
22
|
+
{
|
|
23
|
+
size = componentOptions.size ?? "md",
|
|
24
|
+
variant = componentOptions.variant ?? "outline",
|
|
25
|
+
color = componentOptions.color ?? "neutral",
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
28
|
+
...children
|
|
29
|
+
] = toPropsAndChildren(args);
|
|
30
|
+
|
|
31
|
+
return select(
|
|
32
|
+
{
|
|
33
|
+
...props,
|
|
34
|
+
class: classNames(
|
|
35
|
+
"select-native",
|
|
36
|
+
color,
|
|
37
|
+
size,
|
|
38
|
+
variant,
|
|
39
|
+
className,
|
|
40
|
+
componentOptions?.class,
|
|
41
|
+
props?.class
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
children
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
}
|