grommet 2.49.0 → 2.50.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.
@@ -0,0 +1,316 @@
1
+ import React from 'react';
2
+ import { Box, DataTable, Heading, Text } from 'grommet';
3
+ var data = [{
4
+ id: 'b0:2a:43:52:48:c5',
5
+ macAddress: 'b0:2a:43:52:48:c5',
6
+ ipAddress: '192.168.0.20',
7
+ hostname: 'wh7-dureal50',
8
+ connectionType: 'Wireless',
9
+ category: 'Network',
10
+ status: 'Active',
11
+ deviceName: 'Chromecast',
12
+ networkBand: {
13
+ value: 2.4,
14
+ unit: 'GHz'
15
+ },
16
+ linkRate: {
17
+ value: 72,
18
+ unit: 'Mbps'
19
+ }
20
+ }, {
21
+ id: '00:d0:2d:32:b6:cd',
22
+ macAddress: '00:d0:2d:32:b6:cd',
23
+ ipAddress: '192.168.0.24',
24
+ hostname: 'wh7-dureal50',
25
+ connectionType: 'Wireless',
26
+ category: 'Network',
27
+ status: 'Active',
28
+ deviceName: 'Gateway32B6CD',
29
+ networkBand: {
30
+ value: 2.4,
31
+ unit: 'GHz'
32
+ },
33
+ linkRate: {
34
+ value: 72,
35
+ unit: 'Mbps'
36
+ }
37
+ }, {
38
+ id: 'd8:6c:63:46:13:03',
39
+ macAddress: 'd8:6c:63:46:13:03',
40
+ ipAddress: '192.168.0.19',
41
+ hostname: 'wh7-dureal50',
42
+ connectionType: 'Wireless',
43
+ category: 'Network',
44
+ status: 'Active',
45
+ deviceName: 'Amazon-Firestick',
46
+ networkBand: {
47
+ value: 2.4,
48
+ unit: 'GHz'
49
+ },
50
+ linkRate: {
51
+ value: 72,
52
+ unit: 'Mbps'
53
+ }
54
+ }, {
55
+ id: 'f4:f5:d8:c0:e2:9c',
56
+ macAddress: 'f4:f5:d8:c0:e2:9c',
57
+ ipAddress: '192.168.0.21',
58
+ hostname: 'wh7-dureal50',
59
+ connectionType: 'Wireless',
60
+ category: 'Network',
61
+ status: 'Active',
62
+ deviceName: 'Google-Home',
63
+ networkBand: {
64
+ value: 2.4,
65
+ unit: 'GHz'
66
+ },
67
+ linkRate: {
68
+ value: 72,
69
+ unit: 'Mbps'
70
+ }
71
+ }, {
72
+ id: '38:f9:d3:b7:09:4e',
73
+ macAddress: '38:f9:d3:b7:09:4e',
74
+ ipAddress: '192.168.0.21',
75
+ hostname: 'wh7-dureal50',
76
+ connectionType: 'Wireless',
77
+ category: 'Network',
78
+ status: 'Active',
79
+ deviceName: 'Daras-MBP',
80
+ networkBand: {
81
+ value: 5,
82
+ unit: 'GHz'
83
+ },
84
+ linkRate: {
85
+ value: 702,
86
+ unit: 'Mbps'
87
+ }
88
+ }, {
89
+ id: '10:40:f3:85:67:44',
90
+ macAddress: '10:40:f3:85:67:44',
91
+ ipAddress: '192.168.0.13',
92
+ hostname: 'wh7-dureal50',
93
+ connectionType: 'Wireless',
94
+ category: 'Network',
95
+ status: 'Active',
96
+ deviceName: 'Daras-Air',
97
+ networkBand: {
98
+ value: 2.4,
99
+ unit: 'GHz'
100
+ },
101
+ linkRate: {
102
+ value: 78,
103
+ unit: 'Mbps'
104
+ }
105
+ }, {
106
+ id: 'a4:f1:e8:27:e7:1c',
107
+ macAddress: 'a4:f1:e8:27:e7:1c',
108
+ ipAddress: '192.168.0.11',
109
+ hostname: 'wh7-dureal50',
110
+ connectionType: 'Wireless',
111
+ category: 'Network',
112
+ status: 'Active',
113
+ deviceName: 'iPhone',
114
+ networkBand: {
115
+ value: 2.4,
116
+ unit: 'GHz'
117
+ },
118
+ linkRate: {
119
+ value: 24,
120
+ unit: 'Mbps'
121
+ }
122
+ }, {
123
+ id: '10:e7:c6:cb:f8:58',
124
+ macAddress: '10:e7:c6:cb:f8:58',
125
+ ipAddress: '192.168.0.22',
126
+ hostname: 'wh7-dureal50',
127
+ connectionType: 'Wireless',
128
+ category: 'Network',
129
+ status: 'Active',
130
+ deviceName: 'HPCBF857',
131
+ networkBand: {
132
+ value: 2.4,
133
+ unit: 'GHz'
134
+ },
135
+ linkRate: {
136
+ value: 24,
137
+ unit: 'Mbps'
138
+ }
139
+ }, {
140
+ id: '44:07:0b:ba:1e:eb',
141
+ macAddress: '44:07:0b:ba:1e:eb',
142
+ ipAddress: '192.168.0.18',
143
+ hostname: 'wh7-dureal50',
144
+ connectionType: 'Wireless',
145
+ category: 'Network',
146
+ status: 'Active',
147
+ deviceName: 'Google-Home-Mini',
148
+ networkBand: {
149
+ value: 2.4,
150
+ unit: 'GHz'
151
+ },
152
+ linkRate: {
153
+ value: 72,
154
+ unit: 'Mbps'
155
+ }
156
+ }, {
157
+ id: '00:f6:20:60:15:d0',
158
+ macAddress: '00:f6:20:60:15:d0',
159
+ ipAddress: '192.168.0.17',
160
+ hostname: 'wh7-dureal50',
161
+ connectionType: 'Wireless',
162
+ category: 'Network',
163
+ status: 'Active',
164
+ deviceName: 'Amazon-Alexa',
165
+ networkBand: {
166
+ value: 2.4,
167
+ unit: 'GHz'
168
+ },
169
+ linkRate: {
170
+ value: 72,
171
+ unit: 'Mbps'
172
+ }
173
+ }, {
174
+ id: '30:fd:38:88:49:f4',
175
+ macAddress: '30:fd:38:88:49:f4',
176
+ ipAddress: '192.168.0.16',
177
+ hostname: 'wh7-dureal50',
178
+ connectionType: 'Wireless',
179
+ category: 'Network',
180
+ status: 'Active',
181
+ deviceName: 'Google-Home-Mini',
182
+ networkBand: {
183
+ value: 2.4,
184
+ unit: 'GHz'
185
+ },
186
+ linkRate: {
187
+ value: 292,
188
+ unit: 'Mbps'
189
+ }
190
+ }, {
191
+ id: '7c:b0:c2:5c:94:a5',
192
+ macAddress: '7c:b0:c2:5c:94:a5',
193
+ ipAddress: '192.168.0.26',
194
+ hostname: 'wh7-dureal50',
195
+ connectionType: 'Wireless',
196
+ category: 'Network',
197
+ status: 'Active',
198
+ deviceName: 'N/A',
199
+ networkBand: {
200
+ value: 2.4,
201
+ unit: 'GHz'
202
+ },
203
+ linkRate: {
204
+ value: 6,
205
+ unit: 'Mbps'
206
+ }
207
+ }, {
208
+ id: 'E0:5F:45:96:F4:DD',
209
+ macAddress: 'E0:5F:45:96:F4:DD',
210
+ ipAddress: '192.168.0.25',
211
+ hostname: 'wh7-dureal50',
212
+ connectionType: 'Wireless',
213
+ category: 'Network',
214
+ status: 'Active',
215
+ deviceName: 'N/A',
216
+ networkBand: {
217
+ value: 2.4,
218
+ unit: 'GHz'
219
+ },
220
+ linkRate: {
221
+ value: 1,
222
+ unit: 'Mbps'
223
+ }
224
+ }];
225
+ var columns = [{
226
+ primary: true,
227
+ property: 'macAddress',
228
+ header: 'MAC address',
229
+ render: function render(datum) {
230
+ return datum.macAddress;
231
+ },
232
+ pin: true
233
+ }, {
234
+ property: 'ipAddress',
235
+ header: 'IP V4',
236
+ render: function render(datum) {
237
+ return /*#__PURE__*/React.createElement(Text, {
238
+ truncate: "tip"
239
+ }, datum.ipAddress);
240
+ },
241
+ size: 'xsmall',
242
+ align: 'end'
243
+ }, {
244
+ property: 'hostname',
245
+ header: 'Hostname',
246
+ render: function render(datum) {
247
+ return /*#__PURE__*/React.createElement(Text, {
248
+ truncate: "tip"
249
+ }, datum.hostname);
250
+ },
251
+ size: 'xsmall'
252
+ }, {
253
+ property: 'connectionType',
254
+ header: 'Connection type'
255
+ }, {
256
+ property: 'category',
257
+ header: 'Category'
258
+ }, {
259
+ property: 'deviceName',
260
+ header: 'Device name',
261
+ render: function render(datum) {
262
+ return /*#__PURE__*/React.createElement(Text, {
263
+ truncate: "tip"
264
+ }, datum.deviceName);
265
+ },
266
+ size: 'xsmall'
267
+ }, {
268
+ property: 'status',
269
+ header: 'Status'
270
+ }, {
271
+ property: 'networkBand.value',
272
+ header: 'Network band',
273
+ units: 'GHz',
274
+ render: function render(datum) {
275
+ return datum.networkBand.value;
276
+ },
277
+ align: 'end'
278
+ }, {
279
+ property: 'linkRate.value',
280
+ header: 'Link rate',
281
+ units: 'Mbps',
282
+ render: function render(datum) {
283
+ return datum.linkRate.value;
284
+ },
285
+ align: 'end'
286
+ }];
287
+ export var ResizablePinnedDataTable = function ResizablePinnedDataTable() {
288
+ return /*#__PURE__*/React.createElement(Box, {
289
+ align: "center",
290
+ pad: "large"
291
+ }, /*#__PURE__*/React.createElement(Heading, {
292
+ level: "3"
293
+ }, "Table with resizable & column sizes"), /*#__PURE__*/React.createElement(Box, {
294
+ align: "start",
295
+ height: "medium"
296
+ // restricting width to demonstrate pinned column behavior
297
+ ,
298
+ width: {
299
+ width: 'xxlarge',
300
+ max: '100%'
301
+ },
302
+ overflow: "auto"
303
+ }, /*#__PURE__*/React.createElement(DataTable, {
304
+ "aria-describedby": "connected-heading",
305
+ data: data,
306
+ columns: columns,
307
+ pin: true,
308
+ resizeable: true
309
+ })))
310
+ // </Grommet>
311
+ ;
312
+ };
313
+ ResizablePinnedDataTable.storyName = 'Resizable pinned columns';
314
+ export default {
315
+ title: 'Visualizations/DataTable/Resizable pinned columns'
316
+ };
@@ -1058,6 +1058,9 @@ export interface ThemeType {
1058
1058
  size: string;
1059
1059
  };
1060
1060
  };
1061
+ padding?: {
1062
+ vertical?: string;
1063
+ };
1061
1064
  };
1062
1065
  primary?: {
1063
1066
  weight?: string;
@@ -1204,7 +1204,7 @@ export var generate = function generate(baseSpacing, scale) {
1204
1204
  border: {
1205
1205
  color: 'border',
1206
1206
  side: 'end'
1207
- }
1207
+ },
1208
1208
  // hover: {
1209
1209
  // border: {
1210
1210
  // color: undefined,
@@ -1212,6 +1212,9 @@ export var generate = function generate(baseSpacing, scale) {
1212
1212
  // size: undefined,
1213
1213
  // },
1214
1214
  // },
1215
+ padding: {
1216
+ vertical: 'xsmall'
1217
+ }
1215
1218
  },
1216
1219
  search: {
1217
1220
  pad: {