@next-bricks/presentational 0.1.10 → 0.2.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 (45) hide show
  1. package/dist/bricks.json +6 -2
  2. package/dist/chunks/4131.2bf7a912.js +2 -0
  3. package/dist/chunks/4131.2bf7a912.js.map +1 -0
  4. package/dist/chunks/4823.5d7d9ee5.js +3 -0
  5. package/dist/chunks/4823.5d7d9ee5.js.map +1 -0
  6. package/dist/chunks/5202.94246a30.js +2 -0
  7. package/dist/chunks/{5202.673df1e8.js.map → 5202.94246a30.js.map} +1 -1
  8. package/dist/chunks/533.0dfc4222.js +2 -0
  9. package/dist/chunks/533.0dfc4222.js.map +1 -0
  10. package/dist/chunks/{7822.6e643706.js → 7822.035ae6c9.js} +2 -2
  11. package/dist/chunks/{7822.6e643706.js.map → 7822.035ae6c9.js.map} +1 -1
  12. package/dist/chunks/9509.1e04a9a2.js +2 -0
  13. package/dist/chunks/9509.1e04a9a2.js.map +1 -0
  14. package/dist/chunks/9549.e948586a.js +2 -0
  15. package/dist/chunks/{9549.de78e47a.js.map → 9549.e948586a.js.map} +1 -1
  16. package/dist/chunks/general-alert.45feb86c.js +3 -0
  17. package/dist/chunks/general-alert.45feb86c.js.map +1 -0
  18. package/dist/chunks/general-descriptions.eeaba6b9.js +3 -0
  19. package/dist/chunks/general-descriptions.eeaba6b9.js.LICENSE.txt +5 -0
  20. package/dist/chunks/{general-descriptions.7e5d4e2a.js.map → general-descriptions.eeaba6b9.js.map} +1 -1
  21. package/dist/chunks/main.24d9f2b5.js +2 -0
  22. package/dist/chunks/main.24d9f2b5.js.map +1 -0
  23. package/dist/index.6544e1fa.js +2 -0
  24. package/dist/index.6544e1fa.js.map +1 -0
  25. package/dist/manifest.json +44 -0
  26. package/dist/types.json +290 -63
  27. package/dist-types/bootstrap.d.ts +1 -0
  28. package/dist-types/general-alert/constants.d.ts +65 -0
  29. package/dist-types/general-alert/index.d.ts +40 -0
  30. package/dist-types/general-alert/index.spec.d.ts +1 -0
  31. package/docs/general-alert.md +105 -0
  32. package/package.json +3 -3
  33. package/dist/chunks/4131.e141583f.js +0 -2
  34. package/dist/chunks/4131.e141583f.js.map +0 -1
  35. package/dist/chunks/5202.673df1e8.js +0 -2
  36. package/dist/chunks/8276.3d2a08b8.js +0 -3
  37. package/dist/chunks/8276.3d2a08b8.js.map +0 -1
  38. package/dist/chunks/9549.de78e47a.js +0 -2
  39. package/dist/chunks/general-descriptions.7e5d4e2a.js +0 -3
  40. package/dist/chunks/main.f046bde8.js +0 -2
  41. package/dist/chunks/main.f046bde8.js.map +0 -1
  42. package/dist/index.3c616588.js +0 -2
  43. package/dist/index.3c616588.js.map +0 -1
  44. /package/dist/chunks/{8276.3d2a08b8.js.LICENSE.txt → 4823.5d7d9ee5.js.LICENSE.txt} +0 -0
  45. /package/dist/chunks/{general-descriptions.7e5d4e2a.js.LICENSE.txt → general-alert.45feb86c.js.LICENSE.txt} +0 -0
package/dist/types.json CHANGED
@@ -1,76 +1,303 @@
1
1
  {
2
- "presentational.general-descriptions": [
3
- {
4
- "name": "DescriptionItem",
5
- "type": "interface",
6
- "annotation": [
7
- {
8
- "type": "propertySignature",
9
- "name": "label",
10
- "property": {
11
- "type": "keyword",
12
- "value": "string"
13
- }
14
- },
15
- {
16
- "type": "propertySignature",
17
- "name": "field",
18
- "property": {
19
- "type": "keyword",
20
- "value": "string"
21
- }
22
- },
23
- {
24
- "type": "propertySignature",
25
- "name": "group",
26
- "property": {
27
- "type": "keyword",
28
- "value": "string"
29
- }
30
- },
31
- {
32
- "type": "propertySignature",
33
- "name": "text",
34
- "property": {
35
- "type": "union",
36
- "types": [
37
- {
2
+ "presentational.general-descriptions": {
3
+ "properties": [
4
+ {
5
+ "name": "descriptionTitle",
6
+ "types": {
7
+ "type": "union",
8
+ "types": [
9
+ {
10
+ "type": "keyword",
11
+ "value": "string"
12
+ }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "name": "list",
18
+ "types": {
19
+ "type": "union",
20
+ "types": [
21
+ {
22
+ "type": "array",
23
+ "elementType": {
24
+ "type": "reference",
25
+ "typeName": "DescriptionItem"
26
+ }
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "name": "showCard",
33
+ "types": {
34
+ "type": "union",
35
+ "types": [
36
+ {
37
+ "type": "keyword",
38
+ "value": "boolean"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "name": "column",
45
+ "types": {
46
+ "type": "union",
47
+ "types": [
48
+ {
49
+ "type": "keyword",
50
+ "value": "number"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "name": "layout",
57
+ "types": {
58
+ "type": "union",
59
+ "types": [
60
+ {
61
+ "type": "reference",
62
+ "typeName": "Layout"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "name": "bordered",
69
+ "types": {
70
+ "type": "union",
71
+ "types": [
72
+ {
73
+ "type": "keyword",
74
+ "value": "boolean"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "name": "hideGroups",
81
+ "types": {
82
+ "type": "union",
83
+ "types": [
84
+ {
85
+ "type": "keyword",
86
+ "value": "string"
87
+ },
88
+ {
89
+ "type": "array",
90
+ "elementType": {
38
91
  "type": "keyword",
39
92
  "value": "string"
40
- },
41
- {
42
- "type": "keyword",
43
- "value": "number"
44
93
  }
45
- ]
46
- }
47
- },
48
- {
49
- "type": "propertySignature",
50
- "name": "useBrick",
51
- "property": {
52
- "type": "reference",
53
- "typeName": "UseSingleBrickConf"
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ "name": "dataSource",
100
+ "types": {
101
+ "type": "union",
102
+ "types": [
103
+ {
104
+ "type": "reference",
105
+ "typeName": "Record",
106
+ "typeParameters": [
107
+ {
108
+ "type": "keyword",
109
+ "value": "string"
110
+ },
111
+ {
112
+ "type": "keyword",
113
+ "value": "any"
114
+ }
115
+ ]
116
+ }
117
+ ]
118
+ }
119
+ }
120
+ ],
121
+ "types": [
122
+ {
123
+ "name": "DescriptionItem",
124
+ "type": "interface",
125
+ "annotation": [
126
+ {
127
+ "type": "propertySignature",
128
+ "name": "label",
129
+ "property": {
130
+ "type": "keyword",
131
+ "value": "string"
132
+ }
133
+ },
134
+ {
135
+ "type": "propertySignature",
136
+ "name": "field",
137
+ "property": {
138
+ "type": "keyword",
139
+ "value": "string"
140
+ }
141
+ },
142
+ {
143
+ "type": "propertySignature",
144
+ "name": "group",
145
+ "property": {
146
+ "type": "keyword",
147
+ "value": "string"
148
+ }
149
+ },
150
+ {
151
+ "type": "propertySignature",
152
+ "name": "text",
153
+ "property": {
154
+ "type": "union",
155
+ "types": [
156
+ {
157
+ "type": "keyword",
158
+ "value": "string"
159
+ },
160
+ {
161
+ "type": "keyword",
162
+ "value": "number"
163
+ }
164
+ ]
165
+ }
166
+ },
167
+ {
168
+ "type": "propertySignature",
169
+ "name": "useBrick",
170
+ "property": {
171
+ "type": "reference",
172
+ "typeName": "UseSingleBrickConf"
173
+ }
54
174
  }
175
+ ]
176
+ },
177
+ {
178
+ "name": "Layout",
179
+ "type": "typeAlias",
180
+ "annotation": {
181
+ "type": "union",
182
+ "types": [
183
+ {
184
+ "type": "literal",
185
+ "value": "horizontal"
186
+ },
187
+ {
188
+ "type": "literal",
189
+ "value": "vertical"
190
+ }
191
+ ]
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ "presentational.general-alert": {
197
+ "properties": [
198
+ {
199
+ "name": "type",
200
+ "types": {
201
+ "type": "reference",
202
+ "typeName": "AlertType"
55
203
  }
56
- ]
57
- },
58
- {
59
- "name": "Layout",
60
- "type": "typeAlias",
61
- "annotation": {
62
- "type": "union",
63
- "types": [
204
+ },
205
+ {
206
+ "name": "hasTitle",
207
+ "types": {
208
+ "type": "union",
209
+ "types": [
210
+ {
211
+ "type": "keyword",
212
+ "value": "boolean"
213
+ }
214
+ ]
215
+ }
216
+ },
217
+ {
218
+ "name": "closable",
219
+ "types": {
220
+ "type": "union",
221
+ "types": [
222
+ {
223
+ "type": "keyword",
224
+ "value": "boolean"
225
+ }
226
+ ]
227
+ }
228
+ },
229
+ {
230
+ "name": "localStorageKey",
231
+ "types": {
232
+ "type": "union",
233
+ "types": [
234
+ {
235
+ "type": "keyword",
236
+ "value": "string"
237
+ }
238
+ ]
239
+ }
240
+ },
241
+ {
242
+ "name": "disableUrlNamespace",
243
+ "types": {
244
+ "type": "union",
245
+ "types": [
246
+ {
247
+ "type": "keyword",
248
+ "value": "boolean"
249
+ }
250
+ ]
251
+ }
252
+ }
253
+ ],
254
+ "types": [
255
+ {
256
+ "name": "AlertType",
257
+ "type": "enums",
258
+ "members": [
259
+ {
260
+ "name": {
261
+ "type": "stringLiteral",
262
+ "value": "SUCCESS"
263
+ },
264
+ "value": {
265
+ "type": "stringLiteral",
266
+ "value": "success"
267
+ }
268
+ },
269
+ {
270
+ "name": {
271
+ "type": "stringLiteral",
272
+ "value": "INFO"
273
+ },
274
+ "value": {
275
+ "type": "stringLiteral",
276
+ "value": "info"
277
+ }
278
+ },
64
279
  {
65
- "type": "literal",
66
- "value": "horizontal"
280
+ "name": {
281
+ "type": "stringLiteral",
282
+ "value": "WARNING"
283
+ },
284
+ "value": {
285
+ "type": "stringLiteral",
286
+ "value": "warning"
287
+ }
67
288
  },
68
289
  {
69
- "type": "literal",
70
- "value": "vertical"
290
+ "name": {
291
+ "type": "stringLiteral",
292
+ "value": "ERROR"
293
+ },
294
+ "value": {
295
+ "type": "stringLiteral",
296
+ "value": "error"
297
+ }
71
298
  }
72
299
  ]
73
300
  }
74
- }
75
- ]
301
+ ]
302
+ }
76
303
  }
@@ -1 +1,2 @@
1
1
  import "./descriptions/index.js";
2
+ import "./general-alert/index.js";
@@ -0,0 +1,65 @@
1
+ export declare enum AlertType {
2
+ "SUCCESS" = "success",
3
+ "INFO" = "info",
4
+ "WARNING" = "warning",
5
+ "ERROR" = "error"
6
+ }
7
+ export declare const alertTypeMap: {
8
+ success: {
9
+ outlinedIcon: {
10
+ lib: string;
11
+ icon: string;
12
+ theme: string;
13
+ };
14
+ filledIcon: {
15
+ lib: string;
16
+ icon: string;
17
+ theme: string;
18
+ };
19
+ color: string;
20
+ bgColor: string;
21
+ };
22
+ info: {
23
+ outlinedIcon: {
24
+ lib: string;
25
+ icon: string;
26
+ theme: string;
27
+ };
28
+ filledIcon: {
29
+ lib: string;
30
+ icon: string;
31
+ theme: string;
32
+ };
33
+ color: string;
34
+ bgColor: string;
35
+ };
36
+ warning: {
37
+ outlinedIcon: {
38
+ lib: string;
39
+ icon: string;
40
+ theme: string;
41
+ };
42
+ filledIcon: {
43
+ lib: string;
44
+ icon: string;
45
+ theme: string;
46
+ };
47
+ color: string;
48
+ bgColor: string;
49
+ };
50
+ error: {
51
+ outlinedIcon: {
52
+ lib: string;
53
+ icon: string;
54
+ theme: string;
55
+ };
56
+ filledIcon: {
57
+ lib: string;
58
+ icon: string;
59
+ theme: string;
60
+ };
61
+ color: string;
62
+ bgColor: string;
63
+ };
64
+ };
65
+ export declare const LOCAL_STORAGE_PREFIX = "presentational.general-alert-hidden";
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import { AlertType } from "./constants.js";
5
+ export interface GeneralAlertProps {
6
+ type: AlertType;
7
+ hasTitle?: boolean;
8
+ closable?: boolean;
9
+ localStorageKey?: string;
10
+ disableUrlNamespace?: boolean;
11
+ }
12
+ /**
13
+ * 告警提示
14
+ * @slot 内容区
15
+ * @slot title - 标题
16
+ */
17
+ export declare class GeneralAlert extends ReactNextElement implements GeneralAlertProps {
18
+ /**
19
+ * 警告类型
20
+ */
21
+ accessor type: AlertType;
22
+ /**
23
+ * 是否显示标题。开启后,可以使用 `title` 插槽
24
+ */
25
+ accessor hasTitle: boolean | undefined;
26
+ /**
27
+ * 是否显示关闭按钮
28
+ */
29
+ accessor closable: boolean | undefined;
30
+ /**
31
+ * 以该值和页面 url 作为命名空间,决定是否显示该警告提示
32
+ */
33
+ accessor localStorageKey: string | undefined;
34
+ /**
35
+ * 关闭后仅以 `localStorageKey` 作为命名空间
36
+ */
37
+ accessor disableUrlNamespace: boolean | undefined;
38
+ render(): JSX.Element;
39
+ }
40
+ export declare function GeneralAlertComponent(props: GeneralAlertProps): JSX.Element;
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,105 @@
1
+ 告警提示
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: div
9
+ properties:
10
+ style:
11
+ display: flex
12
+ flex-direction: column
13
+ gap: 10px
14
+ slots:
15
+ "":
16
+ type: bricks
17
+ bricks:
18
+ - brick: presentational.general-alert
19
+ properties:
20
+ textContent: 你好!欢迎使用EasyOps 2.0专业版,你可以根据自身需求添加业务模块。
21
+ type: info
22
+ closable: true
23
+ - brick: presentational.general-alert
24
+ properties:
25
+ textContent: 恭喜!你所提交的信息已经审核通过。
26
+ type: success
27
+ closable: true
28
+ - brick: presentational.general-alert
29
+ properties:
30
+ textContent: "系统将于 15 : 00 - 17 : 00 进行升级,请及时保存你的资料!"
31
+ type: warning
32
+ closable: true
33
+ - brick: presentational.general-alert
34
+ properties:
35
+ textContent: 系统错误,请稍后重试。
36
+ type: error
37
+ closable: true
38
+ ```
39
+
40
+ ### HasTitle
41
+
42
+ ```yaml preview
43
+ brick: div
44
+ properties:
45
+ style:
46
+ display: flex
47
+ flex-direction: column
48
+ gap: 10px
49
+ slots:
50
+ "":
51
+ type: bricks
52
+ bricks:
53
+ - brick: presentational.general-alert
54
+ properties:
55
+ textContent: 你好,由于你的良好信用,我们决定赠送你三个月产品会员,欲了解会员特权与活动请进首页会员专区查看。
56
+ type: info
57
+ closable: true
58
+ hasTitle: true
59
+ slots:
60
+ title:
61
+ type: bricks
62
+ bricks:
63
+ - brick: div
64
+ properties:
65
+ textContent: 帮助信息
66
+ - brick: presentational.general-alert
67
+ properties:
68
+ textContent: 你所提交的审核信息已全部通过审核,请及时跟进申请状况。
69
+ type: success
70
+ closable: true
71
+ hasTitle: true
72
+ slots:
73
+ title:
74
+ type: bricks
75
+ bricks:
76
+ - brick: div
77
+ properties:
78
+ textContent: 已成功
79
+ - brick: presentational.general-alert
80
+ properties:
81
+ textContent: 你所提交的审核信息审核失败,可以进入个人信箱查看原因。如有疑问,请联系客服人员。
82
+ type: warning
83
+ closable: true
84
+ hasTitle: true
85
+ slots:
86
+ title:
87
+ type: bricks
88
+ bricks:
89
+ - brick: div
90
+ properties:
91
+ textContent: 请注意
92
+ - brick: presentational.general-alert
93
+ properties:
94
+ textContent: 你的账户会员使用权限将在3天后到期,请及时跟进申请状况,如有疑问,请联系审核人员。
95
+ type: error
96
+ closable: true
97
+ hasTitle: true
98
+ slots:
99
+ title:
100
+ type: bricks
101
+ bricks:
102
+ - brick: div
103
+ properties:
104
+ textContent: 出错了
105
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/presentational",
3
- "version": "0.1.10",
3
+ "version": "0.2.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/presentational",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,8 +34,8 @@
34
34
  "postpublish": "mv package.json.bak package.json"
35
35
  },
36
36
  "devDependencies": {
37
- "@next-core/build-next-bricks": "^1.9.0",
37
+ "@next-core/build-next-bricks": "^1.10.0",
38
38
  "@next-core/test-next": "^1.0.6"
39
39
  },
40
- "gitHead": "17a18f696648ddc1417ec395d5b46a28a9dc386c"
40
+ "gitHead": "d24d177295f0f3edbf6d28b1d9b6ae87c2f506ec"
41
41
  }