@pingux/astro 2.7.1 → 2.8.0-alpha.1

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 (90) hide show
  1. package/lib/cjs/components/Button/Button.js +2 -55
  2. package/lib/cjs/components/Button/Button.stories.js +12 -30
  3. package/lib/cjs/components/Button/buttonAttributes.js +109 -0
  4. package/lib/cjs/components/Calendar/Calendar.test.js +6 -6
  5. package/lib/cjs/components/Calendar/CalendarCell.js +6 -5
  6. package/lib/cjs/components/IconButton/IconButton.js +2 -38
  7. package/lib/cjs/components/IconButton/IconButton.stories.js +2 -34
  8. package/lib/cjs/components/IconButton/iconButtonAttributes.js +100 -0
  9. package/lib/cjs/components/ListItem/ListItem.js +1 -0
  10. package/lib/cjs/components/ListView/ListView.js +0 -9
  11. package/lib/cjs/components/ListView/ListView.stories.js +39 -104
  12. package/lib/cjs/components/ListViewItem/ListViewItem.js +14 -5
  13. package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +6 -1
  14. package/lib/cjs/components/Menu/Menu.js +7 -60
  15. package/lib/cjs/components/Menu/Menu.stories.js +2 -56
  16. package/lib/cjs/components/Menu/menuAttributes.js +104 -0
  17. package/lib/cjs/components/SwitchField/SwitchField.js +12 -54
  18. package/lib/cjs/components/SwitchField/SwitchField.stories.js +2 -34
  19. package/lib/cjs/components/SwitchField/SwitchField.test.js +4 -5
  20. package/lib/cjs/components/SwitchField/switchFieldAttributes.js +191 -0
  21. package/lib/cjs/experimental/ListViewItem/ListViewItem.js +157 -0
  22. package/lib/cjs/experimental/ListViewItem/ListViewItem.stories.js +136 -0
  23. package/lib/cjs/experimental/ListViewItem/ListViewItem.test.js +77 -0
  24. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.js +34 -0
  25. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +31 -0
  26. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.test.js +25 -0
  27. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemMenu.js +37 -0
  28. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemMenu.stories.js +36 -0
  29. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemMenu.test.js +59 -0
  30. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.js +32 -0
  31. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.stories.js +41 -0
  32. package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.test.js +25 -0
  33. package/lib/cjs/experimental/ListViewItem/listViewItemAttributes.js +81 -0
  34. package/lib/cjs/experimental/SaveBar/SaveBar.js +85 -0
  35. package/lib/cjs/experimental/SaveBar/SaveBar.stories.js +101 -0
  36. package/lib/cjs/experimental/SaveBar/SaveBar.test.js +94 -0
  37. package/lib/cjs/experimental/SaveBar/index.js +14 -0
  38. package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +359 -0
  39. package/lib/cjs/experimental/recipes/ScrollableListView.stories.js +104 -0
  40. package/lib/cjs/experimental/recipes/items.js +77 -0
  41. package/lib/cjs/index.js +64 -51
  42. package/lib/cjs/utils/docUtils/ariaAttributes.js +2 -1
  43. package/lib/cjs/utils/docUtils/docArgTypes.js +41 -0
  44. package/lib/cjs/utils/docUtils/hoverProps.js +7 -2
  45. package/lib/components/Button/Button.js +2 -55
  46. package/lib/components/Button/Button.stories.js +13 -31
  47. package/lib/components/Button/buttonAttributes.js +101 -0
  48. package/lib/components/Calendar/Calendar.test.js +6 -6
  49. package/lib/components/Calendar/CalendarCell.js +6 -5
  50. package/lib/components/IconButton/IconButton.js +2 -38
  51. package/lib/components/IconButton/IconButton.stories.js +2 -34
  52. package/lib/components/IconButton/iconButtonAttributes.js +91 -0
  53. package/lib/components/ListItem/ListItem.js +2 -1
  54. package/lib/components/ListView/ListView.js +0 -9
  55. package/lib/components/ListView/ListView.stories.js +40 -106
  56. package/lib/components/ListViewItem/ListViewItem.js +12 -4
  57. package/lib/components/ListViewItem/ListViewItem.styles.js +6 -1
  58. package/lib/components/Menu/Menu.js +7 -60
  59. package/lib/components/Menu/Menu.stories.js +2 -57
  60. package/lib/components/Menu/menuAttributes.js +95 -0
  61. package/lib/components/SwitchField/SwitchField.js +14 -55
  62. package/lib/components/SwitchField/SwitchField.stories.js +2 -34
  63. package/lib/components/SwitchField/SwitchField.test.js +4 -5
  64. package/lib/components/SwitchField/switchFieldAttributes.js +182 -0
  65. package/lib/experimental/ListViewItem/ListViewItem.js +144 -0
  66. package/lib/experimental/ListViewItem/ListViewItem.stories.js +122 -0
  67. package/lib/experimental/ListViewItem/ListViewItem.test.js +74 -0
  68. package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.js +25 -0
  69. package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +21 -0
  70. package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.test.js +22 -0
  71. package/lib/experimental/ListViewItem/controls/ListViewItemMenu.js +28 -0
  72. package/lib/experimental/ListViewItem/controls/ListViewItemMenu.stories.js +26 -0
  73. package/lib/experimental/ListViewItem/controls/ListViewItemMenu.test.js +56 -0
  74. package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.js +23 -0
  75. package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.stories.js +32 -0
  76. package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.test.js +22 -0
  77. package/lib/experimental/ListViewItem/listViewItemAttributes.js +72 -0
  78. package/lib/experimental/SaveBar/SaveBar.js +76 -0
  79. package/lib/experimental/SaveBar/SaveBar.stories.js +88 -0
  80. package/lib/experimental/SaveBar/SaveBar.test.js +91 -0
  81. package/lib/experimental/SaveBar/index.js +1 -0
  82. package/lib/experimental/recipes/ListAndPanel.stories.js +342 -0
  83. package/lib/experimental/recipes/ScrollableListView.stories.js +89 -0
  84. package/lib/experimental/recipes/items.js +68 -0
  85. package/lib/index.js +7 -3
  86. package/lib/utils/docUtils/ariaAttributes.js +1 -1
  87. package/lib/utils/docUtils/docArgTypes.js +29 -0
  88. package/lib/utils/docUtils/hoverProps.js +7 -2
  89. package/package.json +1 -1
  90. package/NOTICE.html +0 -12804
@@ -0,0 +1,91 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import axeTest from '../../utils/testUtils/testAxe';
4
+ import { render, screen } from '../../utils/testUtils/testWrapper';
5
+ import SaveBar from '.';
6
+ import { jsx as ___EmotionJSX } from "@emotion/react";
7
+ var testId = 'test-SaveBar';
8
+ var saveButtonProps = {
9
+ key: 'save button',
10
+ text: 'Save',
11
+ onPress: function onPress() {
12
+ return alert('Save button pressed');
13
+ }
14
+ };
15
+ var cancelButtonProps = {
16
+ key: 'cancel button',
17
+ text: 'Cancel',
18
+ onPress: function onPress() {
19
+ return alert('Cancel button pressed');
20
+ }
21
+ };
22
+ var refreshButtonProps = {
23
+ key: 'refresh button',
24
+ text: 'Refresh',
25
+ onPress: function onPress() {
26
+ return alert('Refresh button pressed');
27
+ }
28
+ };
29
+ var defaultProps = {
30
+ 'data-testid': testId,
31
+ saveButtonProps: saveButtonProps,
32
+ cancelButtonProps: cancelButtonProps
33
+ };
34
+ var getComponent = function getComponent() {
35
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
+ return render(___EmotionJSX(SaveBar, _extends({}, defaultProps, props)));
37
+ };
38
+ var getComponentCustomChildren = function getComponentCustomChildren() {
39
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
40
+ return render(___EmotionJSX(SaveBar, _extends({}, defaultProps, props), ___EmotionJSX("button", null, "custom text"), ___EmotionJSX("button", null, "Also custom text")));
41
+ };
42
+ var getComponentTextChildren = function getComponentTextChildren() {
43
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
+ return render(___EmotionJSX(SaveBar, props, "custom text"));
45
+ };
46
+ axeTest(getComponent);
47
+ afterEach(function () {
48
+ jest.resetAllMocks();
49
+ });
50
+ test('SaveBar does render', function () {
51
+ getComponent({});
52
+ var element = screen.getByTestId(testId);
53
+ expect(element).toBeInTheDocument();
54
+ });
55
+ test('renders save and cancel buttons', function () {
56
+ getComponent();
57
+ var saveButton = screen.getByText(saveButtonProps.text);
58
+ expect(saveButton).toBeInTheDocument();
59
+ var cancelButton = screen.getByText(cancelButtonProps.text);
60
+ expect(cancelButton).toBeInTheDocument();
61
+ });
62
+ test('renders all three buttons', function () {
63
+ getComponent({
64
+ refreshButtonProps: refreshButtonProps
65
+ });
66
+ var saveButton = screen.getByText(saveButtonProps.text);
67
+ expect(saveButton).toBeInTheDocument();
68
+ var refreshButton = screen.getByText(refreshButtonProps.text);
69
+ expect(refreshButton).toBeInTheDocument();
70
+ var cancelButton = screen.getByText(cancelButtonProps.text);
71
+ expect(cancelButton).toBeInTheDocument();
72
+ });
73
+ test('renders custom children', function () {
74
+ getComponentCustomChildren();
75
+ var firstButton = screen.getByText('custom text');
76
+ var secondButton = screen.getByText('Also custom text');
77
+ expect(firstButton).toBeInTheDocument();
78
+ expect(secondButton).toBeInTheDocument();
79
+ });
80
+ test('renders custom text', function () {
81
+ getComponentTextChildren();
82
+ var firstText = screen.getByText('custom text');
83
+ expect(firstText).toBeInTheDocument();
84
+ });
85
+ test('isJustifiedRight reverses order of button', function () {
86
+ getComponent({
87
+ isJustifiedRight: true
88
+ });
89
+ var buttons = screen.getAllByRole('button');
90
+ expect(buttons[0]).toHaveAttribute('data-id', 'cancel-button');
91
+ });
@@ -0,0 +1 @@
1
+ export { default } from './SaveBar';
@@ -0,0 +1,342 @@
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, ListView, ListViewItem, ListViewItemMenu, ListViewItemSwitchField, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, 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
+ data: {
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
+ // icon: AccountIcon,
130
+ // },
131
+ // ]
132
+
133
+ var _useState = useState(),
134
+ _useState2 = _slicedToArray(_useState, 2),
135
+ selectedItemId = _useState2[0],
136
+ setSelectedItemId = _useState2[1];
137
+ var _useState3 = useState(),
138
+ _useState4 = _slicedToArray(_useState3, 2),
139
+ selectedKeys = _useState4[0],
140
+ setSelectedKeys = _useState4[1];
141
+ var _useOverlayPanelState = useOverlayPanelState(),
142
+ panelState = _useOverlayPanelState.state,
143
+ onPanelClose = _useOverlayPanelState.onClose;
144
+ var panelTriggerRef = useRef();
145
+ var closePanelHandler = function closePanelHandler() {
146
+ onPanelClose(panelState, panelTriggerRef);
147
+ setSelectedItemId(-1);
148
+ setSelectedKeys([]);
149
+ };
150
+ var selectItemHandler = function selectItemHandler(e) {
151
+ if (e.size) {
152
+ setSelectedItemId(_findIndexInstanceProperty(items).call(items, function (item) {
153
+ return item.email === e.currentKey;
154
+ }));
155
+ setSelectedKeys([e.currentKey]);
156
+ panelState.open();
157
+ } else {
158
+ closePanelHandler();
159
+ }
160
+ };
161
+ return ___EmotionJSX(Box, {
162
+ sx: sx.wrapper
163
+ }, title, ___EmotionJSX(SearchField, {
164
+ position: "fixed",
165
+ mb: "lg",
166
+ mt: "lg",
167
+ width: "400px",
168
+ placeholder: "Search",
169
+ "aria-label": "search"
170
+ }), ___EmotionJSX(Separator, {
171
+ margin: 0
172
+ }), ___EmotionJSX(ListView, {
173
+ items: items,
174
+ onSelectionChange: selectItemHandler,
175
+ ref: panelTriggerRef,
176
+ selectedKeys: selectedKeys
177
+ }, function (item) {
178
+ var _context;
179
+ return ___EmotionJSX(Item, {
180
+ key: item.email
181
+ }, ___EmotionJSX(ListElement, {
182
+ data: {
183
+ text: _concatInstanceProperty(_context = "".concat(item.lastName, ", ")).call(_context, item.firstName),
184
+ subtext: item.email,
185
+ icon: item.icon
186
+ }
187
+ }));
188
+ }), ___EmotionJSX(OverlayPanel, {
189
+ isOpen: panelState.isOpen,
190
+ state: panelState,
191
+ triggerRef: panelTriggerRef,
192
+ p: 0,
193
+ size: "large"
194
+ }, panelState.isOpen && ___EmotionJSX(FocusScope, {
195
+ contain: true,
196
+ restoreFocus: true,
197
+ autoFocus: true
198
+ }, ___EmotionJSX(PanelHeader, {
199
+ item: selectedItemId >= 0 ? items[selectedItemId] : [],
200
+ onClosePanel: closePanelHandler
201
+ }), ___EmotionJSX(Separator, {
202
+ margin: 0,
203
+ sx: sx.separator
204
+ }), ___EmotionJSX(Box, {
205
+ sx: sx.tabsWrapper
206
+ }, ___EmotionJSX(Tabs, {
207
+ tabListProps: {
208
+ justifyContent: 'center'
209
+ },
210
+ tabPanelProps: {
211
+ sx: {
212
+ position: 'relative'
213
+ }
214
+ }
215
+ }, ___EmotionJSX(Tab, {
216
+ title: "Profile"
217
+ }, selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(IconButton, {
218
+ variant: "inverted",
219
+ "aria-label": "pencil icon button",
220
+ sx: sx.iconButton
221
+ }, ___EmotionJSX(Icon, {
222
+ icon: PencilIcon,
223
+ size: "sm"
224
+ })), ___EmotionJSX(Text, {
225
+ sx: sx.itemLabel
226
+ }, "Full Name"), ___EmotionJSX(Text, {
227
+ sx: sx.itemValue
228
+ }, items[selectedItemId].firstName, ' ', items[selectedItemId].lastName), ___EmotionJSX(Text, {
229
+ sx: sx.itemLabel
230
+ }, "First Name"), ___EmotionJSX(Text, {
231
+ sx: sx.itemValue
232
+ }, items[selectedItemId].firstName), ___EmotionJSX(Text, {
233
+ sx: sx.itemLabel
234
+ }, "Last Name"), ___EmotionJSX(Text, {
235
+ sx: sx.itemValue
236
+ }, items[selectedItemId].lastName), ___EmotionJSX(Text, {
237
+ sx: sx.itemLabel
238
+ }, "Email"), ___EmotionJSX(Text, {
239
+ sx: sx.itemValue
240
+ }, items[selectedItemId].email))), ___EmotionJSX(Tab, {
241
+ title: "Group Memberships"
242
+ }, ___EmotionJSX(Text, null, "Group Memberships")), ___EmotionJSX(Tab, {
243
+ title: "Account Info"
244
+ }, ___EmotionJSX(Text, null, "Account Info")))))));
245
+ };
246
+ export var ListElement = function ListElement(_ref) {
247
+ var _ref$data = _ref.data,
248
+ data = _ref$data === void 0 ? {
249
+ subtext: 'dburkitt5@columbia.edu',
250
+ text: 'Burkitt, Nicola',
251
+ icon: AccountIcon
252
+ } : _ref$data;
253
+ var listItemRef = useRef();
254
+ var _useOverlappingMenuHo = useOverlappingMenuHoverState({
255
+ listItemRef: listItemRef
256
+ }),
257
+ handleHoverEnd = _useOverlappingMenuHo.handleHoverEnd,
258
+ handleHoverStart = _useOverlappingMenuHo.handleHoverStart,
259
+ handleMenuHoverEnd = _useOverlappingMenuHo.handleMenuHoverEnd,
260
+ handleMouseMove = _useOverlappingMenuHo.handleMouseMove,
261
+ isHovered = _useOverlappingMenuHo.isHovered;
262
+ var text = data.text,
263
+ subtext = data.subtext,
264
+ icon = data.icon;
265
+ return ___EmotionJSX(ListViewItem, {
266
+ data: {
267
+ icon: icon,
268
+ subtext: subtext,
269
+ text: text
270
+ },
271
+ isHovered: isHovered,
272
+ onHoverEnd: handleHoverEnd,
273
+ onHoverStart: handleHoverStart,
274
+ onMouseMove: handleMouseMove,
275
+ ref: listItemRef
276
+ }, ___EmotionJSX(ListViewItemSwitchField, null), ___EmotionJSX(ListViewItemMenu, {
277
+ onAction: handleHoverEnd,
278
+ onHoverEnd: handleMenuHoverEnd,
279
+ onHoverStart: handleHoverStart
280
+ }, ___EmotionJSX(Item, {
281
+ key: "enable"
282
+ }, "Enable user"), ___EmotionJSX(Item, {
283
+ key: "disable"
284
+ }, "Disable user"), ___EmotionJSX(Item, {
285
+ key: "delete"
286
+ }, "Delete user")));
287
+ };
288
+ export var PanelHeader = function PanelHeader(_ref2) {
289
+ var _context2;
290
+ var _ref2$item = _ref2.item,
291
+ item = _ref2$item === void 0 ? {
292
+ email: 'dburkitt5@columbia.edu',
293
+ icon: AccountIcon,
294
+ firstName: 'John',
295
+ lastName: 'Doe'
296
+ } : _ref2$item,
297
+ onClosePanel = _ref2.onClosePanel;
298
+ var email = item.email,
299
+ firstName = item.firstName,
300
+ lastName = item.lastName;
301
+ var text = _concatInstanceProperty(_context2 = "".concat(lastName, ", ")).call(_context2, firstName);
302
+ return ___EmotionJSX(Box, {
303
+ sx: sx.panelHeader.container
304
+ }, ___EmotionJSX(Box, {
305
+ isRow: true,
306
+ sx: sx.panelHeader.wrapper
307
+ }, ___EmotionJSX(Box, {
308
+ isRow: true,
309
+ sx: sx.panelHeader.data
310
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
311
+ variant: "bodyStrong",
312
+ sx: sx.panelHeader.title
313
+ }, text), ___EmotionJSX(Text, {
314
+ variant: "subtitle",
315
+ sx: sx.panelHeader.subtitle
316
+ }, email))), ___EmotionJSX(Box, {
317
+ isRow: true,
318
+ sx: sx.panelHeader.controls
319
+ }, ___EmotionJSX(SwitchField, {
320
+ "aria-label": "active user",
321
+ isDefaultSelected: true,
322
+ alignSelf: "center",
323
+ mr: "xs"
324
+ }), ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(IconButton, {
325
+ "aria-label": "more"
326
+ }, ___EmotionJSX(Icon, {
327
+ icon: MoreVertIcon,
328
+ size: "md"
329
+ })), ___EmotionJSX(Menu, null, ___EmotionJSX(Item, {
330
+ key: "enable"
331
+ }, "Enable user"), ___EmotionJSX(Item, {
332
+ key: "disable"
333
+ }, "Disable user"), ___EmotionJSX(Item, {
334
+ key: "delete"
335
+ }, "Delete user"))), ___EmotionJSX(IconButton, {
336
+ "aria-label": "close icon button",
337
+ onPress: onClosePanel
338
+ }, ___EmotionJSX(Icon, {
339
+ size: "sm",
340
+ icon: CloseIcon
341
+ })))));
342
+ };
@@ -0,0 +1,89 @@
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, ListView, ListViewItem, ListViewItemEditButton, ListViewItemMenu, ScrollBox, SearchField } 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
+ }, ___EmotionJSX(ListViewItem, {
77
+ data: {
78
+ icon: FormSelectIcon,
79
+ text: item.name
80
+ }
81
+ }, ___EmotionJSX(ListViewItemEditButton, null), ___EmotionJSX(ListViewItemMenu, null, ___EmotionJSX(Item, {
82
+ key: "enable"
83
+ }, "Enable user"), ___EmotionJSX(Item, {
84
+ key: "disable"
85
+ }, "Disable user"), ___EmotionJSX(Item, {
86
+ key: "delete"
87
+ }, "Delete user"))));
88
+ })));
89
+ };
@@ -0,0 +1,68 @@
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
+ icon: AccountIcon
8
+ }, {
9
+ email: 'idixie2@elegantthemes.com',
10
+ firstName: 'Cacilia',
11
+ lastName: 'Dixie',
12
+ icon: FormSelectIcon
13
+ }, {
14
+ email: 'dfowler0@rambler.ru',
15
+ firstName: 'Stavro',
16
+ lastName: 'Fowler',
17
+ icon: AccountIcon
18
+ }, {
19
+ email: 'jgolde8@jimdo.com',
20
+ firstName: 'Celisse',
21
+ lastName: 'Golde',
22
+ icon: FormSelectIcon
23
+ }, {
24
+ email: 'shearst9@answers.com',
25
+ firstName: 'Jeth',
26
+ lastName: 'Hearst',
27
+ icon: AccountIcon
28
+ }, {
29
+ email: 'ajinaa@mapquest.com',
30
+ firstName: 'Kaycee',
31
+ lastName: 'Jina',
32
+ icon: AccountIcon
33
+ }, {
34
+ email: 'vmalster4@biblegateway.com',
35
+ firstName: 'Lorry',
36
+ lastName: 'Malster',
37
+ icon: AccountIcon
38
+ }, {
39
+ email: 'yphipp6@yellowpages.com',
40
+ firstName: 'Stanley',
41
+ lastName: 'Phipp',
42
+ icon: AccountIcon
43
+ }, {
44
+ email: 'mskilbeck3@bbc.co.uk',
45
+ firstName: 'Gradey',
46
+ lastName: 'Skilbeck',
47
+ icon: AccountIcon
48
+ }, {
49
+ email: 'dstebbing1@msu.edu',
50
+ firstName: 'Marnia',
51
+ lastName: 'Stebbing',
52
+ icon: AccountIcon
53
+ }, {
54
+ email: 'lsterley7@lulu.com',
55
+ firstName: 'Joshua',
56
+ lastName: 'Sterley',
57
+ icon: AccountIcon
58
+ }, {
59
+ email: 'luttleyb@hugedomains.com',
60
+ firstName: 'Jarrod',
61
+ lastName: 'Uttley',
62
+ icon: AccountIcon
63
+ }, {
64
+ email: 'lidelc@yelp.com',
65
+ firstName: 'Andromache',
66
+ lastName: 'Idel',
67
+ icon: AccountIcon
68
+ }];
package/lib/index.js CHANGED
@@ -83,8 +83,6 @@ export { default as ListItem } from './components/ListItem';
83
83
  export * from './components/ListItem';
84
84
  export { default as ListView } from './components/ListView';
85
85
  export * from './components/ListView';
86
- export { default as ListViewItem } from './components/ListViewItem';
87
- export * from './components/ListViewItem';
88
86
  export { default as Loader } from './components/Loader';
89
87
  export * from './components/Loader';
90
88
  export { default as Menu } from './components/Menu';
@@ -166,4 +164,10 @@ export { default as DataTable } from './components/DataTable';
166
164
  export * from './components/DataTable';
167
165
  export { OverlayProvider, useOverlayPosition, useOverlayTrigger } from 'react-aria';
168
166
  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';
167
+ export { TableBody as DataTableBody, Cell as DataTableCell, Column as DataTableColumn, TableHeader as DataTableHeader, Row as DataTableRow } from 'react-stately';
168
+
169
+ // Experimental
170
+ export { default as ListViewItemEditButton } from './experimental/ListViewItem/controls/ListViewItemEditButton';
171
+ export { default as ListViewItemMenu } from './experimental/ListViewItem/controls/ListViewItemMenu';
172
+ export { default as ListViewItemSwitchField } from './experimental/ListViewItem/controls/ListViewItemSwitchField';
173
+ export { default as ListViewItem } from './experimental/ListViewItem/ListViewItem';
@@ -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
+ };
@@ -11,6 +11,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
11
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
12
  import PropTypes from 'prop-types';
13
13
  var descriptions = {
14
+ isHovered: 'If the item is hovered',
14
15
  onHoverStart: 'Handler that is called when a hover interaction starts.',
15
16
  onHoverEnd: 'Handler that is called when a hover interaction ends.',
16
17
  onHoverChange: 'Handler that is called when the hover state changes.'
@@ -27,6 +28,9 @@ export var baseDocSettings = {
27
28
  }
28
29
  };
29
30
  export var onHoverArgTypes = {
31
+ isHovered: _objectSpread({
32
+ description: descriptions.isHovered
33
+ }, baseDocSettings),
30
34
  'onHoverStart': _objectSpread({
31
35
  description: descriptions.onHoverStart
32
36
  }, baseDocSettings),
@@ -38,7 +42,8 @@ export var onHoverArgTypes = {
38
42
  }, baseDocSettings)
39
43
  };
40
44
  export var onHoverPropTypes = {
41
- onHoverStart: PropTypes.func,
45
+ isHovered: PropTypes.bool,
46
+ onHoverChange: PropTypes.func,
42
47
  onHoverEnd: PropTypes.func,
43
- onHoverChange: PropTypes.func
48
+ onHoverStart: PropTypes.func
44
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.7.1",
3
+ "version": "2.8.0-alpha.1",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",