@blockle/blocks 0.8.5 → 0.8.7
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 +19 -18
- package/dist/index.cjs +60 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +63 -4
- package/dist/momotaro.chunk.d.ts +118 -94
- package/dist/styles/components/Switch/switch.css.cjs +26 -0
- package/dist/styles/components/Switch/switch.css.mjs +27 -0
- package/dist/styles/lib/css/atoms/atomicProperties.cjs +1 -0
- package/dist/styles/lib/css/atoms/atomicProperties.mjs +1 -0
- package/dist/styles/lib/css/style/style.cjs +28 -0
- package/dist/styles/lib/css/style/style.mjs +29 -0
- package/dist/styles/themes/momotaro/components/button.css.cjs +65 -76
- package/dist/styles/themes/momotaro/components/button.css.mjs +62 -73
- package/dist/styles/themes/momotaro/components/helpers.css.cjs +5 -5
- package/dist/styles/themes/momotaro/components/helpers.css.mjs +6 -6
- package/dist/styles/themes/momotaro/components/index.cjs +3 -1
- package/dist/styles/themes/momotaro/components/index.mjs +3 -1
- package/dist/styles/themes/momotaro/components/progress.css.cjs +15 -5
- package/dist/styles/themes/momotaro/components/progress.css.mjs +15 -5
- package/dist/styles/themes/momotaro/components/switch.css.cjs +58 -0
- package/dist/styles/themes/momotaro/components/switch.css.mjs +59 -0
- package/package.json +14 -13
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
2
|
import { keyframes, style } from "@vanilla-extract/css";
|
|
3
3
|
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
4
|
+
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
4
5
|
import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
|
|
5
6
|
setFileScope("src/themes/momotaro/components/progress.css.ts?used", "blocks");
|
|
6
7
|
const indeterminateAnimation = keyframes({
|
|
@@ -12,15 +13,15 @@ const indeterminateAnimation = keyframes({
|
|
|
12
13
|
}
|
|
13
14
|
}, "indeterminateAnimation");
|
|
14
15
|
const progress = makeComponentTheme("progress", {
|
|
15
|
-
|
|
16
|
-
height:
|
|
16
|
+
base: style([{
|
|
17
|
+
height: 8
|
|
17
18
|
}, atoms({
|
|
18
19
|
width: "full",
|
|
19
20
|
borderRadius: "small",
|
|
20
21
|
backgroundColor: "textLight",
|
|
21
22
|
color: "primary",
|
|
22
23
|
overflow: "hidden"
|
|
23
|
-
})], "
|
|
24
|
+
})], "progress_base"),
|
|
24
25
|
bar: style({
|
|
25
26
|
borderRadius: "inherit",
|
|
26
27
|
"@media": {
|
|
@@ -31,10 +32,19 @@ const progress = makeComponentTheme("progress", {
|
|
|
31
32
|
}, "progress_bar"),
|
|
32
33
|
variants: {
|
|
33
34
|
indeterminate: style({
|
|
34
|
-
animation: `${indeterminateAnimation} 10s ease-in-out infinite`,
|
|
35
35
|
"@media": {
|
|
36
|
+
// For reduce motion we show a striped pattern instead of animating
|
|
37
|
+
"(prefers-reduced-motion: reduce)": {
|
|
38
|
+
backgroundImage: `repeating-linear-gradient(
|
|
39
|
+
45deg,
|
|
40
|
+
transparent,
|
|
41
|
+
transparent 20px,
|
|
42
|
+
${vars.color.primaryDark} 20px,
|
|
43
|
+
${vars.color.primaryDark} 40px
|
|
44
|
+
)`
|
|
45
|
+
},
|
|
36
46
|
"(prefers-reduced-motion: no-preference)": {
|
|
37
|
-
|
|
47
|
+
animation: `${indeterminateAnimation} 3s ease-in-out infinite`
|
|
38
48
|
}
|
|
39
49
|
}
|
|
40
50
|
}, "progress_variants_indeterminate")
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
+
const css = require("@vanilla-extract/css");
|
|
4
|
+
const styles_lib_css_style_style_cjs = require("../../../lib/css/style/style.cjs");
|
|
5
|
+
const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
|
|
6
|
+
const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
|
|
7
|
+
const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
|
|
8
|
+
fileScope.setFileScope("src/themes/momotaro/components/switch.css.ts?used", "blocks");
|
|
9
|
+
const activeScaleFactor = css.createVar("activeScaleFactor");
|
|
10
|
+
const switchTheme = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("switch", {
|
|
11
|
+
base: styles_lib_css_style_style_cjs.style([{
|
|
12
|
+
width: 52,
|
|
13
|
+
height: 32,
|
|
14
|
+
borderRadius: "xlarge",
|
|
15
|
+
backgroundColor: "textLight",
|
|
16
|
+
"@media": {
|
|
17
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
18
|
+
transition: "background-color 120ms linear"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
selectors: {
|
|
22
|
+
'&[data-checked="true"]': {
|
|
23
|
+
backgroundColor: styles_lib_theme_vars_css_cjs.vars.color.secondary
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
// Scale the switch when it's `:active`
|
|
27
|
+
vars: {
|
|
28
|
+
[activeScaleFactor]: "1"
|
|
29
|
+
},
|
|
30
|
+
":active": {
|
|
31
|
+
vars: {
|
|
32
|
+
[activeScaleFactor]: "0.96"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, styles_themes_momotaro_components_helpers_css_cjs.focusable]),
|
|
36
|
+
slider: styles_lib_css_style_style_cjs.style({
|
|
37
|
+
width: 24,
|
|
38
|
+
height: 24,
|
|
39
|
+
top: 4,
|
|
40
|
+
left: 4,
|
|
41
|
+
transform: `translateX(0) scale(calc(0.9 * ${activeScaleFactor}))`,
|
|
42
|
+
position: "absolute",
|
|
43
|
+
backgroundColor: "white",
|
|
44
|
+
borderRadius: "xlarge",
|
|
45
|
+
selectors: {
|
|
46
|
+
'&[data-checked="true"]': {
|
|
47
|
+
transform: `translateX(20px) scale(${activeScaleFactor})`
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"@media": {
|
|
51
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
52
|
+
transition: "transform 120ms ease-out"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
fileScope.endFileScope();
|
|
58
|
+
exports.switchTheme = switchTheme;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { createVar } from "@vanilla-extract/css";
|
|
3
|
+
import { style } from "../../../lib/css/style/style.mjs";
|
|
4
|
+
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
5
|
+
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
6
|
+
import { focusable } from "./helpers.css.mjs";
|
|
7
|
+
setFileScope("src/themes/momotaro/components/switch.css.ts?used", "blocks");
|
|
8
|
+
const activeScaleFactor = createVar("activeScaleFactor");
|
|
9
|
+
const switchTheme = makeComponentTheme("switch", {
|
|
10
|
+
base: style([{
|
|
11
|
+
width: 52,
|
|
12
|
+
height: 32,
|
|
13
|
+
borderRadius: "xlarge",
|
|
14
|
+
backgroundColor: "textLight",
|
|
15
|
+
"@media": {
|
|
16
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
17
|
+
transition: "background-color 120ms linear"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
selectors: {
|
|
21
|
+
'&[data-checked="true"]': {
|
|
22
|
+
backgroundColor: vars.color.secondary
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// Scale the switch when it's `:active`
|
|
26
|
+
vars: {
|
|
27
|
+
[activeScaleFactor]: "1"
|
|
28
|
+
},
|
|
29
|
+
":active": {
|
|
30
|
+
vars: {
|
|
31
|
+
[activeScaleFactor]: "0.96"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, focusable]),
|
|
35
|
+
slider: style({
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24,
|
|
38
|
+
top: 4,
|
|
39
|
+
left: 4,
|
|
40
|
+
transform: `translateX(0) scale(calc(0.9 * ${activeScaleFactor}))`,
|
|
41
|
+
position: "absolute",
|
|
42
|
+
backgroundColor: "white",
|
|
43
|
+
borderRadius: "xlarge",
|
|
44
|
+
selectors: {
|
|
45
|
+
'&[data-checked="true"]': {
|
|
46
|
+
transform: `translateX(20px) scale(${activeScaleFactor})`
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"@media": {
|
|
50
|
+
"(prefers-reduced-motion: no-preference)": {
|
|
51
|
+
transition: "transform 120ms ease-out"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
endFileScope();
|
|
57
|
+
export {
|
|
58
|
+
switchTheme
|
|
59
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockle/blocks",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "Blocks design system",
|
|
5
5
|
"repository": "git@github.com:Blockle/blocks.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,26 +60,27 @@
|
|
|
60
60
|
"@changesets/cli": "^2.26.2",
|
|
61
61
|
"@crackle/cli": "^0.12.4",
|
|
62
62
|
"@crackle/core": "^0.28.0",
|
|
63
|
-
"@storybook/addon-a11y": "^7.5.
|
|
63
|
+
"@storybook/addon-a11y": "^7.5.3",
|
|
64
64
|
"@storybook/addon-coverage": "^0.0.9",
|
|
65
|
-
"@storybook/addon-essentials": "^7.5.
|
|
66
|
-
"@storybook/addon-interactions": "^7.5.
|
|
67
|
-
"@storybook/addon-links": "^7.5.
|
|
68
|
-
"@storybook/blocks": "^7.5.
|
|
65
|
+
"@storybook/addon-essentials": "^7.5.3",
|
|
66
|
+
"@storybook/addon-interactions": "^7.5.3",
|
|
67
|
+
"@storybook/addon-links": "^7.5.3",
|
|
68
|
+
"@storybook/blocks": "^7.5.3",
|
|
69
69
|
"@storybook/jest": "^0.2.3",
|
|
70
|
-
"@storybook/react": "^7.5.
|
|
71
|
-
"@storybook/react-vite": "^7.5.
|
|
70
|
+
"@storybook/react": "^7.5.3",
|
|
71
|
+
"@storybook/react-vite": "^7.5.3",
|
|
72
72
|
"@storybook/testing-library": "^0.2.2",
|
|
73
73
|
"@testing-library/jest-dom": "^6.1.4",
|
|
74
|
-
"@testing-library/react": "^14.
|
|
74
|
+
"@testing-library/react": "^14.1.0",
|
|
75
75
|
"@types/react": "^18.2.34",
|
|
76
76
|
"@types/react-dom": "^18.2.14",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
78
|
-
"@typescript-eslint/parser": "^6.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
|
78
|
+
"@typescript-eslint/parser": "^6.10.0",
|
|
79
79
|
"@vanilla-extract/vite-plugin": "^3.8.2",
|
|
80
80
|
"@vitest/coverage-v8": "^0.34.6",
|
|
81
|
+
"autoprefixer": "^10.4.16",
|
|
81
82
|
"cross-env": "^7.0.3",
|
|
82
|
-
"eslint": "^8.
|
|
83
|
+
"eslint": "^8.53.0",
|
|
83
84
|
"eslint-config-prettier": "^9.0.0",
|
|
84
85
|
"eslint-plugin-jest": "^27.6.0",
|
|
85
86
|
"eslint-plugin-prettier": "^5.0.1",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"jsdom": "^22.1.0",
|
|
91
92
|
"prettier": "^3.0.3",
|
|
92
93
|
"prop-types": "^15.8.1",
|
|
93
|
-
"storybook": "^7.5.
|
|
94
|
+
"storybook": "^7.5.3",
|
|
94
95
|
"typescript": "^5.2.2",
|
|
95
96
|
"vitest": "^0.34.6"
|
|
96
97
|
},
|