@kalink-ui/seedly 0.34.4 → 0.35.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/CHANGELOG.md +12 -0
- package/README.md +34 -0
- package/docs/component-theming.md +295 -0
- package/docs/theming-strategy.md +69 -0
- package/docs/tone-system.md +139 -0
- package/docs/value-and-scope.md +65 -0
- package/package.json +4 -3
- package/src/components/alert-dialog/alert-dialog-action.tsx +0 -2
- package/src/components/alert-dialog/alert-dialog-cancel.tsx +0 -1
- package/src/components/alert-dialog/alert-dialog-content.css.ts +1 -1
- package/src/components/alert-dialog/alert-dialog-content.tsx +13 -6
- package/src/components/alert-dialog/alert-dialog-footer.css.ts +3 -3
- package/src/components/alert-dialog/alert-dialog-footer.tsx +2 -2
- package/src/components/alert-dialog/alert-dialog-header.tsx +4 -4
- package/src/components/alert-dialog/index.ts +9 -0
- package/src/components/box/box.css.ts +137 -39
- package/src/components/box/box.responsive.ts +2 -2
- package/src/components/box/box.tsx +2 -3
- package/src/components/box/index.ts +1 -1
- package/src/components/button/button.css.ts +142 -149
- package/src/components/button/button.responsive.ts +2 -2
- package/src/components/button/button.tsx +44 -31
- package/src/components/button/index.ts +2 -2
- package/src/components/button-icon/button-icon.css.ts +26 -62
- package/src/components/button-icon/button-icon.responsive.ts +2 -2
- package/src/components/button-icon/button-icon.tsx +5 -7
- package/src/components/card/card.css.ts +1 -5
- package/src/components/card/card.tsx +11 -11
- package/src/components/center/center.css.ts +61 -21
- package/src/components/center/center.responsive.ts +2 -2
- package/src/components/center/center.tsx +4 -6
- package/src/components/center/index.ts +1 -1
- package/src/components/cluster/cluster.css.ts +37 -99
- package/src/components/cluster/cluster.responsive.ts +13 -2
- package/src/components/cluster/cluster.tsx +6 -5
- package/src/components/cluster/index.ts +5 -1
- package/src/components/command/command-empty.tsx +36 -4
- package/src/components/command/command-group.css.ts +23 -7
- package/src/components/command/command-group.tsx +30 -6
- package/src/components/command/command-input.css.ts +2 -2
- package/src/components/command/command-item.tsx +26 -2
- package/src/components/command/command-list.css.ts +2 -2
- package/src/components/command/command-list.responsive.ts +2 -2
- package/src/components/command/command-list.tsx +1 -2
- package/src/components/command/command-separator.tsx +7 -5
- package/src/components/cover/cover.css.ts +29 -8
- package/src/components/cover/cover.tsx +13 -13
- package/src/components/cover/index.ts +2 -2
- package/src/components/divider/divider.css.ts +9 -4
- package/src/components/form-field/form-field-context.ts +3 -0
- package/src/components/form-field/form-field-item.tsx +3 -3
- package/src/components/form-field/form-field-message.tsx +34 -3
- package/src/components/form-field/form-field.css.ts +78 -16
- package/src/components/form-field/form-field.tsx +5 -0
- package/src/components/form-field/index.ts +1 -1
- package/src/components/frame/frame.css.ts +96 -59
- package/src/components/frame/frame.responsive.ts +9 -0
- package/src/components/frame/frame.tsx +11 -5
- package/src/components/frame/index.ts +1 -1
- package/src/components/grid/grid-child.tsx +14 -10
- package/src/components/grid/grid.css.ts +56 -148
- package/src/components/grid/grid.tsx +40 -18
- package/src/components/grid/index.ts +4 -3
- package/src/components/heading/heading.css.ts +4 -4
- package/src/components/heading/heading.responsive.ts +6 -6
- package/src/components/heading/heading.tsx +3 -4
- package/src/components/heading/index.ts +1 -1
- package/src/components/input/index.ts +4 -1
- package/src/components/input/input-wrapper.tsx +20 -8
- package/src/components/input/input.css.ts +121 -93
- package/src/components/input/input.responsive.ts +9 -0
- package/src/components/input/input.tsx +7 -1
- package/src/components/label/label.css.ts +2 -2
- package/src/components/label/label.tsx +23 -3
- package/src/components/layout-maps.ts +120 -0
- package/src/components/loader/index.ts +2 -1
- package/src/components/loader/loader.css.ts +91 -54
- package/src/components/loader/moon-loader.responsive.ts +2 -2
- package/src/components/loader/moon-loader.tsx +4 -5
- package/src/components/loader-overlay/loader-overlay.css.ts +3 -3
- package/src/components/loader-overlay/loader-overlay.tsx +5 -2
- package/src/components/menu/index.ts +2 -2
- package/src/components/menu/menu-item.css.ts +102 -46
- package/src/components/menu/menu-separator.css.ts +27 -15
- package/src/components/menu/menu-separator.responsive.ts +2 -2
- package/src/components/overlay/overlay.css.ts +1 -1
- package/src/components/popover/index.ts +1 -1
- package/src/components/popover/popover-content.css.ts +69 -52
- package/src/components/popover/popover-content.tsx +22 -6
- package/src/components/scroll-area/scroll-area.css.ts +3 -3
- package/src/components/scroll-area/scroll-bar.tsx +2 -2
- package/src/components/select/index.ts +4 -5
- package/src/components/select/select-content.css.ts +1 -1
- package/src/components/select/select-content.tsx +2 -2
- package/src/components/select/select-item.tsx +11 -3
- package/src/components/select/select-trigger.css.ts +14 -18
- package/src/components/select/select-trigger.tsx +18 -8
- package/src/components/select/select.tsx +10 -6
- package/src/components/sheet/index.ts +9 -0
- package/src/components/sheet/sheet-content.css.ts +2 -2
- package/src/components/sheet/sheet-content.tsx +25 -7
- package/src/components/sheet/sheet-description.tsx +5 -7
- package/src/components/sheet/sheet-footer.tsx +3 -1
- package/src/components/sheet/sheet-header.css.ts +1 -1
- package/src/components/sheet/sheet-header.tsx +3 -3
- package/src/components/sheet/sheet-overlay.tsx +3 -4
- package/src/components/sheet/sheet-title.tsx +1 -1
- package/src/components/sidebar/index.ts +5 -1
- package/src/components/sidebar/sidebar.css.ts +35 -9
- package/src/components/sidebar/sidebar.tsx +7 -10
- package/src/components/skeleton/skeleton.css.ts +23 -14
- package/src/components/skeleton/skeleton.tsx +26 -7
- package/src/components/stack/index.ts +1 -1
- package/src/components/stack/stack.css.ts +18 -46
- package/src/components/stack/stack.tsx +1 -2
- package/src/components/switcher/index.ts +5 -1
- package/src/components/switcher/switcher.css.ts +105 -72
- package/src/components/switcher/switcher.responsive.ts +2 -2
- package/src/components/switcher/switcher.tsx +5 -5
- package/src/components/text/text.css.ts +93 -105
- package/src/components/text/text.responsive.ts +3 -63
- package/src/components/text/text.tsx +16 -28
- package/src/components/text-field/index.ts +1 -2
- package/src/components/text-field/text-field.tsx +5 -7
- package/src/components/textarea/textarea-input.tsx +30 -3
- package/src/components/textarea/textarea.css.ts +12 -7
- package/src/components/textarea/textarea.tsx +9 -3
- package/src/components/visually-hidden/visually-hidden.css.ts +16 -10
- package/src/styles/define-responsive-properties.ts +5 -1
- package/src/styles/index.ts +12 -0
- package/src/styles/responsive.ts +72 -43
- package/src/styles/system-contract.css.ts +22 -3
- package/src/styles/theme/sprout-ref.css.ts +107 -0
- package/src/styles/theme/sprout.css.ts +259 -0
- package/src/styles/tone.ts +69 -0
- package/src/styles/typography.responsive.css.ts +35 -0
- package/src/styles/typography.responsive.ts +104 -0
- package/src/utils/arg-types/index.ts +1 -0
- package/src/utils/arg-types/responsive-arg.ts +28 -0
- package/src/utils/index.ts +1 -0
- package/src/components/command/command-item.css.ts +0 -32
- package/src/components/select/select.css.ts +0 -3
- package/src/components/sheet/sheet-body.css.ts +0 -68
- package/src/components/text-field/text-field.css.ts +0 -3
|
@@ -8,21 +8,30 @@ import {
|
|
|
8
8
|
sys,
|
|
9
9
|
transition,
|
|
10
10
|
} from '../../styles';
|
|
11
|
+
import { components } from '../../styles/layers.css';
|
|
11
12
|
|
|
12
|
-
export const
|
|
13
|
+
export const loaderRecipe = recipe({
|
|
13
14
|
variants: {
|
|
14
15
|
active: {
|
|
15
16
|
true: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
'@layer': {
|
|
18
|
+
[components]: {
|
|
19
|
+
opacity: 1,
|
|
20
|
+
visibility: 'visible',
|
|
21
|
+
|
|
22
|
+
animationPlayState: 'running',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
20
25
|
},
|
|
21
26
|
false: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
'@layer': {
|
|
28
|
+
[components]: {
|
|
29
|
+
opacity: 0,
|
|
30
|
+
visibility: 'hidden',
|
|
31
|
+
|
|
32
|
+
animationPlayState: 'paused',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
26
35
|
},
|
|
27
36
|
},
|
|
28
37
|
},
|
|
@@ -40,80 +49,108 @@ const loaderAnimation = keyframes({
|
|
|
40
49
|
// Shared size variant styles for responsive overrides
|
|
41
50
|
const loaderWrapperSizeStyles = {
|
|
42
51
|
sm: {
|
|
43
|
-
|
|
44
|
-
[
|
|
52
|
+
'@layer': {
|
|
53
|
+
[components]: {
|
|
54
|
+
vars: {
|
|
55
|
+
[size]: sys.spacing[4],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
45
58
|
},
|
|
46
59
|
},
|
|
47
60
|
md: {
|
|
48
|
-
|
|
49
|
-
[
|
|
61
|
+
'@layer': {
|
|
62
|
+
[components]: {
|
|
63
|
+
vars: {
|
|
64
|
+
[size]: sys.spacing[5],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
50
67
|
},
|
|
51
68
|
},
|
|
52
69
|
lg: {
|
|
53
|
-
|
|
54
|
-
[
|
|
70
|
+
'@layer': {
|
|
71
|
+
[components]: {
|
|
72
|
+
vars: {
|
|
73
|
+
[size]: sys.spacing[6],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
55
76
|
},
|
|
56
77
|
},
|
|
57
78
|
} as const;
|
|
58
79
|
|
|
59
|
-
export const
|
|
80
|
+
export const loaderWrapperRecipe = recipe({
|
|
60
81
|
base: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
'@layer': {
|
|
83
|
+
[components]: {
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
width: size,
|
|
86
|
+
height: size,
|
|
87
|
+
|
|
88
|
+
animationName: loaderAnimation,
|
|
89
|
+
animationDuration: '1s',
|
|
90
|
+
animationIterationCount: 'infinite',
|
|
91
|
+
animationTimingFunction: 'linear',
|
|
92
|
+
animationFillMode: 'forwards',
|
|
93
|
+
|
|
94
|
+
transition: transition(['opacity', 'visibility']),
|
|
95
|
+
pointerEvents: 'none',
|
|
96
|
+
|
|
97
|
+
vars: {
|
|
98
|
+
[moonSize]: calc.divide(size, 7),
|
|
99
|
+
},
|
|
100
|
+
},
|
|
76
101
|
},
|
|
77
102
|
},
|
|
78
103
|
|
|
79
104
|
variants: {
|
|
80
105
|
size: loaderWrapperSizeStyles,
|
|
81
106
|
},
|
|
107
|
+
|
|
108
|
+
defaultVariants: {
|
|
109
|
+
size: 'md',
|
|
110
|
+
},
|
|
82
111
|
});
|
|
83
112
|
|
|
84
113
|
export const ellipse = style({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
114
|
+
'@layer': {
|
|
115
|
+
[components]: {
|
|
116
|
+
width: size,
|
|
117
|
+
height: size,
|
|
118
|
+
|
|
119
|
+
position: 'absolute',
|
|
120
|
+
insetBlockStart: 0,
|
|
121
|
+
insetInlineStart: 0,
|
|
122
|
+
|
|
123
|
+
borderRadius: '100%',
|
|
124
|
+
borderWidth: moonSize,
|
|
125
|
+
borderStyle: 'solid',
|
|
126
|
+
borderColor: `color-mix(in srgb, ${sys.surface.foreground} 30%, transparent)`,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
96
129
|
});
|
|
97
130
|
|
|
98
131
|
export const moon = style({
|
|
99
|
-
|
|
100
|
-
|
|
132
|
+
'@layer': {
|
|
133
|
+
[components]: {
|
|
134
|
+
width: moonSize,
|
|
135
|
+
height: moonSize,
|
|
101
136
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
insetBlockStart: calc.subtract(
|
|
139
|
+
calc.divide(size, 2),
|
|
140
|
+
calc.divide(moonSize, 2),
|
|
141
|
+
),
|
|
142
|
+
insetInlineStart: 0,
|
|
108
143
|
|
|
109
|
-
|
|
144
|
+
backgroundColor: sys.surface.foreground,
|
|
110
145
|
|
|
111
|
-
|
|
146
|
+
borderRadius: '100%',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
112
149
|
});
|
|
113
150
|
|
|
114
|
-
export type LoaderVariants = NonNullable<RecipeVariants<typeof
|
|
151
|
+
export type LoaderVariants = NonNullable<RecipeVariants<typeof loaderRecipe>>;
|
|
115
152
|
export type MoonLoaderVariants = NonNullable<
|
|
116
|
-
RecipeVariants<typeof
|
|
153
|
+
RecipeVariants<typeof loaderWrapperRecipe>
|
|
117
154
|
>;
|
|
118
155
|
|
|
119
156
|
export const sizeAt = createResponsiveVariants({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { loaderWrapperRecipe, sizeAt } from './loader.css';
|
|
4
4
|
|
|
5
5
|
export const moonLoaderResponsive = responsiveRecipe({
|
|
6
|
-
recipe:
|
|
6
|
+
recipe: loaderWrapperRecipe,
|
|
7
7
|
at: { size: sizeAt },
|
|
8
8
|
order: defaultOrder,
|
|
9
9
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
1
|
import { ElementType } from 'react';
|
|
3
2
|
|
|
4
3
|
import { Box, BoxProps } from '../box';
|
|
@@ -6,7 +5,7 @@ import { Box, BoxProps } from '../box';
|
|
|
6
5
|
import {
|
|
7
6
|
ellipse,
|
|
8
7
|
moon,
|
|
9
|
-
|
|
8
|
+
loaderRecipe,
|
|
10
9
|
LoaderVariants,
|
|
11
10
|
MoonLoaderVariants,
|
|
12
11
|
} from './loader.css';
|
|
@@ -38,9 +37,9 @@ export function MoonLoader<TUse extends ElementType>({
|
|
|
38
37
|
|
|
39
38
|
return (
|
|
40
39
|
<Box
|
|
41
|
-
className={
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
className={moonLoaderResponsive(
|
|
41
|
+
{ size },
|
|
42
|
+
loaderRecipe({ active }),
|
|
44
43
|
className,
|
|
45
44
|
)}
|
|
46
45
|
{...props}
|
|
@@ -3,7 +3,7 @@ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
|
3
3
|
import { sys } from '../../styles';
|
|
4
4
|
import { components } from '../../styles/layers.css';
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const loaderOverlayRecipe = recipe({
|
|
7
7
|
base: {
|
|
8
8
|
'@layer': {
|
|
9
9
|
[components]: {
|
|
@@ -16,7 +16,7 @@ export const loaderOverlay = recipe({
|
|
|
16
16
|
|
|
17
17
|
zIndex: 1000,
|
|
18
18
|
|
|
19
|
-
backgroundColor: `color-mix(in srgb, ${sys.
|
|
19
|
+
backgroundColor: `color-mix(in srgb, ${sys.surface.foreground} 5%, transparent)`,
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -44,5 +44,5 @@ export const loaderOverlay = recipe({
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
export type LoaderOverlayVariants = NonNullable<
|
|
47
|
-
RecipeVariants<typeof
|
|
47
|
+
RecipeVariants<typeof loaderOverlayRecipe>
|
|
48
48
|
>;
|
|
@@ -6,7 +6,10 @@ import { MoonLoader } from '../loader';
|
|
|
6
6
|
import { Stack, StackProps } from '../stack';
|
|
7
7
|
import { Text } from '../text';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
loaderOverlayRecipe,
|
|
11
|
+
LoaderOverlayVariants,
|
|
12
|
+
} from './loader-overlay.css';
|
|
10
13
|
|
|
11
14
|
interface LoaderOverlayProps extends LoaderOverlayVariants {
|
|
12
15
|
text?: string;
|
|
@@ -23,7 +26,7 @@ export function LoaderOverlay({
|
|
|
23
26
|
return (
|
|
24
27
|
<Box
|
|
25
28
|
spacing={spacing}
|
|
26
|
-
className={clsx(
|
|
29
|
+
className={clsx(loaderOverlayRecipe({ position }), className)}
|
|
27
30
|
>
|
|
28
31
|
<Stack use={Center} align="center" spacing={spacing} intrinsic andText>
|
|
29
32
|
<MoonLoader active forceMount />
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { menuItemRecipe, menuItemIcon, menuItemVars } from './menu-item.css';
|
|
2
|
+
export { menuSeparatorRecipe } from './menu-separator.css';
|
|
@@ -1,79 +1,135 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
1
|
+
import { assignVars, createThemeContract, style } from '@vanilla-extract/css';
|
|
2
2
|
import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createToneAssignments,
|
|
6
|
+
createToneStyles,
|
|
7
|
+
sys,
|
|
8
|
+
typography,
|
|
9
|
+
} from '../../styles';
|
|
10
|
+
import { components } from '../../styles/layers.css';
|
|
11
|
+
|
|
12
|
+
export const menuItemVars = createThemeContract({
|
|
13
|
+
color: {
|
|
14
|
+
foreground: null,
|
|
15
|
+
overlay: null,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const menuItemToneVars = createThemeContract({
|
|
20
|
+
base: null,
|
|
21
|
+
onBase: null,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const menuItemColorDefaults = assignVars(menuItemVars.color, {
|
|
25
|
+
foreground: sys.surface.foreground,
|
|
26
|
+
overlay: sys.surface.foreground,
|
|
27
|
+
});
|
|
5
28
|
|
|
6
|
-
|
|
7
|
-
base: [
|
|
8
|
-
typography.body.medium,
|
|
9
|
-
{
|
|
10
|
-
display: 'flex',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
gap: sys.spacing[2],
|
|
29
|
+
const menuItemToneAssignments = createToneAssignments(menuItemToneVars);
|
|
13
30
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
const menuToneStyles = createToneStyles(menuItemToneVars, ({ base }) => ({
|
|
32
|
+
...menuItemColorDefaults,
|
|
33
|
+
...assignVars(menuItemVars.color, {
|
|
34
|
+
foreground: base,
|
|
35
|
+
overlay: base,
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
17
38
|
|
|
18
|
-
|
|
39
|
+
export const menuItemRecipe = recipe({
|
|
40
|
+
base: {
|
|
41
|
+
'@layer': {
|
|
42
|
+
[components]: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
gap: sys.spacing[2],
|
|
19
46
|
|
|
20
|
-
|
|
47
|
+
paddingInline: sys.spacing[2],
|
|
48
|
+
paddingBlock: sys.spacing[1],
|
|
49
|
+
width: '100%',
|
|
21
50
|
|
|
22
|
-
|
|
51
|
+
position: 'relative',
|
|
23
52
|
|
|
24
|
-
|
|
25
|
-
userSelect: 'none',
|
|
53
|
+
textAlign: 'start',
|
|
26
54
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
borderRadius: sys.shape.corner.small,
|
|
56
|
+
|
|
57
|
+
cursor: 'pointer',
|
|
58
|
+
userSelect: 'none',
|
|
59
|
+
|
|
60
|
+
vars: {
|
|
61
|
+
...menuItemColorDefaults,
|
|
62
|
+
...menuItemToneAssignments.neutral,
|
|
31
63
|
},
|
|
32
64
|
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
selectors: {
|
|
66
|
+
'&[data-disabled="true"], &[aria-disabled="true"]': {
|
|
67
|
+
pointerEvents: 'none',
|
|
68
|
+
opacity: 0.6,
|
|
69
|
+
},
|
|
35
70
|
|
|
36
|
-
|
|
37
|
-
|
|
71
|
+
'&:before': {
|
|
72
|
+
content: '""',
|
|
38
73
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
left: 0,
|
|
74
|
+
width: '100%',
|
|
75
|
+
height: '100%',
|
|
42
76
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
top: 0,
|
|
79
|
+
left: 0,
|
|
46
80
|
|
|
47
|
-
|
|
48
|
-
|
|
81
|
+
backgroundColor: menuItemVars.color.overlay,
|
|
82
|
+
opacity: 0,
|
|
83
|
+
borderRadius: 'inherit',
|
|
49
84
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
85
|
+
pointerEvents: 'none',
|
|
86
|
+
},
|
|
53
87
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
'&:hover::before': {
|
|
89
|
+
opacity: sys.state.hovered.opacity,
|
|
90
|
+
},
|
|
57
91
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
opacity: sys.state.focused.opacity,
|
|
92
|
+
'&:is(:focus, :focus-visible, [aria-selected="true"])': {
|
|
93
|
+
outline: 'none',
|
|
61
94
|
},
|
|
95
|
+
|
|
96
|
+
'&:focus::before, &:focus-visible::before, &[aria-selected="true"]::before':
|
|
97
|
+
{
|
|
98
|
+
opacity: sys.state.focused.opacity,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
62
101
|
},
|
|
63
102
|
},
|
|
64
|
-
|
|
103
|
+
},
|
|
65
104
|
|
|
66
105
|
variants: {
|
|
106
|
+
size: {
|
|
107
|
+
sm: typography.body.small,
|
|
108
|
+
md: typography.body.medium,
|
|
109
|
+
lg: typography.body.large,
|
|
110
|
+
},
|
|
67
111
|
inset: {
|
|
68
112
|
true: {
|
|
69
|
-
|
|
113
|
+
'@layer': {
|
|
114
|
+
[components]: {
|
|
115
|
+
paddingInlineStart: sys.spacing[4],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
70
118
|
},
|
|
71
119
|
},
|
|
120
|
+
tone: menuToneStyles,
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
defaultVariants: {
|
|
124
|
+
tone: 'neutral',
|
|
125
|
+
size: 'md',
|
|
72
126
|
},
|
|
73
127
|
});
|
|
74
128
|
|
|
75
129
|
export const menuItemIcon = style({
|
|
76
|
-
color:
|
|
130
|
+
color: menuItemToneVars.onBase,
|
|
77
131
|
});
|
|
78
132
|
|
|
79
|
-
export type MenuItemVariants = NonNullable<
|
|
133
|
+
export type MenuItemVariants = NonNullable<
|
|
134
|
+
RecipeVariants<typeof menuItemRecipe>
|
|
135
|
+
>;
|
|
@@ -26,33 +26,45 @@ export const menuSeparatorSpacingStyles = mapContractVars(
|
|
|
26
26
|
}),
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
export const
|
|
29
|
+
export const menuSeparatorRecipe = recipe({
|
|
30
30
|
base: {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
'@layer': {
|
|
32
|
+
[components]: {
|
|
33
|
+
paddingBlock: spaceVar,
|
|
34
|
+
marginInline: sys.spacing[2],
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
position: 'relative',
|
|
37
|
+
|
|
38
|
+
vars: {
|
|
39
|
+
[spaceVar]: sys.spacing[2],
|
|
40
|
+
},
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
'::after': {
|
|
43
|
+
content: '""',
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
height: '1px',
|
|
46
|
+
width: '100%',
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
top: '50%',
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
backgroundColor: sys.surface.foreground,
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
transform: 'translateY(-50%)',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
48
56
|
},
|
|
49
57
|
},
|
|
50
58
|
|
|
51
59
|
variants: {
|
|
52
60
|
offset: {
|
|
53
61
|
true: {
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
'@layer': {
|
|
63
|
+
[components]: {
|
|
64
|
+
marginInline: calc.negate(sys.spacing[2]),
|
|
65
|
+
marginBlock: calc.negate(sys.spacing[2]),
|
|
66
|
+
},
|
|
67
|
+
},
|
|
56
68
|
},
|
|
57
69
|
},
|
|
58
70
|
|
|
@@ -61,7 +73,7 @@ export const menuSeparator = recipe({
|
|
|
61
73
|
});
|
|
62
74
|
|
|
63
75
|
export type MenuSeparatorVariants = NonNullable<
|
|
64
|
-
RecipeVariants<typeof
|
|
76
|
+
RecipeVariants<typeof menuSeparatorRecipe>
|
|
65
77
|
>;
|
|
66
78
|
|
|
67
79
|
export const spacingAt = createResponsiveVariants({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defaultOrder, responsiveRecipe } from '../../styles/responsive';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { menuSeparatorRecipe, spacingAt } from './menu-separator.css';
|
|
4
4
|
|
|
5
5
|
export const menuSeparatorResponsive = responsiveRecipe({
|
|
6
|
-
recipe:
|
|
6
|
+
recipe: menuSeparatorRecipe,
|
|
7
7
|
at: { spacing: spacingAt },
|
|
8
8
|
order: defaultOrder,
|
|
9
9
|
});
|
|
@@ -29,7 +29,7 @@ export const overlay = style({
|
|
|
29
29
|
position: 'fixed',
|
|
30
30
|
inset: 0,
|
|
31
31
|
|
|
32
|
-
backgroundColor: `color(
|
|
32
|
+
backgroundColor: `color-mix(in srgb, ${sys.surface.background} 50%, transparent)`,
|
|
33
33
|
|
|
34
34
|
animationDuration: sys.motion.duration.medium[2],
|
|
35
35
|
animationTimingFunction: sys.motion.easing.standard,
|