@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,26 @@
1
+ ## API
2
+
3
+ ### Navbar Props
4
+
5
+ | 参数 | 说明 | 类型 | 默认值 |
6
+ | ------------- | ------------------------------------------------------- | --------- | ------- |
7
+ | title | 标题 | _string_ | `''` |
8
+ | bordered | 是否显示下边框 | _boolean_ | `false` |
9
+ | fixed | 是否固定在顶部 | _boolean_ | `false` |
10
+ | safeArea | 安全区域,可选值 `top` `bottom`,仅在`fixed=true`时有效 | _string_ | - |
11
+ | nativeSafeTop | 是否启用顶部安全区域原生属性 | _boolean_ | `false` |
12
+ | placeholder | 固定在顶部时,是否在标签位置生成一个等高的占位元素 | _boolean_ | `false` |
13
+
14
+ ### Navbar.NavLeft Props
15
+
16
+ | 参数 | 说明 | 类型 | 默认值 |
17
+ | -------- | -------- | ----------- | ------ |
18
+ | icon | 左侧图标 | _Icon_ | - |
19
+ | children | 左侧文案 | _ReactNode_ | - |
20
+
21
+ ### Navbar.NavRight Props
22
+
23
+ | 参数 | 说明 | 类型 | 默认值 |
24
+ | -------- | -------- | ----------- | ------ |
25
+ | icon | 右侧图标 | _Icon_ | - |
26
+ | children | 右侧文案 | _ReactNode_ | - |
@@ -0,0 +1,85 @@
1
+ # Navbar 导航栏
2
+
3
+ ### 介绍
4
+
5
+ 为页面提供导航功能,常用于页面顶部。
6
+
7
+ ### 引入
8
+
9
+ ```tsx
10
+ import { Navbar } from "@fjyueke/bify-core"
11
+ ```
12
+
13
+ ## 代码演示
14
+
15
+ ### 基础用法
16
+
17
+ ```tsx
18
+ <Navbar title="标题" />
19
+ ```
20
+
21
+ ### 返回上级
22
+
23
+ ```tsx
24
+ <Navbar title="标题">
25
+ <Navbar.NavLeft onClick={onClick}>返回</Navbar.NavLeft>
26
+ <Navbar.NavRight>按钮</Navbar.NavRight>
27
+ </Navbar>
28
+ ```
29
+
30
+ ### 使用 NavLeft 和 NavRight
31
+
32
+ ```tsx
33
+ <Navbar>
34
+ <Navbar.NavLeft>返回</Navbar.NavLeft>
35
+ <Navbar.Title>标题</Navbar.Title>
36
+ <Navbar.NavRight icon={<Search />} />
37
+ </Navbar>
38
+ ```
39
+
40
+ ## API
41
+
42
+ ### Navbar Props
43
+
44
+ | 参数 | 说明 | 类型 | 默认值 |
45
+ | ------------- | ------------------------------------------------------- | --------- | ------- |
46
+ | title | 标题 | _string_ | `''` |
47
+ | bordered | 是否显示下边框 | _boolean_ | `false` |
48
+ | fixed | 是否固定在顶部 | _boolean_ | `false` |
49
+ | safeArea | 安全区域,可选值 `top` `bottom`,仅在`fixed=true`时有效 | _string_ | - |
50
+ | nativeSafeTop | 是否启用顶部安全区域原生属性 | _boolean_ | `false` |
51
+ | placeholder | 固定在顶部时,是否在标签位置生成一个等高的占位元素 | _boolean_ | `false` |
52
+
53
+ ### Navbar.NavLeft Props
54
+
55
+ | 参数 | 说明 | 类型 | 默认值 |
56
+ | -------- | -------- | ----------- | ------ |
57
+ | icon | 左侧图标 | _Icon_ | - |
58
+ | children | 左侧文案 | _ReactNode_ | - |
59
+
60
+ ### Navbar.NavRight Props
61
+
62
+ | 参数 | 说明 | 类型 | 默认值 |
63
+ | -------- | -------- | ----------- | ------ |
64
+ | icon | 右侧图标 | _Icon_ | - |
65
+ | children | 右侧文案 | _ReactNode_ | - |
66
+
67
+ ## 主题定制
68
+
69
+ ### 样式变量
70
+
71
+ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider](/components/config-provider/) 组件。
72
+
73
+ | 名称 | 默认值 | 描述 |
74
+ | -------------------------- | ------------------------- | ---- |
75
+ | --navbar-z-index | _1_ | - |
76
+ | --navbar-height | _46px \* $hd_ | - |
77
+ | --navbar-line-height | _var(--line-height-lg)_ | - |
78
+ | --navbar-background-color | _var(--white)_ | - |
79
+ | --navbar-icon-margin-right | _var(--padding-base)_ | - |
80
+ | --navbar-icon-font-size | _16px \* $hd_ | - |
81
+ | --navbar-icon-color | _var(--blue)_ | - |
82
+ | --navbar-text-color | _var(--blue)_ | - |
83
+ | --navbar-title-font-size | _var(--font-size-lg)_ | - |
84
+ | --navbar-title-font-weight | _var(--font-weight-bold)_ | - |
85
+ | --navbar-title-color | _var(--text-color)_ | - |
@@ -0,0 +1,28 @@
1
+ import { Navbar } from "@fjyueke/bify-core"
2
+ import { Search } 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 NavbarDemo() {
8
+ return (
9
+ <Page title="Navbar 导航栏" className="navbar-demo">
10
+ <Block title="基础用法">
11
+ <Navbar title="标题" />
12
+ </Block>
13
+ <Block title="返回上级">
14
+ <Navbar title="标题">
15
+ <Navbar.NavLeft>返回</Navbar.NavLeft>
16
+ <Navbar.NavRight>按钮</Navbar.NavRight>
17
+ </Navbar>
18
+ </Block>
19
+ <Block title="使用 NavLeft 和 NavRight">
20
+ <Navbar>
21
+ <Navbar.NavLeft>返回</Navbar.NavLeft>
22
+ <Navbar.Title>标题</Navbar.Title>
23
+ <Navbar.NavRight icon={<Search />} />
24
+ </Navbar>
25
+ </Block>
26
+ </Page>
27
+ )
28
+ }
@@ -0,0 +1,28 @@
1
+ ## API
2
+
3
+ ### Props
4
+
5
+ | 参数 | 说明 | 类型 | 默认值 |
6
+ | ---------- | ---------------------------------------- | ------------------ | ------- |
7
+ | className | 通知栏自定义类名 | _string_ | - |
8
+ | style | 通知栏自定义样式 | _CSSProperties_ | - |
9
+ | children | 通知文本内容 | _ReactNode_ | - |
10
+ | delay | 动画延迟时间 (ms) | _number \| string_ | `1000` |
11
+ | speed | 滚动速率 (px/s) | _number \| string_ | `60` |
12
+ | scrollable | 是否开启滚动播放,内容长度溢出时默认开启 | _boolean_ | `false` |
13
+ | wordwrap | 是否开启文本换行,只在禁用滚动时生效 | _boolean_ | `false` |
14
+
15
+ ### Events
16
+
17
+ | 事件名 | 说明 | 回调参数 |
18
+ | -------- | ---------------------------- | ------------------- |
19
+ | onClick | 点击通知栏时触发 | _event: MouseEvent_ |
20
+ | onReplay | 每当滚动栏重新开始滚动时触发 | - |
21
+
22
+ ### 方法
23
+
24
+ 通过 ref 可以获取到 NoticeBar 实例并调用实例方法
25
+
26
+ | 方法名 | 说明 | 参数 | 返回值 |
27
+ | ---------------------- | -------------------- | ---- | ------ |
28
+ | reset `v0.1.1-alpha.3` | 重置通知栏到初始状态 | - | - |
@@ -0,0 +1,154 @@
1
+ # NoticeBar 通知栏
2
+
3
+ ### 介绍
4
+
5
+ 用于循环播放展示一组消息通知。
6
+
7
+ ### 引入
8
+
9
+ ```tsx
10
+ import { NoticeBar } from "@fjyueke/bify-core"
11
+ ```
12
+
13
+ ## 代码演示
14
+
15
+ ### 基础用法
16
+
17
+ 通过 `children` 属性设置通知栏的内容,通过 `NoticeBar.Icon` 组件设置通知栏左侧的图标。
18
+
19
+ ```tsx
20
+ <NoticeBar scrollable>
21
+ <NoticeBar.Icon>
22
+ <VolumeOutlined />
23
+ </NoticeBar.Icon>
24
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
25
+ </NoticeBar>
26
+ ```
27
+
28
+ ### 滚动播放
29
+
30
+ 通知栏的内容长度溢出时会自动开启滚动播放,通过 `scrollable` 属性可以控制该行为。
31
+
32
+ ```tsx
33
+ <!-- 文字较短时,通过设置 scrollable 属性开启滚动播放 -->
34
+ <van-notice-bar scrollable text="技术是开发它的人的共同灵魂。" />
35
+ <NoticeBar scrollable>技术是开发它的人的共同灵魂。</NoticeBar>
36
+ <!-- 文字较长时,通过禁用 scrollable 属性关闭滚动播放 -->
37
+ <NoticeBar scrollable={false}>
38
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
39
+ </NoticeBar>
40
+ ```
41
+
42
+ ### 多行展示
43
+
44
+ 文字较长时,可以通过设置 `wordwrap` 属性来开启多行展示。
45
+
46
+ ```tsx
47
+ <NoticeBar wordwrap scrollable={false}>
48
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
49
+ </NoticeBar>
50
+ ```
51
+
52
+ ### 通知栏模式
53
+
54
+ 通过 `NoticeBar.Action` 组件可以显示不同的通知栏模式。
55
+
56
+ ```tsx
57
+ <NoticeBar scrollable={false}>
58
+ 技术是开发它的人的共同灵魂。
59
+ <NoticeBar.Action>
60
+ <Cross />
61
+ </NoticeBar.Action>
62
+ </NoticeBar>
63
+ <WhiteSpace />
64
+ <NoticeBar scrollable={false}>
65
+ 技术是开发它的人的共同灵魂。
66
+ <NoticeBar.Action>
67
+ <ArrowRight />
68
+ </NoticeBar.Action>
69
+ </NoticeBar>
70
+ ```
71
+
72
+ ### 自定义样式
73
+
74
+ 通过 `style` 属性设置文本颜色和背景色。
75
+
76
+ ```tsx
77
+ <NoticeBar style={{ color: "#1989fa", background: "#ecf9ff" }}>
78
+ <NoticeBar.Icon>
79
+ <InfoOutlined />
80
+ </NoticeBar.Icon>
81
+ 技术是开发它的人的共同灵魂。
82
+ </NoticeBar>
83
+ ```
84
+
85
+ ### 垂直滚动
86
+
87
+ 搭配 NoticeBar 和 Swiper 组件可以实现垂直滚动的效果。
88
+
89
+ ```tsx
90
+ <NoticeBar>
91
+ <NoticeBar.Icon>
92
+ <VolumeOutlined />
93
+ </NoticeBar.Icon>
94
+ <Swiper className="notice-swiper" direction="vertical" autoplay={3000}>
95
+ <Swiper.Item>内容 1</Swiper.Item>
96
+ <Swiper.Item>内容 2</Swiper.Item>
97
+ <Swiper.Item>内容 3</Swiper.Item>
98
+ </Swiper>
99
+ </NoticeBar>
100
+ ```
101
+
102
+ ```scss
103
+ .notice-swiper {
104
+ height: 40px * 2;
105
+ line-height: 40px * 2;
106
+ }
107
+ ```
108
+
109
+ ## API
110
+
111
+ ### Props
112
+
113
+ | 参数 | 说明 | 类型 | 默认值 |
114
+ | ---------- | ---------------------------------------- | ------------------ | ------- |
115
+ | className | 通知栏自定义类名 | _string_ | - |
116
+ | style | 通知栏自定义样式 | _CSSProperties_ | - |
117
+ | children | 通知文本内容 | _ReactNode_ | - |
118
+ | delay | 动画延迟时间 (ms) | _number \| string_ | `1000` |
119
+ | speed | 滚动速率 (px/s) | _number \| string_ | `60` |
120
+ | scrollable | 是否开启滚动播放,内容长度溢出时默认开启 | _boolean_ | `false` |
121
+ | wordwrap | 是否开启文本换行,只在禁用滚动时生效 | _boolean_ | `false` |
122
+
123
+ ### Events
124
+
125
+ | 事件名 | 说明 | 回调参数 |
126
+ | -------- | ---------------------------- | ------------------- |
127
+ | onClick | 点击通知栏时触发 | _event: MouseEvent_ |
128
+ | onReplay | 每当滚动栏重新开始滚动时触发 | - |
129
+
130
+ ### 方法
131
+
132
+ 通过 ref 可以获取到 NoticeBar 实例并调用实例方法
133
+
134
+ | 方法名 | 说明 | 参数 | 返回值 |
135
+ | ---------------------- | -------------------- | ---- | ------ |
136
+ | reset `v0.1.1-alpha.3` | 重置通知栏到初始状态 | - | - |
137
+
138
+ ## 主题定制
139
+
140
+ ### 样式变量
141
+
142
+ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider](/components/config-provider/) 组件。
143
+
144
+ | 名称 | 默认值 | 描述 |
145
+ | ----------------------------- | ------------------------------------- | ---- |
146
+ | --notice-bar-height | _40px \* $hd_ | - |
147
+ | --notice-bar-padding | _0 var(--padding-md)_ | - |
148
+ | --notice-bar-wordwrap-padding | _var(--padding-xs) var(--padding-md)_ | - |
149
+ | --notice-bar-color | _var(--orange-dark)_ | - |
150
+ | --notice-bar-font-size | _var(--font-size-md)_ | - |
151
+ | --notice-bar-line-height | _24px \* $hd_ | - |
152
+ | --notice-bar-background-color | _var(--orange-light)_ | - |
153
+ | --notice-bar-icon-size | _16px \* $hd_ | - |
154
+ | --notice-bar-icon-min-width | _24px \* $hd_ | - |
@@ -0,0 +1,107 @@
1
+ import { NoticeBar, Swiper, WhiteSpace } from "@fjyueke/bify-core"
2
+ import { ArrowRight, Cross, InfoOutlined, VolumeOutlined } from "@fjyueke/bify-icons"
3
+ import Block from "../../../components/block"
4
+ import Page from "../../../components/page"
5
+ import "./index.scss"
6
+
7
+ function BasicNoticeBar() {
8
+ return (
9
+ <NoticeBar scrollable>
10
+ <NoticeBar.Icon>
11
+ <VolumeOutlined />
12
+ </NoticeBar.Icon>
13
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
14
+ </NoticeBar>
15
+ )
16
+ }
17
+
18
+ function ScrollableNoticeBar() {
19
+ return (
20
+ <>
21
+ <NoticeBar scrollable>技术是开发它的人的共同灵魂。</NoticeBar>
22
+ <WhiteSpace />
23
+ <NoticeBar scrollable={false}>
24
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
25
+ </NoticeBar>
26
+ </>
27
+ )
28
+ }
29
+
30
+ function WordwrapNoticeBar() {
31
+ return (
32
+ <NoticeBar wordwrap scrollable={false}>
33
+ 在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。
34
+ </NoticeBar>
35
+ )
36
+ }
37
+
38
+ function ActionNoticeBar() {
39
+ return (
40
+ <>
41
+ <NoticeBar scrollable={false}>
42
+ 技术是开发它的人的共同灵魂。
43
+ <NoticeBar.Action>
44
+ <Cross />
45
+ </NoticeBar.Action>
46
+ </NoticeBar>
47
+ <WhiteSpace />
48
+ <NoticeBar scrollable={false}>
49
+ 技术是开发它的人的共同灵魂。
50
+ <NoticeBar.Action>
51
+ <ArrowRight />
52
+ </NoticeBar.Action>
53
+ </NoticeBar>
54
+ </>
55
+ )
56
+ }
57
+
58
+ function NoticeBarWithCustomStyle() {
59
+ return (
60
+ <NoticeBar style={{ color: "#1989fa", background: "#ecf9ff" }}>
61
+ <NoticeBar.Icon>
62
+ <InfoOutlined />
63
+ </NoticeBar.Icon>
64
+ 技术是开发它的人的共同灵魂。
65
+ </NoticeBar>
66
+ )
67
+ }
68
+
69
+ function NoticeBarWithVerticalScrolling() {
70
+ return (
71
+ <NoticeBar>
72
+ <NoticeBar.Icon>
73
+ <VolumeOutlined />
74
+ </NoticeBar.Icon>
75
+ <Swiper className="notice-swiper" direction="vertical" autoplay={3000}>
76
+ <Swiper.Item>内容 1</Swiper.Item>
77
+ <Swiper.Item>内容 2</Swiper.Item>
78
+ <Swiper.Item>内容 3</Swiper.Item>
79
+ </Swiper>
80
+ </NoticeBar>
81
+ )
82
+ }
83
+
84
+ export default function NoticeBarDemo() {
85
+ return (
86
+ <Page title="NoticeBar 通知栏" className="notice-bar-demo">
87
+ <Block title="基础用法">
88
+ <BasicNoticeBar />
89
+ </Block>
90
+ <Block title="滚动播放">
91
+ <ScrollableNoticeBar />
92
+ </Block>
93
+ <Block title="多行展示">
94
+ <WordwrapNoticeBar />
95
+ </Block>
96
+ <Block title="通知栏模式">
97
+ <ActionNoticeBar />
98
+ </Block>
99
+ <Block title="自定义样式">
100
+ <NoticeBarWithCustomStyle />
101
+ </Block>
102
+ <Block title="垂直滚动">
103
+ <NoticeBarWithVerticalScrolling />
104
+ </Block>
105
+ </Page>
106
+ )
107
+ }
@@ -0,0 +1,28 @@
1
+ ## API
2
+
3
+ ### Props
4
+
5
+ | 参数 | 说明 | 类型 | 默认值 |
6
+ | --------------------------- | -------------------------------------------- | -------------------------- | -------- |
7
+ | className | 自定义类名 | _string_ | - |
8
+ | style | 组件样式 | _CSSProperties_ | - |
9
+ | defaultOpen | 默认是否显示消息提示 | _boolean_ | - |
10
+ | open | 是否显示消息提示 | _boolean_ | - |
11
+ | type | 类型,可选值为 `primary` `success` `warning` | _string_ | `danger` |
12
+ | color `v0.6.0-alpha.0` | 字体颜色 | _string_ | - |
13
+ | background `v0.6.0-alpha.0` | 背景颜色 | _string_ | - |
14
+ | duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number_ | `3000` |
15
+ | children | 展示文案,支持通过`\n`换行 | _ReactNode_ | - |
16
+ | onClose | 关闭时的回调函数 | _(open : boolean) => void_ | - |
17
+
18
+ ### Options
19
+
20
+ | 参数 | 说明 | 类型 | 默认值 |
21
+ | --------- | -------------------------------------------- | -------------------------- | -------- |
22
+ | selector | 自定义节点选择器 | _string_ | `notify` |
23
+ | className | 自定义类名 | _string_ | - |
24
+ | style | 组件样式 | _CSSProperties_ | - |
25
+ | color | 类型,可选值为 `primary` `success` `warning` | _string_ | `danger` |
26
+ | duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number_ | `3000` |
27
+ | message | 展示文案,支持通过`\n`换行 | _ReactNode_ | - |
28
+ | onClose | 关闭时的回调函数 | _(open : boolean) => void_ | - |
@@ -0,0 +1,140 @@
1
+ # Notify 消息提示
2
+
3
+ ### 介绍
4
+
5
+ 在页面顶部展示消息提示,支持函数调用和组件调用两种方式。
6
+
7
+ ### 函数调用
8
+
9
+ 版本 >= `v0.6.0-alpha.0`可以直接调用。低版本需要手动在页面(page)里挂载一个 Notify 组件并指定 id 为 `notify`。
10
+
11
+ ```tsx
12
+ import { Cell, Notify } from "@fjyueke/bify-core"
13
+
14
+ function ImperativeNotify() {
15
+ return (
16
+ <>
17
+ {/* <Notify id="notify" /> */}
18
+ <Cell title="函数调用" clickable isLink onClick={() => Notify.open("通知内容")} />
19
+ </>
20
+ )
21
+ }
22
+ ```
23
+
24
+ ### 组件调用
25
+
26
+ ```tsx
27
+ import { Cell, Notify } from "@fjyueke/bify-core"
28
+
29
+ function BasicNotify() {
30
+ const [open, setOpen] = useState(false)
31
+
32
+ return (
33
+ <>
34
+ <Notify open={open} onClose={setOpen}>
35
+ 通知内容
36
+ </Notify>
37
+ <Cell title="基础用法" clickable onClick={() => setOpen(true)} />
38
+ </>
39
+ )
40
+ }
41
+ ```
42
+
43
+ ## 代码演示
44
+
45
+ ### 基础用法
46
+
47
+ ```ts
48
+ Notify.open("通知内容")
49
+ ```
50
+
51
+ ```tsx
52
+ <Notify id="notify" open>
53
+ 通知内容
54
+ </Notify>
55
+ ```
56
+
57
+ ### 通知颜色
58
+
59
+ 预设 `primary`、`success`、`warning`、`danger` 四种通知颜色,默认为 `danger`。
60
+
61
+ ```ts
62
+ Notify.open({ type: "primary", message: "通知内容" })
63
+ Notify.open({ type: "success", message: "通知内容" })
64
+ Notify.open({ type: "danger", message: "通知内容" })
65
+ Notify.open({ type: "warning", message: "通知内容" })
66
+ ```
67
+
68
+ ```tsx
69
+ <Notify open type="primary">通知内容</Notify>
70
+ <Notify open type="success">通知内容</Notify>
71
+ <Notify open type="danger">通知内容</Notify>
72
+ <Notify open type="warning">通知内容</Notify>
73
+ ```
74
+
75
+ ### 自定义通知
76
+
77
+ 自定义消息通知的颜色和展示时长。
78
+
79
+ ```ts
80
+ Notify.open({
81
+ color: "#ad0000",
82
+ background: "#ffe1e1",
83
+ message: "自定义颜色",
84
+ })
85
+ Notify.open({
86
+ duration: 1000,
87
+ message: "自定义时长",
88
+ })
89
+ ```
90
+
91
+ ```tsx
92
+ <Notify open style={{ color: "#ad0000", background: "#ffe1e1" }}>自定义颜色</Notify>
93
+ <Notify open duration={1000}>自定义时长</Notify>
94
+ ```
95
+
96
+ ## API
97
+
98
+ ### Props
99
+
100
+ | 参数 | 说明 | 类型 | 默认值 |
101
+ | --------------------------- | -------------------------------------------- | -------------------------- | -------- |
102
+ | className | 自定义类名 | _string_ | - |
103
+ | style | 组件样式 | _CSSProperties_ | - |
104
+ | defaultOpen | 默认是否显示消息提示 | _boolean_ | - |
105
+ | open | 是否显示消息提示 | _boolean_ | - |
106
+ | type | 类型,可选值为 `primary` `success` `warning` | _string_ | `danger` |
107
+ | color `v0.6.0-alpha.0` | 字体颜色 | _string_ | - |
108
+ | background `v0.6.0-alpha.0` | 背景颜色 | _string_ | - |
109
+ | duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number_ | `3000` |
110
+ | children | 展示文案,支持通过`\n`换行 | _ReactNode_ | - |
111
+ | onClose | 关闭时的回调函数 | _(open : boolean) => void_ | - |
112
+
113
+ ### Options
114
+
115
+ | 参数 | 说明 | 类型 | 默认值 |
116
+ | --------- | -------------------------------------------- | -------------------------- | -------- |
117
+ | selector | 自定义节点选择器 | _string_ | `notify` |
118
+ | className | 自定义类名 | _string_ | - |
119
+ | style | 组件样式 | _CSSProperties_ | - |
120
+ | color | 类型,可选值为 `primary` `success` `warning` | _string_ | `danger` |
121
+ | duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number_ | `3000` |
122
+ | message | 展示文案,支持通过`\n`换行 | _ReactNode_ | - |
123
+ | onClose | 关闭时的回调函数 | _(open : boolean) => void_ | - |
124
+
125
+ ## 主题定制
126
+
127
+ ### 样式变量
128
+
129
+ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider](/components/config-provider/) 组件。
130
+
131
+ | 名称 | 默认值 | 描述 |
132
+ | --------------------------------- | ------------------------------------- | ---- |
133
+ | --notify-color | _var(--white)_ | - |
134
+ | --notify-padding | _var(--padding-xs) var(--padding-md)_ | - |
135
+ | --notify-font-size | _var(--font-size-md)_ | - |
136
+ | --notify-line-height | _var(--line-height-md)_ | - |
137
+ | --notify-primary-background-color | _var(--primary-color)_ | - |
138
+ | --notify-success-background-color | _var(--success-color)_ | - |
139
+ | --notify-warning-background-color | _var(--warning-color)_ | - |
140
+ | --notify-danger-background-color | _var(--danger-color)_ | - |
@@ -0,0 +1,89 @@
1
+ import { Cell, Notify } from "@fjyueke/bify-core"
2
+ import Block from "../../../components/block"
3
+ import Page from "../../../components/page"
4
+ import "./index.scss"
5
+
6
+ function BasicNotify() {
7
+ return (
8
+ <>
9
+ <Cell title="基础用法" clickable isLink onClick={() => Notify.open("文字提示")} />
10
+ </>
11
+ )
12
+ }
13
+
14
+ function CustomNotify() {
15
+ return (
16
+ <>
17
+ <Cell
18
+ title="自定义颜色"
19
+ clickable
20
+ isLink
21
+ onClick={() => {
22
+ Notify.open({
23
+ color: "#ad0000",
24
+ background: "#ffe1e1",
25
+ message: "自定义颜色",
26
+ })
27
+ }}
28
+ />
29
+ <Cell
30
+ title="自定义时长"
31
+ clickable
32
+ isLink
33
+ onClick={() =>
34
+ Notify.open({
35
+ duration: 1000,
36
+ message: "自定义时长",
37
+ })
38
+ }
39
+ />
40
+ </>
41
+ )
42
+ }
43
+
44
+ function NotifyWithPresetColors() {
45
+ return (
46
+ <>
47
+ <Cell
48
+ title="主要通知"
49
+ clickable
50
+ isLink
51
+ onClick={() => Notify.open({ color: "primary", message: "通知内容" })}
52
+ />
53
+ <Cell
54
+ title="成功通知"
55
+ clickable
56
+ isLink
57
+ onClick={() => Notify.open({ color: "success", message: "通知内容" })}
58
+ />
59
+ <Cell
60
+ title="危险通知"
61
+ clickable
62
+ isLink
63
+ onClick={() => Notify.open({ color: "danger", message: "通知内容" })}
64
+ />
65
+ <Cell
66
+ title="警告通知"
67
+ clickable
68
+ isLink
69
+ onClick={() => Notify.open({ color: "warning", message: "通知内容" })}
70
+ />
71
+ </>
72
+ )
73
+ }
74
+
75
+ export default function NotifyDemo() {
76
+ return (
77
+ <Page title="Notify 消息提示" className="notify-demo">
78
+ <Block variant="card" title="基础用法">
79
+ <BasicNotify />
80
+ </Block>
81
+ <Block variant="card" title="通知颜色">
82
+ <NotifyWithPresetColors />
83
+ </Block>
84
+ <Block variant="card" title="自定义配置">
85
+ <CustomNotify />
86
+ </Block>
87
+ </Page>
88
+ )
89
+ }