@akinon/ui-menu 1.0.0 → 1.0.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.
- package/dist/cjs/index.js +19 -18
- package/dist/esm/index.js +19 -18
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -41,42 +41,43 @@ const Menu = (_a) => {
|
|
|
41
41
|
const menuToken = token.Menu;
|
|
42
42
|
const prefixWithoutHash = `${getPrefixCls()}-menu`;
|
|
43
43
|
const prefixClsWithoutHash = `.${prefixWithoutHash}`;
|
|
44
|
+
const customTokens = theme.CustomTokens || {};
|
|
44
45
|
const useStyle = (0, cssinjs_1.useStyleRegister)({
|
|
45
46
|
token: token,
|
|
46
47
|
path: ['Menu'],
|
|
47
48
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
49
|
theme: theme
|
|
49
50
|
}, () => {
|
|
50
|
-
const prefixCls = `:where(.${hashId})
|
|
51
|
+
const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
|
|
51
52
|
return {
|
|
52
53
|
[prefixCls]: {
|
|
53
54
|
minWidth: menuToken.minWidth,
|
|
54
55
|
[`&${prefixClsWithoutHash}-inline-collapsed`]: {
|
|
55
|
-
minWidth:
|
|
56
|
+
minWidth: customTokens.others.valueUnset
|
|
56
57
|
},
|
|
57
58
|
[`&${prefixClsWithoutHash}-dark`]: {
|
|
58
59
|
[`${prefixClsWithoutHash}-title, ${prefixClsWithoutHash}-submenu-title`]: {
|
|
59
60
|
paddingInlineEnd: '1rem',
|
|
60
61
|
color: menuToken.mainMenuColor,
|
|
61
|
-
fontWeight:
|
|
62
|
+
fontWeight: customTokens.typography.fontWeightBold
|
|
62
63
|
},
|
|
63
64
|
[`${prefixClsWithoutHash}-item`]: {
|
|
64
65
|
color: menuToken.mainMenuColor,
|
|
65
|
-
fontWeight:
|
|
66
|
+
fontWeight: customTokens.typography.fontWeightBold
|
|
66
67
|
},
|
|
67
68
|
[`${prefixClsWithoutHash}-sub`]: {
|
|
68
|
-
fontWeight:
|
|
69
|
+
fontWeight: customTokens.typography.fontWeightMedium,
|
|
69
70
|
[`${prefixClsWithoutHash}-item`]: {
|
|
70
71
|
color: menuToken.subMenuTitleColor,
|
|
71
|
-
fontWeight:
|
|
72
|
+
fontWeight: customTokens.typography.fontWeightMedium
|
|
72
73
|
},
|
|
73
74
|
[`${prefixClsWithoutHash}-submenu`]: {
|
|
74
75
|
[`${prefixClsWithoutHash}-submenu-title`]: {
|
|
75
76
|
color: menuToken.subMenuTitleColor,
|
|
76
77
|
['svg']: {
|
|
77
|
-
position:
|
|
78
|
+
position: customTokens.layout.positionAbsolute,
|
|
78
79
|
marginLeft: menuToken.subMenuTitleIconMargin,
|
|
79
|
-
insetInlineEnd:
|
|
80
|
+
insetInlineEnd: customTokens.others.valueUnset
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
[`${prefixClsWithoutHash}-sub`]: {
|
|
@@ -93,10 +94,10 @@ const Menu = (_a) => {
|
|
|
93
94
|
height: menuToken.childMenuItemSelectedChildHeight,
|
|
94
95
|
borderRadius: menuToken.childMenuItemSelectedChildRadius,
|
|
95
96
|
marginLeft: menuToken.childMenuItemSelectedChildMargin,
|
|
96
|
-
opacity:
|
|
97
|
-
insetBlock:
|
|
98
|
-
insetInlineEnd:
|
|
99
|
-
transform:
|
|
97
|
+
opacity: customTokens.others.opacityFull,
|
|
98
|
+
insetBlock: customTokens.others.valueUnset,
|
|
99
|
+
insetInlineEnd: customTokens.others.valueUnset,
|
|
100
|
+
transform: customTokens.layout.displayNone,
|
|
100
101
|
background: menuToken.childMenuItemSelectedChildBgColor
|
|
101
102
|
}
|
|
102
103
|
}
|
|
@@ -106,13 +107,13 @@ const Menu = (_a) => {
|
|
|
106
107
|
['&::after']: {
|
|
107
108
|
width: menuToken.subMenuOnlyChildSize,
|
|
108
109
|
height: menuToken.subMenuOnlyChildSize,
|
|
109
|
-
borderRadius:
|
|
110
|
+
borderRadius: customTokens.sizing.valueHalf,
|
|
110
111
|
background: menuToken.subMenuOnlyChildBgColor,
|
|
111
112
|
marginLeft: menuToken.subMenuOnlyChildMargin,
|
|
112
|
-
opacity:
|
|
113
|
-
insetBlock:
|
|
114
|
-
insetInlineEnd:
|
|
115
|
-
transform:
|
|
113
|
+
opacity: customTokens.others.opacityFull,
|
|
114
|
+
insetBlock: customTokens.others.valueUnset,
|
|
115
|
+
insetInlineEnd: customTokens.others.valueUnset,
|
|
116
|
+
transform: customTokens.layout.displayNone
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
}
|
|
@@ -156,7 +157,7 @@ const Menu = (_a) => {
|
|
|
156
157
|
},
|
|
157
158
|
[`${prefixClsWithoutHash}-item-only-child`]: {
|
|
158
159
|
color: menuToken.lightSubTitleColor,
|
|
159
|
-
fontWeight:
|
|
160
|
+
fontWeight: customTokens.typography.fontWeightMedium,
|
|
160
161
|
['&::after']: {
|
|
161
162
|
background: menuToken.lightSubTitleColor
|
|
162
163
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -38,42 +38,43 @@ export const Menu = (_a) => {
|
|
|
38
38
|
const menuToken = token.Menu;
|
|
39
39
|
const prefixWithoutHash = `${getPrefixCls()}-menu`;
|
|
40
40
|
const prefixClsWithoutHash = `.${prefixWithoutHash}`;
|
|
41
|
+
const customTokens = theme.CustomTokens || {};
|
|
41
42
|
const useStyle = useStyleRegister({
|
|
42
43
|
token: token,
|
|
43
44
|
path: ['Menu'],
|
|
44
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
46
|
theme: theme
|
|
46
47
|
}, () => {
|
|
47
|
-
const prefixCls = `:where(.${hashId})
|
|
48
|
+
const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
|
|
48
49
|
return {
|
|
49
50
|
[prefixCls]: {
|
|
50
51
|
minWidth: menuToken.minWidth,
|
|
51
52
|
[`&${prefixClsWithoutHash}-inline-collapsed`]: {
|
|
52
|
-
minWidth:
|
|
53
|
+
minWidth: customTokens.others.valueUnset
|
|
53
54
|
},
|
|
54
55
|
[`&${prefixClsWithoutHash}-dark`]: {
|
|
55
56
|
[`${prefixClsWithoutHash}-title, ${prefixClsWithoutHash}-submenu-title`]: {
|
|
56
57
|
paddingInlineEnd: '1rem',
|
|
57
58
|
color: menuToken.mainMenuColor,
|
|
58
|
-
fontWeight:
|
|
59
|
+
fontWeight: customTokens.typography.fontWeightBold
|
|
59
60
|
},
|
|
60
61
|
[`${prefixClsWithoutHash}-item`]: {
|
|
61
62
|
color: menuToken.mainMenuColor,
|
|
62
|
-
fontWeight:
|
|
63
|
+
fontWeight: customTokens.typography.fontWeightBold
|
|
63
64
|
},
|
|
64
65
|
[`${prefixClsWithoutHash}-sub`]: {
|
|
65
|
-
fontWeight:
|
|
66
|
+
fontWeight: customTokens.typography.fontWeightMedium,
|
|
66
67
|
[`${prefixClsWithoutHash}-item`]: {
|
|
67
68
|
color: menuToken.subMenuTitleColor,
|
|
68
|
-
fontWeight:
|
|
69
|
+
fontWeight: customTokens.typography.fontWeightMedium
|
|
69
70
|
},
|
|
70
71
|
[`${prefixClsWithoutHash}-submenu`]: {
|
|
71
72
|
[`${prefixClsWithoutHash}-submenu-title`]: {
|
|
72
73
|
color: menuToken.subMenuTitleColor,
|
|
73
74
|
['svg']: {
|
|
74
|
-
position:
|
|
75
|
+
position: customTokens.layout.positionAbsolute,
|
|
75
76
|
marginLeft: menuToken.subMenuTitleIconMargin,
|
|
76
|
-
insetInlineEnd:
|
|
77
|
+
insetInlineEnd: customTokens.others.valueUnset
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
[`${prefixClsWithoutHash}-sub`]: {
|
|
@@ -90,10 +91,10 @@ export const Menu = (_a) => {
|
|
|
90
91
|
height: menuToken.childMenuItemSelectedChildHeight,
|
|
91
92
|
borderRadius: menuToken.childMenuItemSelectedChildRadius,
|
|
92
93
|
marginLeft: menuToken.childMenuItemSelectedChildMargin,
|
|
93
|
-
opacity:
|
|
94
|
-
insetBlock:
|
|
95
|
-
insetInlineEnd:
|
|
96
|
-
transform:
|
|
94
|
+
opacity: customTokens.others.opacityFull,
|
|
95
|
+
insetBlock: customTokens.others.valueUnset,
|
|
96
|
+
insetInlineEnd: customTokens.others.valueUnset,
|
|
97
|
+
transform: customTokens.layout.displayNone,
|
|
97
98
|
background: menuToken.childMenuItemSelectedChildBgColor
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -103,13 +104,13 @@ export const Menu = (_a) => {
|
|
|
103
104
|
['&::after']: {
|
|
104
105
|
width: menuToken.subMenuOnlyChildSize,
|
|
105
106
|
height: menuToken.subMenuOnlyChildSize,
|
|
106
|
-
borderRadius:
|
|
107
|
+
borderRadius: customTokens.sizing.valueHalf,
|
|
107
108
|
background: menuToken.subMenuOnlyChildBgColor,
|
|
108
109
|
marginLeft: menuToken.subMenuOnlyChildMargin,
|
|
109
|
-
opacity:
|
|
110
|
-
insetBlock:
|
|
111
|
-
insetInlineEnd:
|
|
112
|
-
transform:
|
|
110
|
+
opacity: customTokens.others.opacityFull,
|
|
111
|
+
insetBlock: customTokens.others.valueUnset,
|
|
112
|
+
insetInlineEnd: customTokens.others.valueUnset,
|
|
113
|
+
transform: customTokens.layout.displayNone
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
}
|
|
@@ -153,7 +154,7 @@ export const Menu = (_a) => {
|
|
|
153
154
|
},
|
|
154
155
|
[`${prefixClsWithoutHash}-item-only-child`]: {
|
|
155
156
|
color: menuToken.lightSubTitleColor,
|
|
156
|
-
fontWeight:
|
|
157
|
+
fontWeight: customTokens.typography.fontWeightMedium,
|
|
157
158
|
['&::after']: {
|
|
158
159
|
background: menuToken.lightSubTitleColor
|
|
159
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-menu",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"antd": "5.22.6",
|
|
13
|
-
"@akinon/
|
|
14
|
-
"@akinon/
|
|
13
|
+
"@akinon/icons": "1.0.1",
|
|
14
|
+
"@akinon/ui-theme": "1.0.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"clean-package": "2.2.0",
|
|
18
18
|
"copyfiles": "^2.4.1",
|
|
19
19
|
"rimraf": "^5.0.5",
|
|
20
20
|
"typescript": "*",
|
|
21
|
-
"@akinon/typescript-config": "1.0.
|
|
21
|
+
"@akinon/typescript-config": "1.0.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=18",
|