@pingux/astro 2.16.1-alpha.0 → 2.17.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.
- package/lib/cjs/components/ListView/ListView.js +1 -1
- package/lib/cjs/components/ListView/ListView.mdx +4 -1
- package/lib/cjs/components/ListView/ListView.stories.js +52 -98
- package/lib/cjs/components/ListView/ListViewItem.js +126 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +81 -100
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.mdx +4 -4
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.stories.js +32 -37
- package/lib/cjs/{experimental → components}/ListViewItem/ListViewItem.test.js +3 -3
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.test.js +2 -2
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.js +8 -8
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemMenu.test.js +2 -3
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.stories.js +5 -5
- package/lib/cjs/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.test.js +2 -2
- package/lib/cjs/experimental/PageHeader/PageHeader.js +14 -14
- package/lib/cjs/experimental/PageHeader/PageHeader.stories.js +27 -11
- package/lib/cjs/experimental/PageHeader/PageHeader.test.js +14 -5
- package/lib/cjs/experimental/PanelHeader/PanelHeader.js +1 -1
- package/lib/cjs/experimental/PanelHeader/PanelHeader.stories.js +1 -1
- package/lib/cjs/index.d.ts +4 -4
- package/lib/cjs/index.js +8 -8
- package/lib/cjs/recipes/ListAndPanel.stories.js +195 -267
- package/lib/cjs/recipes/MaskedValue.stories.js +8 -1
- package/lib/cjs/{experimental/recipes → recipes}/ScrollableListView.stories.js +2 -2
- package/lib/cjs/utils/designUtils/figmaLinks.js +3 -0
- package/lib/components/ListView/ListView.js +1 -1
- package/lib/components/ListView/ListView.mdx +4 -1
- package/lib/components/ListView/ListView.stories.js +47 -93
- package/lib/components/ListView/ListViewItem.js +113 -0
- package/lib/components/ListViewItem/ListViewItem.js +78 -99
- package/lib/{experimental → components}/ListViewItem/ListViewItem.mdx +4 -4
- package/lib/{experimental → components}/ListViewItem/ListViewItem.stories.js +7 -12
- package/lib/{experimental → components}/ListViewItem/ListViewItem.test.js +1 -1
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.js +4 -4
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemEditButton.test.js +1 -1
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.js +5 -5
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemMenu.test.js +1 -2
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.js +4 -4
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.stories.js +3 -3
- package/lib/{experimental → components}/ListViewItem/controls/ListViewItemSwitchField.test.js +1 -1
- package/lib/experimental/PageHeader/PageHeader.js +14 -14
- package/lib/experimental/PageHeader/PageHeader.stories.js +25 -10
- package/lib/experimental/PageHeader/PageHeader.test.js +14 -5
- package/lib/experimental/PanelHeader/PanelHeader.js +1 -1
- package/lib/experimental/PanelHeader/PanelHeader.stories.js +1 -1
- package/lib/index.js +4 -4
- package/lib/recipes/ListAndPanel.stories.js +186 -260
- package/lib/recipes/MaskedValue.stories.js +7 -0
- package/lib/{experimental/recipes → recipes}/ScrollableListView.stories.js +2 -2
- package/lib/utils/designUtils/figmaLinks.js +3 -0
- package/package.json +1 -1
- package/lib/cjs/components/ListItem/ListItem.stories.js +0 -189
- package/lib/cjs/experimental/ListView/ListView.mdx +0 -47
- package/lib/cjs/experimental/ListView/ListView.stories.js +0 -742
- package/lib/cjs/experimental/ListViewItem/ListViewItem.js +0 -108
- package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +0 -359
- package/lib/cjs/recipes/ScrollableListView.stories.hidden.js +0 -136
- package/lib/cjs/recipes/StatsCircle.stories.js +0 -37
- package/lib/components/ListItem/ListItem.stories.js +0 -174
- package/lib/experimental/ListView/ListView.mdx +0 -47
- package/lib/experimental/ListView/ListView.stories.js +0 -729
- package/lib/experimental/ListViewItem/ListViewItem.js +0 -93
- package/lib/experimental/recipes/ListAndPanel.stories.js +0 -342
- package/lib/recipes/ScrollableListView.stories.hidden.js +0 -121
- package/lib/recipes/StatsCircle.stories.js +0 -27
- /package/lib/cjs/{experimental → components}/ListViewItem/listViewItemAttributes.js +0 -0
- /package/lib/cjs/{experimental/recipes → recipes}/items.js +0 -0
- /package/lib/{experimental → components}/ListViewItem/listViewItemAttributes.js +0 -0
- /package/lib/{experimental/recipes → recipes}/items.js +0 -0
@@ -1,174 +0,0 @@
|
|
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 _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
11
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
12
|
-
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; }
|
13
|
-
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; }
|
14
|
-
import React, { useState } from 'react';
|
15
|
-
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
16
|
-
import MoreVertIcon from '@pingux/mdi-react/MoreVertIcon';
|
17
|
-
import { withDesign } from 'storybook-addon-designs';
|
18
|
-
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
19
|
-
import { Box, Icon, IconButton, ListItem, Separator, Text } from '../../index';
|
20
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
|
21
|
-
import { onHoverArgTypes } from '../../utils/docUtils/hoverProps';
|
22
|
-
import ListItemReadme from './ListItem.mdx';
|
23
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
24
|
-
export default {
|
25
|
-
title: 'Components/ListItem',
|
26
|
-
component: ListItem,
|
27
|
-
decorators: [withDesign],
|
28
|
-
parameters: {
|
29
|
-
docs: {
|
30
|
-
page: function page() {
|
31
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ListItemReadme, null), ___EmotionJSX(DocsLayout, null));
|
32
|
-
},
|
33
|
-
source: {
|
34
|
-
type: 'code'
|
35
|
-
}
|
36
|
-
}
|
37
|
-
},
|
38
|
-
argTypes: _objectSpread({}, onHoverArgTypes)
|
39
|
-
};
|
40
|
-
export var Default = function Default(args) {
|
41
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Separator, {
|
42
|
-
margin: 0
|
43
|
-
}), ___EmotionJSX(ListItem, args, ___EmotionJSX(Box, {
|
44
|
-
isRow: true,
|
45
|
-
mr: "auto",
|
46
|
-
alignSelf: "center"
|
47
|
-
}, ___EmotionJSX(Icon, {
|
48
|
-
icon: AccountIcon,
|
49
|
-
alignSelf: "center",
|
50
|
-
mr: "sm",
|
51
|
-
color: "accent.40",
|
52
|
-
size: 32,
|
53
|
-
title: {
|
54
|
-
name: 'Account Icon'
|
55
|
-
}
|
56
|
-
}), ___EmotionJSX(Text, {
|
57
|
-
variant: "itemTitle",
|
58
|
-
alignSelf: "center"
|
59
|
-
}, "Fons Vernall")), ___EmotionJSX(Box, {
|
60
|
-
isRow: true,
|
61
|
-
alignSelf: "center"
|
62
|
-
}, ___EmotionJSX(IconButton, {
|
63
|
-
"aria-label": "filter"
|
64
|
-
}, ___EmotionJSX(Icon, {
|
65
|
-
icon: MoreVertIcon,
|
66
|
-
size: "sm",
|
67
|
-
color: "neutral.20",
|
68
|
-
title: {
|
69
|
-
name: 'More Vertical Icon'
|
70
|
-
}
|
71
|
-
})))), ___EmotionJSX(Separator, {
|
72
|
-
margin: 0
|
73
|
-
}));
|
74
|
-
};
|
75
|
-
Default.parameters = {
|
76
|
-
design: {
|
77
|
-
type: 'figma',
|
78
|
-
url: FIGMA_LINKS.listItem["default"]
|
79
|
-
}
|
80
|
-
};
|
81
|
-
export var WithSubtitle = function WithSubtitle(args) {
|
82
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Separator, {
|
83
|
-
margin: 0
|
84
|
-
}), ___EmotionJSX(ListItem, args, ___EmotionJSX(Box, {
|
85
|
-
isRow: true,
|
86
|
-
mr: "auto",
|
87
|
-
alignSelf: "center"
|
88
|
-
}, ___EmotionJSX(Icon, {
|
89
|
-
icon: AccountIcon,
|
90
|
-
alignSelf: "center",
|
91
|
-
mr: "sm",
|
92
|
-
color: "accent.40",
|
93
|
-
size: 32,
|
94
|
-
title: {
|
95
|
-
name: 'Account Icon'
|
96
|
-
}
|
97
|
-
}), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
98
|
-
variant: "itemTitle"
|
99
|
-
}, "Fons Vernall"), ___EmotionJSX(Text, {
|
100
|
-
variant: "itemSubtitle",
|
101
|
-
mt: 1
|
102
|
-
}, "fvernall0@google.it"))), ___EmotionJSX(Box, {
|
103
|
-
isRow: true,
|
104
|
-
alignSelf: "center"
|
105
|
-
}, ___EmotionJSX(IconButton, {
|
106
|
-
"aria-label": "filter"
|
107
|
-
}, ___EmotionJSX(Icon, {
|
108
|
-
icon: MoreVertIcon,
|
109
|
-
size: "sm",
|
110
|
-
color: "neutral.20",
|
111
|
-
title: {
|
112
|
-
name: 'More Vertical Icon'
|
113
|
-
}
|
114
|
-
})))), ___EmotionJSX(Separator, {
|
115
|
-
margin: 0
|
116
|
-
}));
|
117
|
-
};
|
118
|
-
export var WithHoverHandlers = function WithHoverHandlers(args) {
|
119
|
-
var _useState = useState(false),
|
120
|
-
_useState2 = _slicedToArray(_useState, 2),
|
121
|
-
isHovered = _useState2[0],
|
122
|
-
setIsHovered = _useState2[1];
|
123
|
-
var handleHoverChange = function handleHoverChange() {
|
124
|
-
setIsHovered(function (previousIsHovered) {
|
125
|
-
return !previousIsHovered;
|
126
|
-
});
|
127
|
-
};
|
128
|
-
var sx = function sx(shouldTranslate) {
|
129
|
-
return {
|
130
|
-
transform: "".concat(shouldTranslate ? 'translate(15px)' : 'translate(0)')
|
131
|
-
};
|
132
|
-
};
|
133
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Separator, {
|
134
|
-
margin: 0
|
135
|
-
}), ___EmotionJSX(ListItem, _extends({}, args, {
|
136
|
-
onHoverEnd: handleHoverChange,
|
137
|
-
onHoverStart: handleHoverChange
|
138
|
-
}), ___EmotionJSX(Box, {
|
139
|
-
isRow: true,
|
140
|
-
mr: "auto",
|
141
|
-
alignSelf: "center"
|
142
|
-
}, ___EmotionJSX(Icon, {
|
143
|
-
icon: AccountIcon,
|
144
|
-
alignSelf: "center",
|
145
|
-
mr: "sm",
|
146
|
-
color: "accent.40",
|
147
|
-
size: 32,
|
148
|
-
title: {
|
149
|
-
name: 'Account Icon'
|
150
|
-
}
|
151
|
-
}), ___EmotionJSX(Box, {
|
152
|
-
sx: sx(isHovered)
|
153
|
-
}, ___EmotionJSX(Text, {
|
154
|
-
variant: "itemTitle"
|
155
|
-
}, "Fons Vernall"), ___EmotionJSX(Text, {
|
156
|
-
variant: "itemSubtitle",
|
157
|
-
mt: 1
|
158
|
-
}, "fvernall0@google.it"))), ___EmotionJSX(Box, {
|
159
|
-
isRow: true,
|
160
|
-
alignSelf: "center"
|
161
|
-
}, ___EmotionJSX(IconButton, {
|
162
|
-
size: 26,
|
163
|
-
"aria-label": "filter"
|
164
|
-
}, ___EmotionJSX(Icon, {
|
165
|
-
icon: MoreVertIcon,
|
166
|
-
size: 20,
|
167
|
-
color: "neutral.20",
|
168
|
-
title: {
|
169
|
-
name: 'More Vertical Icon'
|
170
|
-
}
|
171
|
-
})))), ___EmotionJSX(Separator, {
|
172
|
-
margin: 0
|
173
|
-
}));
|
174
|
-
};
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
2
|
-
|
3
|
-
<Meta title="Components/ListView/ListView" />
|
4
|
-
|
5
|
-
# ListView
|
6
|
-
|
7
|
-
ListViews are used to display a list of items. Users can select, view, or edit items in this list.
|
8
|
-
This virtualized component supports asynchronous data in infinitely scrollable lists.
|
9
|
-
|
10
|
-
This component should:
|
11
|
-
- Be used to list items that contain a significant amount of information within them.
|
12
|
-
- Be able to access ListItem information.
|
13
|
-
|
14
|
-
It shouldn’t be used to list items that only have a single piece of information.
|
15
|
-
|
16
|
-
### Required Components
|
17
|
-
|
18
|
-
This component requires [ListViewItem](./?path=/story/experimental-listviewitem--default).
|
19
|
-
|
20
|
-
### Accessibility
|
21
|
-
|
22
|
-
This component should adhere to the [WAI-ARIA ListBox](https://www.w3.org/WAI/ARIA/apg/patterns/listbox/) accessibility guidelines.
|
23
|
-
|
24
|
-
#### Keyboard Navigation
|
25
|
-
|
26
|
-
These keys provide additional functionality to the component.
|
27
|
-
|
28
|
-
| Key | Functions |
|
29
|
-
| ---- | ---- |
|
30
|
-
| Space or Enter | Selects the item. |
|
31
|
-
| Tab | Focuses item and follows the page tab sequence. |
|
32
|
-
| Shift + Tab | Moves focus to the previous focusable component. |
|
33
|
-
| Arrow keys | Can be used to move the selection in the menu. |
|
34
|
-
| Home(Fn + Right Arrow Key) Or Control/Command + Home | Shifts the focus to the first row. |
|
35
|
-
| End(Fn + Left Arrow Key) Or Control/Command + End | Shifts the focus to the last visible row. |
|
36
|
-
|
37
|
-
#### Screen Readers
|
38
|
-
|
39
|
-
This component uses the following attributes to assist screen readers:
|
40
|
-
- The **`aria-label`** attribute is used to provide an accessible name.
|
41
|
-
- The **`aria-rowcount`** and **`aria-columncount`** attributes are used to indicate the total number of rows and columns in the grid structure.
|
42
|
-
- The **`aria-multiselectable`** attribute is used to indicate that users can toggle between items in the grid.
|
43
|
-
- Each ListViewItem uses the **`aria-rowindex`** attribute, which defines a component's position in the total number of rows.
|
44
|
-
- Each item also uses the aria-label, **`aria-colindex`** attributes to indicate the component’s column position and aria-selected to indicate the currently selected state.
|
45
|
-
|
46
|
-
#### NOTES:
|
47
|
-
- See the [ListAndPanel](./?path=/story/experimental-recipes-listandpanel--list-and-panel) and [ScrollableListView](./?path=/story/experimental-recipes-scrollablelistview--scrollable-list-view) recipes for more detailed examples.
|