@pingux/astro 2.6.1-alpha.2 → 2.7.0-alpha.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 (67) hide show
  1. package/lib/cjs/components/IconButton/IconButton.js +2 -38
  2. package/lib/cjs/components/IconButton/IconButton.stories.js +2 -34
  3. package/lib/cjs/components/IconButton/iconButtonAttributes.js +100 -0
  4. package/lib/cjs/components/ListView/ListView.js +0 -9
  5. package/lib/cjs/components/ListView/ListView.stories.js +34 -80
  6. package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +6 -1
  7. package/lib/cjs/components/Menu/Menu.js +7 -60
  8. package/lib/cjs/components/Menu/Menu.stories.js +2 -56
  9. package/lib/cjs/components/Menu/menuAttributes.js +104 -0
  10. package/lib/cjs/components/SwitchField/SwitchField.js +12 -54
  11. package/lib/cjs/components/SwitchField/SwitchField.stories.js +2 -34
  12. package/lib/cjs/components/SwitchField/SwitchField.test.js +4 -5
  13. package/lib/cjs/components/SwitchField/switchFieldAttributes.js +191 -0
  14. package/lib/cjs/experimental/StyledListItem/StyledListItem.js +159 -0
  15. package/lib/cjs/experimental/StyledListItem/StyledListItem.stories.js +155 -0
  16. package/lib/cjs/experimental/StyledListItem/StyledListItem.test.js +83 -0
  17. package/lib/cjs/experimental/StyledListItem/controls/ListItemEditButton.js +34 -0
  18. package/lib/cjs/experimental/StyledListItem/controls/ListItemEditButton.stories.js +31 -0
  19. package/lib/cjs/experimental/StyledListItem/controls/ListItemEditButton.test.js +25 -0
  20. package/lib/cjs/experimental/StyledListItem/controls/ListItemMenu.js +37 -0
  21. package/lib/cjs/experimental/StyledListItem/controls/ListItemMenu.stories.js +36 -0
  22. package/lib/cjs/experimental/StyledListItem/controls/ListItemMenu.test.js +59 -0
  23. package/lib/cjs/experimental/StyledListItem/controls/ListItemSwitchField.js +32 -0
  24. package/lib/cjs/experimental/StyledListItem/controls/ListItemSwitchField.stories.js +41 -0
  25. package/lib/cjs/experimental/StyledListItem/controls/ListItemSwitchField.test.js +25 -0
  26. package/lib/cjs/experimental/StyledListItem/styledListItemAttributes.js +81 -0
  27. package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +370 -0
  28. package/lib/cjs/experimental/recipes/ScrollableListView.stories.js +108 -0
  29. package/lib/cjs/experimental/recipes/items.js +126 -0
  30. package/lib/cjs/index.js +33 -1
  31. package/lib/cjs/utils/docUtils/ariaAttributes.js +2 -1
  32. package/lib/cjs/utils/docUtils/docArgTypes.js +41 -0
  33. package/lib/cjs/utils/docUtils/hoverProps.js +7 -2
  34. package/lib/components/IconButton/IconButton.js +2 -38
  35. package/lib/components/IconButton/IconButton.stories.js +2 -34
  36. package/lib/components/IconButton/iconButtonAttributes.js +91 -0
  37. package/lib/components/ListView/ListView.js +0 -9
  38. package/lib/components/ListView/ListView.stories.js +35 -82
  39. package/lib/components/ListViewItem/ListViewItem.styles.js +6 -1
  40. package/lib/components/Menu/Menu.js +7 -60
  41. package/lib/components/Menu/Menu.stories.js +2 -57
  42. package/lib/components/Menu/menuAttributes.js +95 -0
  43. package/lib/components/SwitchField/SwitchField.js +14 -55
  44. package/lib/components/SwitchField/SwitchField.stories.js +2 -34
  45. package/lib/components/SwitchField/SwitchField.test.js +4 -5
  46. package/lib/components/SwitchField/switchFieldAttributes.js +182 -0
  47. package/lib/experimental/StyledListItem/StyledListItem.js +146 -0
  48. package/lib/experimental/StyledListItem/StyledListItem.stories.js +140 -0
  49. package/lib/experimental/StyledListItem/StyledListItem.test.js +74 -0
  50. package/lib/experimental/StyledListItem/controls/ListItemEditButton.js +25 -0
  51. package/lib/experimental/StyledListItem/controls/ListItemEditButton.stories.js +21 -0
  52. package/lib/experimental/StyledListItem/controls/ListItemEditButton.test.js +22 -0
  53. package/lib/experimental/StyledListItem/controls/ListItemMenu.js +28 -0
  54. package/lib/experimental/StyledListItem/controls/ListItemMenu.stories.js +26 -0
  55. package/lib/experimental/StyledListItem/controls/ListItemMenu.test.js +56 -0
  56. package/lib/experimental/StyledListItem/controls/ListItemSwitchField.js +23 -0
  57. package/lib/experimental/StyledListItem/controls/ListItemSwitchField.stories.js +32 -0
  58. package/lib/experimental/StyledListItem/controls/ListItemSwitchField.test.js +22 -0
  59. package/lib/experimental/StyledListItem/styledListItemAttributes.js +72 -0
  60. package/lib/experimental/recipes/ListAndPanel.stories.js +353 -0
  61. package/lib/experimental/recipes/ScrollableListView.stories.js +93 -0
  62. package/lib/experimental/recipes/items.js +117 -0
  63. package/lib/index.js +7 -1
  64. package/lib/utils/docUtils/ariaAttributes.js +1 -1
  65. package/lib/utils/docUtils/docArgTypes.js +29 -0
  66. package/lib/utils/docUtils/hoverProps.js +7 -2
  67. package/package.json +1 -1
@@ -0,0 +1,72 @@
1
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+ 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; }
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+ import PropTypes from 'prop-types';
13
+ import { booleanArg, stringOrStringArray } from '../../utils/docUtils/docArgTypes';
14
+ import { onHoverArgTypes, onHoverPropTypes } from '../../utils/docUtils/hoverProps';
15
+ var descriptions = {
16
+ details: 'Object with User/Group details.',
17
+ className: 'A list of class names to apply to the element',
18
+ isSelected: 'Sets the selected state of the ListItem',
19
+ isPanelHeader: 'A boolean that will adapt the styling of ListIteme to be used as the PanelHeader',
20
+ slots: 'Provides a way to insert markup in specified places.',
21
+ linkProps: 'When present, provides meta click functionality'
22
+ };
23
+ export var styledListItemArgTypes = _objectSpread({
24
+ className: {
25
+ description: descriptions.className,
26
+ type: {
27
+ summary: stringOrStringArray
28
+ }
29
+ },
30
+ details: {
31
+ description: descriptions.details,
32
+ type: {
33
+ summary: '{ icon, text, subtext }'
34
+ }
35
+ },
36
+ isSelected: _objectSpread(_objectSpread({}, booleanArg), {}, {
37
+ description: descriptions.isSelected,
38
+ control: {
39
+ type: 'none'
40
+ },
41
+ linkProps: {
42
+ description: descriptions.linkProps,
43
+ type: {
44
+ summary: '{ href, target }'
45
+ }
46
+ }
47
+ }),
48
+ onMetaClick: {
49
+ description: ''
50
+ },
51
+ slots: {
52
+ description: descriptions.slots,
53
+ type: {
54
+ summary: '{ leftOfDetails, rightOfDetails }'
55
+ }
56
+ }
57
+ }, onHoverArgTypes);
58
+ export var styledListItemPropTypes = _objectSpread({
59
+ className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
60
+ details: PropTypes.shape({
61
+ icon: PropTypes.elementType,
62
+ subtext: PropTypes.string,
63
+ text: PropTypes.string
64
+ }),
65
+ isSelected: PropTypes.bool,
66
+ linkProps: PropTypes.object,
67
+ onMetaClick: PropTypes.func,
68
+ slots: PropTypes.shape({
69
+ leftOfDetails: PropTypes.node,
70
+ rightOfDetails: PropTypes.node
71
+ })
72
+ }, onHoverPropTypes);
@@ -0,0 +1,353 @@
1
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
2
+ import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
3
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
4
+ import React, { useRef, useState } from 'react';
5
+ import { FocusScope } from 'react-aria';
6
+ import { Item } from 'react-stately';
7
+ import AccountIcon from '@pingux/mdi-react/AccountIcon';
8
+ import CloseIcon from '@pingux/mdi-react/CloseIcon';
9
+ import MoreVertIcon from '@pingux/mdi-react/MoreVertIcon';
10
+ import PencilIcon from '@pingux/mdi-react/PencilIcon';
11
+ import PlusIcon from '@pingux/mdi-react/PlusIcon';
12
+ import { useOverlayPanelState } from '../../hooks';
13
+ import useOverlappingMenuHoverState from '../../hooks/useOverlappingMenuHoverState';
14
+ import { Box, Icon, IconButton, Link, ListItemMenu, ListItemSwitchField, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, StyledListItem, SwitchField, Tab, Tabs, Text } from '../../index';
15
+ import { items } from './items';
16
+ import { jsx as ___EmotionJSX } from "@emotion/react";
17
+ export default {
18
+ title: 'Experimental/Recipes/ListAndPanel',
19
+ parameters: {
20
+ docs: {
21
+ source: {
22
+ type: 'code'
23
+ }
24
+ }
25
+ }
26
+ };
27
+ var sx = {
28
+ wrapper: {
29
+ px: 'lg',
30
+ py: 'lg',
31
+ bg: 'accent.99',
32
+ height: '900px',
33
+ overflowY: 'scroll'
34
+ },
35
+ separator: {
36
+ bg: 'accent.90'
37
+ },
38
+ tabsWrapper: {
39
+ px: 'lg',
40
+ pt: 'xs'
41
+ },
42
+ iconButton: {
43
+ position: 'absolute',
44
+ top: 0,
45
+ right: 0
46
+ },
47
+ itemLabel: {
48
+ fontSize: 'sm',
49
+ fontWeight: 3,
50
+ lineHeight: '16px',
51
+ mb: 'xs'
52
+ },
53
+ itemValue: {
54
+ fontWeight: 0,
55
+ lineHeight: '18px',
56
+ mb: 'md'
57
+ },
58
+ panelHeader: {
59
+ container: {
60
+ bg: 'accent.99',
61
+ minHeight: 58,
62
+ ml: 0,
63
+ pl: 14,
64
+ pr: 'xs'
65
+ },
66
+ controls: {
67
+ alignSelf: 'center',
68
+ ml: 'auto',
69
+ pr: 'sm'
70
+ },
71
+ details: {
72
+ alignItems: 'center'
73
+ },
74
+ subtitle: {
75
+ alignSelf: 'start',
76
+ fontSize: 'sm',
77
+ lineHeight: '16px',
78
+ my: '1px'
79
+ },
80
+ title: {
81
+ alignSelf: 'start',
82
+ fontSize: 'md'
83
+ },
84
+ wrapper: {
85
+ cursor: 'pointer',
86
+ display: 'flex',
87
+ flex: '1 1 0px',
88
+ ml: 'md'
89
+ }
90
+ }
91
+ };
92
+ var heading = 'Users';
93
+ var description = 'The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page.';
94
+ var title = ___EmotionJSX(Box, null, ___EmotionJSX(Box, {
95
+ align: "center",
96
+ isRow: true,
97
+ mb: "xs",
98
+ role: "heading",
99
+ "aria-level": "1"
100
+ }, ___EmotionJSX(Text, {
101
+ fontSize: "xx",
102
+ fontWeight: 3,
103
+ fontColor: "text.primary"
104
+ }, heading), ___EmotionJSX(IconButton, {
105
+ "aria-label": "icon button",
106
+ ml: "sm",
107
+ variant: "inverted"
108
+ }, ___EmotionJSX(Icon, {
109
+ icon: PlusIcon,
110
+ size: "sm"
111
+ }))), ___EmotionJSX(Text, {
112
+ fontSize: "sm",
113
+ color: "text.secondary",
114
+ fontWeight: 0,
115
+ width: "800px"
116
+ }, description, ___EmotionJSX(Link, {
117
+ href: "https://uilibrary.ping-eng.com/",
118
+ sx: {
119
+ fontSize: '13px'
120
+ }
121
+ }, " Learn more")));
122
+ export var ListAndPanel = function ListAndPanel() {
123
+ // Example of items data structure
124
+ // const items = [
125
+ // {
126
+ // email: 'dburkitt5@columbia.edu',
127
+ // firstName: 'Nicola',
128
+ // lastName: 'Burkitt',
129
+ // hasIcon: true,
130
+ // icon: AccountIcon,
131
+ // linkProps: { href: 'https://pingidentity.com/' },
132
+ // },
133
+ // ]
134
+
135
+ var _useState = useState(),
136
+ _useState2 = _slicedToArray(_useState, 2),
137
+ selectedItemId = _useState2[0],
138
+ setSelectedItemId = _useState2[1];
139
+ var _useState3 = useState(),
140
+ _useState4 = _slicedToArray(_useState3, 2),
141
+ selectedKeys = _useState4[0],
142
+ setSelectedKeys = _useState4[1];
143
+ var _useOverlayPanelState = useOverlayPanelState(),
144
+ panelState = _useOverlayPanelState.state,
145
+ onPanelClose = _useOverlayPanelState.onClose;
146
+ var panelTriggerRef = useRef();
147
+ var closePanelHandler = function closePanelHandler() {
148
+ onPanelClose(panelState, panelTriggerRef);
149
+ setSelectedItemId(-1);
150
+ setSelectedKeys([]);
151
+ };
152
+ var selectItemHandler = function selectItemHandler(e) {
153
+ if (e.size) {
154
+ setSelectedItemId(_findIndexInstanceProperty(items).call(items, function (item) {
155
+ return item.email === e.currentKey;
156
+ }));
157
+ setSelectedKeys([e.currentKey]);
158
+ panelState.open();
159
+ } else {
160
+ closePanelHandler();
161
+ }
162
+ };
163
+ return ___EmotionJSX(Box, {
164
+ sx: sx.wrapper
165
+ }, title, ___EmotionJSX(SearchField, {
166
+ position: "fixed",
167
+ mb: "lg",
168
+ mt: "lg",
169
+ width: "400px",
170
+ placeholder: "Search",
171
+ "aria-label": "search"
172
+ }), ___EmotionJSX(Separator, {
173
+ margin: 0
174
+ }), ___EmotionJSX(ListView, {
175
+ items: items,
176
+ onSelectionChange: selectItemHandler,
177
+ ref: panelTriggerRef,
178
+ selectedKeys: selectedKeys
179
+ }, function (item) {
180
+ return ___EmotionJSX(Item, {
181
+ key: item.email,
182
+ textValue: item.email,
183
+ hasSeparator: item.hasSeparator
184
+ // ListView wraps ListItems with padding and height styles, when using the
185
+ // StyledListItem use the `listViewItem.styledListItem` variant to override this.
186
+ ,
187
+ listItemProps: {
188
+ variant: 'listViewItem.styledListItem'
189
+ }
190
+ }, ___EmotionJSX(ListElement, {
191
+ item: item
192
+ }));
193
+ }), ___EmotionJSX(OverlayPanel, {
194
+ isOpen: panelState.isOpen,
195
+ state: panelState,
196
+ triggerRef: panelTriggerRef,
197
+ p: 0,
198
+ size: "large"
199
+ }, panelState.isOpen && ___EmotionJSX(FocusScope, {
200
+ contain: true,
201
+ restoreFocus: true,
202
+ autoFocus: true
203
+ }, ___EmotionJSX(PanelHeader, {
204
+ item: selectedItemId >= 0 ? items[selectedItemId] : [],
205
+ onClosePanel: closePanelHandler
206
+ }), ___EmotionJSX(Separator, {
207
+ margin: 0,
208
+ sx: sx.separator
209
+ }), ___EmotionJSX(Box, {
210
+ sx: sx.tabsWrapper
211
+ }, ___EmotionJSX(Tabs, {
212
+ tabListProps: {
213
+ justifyContent: 'center'
214
+ },
215
+ tabPanelProps: {
216
+ sx: {
217
+ position: 'relative'
218
+ }
219
+ }
220
+ }, ___EmotionJSX(Tab, {
221
+ title: "Profile"
222
+ }, selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(IconButton, {
223
+ variant: "inverted",
224
+ "aria-label": "pencil icon button",
225
+ sx: sx.iconButton
226
+ }, ___EmotionJSX(Icon, {
227
+ icon: PencilIcon,
228
+ size: "sm"
229
+ })), ___EmotionJSX(Text, {
230
+ sx: sx.itemLabel
231
+ }, "Full Name"), ___EmotionJSX(Text, {
232
+ sx: sx.itemValue
233
+ }, items[selectedItemId].firstName, ' ', items[selectedItemId].lastName), ___EmotionJSX(Text, {
234
+ sx: sx.itemLabel
235
+ }, "First Name"), ___EmotionJSX(Text, {
236
+ sx: sx.itemValue
237
+ }, items[selectedItemId].firstName), ___EmotionJSX(Text, {
238
+ sx: sx.itemLabel
239
+ }, "Last Name"), ___EmotionJSX(Text, {
240
+ sx: sx.itemValue
241
+ }, items[selectedItemId].lastName), ___EmotionJSX(Text, {
242
+ sx: sx.itemLabel
243
+ }, "Email"), ___EmotionJSX(Text, {
244
+ sx: sx.itemValue
245
+ }, items[selectedItemId].email))), ___EmotionJSX(Tab, {
246
+ title: "Group Memberships"
247
+ }, ___EmotionJSX(Text, null, "Group Memberships")), ___EmotionJSX(Tab, {
248
+ title: "Account Info"
249
+ }, ___EmotionJSX(Text, null, "Account Info")))))));
250
+ };
251
+ export var ListElement = function ListElement(_ref) {
252
+ var _context;
253
+ var _ref$item = _ref.item,
254
+ item = _ref$item === void 0 ? {
255
+ email: '',
256
+ icon: AccountIcon,
257
+ firstName: 'John',
258
+ lastName: 'Doe'
259
+ } : _ref$item;
260
+ var listItemRef = useRef();
261
+ var _useOverlappingMenuHo = useOverlappingMenuHoverState({
262
+ listItemRef: listItemRef
263
+ }),
264
+ handleHoverEnd = _useOverlappingMenuHo.handleHoverEnd,
265
+ handleHoverStart = _useOverlappingMenuHo.handleHoverStart,
266
+ handleMenuHoverEnd = _useOverlappingMenuHo.handleMenuHoverEnd,
267
+ handleMouseMove = _useOverlappingMenuHo.handleMouseMove,
268
+ isHovered = _useOverlappingMenuHo.isHovered;
269
+ var icon = item.icon,
270
+ email = item.email,
271
+ firstName = item.firstName,
272
+ lastName = item.lastName,
273
+ linkProps = item.linkProps;
274
+ var text = _concatInstanceProperty(_context = "".concat(lastName, ", ")).call(_context, firstName);
275
+ return ___EmotionJSX(StyledListItem, {
276
+ details: {
277
+ icon: icon,
278
+ subtext: email,
279
+ text: text
280
+ },
281
+ isHovered: isHovered,
282
+ onHoverEnd: handleHoverEnd,
283
+ onHoverStart: handleHoverStart,
284
+ onMouseMove: handleMouseMove,
285
+ linkProps: linkProps,
286
+ ref: listItemRef
287
+ }, ___EmotionJSX(ListItemSwitchField, null), ___EmotionJSX(ListItemMenu, {
288
+ onAction: handleHoverEnd,
289
+ onHoverEnd: handleMenuHoverEnd,
290
+ onHoverStart: handleHoverStart
291
+ }, ___EmotionJSX(Item, {
292
+ key: "enable"
293
+ }, "Enable user"), ___EmotionJSX(Item, {
294
+ key: "disable"
295
+ }, "Disable user"), ___EmotionJSX(Item, {
296
+ key: "delete"
297
+ }, "Delete user")));
298
+ };
299
+ export var PanelHeader = function PanelHeader(_ref2) {
300
+ var _context2;
301
+ var _ref2$item = _ref2.item,
302
+ item = _ref2$item === void 0 ? {
303
+ email: '',
304
+ icon: AccountIcon,
305
+ firstName: 'John',
306
+ lastName: 'Doe'
307
+ } : _ref2$item,
308
+ onClosePanel = _ref2.onClosePanel;
309
+ var email = item.email,
310
+ firstName = item.firstName,
311
+ lastName = item.lastName;
312
+ var text = _concatInstanceProperty(_context2 = "".concat(lastName, ", ")).call(_context2, firstName);
313
+ return ___EmotionJSX(Box, {
314
+ sx: sx.panelHeader.container
315
+ }, ___EmotionJSX(Box, {
316
+ isRow: true,
317
+ sx: sx.panelHeader.wrapper
318
+ }, ___EmotionJSX(Box, {
319
+ isRow: true,
320
+ sx: sx.panelHeader.details
321
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
322
+ variant: "bodyStrong",
323
+ sx: sx.panelHeader.title
324
+ }, text), ___EmotionJSX(Text, {
325
+ variant: "subtitle",
326
+ sx: sx.panelHeader.subtitle
327
+ }, email))), ___EmotionJSX(Box, {
328
+ isRow: true,
329
+ sx: sx.panelHeader.controls
330
+ }, ___EmotionJSX(SwitchField, {
331
+ "aria-label": "active user",
332
+ isDefaultSelected: true,
333
+ alignSelf: "center",
334
+ mr: "xs"
335
+ }), ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(IconButton, {
336
+ "aria-label": "more"
337
+ }, ___EmotionJSX(Icon, {
338
+ icon: MoreVertIcon,
339
+ size: "md"
340
+ })), ___EmotionJSX(Menu, null, ___EmotionJSX(Item, {
341
+ key: "enable"
342
+ }, "Enable user"), ___EmotionJSX(Item, {
343
+ key: "disable"
344
+ }, "Disable user"), ___EmotionJSX(Item, {
345
+ key: "delete"
346
+ }, "Delete user"))), ___EmotionJSX(IconButton, {
347
+ "aria-label": "close icon button",
348
+ onPress: onClosePanel
349
+ }, ___EmotionJSX(Icon, {
350
+ size: "sm",
351
+ icon: CloseIcon
352
+ })))));
353
+ };
@@ -0,0 +1,93 @@
1
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
2
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
3
+ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
4
+ import React, { useState } from 'react';
5
+ import { Item } from 'react-stately';
6
+ import FormSelectIcon from '@pingux/mdi-react/FormSelectIcon';
7
+ import { Box, ListItemEditButton, ListItemMenu, ListView, ScrollBox, SearchField, StyledListItem } from '../../index';
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
+ export default {
10
+ title: 'Experimental/recipes/ScrollableListView'
11
+ };
12
+ export var ScrollableListView = function ScrollableListView() {
13
+ var unfilteredItems = [{
14
+ key: 'Aardvark',
15
+ name: 'Aardvark',
16
+ id: '1'
17
+ }, {
18
+ key: 'Kangaroo',
19
+ name: 'Kangaroo',
20
+ id: '2'
21
+ }, {
22
+ key: 'Snake',
23
+ name: 'Snake',
24
+ id: '3'
25
+ }, {
26
+ key: 'Dog',
27
+ name: 'Dog',
28
+ id: '4'
29
+ }, {
30
+ key: 'Cat',
31
+ name: 'Cat',
32
+ id: '5'
33
+ }, {
34
+ key: 'Mouse',
35
+ name: 'Mouse',
36
+ id: '6'
37
+ }, {
38
+ key: 'Jaguar',
39
+ name: 'Jaguar',
40
+ id: '7'
41
+ }, {
42
+ key: 'Elephant',
43
+ name: 'Elephant',
44
+ id: '7'
45
+ }];
46
+ var _useState = useState(''),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ value = _useState2[0],
49
+ setValue = _useState2[1];
50
+ var _useState3 = useState(unfilteredItems),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ scrollableListViewItems = _useState4[0],
53
+ setScrollableListViewItems = _useState4[1];
54
+ var filterItems = function filterItems(input) {
55
+ var filtered = _filterInstanceProperty(unfilteredItems).call(unfilteredItems, function (obj) {
56
+ var _context;
57
+ return _includesInstanceProperty(_context = obj.name.toLowerCase()).call(_context, input.toLowerCase());
58
+ });
59
+ setScrollableListViewItems(filtered);
60
+ };
61
+ var onChangeInput = function onChangeInput(input) {
62
+ setValue(input);
63
+ filterItems(input);
64
+ };
65
+ return ___EmotionJSX(Box, null, ___EmotionJSX(SearchField, {
66
+ value: value,
67
+ onChange: onChangeInput
68
+ }), ___EmotionJSX(ScrollBox, {
69
+ maxHeight: 450,
70
+ hasShadows: true
71
+ }, ___EmotionJSX(ListView, {
72
+ items: scrollableListViewItems
73
+ }, function (item) {
74
+ return ___EmotionJSX(Item, {
75
+ key: item.name,
76
+ textValue: item.name,
77
+ listItemProps: {
78
+ variant: 'listViewItem.styledListItem'
79
+ }
80
+ }, ___EmotionJSX(StyledListItem, {
81
+ details: {
82
+ icon: FormSelectIcon,
83
+ text: item.name
84
+ }
85
+ }, ___EmotionJSX(ListItemEditButton, null), ___EmotionJSX(ListItemMenu, null, ___EmotionJSX(Item, {
86
+ key: "enable"
87
+ }, "Enable user"), ___EmotionJSX(Item, {
88
+ key: "disable"
89
+ }, "Disable user"), ___EmotionJSX(Item, {
90
+ key: "delete"
91
+ }, "Delete user"))));
92
+ })));
93
+ };
@@ -0,0 +1,117 @@
1
+ import AccountIcon from '@pingux/mdi-react/AccountIcon';
2
+ import FormSelectIcon from '@pingux/mdi-react/FormSelectIcon';
3
+ export var items = [{
4
+ email: 'dburkitt5@columbia.edu',
5
+ firstName: 'Nicola',
6
+ lastName: 'Burkitt',
7
+ hasIcon: true,
8
+ icon: AccountIcon,
9
+ linkProps: {
10
+ href: 'https://pingidentity.com/'
11
+ }
12
+ }, {
13
+ email: 'idixie2@elegantthemes.com',
14
+ firstName: 'Cacilia',
15
+ lastName: 'Dixie',
16
+ hasIcon: true,
17
+ icon: FormSelectIcon,
18
+ linkProps: {
19
+ href: 'https://pingidentity.com/'
20
+ }
21
+ }, {
22
+ email: 'dfowler0@rambler.ru',
23
+ firstName: 'Stavro',
24
+ lastName: 'Fowler',
25
+ hasIcon: true,
26
+ icon: AccountIcon,
27
+ linkProps: {
28
+ href: 'https://pingidentity.com/'
29
+ }
30
+ }, {
31
+ email: 'jgolde8@jimdo.com',
32
+ firstName: 'Celisse',
33
+ lastName: 'Golde',
34
+ hasIcon: true,
35
+ icon: FormSelectIcon
36
+ }, {
37
+ email: 'shearst9@answers.com',
38
+ firstName: 'Jeth',
39
+ lastName: 'Hearst',
40
+ hasIcon: true,
41
+ icon: AccountIcon,
42
+ linkProps: {
43
+ href: 'https://pingidentity.com/'
44
+ }
45
+ }, {
46
+ email: 'ajinaa@mapquest.com',
47
+ firstName: 'Kaycee',
48
+ lastName: 'Jina',
49
+ hasIcon: true,
50
+ icon: AccountIcon,
51
+ linkProps: {
52
+ href: 'https://pingidentity.com/'
53
+ }
54
+ }, {
55
+ email: 'vmalster4@biblegateway.com',
56
+ firstName: 'Lorry',
57
+ lastName: 'Malster',
58
+ hasIcon: true,
59
+ icon: AccountIcon,
60
+ linkProps: {
61
+ href: 'https://pingidentity.com/'
62
+ }
63
+ }, {
64
+ email: 'yphipp6@yellowpages.com',
65
+ firstName: 'Stanley',
66
+ lastName: 'Phipp',
67
+ hasIcon: true,
68
+ icon: AccountIcon,
69
+ linkProps: {
70
+ href: 'https://pingidentity.com/'
71
+ }
72
+ }, {
73
+ email: 'mskilbeck3@bbc.co.uk',
74
+ firstName: 'Gradey',
75
+ lastName: 'Skilbeck',
76
+ hasIcon: true,
77
+ icon: AccountIcon,
78
+ linkProps: {
79
+ href: 'https://pingidentity.com/'
80
+ }
81
+ }, {
82
+ email: 'dstebbing1@msu.edu',
83
+ firstName: 'Marnia',
84
+ lastName: 'Stebbing',
85
+ hasIcon: true,
86
+ icon: AccountIcon,
87
+ linkProps: {
88
+ href: 'https://pingidentity.com/'
89
+ }
90
+ }, {
91
+ email: 'lsterley7@lulu.com',
92
+ firstName: 'Joshua',
93
+ lastName: 'Sterley',
94
+ hasIcon: true,
95
+ icon: AccountIcon,
96
+ linkProps: {
97
+ href: 'https://pingidentity.com/'
98
+ }
99
+ }, {
100
+ email: 'luttleyb@hugedomains.com',
101
+ firstName: 'Jarrod',
102
+ lastName: 'Uttley',
103
+ hasIcon: true,
104
+ icon: AccountIcon,
105
+ linkProps: {
106
+ href: 'https://pingidentity.com/'
107
+ }
108
+ }, {
109
+ email: 'lidelc@yelp.com',
110
+ firstName: 'Andromache',
111
+ lastName: 'Idel',
112
+ hasIcon: true,
113
+ icon: AccountIcon,
114
+ linkProps: {
115
+ href: 'https://pingidentity.com/'
116
+ }
117
+ }];
package/lib/index.js CHANGED
@@ -166,4 +166,10 @@ export { default as DataTable } from './components/DataTable';
166
166
  export * from './components/DataTable';
167
167
  export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
168
168
  export { Item, Section, useOverlayTriggerState } from 'react-stately';
169
- export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow } from 'react-stately';
169
+ export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow } from 'react-stately';
170
+
171
+ // Experimental
172
+ export { default as ListItemEditButton } from './experimental/StyledListItem/controls/ListItemEditButton';
173
+ export { default as ListItemMenu } from './experimental/StyledListItem/controls/ListItemMenu';
174
+ export { default as ListItemSwitchField } from './experimental/StyledListItem/controls/ListItemSwitchField';
175
+ export { default as StyledListItem } from './experimental/StyledListItem/StyledListItem';
@@ -14,7 +14,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
14
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
15
15
  import omit from 'lodash/omit';
16
16
  import PropTypes from 'prop-types';
17
- var descriptions = {
17
+ export var descriptions = {
18
18
  ariaControls: 'Identifies the element (or elements) whose contents or presence are controlled by the current element.',
19
19
  ariaDescribedby: 'Identifies the element (or elements) that describes the object.',
20
20
  ariaDetails: 'Identifies the element (or elements) that provide a detailed, extended description for the object.',
@@ -0,0 +1,29 @@
1
+ var _context;
2
+ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
3
+ export var docArgTypes = {
4
+ bool: 'boolean',
5
+ node: 'node',
6
+ string: 'string',
7
+ stringArray: 'string[]',
8
+ text: 'text',
9
+ func: 'func',
10
+ object: 'object'
11
+ };
12
+ export var stringOrStringArray = _concatInstanceProperty(_context = "".concat(docArgTypes.string, " | ")).call(_context, docArgTypes.stringArray);
13
+ export var booleanArg = {
14
+ control: {
15
+ type: docArgTypes.bool
16
+ },
17
+ defaultValue: false,
18
+ type: {
19
+ summary: docArgTypes.bool
20
+ }
21
+ };
22
+ export var funcArg = {
23
+ control: {
24
+ type: null
25
+ },
26
+ type: {
27
+ summary: docArgTypes.func
28
+ }
29
+ };