@liujitcn/kratos-taro-app-ui 0.0.31 → 0.0.32

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 公开入口
6
6
 
7
- - `@liujitcn/kratos-taro-app-ui`:版本标识、按需封装的 NutUI 图标和与 uni-app 对齐的 `UniIcon`。
7
+ - `@liujitcn/kratos-taro-app-ui`:版本标识、按需封装的 NutUI 图标和与 uni-app 对齐的 `UniIcon`;`UniIcon` 同时提供消息分类所需的通知、锁定、列表、会话等字形。
8
8
  - `@liujitcn/kratos-taro-app-ui/icons`:图标专用入口。
9
9
  - `@liujitcn/kratos-taro-app-ui/styles/theme.scss`:Kratos 与 NutUI 主题变量。
10
10
 
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "type": "git",
8
8
  "url": "git@github.com:liujitcn/kratos-admin.git"
9
9
  },
10
- "version": "0.0.31",
10
+ "version": "0.0.32",
11
11
  "type": "module",
12
12
  "files": [
13
13
  "src",
@@ -29,7 +29,7 @@
29
29
  "react": "18.3.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@liujitcn/kratos-taro-app-core": "^0.0.31"
32
+ "@liujitcn/kratos-taro-app-core": "^0.0.32"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pnpm pack --pack-destination ../../dist/npm",
package/src/UniIcon.tsx CHANGED
@@ -2,10 +2,29 @@ import { Text } from '@tarojs/components'
2
2
  import './styles/uni-icons.scss'
3
3
 
4
4
  /** uni-app uni-icons 中输入器使用的图标字形。 */
5
- export type UniIconName = 'plusempty' | 'mic' | 'paperplane' | 'left' | 'bars'
5
+ export type UniIconName =
6
+ | 'plusempty'
7
+ | 'mic'
8
+ | 'paperplane'
9
+ | 'paperplane-filled'
10
+ | 'left'
11
+ | 'bars'
12
+ | 'notification'
13
+ | 'notification-filled'
14
+ | 'locked-filled'
15
+ | 'list'
16
+ | 'chatboxes-filled'
17
+ | 'info-filled'
18
+ | 'flag-filled'
19
+ | 'checkbox-filled'
20
+ | 'settings-filled'
21
+ | 'person-filled'
22
+ | 'calendar-filled'
23
+ | 'chatbubble-filled'
6
24
 
7
25
  /** Taro 端复用 uni-app 图标字体的图标组件。 */
8
26
  export interface UniIconProps {
27
+ className?: string
9
28
  type: UniIconName
10
29
  size?: number | string
11
30
  color?: string
@@ -15,15 +34,31 @@ const iconUnicode: Record<UniIconName, string> = {
15
34
  plusempty: '\ue67b',
16
35
  mic: '\ue671',
17
36
  paperplane: '\ue672',
37
+ 'paperplane-filled': '\ue675',
18
38
  left: '\ue6b7',
19
39
  bars: '\ue627',
40
+ notification: '\ue6a6',
41
+ 'notification-filled': '\ue6c1',
42
+ 'locked-filled': '\ue668',
43
+ list: '\ue644',
44
+ 'chatboxes-filled': '\ue692',
45
+ 'info-filled': '\ue649',
46
+ 'flag-filled': '\ue660',
47
+ 'checkbox-filled': '\ue62c',
48
+ 'settings-filled': '\ue6ce',
49
+ 'person-filled': '\ue69d',
50
+ 'calendar-filled': '\ue6c0',
51
+ 'chatbubble-filled': '\ue694',
20
52
  }
21
53
 
22
54
  /** 渲染与 uni-app uni-icons 相同的图标字形。 */
23
- export default function UniIcon({ type, size = 16, color = '#333' }: UniIconProps) {
55
+ export default function UniIcon({ className, type, size = 16, color = '#333' }: UniIconProps) {
24
56
  const fontSize = typeof size === 'number' ? `${size}px` : size
25
57
  return (
26
- <Text className='kratos-uni-icon' style={{ fontSize, color }}>
58
+ <Text
59
+ className={['kratos-uni-icon', className].filter(Boolean).join(' ')}
60
+ style={{ fontSize, color }}
61
+ >
27
62
  {iconUnicode[type]}
28
63
  </Text>
29
64
  )
package/src/icons.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference path="./types/nutui-icons.d.ts" />
2
2
 
3
3
  export { default as UniIcon } from './UniIcon'
4
+ export type { UniIconName, UniIconProps } from './UniIcon'
4
5
 
5
6
  export { default as ArrowLeft } from '@nutui/icons-react-taro/dist/es/icons/ArrowLeft.js'
6
7
  export { default as ArrowRight } from '@nutui/icons-react-taro/dist/es/icons/ArrowRight.js'