@blockle/blocks-theme-momotaro 7.0.0 → 7.2.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.
@@ -18,7 +18,7 @@ const alert = makeComponentTheme(
18
18
  }),
19
19
  variants: {
20
20
  intent: {
21
- error: intentStyle(vars.colorRole.danger),
21
+ danger: intentStyle(vars.colorRole.danger),
22
22
  info: intentStyle(vars.colorRole.info),
23
23
  success: intentStyle(vars.colorRole.success),
24
24
  warning: intentStyle(vars.colorRole.warning)
@@ -1 +1 @@
1
- {"version":3,"file":"button.css.d.ts","sourceRoot":"","sources":["../../src/components/button.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAW9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAmIlD,CAAC"}
1
+ {"version":3,"file":"button.css.d.ts","sourceRoot":"","sources":["../../src/components/button.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAW9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAiDlD,CAAC"}
@@ -1,75 +1,30 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
3
- import { style, createVar } from "@vanilla-extract/css";
4
- import { clickable } from "./helpers.css.js";
2
+ import { makeComponentTheme, atoms } from "@blockle/blocks-core";
3
+ import { style } from "@vanilla-extract/css";
4
+ import { buttonIntent, buttonVariant, buttonHeight, buttonBase, buttonRadius } from "./buttonBase.css.js";
5
5
  setFileScope("src/components/button.css.ts", "@blockle/blocks-theme-momotaro");
6
- const solidColor = createVar();
7
- const solidHoverColor = createVar();
8
- const subtleColor = createVar();
9
- const contrastColor = createVar();
10
6
  const button = makeComponentTheme(
11
7
  "button",
12
8
  {
13
9
  root: style([
14
10
  atoms({
15
- display: "inline-flex",
16
- placeItems: "center",
17
11
  fontSize: "medium",
18
- borderRadius: 2,
19
12
  fontWeight: "medium",
20
13
  gap: 2,
21
14
  paddingBlock: 1
22
15
  }),
23
- {
24
- selectors: {}
25
- },
26
- clickable
16
+ buttonBase,
17
+ buttonRadius
27
18
  ]),
28
19
  variants: {
29
- variant: {
30
- solid: style({
31
- color: contrastColor,
32
- backgroundColor: solidColor,
33
- border: "none",
34
- selectors: {
35
- "&:hover:not(:disabled)": {
36
- backgroundColor: solidHoverColor
37
- }
38
- }
39
- }),
40
- outline: style([
41
- atoms({
42
- borderWidth: "thin"
43
- }),
44
- {
45
- color: solidColor,
46
- borderStyle: "solid",
47
- borderColor: solidColor,
48
- background: "transparent",
49
- selectors: {
50
- "&:hover:not(:disabled)": {
51
- backgroundColor: subtleColor
52
- }
53
- }
54
- }
55
- ]),
56
- ghost: style({
57
- color: solidColor,
58
- background: "transparent",
59
- selectors: {
60
- "&:hover:not(:disabled)": {
61
- backgroundColor: subtleColor
62
- }
63
- }
64
- })
65
- },
20
+ variant: buttonVariant,
66
21
  size: {
67
22
  small: style([
68
23
  atoms({
69
24
  paddingInline: 3
70
25
  }),
71
26
  {
72
- minHeight: 40
27
+ minHeight: buttonHeight.small
73
28
  }
74
29
  ]),
75
30
  medium: style([
@@ -77,7 +32,7 @@ const button = makeComponentTheme(
77
32
  paddingInline: 4
78
33
  }),
79
34
  {
80
- minHeight: 48
35
+ minHeight: buttonHeight.medium
81
36
  }
82
37
  ]),
83
38
  large: style([
@@ -85,52 +40,11 @@ const button = makeComponentTheme(
85
40
  paddingInline: 5
86
41
  }),
87
42
  {
88
- minHeight: 56
43
+ minHeight: buttonHeight.large
89
44
  }
90
45
  ])
91
46
  },
92
- intent: {
93
- neutral: style({
94
- vars: {
95
- [solidColor]: vars.colorRole.neutral.solid,
96
- [solidHoverColor]: vars.colorRole.neutral.solidHover,
97
- [subtleColor]: vars.colorRole.neutral.subtle,
98
- [contrastColor]: vars.colorRole.neutral.contrast
99
- }
100
- }),
101
- primary: style({
102
- vars: {
103
- [solidColor]: vars.colorRole.primary.solid,
104
- [solidHoverColor]: vars.colorRole.primary.solidHover,
105
- [subtleColor]: vars.colorRole.primary.subtle,
106
- [contrastColor]: vars.colorRole.primary.contrast
107
- }
108
- }),
109
- secondary: style({
110
- vars: {
111
- [solidColor]: vars.colorRole.secondary.solid,
112
- [solidHoverColor]: vars.colorRole.secondary.solidHover,
113
- [subtleColor]: vars.colorRole.secondary.subtle,
114
- [contrastColor]: vars.colorRole.secondary.contrast
115
- }
116
- }),
117
- success: style({
118
- vars: {
119
- [solidColor]: vars.colorRole.success.solid,
120
- [solidHoverColor]: vars.colorRole.success.solidHover,
121
- [subtleColor]: vars.colorRole.success.subtle,
122
- [contrastColor]: vars.colorRole.success.contrast
123
- }
124
- }),
125
- danger: style({
126
- vars: {
127
- [solidColor]: vars.colorRole.danger.solid,
128
- [solidHoverColor]: vars.colorRole.danger.solidHover,
129
- [subtleColor]: vars.colorRole.danger.subtle,
130
- [contrastColor]: vars.colorRole.danger.contrast
131
- }
132
- })
133
- }
47
+ intent: buttonIntent
134
48
  },
135
49
  defaultVariants: {
136
50
  size: "medium",
@@ -0,0 +1,21 @@
1
+ export declare const buttonHeight: {
2
+ readonly small: 40;
3
+ readonly medium: 48;
4
+ readonly large: 56;
5
+ };
6
+ export declare const buttonBase: string;
7
+ export declare const buttonRadius: any;
8
+ export declare const buttonVariant: {
9
+ solid: string;
10
+ outline: string;
11
+ ghost: string;
12
+ };
13
+ export declare const buttonIntent: {
14
+ neutral: string;
15
+ primary: string;
16
+ secondary: string;
17
+ success: string;
18
+ danger: string;
19
+ inherit: string;
20
+ };
21
+ //# sourceMappingURL=buttonBase.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonBase.css.d.ts","sourceRoot":"","sources":["../../src/components/buttonBase.css.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,UAAU,QAMrB,CAAC;AAEH,eAAO,MAAM,YAAY,KAEvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;CAoCzB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;CAgDxB,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { vars, atoms } from "@blockle/blocks-core";
3
+ import { style, createVar } from "@vanilla-extract/css";
4
+ import { clickable } from "./helpers.css.js";
5
+ setFileScope("src/components/buttonBase.css.ts", "@blockle/blocks-theme-momotaro");
6
+ const solidColor = createVar();
7
+ const solidHoverColor = createVar();
8
+ const subtleColor = createVar();
9
+ const contrastColor = createVar();
10
+ const buttonHeight = {
11
+ small: 40,
12
+ medium: 48,
13
+ large: 56
14
+ };
15
+ const buttonBase = style([
16
+ atoms({
17
+ display: "inline-flex",
18
+ placeItems: "center"
19
+ }),
20
+ clickable
21
+ ]);
22
+ const buttonRadius = atoms({
23
+ borderRadius: 2
24
+ });
25
+ const buttonVariant = {
26
+ solid: style({
27
+ color: contrastColor,
28
+ backgroundColor: solidColor,
29
+ border: "none",
30
+ selectors: {
31
+ "&:hover:not(:disabled)": {
32
+ backgroundColor: solidHoverColor
33
+ }
34
+ }
35
+ }),
36
+ outline: style([
37
+ atoms({
38
+ borderWidth: "thin"
39
+ }),
40
+ {
41
+ color: solidColor,
42
+ borderStyle: "solid",
43
+ borderColor: solidColor,
44
+ background: "transparent",
45
+ selectors: {
46
+ "&:hover:not(:disabled)": {
47
+ backgroundColor: subtleColor
48
+ }
49
+ }
50
+ }
51
+ ]),
52
+ ghost: style({
53
+ color: solidColor,
54
+ background: "transparent",
55
+ selectors: {
56
+ "&:hover:not(:disabled)": {
57
+ backgroundColor: subtleColor
58
+ }
59
+ }
60
+ })
61
+ };
62
+ const buttonIntent = {
63
+ neutral: style({
64
+ vars: {
65
+ [solidColor]: vars.colorRole.neutral.solid,
66
+ [solidHoverColor]: vars.colorRole.neutral.solidHover,
67
+ [subtleColor]: vars.colorRole.neutral.subtle,
68
+ [contrastColor]: vars.colorRole.neutral.contrast
69
+ }
70
+ }),
71
+ primary: style({
72
+ vars: {
73
+ [solidColor]: vars.colorRole.primary.solid,
74
+ [solidHoverColor]: vars.colorRole.primary.solidHover,
75
+ [subtleColor]: vars.colorRole.primary.subtle,
76
+ [contrastColor]: vars.colorRole.primary.contrast
77
+ }
78
+ }),
79
+ secondary: style({
80
+ vars: {
81
+ [solidColor]: vars.colorRole.secondary.solid,
82
+ [solidHoverColor]: vars.colorRole.secondary.solidHover,
83
+ [subtleColor]: vars.colorRole.secondary.subtle,
84
+ [contrastColor]: vars.colorRole.secondary.contrast
85
+ }
86
+ }),
87
+ success: style({
88
+ vars: {
89
+ [solidColor]: vars.colorRole.success.solid,
90
+ [solidHoverColor]: vars.colorRole.success.solidHover,
91
+ [subtleColor]: vars.colorRole.success.subtle,
92
+ [contrastColor]: vars.colorRole.success.contrast
93
+ }
94
+ }),
95
+ danger: style({
96
+ vars: {
97
+ [solidColor]: vars.colorRole.danger.solid,
98
+ [solidHoverColor]: vars.colorRole.danger.solidHover,
99
+ [subtleColor]: vars.colorRole.danger.subtle,
100
+ [contrastColor]: vars.colorRole.danger.contrast
101
+ }
102
+ }),
103
+ // Takes the surrounding text color; only used with the ghost and outline variants
104
+ inherit: style({
105
+ vars: {
106
+ [solidColor]: "currentColor",
107
+ [subtleColor]: "color-mix(in srgb, currentColor 12%, transparent)"
108
+ }
109
+ })
110
+ };
111
+ endFileScope();
112
+ export {
113
+ buttonBase,
114
+ buttonHeight,
115
+ buttonIntent,
116
+ buttonRadius,
117
+ buttonVariant
118
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.css.d.ts","sourceRoot":"","sources":["../../src/components/drawer.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAsElD,CAAC"}
1
+ {"version":3,"file":"drawer.css.d.ts","sourceRoot":"","sources":["../../src/components/drawer.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAM9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CA8FlD,CAAC"}
@@ -3,6 +3,7 @@ import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
3
3
  import { style, createVar } from "@vanilla-extract/css";
4
4
  setFileScope("src/components/drawer.css.ts", "@blockle/blocks-theme-momotaro");
5
5
  const startingTransform = createVar();
6
+ const drawerSize = createVar();
6
7
  const drawer = makeComponentTheme(
7
8
  "drawer",
8
9
  {
@@ -53,24 +54,48 @@ const drawer = makeComponentTheme(
53
54
  top: style({
54
55
  vars: {
55
56
  [startingTransform]: "translate(0, -100%)"
56
- }
57
+ },
58
+ height: drawerSize
57
59
  }),
58
60
  right: style({
59
61
  vars: {
60
62
  [startingTransform]: "translate(100%, 0)"
61
- }
63
+ },
64
+ width: drawerSize
62
65
  }),
63
66
  bottom: style({
64
67
  vars: {
65
68
  [startingTransform]: "translate(0, 100%)"
66
- }
69
+ },
70
+ height: drawerSize
67
71
  }),
68
72
  left: style({
69
73
  vars: {
70
74
  [startingTransform]: "translate(-100%, 0)"
75
+ },
76
+ width: drawerSize
77
+ })
78
+ },
79
+ size: {
80
+ small: style({
81
+ vars: {
82
+ [drawerSize]: "min(300px, 100%)"
83
+ }
84
+ }),
85
+ medium: style({
86
+ vars: {
87
+ [drawerSize]: "min(480px, 100%)"
88
+ }
89
+ }),
90
+ large: style({
91
+ vars: {
92
+ [drawerSize]: "min(640px, 100%)"
71
93
  }
72
94
  })
73
95
  }
96
+ },
97
+ defaultVariants: {
98
+ size: "small"
74
99
  }
75
100
  }
76
101
  );
@@ -0,0 +1,3 @@
1
+ import { ThemeComponentsStyles } from '@blockle/blocks-core';
2
+ export declare const iconButton: ThemeComponentsStyles['iconButton'];
3
+ //# sourceMappingURL=iconButton.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconButton.css.d.ts","sourceRoot":"","sources":["../../src/components/iconButton.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AA8B9B,eAAO,MAAM,UAAU,EAAE,qBAAqB,CAAC,YAAY,CA0BvD,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { makeComponentTheme, atoms } from "@blockle/blocks-core";
3
+ import { style, globalStyle } from "@vanilla-extract/css";
4
+ import { buttonIntent, buttonRadius, buttonVariant, buttonBase, buttonHeight } from "./buttonBase.css.js";
5
+ setFileScope("src/components/iconButton.css.ts", "@blockle/blocks-theme-momotaro");
6
+ const sizeStyles = {
7
+ small: style({ blockSize: buttonHeight.small }),
8
+ medium: style({ blockSize: buttonHeight.medium }),
9
+ large: style({ blockSize: buttonHeight.large })
10
+ };
11
+ const iconSize = {
12
+ small: 20,
13
+ medium: 24,
14
+ large: 28
15
+ };
16
+ for (const key of ["small", "medium", "large"]) {
17
+ globalStyle(`${sizeStyles[key]} > svg`, {
18
+ inlineSize: iconSize[key],
19
+ blockSize: iconSize[key]
20
+ });
21
+ }
22
+ const iconButton = makeComponentTheme("iconButton", {
23
+ root: style([
24
+ buttonBase,
25
+ atoms({ justifyContent: "center" }),
26
+ {
27
+ aspectRatio: "1",
28
+ flexShrink: 0,
29
+ padding: 0
30
+ }
31
+ ]),
32
+ variants: {
33
+ variant: buttonVariant,
34
+ size: sizeStyles,
35
+ shape: {
36
+ square: buttonRadius,
37
+ circle: style({ borderRadius: "50%" })
38
+ },
39
+ intent: buttonIntent
40
+ },
41
+ defaultVariants: {
42
+ size: "medium",
43
+ variant: "solid",
44
+ intent: "primary",
45
+ shape: "square"
46
+ }
47
+ });
48
+ endFileScope();
49
+ export {
50
+ iconButton
51
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAwBlE,eAAO,MAAM,UAAU,EAAE,qBAsBxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA2BlE,eAAO,MAAM,UAAU,EAAE,qBAyBxB,CAAC"}
@@ -6,6 +6,7 @@ import { divider } from "./divider.css.js";
6
6
  import { drawer } from "./drawer.css.js";
7
7
  import { heading } from "./heading.css.js";
8
8
  import { icon } from "./icon.css.js";
9
+ import { iconButton } from "./iconButton.css.js";
9
10
  import { label } from "./label.css.js";
10
11
  import { link } from "./link.css.js";
11
12
  import { popover } from "./popover.css.js";
@@ -15,9 +16,11 @@ import { select } from "./select.css.js";
15
16
  import { slider } from "./slider.css.js";
16
17
  import { spinner } from "./spinner.css.js";
17
18
  import { switchTheme } from "./switch.css.js";
19
+ import { tag } from "./tag.css.js";
18
20
  import { text } from "./text.css.js";
19
21
  import { textarea } from "./textarea.css.js";
20
22
  import { textInput } from "./textInput.css.js";
23
+ import { toast } from "./toast.css.js";
21
24
  import { tooltip } from "./tooltip.css.js";
22
25
  const components = {
23
26
  alert,
@@ -28,6 +31,7 @@ const components = {
28
31
  drawer,
29
32
  heading,
30
33
  icon,
34
+ iconButton,
31
35
  label,
32
36
  link,
33
37
  popover,
@@ -37,9 +41,11 @@ const components = {
37
41
  slider,
38
42
  spinner,
39
43
  switch: switchTheme,
44
+ tag,
40
45
  text,
41
46
  textarea,
42
47
  textInput,
48
+ toast,
43
49
  tooltip
44
50
  };
45
51
  export {
@@ -28,7 +28,7 @@ const link = makeComponentTheme("link", {
28
28
  focusable
29
29
  ]),
30
30
  variants: {
31
- variant: {
31
+ intent: {
32
32
  inherit: style({
33
33
  color: "inherit",
34
34
  fontWeight: "inherit"
@@ -37,8 +37,8 @@ const link = makeComponentTheme("link", {
37
37
  color: vars.colorRole.primary.foreground,
38
38
  fontWeight: 500
39
39
  }),
40
- secondary: style({
41
- color: vars.colorRole.secondary.foreground,
40
+ neutral: style({
41
+ color: vars.colorRole.neutral.foreground,
42
42
  fontWeight: 500
43
43
  })
44
44
  },
@@ -47,7 +47,7 @@ const link = makeComponentTheme("link", {
47
47
  })
48
48
  },
49
49
  defaultVariants: {
50
- variant: "primary"
50
+ intent: "primary"
51
51
  }
52
52
  });
53
53
  endFileScope();
@@ -1 +1 @@
1
- {"version":3,"file":"select.css.d.ts","sourceRoot":"","sources":["../../src/components/select.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CA0ClD,CAAC"}
1
+ {"version":3,"file":"select.css.d.ts","sourceRoot":"","sources":["../../src/components/select.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAmElD,CAAC"}
@@ -8,7 +8,6 @@ const select = makeComponentTheme(
8
8
  {
9
9
  select: style([
10
10
  atoms({
11
- paddingInline: 3,
12
11
  paddingBlock: 1,
13
12
  borderRadius: 2,
14
13
  boxShadow: 2
@@ -18,7 +17,6 @@ const select = makeComponentTheme(
18
17
  outline: "none",
19
18
  color: vars.colorRole.text.default,
20
19
  backgroundColor: vars.colorRole.surface.raised,
21
- minHeight: 40,
22
20
  transitionDuration: vars.transition.fast,
23
21
  transitionProperty: "outline-color, outline-offset"
24
22
  },
@@ -36,12 +34,39 @@ const select = makeComponentTheme(
36
34
  }
37
35
  ]),
38
36
  solid: style({})
37
+ },
38
+ size: {
39
+ small: style([
40
+ atoms({
41
+ paddingInline: 3
42
+ }),
43
+ {
44
+ minHeight: 40
45
+ }
46
+ ]),
47
+ medium: style([
48
+ atoms({
49
+ paddingInline: 4
50
+ }),
51
+ {
52
+ minHeight: 48
53
+ }
54
+ ]),
55
+ large: style([
56
+ atoms({
57
+ paddingInline: 5
58
+ }),
59
+ {
60
+ minHeight: 56
61
+ }
62
+ ])
39
63
  }
40
64
  },
41
65
  icon: atoms({
42
66
  paddingInline: 3
43
67
  }),
44
68
  defaultVariants: {
69
+ size: "medium",
45
70
  variant: "solid"
46
71
  }
47
72
  }
@@ -0,0 +1,3 @@
1
+ import { ThemeComponentsStyles } from '@blockle/blocks-core';
2
+ export declare const tag: ThemeComponentsStyles['tag'];
3
+ //# sourceMappingURL=tag.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.css.d.ts","sourceRoot":"","sources":["../../src/components/tag.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAqE9B,eAAO,MAAM,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAsC3C,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
3
+ import { style, createVar, globalStyle } from "@vanilla-extract/css";
4
+ setFileScope("src/components/tag.css.ts", "@blockle/blocks-theme-momotaro");
5
+ const paddingBlock = createVar();
6
+ const paddingInline = createVar();
7
+ const slot = style([
8
+ atoms({
9
+ display: "inline-flex",
10
+ alignItems: "center",
11
+ justifyContent: "center"
12
+ }),
13
+ {
14
+ blockSize: "1lh",
15
+ flexShrink: 0
16
+ }
17
+ ]);
18
+ const startSlot = style([slot]);
19
+ const endSlot = style([slot]);
20
+ const root = style([
21
+ atoms({
22
+ display: "inline-flex",
23
+ alignItems: "center",
24
+ gap: 1,
25
+ borderRadius: "full",
26
+ fontWeight: "medium",
27
+ lineHeight: "normal"
28
+ }),
29
+ {
30
+ verticalAlign: "middle",
31
+ whiteSpace: "nowrap",
32
+ paddingBlock,
33
+ paddingInline,
34
+ selectors: {
35
+ // A Slot sits as close to the rounded edge as to the top and bottom
36
+ [`&:has(> ${startSlot})`]: {
37
+ paddingInlineStart: paddingBlock
38
+ },
39
+ [`&:has(> ${endSlot})`]: {
40
+ paddingInlineEnd: paddingBlock
41
+ }
42
+ }
43
+ }
44
+ ]);
45
+ globalStyle(`${root} > ${slot} > *`, {
46
+ blockSize: "100%",
47
+ inlineSize: "auto",
48
+ maxBlockSize: "100%"
49
+ });
50
+ globalStyle(`${root} > ${slot} > * > svg`, {
51
+ blockSize: "75%",
52
+ inlineSize: "75%"
53
+ });
54
+ const intentStyle = (roles) => style({
55
+ backgroundColor: roles.subtle,
56
+ color: roles.foreground
57
+ });
58
+ const tag = makeComponentTheme("tag", {
59
+ root,
60
+ startSlot,
61
+ endSlot,
62
+ variants: {
63
+ intent: {
64
+ primary: intentStyle(vars.colorRole.primary),
65
+ secondary: intentStyle(vars.colorRole.secondary),
66
+ neutral: intentStyle(vars.colorRole.neutral),
67
+ danger: intentStyle(vars.colorRole.danger),
68
+ success: intentStyle(vars.colorRole.success),
69
+ info: intentStyle(vars.colorRole.info),
70
+ warning: intentStyle(vars.colorRole.warning)
71
+ },
72
+ size: {
73
+ small: style([
74
+ atoms({ fontSize: "xsmall" }),
75
+ { vars: { [paddingBlock]: "2px", [paddingInline]: vars.space[2] } }
76
+ ]),
77
+ medium: style([
78
+ atoms({ fontSize: "small" }),
79
+ { vars: { [paddingBlock]: "2px", [paddingInline]: vars.space[2] } }
80
+ ]),
81
+ large: style([
82
+ atoms({ fontSize: "medium" }),
83
+ {
84
+ vars: {
85
+ [paddingBlock]: vars.space[1],
86
+ [paddingInline]: vars.space[3]
87
+ }
88
+ }
89
+ ])
90
+ }
91
+ },
92
+ defaultVariants: {
93
+ intent: "neutral",
94
+ size: "small"
95
+ }
96
+ });
97
+ endFileScope();
98
+ export {
99
+ tag
100
+ };
@@ -0,0 +1,3 @@
1
+ import { ThemeComponentsStyles } from '@blockle/blocks-core';
2
+ export declare const toast: ThemeComponentsStyles['toast'];
3
+ //# sourceMappingURL=toast.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.css.d.ts","sourceRoot":"","sources":["../../src/components/toast.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAuB9B,eAAO,MAAM,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAqChD,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { makeComponentTheme, atoms } from "@blockle/blocks-core";
3
+ import { style, keyframes, createVar } from "@vanilla-extract/css";
4
+ setFileScope("src/components/toast.css.ts", "@blockle/blocks-theme-momotaro");
5
+ const enterTranslate = createVar();
6
+ const toastEnter = keyframes({
7
+ from: { opacity: 0, scale: 0.9, translate: enterTranslate },
8
+ to: { opacity: 1, scale: 1, translate: "0 0" }
9
+ });
10
+ const top = style({
11
+ vars: {
12
+ [enterTranslate]: "0 -20%"
13
+ }
14
+ });
15
+ const bottom = style({
16
+ vars: {
17
+ [enterTranslate]: "0 20%"
18
+ }
19
+ });
20
+ const toast = makeComponentTheme(
21
+ "toast",
22
+ {
23
+ root: style([
24
+ atoms({
25
+ gap: 2,
26
+ padding: 2
27
+ }),
28
+ {
29
+ maxWidth: "min(100%, 400px)"
30
+ }
31
+ ]),
32
+ toast: style([
33
+ atoms({
34
+ boxShadow: 3
35
+ }),
36
+ {
37
+ "@media": {
38
+ "(prefers-reduced-motion: no-preference)": {
39
+ animationName: toastEnter,
40
+ animationDuration: "240ms",
41
+ animationTimingFunction: "ease-out"
42
+ }
43
+ }
44
+ }
45
+ ]),
46
+ variants: {
47
+ placement: {
48
+ top,
49
+ "top-start": top,
50
+ "top-end": top,
51
+ bottom,
52
+ "bottom-start": bottom,
53
+ "bottom-end": bottom
54
+ }
55
+ }
56
+ }
57
+ );
58
+ endFileScope();
59
+ export {
60
+ toast
61
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockle/blocks-theme-momotaro",
3
- "version": "7.0.0",
3
+ "version": "7.2.0",
4
4
  "description": "Momotaro theme for Blocks",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,7 +34,7 @@
34
34
  "@vanilla-extract/css": "^1.18.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@blockle/blocks-core": ">=3.0.x",
37
+ "@blockle/blocks-core": ">=3.2.x",
38
38
  "@vanilla-extract/css": "^1.18.0"
39
39
  },
40
40
  "publishConfig": {