@blockle/blocks-theme-momotaro 7.2.0 → 7.3.1

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 (61) hide show
  1. package/dist/components/alert.css.d.ts.map +1 -1
  2. package/dist/components/alert.css.js +17 -9
  3. package/dist/components/button.css.d.ts.map +1 -1
  4. package/dist/components/button.css.js +23 -32
  5. package/dist/components/buttonBase.css.d.ts +1 -1
  6. package/dist/components/buttonBase.css.d.ts.map +1 -1
  7. package/dist/components/buttonBase.css.js +99 -59
  8. package/dist/components/checkbox.css.d.ts.map +1 -1
  9. package/dist/components/checkbox.css.js +49 -39
  10. package/dist/components/dialog.css.d.ts.map +1 -1
  11. package/dist/components/dialog.css.js +64 -52
  12. package/dist/components/divider.css.d.ts.map +1 -1
  13. package/dist/components/divider.css.js +28 -12
  14. package/dist/components/drawer.css.d.ts.map +1 -1
  15. package/dist/components/drawer.css.js +85 -57
  16. package/dist/components/heading.css.d.ts.map +1 -1
  17. package/dist/components/heading.css.js +13 -5
  18. package/dist/components/helpers.css.d.ts.map +1 -1
  19. package/dist/components/helpers.css.js +33 -25
  20. package/dist/components/icon.css.d.ts.map +1 -1
  21. package/dist/components/icon.css.js +26 -6
  22. package/dist/components/iconButton.css.d.ts.map +1 -1
  23. package/dist/components/iconButton.css.js +22 -11
  24. package/dist/components/index.d.ts.map +1 -1
  25. package/dist/components/index.js +4 -0
  26. package/dist/components/label.css.d.ts.map +1 -1
  27. package/dist/components/label.css.js +28 -8
  28. package/dist/components/link.css.d.ts.map +1 -1
  29. package/dist/components/link.css.js +46 -26
  30. package/dist/components/menu.css.d.ts +3 -0
  31. package/dist/components/menu.css.d.ts.map +1 -0
  32. package/dist/components/menu.css.js +83 -0
  33. package/dist/components/popover.css.js +31 -31
  34. package/dist/components/progress.css.d.ts.map +1 -1
  35. package/dist/components/progress.css.js +32 -24
  36. package/dist/components/radio.css.d.ts.map +1 -1
  37. package/dist/components/radio.css.js +50 -38
  38. package/dist/components/select.css.d.ts.map +1 -1
  39. package/dist/components/select.css.js +54 -44
  40. package/dist/components/slider.css.d.ts.map +1 -1
  41. package/dist/components/slider.css.js +82 -46
  42. package/dist/components/spinner.css.d.ts.map +1 -1
  43. package/dist/components/spinner.css.js +28 -12
  44. package/dist/components/switch.css.d.ts.map +1 -1
  45. package/dist/components/switch.css.js +48 -46
  46. package/dist/components/tabs.css.d.ts +3 -0
  47. package/dist/components/tabs.css.d.ts.map +1 -0
  48. package/dist/components/tabs.css.js +102 -0
  49. package/dist/components/tag.css.d.ts.map +1 -1
  50. package/dist/components/tag.css.js +66 -57
  51. package/dist/components/text.css.d.ts.map +1 -1
  52. package/dist/components/text.css.js +13 -5
  53. package/dist/components/textInput.css.d.ts.map +1 -1
  54. package/dist/components/textInput.css.js +30 -28
  55. package/dist/components/textarea.css.d.ts.map +1 -1
  56. package/dist/components/textarea.css.js +30 -28
  57. package/dist/components/toast.css.d.ts.map +1 -1
  58. package/dist/components/toast.css.js +32 -24
  59. package/dist/components/tooltip.css.d.ts.map +1 -1
  60. package/dist/components/tooltip.css.js +17 -10
  61. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
2
+ import { makeComponentTheme, vars, layers } from "@blockle/blocks-core";
3
3
  import { style, createVar } from "@vanilla-extract/css";
4
4
  import { focusable } from "./helpers.css.js";
5
5
  setFileScope("src/components/slider.css.ts", "@blockle/blocks-theme-momotaro");
@@ -12,39 +12,51 @@ const slider = makeComponentTheme(
12
12
  "slider",
13
13
  {
14
14
  root: style({
15
- blockSize: "20px"
15
+ "@layer": {
16
+ [layers.theme]: {
17
+ blockSize: "20px"
18
+ }
19
+ }
16
20
  }),
17
- track: style([
18
- atoms({
19
- borderRadius: 1
20
- }),
21
- {
22
- blockSize: "4px",
23
- backgroundColor: trackBackground
21
+ track: style({
22
+ "@layer": {
23
+ [layers.theme]: {
24
+ borderRadius: vars.borderRadius[1],
25
+ blockSize: "4px",
26
+ backgroundColor: trackBackground
27
+ }
24
28
  }
25
- ]),
29
+ }),
26
30
  filledTrack: style({
27
- backgroundColor: filledTrackBackground
31
+ "@layer": {
32
+ [layers.theme]: {
33
+ backgroundColor: filledTrackBackground
34
+ }
35
+ }
28
36
  }),
29
37
  thumb: style([
30
38
  {
31
- backgroundColor: thumbBackground,
32
- borderRadius: "50%",
33
- height: "16px",
34
- width: "16px",
35
- boxShadow: `0 0 0 0px color-mix(in srgb, ${haloColor}, transparent 0%)`,
36
- vars: {
37
- [thumbActive]: `0 0 0 8px color-mix(in srgb, ${haloColor}, transparent 20%)`
38
- },
39
- ":hover": {
40
- boxShadow: thumbActive
41
- },
42
- ":focus-visible": {
43
- boxShadow: thumbActive
44
- },
45
- "@media": {
46
- "(prefers-reduced-motion: no-preference)": {
47
- transition: "box-shadow 0.2s"
39
+ "@layer": {
40
+ [layers.theme]: {
41
+ backgroundColor: thumbBackground,
42
+ borderRadius: "50%",
43
+ height: "16px",
44
+ width: "16px",
45
+ boxShadow: `0 0 0 0px color-mix(in srgb, ${haloColor}, transparent 0%)`,
46
+ vars: {
47
+ [thumbActive]: `0 0 0 8px color-mix(in srgb, ${haloColor}, transparent 20%)`
48
+ },
49
+ ":hover": {
50
+ boxShadow: thumbActive
51
+ },
52
+ ":focus-visible": {
53
+ boxShadow: thumbActive
54
+ },
55
+ "@media": {
56
+ "(prefers-reduced-motion: no-preference)": {
57
+ transition: "box-shadow 0.2s"
58
+ }
59
+ }
48
60
  }
49
61
  }
50
62
  },
@@ -53,39 +65,63 @@ const slider = makeComponentTheme(
53
65
  variants: {
54
66
  size: {
55
67
  small: style({
56
- inlineSize: "100px"
68
+ "@layer": {
69
+ [layers.theme]: {
70
+ inlineSize: "100px"
71
+ }
72
+ }
57
73
  }),
58
74
  medium: style({
59
- inlineSize: "200px"
75
+ "@layer": {
76
+ [layers.theme]: {
77
+ inlineSize: "200px"
78
+ }
79
+ }
60
80
  }),
61
81
  large: style({
62
- inlineSize: "300px"
82
+ "@layer": {
83
+ [layers.theme]: {
84
+ inlineSize: "300px"
85
+ }
86
+ }
63
87
  })
64
88
  },
65
89
  intent: {
66
90
  primary: style({
67
- vars: {
68
- [trackBackground]: vars.colorRole.primary.subtle,
69
- [filledTrackBackground]: vars.colorRole.primary.solid,
70
- [thumbBackground]: vars.colorRole.primary.solid,
71
- [haloColor]: vars.colorRole.primary.subtle
91
+ "@layer": {
92
+ [layers.theme]: {
93
+ vars: {
94
+ [trackBackground]: vars.colorRole.primary.subtle,
95
+ [filledTrackBackground]: vars.colorRole.primary.solid,
96
+ [thumbBackground]: vars.colorRole.primary.solid,
97
+ [haloColor]: vars.colorRole.primary.subtle
98
+ }
99
+ }
72
100
  }
73
101
  }),
74
102
  secondary: style({
75
- vars: {
76
- [trackBackground]: vars.colorRole.secondary.subtle,
77
- [filledTrackBackground]: vars.colorRole.secondary.solid,
78
- [thumbBackground]: vars.colorRole.secondary.solid,
79
- [haloColor]: vars.colorRole.secondary.subtle
103
+ "@layer": {
104
+ [layers.theme]: {
105
+ vars: {
106
+ [trackBackground]: vars.colorRole.secondary.subtle,
107
+ [filledTrackBackground]: vars.colorRole.secondary.solid,
108
+ [thumbBackground]: vars.colorRole.secondary.solid,
109
+ [haloColor]: vars.colorRole.secondary.subtle
110
+ }
111
+ }
80
112
  }
81
113
  })
82
114
  },
83
115
  disabled: style({
84
- pointerEvents: "none",
85
- vars: {
86
- [trackBackground]: vars.colorRole.border.default,
87
- [filledTrackBackground]: vars.colorRole.text.disabled,
88
- [thumbBackground]: vars.colorRole.text.disabled
116
+ "@layer": {
117
+ [layers.theme]: {
118
+ pointerEvents: "none",
119
+ vars: {
120
+ [trackBackground]: vars.colorRole.border.default,
121
+ [filledTrackBackground]: vars.colorRole.text.disabled,
122
+ [thumbBackground]: vars.colorRole.text.disabled
123
+ }
124
+ }
89
125
  }
90
126
  })
91
127
  },
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.css.d.ts","sourceRoot":"","sources":["../../src/components/spinner.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAY9B,eAAO,MAAM,OAAO,EAAE,qBAAqB,CAAC,SAAS,CA8BpD,CAAC"}
1
+ {"version":3,"file":"spinner.css.d.ts","sourceRoot":"","sources":["../../src/components/spinner.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAY9B,eAAO,MAAM,OAAO,EAAE,qBAAqB,CAAC,SAAS,CA8CpD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme } from "@blockle/blocks-core";
2
+ import { makeComponentTheme, layers } from "@blockle/blocks-core";
3
3
  import { style, keyframes } from "@vanilla-extract/css";
4
4
  setFileScope("src/components/spinner.css.ts", "@blockle/blocks-theme-momotaro");
5
5
  const spinAnimation = keyframes({
@@ -14,25 +14,41 @@ const spinner = makeComponentTheme(
14
14
  "spinner",
15
15
  {
16
16
  root: style({
17
- aspectRatio: "1 / 1",
18
- overflow: "hidden",
19
- borderRadius: "50%",
20
- borderWidth: "3px",
21
- borderStyle: "solid",
22
- borderColor: "currentColor transparent currentColor transparent",
23
- animation: `${spinAnimation} 1.2s linear infinite`
17
+ "@layer": {
18
+ [layers.theme]: {
19
+ aspectRatio: "1 / 1",
20
+ overflow: "hidden",
21
+ borderRadius: "50%",
22
+ borderWidth: "3px",
23
+ borderStyle: "solid",
24
+ borderColor: "currentColor transparent currentColor transparent",
25
+ animation: `${spinAnimation} 1.2s linear infinite`
26
+ }
27
+ }
24
28
  }),
25
29
  variants: {
26
- // note: colors are handled by atoms
30
+ // note: colors come from the color scheme (currentColor)
27
31
  size: {
28
32
  small: style({
29
- width: 16
33
+ "@layer": {
34
+ [layers.theme]: {
35
+ width: 16
36
+ }
37
+ }
30
38
  }),
31
39
  medium: style({
32
- width: 24
40
+ "@layer": {
41
+ [layers.theme]: {
42
+ width: 24
43
+ }
44
+ }
33
45
  }),
34
46
  large: style({
35
- width: 32
47
+ "@layer": {
48
+ [layers.theme]: {
49
+ width: 32
50
+ }
51
+ }
36
52
  })
37
53
  }
38
54
  },
@@ -1 +1 @@
1
- {"version":3,"file":"switch.css.d.ts","sourceRoot":"","sources":["../../src/components/switch.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAO9B,eAAO,MAAM,WAAW,EAAE,qBAAqB,CAAC,QAAQ,CA2DvD,CAAC"}
1
+ {"version":3,"file":"switch.css.d.ts","sourceRoot":"","sources":["../../src/components/switch.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAO9B,eAAO,MAAM,WAAW,EAAE,qBAAqB,CAAC,QAAQ,CA6DvD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
2
+ import { makeComponentTheme, vars, layers } from "@blockle/blocks-core";
3
3
  import { style, createVar } from "@vanilla-extract/css";
4
4
  import { focusable } from "./helpers.css.js";
5
5
  setFileScope("src/components/switch.css.ts", "@blockle/blocks-theme-momotaro");
@@ -8,60 +8,62 @@ const switchTheme = makeComponentTheme(
8
8
  "switch",
9
9
  {
10
10
  root: style([
11
- atoms({
12
- borderRadius: 4
13
- }),
14
11
  {
15
- backgroundColor: vars.colorRole.border.strong,
16
- width: 52,
17
- height: 32,
18
- "@media": {
19
- "(prefers-reduced-motion: no-preference)": {
20
- transition: `background-color 120ms linear, box-shadow ${vars.transition.fast}`
21
- }
22
- },
23
- selectors: {
24
- '&[data-checked="true"]': {
25
- backgroundColor: vars.colorRole.secondary.solid
26
- }
27
- },
28
- // Scale the switch when it's `:active`
29
- vars: {
30
- [activeScaleFactor]: "1"
31
- },
32
- ":active": {
33
- vars: {
34
- [activeScaleFactor]: "0.96"
12
+ "@layer": {
13
+ [layers.theme]: {
14
+ borderRadius: vars.borderRadius[4],
15
+ backgroundColor: vars.colorRole.border.strong,
16
+ width: 52,
17
+ height: 32,
18
+ "@media": {
19
+ "(prefers-reduced-motion: no-preference)": {
20
+ transition: `background-color 120ms linear, box-shadow ${vars.transition.fast}`
21
+ }
22
+ },
23
+ selectors: {
24
+ '&[data-checked="true"]': {
25
+ backgroundColor: vars.colorRole.secondary.solid
26
+ }
27
+ },
28
+ // Scale the switch when it's `:active`
29
+ vars: {
30
+ [activeScaleFactor]: "1"
31
+ },
32
+ ":active": {
33
+ vars: {
34
+ [activeScaleFactor]: "0.96"
35
+ }
36
+ }
35
37
  }
36
38
  }
37
39
  },
38
40
  focusable
39
41
  ]),
40
- thumb: style([
41
- atoms({
42
- borderRadius: "full"
43
- }),
44
- {
45
- width: 24,
46
- height: 24,
47
- top: 4,
48
- left: 4,
49
- transform: `translateX(0) scale(calc(0.9 * ${activeScaleFactor}))`,
50
- position: "absolute",
51
- // Deliberately fixed: the thumb is white in every mode
52
- backgroundColor: vars.color.white,
53
- selectors: {
54
- '&[data-checked="true"]': {
55
- transform: `translateX(20px) scale(${activeScaleFactor})`
56
- }
57
- },
58
- "@media": {
59
- "(prefers-reduced-motion: no-preference)": {
60
- transition: "transform 120ms ease-out"
42
+ thumb: style({
43
+ "@layer": {
44
+ [layers.theme]: {
45
+ borderRadius: vars.borderRadius.full,
46
+ width: 24,
47
+ height: 24,
48
+ top: 4,
49
+ left: 4,
50
+ transform: `translateX(0) scale(calc(0.9 * ${activeScaleFactor}))`,
51
+ position: "absolute",
52
+ // Deliberately fixed: the thumb is white in every mode
53
+ backgroundColor: vars.color.white,
54
+ selectors: {
55
+ '&[data-checked="true"]': {
56
+ transform: `translateX(20px) scale(${activeScaleFactor})`
57
+ }
58
+ },
59
+ "@media": {
60
+ "(prefers-reduced-motion: no-preference)": {
61
+ transition: "transform 120ms ease-out"
62
+ }
61
63
  }
62
64
  }
63
65
  }
64
- ])
66
+ })
65
67
  }
66
68
  );
67
69
  endFileScope();
@@ -0,0 +1,3 @@
1
+ import { ThemeComponentsStyles } from '@blockle/blocks-core';
2
+ export declare const tabs: ThemeComponentsStyles['tabs'];
3
+ //# sourceMappingURL=tabs.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.css.d.ts","sourceRoot":"","sources":["../../src/components/tabs.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAG3B,MAAM,sBAAsB,CAAC;AAqG9B,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAO7C,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { makeComponentTheme, vars, layers, tabIndicatorVars } from "@blockle/blocks-core";
3
+ import { style } from "@vanilla-extract/css";
4
+ import { focusable } from "./helpers.css.js";
5
+ setFileScope("src/components/tabs.css.ts", "@blockle/blocks-theme-momotaro");
6
+ const list = style({
7
+ "@layer": {
8
+ [layers.theme]: {
9
+ // The thin baseline under the whole row
10
+ boxShadow: `inset 0 -1px 0 ${vars.colorRole.border.default}`,
11
+ vars: {
12
+ [tabIndicatorVars.color]: vars.colorRole.primary.solid,
13
+ [tabIndicatorVars.thickness]: "2px",
14
+ [tabIndicatorVars.duration]: "200ms",
15
+ [tabIndicatorVars.easing]: "ease-in-out"
16
+ }
17
+ }
18
+ }
19
+ });
20
+ const tab = style({
21
+ "@layer": {
22
+ [layers.theme]: {
23
+ display: "flex",
24
+ alignItems: "center"
25
+ }
26
+ }
27
+ });
28
+ const trigger = style([
29
+ focusable,
30
+ {
31
+ "@layer": {
32
+ [layers.theme]: {
33
+ paddingBlock: vars.space[2],
34
+ paddingInline: vars.space[3],
35
+ border: "none",
36
+ background: "transparent",
37
+ color: vars.colorRole.text.muted,
38
+ font: "inherit",
39
+ fontSize: "inherit",
40
+ fontWeight: 500,
41
+ textDecoration: "none",
42
+ cursor: "pointer",
43
+ whiteSpace: "nowrap",
44
+ selectors: {
45
+ "&:hover": {
46
+ color: vars.colorRole.text.default
47
+ },
48
+ '&[aria-selected="true"], &[aria-current="page"]': {
49
+ color: vars.colorRole.text.default,
50
+ fontWeight: 600
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ ]);
57
+ const slot = style({
58
+ "@layer": {
59
+ [layers.theme]: {
60
+ display: "flex",
61
+ alignItems: "center"
62
+ }
63
+ }
64
+ });
65
+ const startSlot = style([
66
+ slot,
67
+ {
68
+ "@layer": {
69
+ [layers.theme]: { paddingInlineStart: vars.space[3] }
70
+ }
71
+ }
72
+ ]);
73
+ const endSlot = style([
74
+ slot,
75
+ {
76
+ "@layer": {
77
+ [layers.theme]: { paddingInlineEnd: vars.space[2] }
78
+ }
79
+ }
80
+ ]);
81
+ const panel = style({
82
+ "@layer": {
83
+ [layers.theme]: {
84
+ ":focus-visible": {
85
+ outline: `2px solid ${vars.colorRole.focusRing.color}`,
86
+ outlineOffset: "2px"
87
+ }
88
+ }
89
+ }
90
+ });
91
+ const tabs = makeComponentTheme("tabs", {
92
+ list,
93
+ tab,
94
+ trigger,
95
+ startSlot,
96
+ endSlot,
97
+ panel
98
+ });
99
+ endFileScope();
100
+ export {
101
+ tabs
102
+ };
@@ -1 +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"}
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;AAkG9B,eAAO,MAAM,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAwB3C,CAAC"}
@@ -1,59 +1,82 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme, vars, atoms } from "@blockle/blocks-core";
2
+ import { makeComponentTheme, vars, layers } from "@blockle/blocks-core";
3
3
  import { style, createVar, globalStyle } from "@vanilla-extract/css";
4
4
  setFileScope("src/components/tag.css.ts", "@blockle/blocks-theme-momotaro");
5
5
  const paddingBlock = createVar();
6
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
7
+ const slot = style({
8
+ "@layer": {
9
+ [layers.theme]: {
10
+ display: "inline-flex",
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ blockSize: "1lh",
14
+ flexShrink: 0
15
+ }
16
16
  }
17
- ]);
17
+ });
18
18
  const startSlot = style([slot]);
19
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
20
+ const root = style({
21
+ "@layer": {
22
+ [layers.theme]: {
23
+ display: "inline-flex",
24
+ alignItems: "center",
25
+ gap: vars.space[1],
26
+ borderRadius: vars.borderRadius.full,
27
+ fontWeight: vars.fontWeight.medium,
28
+ lineHeight: vars.lineHeight.normal,
29
+ verticalAlign: "middle",
30
+ whiteSpace: "nowrap",
31
+ paddingBlock,
32
+ paddingInline,
33
+ selectors: {
34
+ // A Slot sits as close to the rounded edge as to the top and bottom
35
+ [`&:has(> ${startSlot})`]: {
36
+ paddingInlineStart: paddingBlock
37
+ },
38
+ [`&:has(> ${endSlot})`]: {
39
+ paddingInlineEnd: paddingBlock
40
+ }
41
41
  }
42
42
  }
43
43
  }
44
- ]);
44
+ });
45
45
  globalStyle(`${root} > ${slot} > *`, {
46
- blockSize: "100%",
47
- inlineSize: "auto",
48
- maxBlockSize: "100%"
46
+ "@layer": {
47
+ [layers.theme]: {
48
+ blockSize: "100%",
49
+ inlineSize: "auto",
50
+ maxBlockSize: "100%"
51
+ }
52
+ }
49
53
  });
50
54
  globalStyle(`${root} > ${slot} > * > svg`, {
51
- blockSize: "75%",
52
- inlineSize: "75%"
55
+ "@layer": {
56
+ [layers.theme]: {
57
+ blockSize: "75%",
58
+ inlineSize: "75%"
59
+ }
60
+ }
53
61
  });
54
62
  const intentStyle = (roles) => style({
55
- backgroundColor: roles.subtle,
56
- color: roles.foreground
63
+ "@layer": {
64
+ [layers.theme]: {
65
+ backgroundColor: roles.subtle,
66
+ color: roles.foreground
67
+ }
68
+ }
69
+ });
70
+ const sizeStyle = (fontSize, paddingBlockValue, paddingInlineValue) => style({
71
+ "@layer": {
72
+ [layers.theme]: {
73
+ fontSize,
74
+ vars: {
75
+ [paddingBlock]: paddingBlockValue,
76
+ [paddingInline]: paddingInlineValue
77
+ }
78
+ }
79
+ }
57
80
  });
58
81
  const tag = makeComponentTheme("tag", {
59
82
  root,
@@ -70,23 +93,9 @@ const tag = makeComponentTheme("tag", {
70
93
  warning: intentStyle(vars.colorRole.warning)
71
94
  },
72
95
  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
- ])
96
+ small: sizeStyle(vars.fontSize.xsmall, "2px", vars.space[2]),
97
+ medium: sizeStyle(vars.fontSize.small, "2px", vars.space[2]),
98
+ large: sizeStyle(vars.fontSize.medium, vars.space[1], vars.space[3])
90
99
  }
91
100
  },
92
101
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"text.css.d.ts","sourceRoot":"","sources":["../../src/components/text.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAY7C,CAAC"}
1
+ {"version":3,"file":"text.css.d.ts","sourceRoot":"","sources":["../../src/components/text.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAoB7C,CAAC"}
@@ -1,14 +1,22 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { makeComponentTheme, vars } from "@blockle/blocks-core";
2
+ import { makeComponentTheme, vars, layers } from "@blockle/blocks-core";
3
3
  import { style } from "@vanilla-extract/css";
4
4
  setFileScope("src/components/text.css.ts", "@blockle/blocks-theme-momotaro");
5
5
  const text = makeComponentTheme("text", {
6
6
  variants: {
7
7
  color: {
8
- default: style({ color: vars.colorRole.text.default }),
9
- muted: style({ color: vars.colorRole.text.muted }),
10
- disabled: style({ color: vars.colorRole.text.disabled }),
11
- inverse: style({ color: vars.colorRole.text.inverse })
8
+ default: style({
9
+ "@layer": { [layers.theme]: { color: vars.colorRole.text.default } }
10
+ }),
11
+ muted: style({
12
+ "@layer": { [layers.theme]: { color: vars.colorRole.text.muted } }
13
+ }),
14
+ disabled: style({
15
+ "@layer": { [layers.theme]: { color: vars.colorRole.text.disabled } }
16
+ }),
17
+ inverse: style({
18
+ "@layer": { [layers.theme]: { color: vars.colorRole.text.inverse } }
19
+ })
12
20
  }
13
21
  },
14
22
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"textInput.css.d.ts","sourceRoot":"","sources":["../../src/components/textInput.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAuCxD,CAAC"}
1
+ {"version":3,"file":"textInput.css.d.ts","sourceRoot":"","sources":["../../src/components/textInput.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAyCxD,CAAC"}