@blockle/blocks-theme-momotaro 1.0.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/README.md +1 -0
- package/dist/components/button.css.cjs +126 -0
- package/dist/components/button.css.d.ts +1 -0
- package/dist/components/button.css.js +126 -0
- package/dist/components/checkbox.css.cjs +62 -0
- package/dist/components/checkbox.css.d.ts +1 -0
- package/dist/components/checkbox.css.js +62 -0
- package/dist/components/dialog.css.cjs +81 -0
- package/dist/components/dialog.css.d.ts +1 -0
- package/dist/components/dialog.css.js +81 -0
- package/dist/components/divider.css.cjs +16 -0
- package/dist/components/divider.css.d.ts +1 -0
- package/dist/components/divider.css.js +16 -0
- package/dist/components/helpers.css.cjs +47 -0
- package/dist/components/helpers.css.d.ts +8 -0
- package/dist/components/helpers.css.js +47 -0
- package/dist/components/index.cjs +35 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +35 -0
- package/dist/components/input.css.cjs +46 -0
- package/dist/components/input.css.d.ts +1 -0
- package/dist/components/input.css.js +46 -0
- package/dist/components/label.css.cjs +33 -0
- package/dist/components/label.css.d.ts +1 -0
- package/dist/components/label.css.js +33 -0
- package/dist/components/link.css.cjs +56 -0
- package/dist/components/link.css.d.ts +1 -0
- package/dist/components/link.css.js +56 -0
- package/dist/components/popover.css.cjs +37 -0
- package/dist/components/popover.css.d.ts +1 -0
- package/dist/components/popover.css.js +37 -0
- package/dist/components/progress.css.cjs +57 -0
- package/dist/components/progress.css.d.ts +1 -0
- package/dist/components/progress.css.js +57 -0
- package/dist/components/radio.css.cjs +63 -0
- package/dist/components/radio.css.d.ts +1 -0
- package/dist/components/radio.css.js +63 -0
- package/dist/components/select.css.cjs +53 -0
- package/dist/components/select.css.d.ts +1 -0
- package/dist/components/select.css.js +53 -0
- package/dist/components/slider.css.cjs +95 -0
- package/dist/components/slider.css.d.ts +1 -0
- package/dist/components/slider.css.js +95 -0
- package/dist/components/spinner.css.cjs +44 -0
- package/dist/components/spinner.css.d.ts +1 -0
- package/dist/components/spinner.css.js +44 -0
- package/dist/components/switch.css.cjs +66 -0
- package/dist/components/switch.css.d.ts +1 -0
- package/dist/components/switch.css.js +66 -0
- package/dist/components/tooltip.css.cjs +31 -0
- package/dist/components/tooltip.css.d.ts +1 -0
- package/dist/components/tooltip.css.js +31 -0
- package/dist/components/transitions.cjs +4 -0
- package/dist/components/transitions.d.ts +1 -0
- package/dist/components/transitions.js +4 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/momotaro.css.cjs +14 -0
- package/dist/momotaro.css.d.ts +1 -0
- package/dist/momotaro.css.js +14 -0
- package/dist/tokens.css.cjs +86 -0
- package/dist/tokens.css.d.ts +2 -0
- package/dist/tokens.css.js +86 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @blockle/blocks
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const css = require("@vanilla-extract/css");
|
|
5
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
+
const helpers_css = require("./helpers.css.cjs");
|
|
7
|
+
fileScope.setFileScope("src/components/button.css.ts", "@blockle/blocks-theme-momotaro");
|
|
8
|
+
const intentColor = css.createVar();
|
|
9
|
+
const hoverBackgroundColor = css.createVar();
|
|
10
|
+
const button = blocksCore.makeComponentTheme("button", {
|
|
11
|
+
base: css.style([
|
|
12
|
+
blocksCore.sprinkles({
|
|
13
|
+
display: "inline-flex",
|
|
14
|
+
placeItems: "center",
|
|
15
|
+
fontSize: "medium",
|
|
16
|
+
borderRadius: "medium",
|
|
17
|
+
fontWeight: "medium",
|
|
18
|
+
// Space between `startSlot | children | endSlot`
|
|
19
|
+
gap: "small"
|
|
20
|
+
}),
|
|
21
|
+
{
|
|
22
|
+
selectors: {
|
|
23
|
+
"&:hover:not(:disabled)": {
|
|
24
|
+
backgroundColor: hoverBackgroundColor
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
helpers_css.clickable
|
|
29
|
+
]),
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
solid: css.style({
|
|
33
|
+
color: blocksCore.vars.color.white,
|
|
34
|
+
backgroundColor: intentColor,
|
|
35
|
+
border: "none"
|
|
36
|
+
}),
|
|
37
|
+
outline: css.style([
|
|
38
|
+
blocksCore.sprinkles({
|
|
39
|
+
borderWidth: "small"
|
|
40
|
+
}),
|
|
41
|
+
{
|
|
42
|
+
color: intentColor,
|
|
43
|
+
borderStyle: "solid",
|
|
44
|
+
borderColor: intentColor,
|
|
45
|
+
background: "transparent"
|
|
46
|
+
}
|
|
47
|
+
]),
|
|
48
|
+
ghost: css.style({
|
|
49
|
+
color: intentColor,
|
|
50
|
+
background: "transparent"
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
small: css.style([
|
|
55
|
+
blocksCore.sprinkles({
|
|
56
|
+
paddingInline: "large"
|
|
57
|
+
}),
|
|
58
|
+
{
|
|
59
|
+
height: 40
|
|
60
|
+
}
|
|
61
|
+
]),
|
|
62
|
+
medium: css.style([
|
|
63
|
+
blocksCore.sprinkles({
|
|
64
|
+
paddingInline: "xlarge"
|
|
65
|
+
}),
|
|
66
|
+
{
|
|
67
|
+
height: 56
|
|
68
|
+
}
|
|
69
|
+
]),
|
|
70
|
+
large: css.style([
|
|
71
|
+
blocksCore.sprinkles({
|
|
72
|
+
paddingInline: "xlarge"
|
|
73
|
+
}),
|
|
74
|
+
{
|
|
75
|
+
height: 72
|
|
76
|
+
}
|
|
77
|
+
])
|
|
78
|
+
},
|
|
79
|
+
intent: {
|
|
80
|
+
neutral: css.style({
|
|
81
|
+
vars: {
|
|
82
|
+
[intentColor]: blocksCore.vars.color.primary,
|
|
83
|
+
[hoverBackgroundColor]: blocksCore.vars.color.primaryLight
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
danger: css.style({
|
|
87
|
+
vars: {
|
|
88
|
+
[intentColor]: blocksCore.vars.color.danger,
|
|
89
|
+
[hoverBackgroundColor]: "#fff8f7",
|
|
90
|
+
[helpers_css.focusRingColor]: blocksCore.vars.color.danger
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
compoundVariants: [
|
|
96
|
+
{
|
|
97
|
+
variants: {
|
|
98
|
+
variant: "solid",
|
|
99
|
+
intent: "neutral"
|
|
100
|
+
},
|
|
101
|
+
style: css.style({
|
|
102
|
+
vars: {
|
|
103
|
+
[hoverBackgroundColor]: blocksCore.vars.color.primaryDark
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
variants: {
|
|
109
|
+
variant: "solid",
|
|
110
|
+
intent: "danger"
|
|
111
|
+
},
|
|
112
|
+
style: css.style({
|
|
113
|
+
vars: {
|
|
114
|
+
[hoverBackgroundColor]: "#f9b1a9"
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
defaultVariants: {
|
|
120
|
+
size: "small",
|
|
121
|
+
variant: "solid",
|
|
122
|
+
intent: "neutral"
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
fileScope.endFileScope();
|
|
126
|
+
exports.button = button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const button: import('@blockle/blocks-core').ComponentTheme<import('@blockle/blocks-core/dist/config/componentThemes').ButtonTheme> | undefined;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { style, createVar } from "@vanilla-extract/css";
|
|
3
|
+
import { makeComponentTheme, vars, sprinkles } from "@blockle/blocks-core";
|
|
4
|
+
import { focusRingColor, clickable } from "./helpers.css.js";
|
|
5
|
+
setFileScope("src/components/button.css.ts", "@blockle/blocks-theme-momotaro");
|
|
6
|
+
const intentColor = createVar();
|
|
7
|
+
const hoverBackgroundColor = createVar();
|
|
8
|
+
const button = makeComponentTheme("button", {
|
|
9
|
+
base: style([
|
|
10
|
+
sprinkles({
|
|
11
|
+
display: "inline-flex",
|
|
12
|
+
placeItems: "center",
|
|
13
|
+
fontSize: "medium",
|
|
14
|
+
borderRadius: "medium",
|
|
15
|
+
fontWeight: "medium",
|
|
16
|
+
// Space between `startSlot | children | endSlot`
|
|
17
|
+
gap: "small"
|
|
18
|
+
}),
|
|
19
|
+
{
|
|
20
|
+
selectors: {
|
|
21
|
+
"&:hover:not(:disabled)": {
|
|
22
|
+
backgroundColor: hoverBackgroundColor
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
clickable
|
|
27
|
+
]),
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
solid: style({
|
|
31
|
+
color: vars.color.white,
|
|
32
|
+
backgroundColor: intentColor,
|
|
33
|
+
border: "none"
|
|
34
|
+
}),
|
|
35
|
+
outline: style([
|
|
36
|
+
sprinkles({
|
|
37
|
+
borderWidth: "small"
|
|
38
|
+
}),
|
|
39
|
+
{
|
|
40
|
+
color: intentColor,
|
|
41
|
+
borderStyle: "solid",
|
|
42
|
+
borderColor: intentColor,
|
|
43
|
+
background: "transparent"
|
|
44
|
+
}
|
|
45
|
+
]),
|
|
46
|
+
ghost: style({
|
|
47
|
+
color: intentColor,
|
|
48
|
+
background: "transparent"
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
small: style([
|
|
53
|
+
sprinkles({
|
|
54
|
+
paddingInline: "large"
|
|
55
|
+
}),
|
|
56
|
+
{
|
|
57
|
+
height: 40
|
|
58
|
+
}
|
|
59
|
+
]),
|
|
60
|
+
medium: style([
|
|
61
|
+
sprinkles({
|
|
62
|
+
paddingInline: "xlarge"
|
|
63
|
+
}),
|
|
64
|
+
{
|
|
65
|
+
height: 56
|
|
66
|
+
}
|
|
67
|
+
]),
|
|
68
|
+
large: style([
|
|
69
|
+
sprinkles({
|
|
70
|
+
paddingInline: "xlarge"
|
|
71
|
+
}),
|
|
72
|
+
{
|
|
73
|
+
height: 72
|
|
74
|
+
}
|
|
75
|
+
])
|
|
76
|
+
},
|
|
77
|
+
intent: {
|
|
78
|
+
neutral: style({
|
|
79
|
+
vars: {
|
|
80
|
+
[intentColor]: vars.color.primary,
|
|
81
|
+
[hoverBackgroundColor]: vars.color.primaryLight
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
danger: style({
|
|
85
|
+
vars: {
|
|
86
|
+
[intentColor]: vars.color.danger,
|
|
87
|
+
[hoverBackgroundColor]: "#fff8f7",
|
|
88
|
+
[focusRingColor]: vars.color.danger
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
compoundVariants: [
|
|
94
|
+
{
|
|
95
|
+
variants: {
|
|
96
|
+
variant: "solid",
|
|
97
|
+
intent: "neutral"
|
|
98
|
+
},
|
|
99
|
+
style: style({
|
|
100
|
+
vars: {
|
|
101
|
+
[hoverBackgroundColor]: vars.color.primaryDark
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
variants: {
|
|
107
|
+
variant: "solid",
|
|
108
|
+
intent: "danger"
|
|
109
|
+
},
|
|
110
|
+
style: style({
|
|
111
|
+
vars: {
|
|
112
|
+
[hoverBackgroundColor]: "#f9b1a9"
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
defaultVariants: {
|
|
118
|
+
size: "small",
|
|
119
|
+
variant: "solid",
|
|
120
|
+
intent: "neutral"
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
endFileScope();
|
|
124
|
+
export {
|
|
125
|
+
button
|
|
126
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
const helpers_css = require("./helpers.css.cjs");
|
|
7
|
+
const transitions = require("./transitions.cjs");
|
|
8
|
+
fileScope.setFileScope("src/components/checkbox.css.ts", "@blockle/blocks-theme-momotaro");
|
|
9
|
+
const checkbox = blocksCore.makeComponentTheme("checkbox", {
|
|
10
|
+
base: css.style([
|
|
11
|
+
{
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
inlineSize: 24,
|
|
16
|
+
blockSize: 24,
|
|
17
|
+
"@media": {
|
|
18
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
19
|
+
transition: `background-color ${blocksCore.vars.transition.normal}, box-shadow ${blocksCore.vars.transition.fast}`
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
selectors: {
|
|
23
|
+
"&:hover:not(:has(input:disabled))": {
|
|
24
|
+
backgroundColor: blocksCore.vars.color.primaryDark
|
|
25
|
+
},
|
|
26
|
+
"&:has(input:checked)": {
|
|
27
|
+
backgroundColor: blocksCore.vars.color.primary
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
blocksCore.sprinkles({
|
|
32
|
+
backgroundColor: "primaryLight",
|
|
33
|
+
borderRadius: "small"
|
|
34
|
+
}),
|
|
35
|
+
helpers_css.focusable
|
|
36
|
+
]),
|
|
37
|
+
icon: css.style({
|
|
38
|
+
inlineSize: "1rem",
|
|
39
|
+
blockSize: "1rem",
|
|
40
|
+
color: "white",
|
|
41
|
+
transform: "scale(0)",
|
|
42
|
+
selectors: {
|
|
43
|
+
"input:checked ~ &": {
|
|
44
|
+
transform: "scale(1)"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"@media": {
|
|
48
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
49
|
+
transition: `transform ${blocksCore.vars.transition.normal} ${transitions.bounceOut}`
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
label: blocksCore.sprinkles({
|
|
54
|
+
display: "flex",
|
|
55
|
+
flexDirection: "row",
|
|
56
|
+
padding: "xsmall",
|
|
57
|
+
gap: "medium",
|
|
58
|
+
cursor: "pointer"
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
fileScope.endFileScope();
|
|
62
|
+
exports.checkbox = checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkbox: import('@blockle/blocks-core').ComponentTheme<import('@blockle/blocks-core/dist/config/componentThemes').CheckboxTheme> | undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { makeComponentTheme, sprinkles, vars } from "@blockle/blocks-core";
|
|
3
|
+
import { style } from "@vanilla-extract/css";
|
|
4
|
+
import { focusable } from "./helpers.css.js";
|
|
5
|
+
import { bounceOut } from "./transitions.js";
|
|
6
|
+
setFileScope("src/components/checkbox.css.ts", "@blockle/blocks-theme-momotaro");
|
|
7
|
+
const checkbox = makeComponentTheme("checkbox", {
|
|
8
|
+
base: style([
|
|
9
|
+
{
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
inlineSize: 24,
|
|
14
|
+
blockSize: 24,
|
|
15
|
+
"@media": {
|
|
16
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
17
|
+
transition: `background-color ${vars.transition.normal}, box-shadow ${vars.transition.fast}`
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
selectors: {
|
|
21
|
+
"&:hover:not(:has(input:disabled))": {
|
|
22
|
+
backgroundColor: vars.color.primaryDark
|
|
23
|
+
},
|
|
24
|
+
"&:has(input:checked)": {
|
|
25
|
+
backgroundColor: vars.color.primary
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
sprinkles({
|
|
30
|
+
backgroundColor: "primaryLight",
|
|
31
|
+
borderRadius: "small"
|
|
32
|
+
}),
|
|
33
|
+
focusable
|
|
34
|
+
]),
|
|
35
|
+
icon: style({
|
|
36
|
+
inlineSize: "1rem",
|
|
37
|
+
blockSize: "1rem",
|
|
38
|
+
color: "white",
|
|
39
|
+
transform: "scale(0)",
|
|
40
|
+
selectors: {
|
|
41
|
+
"input:checked ~ &": {
|
|
42
|
+
transform: "scale(1)"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"@media": {
|
|
46
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
47
|
+
transition: `transform ${vars.transition.normal} ${bounceOut}`
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
label: sprinkles({
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "row",
|
|
54
|
+
padding: "xsmall",
|
|
55
|
+
gap: "medium",
|
|
56
|
+
cursor: "pointer"
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
endFileScope();
|
|
60
|
+
export {
|
|
61
|
+
checkbox
|
|
62
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
fileScope.setFileScope("src/components/dialog.css.ts", "@blockle/blocks-theme-momotaro");
|
|
7
|
+
const dialog = blocksCore.makeComponentTheme("dialog", {
|
|
8
|
+
dialog: css.style([
|
|
9
|
+
blocksCore.sprinkles({
|
|
10
|
+
display: "flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
padding: "gutter",
|
|
13
|
+
border: "none",
|
|
14
|
+
overflow: "auto",
|
|
15
|
+
borderRadius: "medium",
|
|
16
|
+
boxShadow: "large"
|
|
17
|
+
}),
|
|
18
|
+
{
|
|
19
|
+
maxHeight: "90%",
|
|
20
|
+
minWidth: "300px",
|
|
21
|
+
"::backdrop": {
|
|
22
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
23
|
+
},
|
|
24
|
+
selectors: {
|
|
25
|
+
"&[open]": {
|
|
26
|
+
transform: "translate(0, 0)",
|
|
27
|
+
opacity: 1,
|
|
28
|
+
// @ts-expect-error - Vanilla Extract does not support @starting-style (yet)
|
|
29
|
+
"@starting-style": {
|
|
30
|
+
transform: "translate(0, -120px)",
|
|
31
|
+
opacity: 0
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"&[open]::backdrop": {
|
|
35
|
+
opacity: 1,
|
|
36
|
+
"@starting-style": {
|
|
37
|
+
opacity: 0
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
// Apply the animation only if the user has not requested reduced motion
|
|
42
|
+
"@media": {
|
|
43
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
44
|
+
// Ending style
|
|
45
|
+
transform: "translate(0, -120px)",
|
|
46
|
+
opacity: 0,
|
|
47
|
+
transitionBehavior: "allow-discrete",
|
|
48
|
+
transitionProperty: "opacity, transform, overlay, display",
|
|
49
|
+
transitionDuration: "240ms, 160ms, 240ms, 240ms",
|
|
50
|
+
"::backdrop": {
|
|
51
|
+
opacity: 0,
|
|
52
|
+
transitionBehavior: "allow-discrete",
|
|
53
|
+
transitionProperty: "opacity, overlay, display",
|
|
54
|
+
transitionDuration: "160ms, 240ms, 240ms"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]),
|
|
60
|
+
variants: {
|
|
61
|
+
size: {
|
|
62
|
+
small: css.style({
|
|
63
|
+
width: "400px",
|
|
64
|
+
maxWidth: "min(400px, 90%)"
|
|
65
|
+
}),
|
|
66
|
+
medium: css.style({
|
|
67
|
+
width: "600px",
|
|
68
|
+
maxWidth: "min(600px, 90%)"
|
|
69
|
+
}),
|
|
70
|
+
large: css.style({
|
|
71
|
+
width: "800px",
|
|
72
|
+
maxWidth: "min(800px, 90%)"
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: "small"
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
fileScope.endFileScope();
|
|
81
|
+
exports.dialog = dialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dialog: import('@blockle/blocks-core').ComponentTheme<import('@blockle/blocks-core/dist/config/componentThemes').DialogTheme> | undefined;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { makeComponentTheme, sprinkles } from "@blockle/blocks-core";
|
|
3
|
+
import { style } from "@vanilla-extract/css";
|
|
4
|
+
setFileScope("src/components/dialog.css.ts", "@blockle/blocks-theme-momotaro");
|
|
5
|
+
const dialog = makeComponentTheme("dialog", {
|
|
6
|
+
dialog: style([
|
|
7
|
+
sprinkles({
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
padding: "gutter",
|
|
11
|
+
border: "none",
|
|
12
|
+
overflow: "auto",
|
|
13
|
+
borderRadius: "medium",
|
|
14
|
+
boxShadow: "large"
|
|
15
|
+
}),
|
|
16
|
+
{
|
|
17
|
+
maxHeight: "90%",
|
|
18
|
+
minWidth: "300px",
|
|
19
|
+
"::backdrop": {
|
|
20
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
21
|
+
},
|
|
22
|
+
selectors: {
|
|
23
|
+
"&[open]": {
|
|
24
|
+
transform: "translate(0, 0)",
|
|
25
|
+
opacity: 1,
|
|
26
|
+
// @ts-expect-error - Vanilla Extract does not support @starting-style (yet)
|
|
27
|
+
"@starting-style": {
|
|
28
|
+
transform: "translate(0, -120px)",
|
|
29
|
+
opacity: 0
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"&[open]::backdrop": {
|
|
33
|
+
opacity: 1,
|
|
34
|
+
"@starting-style": {
|
|
35
|
+
opacity: 0
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
// Apply the animation only if the user has not requested reduced motion
|
|
40
|
+
"@media": {
|
|
41
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
42
|
+
// Ending style
|
|
43
|
+
transform: "translate(0, -120px)",
|
|
44
|
+
opacity: 0,
|
|
45
|
+
transitionBehavior: "allow-discrete",
|
|
46
|
+
transitionProperty: "opacity, transform, overlay, display",
|
|
47
|
+
transitionDuration: "240ms, 160ms, 240ms, 240ms",
|
|
48
|
+
"::backdrop": {
|
|
49
|
+
opacity: 0,
|
|
50
|
+
transitionBehavior: "allow-discrete",
|
|
51
|
+
transitionProperty: "opacity, overlay, display",
|
|
52
|
+
transitionDuration: "160ms, 240ms, 240ms"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]),
|
|
58
|
+
variants: {
|
|
59
|
+
size: {
|
|
60
|
+
small: style({
|
|
61
|
+
width: "400px",
|
|
62
|
+
maxWidth: "min(400px, 90%)"
|
|
63
|
+
}),
|
|
64
|
+
medium: style({
|
|
65
|
+
width: "600px",
|
|
66
|
+
maxWidth: "min(600px, 90%)"
|
|
67
|
+
}),
|
|
68
|
+
large: style({
|
|
69
|
+
width: "800px",
|
|
70
|
+
maxWidth: "min(800px, 90%)"
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: {
|
|
75
|
+
size: "small"
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
endFileScope();
|
|
79
|
+
export {
|
|
80
|
+
dialog
|
|
81
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
fileScope.setFileScope("src/components/divider.css.ts", "@blockle/blocks-theme-momotaro");
|
|
7
|
+
const divider = blocksCore.makeComponentTheme("divider", {
|
|
8
|
+
base: css.style({
|
|
9
|
+
blockSize: 1
|
|
10
|
+
}),
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
color: "textLight"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fileScope.endFileScope();
|
|
16
|
+
exports.divider = divider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const divider: import('@blockle/blocks-core').ComponentTheme<import('@blockle/blocks-core/dist/config/componentThemes').DividerTheme> | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { makeComponentTheme } from "@blockle/blocks-core";
|
|
3
|
+
import { style } from "@vanilla-extract/css";
|
|
4
|
+
setFileScope("src/components/divider.css.ts", "@blockle/blocks-theme-momotaro");
|
|
5
|
+
const divider = makeComponentTheme("divider", {
|
|
6
|
+
base: style({
|
|
7
|
+
blockSize: 1
|
|
8
|
+
}),
|
|
9
|
+
defaultVariants: {
|
|
10
|
+
color: "textLight"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
endFileScope();
|
|
14
|
+
export {
|
|
15
|
+
divider
|
|
16
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
fileScope.setFileScope("src/components/helpers.css.ts", "@blockle/blocks-theme-momotaro");
|
|
7
|
+
const focusRingColor = css.createVar();
|
|
8
|
+
const focusable = css.style({
|
|
9
|
+
"@media": {
|
|
10
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
11
|
+
transition: `box-shadow ${blocksCore.vars.transition.fast}`
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
":focus-visible": {
|
|
15
|
+
outline: "2px solid transparent",
|
|
16
|
+
outlineOffset: "2px",
|
|
17
|
+
boxShadow: `0 0 1px 2px ${css.fallbackVar(focusRingColor, "#AF8EFF")}`
|
|
18
|
+
},
|
|
19
|
+
selectors: {
|
|
20
|
+
"&:disabled, &[disabled]": {
|
|
21
|
+
opacity: 0.5,
|
|
22
|
+
cursor: "auto",
|
|
23
|
+
pointerEvents: "none"
|
|
24
|
+
},
|
|
25
|
+
"&:has(input:focus-visible)": {
|
|
26
|
+
outline: "2px solid transparent",
|
|
27
|
+
outlineOffset: "2px",
|
|
28
|
+
boxShadow: blocksCore.vars.focus.boxShadow
|
|
29
|
+
},
|
|
30
|
+
"&:has(input:disabled)": {
|
|
31
|
+
opacity: 0.5,
|
|
32
|
+
cursor: "auto"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const clickable = css.style([
|
|
37
|
+
focusable,
|
|
38
|
+
{
|
|
39
|
+
":active": {
|
|
40
|
+
transform: "scale(0.975)"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
fileScope.endFileScope();
|
|
45
|
+
exports.clickable = clickable;
|
|
46
|
+
exports.focusRingColor = focusRingColor;
|
|
47
|
+
exports.focusable = focusable;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const focusRingColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
2
|
+
/**
|
|
3
|
+
* NOTE: When the original element has a transition, make sure to include
|
|
4
|
+
* `box-shadow ${vars.transition.fast}` in the transition property for the
|
|
5
|
+
* focus transition to work correctly.
|
|
6
|
+
*/
|
|
7
|
+
export declare const focusable: string;
|
|
8
|
+
export declare const clickable: string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { vars } from "@blockle/blocks-core";
|
|
3
|
+
import { style, fallbackVar, createVar } from "@vanilla-extract/css";
|
|
4
|
+
setFileScope("src/components/helpers.css.ts", "@blockle/blocks-theme-momotaro");
|
|
5
|
+
const focusRingColor = createVar();
|
|
6
|
+
const focusable = style({
|
|
7
|
+
"@media": {
|
|
8
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
9
|
+
transition: `box-shadow ${vars.transition.fast}`
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
":focus-visible": {
|
|
13
|
+
outline: "2px solid transparent",
|
|
14
|
+
outlineOffset: "2px",
|
|
15
|
+
boxShadow: `0 0 1px 2px ${fallbackVar(focusRingColor, "#AF8EFF")}`
|
|
16
|
+
},
|
|
17
|
+
selectors: {
|
|
18
|
+
"&:disabled, &[disabled]": {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
cursor: "auto",
|
|
21
|
+
pointerEvents: "none"
|
|
22
|
+
},
|
|
23
|
+
"&:has(input:focus-visible)": {
|
|
24
|
+
outline: "2px solid transparent",
|
|
25
|
+
outlineOffset: "2px",
|
|
26
|
+
boxShadow: vars.focus.boxShadow
|
|
27
|
+
},
|
|
28
|
+
"&:has(input:disabled)": {
|
|
29
|
+
opacity: 0.5,
|
|
30
|
+
cursor: "auto"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const clickable = style([
|
|
35
|
+
focusable,
|
|
36
|
+
{
|
|
37
|
+
":active": {
|
|
38
|
+
transform: "scale(0.975)"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
42
|
+
endFileScope();
|
|
43
|
+
export {
|
|
44
|
+
clickable,
|
|
45
|
+
focusRingColor,
|
|
46
|
+
focusable
|
|
47
|
+
};
|