@next-bricks/presentational 1.21.9 → 1.21.10

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 (60) hide show
  1. package/dist/bricks.json +9 -9
  2. package/dist/chunks/5045.b0f85f6b.js.map +1 -1
  3. package/dist/chunks/code-wrapper.40655769.js.map +1 -1
  4. package/dist/chunks/eo-card-item.fbff6f7e.js.map +1 -1
  5. package/dist/chunks/eo-carousel-text.d8e8c2c9.js.map +1 -1
  6. package/dist/chunks/eo-code-block.7efe5647.js.map +1 -1
  7. package/dist/chunks/eo-code-display.ffd79558.js.map +1 -1
  8. package/dist/chunks/eo-current-time.7cbef918.js.map +1 -1
  9. package/dist/chunks/eo-descriptions.b8320ca9.js.map +1 -1
  10. package/dist/chunks/eo-humanize-time.2397ce6e.js.map +1 -1
  11. package/dist/chunks/eo-info-card-item.0d15cb28.js.map +1 -1
  12. package/dist/chunks/eo-loading-step.834e0aa3.js.map +1 -1
  13. package/dist/chunks/eo-pagination.16fd816a.js.map +1 -1
  14. package/dist/chunks/eo-statistics-card.410b5416.js.map +1 -1
  15. package/dist/examples.json +15 -15
  16. package/dist/{index.db5144bf.js → index.3d30863f.js} +2 -2
  17. package/dist/{index.db5144bf.js.map → index.3d30863f.js.map} +1 -1
  18. package/dist/manifest.json +108 -98
  19. package/dist/types.json +110 -110
  20. package/dist-types/card-item/index.d.ts +8 -4
  21. package/dist-types/carousel-text/index.d.ts +1 -1
  22. package/dist-types/code-block/index.d.ts +12 -3
  23. package/dist-types/code-display/index.d.ts +0 -1
  24. package/dist-types/code-wrapper/index.d.ts +7 -2
  25. package/dist-types/current-time/index.d.ts +1 -1
  26. package/dist-types/descriptions/index.d.ts +2 -1
  27. package/dist-types/humanize-time/index.d.ts +8 -8
  28. package/dist-types/info-card-item/index.d.ts +8 -7
  29. package/dist-types/loading-step/index.d.ts +8 -8
  30. package/dist-types/pagination/index.d.ts +7 -0
  31. package/dist-types/statistics-card/index.d.ts +2 -2
  32. package/docs/eo-alert.md +65 -1
  33. package/docs/eo-alert.react.md +127 -0
  34. package/docs/eo-card-item.md +179 -210
  35. package/docs/eo-card-item.react.md +578 -0
  36. package/docs/eo-carousel-text.md +49 -2
  37. package/docs/eo-carousel-text.react.md +62 -0
  38. package/docs/eo-code-block.md +135 -4
  39. package/docs/eo-code-block.react.md +146 -0
  40. package/docs/eo-code-display.md +97 -1
  41. package/docs/eo-code-display.react.md +116 -0
  42. package/docs/eo-code-wrapper.md +108 -0
  43. package/docs/eo-code-wrapper.react.md +100 -0
  44. package/docs/eo-current-time.md +40 -1
  45. package/docs/eo-current-time.react.md +53 -0
  46. package/docs/eo-descriptions.md +74 -4
  47. package/docs/eo-descriptions.react.md +329 -0
  48. package/docs/eo-divider.md +105 -17
  49. package/docs/eo-divider.react.md +129 -0
  50. package/docs/eo-humanize-time.md +89 -42
  51. package/docs/eo-humanize-time.react.md +109 -0
  52. package/docs/eo-info-card-item.md +129 -183
  53. package/docs/eo-info-card-item.react.md +188 -0
  54. package/docs/eo-loading-step.md +96 -1
  55. package/docs/eo-loading-step.react.md +102 -0
  56. package/docs/eo-pagination.md +74 -1
  57. package/docs/eo-pagination.react.md +93 -0
  58. package/docs/eo-statistics-card.md +175 -456
  59. package/docs/eo-statistics-card.react.md +376 -0
  60. package/package.json +2 -2
@@ -0,0 +1,376 @@
1
+ ---
2
+ tagName: eo-statistics-card
3
+ displayName: WrappedEoStatisticsCard
4
+ description: 统计卡片
5
+ category: card-info
6
+ source: "@next-bricks/presentational"
7
+ ---
8
+
9
+ # WrappedEoStatisticsCard
10
+
11
+ > 统计卡片
12
+
13
+ ## 导入
14
+
15
+ ```tsx
16
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 必填 | 默认值 | 说明 |
22
+ | ------------------- | --------------------------------------------------------- | ---- | ---------- | ---------------------------------------------------------------------------------------------- |
23
+ | cardTitle | `string` | 否 | - | 卡片标题 |
24
+ | value | `string` | 否 | - | 统计值 |
25
+ | unit | `string` | 否 | - | 统计值单位,显示在值后方 |
26
+ | icon | `GeneralIconProps & { color?: string; bgColor?: string }` | 否 | - | 图标,支持 GeneralIconProps 的所有字段,额外支持 `color`(图标颜色)和 `bgColor`(图标背景色) |
27
+ | size | `"large" \| "medium" \| "small"` | 否 | `"medium"` | 卡片尺寸 |
28
+ | outline | `"border" \| "background" \| "none"` | 否 | `"border"` | 卡片轮廓样式,`border` 显示边框,`background` 显示背景色,`none` 无轮廓 |
29
+ | background | `string` | 否 | - | 卡片背景,支持任意 CSS background 值(颜色、渐变等) |
30
+ | descriptionPosition | `"bottom" \| "right"` | 否 | `"bottom"` | 描述信息(description slot)的位置,`bottom` 显示在值下方,`right` 显示在值右侧 |
31
+ | valueStyle | `React.CSSProperties` | 否 | - | 统计值的自定义样式 |
32
+ | interactable | `boolean` | 否 | - | 是否启用可互动样式(hover 高亮),适用于卡片整体可点击的场景 |
33
+
34
+ ## Slots
35
+
36
+ | 插槽 | 说明 |
37
+ | ------------ | ---------------------------------------------------- |
38
+ | titlePrefix | 标题前缀,放置辅助信息 |
39
+ | titleSuffix | 标题后缀,放置辅助信息 |
40
+ | description | 描述信息,通常是对于统计值的描述 |
41
+ | basicContent | 卡片右侧内容区,适合放置迷你图表,常用于小卡片 |
42
+ | extraContent | 卡片下方内容区,适合放置图表,用于展示更多信息的场景 |
43
+ | operator | 右上角操作区 |
44
+
45
+ ## Examples
46
+
47
+ ### Basic
48
+
49
+ 展示基础统计卡片,带图标和自定义值颜色,通过 `titleSuffix` 插槽添加提示。
50
+
51
+ ```tsx preview
52
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
53
+ import { WrappedEoTooltip } from "@easyops/wrapped-components";
54
+ import { WrappedEoIcon } from "@easyops/wrapped-components";
55
+
56
+ export default function App() {
57
+ return (
58
+ <WrappedEoStatisticsCard
59
+ cardTitle="安全评分"
60
+ value="93"
61
+ valueStyle={{ color: "var(--color-success)" }}
62
+ icon={{
63
+ lib: "easyops",
64
+ category: "monitor",
65
+ icon: "infra-monitor",
66
+ bgColor: "#E6F0FC",
67
+ color: "#3480EA",
68
+ }}
69
+ style={{ width: 300 }}
70
+ >
71
+ <WrappedEoTooltip
72
+ slot="titleSuffix"
73
+ content="安全评分是根据您的资产状态进行的评分"
74
+ trigger="hover"
75
+ placement="top-start"
76
+ >
77
+ <WrappedEoIcon
78
+ lib="antd"
79
+ icon="question-circle"
80
+ theme="outlined"
81
+ style={{ fontSize: 12, color: "var(--text-color-secondary)" }}
82
+ />
83
+ </WrappedEoTooltip>
84
+ </WrappedEoStatisticsCard>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ### Outline
90
+
91
+ 通过 `outline` 属性控制卡片轮廓样式,支持 `border`、`background` 和 `none` 三种模式。
92
+
93
+ ```tsx preview
94
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
95
+
96
+ const icon = {
97
+ lib: "easyops",
98
+ category: "monitor",
99
+ icon: "infra-monitor",
100
+ bgColor: "#E6F0FC",
101
+ color: "#3480EA",
102
+ };
103
+
104
+ export default function App() {
105
+ return (
106
+ <div style={{ display: "flex", gap: 16 }}>
107
+ <WrappedEoStatisticsCard
108
+ cardTitle="事件总数"
109
+ value="1.2K"
110
+ unit="个"
111
+ outline="border"
112
+ icon={icon}
113
+ style={{ width: 300 }}
114
+ />
115
+ <WrappedEoStatisticsCard
116
+ cardTitle="事件总数"
117
+ value="1.2K"
118
+ unit="个"
119
+ outline="background"
120
+ icon={icon}
121
+ style={{ width: 300 }}
122
+ />
123
+ <WrappedEoStatisticsCard
124
+ cardTitle="事件总数"
125
+ value="1.2K"
126
+ unit="个"
127
+ outline="none"
128
+ icon={icon}
129
+ style={{ width: 300 }}
130
+ />
131
+ </div>
132
+ );
133
+ }
134
+ ```
135
+
136
+ ### Size
137
+
138
+ 通过 `size` 属性控制卡片尺寸,支持 `large`、`medium`(默认)和 `small` 三种规格。
139
+
140
+ ```tsx preview
141
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
142
+
143
+ const icon = {
144
+ lib: "easyops",
145
+ category: "monitor",
146
+ icon: "infra-monitor",
147
+ bgColor: "#E6F0FC",
148
+ color: "#3480EA",
149
+ };
150
+
151
+ export default function App() {
152
+ return (
153
+ <div style={{ display: "flex", gap: 16 }}>
154
+ <WrappedEoStatisticsCard
155
+ cardTitle="事件总数"
156
+ value="1.2K"
157
+ unit="个"
158
+ size="large"
159
+ icon={icon}
160
+ style={{ width: 300 }}
161
+ />
162
+ <WrappedEoStatisticsCard
163
+ cardTitle="事件总数"
164
+ value="1.2K"
165
+ unit="个"
166
+ size="medium"
167
+ icon={icon}
168
+ style={{ width: 300 }}
169
+ />
170
+ <WrappedEoStatisticsCard
171
+ cardTitle="事件总数"
172
+ value="1.2K"
173
+ unit="个"
174
+ size="small"
175
+ icon={icon}
176
+ style={{ width: 300 }}
177
+ />
178
+ </div>
179
+ );
180
+ }
181
+ ```
182
+
183
+ ### Description Position
184
+
185
+ 通过 `descriptionPosition` 控制描述内容的位置,`bottom` 显示在值下方,`right` 显示在值右侧。
186
+
187
+ ```tsx preview
188
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
189
+ import { WrappedEoIcon } from "@easyops/wrapped-components";
190
+
191
+ export default function App() {
192
+ return (
193
+ <div style={{ display: "flex", gap: 16 }}>
194
+ <WrappedEoStatisticsCard
195
+ cardTitle="事件响应率"
196
+ value="78.3%"
197
+ descriptionPosition="bottom"
198
+ style={{ width: 300 }}
199
+ >
200
+ <div slot="description">
201
+ <span>同比上周</span>
202
+ <span style={{ color: "var(--color-success)" }}>上升3.45%</span>
203
+ </div>
204
+ </WrappedEoStatisticsCard>
205
+
206
+ <WrappedEoStatisticsCard
207
+ cardTitle="事件响应数量"
208
+ value="4,089"
209
+ descriptionPosition="right"
210
+ style={{ width: 400 }}
211
+ >
212
+ <WrappedEoIcon
213
+ slot="titlePrefix"
214
+ lib="antd"
215
+ icon="check-circle"
216
+ theme="filled"
217
+ style={{ fontSize: 12, color: "var(--color-success)" }}
218
+ />
219
+ <div slot="description">
220
+ <span>同比上周</span>
221
+ <span style={{ color: "var(--color-success)" }}>上升31.45%</span>
222
+ </div>
223
+ </WrappedEoStatisticsCard>
224
+ </div>
225
+ );
226
+ }
227
+ ```
228
+
229
+ ### Background
230
+
231
+ 通过 `background` 属性自定义卡片背景,支持颜色、渐变等 CSS 值。
232
+
233
+ ```tsx preview
234
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
235
+
236
+ export default function App() {
237
+ return (
238
+ <WrappedEoStatisticsCard
239
+ cardTitle="安全评分"
240
+ value="93"
241
+ valueStyle={{ color: "#fff" }}
242
+ background="linear-gradient(135deg, #3480EA 0%, #6EABF5 100%)"
243
+ style={{ width: 300 }}
244
+ />
245
+ );
246
+ }
247
+ ```
248
+
249
+ ### With Extra Content
250
+
251
+ 通过 `basicContent` 插槽在卡片右侧放置迷你图表,通过 `extraContent` 插槽在卡片下方放置完整图表,展示更丰富的数据信息。
252
+
253
+ ```tsx preview
254
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
255
+
256
+ export default function App() {
257
+ return (
258
+ <div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
259
+ {/* basicContent slot: 卡片右侧迷你图表区 */}
260
+ <WrappedEoStatisticsCard
261
+ cardTitle="事件响应率"
262
+ value="78.3%"
263
+ style={{ width: 400 }}
264
+ >
265
+ <div slot="description">
266
+ <span>同比上周</span>
267
+ <span style={{ color: "var(--color-success)" }}>上升3.45%</span>
268
+ </div>
269
+ <div
270
+ slot="basicContent"
271
+ style={{
272
+ width: 120,
273
+ height: 40,
274
+ background: "var(--color-fill-bg-3)",
275
+ borderRadius: 4,
276
+ display: "flex",
277
+ alignItems: "center",
278
+ justifyContent: "center",
279
+ color: "var(--text-color-secondary)",
280
+ fontSize: 12,
281
+ }}
282
+ >
283
+ 迷你图表区
284
+ </div>
285
+ </WrappedEoStatisticsCard>
286
+
287
+ {/* extraContent slot: 卡片下方图表区 */}
288
+ <WrappedEoStatisticsCard
289
+ cardTitle="事件响应数量"
290
+ value="4,089"
291
+ descriptionPosition="right"
292
+ style={{ width: 500 }}
293
+ >
294
+ <div slot="description">
295
+ <span>同比上周</span>
296
+ <span style={{ color: "var(--color-success)" }}>上升31.45%</span>
297
+ </div>
298
+ <div
299
+ slot="extraContent"
300
+ style={{
301
+ height: 60,
302
+ display: "flex",
303
+ alignItems: "center",
304
+ color: "var(--text-color-secondary)",
305
+ }}
306
+ >
307
+ (此处可放置完整图表)
308
+ </div>
309
+ </WrappedEoStatisticsCard>
310
+ </div>
311
+ );
312
+ }
313
+ ```
314
+
315
+ ### Interactable
316
+
317
+ 通过 `interactable` 属性启用可互动样式,适用于卡片整体可点击跳转的场景;通过 `operator` 插槽在右上角放置操作菜单。
318
+
319
+ ```tsx preview
320
+ import { WrappedEoStatisticsCard } from "@easyops/wrapped-components";
321
+ import { WrappedEoLink } from "@easyops/wrapped-components";
322
+ import { WrappedEoMiniActions } from "@easyops/wrapped-components";
323
+
324
+ const icon = {
325
+ lib: "easyops",
326
+ category: "monitor",
327
+ icon: "infra-monitor",
328
+ bgColor: "#E6F0FC",
329
+ color: "#3480EA",
330
+ };
331
+
332
+ export default function App() {
333
+ return (
334
+ <div style={{ display: "flex", gap: 16 }}>
335
+ <WrappedEoLink type="plain" url="/detail" target="_blank">
336
+ <WrappedEoStatisticsCard
337
+ interactable
338
+ outline="border"
339
+ cardTitle="安全评分"
340
+ value="93"
341
+ valueStyle={{ color: "var(--color-success)" }}
342
+ icon={icon}
343
+ style={{ width: 200 }}
344
+ />
345
+ </WrappedEoLink>
346
+
347
+ <WrappedEoStatisticsCard
348
+ cardTitle="安全评分"
349
+ value="93"
350
+ valueStyle={{ color: "var(--color-success)" }}
351
+ icon={icon}
352
+ style={{ width: 300 }}
353
+ >
354
+ <WrappedEoMiniActions
355
+ slot="operator"
356
+ actions={[
357
+ {
358
+ icon: { lib: "antd", icon: "edit", theme: "outlined" },
359
+ text: "编辑",
360
+ isDropdown: true,
361
+ event: "edit",
362
+ },
363
+ {
364
+ icon: { lib: "antd", icon: "delete", theme: "outlined" },
365
+ text: "删除",
366
+ isDropdown: true,
367
+ disabled: true,
368
+ event: "delete",
369
+ },
370
+ ]}
371
+ />
372
+ </WrappedEoStatisticsCard>
373
+ </div>
374
+ );
375
+ }
376
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/presentational",
3
- "version": "1.21.9",
3
+ "version": "1.21.10",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/presentational",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,5 +46,5 @@
46
46
  "@next-bricks/containers": "*",
47
47
  "@next-bricks/icons": "*"
48
48
  },
49
- "gitHead": "1bd932762c765bd5b970f06e76171b8c3cc7ba0a"
49
+ "gitHead": "2670992c377a46bcaed4f3ed70431bb5441c4bb7"
50
50
  }