@fjyueke/bify-mcp 1.0.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.
Files changed (210) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +248 -0
  5. package/metaData/components/action-sheet/api.md +74 -0
  6. package/metaData/components/action-sheet/doc.md +243 -0
  7. package/metaData/components/action-sheet/example/index.tsx +116 -0
  8. package/metaData/components/area-picker/api.md +25 -0
  9. package/metaData/components/area-picker/doc.md +132 -0
  10. package/metaData/components/area-picker/example/index.tsx +60 -0
  11. package/metaData/components/avatar/api.md +19 -0
  12. package/metaData/components/avatar/doc.md +170 -0
  13. package/metaData/components/avatar/example/index.tsx +76 -0
  14. package/metaData/components/back-top/api.md +21 -0
  15. package/metaData/components/back-top/doc.md +142 -0
  16. package/metaData/components/back-top/example/index.tsx +96 -0
  17. package/metaData/components/backdrop/api.md +20 -0
  18. package/metaData/components/backdrop/doc.md +98 -0
  19. package/metaData/components/backdrop/example/index.tsx +33 -0
  20. package/metaData/components/badge/api.md +10 -0
  21. package/metaData/components/badge/doc.md +169 -0
  22. package/metaData/components/badge/example/index.tsx +81 -0
  23. package/metaData/components/button/api.md +31 -0
  24. package/metaData/components/button/doc.md +235 -0
  25. package/metaData/components/button/example/index.tsx +235 -0
  26. package/metaData/components/calendar/api.md +62 -0
  27. package/metaData/components/calendar/doc.md +516 -0
  28. package/metaData/components/calendar/example/index.tsx +501 -0
  29. package/metaData/components/cascader/api.md +55 -0
  30. package/metaData/components/cascader/doc.md +358 -0
  31. package/metaData/components/cascader/example/index.tsx +159 -0
  32. package/metaData/components/cell/api.md +37 -0
  33. package/metaData/components/cell/doc.md +158 -0
  34. package/metaData/components/cell/example/index.tsx +44 -0
  35. package/metaData/components/checkbox/api.md +35 -0
  36. package/metaData/components/checkbox/doc.md +203 -0
  37. package/metaData/components/checkbox/example/index.tsx +94 -0
  38. package/metaData/components/circle/api.md +17 -0
  39. package/metaData/components/circle/doc.md +123 -0
  40. package/metaData/components/circle/example/index.tsx +81 -0
  41. package/metaData/components/collapse/api.md +31 -0
  42. package/metaData/components/collapse/doc.md +142 -0
  43. package/metaData/components/collapse/example/index.tsx +81 -0
  44. package/metaData/components/config-provider/api.md +7 -0
  45. package/metaData/components/config-provider/doc.md +193 -0
  46. package/metaData/components/config-provider/example/index.tsx +54 -0
  47. package/metaData/components/countdown/api.md +46 -0
  48. package/metaData/components/countdown/doc.md +167 -0
  49. package/metaData/components/countdown/example/index.tsx +70 -0
  50. package/metaData/components/datetime-picker/api.md +25 -0
  51. package/metaData/components/datetime-picker/doc.md +317 -0
  52. package/metaData/components/datetime-picker/example/index.tsx +265 -0
  53. package/metaData/components/dialog/api.md +66 -0
  54. package/metaData/components/dialog/doc.md +292 -0
  55. package/metaData/components/dialog/example/index.tsx +138 -0
  56. package/metaData/components/divider/api.md +15 -0
  57. package/metaData/components/divider/doc.md +108 -0
  58. package/metaData/components/divider/example/index.tsx +45 -0
  59. package/metaData/components/dropdown-menu/api.md +37 -0
  60. package/metaData/components/dropdown-menu/doc.md +279 -0
  61. package/metaData/components/dropdown-menu/example/index.tsx +182 -0
  62. package/metaData/components/empty/api.md +20 -0
  63. package/metaData/components/empty/doc.md +126 -0
  64. package/metaData/components/empty/example/index.tsx +66 -0
  65. package/metaData/components/field/api.md +10 -0
  66. package/metaData/components/field/doc.md +274 -0
  67. package/metaData/components/field/example/index.tsx +203 -0
  68. package/metaData/components/fixed-nav/api.md +21 -0
  69. package/metaData/components/fixed-nav/doc.md +196 -0
  70. package/metaData/components/fixed-nav/example/index.tsx +80 -0
  71. package/metaData/components/fixed-view/api.md +10 -0
  72. package/metaData/components/fixed-view/doc.md +25 -0
  73. package/metaData/components/fixed-view/example/index.tsx +12 -0
  74. package/metaData/components/flex/api.md +18 -0
  75. package/metaData/components/flex/doc.md +103 -0
  76. package/metaData/components/flex/example/index.tsx +58 -0
  77. package/metaData/components/floating-bubble/api.md +18 -0
  78. package/metaData/components/floating-bubble/doc.md +94 -0
  79. package/metaData/components/floating-bubble/example/index.tsx +55 -0
  80. package/metaData/components/floating-panel/api.md +19 -0
  81. package/metaData/components/floating-panel/doc.md +174 -0
  82. package/metaData/components/floating-panel/example/index.tsx +131 -0
  83. package/metaData/components/form/api.md +124 -0
  84. package/metaData/components/form/doc.md +759 -0
  85. package/metaData/components/form/example/index.tsx +222 -0
  86. package/metaData/components/grid/api.md +28 -0
  87. package/metaData/components/grid/doc.md +167 -0
  88. package/metaData/components/grid/example/index.tsx +80 -0
  89. package/metaData/components/image/api.md +42 -0
  90. package/metaData/components/image/doc.md +117 -0
  91. package/metaData/components/image/example/index.tsx +76 -0
  92. package/metaData/components/index-list/api.md +39 -0
  93. package/metaData/components/index-list/doc.md +176 -0
  94. package/metaData/components/index-list/example/index.tsx +110 -0
  95. package/metaData/components/list/api.md +30 -0
  96. package/metaData/components/list/doc.md +317 -0
  97. package/metaData/components/list/example/index.tsx +218 -0
  98. package/metaData/components/loading/api.md +10 -0
  99. package/metaData/components/loading/doc.md +113 -0
  100. package/metaData/components/loading/example/index.tsx +47 -0
  101. package/metaData/components/navbar/api.md +26 -0
  102. package/metaData/components/navbar/doc.md +85 -0
  103. package/metaData/components/navbar/example/index.tsx +28 -0
  104. package/metaData/components/notice-bar/api.md +28 -0
  105. package/metaData/components/notice-bar/doc.md +154 -0
  106. package/metaData/components/notice-bar/example/index.tsx +107 -0
  107. package/metaData/components/notify/api.md +28 -0
  108. package/metaData/components/notify/doc.md +140 -0
  109. package/metaData/components/notify/example/index.tsx +89 -0
  110. package/metaData/components/number-keyboard/api.md +21 -0
  111. package/metaData/components/number-keyboard/doc.md +247 -0
  112. package/metaData/components/number-keyboard/example/index.tsx +201 -0
  113. package/metaData/components/pagination/api.md +18 -0
  114. package/metaData/components/pagination/doc.md +113 -0
  115. package/metaData/components/pagination/example/index.tsx +73 -0
  116. package/metaData/components/password-input/api.md +25 -0
  117. package/metaData/components/password-input/doc.md +126 -0
  118. package/metaData/components/password-input/example/index.tsx +124 -0
  119. package/metaData/components/picker/api.md +61 -0
  120. package/metaData/components/picker/doc.md +336 -0
  121. package/metaData/components/picker/example/index.tsx +232 -0
  122. package/metaData/components/popup/api.md +48 -0
  123. package/metaData/components/popup/doc.md +150 -0
  124. package/metaData/components/popup/example/index.tsx +214 -0
  125. package/metaData/components/progress/api.md +11 -0
  126. package/metaData/components/progress/doc.md +105 -0
  127. package/metaData/components/progress/example/index.tsx +58 -0
  128. package/metaData/components/pull-refresh/api.md +18 -0
  129. package/metaData/components/pull-refresh/doc.md +198 -0
  130. package/metaData/components/pull-refresh/example/index.tsx +153 -0
  131. package/metaData/components/radio/api.md +26 -0
  132. package/metaData/components/radio/doc.md +201 -0
  133. package/metaData/components/radio/example/index.tsx +103 -0
  134. package/metaData/components/rate/api.md +23 -0
  135. package/metaData/components/rate/doc.md +122 -0
  136. package/metaData/components/rate/example/index.tsx +36 -0
  137. package/metaData/components/rolling-text/api.md +23 -0
  138. package/metaData/components/rolling-text/doc.md +153 -0
  139. package/metaData/components/rolling-text/example/index.tsx +150 -0
  140. package/metaData/components/safe-area/api.md +8 -0
  141. package/metaData/components/safe-area/doc.md +30 -0
  142. package/metaData/components/safe-area/example/index.tsx +16 -0
  143. package/metaData/components/search/api.md +35 -0
  144. package/metaData/components/search/doc.md +185 -0
  145. package/metaData/components/search/example/index.tsx +101 -0
  146. package/metaData/components/share-sheet/api.md +48 -0
  147. package/metaData/components/share-sheet/doc.md +215 -0
  148. package/metaData/components/share-sheet/example/index.tsx +143 -0
  149. package/metaData/components/sidebar/api.md +28 -0
  150. package/metaData/components/sidebar/doc.md +122 -0
  151. package/metaData/components/sidebar/example/index.tsx +58 -0
  152. package/metaData/components/signature/api.md +19 -0
  153. package/metaData/components/signature/doc.md +115 -0
  154. package/metaData/components/signature/example/index.tsx +56 -0
  155. package/metaData/components/skeleton/api.md +45 -0
  156. package/metaData/components/skeleton/doc.md +131 -0
  157. package/metaData/components/skeleton/example/index.tsx +80 -0
  158. package/metaData/components/slider/api.md +28 -0
  159. package/metaData/components/slider/doc.md +151 -0
  160. package/metaData/components/slider/example/index.tsx +54 -0
  161. package/metaData/components/space/api.md +12 -0
  162. package/metaData/components/space/doc.md +125 -0
  163. package/metaData/components/space/example/index.tsx +75 -0
  164. package/metaData/components/stepper/api.md +37 -0
  165. package/metaData/components/stepper/doc.md +152 -0
  166. package/metaData/components/stepper/example/index.tsx +45 -0
  167. package/metaData/components/steps/api.md +9 -0
  168. package/metaData/components/steps/doc.md +143 -0
  169. package/metaData/components/steps/example/index.tsx +93 -0
  170. package/metaData/components/sticky/api.md +16 -0
  171. package/metaData/components/sticky/doc.md +87 -0
  172. package/metaData/components/sticky/example/index.tsx +62 -0
  173. package/metaData/components/swipe-cell/api.md +19 -0
  174. package/metaData/components/swipe-cell/doc.md +105 -0
  175. package/metaData/components/swipe-cell/example/index.tsx +62 -0
  176. package/metaData/components/swiper/api.md +22 -0
  177. package/metaData/components/swiper/doc.md +228 -0
  178. package/metaData/components/swiper/example/index.tsx +118 -0
  179. package/metaData/components/switch/api.md +17 -0
  180. package/metaData/components/switch/doc.md +110 -0
  181. package/metaData/components/switch/example/index.tsx +57 -0
  182. package/metaData/components/tabbar/api.md +27 -0
  183. package/metaData/components/tabbar/doc.md +160 -0
  184. package/metaData/components/tabbar/example/index.tsx +99 -0
  185. package/metaData/components/tabs/api.md +36 -0
  186. package/metaData/components/tabs/doc.md +307 -0
  187. package/metaData/components/tabs/example/index.tsx +231 -0
  188. package/metaData/components/tag/api.md +17 -0
  189. package/metaData/components/tag/doc.md +162 -0
  190. package/metaData/components/tag/example/index.tsx +84 -0
  191. package/metaData/components/text-ellipsis/api.md +26 -0
  192. package/metaData/components/text-ellipsis/doc.md +135 -0
  193. package/metaData/components/text-ellipsis/example/index.tsx +44 -0
  194. package/metaData/components/timeline/api.md +20 -0
  195. package/metaData/components/timeline/doc.md +210 -0
  196. package/metaData/components/timeline/example/index.tsx +145 -0
  197. package/metaData/components/toast/api.md +39 -0
  198. package/metaData/components/toast/doc.md +256 -0
  199. package/metaData/components/toast/example/index.tsx +136 -0
  200. package/metaData/components/tree-select/api.md +19 -0
  201. package/metaData/components/tree-select/doc.md +185 -0
  202. package/metaData/components/tree-select/example/index.tsx +112 -0
  203. package/metaData/components/uploader/api.md +32 -0
  204. package/metaData/components/uploader/doc.md +340 -0
  205. package/metaData/components/uploader/example/index.tsx +222 -0
  206. package/metaData/components/watermark/api.md +18 -0
  207. package/metaData/components/watermark/doc.md +97 -0
  208. package/metaData/components/watermark/example/index.tsx +62 -0
  209. package/metaData/components-index.json +274 -0
  210. package/package.json +56 -0
@@ -0,0 +1,235 @@
1
+ # Button 按钮
2
+
3
+ ### 介绍
4
+
5
+ 按钮用于触发一个操作,如提交表单。
6
+
7
+ ### 引入
8
+
9
+ ```jsx
10
+ import { Button } from "@fjyueke/bify-core"
11
+ ```
12
+
13
+ ## 代码演示
14
+
15
+ ### 按钮颜色
16
+
17
+ 按钮支持 `default`、`primary`、`info`、`success`、`warning`、`danger` 六种颜色,默认为 `default`。
18
+
19
+ ```jsx
20
+ <Button color="primary">主要按钮</Button>
21
+ <Button color="info">信息按钮</Button>
22
+ <Button color="success">成功按钮</Button>
23
+ <Button color="warning">警告按钮</Button>
24
+ <Button color="danger">危险按钮</Button>
25
+ <Button color="default">默认按钮</Button>
26
+ ```
27
+
28
+ ### 文本按钮
29
+
30
+ 通过 `variant="text"` 属性将按钮设置为文本按钮。
31
+
32
+ ```jsx
33
+ <Button variant="text" color="primary">主要按钮</Button>
34
+ <Button variant="text" color="info">信息按钮</Button>
35
+ <Button variant="text" color="success">成功按钮</Button>
36
+ <Button variant="text" color="warning">警告按钮</Button>
37
+ <Button variant="text" color="danger">危险按钮</Button>
38
+ <Button variant="text" color="default">默认按钮</Button>
39
+ ```
40
+
41
+ ### 轮廓按钮
42
+
43
+ 通过 `variant="contained"` 属性将按钮设置为轮廓按钮。
44
+
45
+ ```jsx
46
+ <Button variant="outlined" color="primary">主要按钮</Button>
47
+ <Button variant="outlined" color="info">信息按钮</Button>
48
+ <Button variant="outlined" color="success">成功按钮</Button>
49
+ <Button variant="outlined" color="warning">警告按钮</Button>
50
+ <Button variant="outlined" color="danger">危险按钮</Button>
51
+ <Button variant="outlined" color="default">默认按钮</Button>
52
+ ```
53
+
54
+ ### 细边框
55
+
56
+ 设置 `hairline` 属性可以展示 0.5px 的细边框。
57
+
58
+ ```jsx
59
+ <Button variant="outlined" color="primary" hairline>主要按钮</Button>
60
+ <Button variant="outlined" color="info" hairline>信息按钮</Button>
61
+ <Button variant="outlined" color="success" hairline>成功按钮</Button>
62
+ <Button variant="outlined" color="warning" hairline>警告按钮</Button>
63
+ <Button variant="outlined" color="danger" hairline>危险按钮</Button>
64
+ <Button variant="outlined" color="default" hairline>默认按钮</Button>
65
+ ```
66
+
67
+ ### 禁用状态
68
+
69
+ 通过 `disabled` 属性来禁用按钮,禁用状态下按钮不可点击。
70
+
71
+ ```jsx
72
+ <Button variant="contained" color="primary" disabled>主要按钮</Button>
73
+ <Button variant="contained" color="info" disabled>信息按钮</Button>
74
+ <Button variant="contained" color="success" disabled>成功按钮</Button>
75
+ <Button variant="contained" color="warning" disabled>警告按钮</Button>
76
+ <Button variant="contained" color="danger" disabled>危险按钮</Button>
77
+ <Button variant="contained" color="default" disabled>默认按钮</Button>
78
+ ```
79
+
80
+ ### 加载状态
81
+
82
+ 通过 `loading` 属性设置按钮为加载状态,可以通过 `{type: "spinner"}` 设置加载类型。
83
+
84
+ ```tsx
85
+ <Button color="success" loading />
86
+ <Button color="success" loading={{ type: "spinner" }} />
87
+ <Button color="primary" loading>加载中...</Button>
88
+ ```
89
+
90
+ ### 按钮形状
91
+
92
+ 通过 `shape="square"` 设置方形按钮,通过 `shape="round"` 设置圆形按钮。
93
+
94
+ ```jsx
95
+ <Button variant="contained" color="primary" shape="square">方形按钮</Button>
96
+ <Button variant="contained" color="primary" shape="round">圆形按钮</Button>
97
+ ```
98
+
99
+ ### 图标按钮
100
+
101
+ 通过 `icon` 属性设置按钮图标,支持 Icon 组件里的所有图标,也可以传入图标 URL。
102
+
103
+ ```jsx
104
+ <Button variant="contained" color="primary" icon={<DoneOutlined />} />
105
+ <Button variant="contained" color="primary" icon={<DoneOutlined />}>主要按钮</Button>
106
+ <Button variant="outlined" color="primary" icon={<DoneOutlined />} iconPosition="right">轮廓按钮</Button>
107
+ ```
108
+
109
+ ### 按钮尺寸
110
+
111
+ 支持 `large`、`medium`、`small`、`mini` 四种尺寸,默认为 `medium`。
112
+
113
+ ```jsx
114
+ <Button color="primary" size="large">大号按钮</Button>
115
+ <Button color="primary" size="medium">普通按钮</Button>
116
+ <Button color="primary" size="small">小型按钮</Button>
117
+ <Button color="primary" size="mini">迷你按钮</Button>
118
+ ```
119
+
120
+ ### 块级元素
121
+
122
+ 按钮在默认情况下为行内块级元素,通过 `block` 属性可以将按钮的元素类型设置为块级元素。
123
+
124
+ ```jsx
125
+ <Button color="primary" block>块级按钮</Button>
126
+ ```
127
+
128
+ ### 自定义颜色
129
+
130
+ 通过 `css` 属性可以自定义按钮的颜色。
131
+
132
+ ```tsx
133
+ <Button style={{ backgroundColor: "#7232dd", color: "#fff" }}>单色按钮</Button>
134
+ <Button style={{ borderColor: "#7232dd", color: "#7232dd" }}>单色按钮</Button>
135
+ <Button style={{ background: "linear-gradient(to right, #ff6034, #ee0a24)", color: "#fff" }}>渐变色按钮</Button>
136
+ ```
137
+
138
+ ### 按钮组
139
+
140
+ ```tsx
141
+ <Button.Group variant="contained" color="primary" shape="round">
142
+ <Button> <ArrowLeft /> 上一步</Button>
143
+ <Button> <Replay /> 刷新</Button>
144
+ <Button>下一步 <Arrow /></Button>
145
+ </Button.Group>
146
+
147
+ <Button.Group variant="outlined" shape="round" size="small">
148
+ <Button> <ArrowLeft /> 上一步</Button>
149
+ <Button><Replay /> 刷新</Button>
150
+ <Button>下一步 <Arrow /></Button>
151
+ </Button.Group>
152
+
153
+ <Button.Group variant="text" color="primary" shape="round">
154
+ <Button> <ArrowLeft /> 上一步</Button>
155
+ <Button> <Replay /> 刷新</Button>
156
+ <Button>下一步 <Arrow /></Button>
157
+ </Button.Group>
158
+ ```
159
+
160
+ ## API
161
+
162
+ ### Props
163
+
164
+ | 参数 | 说明 | 类型 | 默认值 |
165
+ |--------------|--------------------------------------------------|---------------------------------------------------------|-------------|
166
+ | variant | 按钮变种,可选值为 `contained` `text` `outlined` | _string_ | `contained` |
167
+ | color | 按钮颜色,可选值为 `primary` `success` `warning` `danger` | _string_ | `default` |
168
+ | size | 尺寸,可选值为 `large` `small` `mini` | _string_ | `medium` |
169
+ | shape | 按钮形状,可选值为 `square` `round` | _string_ | `square` |
170
+ | icon | 左侧[图标](/components/icon)或[图片](/components/image) | _ReactNode_ | - |
171
+ | iconPosition <br>`v0.1.1-alpha.0` | 图标展示位置,可选值为 `right` | _string_ | `left` |
172
+ | formType | 原生 button 标签的 type 属性 | _string_ | `button` |
173
+ | block | 是否为块级元素 | _boolean_ | `false` |
174
+ | disabled | 是否禁用按钮 | _boolean_ | `false` |
175
+ | hairline | 是否使用 0.5px 边框 | _boolean_ | `false` |
176
+ | loading | 是否显示为加载状态 | _boolean \| [LoadingProps](/components/loading/#props)_ | `false` |
177
+ | children | 按钮文字 | _string_ | - |
178
+
179
+
180
+ ### Button.Group Props
181
+
182
+ | 参数 | 说明 | 类型 | 默认值 |
183
+ |----------|--------------------------------------------------|-----------|-------------|
184
+ | variant | 按钮变种,可选值为 `contained` `text` `outlined` | _string_ | `contained` |
185
+ | color | 按钮颜色,可选值为 `primary` `success` `warning` `danger` | _string_ | `default` |
186
+ | size | 尺寸,可选值为 `large` `small` `mini` | _string_ | `medium` |
187
+ | shape | 按钮形状,可选值为 `round` | _string_ | `square` |
188
+ | block | 是否为块级元素 | _boolean_ | - |
189
+ | disabled | 是否禁用按钮 | _boolean_ | - |
190
+ | hairline | 是否使用 0.5px 边框 | _boolean_ | - |
191
+
192
+ ## 主题定制
193
+
194
+ ### 样式变量
195
+
196
+ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider](/components/config-provider/) 组件。
197
+
198
+ | 名称 | 默认值 | 描述 |
199
+ |-----------------------------------|------------------------------------------|-----|
200
+ | --button-line-height | _1.2_ | - |
201
+ | --button-border-width | _var(--border-width-base)_ | - |
202
+ | --button-border-radius | _var(--border-radius-sm)_ | - |
203
+ | --button-border-radius-max | _var(--border-radius-max)_ | - |
204
+ | --button-transition-duration | _var(--animation-duration-fast)_ | - |
205
+ | --button-disabled-opacity | _var(--disabled-opacity)_ | - |
206
+ | --button-loading-icon-size | _20px * $hd_ | - |
207
+ | --button-height-mini | _24px * $hd_ | - |
208
+ | --button-padding-mini | _0 var(--padding-base)_ | - |
209
+ | --button-font-size-mini | _var(--font-size-xs)_ | - |
210
+ | --button-height-small | _32px * $hd_ | - |
211
+ | --button-padding-small | _0 var(--padding-xs)_ | - |
212
+ | --button-font-size-small | _var(--font-size-sm)_ | - |
213
+ | --button-height-medium | _44px * $hd_ | - |
214
+ | --button-padding-medium | _0 var(--padding-md)_ | - |
215
+ | --button-font-size-medium | _var(--font-size-md)_ | - |
216
+ | --button-height-large | _50px * $hd_ | - |
217
+ | --button-font-size-large | _var(--font-size-lg)_ | - |
218
+ | --button-default-color | _var(--text-color)_ | - |
219
+ | --button-default-background-color | _var(--white)_ | - |
220
+ | --button-default-border-color | _var(--border-color)_ | - |
221
+ | --button-primary-color | _var(--white)_ | - |
222
+ | --button-primary-background-color | _var(--primary-color)_ | - |
223
+ | --button-primary-border-color | _var(--button-primary-background-color)_ | - |
224
+ | --button-info-color | _var(--white)_ | - |
225
+ | --button-info-background-color | _var(--info-color)_ | - |
226
+ | --button-info-border-color | _var(--button-info-background-color)_ | - |
227
+ | --button-success-color | _var(--white)_ | - |
228
+ | --button-success-background-color | _var(--success-color)_ | - |
229
+ | --button-success-border-color | _var(--button-success-background-color)_ | - |
230
+ | --button-warning-color | _var(--white)_ | - |
231
+ | --button-warning-background-color | _var(--warning-color)_ | - |
232
+ | --button-warning-border-color | _var(--button-warning-background-color)_ | - |
233
+ | --button-danger-color | _var(--white)_ | - |
234
+ | --button-danger-background-color | _var(--danger-color)_ | - |
235
+ | --button-danger-border-color | _var(--button-danger-background-color)_ | - |
@@ -0,0 +1,235 @@
1
+ import { Button, Space, WhiteSpace } from "@fjyueke/bify-core"
2
+ import { Arrow, ArrowLeft, Replay, ShopOutlined } from "@fjyueke/bify-icons"
3
+ import Block from "../../../components/block"
4
+ import Page from "../../../components/page"
5
+ import "./index.scss"
6
+
7
+ export default function ButtonDemo() {
8
+ return (
9
+ <Page title="Button 按钮" className="button-demo">
10
+ <Block title="按钮颜色">
11
+ <Space>
12
+ <Button variant="contained" color="primary">
13
+ 主要按钮
14
+ </Button>
15
+ <Button variant="contained" color="info">
16
+ 信息按钮
17
+ </Button>
18
+ <Button variant="contained" color="success">
19
+ 成功按钮
20
+ </Button>
21
+ <Button variant="contained" color="warning">
22
+ 警告按钮
23
+ </Button>
24
+ <Button variant="contained" color="danger">
25
+ 危险按钮
26
+ </Button>
27
+ <Button variant="contained" color="default">
28
+ 默认按钮
29
+ </Button>
30
+ </Space>
31
+ </Block>
32
+ <Block title="文本按钮">
33
+ <Space>
34
+ <Button variant="text" color="primary">
35
+ 主要按钮
36
+ </Button>
37
+ <Button variant="text" color="info">
38
+ 信息按钮
39
+ </Button>
40
+ <Button variant="text" color="success">
41
+ 成功按钮
42
+ </Button>
43
+ <Button variant="text" color="warning">
44
+ 警告按钮
45
+ </Button>
46
+ <Button variant="text" color="danger">
47
+ 危险按钮
48
+ </Button>
49
+ <Button variant="text" color="default">
50
+ 默认按钮
51
+ </Button>
52
+ </Space>
53
+ </Block>
54
+ <Block title="轮廓按钮">
55
+ <Space>
56
+ <Button variant="outlined" color="primary">
57
+ 主要按钮
58
+ </Button>
59
+ <Button variant="outlined" color="info">
60
+ 信息按钮
61
+ </Button>
62
+ <Button variant="outlined" color="success">
63
+ 成功按钮
64
+ </Button>
65
+ <Button variant="outlined" color="warning">
66
+ 警告按钮
67
+ </Button>
68
+ <Button variant="outlined" color="danger">
69
+ 危险按钮
70
+ </Button>
71
+ <Button variant="outlined" color="default">
72
+ 默认按钮
73
+ </Button>
74
+ </Space>
75
+ </Block>
76
+ <Block title="细边框按钮">
77
+ <Space>
78
+ <Button variant="outlined" color="primary" hairline>
79
+ 主要按钮
80
+ </Button>
81
+ <Button variant="outlined" color="info" hairline>
82
+ 信息按钮
83
+ </Button>
84
+ <Button variant="outlined" color="success" hairline>
85
+ 成功按钮
86
+ </Button>
87
+ <Button variant="outlined" color="warning" hairline>
88
+ 警告按钮
89
+ </Button>
90
+ <Button variant="outlined" color="danger" hairline>
91
+ 危险按钮
92
+ </Button>
93
+ <Button variant="outlined" color="default" hairline>
94
+ 默认按钮
95
+ </Button>
96
+ </Space>
97
+ </Block>
98
+ <Block title="禁止状态">
99
+ <Space>
100
+ <Button variant="contained" color="primary" disabled>
101
+ 主要按钮
102
+ </Button>
103
+ <Button variant="contained" color="info" disabled>
104
+ 信息按钮
105
+ </Button>
106
+ <Button variant="contained" color="success" disabled>
107
+ 成功按钮
108
+ </Button>
109
+ <Button variant="contained" color="warning" disabled>
110
+ 警告按钮
111
+ </Button>
112
+ <Button variant="contained" color="danger" disabled>
113
+ 危险按钮
114
+ </Button>
115
+ <Button variant="contained" color="default" disabled>
116
+ 默认按钮
117
+ </Button>
118
+ </Space>
119
+ </Block>
120
+ <Block title="加载状态">
121
+ <Space>
122
+ <Button color="success" loading />
123
+ <Button color="success" loading={{ type: "spinner" }} />
124
+ <Button color="primary" loading>
125
+ 加载中...
126
+ </Button>
127
+ </Space>
128
+ </Block>
129
+ <Block title="按钮形状">
130
+ <Space>
131
+ <Button variant="contained" color="primary" shape="square">
132
+ 方形按钮
133
+ </Button>
134
+ <Button variant="contained" color="primary" shape="round">
135
+ 圆形按钮
136
+ </Button>
137
+ </Space>
138
+ </Block>
139
+ <Block title="图标按钮">
140
+ <Space>
141
+ <Button variant="contained" color="primary" icon={<ShopOutlined />} />
142
+ <Button variant="contained" color="primary" icon={<ShopOutlined />}>
143
+ 主要按钮
144
+ </Button>
145
+ <Button variant="outlined" color="primary" icon={<ShopOutlined />} iconPosition="right">
146
+ 轮廓按钮
147
+ </Button>
148
+ </Space>
149
+ </Block>
150
+ <Block title="按钮尺寸">
151
+ <Button variant="contained" color="primary" size="large">
152
+ 大号按钮
153
+ </Button>
154
+ <WhiteSpace />
155
+ <Space>
156
+ <Button variant="contained" color="primary" size="medium">
157
+ 普通按钮
158
+ </Button>
159
+ <Button variant="contained" color="primary" size="small">
160
+ 小型按钮
161
+ </Button>
162
+ <Button variant="contained" color="primary" size="mini">
163
+ 迷你按钮
164
+ </Button>
165
+ </Space>
166
+ </Block>
167
+ <Block title="块级按钮">
168
+ <Button color="primary" block>
169
+ 块级按钮
170
+ </Button>
171
+ </Block>
172
+ <Block title="自定义颜色">
173
+ <Space>
174
+ <Button style={{ backgroundColor: "#7232dd", color: "#fff", borderColor: "#7232dd" }}>
175
+ 单色按钮
176
+ </Button>
177
+ <Button style={{ borderColor: "#7232dd", color: "#7232dd" }}>单色按钮</Button>
178
+ <Button
179
+ style={{
180
+ background: "linear-gradient(to right, #ff6034, #ee0a24)",
181
+ color: "#fff",
182
+ border: 0,
183
+ }}
184
+ >
185
+ 渐变色按钮
186
+ </Button>
187
+ </Space>
188
+ </Block>
189
+ <Block title="按钮组">
190
+ <Space direction="vertical">
191
+ <Button.Group variant="contained" shape="round" color="primary">
192
+ <Button>
193
+ <ArrowLeft />
194
+ 上一步
195
+ </Button>
196
+ <Button>
197
+ <Replay />
198
+ 刷新
199
+ </Button>
200
+ <Button>
201
+ 下一步
202
+ <Arrow />
203
+ </Button>
204
+ </Button.Group>
205
+ <Button.Group variant="outlined" shape="round">
206
+ <Button>
207
+ <ArrowLeft /> 上一步
208
+ </Button>
209
+ <Button>
210
+ <Replay />
211
+ 刷新
212
+ </Button>
213
+ <Button>
214
+ 下一步
215
+ <Arrow />
216
+ </Button>
217
+ </Button.Group>
218
+ <Button.Group variant="text" shape="round">
219
+ <Button>
220
+ <ArrowLeft /> 上一步
221
+ </Button>
222
+ <Button>
223
+ <Replay />
224
+ 刷新
225
+ </Button>
226
+ <Button>
227
+ 下一步
228
+ <Arrow />
229
+ </Button>
230
+ </Button.Group>
231
+ </Space>
232
+ </Block>
233
+ </Page>
234
+ )
235
+ }
@@ -0,0 +1,62 @@
1
+ ## API
2
+
3
+ ### Props
4
+
5
+ | 参数 | 说明 | 类型 | 默认值 |
6
+ | ----------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------- |
7
+ | type | 选择类型:<br>`single` 表示选择单个日期,<br>`multiple` 表示选择多个日期,<br>`range` 表示选择日期区间 | _string_ | `single` |
8
+ | defaultValue | 默认选中的日期,`type` 为 `multiple` 或 `range` 时为数组,传入 `null` 表示默认不选择 | _Date \| Date[] \| null_ | 今天 |
9
+ | value | 选中的日期,`type` 为 `multiple` 或 `range` 时为数组,传入 `null` 表示默认不选择 | _Date \| Date[] \| null_ | 今天 |
10
+ | formatter | 日期格式化函数 | _(day: Calendar.DayObject) => Calendar.DayObject_ | - |
11
+ | title | 日历标题 | _ReactNode_ | `日期选择` |
12
+ | showSubtitle<br> `v0.1.1-alpha.6` | 是否展示日历副标题(年月) | _boolean_ | `true` |
13
+ | subtitle | 自定义日历副标题 | _ReactNode\|((date: Date) => ReactNode)_ | (date) => \`${date.getFullYear()}年${date.getMonth() + 1}月\` |
14
+ | watermark | 是否显示月份背景水印 | _boolean_ | `true` |
15
+ | min | 可选择的最小日期 | _Date_ | 当前日期 |
16
+ | max | 可选择的最大日期 | _Date_ | 当前日期的六个月后 |
17
+ | poppable <br> `v0.1.1-alpha.6` | 是否以弹层的形式展示日历 | _boolean_ | `false` |
18
+ | showPopup <br> `v0.1.1-alpha.6` | 是否显示日历弹窗, poppable: true 时生效 | _boolean_ | `false` |
19
+ | popupPlacement | 弹出位置,可选值为 `left` `right` `top` , poppable: true 时生效 | _string_ | `bottom` |
20
+ | popupRound | 是否显示圆角弹窗, poppable: true 时生效 | _boolean_ | `true` |
21
+ | popupCloseIcon | 弹框是否显示关闭图标, poppable: true 时生效 | _boolean_ | `true` |
22
+ | readonly | 是否为只读状态,只读状态下不能选择日期 | _boolean_ | `false` |
23
+ | showConfirm <br> `v0.1.1-alpha.6` | 是否展示确认按钮 | _boolean_ | `true` |
24
+ | confirmText <br> `v0.1.1-alpha.6` | 确认按钮的文字 | _ReactNode_ | `确认` |
25
+ | confirmDisabledText <br> `v0.1.1-alpha.6` | 确认按钮处于禁用状态时的文字 | _ReactNode_ | `确认` |
26
+ | firstDayOfWeek | 设置周起始日 | _0-6_ | `0` |
27
+
28
+ ### Calendar.DayObject 数据结构
29
+
30
+ 日历中的每个日期都对应一个 Day 对象,通过`formatter`属性可以自定义 Day 对象的内容
31
+
32
+ | 键名 | 说明 | 类型 |
33
+ | --------- | ------------------------------------------------------------- | -------- |
34
+ | value | 日期对应的 Date 对象 | _Date_ |
35
+ | type | 日期类型,可选值为 `active` `start` `middle` `end` `disabled` | _string_ |
36
+ | children | 中间显示的文字 | _string_ |
37
+ | top | 上方的提示信息 | _string_ |
38
+ | bottom | 下方的提示信息 | _string_ |
39
+ | className | 额外类名 | _string_ |
40
+
41
+ ### Events
42
+
43
+ | 事件名 | 说明 | 回调参数 |
44
+ | ---------------------------- | ----------------------------------------------------------------------- | ----------------------- |
45
+ | onChange | 点击并选中任意日期时触发 | _value: Date \| Date[]_ |
46
+ | onConfirm | 日期选择完成后触发,若使用 `Calendar.Button` 组件,则点击确认按钮后触发 | _value: Date \| Date[]_ |
47
+ | onClose <br>`v0.1.1-alpha.6` | 关闭弹层时出发 | _visible: boolean_ |
48
+
49
+ ### Calendar.Footer Props
50
+
51
+ | 参数 | 说明 | 类型 | 默认值 |
52
+ | -------- | -------- | ---------- | ------ |
53
+ | children | 底部内容 | _ReactNoe_ | - |
54
+
55
+ ### Calendar.Button Props
56
+
57
+ | 参数 | 说明 | 类型 | 默认值 |
58
+ | ------------------- | ---------------------------- | ----------- | --------- |
59
+ | children | 按钮内容 | _ReactNoe_ | 确认 |
60
+ | type | 按钮类型 | _confirm_ | `confirm` |
61
+ | confirmText | 确认按钮的文字 | _ReactNode_ | - |
62
+ | confirmDisabledText | 确认按钮处于禁用状态时的文字 | _ReactNode_ | - |