@unif/react-native-ui 0.2.0 → 0.2.11
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/lib/commonjs/action-sheet/style/index.js.map +1 -1
- package/lib/commonjs/avatar/index.js.map +1 -1
- package/lib/commonjs/chip/index.js +2 -7
- package/lib/commonjs/chip/index.js.map +1 -1
- package/lib/commonjs/chip/style/index.js +5 -0
- package/lib/commonjs/chip/style/index.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/list-item/index.js.map +1 -1
- package/lib/commonjs/menu/index.js +3 -5
- package/lib/commonjs/menu/index.js.map +1 -1
- package/lib/commonjs/popover/index.js.map +1 -1
- package/lib/commonjs/popover/style/index.js +3 -3
- package/lib/commonjs/popover/style/index.js.map +1 -1
- package/lib/commonjs/space/index.js.map +1 -1
- package/lib/commonjs/text/index.js.map +1 -1
- package/lib/commonjs/wave-animation/index.js.map +1 -1
- package/lib/module/action-sheet/style/index.js.map +1 -1
- package/lib/module/avatar/index.js.map +1 -1
- package/lib/module/chip/index.js +2 -7
- package/lib/module/chip/index.js.map +1 -1
- package/lib/module/chip/style/index.js +5 -0
- package/lib/module/chip/style/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/list-item/index.js.map +1 -1
- package/lib/module/menu/index.js +3 -5
- package/lib/module/menu/index.js.map +1 -1
- package/lib/module/popover/index.js.map +1 -1
- package/lib/module/popover/style/index.js +3 -3
- package/lib/module/popover/style/index.js.map +1 -1
- package/lib/module/space/index.js.map +1 -1
- package/lib/module/text/index.js.map +1 -1
- package/lib/module/wave-animation/index.js.map +1 -1
- package/lib/typescript/commonjs/docs-src/components/ExpoSnack.d.ts +11 -0
- package/lib/typescript/commonjs/docs-src/components/ExpoSnack.d.ts.map +1 -0
- package/lib/typescript/commonjs/docusaurus.config.d.ts +4 -0
- package/lib/typescript/commonjs/docusaurus.config.d.ts.map +1 -0
- package/lib/typescript/commonjs/sidebars.d.ts +4 -0
- package/lib/typescript/commonjs/sidebars.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/action-sheet/style/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/avatar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/chip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/chip/style/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/chip/style/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/input/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/list-item/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/popover/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/space/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/text/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/wave-animation/index.d.ts.map +1 -1
- package/lib/typescript/module/docs-src/components/ExpoSnack.d.ts +11 -0
- package/lib/typescript/module/docs-src/components/ExpoSnack.d.ts.map +1 -0
- package/lib/typescript/module/docusaurus.config.d.ts +4 -0
- package/lib/typescript/module/docusaurus.config.d.ts.map +1 -0
- package/lib/typescript/module/sidebars.d.ts +4 -0
- package/lib/typescript/module/sidebars.d.ts.map +1 -0
- package/lib/typescript/module/src/action-sheet/style/index.d.ts.map +1 -1
- package/lib/typescript/module/src/avatar/index.d.ts.map +1 -1
- package/lib/typescript/module/src/chip/index.d.ts.map +1 -1
- package/lib/typescript/module/src/chip/style/index.d.ts +1 -0
- package/lib/typescript/module/src/chip/style/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/input/index.d.ts.map +1 -1
- package/lib/typescript/module/src/list-item/index.d.ts.map +1 -1
- package/lib/typescript/module/src/menu/index.d.ts.map +1 -1
- package/lib/typescript/module/src/popover/index.d.ts.map +1 -1
- package/lib/typescript/module/src/space/index.d.ts.map +1 -1
- package/lib/typescript/module/src/text/index.d.ts.map +1 -1
- package/lib/typescript/module/src/wave-animation/index.d.ts.map +1 -1
- package/package.json +16 -2
- package/src/action-sheet/index.tsx +1 -1
- package/src/action-sheet/style/index.tsx +1 -3
- package/src/avatar/index.tsx +5 -2
- package/src/button/index.tsx +2 -2
- package/src/button/style/index.tsx +1 -1
- package/src/chip/index.tsx +12 -4
- package/src/chip/style/index.tsx +7 -1
- package/src/index.tsx +4 -1
- package/src/input/index.tsx +59 -54
- package/src/list-item/index.tsx +3 -4
- package/src/menu/index.tsx +1 -4
- package/src/popover/index.tsx +6 -7
- package/src/popover/style/index.tsx +3 -3
- package/src/space/index.tsx +1 -3
- package/src/text/index.tsx +6 -1
- package/src/wave-animation/index.tsx +7 -4
- package/lib/commonjs/action-sheet/index.md +0 -69
- package/lib/commonjs/avatar/index.md +0 -51
- package/lib/commonjs/button/index.md +0 -90
- package/lib/commonjs/center/index.md +0 -28
- package/lib/commonjs/chip/index.md +0 -60
- package/lib/commonjs/column/index.md +0 -34
- package/lib/commonjs/divider/index.md +0 -44
- package/lib/commonjs/hooks/index.md +0 -71
- package/lib/commonjs/input/index.md +0 -73
- package/lib/commonjs/list-item/index.md +0 -101
- package/lib/commonjs/popover/index.md +0 -57
- package/lib/commonjs/row/index.md +0 -46
- package/lib/commonjs/space/index.md +0 -31
- package/lib/commonjs/text/index.md +0 -63
- package/lib/commonjs/touchable/index.md +0 -42
- package/lib/commonjs/wave-animation/index.md +0 -50
- package/lib/module/action-sheet/index.md +0 -69
- package/lib/module/avatar/index.md +0 -51
- package/lib/module/button/index.md +0 -90
- package/lib/module/center/index.md +0 -28
- package/lib/module/chip/index.md +0 -60
- package/lib/module/column/index.md +0 -34
- package/lib/module/divider/index.md +0 -44
- package/lib/module/hooks/index.md +0 -71
- package/lib/module/input/index.md +0 -73
- package/lib/module/list-item/index.md +0 -101
- package/lib/module/popover/index.md +0 -57
- package/lib/module/row/index.md +0 -46
- package/lib/module/space/index.md +0 -31
- package/lib/module/text/index.md +0 -63
- package/lib/module/touchable/index.md +0 -42
- package/lib/module/wave-animation/index.md +0 -50
- package/src/action-sheet/index.md +0 -69
- package/src/avatar/index.md +0 -51
- package/src/button/index.md +0 -90
- package/src/center/index.md +0 -28
- package/src/chip/index.md +0 -60
- package/src/column/index.md +0 -34
- package/src/divider/index.md +0 -44
- package/src/hooks/index.md +0 -71
- package/src/input/index.md +0 -73
- package/src/list-item/index.md +0 -101
- package/src/popover/index.md +0 -57
- package/src/row/index.md +0 -46
- package/src/space/index.md +0 -31
- package/src/text/index.md +0 -63
- package/src/touchable/index.md +0 -42
- package/src/wave-animation/index.md +0 -50
package/src/text/index.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Text 语义化文字
|
|
2
|
-
|
|
3
|
-
通过 `variant` 驱动排版样式。继承 RN `Text`,支持嵌套。
|
|
4
|
-
|
|
5
|
-
## 何时使用
|
|
6
|
-
|
|
7
|
-
- 替代直接写 `fontSize` + `fontWeight` + `color` 的 `<Text>` 组合
|
|
8
|
-
- 需要统一排版规范时
|
|
9
|
-
|
|
10
|
-
## 代码演示
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
// 基础用法
|
|
14
|
-
<Text variant="title">标题文字</Text>
|
|
15
|
-
<Text variant="caption" secondary>辅助说明</Text>
|
|
16
|
-
|
|
17
|
-
// 颜色与字重
|
|
18
|
-
<Text variant="caption" primary weight="bold">¥88.00</Text>
|
|
19
|
-
|
|
20
|
-
// 嵌套 Text
|
|
21
|
-
<Text variant="body" numberOfLines={1}>
|
|
22
|
-
<Text primary weight="semibold">新 </Text>
|
|
23
|
-
{productName}
|
|
24
|
-
</Text>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## API
|
|
28
|
-
|
|
29
|
-
| 属性 | 说明 | 类型 | 默认值 |
|
|
30
|
-
|------|------|------|--------|
|
|
31
|
-
| variant | 排版变体 | `'title'` \| `'heading'` \| `'body'` \| `'caption'` \| `'micro'` | `'body'` |
|
|
32
|
-
| secondary | 次要色(colorTextSecondary) | `boolean` | `false` |
|
|
33
|
-
| primary | 主题色(colorPrimary) | `boolean` | `false` |
|
|
34
|
-
| color | 自定义颜色 | `string` | - |
|
|
35
|
-
| weight | 字重 | `'medium'` \| `'semibold'` \| `'bold'` | - |
|
|
36
|
-
|
|
37
|
-
> 继承所有 RN `TextProps`(`numberOfLines`、`ellipsizeMode`、`onPress`、`style` 等)
|
|
38
|
-
|
|
39
|
-
## Variant 规格
|
|
40
|
-
|
|
41
|
-
| variant | fontSize | lineHeight | fontWeight | 场景 |
|
|
42
|
-
|---------|----------|------------|------------|------|
|
|
43
|
-
| title | 20 | 26 | 600 | 页面标题、问候语 |
|
|
44
|
-
| heading | 16 | 22 | 600 | 弹窗标题、区块标题 |
|
|
45
|
-
| body | 15 | 22 | 正常 | 默认正文 |
|
|
46
|
-
| caption | 13 | 18 | 正常 | 信息行、标签 |
|
|
47
|
-
| micro | 12 | 18 | 正常 | 地址、规格、描述 |
|
|
48
|
-
|
|
49
|
-
## Weight 映射
|
|
50
|
-
|
|
51
|
-
| weight | fontWeight | 场景 |
|
|
52
|
-
|--------|----------|------|
|
|
53
|
-
| medium | 500 | 产品名、模型名 |
|
|
54
|
-
| semibold | 600 | 标题、按钮文字、客户名 |
|
|
55
|
-
| bold | 700 | 价格金额 |
|
|
56
|
-
|
|
57
|
-
## 样式优先级
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
VARIANT_MAP → secondary/primary → color → weight → style
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
后传入的属性覆盖先传入的,`style` prop 拥有最高优先级。
|
package/src/touchable/index.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Touchable 统一触摸反馈
|
|
2
|
-
|
|
3
|
-
基于 `Pressable`,统一替代 `TouchableOpacity`。按下时降低透明度,支持自定义 `activeOpacity`。
|
|
4
|
-
|
|
5
|
-
## 何时使用
|
|
6
|
-
|
|
7
|
-
- 替代所有 `TouchableOpacity` 的场景
|
|
8
|
-
- 需要可点击区域(非按钮语义)时
|
|
9
|
-
|
|
10
|
-
## 代码演示
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
// 基础用法
|
|
14
|
-
<Touchable onPress={handlePress}>
|
|
15
|
-
<Row gap={10}>
|
|
16
|
-
<Icon name="settings" />
|
|
17
|
-
<Text>设置</Text>
|
|
18
|
-
</Row>
|
|
19
|
-
</Touchable>
|
|
20
|
-
|
|
21
|
-
// 自定义按下透明度
|
|
22
|
-
<Touchable onPress={handlePress} activeOpacity={0.5}>
|
|
23
|
-
<Text>更明显的按下效果</Text>
|
|
24
|
-
</Touchable>
|
|
25
|
-
|
|
26
|
-
// 长按
|
|
27
|
-
<Touchable onPress={handlePress} onLongPress={handleLongPress}>
|
|
28
|
-
<Text>支持长按</Text>
|
|
29
|
-
</Touchable>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## API
|
|
33
|
-
|
|
34
|
-
| 属性 | 说明 | 类型 | 默认值 |
|
|
35
|
-
|------|------|------|--------|
|
|
36
|
-
| onPress | 点击回调 | `() => void` | - |
|
|
37
|
-
| onLongPress | 长按回调 | `() => void` | - |
|
|
38
|
-
| disabled | 禁用状态 | `boolean` | `false` |
|
|
39
|
-
| activeOpacity | 按下态透明度 | `number` | `0.7` |
|
|
40
|
-
| testID | 测试标识 | `string` | - |
|
|
41
|
-
|
|
42
|
-
> 继承所有 RN `ViewProps`
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: WaveAnimation
|
|
3
|
-
nav:
|
|
4
|
-
title: 组件
|
|
5
|
-
order: 1
|
|
6
|
-
group:
|
|
7
|
-
title: 原子
|
|
8
|
-
order: 1
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# WaveAnimation 声波动画
|
|
12
|
-
|
|
13
|
-
柱状声波动画,适用于语音录制等场景的视觉反馈。
|
|
14
|
-
|
|
15
|
-
## 何时使用
|
|
16
|
-
|
|
17
|
-
- 语音录制时展示声波效果
|
|
18
|
-
- 需要节奏性动画反馈时
|
|
19
|
-
|
|
20
|
-
## 代码演示
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { WaveAnimation } from '@unif/react-native-ui';
|
|
24
|
-
|
|
25
|
-
// 基本用法
|
|
26
|
-
<WaveAnimation active={isRecording} />
|
|
27
|
-
|
|
28
|
-
// 自定义参数
|
|
29
|
-
<WaveAnimation
|
|
30
|
-
active={true}
|
|
31
|
-
color="#EB6E00"
|
|
32
|
-
barCount={5}
|
|
33
|
-
barWidth={4}
|
|
34
|
-
minHeight={4}
|
|
35
|
-
maxHeight={24}
|
|
36
|
-
/>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## API
|
|
40
|
-
|
|
41
|
-
| 属性 | 说明 | 类型 | 默认值 |
|
|
42
|
-
| --------- | ------------ | ---------- | ----------- |
|
|
43
|
-
| active | 控制动画启停 | `boolean` | - |
|
|
44
|
-
| color | 柱体颜色 | `string` | `'#FFFFFF'` |
|
|
45
|
-
| barCount | 柱数 | `number` | `4` |
|
|
46
|
-
| barWidth | 柱宽 | `number` | `3` |
|
|
47
|
-
| minHeight | 最小高度 | `number` | `6` |
|
|
48
|
-
| maxHeight | 最大高度 | `number` | `20` |
|
|
49
|
-
| style | 容器样式 | `ViewStyle`| - |
|
|
50
|
-
| testID | 测试标识 | `string` | - |
|