@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 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}).${getPrefixCls()}-menu`;
51
+ const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
51
52
  return {
52
53
  [prefixCls]: {
53
54
  minWidth: menuToken.minWidth,
54
55
  [`&${prefixClsWithoutHash}-inline-collapsed`]: {
55
- minWidth: 'unset'
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: menuToken.mainMenuFontWeight
62
+ fontWeight: customTokens.typography.fontWeightBold
62
63
  },
63
64
  [`${prefixClsWithoutHash}-item`]: {
64
65
  color: menuToken.mainMenuColor,
65
- fontWeight: menuToken.mainMenuFontWeight
66
+ fontWeight: customTokens.typography.fontWeightBold
66
67
  },
67
68
  [`${prefixClsWithoutHash}-sub`]: {
68
- fontWeight: menuToken.subMenufontWeigth,
69
+ fontWeight: customTokens.typography.fontWeightMedium,
69
70
  [`${prefixClsWithoutHash}-item`]: {
70
71
  color: menuToken.subMenuTitleColor,
71
- fontWeight: menuToken.subMenufontWeigth
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: menuToken.iconPosition,
78
+ position: customTokens.layout.positionAbsolute,
78
79
  marginLeft: menuToken.subMenuTitleIconMargin,
79
- insetInlineEnd: menuToken.unset
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: menuToken.childMenuItemSelectedChildOpacity,
97
- insetBlock: menuToken.unset,
98
- insetInlineEnd: menuToken.unset,
99
- transform: menuToken.none,
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: menuToken.subMenuOnlyChildRadius,
110
+ borderRadius: customTokens.sizing.valueHalf,
110
111
  background: menuToken.subMenuOnlyChildBgColor,
111
112
  marginLeft: menuToken.subMenuOnlyChildMargin,
112
- opacity: menuToken.subMenuOnlyChildOpacity,
113
- insetBlock: menuToken.unset,
114
- insetInlineEnd: menuToken.unset,
115
- transform: menuToken.none
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: menuToken.subMenufontWeigth,
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}).${getPrefixCls()}-menu`;
48
+ const prefixCls = `:where(.${hashId})${prefixClsWithoutHash}`;
48
49
  return {
49
50
  [prefixCls]: {
50
51
  minWidth: menuToken.minWidth,
51
52
  [`&${prefixClsWithoutHash}-inline-collapsed`]: {
52
- minWidth: 'unset'
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: menuToken.mainMenuFontWeight
59
+ fontWeight: customTokens.typography.fontWeightBold
59
60
  },
60
61
  [`${prefixClsWithoutHash}-item`]: {
61
62
  color: menuToken.mainMenuColor,
62
- fontWeight: menuToken.mainMenuFontWeight
63
+ fontWeight: customTokens.typography.fontWeightBold
63
64
  },
64
65
  [`${prefixClsWithoutHash}-sub`]: {
65
- fontWeight: menuToken.subMenufontWeigth,
66
+ fontWeight: customTokens.typography.fontWeightMedium,
66
67
  [`${prefixClsWithoutHash}-item`]: {
67
68
  color: menuToken.subMenuTitleColor,
68
- fontWeight: menuToken.subMenufontWeigth
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: menuToken.iconPosition,
75
+ position: customTokens.layout.positionAbsolute,
75
76
  marginLeft: menuToken.subMenuTitleIconMargin,
76
- insetInlineEnd: menuToken.unset
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: menuToken.childMenuItemSelectedChildOpacity,
94
- insetBlock: menuToken.unset,
95
- insetInlineEnd: menuToken.unset,
96
- transform: menuToken.none,
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: menuToken.subMenuOnlyChildRadius,
107
+ borderRadius: customTokens.sizing.valueHalf,
107
108
  background: menuToken.subMenuOnlyChildBgColor,
108
109
  marginLeft: menuToken.subMenuOnlyChildMargin,
109
- opacity: menuToken.subMenuOnlyChildOpacity,
110
- insetBlock: menuToken.unset,
111
- insetInlineEnd: menuToken.unset,
112
- transform: menuToken.none
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: menuToken.subMenufontWeigth,
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.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/ui-theme": "1.0.0",
14
- "@akinon/icons": "1.0.0"
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.0"
21
+ "@akinon/typescript-config": "1.0.1"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=18",