@grucloud/bau-ui 0.48.0 → 0.50.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/divider/divider.js +48 -0
- package/divider/index.d.ts +10 -0
- package/divider/index.js +1 -0
- package/package.json +4 -4
- package/skeleton/index.d.ts +10 -0
- package/skeleton/index.js +1 -0
- package/skeleton/skeleton.js +63 -0
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
.content {
|
|
11
|
+
margin: 1rem;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
font-size: 0.875rem;
|
|
14
|
+
}
|
|
15
|
+
&::before,
|
|
16
|
+
&::after {
|
|
17
|
+
content: "";
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 0px;
|
|
20
|
+
border-top: 1px solid var(--color-emphasis-200);
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
return function Divider(...args) {
|
|
25
|
+
let [
|
|
26
|
+
{
|
|
27
|
+
size = options.size ?? "md",
|
|
28
|
+
variant = options.variant ?? "plain",
|
|
29
|
+
color = options.color ?? "neutral",
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
32
|
+
...children
|
|
33
|
+
] = toPropsAndChildren(args);
|
|
34
|
+
return div(
|
|
35
|
+
{
|
|
36
|
+
...props,
|
|
37
|
+
class: classNames(
|
|
38
|
+
"divider",
|
|
39
|
+
size,
|
|
40
|
+
className,
|
|
41
|
+
options?.class,
|
|
42
|
+
props?.class
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
div({ class: "content" }, ...children)
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/divider" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type DividerProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<DividerProps>;
|
|
8
|
+
|
|
9
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
10
|
+
}
|
package/divider/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./divider";
|
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.50.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.50.0",
|
|
24
|
+
"@grucloud/bau-css": "^0.50.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"typedoc": "0.24.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d5d3d682f8ae45a307c56377ce507e3fbe2a473f"
|
|
30
30
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "@grucloud/bau-ui/skeleton" {
|
|
2
|
+
type DefaultDesignProps = import("../constants").DefaultDesignProps;
|
|
3
|
+
type ComponentOption = import("../bau-ui").ComponentOption;
|
|
4
|
+
|
|
5
|
+
export type SkeletonProps = {} & DefaultDesignProps;
|
|
6
|
+
|
|
7
|
+
type Component = import("../bau-ui").Component<SkeletonProps>;
|
|
8
|
+
|
|
9
|
+
export default function (context: any, option?: ComponentOption): Component;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./skeleton";
|
|
@@ -0,0 +1,63 @@
|
|
|
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, keyframes } = context;
|
|
6
|
+
const { div } = bau.tags;
|
|
7
|
+
|
|
8
|
+
const opacityKeyFrame = keyframes`
|
|
9
|
+
0% {
|
|
10
|
+
transform: translateX(-100%);
|
|
11
|
+
}
|
|
12
|
+
50% {
|
|
13
|
+
transform: translateX(100%);
|
|
14
|
+
}
|
|
15
|
+
100% {
|
|
16
|
+
transform: translateX(100%);
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
const className = css`
|
|
21
|
+
background-color: var(--color-emphasis-200);
|
|
22
|
+
position: relative;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
&::after {
|
|
25
|
+
animation: 2s linear 0.5s infinite normal none running ${opacityKeyFrame};
|
|
26
|
+
background: linear-gradient(
|
|
27
|
+
90deg,
|
|
28
|
+
transparent,
|
|
29
|
+
rgba(255, 255, 255, 0.4),
|
|
30
|
+
transparent
|
|
31
|
+
);
|
|
32
|
+
content: "";
|
|
33
|
+
position: absolute;
|
|
34
|
+
transform: translateX(-100%);
|
|
35
|
+
inset: 0px;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
return function Skeleton(...args) {
|
|
40
|
+
let [
|
|
41
|
+
{
|
|
42
|
+
size = options.size ?? "md",
|
|
43
|
+
variant = options.variant ?? "plain",
|
|
44
|
+
color = options.color ?? "neutral",
|
|
45
|
+
...props
|
|
46
|
+
},
|
|
47
|
+
...children
|
|
48
|
+
] = toPropsAndChildren(args);
|
|
49
|
+
return div(
|
|
50
|
+
{
|
|
51
|
+
...props,
|
|
52
|
+
class: classNames(
|
|
53
|
+
"skeleton",
|
|
54
|
+
size,
|
|
55
|
+
className,
|
|
56
|
+
options?.class,
|
|
57
|
+
props?.class
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
...children
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
}
|