@blockle/blocks 0.8.9 → 0.9.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.
Files changed (42) hide show
  1. package/dist/index.cjs +6 -4
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.mjs +6 -4
  5. package/dist/momotaro.chunk.d.ts +120 -94
  6. package/dist/styles/components/display/Divider/divider.css.cjs +1 -1
  7. package/dist/styles/components/display/Divider/divider.css.mjs +1 -1
  8. package/dist/styles/components/form/Checkbox/Checkbox.cjs +17 -1
  9. package/dist/styles/components/form/Checkbox/Checkbox.mjs +17 -1
  10. package/dist/styles/components/form/Select/Select.cjs +40 -0
  11. package/dist/styles/components/form/Select/Select.mjs +41 -0
  12. package/dist/styles/components/form/Select/select.css.cjs +37 -0
  13. package/dist/styles/components/form/Select/select.css.mjs +38 -0
  14. package/dist/styles/components/form/Switch/switch.css.cjs +2 -2
  15. package/dist/styles/components/form/Switch/switch.css.mjs +2 -2
  16. package/dist/styles/components/overlay/Dialog/dialog.css.cjs +4 -4
  17. package/dist/styles/components/overlay/Dialog/dialog.css.mjs +4 -4
  18. package/dist/styles/lib/css/atoms/atomicProperties.cjs +28 -22
  19. package/dist/styles/lib/css/atoms/atomicProperties.mjs +28 -22
  20. package/dist/styles/lib/css/atoms/sprinkles.css.cjs +4 -7
  21. package/dist/styles/lib/css/atoms/sprinkles.css.mjs +4 -7
  22. package/dist/styles/themes/momotaro/components/button.css.cjs +3 -3
  23. package/dist/styles/themes/momotaro/components/button.css.mjs +3 -3
  24. package/dist/styles/themes/momotaro/components/checkbox.css.cjs +18 -12
  25. package/dist/styles/themes/momotaro/components/checkbox.css.mjs +18 -12
  26. package/dist/styles/themes/momotaro/components/dialog.css.cjs +7 -7
  27. package/dist/styles/themes/momotaro/components/dialog.css.mjs +7 -7
  28. package/dist/styles/themes/momotaro/components/helpers.css.cjs +7 -6
  29. package/dist/styles/themes/momotaro/components/helpers.css.mjs +7 -6
  30. package/dist/styles/themes/momotaro/components/index.cjs +3 -1
  31. package/dist/styles/themes/momotaro/components/index.mjs +3 -1
  32. package/dist/styles/themes/momotaro/components/input.css.cjs +6 -4
  33. package/dist/styles/themes/momotaro/components/input.css.mjs +6 -4
  34. package/dist/styles/themes/momotaro/components/progress.css.cjs +1 -1
  35. package/dist/styles/themes/momotaro/components/progress.css.mjs +1 -1
  36. package/dist/styles/themes/momotaro/components/radio.css.cjs +12 -5
  37. package/dist/styles/themes/momotaro/components/radio.css.mjs +12 -5
  38. package/dist/styles/themes/momotaro/components/select.css.cjs +35 -0
  39. package/dist/styles/themes/momotaro/components/select.css.mjs +36 -0
  40. package/dist/styles/themes/momotaro/components/switch.css.cjs +1 -1
  41. package/dist/styles/themes/momotaro/components/switch.css.mjs +1 -1
  42. package/package.json +1 -1
@@ -14,7 +14,7 @@ const dialog = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("dialo
14
14
  borderRadius: "medium",
15
15
  boxShadow: "large"
16
16
  }), {
17
- minWidth: "300px",
17
+ minInlineSize: "300px",
18
18
  selectors: {
19
19
  "&[data-open]": {
20
20
  transform: "scale(1)"
@@ -46,16 +46,16 @@ const dialog = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("dialo
46
46
  variants: {
47
47
  size: {
48
48
  small: css.style({
49
- width: "400px",
50
- maxWidth: "min(400px, 90vw)"
49
+ inlineSize: "400px",
50
+ maxInlineSize: "min(400px, 90vw)"
51
51
  }, "dialog_variants_size_small"),
52
52
  medium: css.style({
53
- width: "600px",
54
- maxWidth: "min(600px, 90vw)"
53
+ inlineSize: "600px",
54
+ maxInlineSize: "min(600px, 90vw)"
55
55
  }, "dialog_variants_size_medium"),
56
56
  large: css.style({
57
- width: "800px",
58
- maxWidth: "min(800px, 90vw)"
57
+ inlineSize: "800px",
58
+ maxInlineSize: "min(800px, 90vw)"
59
59
  }, "dialog_variants_size_large")
60
60
  }
61
61
  },
@@ -13,7 +13,7 @@ const dialog = makeComponentTheme("dialog", {
13
13
  borderRadius: "medium",
14
14
  boxShadow: "large"
15
15
  }), {
16
- minWidth: "300px",
16
+ minInlineSize: "300px",
17
17
  selectors: {
18
18
  "&[data-open]": {
19
19
  transform: "scale(1)"
@@ -45,16 +45,16 @@ const dialog = makeComponentTheme("dialog", {
45
45
  variants: {
46
46
  size: {
47
47
  small: style({
48
- width: "400px",
49
- maxWidth: "min(400px, 90vw)"
48
+ inlineSize: "400px",
49
+ maxInlineSize: "min(400px, 90vw)"
50
50
  }, "dialog_variants_size_small"),
51
51
  medium: style({
52
- width: "600px",
53
- maxWidth: "min(600px, 90vw)"
52
+ inlineSize: "600px",
53
+ maxInlineSize: "min(600px, 90vw)"
54
54
  }, "dialog_variants_size_medium"),
55
55
  large: style({
56
- width: "800px",
57
- maxWidth: "min(800px, 90vw)"
56
+ inlineSize: "800px",
57
+ maxInlineSize: "min(800px, 90vw)"
58
58
  }, "dialog_variants_size_large")
59
59
  }
60
60
  },
@@ -5,12 +5,15 @@ const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs")
5
5
  fileScope.setFileScope("src/themes/momotaro/components/helpers.css.ts", "blocks");
6
6
  const focusRingColor = css.createVar("focusRingColor");
7
7
  const focusable = css.style({
8
+ "@media": {
9
+ "(prefers-reduced-motion: no-preference)": {
10
+ transition: `box-shadow ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`
11
+ }
12
+ },
8
13
  ":focus-visible": {
9
14
  outline: "2px solid transparent",
10
15
  outlineOffset: "2px",
11
- boxShadow: `0 0 1px 2px ${css.fallbackVar(focusRingColor, "#AF8EFF")}`,
12
- transitionDuration: styles_lib_theme_vars_css_cjs.vars.transition.fast,
13
- transitionProperty: "box-shadow"
16
+ boxShadow: `0 0 1px 2px ${css.fallbackVar(focusRingColor, "#AF8EFF")}`
14
17
  },
15
18
  selectors: {
16
19
  "&:disabled, &[disabled]": {
@@ -21,9 +24,7 @@ const focusable = css.style({
21
24
  "&:has(input:focus-visible)": {
22
25
  outline: "2px solid transparent",
23
26
  outlineOffset: "2px",
24
- boxShadow: styles_lib_theme_vars_css_cjs.vars.focus.boxShadow,
25
- transitionDuration: styles_lib_theme_vars_css_cjs.vars.transition.fast,
26
- transitionProperty: "box-shadow"
27
+ boxShadow: styles_lib_theme_vars_css_cjs.vars.focus.boxShadow
27
28
  },
28
29
  "&:has(input:disabled)": {
29
30
  opacity: 0.5,
@@ -4,12 +4,15 @@ import { vars } from "../../../lib/theme/vars.css.mjs";
4
4
  setFileScope("src/themes/momotaro/components/helpers.css.ts", "blocks");
5
5
  const focusRingColor = createVar("focusRingColor");
6
6
  const focusable = style({
7
+ "@media": {
8
+ "(prefers-reduced-motion: no-preference)": {
9
+ transition: `box-shadow ${vars.transition.fast}`
10
+ }
11
+ },
7
12
  ":focus-visible": {
8
13
  outline: "2px solid transparent",
9
14
  outlineOffset: "2px",
10
- boxShadow: `0 0 1px 2px ${fallbackVar(focusRingColor, "#AF8EFF")}`,
11
- transitionDuration: vars.transition.fast,
12
- transitionProperty: "box-shadow"
15
+ boxShadow: `0 0 1px 2px ${fallbackVar(focusRingColor, "#AF8EFF")}`
13
16
  },
14
17
  selectors: {
15
18
  "&:disabled, &[disabled]": {
@@ -20,9 +23,7 @@ const focusable = style({
20
23
  "&:has(input:focus-visible)": {
21
24
  outline: "2px solid transparent",
22
25
  outlineOffset: "2px",
23
- boxShadow: vars.focus.boxShadow,
24
- transitionDuration: vars.transition.fast,
25
- transitionProperty: "box-shadow"
26
+ boxShadow: vars.focus.boxShadow
26
27
  },
27
28
  "&:has(input:disabled)": {
28
29
  opacity: 0.5,
@@ -9,6 +9,7 @@ const styles_themes_momotaro_components_label_css_cjs = require("./label.css.cjs
9
9
  const styles_themes_momotaro_components_link_css_cjs = require("./link.css.cjs");
10
10
  const styles_themes_momotaro_components_progress_css_cjs = require("./progress.css.cjs");
11
11
  const styles_themes_momotaro_components_radio_css_cjs = require("./radio.css.cjs");
12
+ const styles_themes_momotaro_components_select_css_cjs = require("./select.css.cjs");
12
13
  const styles_themes_momotaro_components_spinner_css_cjs = require("./spinner.css.cjs");
13
14
  const styles_themes_momotaro_components_switch_css_cjs = require("./switch.css.cjs");
14
15
  const components = {
@@ -16,13 +17,14 @@ const components = {
16
17
  checkbox: styles_themes_momotaro_components_checkbox_css_cjs.checkbox,
17
18
  dialog: styles_themes_momotaro_components_dialog_css_cjs.dialog,
18
19
  divider: styles_themes_momotaro_components_divider_css_cjs.divider,
20
+ dropdown: styles_themes_momotaro_components_dropdown_css_cjs.dropdown,
19
21
  input: styles_themes_momotaro_components_input_css_cjs.input,
20
22
  label: styles_themes_momotaro_components_label_css_cjs.label,
21
23
  link: styles_themes_momotaro_components_link_css_cjs.link,
22
24
  progress: styles_themes_momotaro_components_progress_css_cjs.progress,
23
25
  radio: styles_themes_momotaro_components_radio_css_cjs.radio,
26
+ select: styles_themes_momotaro_components_select_css_cjs.select,
24
27
  spinner: styles_themes_momotaro_components_spinner_css_cjs.spinner,
25
- dropdown: styles_themes_momotaro_components_dropdown_css_cjs.dropdown,
26
28
  switch: styles_themes_momotaro_components_switch_css_cjs.switchTheme
27
29
  };
28
30
  exports.components = components;
@@ -8,6 +8,7 @@ import { label } from "./label.css.mjs";
8
8
  import { link } from "./link.css.mjs";
9
9
  import { progress } from "./progress.css.mjs";
10
10
  import { radio } from "./radio.css.mjs";
11
+ import { select } from "./select.css.mjs";
11
12
  import { spinner } from "./spinner.css.mjs";
12
13
  import { switchTheme } from "./switch.css.mjs";
13
14
  const components = {
@@ -15,13 +16,14 @@ const components = {
15
16
  checkbox,
16
17
  dialog,
17
18
  divider,
19
+ dropdown,
18
20
  input,
19
21
  label,
20
22
  link,
21
23
  progress,
22
24
  radio,
25
+ select,
23
26
  spinner,
24
- dropdown,
25
27
  switch: switchTheme
26
28
  };
27
29
  export {
@@ -8,8 +8,7 @@ fileScope.setFileScope("src/themes/momotaro/components/input.css.ts", "blocks");
8
8
  const input = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("input", {
9
9
  input: css.style([styles_lib_css_atoms_sprinkles_css_cjs.atoms({
10
10
  color: "text",
11
- paddingY: "large",
12
- paddingX: "large",
11
+ padding: "large",
13
12
  border: "none",
14
13
  borderRadius: "small"
15
14
  }), {
@@ -22,8 +21,11 @@ const input = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("input"
22
21
  }], "input_input"),
23
22
  container: css.style([{
24
23
  minHeight: 56,
25
- transitionDuration: styles_lib_theme_vars_css_cjs.vars.transition.fast,
26
- transitionProperty: "box-shadow",
24
+ "@media": {
25
+ "(prefers-reduced-motion: no-preference)": {
26
+ transition: `box-shadow ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`
27
+ }
28
+ },
27
29
  ":focus-within": {
28
30
  outline: "2px solid transparent",
29
31
  outlineOffset: "2px",
@@ -7,8 +7,7 @@ setFileScope("src/themes/momotaro/components/input.css.ts", "blocks");
7
7
  const input = makeComponentTheme("input", {
8
8
  input: style([atoms({
9
9
  color: "text",
10
- paddingY: "large",
11
- paddingX: "large",
10
+ padding: "large",
12
11
  border: "none",
13
12
  borderRadius: "small"
14
13
  }), {
@@ -21,8 +20,11 @@ const input = makeComponentTheme("input", {
21
20
  }], "input_input"),
22
21
  container: style([{
23
22
  minHeight: 56,
24
- transitionDuration: vars.transition.fast,
25
- transitionProperty: "box-shadow",
23
+ "@media": {
24
+ "(prefers-reduced-motion: no-preference)": {
25
+ transition: `box-shadow ${vars.transition.fast}`
26
+ }
27
+ },
26
28
  ":focus-within": {
27
29
  outline: "2px solid transparent",
28
30
  outlineOffset: "2px",
@@ -17,7 +17,7 @@ const progress = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("pro
17
17
  base: css.style([{
18
18
  height: 8
19
19
  }, styles_lib_css_atoms_sprinkles_css_cjs.atoms({
20
- width: "full",
20
+ inlineSize: "full",
21
21
  borderRadius: "small",
22
22
  backgroundColor: "textLight",
23
23
  color: "primary",
@@ -16,7 +16,7 @@ const progress = makeComponentTheme("progress", {
16
16
  base: style([{
17
17
  height: 8
18
18
  }, atoms({
19
- width: "full",
19
+ inlineSize: "full",
20
20
  borderRadius: "small",
21
21
  backgroundColor: "textLight",
22
22
  color: "primary",
@@ -12,11 +12,14 @@ const radio = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("radio"
12
12
  display: "flex",
13
13
  alignItems: "center",
14
14
  justifyContent: "center",
15
- width: 24,
16
- height: 24,
15
+ inlineSize: 24,
16
+ blockSize: 24,
17
17
  borderRadius: 12,
18
- transition: `transform ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`,
19
- transitionProperty: "background-color",
18
+ "@media": {
19
+ "(prefers-reduced-motion: no-preference)": {
20
+ transition: `background-color ${styles_lib_theme_vars_css_cjs.vars.transition.fast}, box-shadow ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`
21
+ }
22
+ },
20
23
  ":hover": {
21
24
  backgroundColor: styles_lib_theme_vars_css_cjs.vars.color.primaryDark
22
25
  },
@@ -34,7 +37,11 @@ const radio = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("radio"
34
37
  backgroundColor: "white",
35
38
  borderRadius: "8px",
36
39
  transform: "scale(0)",
37
- transition: `transform ${styles_lib_theme_vars_css_cjs.vars.transition.normal} ${styles_themes_momotaro_components_transitions_cjs.bounceOut}`,
40
+ "@media": {
41
+ "(prefers-reduced-motion: no-preference)": {
42
+ transition: `transform ${styles_lib_theme_vars_css_cjs.vars.transition.normal} ${styles_themes_momotaro_components_transitions_cjs.bounceOut}`
43
+ }
44
+ },
38
45
  selectors: {
39
46
  "input:checked ~ &": {
40
47
  transform: "scale(1)"
@@ -11,11 +11,14 @@ const radio = makeComponentTheme("radio", {
11
11
  display: "flex",
12
12
  alignItems: "center",
13
13
  justifyContent: "center",
14
- width: 24,
15
- height: 24,
14
+ inlineSize: 24,
15
+ blockSize: 24,
16
16
  borderRadius: 12,
17
- transition: `transform ${vars.transition.fast}`,
18
- transitionProperty: "background-color",
17
+ "@media": {
18
+ "(prefers-reduced-motion: no-preference)": {
19
+ transition: `background-color ${vars.transition.fast}, box-shadow ${vars.transition.fast}`
20
+ }
21
+ },
19
22
  ":hover": {
20
23
  backgroundColor: vars.color.primaryDark
21
24
  },
@@ -33,7 +36,11 @@ const radio = makeComponentTheme("radio", {
33
36
  backgroundColor: "white",
34
37
  borderRadius: "8px",
35
38
  transform: "scale(0)",
36
- transition: `transform ${vars.transition.normal} ${bounceOut}`,
39
+ "@media": {
40
+ "(prefers-reduced-motion: no-preference)": {
41
+ transition: `transform ${vars.transition.normal} ${bounceOut}`
42
+ }
43
+ },
37
44
  selectors: {
38
45
  "input:checked ~ &": {
39
46
  transform: "scale(1)"
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ const fileScope = require("@vanilla-extract/css/fileScope");
3
+ const styles_lib_css_style_style_cjs = require("../../../lib/css/style/style.cjs");
4
+ const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
5
+ const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
6
+ const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
7
+ fileScope.setFileScope("src/themes/momotaro/components/select.css.ts", "blocks");
8
+ const select = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("select", {
9
+ // wrapper: style({}),
10
+ select: styles_lib_css_style_style_cjs.style([{
11
+ color: "text",
12
+ padding: "large",
13
+ border: "none",
14
+ outline: "none",
15
+ backgroundColor: "white",
16
+ borderRadius: "medium",
17
+ boxShadow: "medium",
18
+ minHeight: 56,
19
+ transitionDuration: styles_lib_theme_vars_css_cjs.vars.transition.fast,
20
+ transitionProperty: "box-shadow",
21
+ ":focus-within": {
22
+ outline: "2px solid transparent",
23
+ outlineOffset: "2px",
24
+ boxShadow: `${styles_lib_theme_vars_css_cjs.vars.shadow.small}, ${styles_lib_theme_vars_css_cjs.vars.focus.boxShadow}`
25
+ }
26
+ }, styles_themes_momotaro_components_helpers_css_cjs.focusable]),
27
+ icon: styles_lib_css_style_style_cjs.style({
28
+ paddingInline: "large"
29
+ }),
30
+ defaultVariants: {
31
+ variant: "outline"
32
+ }
33
+ });
34
+ fileScope.endFileScope();
35
+ exports.select = select;
@@ -0,0 +1,36 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { style } from "../../../lib/css/style/style.mjs";
3
+ import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
4
+ import { vars } from "../../../lib/theme/vars.css.mjs";
5
+ import { focusable } from "./helpers.css.mjs";
6
+ setFileScope("src/themes/momotaro/components/select.css.ts", "blocks");
7
+ const select = makeComponentTheme("select", {
8
+ // wrapper: style({}),
9
+ select: style([{
10
+ color: "text",
11
+ padding: "large",
12
+ border: "none",
13
+ outline: "none",
14
+ backgroundColor: "white",
15
+ borderRadius: "medium",
16
+ boxShadow: "medium",
17
+ minHeight: 56,
18
+ transitionDuration: vars.transition.fast,
19
+ transitionProperty: "box-shadow",
20
+ ":focus-within": {
21
+ outline: "2px solid transparent",
22
+ outlineOffset: "2px",
23
+ boxShadow: `${vars.shadow.small}, ${vars.focus.boxShadow}`
24
+ }
25
+ }, focusable]),
26
+ icon: style({
27
+ paddingInline: "large"
28
+ }),
29
+ defaultVariants: {
30
+ variant: "outline"
31
+ }
32
+ });
33
+ endFileScope();
34
+ export {
35
+ select
36
+ };
@@ -15,7 +15,7 @@ const switchTheme = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("
15
15
  backgroundColor: "textLight",
16
16
  "@media": {
17
17
  "(prefers-reduced-motion: no-preference)": {
18
- transition: "background-color 120ms linear"
18
+ transition: `background-color 120ms linear, box-shadow ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`
19
19
  }
20
20
  },
21
21
  selectors: {
@@ -14,7 +14,7 @@ const switchTheme = makeComponentTheme("switch", {
14
14
  backgroundColor: "textLight",
15
15
  "@media": {
16
16
  "(prefers-reduced-motion: no-preference)": {
17
- transition: "background-color 120ms linear"
17
+ transition: `background-color 120ms linear, box-shadow ${vars.transition.fast}`
18
18
  }
19
19
  },
20
20
  selectors: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockle/blocks",
3
- "version": "0.8.9",
3
+ "version": "0.9.0",
4
4
  "description": "Blocks design system",
5
5
  "repository": "git@github.com:Blockle/blocks.git",
6
6
  "license": "MIT",