@pingux/astro 2.0.4-alpha.0 → 2.0.4-alpha.2
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.
- package/lib/cjs/components/ListItem/ListItem.styles.js +21 -7
- package/lib/cjs/hooks/index.js +7 -0
- package/lib/cjs/hooks/useOverlappingMenuHoverState/index.js +14 -0
- package/lib/cjs/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.js +61 -0
- package/lib/cjs/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +226 -0
- package/lib/cjs/recipes/LinkedListView.stories.js +189 -139
- package/lib/cjs/recipes/ListAndPanel.stories.js +21 -46
- package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +55 -31
- package/lib/components/ListItem/ListItem.styles.js +21 -7
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useOverlappingMenuHoverState/index.js +1 -0
- package/lib/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.js +53 -0
- package/lib/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +219 -0
- package/lib/recipes/LinkedListView.stories.js +191 -141
- package/lib/recipes/ListAndPanel.stories.js +21 -46
- package/lib/recipes/TrialExperienceStatusBar.stories.js +55 -30
- package/package.json +1 -1
@@ -5,9 +5,10 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
5
5
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
6
6
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
|
7
7
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
8
|
-
import React, { useState } from 'react';
|
8
|
+
import React, { useRef, useState } from 'react';
|
9
9
|
import DotsVerticalIcon from 'mdi-react/DotsVerticalIcon';
|
10
|
-
import
|
10
|
+
import useOverlappingMenuHoverState from '../hooks/useOverlappingMenuHoverState';
|
11
|
+
import { Badge, Box, Icon, IconButton, Item, ListItem, ListView, Menu, PopoverMenu, Separator, Text } from '../index';
|
11
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
13
|
export default {
|
13
14
|
title: 'Recipes/LinkedListView',
|
@@ -40,7 +41,6 @@ var testData = [{
|
|
40
41
|
hasSeparator: false,
|
41
42
|
hasInsetSeparator: true,
|
42
43
|
badgeText: 'default',
|
43
|
-
expirationText: 'Expiring On: 2022-12-08',
|
44
44
|
childrenObjects: [{
|
45
45
|
key: 'Staging Policy',
|
46
46
|
name: 'Staging Policy',
|
@@ -101,6 +101,93 @@ var testSort = function testSort(array) {
|
|
101
101
|
};
|
102
102
|
var unsorted = flattenArray(testData);
|
103
103
|
var sorted = testSort(unsorted);
|
104
|
+
var sx = {
|
105
|
+
badge: {
|
106
|
+
alignItems: 'center',
|
107
|
+
alignSelf: 'center',
|
108
|
+
ml: 'lg',
|
109
|
+
p: '3px 5px 2px 5px'
|
110
|
+
},
|
111
|
+
bottomBracket: {
|
112
|
+
container: {
|
113
|
+
ml: 12,
|
114
|
+
top: -2,
|
115
|
+
position: 'relative',
|
116
|
+
maxWidth: 15
|
117
|
+
},
|
118
|
+
separator: {
|
119
|
+
backgroundColor: 'decorative.7',
|
120
|
+
marginLeft: '2px !important',
|
121
|
+
maxHeight: '30px',
|
122
|
+
width: '2px !important'
|
123
|
+
},
|
124
|
+
separatorBox: {
|
125
|
+
alignItems: 'center',
|
126
|
+
flexDirection: 'row',
|
127
|
+
minWidth: 9
|
128
|
+
}
|
129
|
+
},
|
130
|
+
expirationBadge: {
|
131
|
+
alignItems: 'center',
|
132
|
+
alignSelf: 'center',
|
133
|
+
border: 'solid 1px',
|
134
|
+
borderColor: 'neutral.80',
|
135
|
+
p: '3px 5px 2px 5px'
|
136
|
+
},
|
137
|
+
listElement: {
|
138
|
+
container: {
|
139
|
+
height: 73,
|
140
|
+
pl: 24,
|
141
|
+
pr: 14
|
142
|
+
},
|
143
|
+
subText: {
|
144
|
+
color: 'text.secondary',
|
145
|
+
fontSize: 'sm',
|
146
|
+
fontWeight: 0
|
147
|
+
},
|
148
|
+
text: {
|
149
|
+
color: 'text.primary',
|
150
|
+
fontSize: 'md',
|
151
|
+
fontWeight: 1
|
152
|
+
},
|
153
|
+
textBox: {
|
154
|
+
alignItems: 'center',
|
155
|
+
justifyContent: 'center',
|
156
|
+
marginRight: 'auto'
|
157
|
+
}
|
158
|
+
},
|
159
|
+
listViewItem: {
|
160
|
+
minHeight: '75px',
|
161
|
+
padding: 1,
|
162
|
+
'&.has-inset-separator': {
|
163
|
+
'&:before': {
|
164
|
+
borderBottom: '1px solid',
|
165
|
+
borderBottomColor: 'line.light',
|
166
|
+
bottom: 0,
|
167
|
+
content: '""',
|
168
|
+
position: 'absolute',
|
169
|
+
right: 0,
|
170
|
+
width: 'calc(100% - 43px)'
|
171
|
+
}
|
172
|
+
},
|
173
|
+
'&.is-focused': {
|
174
|
+
'&:after': {
|
175
|
+
borderBottomColor: 'focus',
|
176
|
+
bottom: 0,
|
177
|
+
content: '""',
|
178
|
+
position: 'absolute',
|
179
|
+
right: 0,
|
180
|
+
width: 'calc(100% - 43px)'
|
181
|
+
}
|
182
|
+
}
|
183
|
+
},
|
184
|
+
topBracket: {
|
185
|
+
top: 50,
|
186
|
+
left: 12,
|
187
|
+
bottom: 0,
|
188
|
+
position: 'absolute'
|
189
|
+
}
|
190
|
+
};
|
104
191
|
export var Default = function Default(_ref) {
|
105
192
|
var _context2;
|
106
193
|
var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
@@ -112,12 +199,9 @@ export var Default = function Default(_ref) {
|
|
112
199
|
var BottomBracket = function BottomBracket() {
|
113
200
|
var color = '#CACED3';
|
114
201
|
return ___EmotionJSX(Box, {
|
115
|
-
sx:
|
116
|
-
width: '15px',
|
117
|
-
position: 'relative'
|
118
|
-
}
|
202
|
+
sx: sx.bottomBracket.container
|
119
203
|
}, ___EmotionJSX(Box, {
|
120
|
-
flexBasis: "
|
204
|
+
flexBasis: "53%"
|
121
205
|
}, ___EmotionJSX("svg", {
|
122
206
|
xmlns: "http://www.w3.org/2000/svg",
|
123
207
|
version: "1.1",
|
@@ -162,17 +246,40 @@ export var Default = function Default(_ref) {
|
|
162
246
|
}))))));
|
163
247
|
};
|
164
248
|
|
249
|
+
// the vector shield and key icon.
|
250
|
+
var ShieldIcon = function ShieldIcon(props) {
|
251
|
+
return ___EmotionJSX("svg", _extends({
|
252
|
+
width: "19",
|
253
|
+
height: "23",
|
254
|
+
viewBox: "0 0 19 23",
|
255
|
+
xmlns: "http://www.w3.org/2000/svg"
|
256
|
+
}, props), ___EmotionJSX("path", {
|
257
|
+
d: "M9.5 7.33342C9.77627 7.33342 10.0412 7.44316 10.2366 7.63851C10.4319 7.83386 10.5417 8.09881 10.5417 8.37508C10.5417 8.65135 10.4319 8.9163 10.2366 9.11165C10.0412 9.307 9.77627 9.41675 9.5 9.41675C9.22373 9.41675 8.95878 9.307 8.76343 9.11165C8.56808 8.9163 8.45833 8.65135 8.45833 8.37508C8.45833 8.09881 8.56808 7.83386 8.76343 7.63851C8.95878 7.44316 9.22373 7.33342 9.5 7.33342ZM18.875 10.4584C18.875 16.2397 14.875 21.6459 9.5 22.9584C4.125 21.6459 0.125 16.2397 0.125 10.4584V4.20842L9.5 0.041748L18.875 4.20842V10.4584ZM9.5 5.25008C8.6712 5.25008 7.87634 5.57932 7.29029 6.16537C6.70424 6.75142 6.375 7.54628 6.375 8.37508C6.375 9.73967 7.23958 10.8959 8.45833 11.323V17.7501H10.5417V15.6667H12.625V13.5834H10.5417V11.323C11.7604 10.8959 12.625 9.73967 12.625 8.37508C12.625 7.54628 12.2958 6.75142 11.7097 6.16537C11.1237 5.57932 10.3288 5.25008 9.5 5.25008Z"
|
258
|
+
}));
|
259
|
+
};
|
260
|
+
var Shield = function Shield(_ref2) {
|
261
|
+
var isParent = _ref2.isParent;
|
262
|
+
return ___EmotionJSX(Box, {
|
263
|
+
alignItems: "center",
|
264
|
+
justifyContent: "center",
|
265
|
+
minWidth: 24,
|
266
|
+
sx: {
|
267
|
+
position: 'relative'
|
268
|
+
}
|
269
|
+
}, ___EmotionJSX(Icon, {
|
270
|
+
icon: ShieldIcon,
|
271
|
+
color: isParent ? 'decorative.7' : 'accent.40',
|
272
|
+
size: 24,
|
273
|
+
isLinked: isParent
|
274
|
+
}), isParent && ___EmotionJSX(TopBracket, null));
|
275
|
+
};
|
276
|
+
|
165
277
|
// the top portion of the bracket svg, this is basically just a straight vertical line.
|
166
278
|
var TopBracket = function TopBracket() {
|
167
279
|
var color = '#CACED3';
|
168
280
|
return ___EmotionJSX(Box, {
|
169
281
|
width: 15,
|
170
|
-
sx:
|
171
|
-
position: 'absolute',
|
172
|
-
bottom: 0,
|
173
|
-
left: 12,
|
174
|
-
top: 50
|
175
|
-
}
|
282
|
+
sx: sx.topBracket
|
176
283
|
}, ___EmotionJSX("svg", {
|
177
284
|
xmlns: "http://www.w3.org/2000/svg",
|
178
285
|
version: "1.1",
|
@@ -194,20 +301,11 @@ export var Default = function Default(_ref) {
|
|
194
301
|
}))));
|
195
302
|
};
|
196
303
|
|
197
|
-
// the vector shield and key icon.
|
198
|
-
var ShieldVector = function ShieldVector(props) {
|
199
|
-
return ___EmotionJSX("svg", _extends({
|
200
|
-
width: "19",
|
201
|
-
height: "23",
|
202
|
-
viewBox: "0 0 19 23",
|
203
|
-
xmlns: "http://www.w3.org/2000/svg"
|
204
|
-
}, props), ___EmotionJSX("path", {
|
205
|
-
d: "M9.5 7.33342C9.77627 7.33342 10.0412 7.44316 10.2366 7.63851C10.4319 7.83386 10.5417 8.09881 10.5417 8.37508C10.5417 8.65135 10.4319 8.9163 10.2366 9.11165C10.0412 9.307 9.77627 9.41675 9.5 9.41675C9.22373 9.41675 8.95878 9.307 8.76343 9.11165C8.56808 8.9163 8.45833 8.65135 8.45833 8.37508C8.45833 8.09881 8.56808 7.83386 8.76343 7.63851C8.95878 7.44316 9.22373 7.33342 9.5 7.33342ZM18.875 10.4584C18.875 16.2397 14.875 21.6459 9.5 22.9584C4.125 21.6459 0.125 16.2397 0.125 10.4584V4.20842L9.5 0.041748L18.875 4.20842V10.4584ZM9.5 5.25008C8.6712 5.25008 7.87634 5.57932 7.29029 6.16537C6.70424 6.75142 6.375 7.54628 6.375 8.37508C6.375 9.73967 7.23958 10.8959 8.45833 11.323V17.7501H10.5417V15.6667H12.625V13.5834H10.5417V11.323C11.7604 10.8959 12.625 9.73967 12.625 8.37508C12.625 7.54628 12.2958 6.75142 11.7097 6.16537C11.1237 5.57932 10.3288 5.25008 9.5 5.25008Z"
|
206
|
-
}));
|
207
|
-
};
|
208
|
-
|
209
304
|
// reusable piece of code that handles the iconbutton and popover on the right side of the rows
|
210
|
-
var IconWithPopover = function IconWithPopover() {
|
305
|
+
var IconWithPopover = function IconWithPopover(_ref3) {
|
306
|
+
var handleHoverEnd = _ref3.handleHoverEnd,
|
307
|
+
handleHoverStart = _ref3.handleHoverStart,
|
308
|
+
handleMenuHoverEnd = _ref3.handleMenuHoverEnd;
|
211
309
|
return ___EmotionJSX(PopoverMenu, {
|
212
310
|
direction: "left"
|
213
311
|
}, ___EmotionJSX(Box, {
|
@@ -222,6 +320,9 @@ export var Default = function Default(_ref) {
|
|
222
320
|
m: "0.61px"
|
223
321
|
}))), ___EmotionJSX(Menu, {
|
224
322
|
direction: "left",
|
323
|
+
onAction: handleHoverEnd,
|
324
|
+
onHoverEnd: handleMenuHoverEnd,
|
325
|
+
onHoverStart: handleHoverStart,
|
225
326
|
sx: {
|
226
327
|
minWidth: '155px',
|
227
328
|
minHeight: '144px'
|
@@ -245,17 +346,12 @@ export var Default = function Default(_ref) {
|
|
245
346
|
return ___EmotionJSX(Badge, {
|
246
347
|
label: "Default",
|
247
348
|
bg: "active",
|
248
|
-
sx:
|
249
|
-
marginLeft: '25px',
|
250
|
-
alignSelf: 'center',
|
251
|
-
alignItems: 'center',
|
252
|
-
padding: '3px 5px 2px 5px'
|
253
|
-
}
|
349
|
+
sx: sx.badge
|
254
350
|
});
|
255
351
|
};
|
256
|
-
var
|
257
|
-
var expirationText =
|
258
|
-
badgeText =
|
352
|
+
var ExpirationBadge = function ExpirationBadge(_ref4) {
|
353
|
+
var expirationText = _ref4.expirationText,
|
354
|
+
badgeText = _ref4.badgeText;
|
259
355
|
return ___EmotionJSX(Box, {
|
260
356
|
sx: !badgeText && {
|
261
357
|
paddingLeft: '72px'
|
@@ -265,128 +361,82 @@ export var Default = function Default(_ref) {
|
|
265
361
|
alignSelf: "center"
|
266
362
|
}, ___EmotionJSX(Badge, {
|
267
363
|
bg: "white",
|
268
|
-
sx:
|
269
|
-
border: 'solid 1px',
|
270
|
-
borderColor: 'neutral.80',
|
271
|
-
alignSelf: 'center',
|
272
|
-
alignItems: 'center',
|
273
|
-
padding: '3px 5px 2px 5px'
|
274
|
-
},
|
364
|
+
sx: sx.expirationBadge,
|
275
365
|
textColor: "text.primary",
|
276
366
|
label: expirationText
|
277
367
|
}));
|
278
368
|
};
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
policyId = props.policyId,
|
285
|
-
name = props.name;
|
369
|
+
var ListElementContent = function ListElementContent(_ref5) {
|
370
|
+
var badgeText = _ref5.badgeText,
|
371
|
+
isChild = _ref5.isChild,
|
372
|
+
name = _ref5.name,
|
373
|
+
policyId = _ref5.policyId;
|
286
374
|
return ___EmotionJSX(Box, {
|
287
375
|
isRow: true,
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
sx:
|
293
|
-
|
294
|
-
|
295
|
-
}, ___EmotionJSX(Icon, {
|
296
|
-
icon: ShieldVector,
|
297
|
-
color: hasStaging ? 'decorative.7' : 'accent.40',
|
298
|
-
size: 24,
|
299
|
-
isLinked: hasStaging
|
300
|
-
}), hasStaging && ___EmotionJSX(TopBracket, null)), ___EmotionJSX(Box, {
|
301
|
-
isRow: true,
|
302
|
-
mr: "auto",
|
303
|
-
alignSelf: "center",
|
304
|
-
justifyContent: "center",
|
305
|
-
ml: "18px",
|
306
|
-
alignItems: "center"
|
307
|
-
}, ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
308
|
-
sx: {
|
309
|
-
fontWeight: 1,
|
310
|
-
color: 'text.primary',
|
311
|
-
fontSize: 'md'
|
312
|
-
}
|
376
|
+
ml: isChild ? 0 : 18,
|
377
|
+
sx: sx.listElement.textBox
|
378
|
+
}, isChild && ___EmotionJSX(Separator, {
|
379
|
+
orientation: "vertical",
|
380
|
+
sx: sx.bottomBracket.separator
|
381
|
+
}), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
382
|
+
sx: sx.listElement.text
|
313
383
|
}, name), ___EmotionJSX(Text, {
|
314
|
-
sx:
|
315
|
-
|
316
|
-
color: 'text.secondary',
|
317
|
-
fontSize: 'sm'
|
318
|
-
}
|
319
|
-
}, "Policy Id:", ' ', policyId)), badgeText && ___EmotionJSX(DefaultBadge, null)), ___EmotionJSX(IconWithPopover, null));
|
384
|
+
sx: sx.listElement.subText
|
385
|
+
}, "Policy Id:", ' ', policyId)), badgeText && ___EmotionJSX(DefaultBadge, null));
|
320
386
|
};
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
387
|
+
var ListElement = function ListElement(_ref6) {
|
388
|
+
var badgeText = _ref6.badgeText,
|
389
|
+
expirationText = _ref6.expirationText,
|
390
|
+
isChild = _ref6.isChild,
|
391
|
+
isParent = _ref6.isParent,
|
392
|
+
name = _ref6.name,
|
393
|
+
policyId = _ref6.policyId;
|
394
|
+
var listItemRef = useRef();
|
395
|
+
var _useOverlappingMenuHo = useOverlappingMenuHoverState({
|
396
|
+
listItemRef: listItemRef
|
397
|
+
}),
|
398
|
+
handleHoverEnd = _useOverlappingMenuHo.handleHoverEnd,
|
399
|
+
handleHoverStart = _useOverlappingMenuHo.handleHoverStart,
|
400
|
+
handleMenuHoverEnd = _useOverlappingMenuHo.handleMenuHoverEnd,
|
401
|
+
handleMouseMove = _useOverlappingMenuHo.handleMouseMove,
|
402
|
+
isHovered = _useOverlappingMenuHo.isHovered;
|
403
|
+
return ___EmotionJSX(ListItem, {
|
404
|
+
isHovered: isHovered,
|
329
405
|
isRow: true,
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
}, ___EmotionJSX(
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
backgroundColor: 'decorative.7',
|
346
|
-
marginLeft: '2px !important'
|
347
|
-
}
|
348
|
-
})), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
349
|
-
sx: {
|
350
|
-
fontWeight: 1,
|
351
|
-
color: 'text.primary',
|
352
|
-
fontSize: 'md'
|
353
|
-
}
|
354
|
-
}, name), ___EmotionJSX(Text, {
|
355
|
-
sx: {
|
356
|
-
fontWeight: 0,
|
357
|
-
color: 'text.secondary',
|
358
|
-
fontSize: 'sm'
|
359
|
-
}
|
360
|
-
}, "Policy Id:", ' ', policyId))), badgeText && ___EmotionJSX(DefaultBadge, null), expirationText && ___EmotionJSX(ExprirationBadge, {
|
406
|
+
onHoverEnd: handleHoverEnd,
|
407
|
+
onHoverStart: handleHoverStart,
|
408
|
+
onMouseMove: handleMouseMove,
|
409
|
+
ref: listItemRef,
|
410
|
+
variant: "listItem.hover",
|
411
|
+
sx: sx.listElement.container
|
412
|
+
}, !isChild ? ___EmotionJSX(Shield, {
|
413
|
+
isParent: isParent
|
414
|
+
}) : ___EmotionJSX(BottomBracket, null), ___EmotionJSX(ListElementContent, {
|
415
|
+
badgeText: badgeText,
|
416
|
+
expirationText: expirationText,
|
417
|
+
isChild: isChild,
|
418
|
+
name: name,
|
419
|
+
policyId: policyId
|
420
|
+
}), expirationText && ___EmotionJSX(ExpirationBadge, {
|
361
421
|
expirationText: expirationText
|
362
|
-
}), ___EmotionJSX(IconWithPopover,
|
422
|
+
}), ___EmotionJSX(IconWithPopover, {
|
423
|
+
handleHoverEnd: handleHoverEnd,
|
424
|
+
handleMenuHoverEnd: handleMenuHoverEnd,
|
425
|
+
handleHoverStart: handleHoverStart
|
426
|
+
}));
|
363
427
|
};
|
364
|
-
return ___EmotionJSX(
|
428
|
+
return ___EmotionJSX(ListView, _extends({}, args, {
|
365
429
|
items: theseItems
|
366
430
|
}), function (item) {
|
367
431
|
return ___EmotionJSX(Item, _extends({}, item, {
|
368
432
|
textValue: item.name,
|
369
433
|
"data-id": item.key,
|
370
434
|
listItemProps: {
|
371
|
-
|
372
|
-
sx: {
|
373
|
-
'&.has-inset-separator': {
|
374
|
-
'&:before': {
|
375
|
-
content: '""',
|
376
|
-
position: 'absolute',
|
377
|
-
width: 'calc(100% - 43px)',
|
378
|
-
right: 0,
|
379
|
-
bottom: 0,
|
380
|
-
borderBottom: '1px solid',
|
381
|
-
borderBottomColor: 'line.light'
|
382
|
-
}
|
383
|
-
}
|
384
|
-
}
|
435
|
+
sx: sx.listViewItem
|
385
436
|
}
|
386
|
-
}),
|
387
|
-
|
388
|
-
|
389
|
-
hasStaging: item.childrenObjects
|
437
|
+
}), ___EmotionJSX(ListElement, _extends({
|
438
|
+
isParent: item.childrenObjects,
|
439
|
+
isChild: item.parentId
|
390
440
|
}, item)));
|
391
|
-
})
|
441
|
+
});
|
392
442
|
};
|
@@ -9,6 +9,7 @@ import MoreVertIcon from 'mdi-react/MoreVertIcon';
|
|
9
9
|
import PencilIcon from 'mdi-react/PencilIcon';
|
10
10
|
import PlusIcon from 'mdi-react/PlusIcon';
|
11
11
|
import { useOverlayPanelState } from '../hooks';
|
12
|
+
import useOverlappingMenuHoverState from '../hooks/useOverlappingMenuHoverState';
|
12
13
|
import { Box, Icon, IconButton, Link, ListItem, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, SwitchField, Tab, Tabs, Text } from '../index';
|
13
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
14
15
|
export default {
|
@@ -174,46 +175,20 @@ var ListElement = function ListElement(_ref) {
|
|
174
175
|
var item = _ref.item,
|
175
176
|
isHoverable = _ref.isHoverable,
|
176
177
|
onClosePanel = _ref.onClosePanel;
|
177
|
-
var _useState = useState(false),
|
178
|
-
_useState2 = _slicedToArray(_useState, 2),
|
179
|
-
isHovered = _useState2[0],
|
180
|
-
setIsHovered = _useState2[1];
|
181
|
-
var _useState3 = useState({}),
|
182
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
183
|
-
mousePosition = _useState4[0],
|
184
|
-
setMousePosition = _useState4[1];
|
185
178
|
var listItemRef = useRef();
|
186
|
-
var
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
if (hasMovedBackToRow) {
|
195
|
-
setIsHovered(true);
|
196
|
-
return;
|
197
|
-
}
|
198
|
-
setIsHovered(false);
|
199
|
-
};
|
200
|
-
var handleMouseMove = function handleMouseMove(e) {
|
201
|
-
setMousePosition({
|
202
|
-
currentPositionX: e.clientX,
|
203
|
-
currentPositionY: e.clientY
|
204
|
-
});
|
205
|
-
};
|
206
|
-
var handleHoveEnd = function handleHoveEnd() {
|
207
|
-
setIsHovered(false);
|
208
|
-
};
|
209
|
-
var handleHoveStart = function handleHoveStart() {
|
210
|
-
setIsHovered(true);
|
211
|
-
};
|
179
|
+
var _useOverlappingMenuHo = useOverlappingMenuHoverState({
|
180
|
+
listItemRef: listItemRef
|
181
|
+
}),
|
182
|
+
handleHoverEnd = _useOverlappingMenuHo.handleHoverEnd,
|
183
|
+
handleHoverStart = _useOverlappingMenuHo.handleHoverStart,
|
184
|
+
handleMenuHoverEnd = _useOverlappingMenuHo.handleMenuHoverEnd,
|
185
|
+
handleMouseMove = _useOverlappingMenuHo.handleMouseMove,
|
186
|
+
isHovered = _useOverlappingMenuHo.isHovered;
|
212
187
|
return ___EmotionJSX(ListItem, {
|
213
188
|
isHovered: isHoverable && isHovered,
|
214
189
|
isRow: true,
|
215
|
-
onHoverEnd:
|
216
|
-
onHoverStart:
|
190
|
+
onHoverEnd: handleHoverEnd,
|
191
|
+
onHoverStart: handleHoverStart,
|
217
192
|
onMouseMove: handleMouseMove,
|
218
193
|
ref: listItemRef,
|
219
194
|
sx: sx.listElement.wrapper
|
@@ -245,9 +220,9 @@ var ListElement = function ListElement(_ref) {
|
|
245
220
|
icon: MoreVertIcon,
|
246
221
|
size: "md"
|
247
222
|
})), ___EmotionJSX(Menu, {
|
248
|
-
onAction:
|
223
|
+
onAction: handleHoverEnd,
|
249
224
|
onHoverEnd: handleMenuHoverEnd,
|
250
|
-
onHoverStart:
|
225
|
+
onHoverStart: handleHoverStart
|
251
226
|
}, ___EmotionJSX(Item, {
|
252
227
|
key: "enable"
|
253
228
|
}, "Enable user"), ___EmotionJSX(Item, {
|
@@ -263,14 +238,14 @@ var ListElement = function ListElement(_ref) {
|
|
263
238
|
}))));
|
264
239
|
};
|
265
240
|
export var Default = function Default() {
|
266
|
-
var
|
267
|
-
|
268
|
-
selectedItemId =
|
269
|
-
setSelectedItemId =
|
270
|
-
var
|
271
|
-
|
272
|
-
selectedKeys =
|
273
|
-
setSelectedKeys =
|
241
|
+
var _useState = useState(),
|
242
|
+
_useState2 = _slicedToArray(_useState, 2),
|
243
|
+
selectedItemId = _useState2[0],
|
244
|
+
setSelectedItemId = _useState2[1];
|
245
|
+
var _useState3 = useState(),
|
246
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
247
|
+
selectedKeys = _useState4[0],
|
248
|
+
setSelectedKeys = _useState4[1];
|
274
249
|
var _useOverlayPanelState = useOverlayPanelState(),
|
275
250
|
panelState = _useOverlayPanelState.state,
|
276
251
|
onPanelClose = _useOverlayPanelState.onClose;
|
@@ -1,10 +1,20 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
1
2
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
3
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
3
6
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
4
7
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
5
8
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
6
9
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
7
|
-
import
|
10
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
11
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
12
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
13
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
14
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
15
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
16
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
17
|
+
import React, { useEffect, useRef, useState } from 'react';
|
8
18
|
import CheckCircleIcon from 'mdi-react/CheckCircleIcon';
|
9
19
|
import { Box, Icon, IconButton, Link, Separator, Text } from '../index';
|
10
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -125,6 +135,8 @@ var sx = {
|
|
125
135
|
maxWidth: '195px'
|
126
136
|
},
|
127
137
|
linkRowIconButton: {
|
138
|
+
height: '23.5px',
|
139
|
+
width: '23.5px',
|
128
140
|
'&.is-pressed': {
|
129
141
|
backgroundColor: 'transparent'
|
130
142
|
},
|
@@ -150,10 +162,9 @@ var sx = {
|
|
150
162
|
linkRowSeparator: {
|
151
163
|
flexGrow: 1,
|
152
164
|
backgroundColor: 'accent.30',
|
153
|
-
maxHeight: '100%',
|
154
165
|
width: '1px !important',
|
155
166
|
zIndex: 2,
|
156
|
-
m: '-
|
167
|
+
m: '-4px 5px -5px 11.5px !important'
|
157
168
|
},
|
158
169
|
linkRowText: {
|
159
170
|
fontSize: 'md',
|
@@ -172,11 +183,11 @@ var sx = {
|
|
172
183
|
boxShadow: '3px 8px 4px rgba(202, 206, 211, 0.36)'
|
173
184
|
}
|
174
185
|
};
|
175
|
-
var Stage = function Stage(
|
176
|
-
var title =
|
177
|
-
icon =
|
178
|
-
links =
|
179
|
-
isLastStage =
|
186
|
+
var Stage = function Stage(_ref) {
|
187
|
+
var title = _ref.title,
|
188
|
+
icon = _ref.icon,
|
189
|
+
links = _ref.links,
|
190
|
+
isLastStage = _ref.isLastStage;
|
180
191
|
var _useState = useState([]),
|
181
192
|
_useState2 = _slicedToArray(_useState, 2),
|
182
193
|
selectedLinks = _useState2[0],
|
@@ -225,43 +236,57 @@ var Stage = function Stage(props) {
|
|
225
236
|
}));
|
226
237
|
}))));
|
227
238
|
};
|
228
|
-
var LinkRow = function LinkRow(
|
229
|
-
var
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
239
|
+
var LinkRow = function LinkRow(_ref2) {
|
240
|
+
var index = _ref2.index,
|
241
|
+
isLastLink = _ref2.isLastLink,
|
242
|
+
isLinkSelected = _ref2.isLinkSelected,
|
243
|
+
onSelectionChange = _ref2.onSelectionChange,
|
244
|
+
title = _ref2.title;
|
234
245
|
var _useState3 = useState(false),
|
235
246
|
_useState4 = _slicedToArray(_useState3, 2),
|
236
247
|
isSelected = _useState4[0],
|
237
248
|
handleSelectionChange = _useState4[1];
|
249
|
+
var _useState5 = useState(0),
|
250
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
251
|
+
verticalSeparatorHeight = _useState6[0],
|
252
|
+
setVerticalSeparatorHeight = _useState6[1];
|
253
|
+
var iconRef = useRef();
|
254
|
+
var rowRef = useRef();
|
255
|
+
useEffect(function () {
|
256
|
+
var _rowRef$current$getBo = rowRef.current.getBoundingClientRect(),
|
257
|
+
height = _rowRef$current$getBo.height;
|
258
|
+
var _iconRef$current$getB = iconRef.current.getBoundingClientRect(),
|
259
|
+
iconRefHeight = _iconRef$current$getB.height;
|
260
|
+
var marginAccommodation = 4;
|
261
|
+
var halfIconHeight = iconRefHeight / 2;
|
262
|
+
setVerticalSeparatorHeight(height - halfIconHeight - marginAccommodation);
|
263
|
+
}, [iconRef, rowRef]);
|
238
264
|
var onIconPress = function onIconPress() {
|
239
265
|
handleSelectionChange(!isSelected);
|
240
266
|
onSelectionChange(index);
|
241
267
|
};
|
242
268
|
return ___EmotionJSX(Box, {
|
243
|
-
isRow: true
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
width: '23.5px'
|
248
|
-
}
|
249
|
-
}, ___EmotionJSX(IconButton, {
|
269
|
+
isRow: true,
|
270
|
+
ref: rowRef
|
271
|
+
}, ___EmotionJSX(Box, null, ___EmotionJSX(IconButton, {
|
272
|
+
"aria-label": "completed step icon indicator",
|
250
273
|
onPress: onIconPress,
|
251
|
-
|
252
|
-
|
274
|
+
ref: iconRef,
|
275
|
+
sx: sx.linkRowIconButton
|
253
276
|
}, ___EmotionJSX(Icon, {
|
254
277
|
icon: isSelected ? CheckCircleIcon : RadioButtonIcon,
|
255
278
|
size: "sm",
|
256
279
|
sx: isSelected ? sx.linkRowIconButton : sx.linkRowIconNotSelected
|
257
|
-
}))
|
258
|
-
|
259
|
-
|
260
|
-
|
280
|
+
})), !isLastLink && isLinkSelected && ___EmotionJSX(Separator, {
|
281
|
+
orientation: "vertical",
|
282
|
+
sx: _objectSpread(_objectSpread({}, sx.linkRowSeparator), {}, {
|
283
|
+
maxHeight: verticalSeparatorHeight
|
284
|
+
})
|
285
|
+
})), ___EmotionJSX(Link, {
|
261
286
|
href: "https://www.pingidentity.com",
|
262
|
-
|
263
|
-
|
264
|
-
}, title))
|
287
|
+
sx: sx.linkRowText,
|
288
|
+
target: "_blank"
|
289
|
+
}, title));
|
265
290
|
};
|
266
291
|
export var Default = function Default() {
|
267
292
|
// Open the `Story` addons tab to view the source code for full context.
|