@pingux/astro 2.243.0 → 2.244.1-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/stories/ListViewNextGenComponent.js +2 -1
- package/lib/cjs/components/ListViewItem/ListViewItem.d.ts +5 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +0 -2
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.d.ts +199 -0
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.d.ts +10 -0
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.js +3 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.d.ts +11 -0
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.js +3 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.d.ts +11 -0
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.js +3 -5
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.d.ts +4 -0
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +15 -8
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.styles.d.ts +80 -0
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChartAttributes.d.ts +73 -0
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChartAttributes.js +1 -15
- package/lib/cjs/components/ListViewItem/controls/chart/chartData.d.ts +4 -0
- package/lib/cjs/components/ListViewItem/index.d.ts +1 -0
- package/lib/cjs/components/ListViewItem/listViewItemAttributes.d.ts +24 -0
- package/lib/cjs/components/ListViewItem/listViewItemAttributes.js +1 -29
- package/lib/cjs/components/PanelHeader/PanelHeader.js +19 -4
- package/lib/cjs/components/TableBase/TableBaseEmptyState.js +3 -2
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +11 -0
- package/lib/cjs/types/listViewItem.d.ts +94 -0
- package/lib/cjs/types/listViewItem.js +5 -0
- package/lib/cjs/types/tableBase.d.ts +2 -0
- package/lib/components/ListView/stories/ListViewNextGenComponent.js +2 -1
- package/lib/components/ListViewItem/ListViewItem.js +0 -2
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.js +2 -4
- package/lib/components/ListViewItem/controls/ListViewItemMenu.js +2 -4
- package/lib/components/ListViewItem/controls/ListViewItemSwitchField.js +2 -6
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +15 -8
- package/lib/components/ListViewItem/controls/chart/ListViewItemChartAttributes.js +0 -13
- package/lib/components/ListViewItem/listViewItemAttributes.js +2 -29
- package/lib/components/PanelHeader/PanelHeader.js +19 -4
- package/lib/components/TableBase/TableBaseEmptyState.js +3 -2
- package/lib/types/index.js +1 -0
- package/lib/types/listViewItem.js +1 -0
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ const getColor = index => {
|
|
|
29
29
|
return colors[lastDigit];
|
|
30
30
|
};
|
|
31
31
|
const ListViewNextGen = () => {
|
|
32
|
-
const chartContainerRef = (0, _react.useRef)();
|
|
32
|
+
const chartContainerRef = (0, _react.useRef)(null);
|
|
33
33
|
const Controls = () => (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_2.ListViewItemSwitchField, null), (0, _react2.jsx)(_2.ListViewItemMenu, null, (0, _react2.jsx)(_2.Item, {
|
|
34
34
|
key: "enable"
|
|
35
35
|
}, "Enable user"), (0, _react2.jsx)(_2.Item, {
|
|
@@ -114,6 +114,7 @@ const ListViewNextGen = () => {
|
|
|
114
114
|
color: 'text.secondary'
|
|
115
115
|
},
|
|
116
116
|
iconWrapperProps: {
|
|
117
|
+
size: 'sm',
|
|
117
118
|
color: 'cyan'
|
|
118
119
|
}
|
|
119
120
|
}, (0, _react2.jsx)(_2.ListViewItemChart, {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListViewItemProps } from '../../types/listViewItem';
|
|
3
|
+
export declare const LIST_ITEM_ICON = "-list-item-icon";
|
|
4
|
+
declare const ListViewItem: React.ForwardRefExoticComponent<ListViewItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export default ListViewItem;
|
|
@@ -11,7 +11,6 @@ var _interactions = require("@react-aria/interactions");
|
|
|
11
11
|
var _ = require("../..");
|
|
12
12
|
var _hooks = require("../../hooks");
|
|
13
13
|
var _pendoID = require("../../utils/devUtils/constants/pendoID");
|
|
14
|
-
var _listViewItemAttributes = require("./listViewItemAttributes");
|
|
15
14
|
var _react2 = require("@emotion/react");
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
16
|
const LIST_ITEM_ICON = exports.LIST_ITEM_ICON = '-list-item-icon';
|
|
@@ -128,6 +127,5 @@ const ListViewItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
128
127
|
variant: "listViewItem.controls"
|
|
129
128
|
}, children)));
|
|
130
129
|
});
|
|
131
|
-
ListViewItem.propTypes = _listViewItemAttributes.listViewItemPropTypes;
|
|
132
130
|
ListViewItem.displayName = displayName;
|
|
133
131
|
var _default = exports.default = ListViewItem;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
container: {
|
|
3
|
+
display: string;
|
|
4
|
+
padding: string;
|
|
5
|
+
flex: string;
|
|
6
|
+
minHeight: string;
|
|
7
|
+
justifyContent: string;
|
|
8
|
+
bg: string;
|
|
9
|
+
outline: string;
|
|
10
|
+
'&.is-selected': {
|
|
11
|
+
bg: string;
|
|
12
|
+
'& li': {
|
|
13
|
+
bg: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
'&.is-hovered': {
|
|
17
|
+
bg: string;
|
|
18
|
+
cursor: string;
|
|
19
|
+
};
|
|
20
|
+
'&.is-focused': {
|
|
21
|
+
boxShadow: string;
|
|
22
|
+
};
|
|
23
|
+
'&.has-separator': {
|
|
24
|
+
borderBottom: string;
|
|
25
|
+
borderBottomColor: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
controls: {
|
|
29
|
+
alignItems: string;
|
|
30
|
+
alignSelf: string;
|
|
31
|
+
flexShrink: number;
|
|
32
|
+
ml: string;
|
|
33
|
+
pr: string;
|
|
34
|
+
};
|
|
35
|
+
iconWrapper: {
|
|
36
|
+
cursor: string;
|
|
37
|
+
display: string;
|
|
38
|
+
flex: string;
|
|
39
|
+
ml: string;
|
|
40
|
+
};
|
|
41
|
+
imageContainer: {
|
|
42
|
+
width: string;
|
|
43
|
+
flexShrink: number;
|
|
44
|
+
display: string;
|
|
45
|
+
justifyContent: string;
|
|
46
|
+
};
|
|
47
|
+
imageWrapper: {
|
|
48
|
+
ml: string;
|
|
49
|
+
cursor: string;
|
|
50
|
+
display: string;
|
|
51
|
+
flex: string;
|
|
52
|
+
};
|
|
53
|
+
leftOfDataWrapper: {
|
|
54
|
+
ml: number;
|
|
55
|
+
cursor: string;
|
|
56
|
+
display: string;
|
|
57
|
+
flex: string;
|
|
58
|
+
};
|
|
59
|
+
linkedViewContainer: {
|
|
60
|
+
minHeight: string;
|
|
61
|
+
height: string;
|
|
62
|
+
'& li': {
|
|
63
|
+
bg: string;
|
|
64
|
+
};
|
|
65
|
+
'&.has-inset-separator': {
|
|
66
|
+
'&:after': {
|
|
67
|
+
content: string;
|
|
68
|
+
position: string;
|
|
69
|
+
width: string;
|
|
70
|
+
right: number;
|
|
71
|
+
bottom: number;
|
|
72
|
+
borderBottom: string;
|
|
73
|
+
borderBottomColor: string;
|
|
74
|
+
};
|
|
75
|
+
'&.is-focused': {
|
|
76
|
+
'&:after': {
|
|
77
|
+
content: string;
|
|
78
|
+
position: string;
|
|
79
|
+
width: string;
|
|
80
|
+
right: number;
|
|
81
|
+
bottom: number;
|
|
82
|
+
borderBottom: string;
|
|
83
|
+
borderBottomColor: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
display: string;
|
|
88
|
+
padding: string;
|
|
89
|
+
flex: string;
|
|
90
|
+
justifyContent: string;
|
|
91
|
+
bg: string;
|
|
92
|
+
outline: string;
|
|
93
|
+
'&.is-selected': {
|
|
94
|
+
bg: string;
|
|
95
|
+
'& li': {
|
|
96
|
+
bg: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
'&.is-hovered': {
|
|
100
|
+
bg: string;
|
|
101
|
+
cursor: string;
|
|
102
|
+
};
|
|
103
|
+
'&.is-focused': {
|
|
104
|
+
boxShadow: string;
|
|
105
|
+
};
|
|
106
|
+
'&.has-separator': {
|
|
107
|
+
borderBottom: string;
|
|
108
|
+
borderBottomColor: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
rightOfData: {
|
|
112
|
+
alignSelf: string;
|
|
113
|
+
flexShrink: number;
|
|
114
|
+
};
|
|
115
|
+
styledContainer: {
|
|
116
|
+
m: string;
|
|
117
|
+
minHeight: string;
|
|
118
|
+
'&.is-hovered': {
|
|
119
|
+
bg: string;
|
|
120
|
+
cursor: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
styledListItem: {
|
|
124
|
+
minHeight: number;
|
|
125
|
+
padding: number;
|
|
126
|
+
display: string;
|
|
127
|
+
flex: string;
|
|
128
|
+
justifyContent: string;
|
|
129
|
+
bg: string;
|
|
130
|
+
outline: string;
|
|
131
|
+
'&.is-selected': {
|
|
132
|
+
bg: string;
|
|
133
|
+
'& li': {
|
|
134
|
+
bg: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
'&.is-hovered': {
|
|
138
|
+
bg: string;
|
|
139
|
+
cursor: string;
|
|
140
|
+
};
|
|
141
|
+
'&.is-focused': {
|
|
142
|
+
boxShadow: string;
|
|
143
|
+
};
|
|
144
|
+
'&.has-separator': {
|
|
145
|
+
borderBottom: string;
|
|
146
|
+
borderBottomColor: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
loaderContainer: {
|
|
150
|
+
bg: string;
|
|
151
|
+
p: string;
|
|
152
|
+
position: string;
|
|
153
|
+
top: string;
|
|
154
|
+
left: string;
|
|
155
|
+
borderWidth: string;
|
|
156
|
+
borderColor: string;
|
|
157
|
+
borderStyle: string;
|
|
158
|
+
borderRadius: string;
|
|
159
|
+
};
|
|
160
|
+
expandableFocusContainer: {
|
|
161
|
+
px: string;
|
|
162
|
+
outline: string;
|
|
163
|
+
border: string;
|
|
164
|
+
'&.is-focused': {
|
|
165
|
+
boxShadow: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
expandableItemBody: {
|
|
169
|
+
px: string;
|
|
170
|
+
};
|
|
171
|
+
expandableStyledListItem: {
|
|
172
|
+
display: string;
|
|
173
|
+
padding: string;
|
|
174
|
+
flex: string;
|
|
175
|
+
flexGrow: number;
|
|
176
|
+
justifyContent: string;
|
|
177
|
+
bg: string;
|
|
178
|
+
minHeight: string;
|
|
179
|
+
py: string;
|
|
180
|
+
px: string;
|
|
181
|
+
'&.is-hovered': {
|
|
182
|
+
bg: string;
|
|
183
|
+
cursor: string;
|
|
184
|
+
};
|
|
185
|
+
'&.is-focused': {
|
|
186
|
+
boxShadow: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
expandableRow: {
|
|
190
|
+
'&.has-separator': {
|
|
191
|
+
borderBottom: string;
|
|
192
|
+
borderBottomColor: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
expandIcon: {
|
|
196
|
+
color: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ListViewItemEditButton is one of several styled control components that can be used as a child
|
|
4
|
+
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
5
|
+
* Its a wrapper component around the [IconButton](./?path=/docs/components-iconbutton--docs),
|
|
6
|
+
* intended to make matching specs easy. Most props available to the IconButton are also available
|
|
7
|
+
* to ListItemEditButton.
|
|
8
|
+
*/
|
|
9
|
+
declare const ListViewItemEditButton: React.ForwardRefExoticComponent<Omit<import("../../..").IconButtonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default ListViewItemEditButton;
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _CreateIcon = _interopRequireDefault(require("@pingux/mdi-react/CreateIcon"));
|
|
10
10
|
var _ = require("../../..");
|
|
11
|
-
var _iconButtonAttributes = require("../../IconButton/iconButtonAttributes");
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
13
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
13
|
/**
|
|
@@ -17,7 +16,9 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
17
16
|
* Its a wrapper component around the [IconButton](./?path=/docs/components-iconbutton--docs),
|
|
18
17
|
* intended to make matching specs easy. Most props available to the IconButton are also available
|
|
19
18
|
* to ListItemEditButton.
|
|
20
|
-
*/
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const ListViewItemEditButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
21
22
|
return (0, _react2.jsx)(_.Box, {
|
|
22
23
|
ref: ref,
|
|
23
24
|
ml: "sm"
|
|
@@ -26,6 +27,5 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
26
27
|
size: "md"
|
|
27
28
|
})));
|
|
28
29
|
});
|
|
29
|
-
ListViewItemEditButton.propTypes = _iconButtonAttributes.iconButtonPropTypes;
|
|
30
30
|
ListViewItemEditButton.displayName = 'ListViewItemEditButton';
|
|
31
31
|
var _default = exports.default = ListViewItemEditButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListViewItemMenuProps } from '../../../types/listViewItem';
|
|
3
|
+
/**
|
|
4
|
+
* ListViewItemEditButton is one of several styled control components that can be used as a child
|
|
5
|
+
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
6
|
+
* Its a wrapper component around the [PopoverMenu](./?path=/docs/components-popovermenu--docs)
|
|
7
|
+
* and [Menu](./?path=/docs/components-menu--docs) component, intended to make matching
|
|
8
|
+
* specs easy. Most props available to the Menu component are available to ListItemMenu.
|
|
9
|
+
*/
|
|
10
|
+
declare const ListViewItemMenu: React.ForwardRefExoticComponent<ListViewItemMenuProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export default ListViewItemMenu;
|
|
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _ = require("../../..");
|
|
11
11
|
var _hooks = require("../../../hooks");
|
|
12
|
-
var _menuAttributes = require("../../Menu/menuAttributes");
|
|
13
12
|
var _react2 = require("@emotion/react");
|
|
14
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
14
|
/**
|
|
@@ -18,7 +17,9 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
18
17
|
* Its a wrapper component around the [PopoverMenu](./?path=/docs/components-popovermenu--docs)
|
|
19
18
|
* and [Menu](./?path=/docs/components-menu--docs) component, intended to make matching
|
|
20
19
|
* specs easy. Most props available to the Menu component are available to ListItemMenu.
|
|
21
|
-
*/
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const ListViewItemMenu = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
22
23
|
children,
|
|
23
24
|
iconButtonProps,
|
|
24
25
|
...others
|
|
@@ -40,6 +41,5 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
40
41
|
}
|
|
41
42
|
})), (0, _react2.jsx)(_.Menu, others, children));
|
|
42
43
|
});
|
|
43
|
-
ListViewItemMenu.propTypes = _menuAttributes.menuPropTypes;
|
|
44
44
|
ListViewItemMenu.displayName = 'ListViewItemMenu';
|
|
45
45
|
var _default = exports.default = ListViewItemMenu;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListViewItemSwitchFieldProps } from '../../../types/listViewItem';
|
|
3
|
+
/**
|
|
4
|
+
* ListViewItemSwitchField is one of several styled control components that can be used as a child
|
|
5
|
+
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
6
|
+
* Its a wrapper component around the [SwitchField](./?path=/docs/form-switchfield--docs),
|
|
7
|
+
* intended to make matching specs easy. Most props available to the SwitchField are also
|
|
8
|
+
* available to ListItemEditButton.
|
|
9
|
+
*/
|
|
10
|
+
declare const ListViewItemSwitchField: React.ForwardRefExoticComponent<ListViewItemSwitchFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export default ListViewItemSwitchField;
|
|
@@ -10,15 +10,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _ = require("../../..");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
-
// import { switchFieldPropTypes } from '../../SwitchField/switchFieldAttributes';
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* ListViewItemSwitchField is one of several styled control components that can be used as a child
|
|
17
15
|
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
18
16
|
* Its a wrapper component around the [SwitchField](./?path=/docs/form-switchfield--docs),
|
|
19
17
|
* intended to make matching specs easy. Most props available to the SwitchField are also
|
|
20
18
|
* available to ListItemEditButton.
|
|
21
|
-
*/
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const ListViewItemSwitchField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
22
22
|
return (0, _react2.jsx)(_.SwitchField, (0, _extends2.default)({
|
|
23
23
|
ref: ref,
|
|
24
24
|
role: "group",
|
|
@@ -28,6 +28,4 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
28
28
|
}, props));
|
|
29
29
|
});
|
|
30
30
|
ListViewItemSwitchField.displayName = 'ListViewItemSwitchField';
|
|
31
|
-
|
|
32
|
-
// ListViewItemSwitchField.propTypes = switchFieldPropTypes;
|
|
33
31
|
var _default = exports.default = ListViewItemSwitchField;
|
|
@@ -14,9 +14,13 @@ var _useResizeObserver = _interopRequireDefault(require("use-resize-observer"));
|
|
|
14
14
|
var _hooks = require("../../../../hooks");
|
|
15
15
|
var _index = require("../../../../index");
|
|
16
16
|
var _colors = require("../../../../styles/colors");
|
|
17
|
-
var _ListViewItemChartAttributes = require("./ListViewItemChartAttributes");
|
|
18
17
|
var _react2 = require("@emotion/react");
|
|
19
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
|
+
// `variant` keys into the theme's style objects but is not part of recharts'
|
|
20
|
+
// prop types; these aliases keep the extra prop typecheckable without
|
|
21
|
+
// changing what is passed through at runtime.
|
|
22
|
+
const TypedResponsiveContainer = _recharts.ResponsiveContainer;
|
|
23
|
+
const TypedLineChart = _recharts.LineChart;
|
|
20
24
|
const ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
21
25
|
const {
|
|
22
26
|
buttonProps,
|
|
@@ -41,15 +45,19 @@ const ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
41
45
|
const {
|
|
42
46
|
visuallyHiddenProps
|
|
43
47
|
} = (0, _reactAria.useVisuallyHidden)();
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
// Before the observer's first measurement, width is undefined; the old JS
|
|
49
|
+
// compared `undefined <= n` (false), so treat unmeasured as infinitely wide.
|
|
50
|
+
const isTablet = (0, _react.useMemo)(() => (width ?? Number.POSITIVE_INFINITY) <= tabletBreakPoint, [tabletBreakPoint, width]);
|
|
51
|
+
const isMobile = (0, _react.useMemo)(() => (width ?? Number.POSITIVE_INFINITY) <= mobileBreakPoint, [mobileBreakPoint, width]);
|
|
46
52
|
const hideIfTablet = (0, _react.useCallback)(() => isTablet && visuallyHiddenProps, [isTablet, visuallyHiddenProps]);
|
|
47
53
|
const hideIfMobile = (0, _react.useCallback)(() => isMobile && visuallyHiddenProps, [isMobile, visuallyHiddenProps]);
|
|
48
54
|
(0, _react.useEffect)(() => {
|
|
49
55
|
async function setAriaLabel() {
|
|
50
56
|
if (containerRef && containerRef.current) {
|
|
51
|
-
const [rechartsWrapper] =
|
|
52
|
-
rechartsWrapper
|
|
57
|
+
const [rechartsWrapper] = Array.from(containerRef.current.getElementsByClassName('recharts-wrapper'));
|
|
58
|
+
if (rechartsWrapper && ariaLabel) {
|
|
59
|
+
rechartsWrapper.setAttribute('aria-label', ariaLabel);
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
setAriaLabel();
|
|
@@ -85,9 +93,9 @@ const ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
85
93
|
}, (0, _react2.jsx)(_index.Box, {
|
|
86
94
|
variant: "lisViewItemChart.chartContainer",
|
|
87
95
|
id: ariaLabel
|
|
88
|
-
}, (0, _react2.jsx)(
|
|
96
|
+
}, (0, _react2.jsx)(TypedResponsiveContainer, {
|
|
89
97
|
variant: "lisViewItemChart.responsiveContainer"
|
|
90
|
-
}, (0, _react2.jsx)(
|
|
98
|
+
}, (0, _react2.jsx)(TypedLineChart, {
|
|
91
99
|
data: chartData,
|
|
92
100
|
variant: "lisViewItemChart.chart"
|
|
93
101
|
}, (0, _react2.jsx)(_recharts.Line, {
|
|
@@ -104,6 +112,5 @@ const ListViewItemChart = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
104
112
|
variant: "variants.lisViewItemChart.trend"
|
|
105
113
|
}, trend))), (0, _react2.jsx)(_index.Tooltip, null, tooltipText)));
|
|
106
114
|
});
|
|
107
|
-
ListViewItemChart.propTypes = _ListViewItemChartAttributes.listViewItemChartPropTypes;
|
|
108
115
|
ListViewItemChart.displayName = 'ListViewItemChart';
|
|
109
116
|
var _default = exports.default = ListViewItemChart;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
chart: {
|
|
3
|
+
width: string;
|
|
4
|
+
height: string;
|
|
5
|
+
};
|
|
6
|
+
responsiveContainer: {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
9
|
+
};
|
|
10
|
+
chartContainer: {
|
|
11
|
+
width: string;
|
|
12
|
+
height: string;
|
|
13
|
+
};
|
|
14
|
+
divider: {
|
|
15
|
+
backgroundColor: string;
|
|
16
|
+
height: string;
|
|
17
|
+
width: string;
|
|
18
|
+
};
|
|
19
|
+
chartLabel: {
|
|
20
|
+
fontSize: string;
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
trendContainer: {
|
|
24
|
+
ml: string;
|
|
25
|
+
width: string;
|
|
26
|
+
};
|
|
27
|
+
trend: {
|
|
28
|
+
color: string;
|
|
29
|
+
fontSize: string;
|
|
30
|
+
fontWeight: number;
|
|
31
|
+
whiteSpace: string;
|
|
32
|
+
};
|
|
33
|
+
chartButton: {
|
|
34
|
+
display: string;
|
|
35
|
+
flexDirection: string;
|
|
36
|
+
alignItems: string;
|
|
37
|
+
color: string;
|
|
38
|
+
background: string;
|
|
39
|
+
cursor: string;
|
|
40
|
+
height: string;
|
|
41
|
+
padding: number;
|
|
42
|
+
ml: string;
|
|
43
|
+
pr: string;
|
|
44
|
+
border: string;
|
|
45
|
+
'&:hover': {
|
|
46
|
+
backgroundColor: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
titleContainer: {
|
|
50
|
+
mr: string;
|
|
51
|
+
display: string;
|
|
52
|
+
flexDirection: string;
|
|
53
|
+
alignItems: string;
|
|
54
|
+
};
|
|
55
|
+
title: {
|
|
56
|
+
textOverflow: string;
|
|
57
|
+
overflow: string;
|
|
58
|
+
whiteSpace: string;
|
|
59
|
+
fontSize: string;
|
|
60
|
+
color: string;
|
|
61
|
+
maxWidth: string;
|
|
62
|
+
};
|
|
63
|
+
content: {
|
|
64
|
+
height: string;
|
|
65
|
+
justifyContent: string;
|
|
66
|
+
display: string;
|
|
67
|
+
flexDirection: string;
|
|
68
|
+
alignItems: string;
|
|
69
|
+
};
|
|
70
|
+
count: {
|
|
71
|
+
color: string;
|
|
72
|
+
fontSize: string;
|
|
73
|
+
fontWeight: number;
|
|
74
|
+
};
|
|
75
|
+
countLabel: {
|
|
76
|
+
fontSize: string;
|
|
77
|
+
color: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const listViewItemChartArgTypes: {
|
|
2
|
+
buttonProps: any;
|
|
3
|
+
chartData: {
|
|
4
|
+
description: string;
|
|
5
|
+
type: {
|
|
6
|
+
summary: any;
|
|
7
|
+
};
|
|
8
|
+
control: string;
|
|
9
|
+
};
|
|
10
|
+
chartDataKey: {
|
|
11
|
+
description: string;
|
|
12
|
+
type: {
|
|
13
|
+
summary: any;
|
|
14
|
+
};
|
|
15
|
+
control: string;
|
|
16
|
+
};
|
|
17
|
+
chartLabel: {
|
|
18
|
+
description: string;
|
|
19
|
+
type: {
|
|
20
|
+
summary: any;
|
|
21
|
+
};
|
|
22
|
+
control: string;
|
|
23
|
+
};
|
|
24
|
+
mobileBreakPoint: {
|
|
25
|
+
description: string;
|
|
26
|
+
type: {
|
|
27
|
+
summary: any;
|
|
28
|
+
};
|
|
29
|
+
control: string;
|
|
30
|
+
};
|
|
31
|
+
tabletBreakPoint: {
|
|
32
|
+
description: string;
|
|
33
|
+
type: {
|
|
34
|
+
summary: any;
|
|
35
|
+
};
|
|
36
|
+
control: string;
|
|
37
|
+
};
|
|
38
|
+
title: {
|
|
39
|
+
description: string;
|
|
40
|
+
type: {
|
|
41
|
+
summary: any;
|
|
42
|
+
};
|
|
43
|
+
control: string;
|
|
44
|
+
};
|
|
45
|
+
tooltipText: {
|
|
46
|
+
description: string;
|
|
47
|
+
type: {
|
|
48
|
+
summary: any;
|
|
49
|
+
};
|
|
50
|
+
control: string;
|
|
51
|
+
};
|
|
52
|
+
contentCount: {
|
|
53
|
+
description: string;
|
|
54
|
+
type: {
|
|
55
|
+
summary: any;
|
|
56
|
+
};
|
|
57
|
+
control: string;
|
|
58
|
+
};
|
|
59
|
+
contentCountLabel: {
|
|
60
|
+
description: string;
|
|
61
|
+
type: {
|
|
62
|
+
summary: any;
|
|
63
|
+
};
|
|
64
|
+
control: string;
|
|
65
|
+
};
|
|
66
|
+
trend: {
|
|
67
|
+
description: string;
|
|
68
|
+
type: {
|
|
69
|
+
summary: any;
|
|
70
|
+
};
|
|
71
|
+
control: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.listViewItemChartArgTypes = void 0;
|
|
9
7
|
var _docArgTypes = require("../../../../utils/docUtils/docArgTypes");
|
|
10
8
|
var _buttonAttributes = require("../../../Button/buttonAttributes");
|
|
11
9
|
const descriptions = {
|
|
@@ -100,16 +98,4 @@ const listViewItemChartArgTypes = exports.listViewItemChartArgTypes = {
|
|
|
100
98
|
},
|
|
101
99
|
control: 'text'
|
|
102
100
|
}
|
|
103
|
-
};
|
|
104
|
-
const listViewItemChartPropTypes = exports.listViewItemChartPropTypes = {
|
|
105
|
-
chartData: _propTypes.default.arrayOf(_propTypes.default.shape({})),
|
|
106
|
-
chartLabel: _propTypes.default.string,
|
|
107
|
-
chartDataKey: _propTypes.default.string,
|
|
108
|
-
contentCount: _propTypes.default.string,
|
|
109
|
-
contentCountLabel: _propTypes.default.string,
|
|
110
|
-
mobileBreakPoint: _propTypes.default.number,
|
|
111
|
-
tabletBreakPoint: _propTypes.default.number,
|
|
112
|
-
title: _propTypes.default.string,
|
|
113
|
-
tooltipText: _propTypes.default.string,
|
|
114
|
-
trend: _propTypes.default.string
|
|
115
101
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ListViewItem';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const SharedItemArgTypes: {
|
|
2
|
+
colorId: {
|
|
3
|
+
description: string;
|
|
4
|
+
control: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
description: string;
|
|
10
|
+
type: {
|
|
11
|
+
summary: string;
|
|
12
|
+
};
|
|
13
|
+
control: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
className: {
|
|
18
|
+
description: string;
|
|
19
|
+
type: {
|
|
20
|
+
summary: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const listViewItemArgTypes: any;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.listViewItemArgTypes = exports.SharedItemArgTypes = void 0;
|
|
9
7
|
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
|
10
8
|
var _docArgTypes = require("../../utils/docUtils/docArgTypes");
|
|
11
9
|
var _hoverProps = require("../../utils/docUtils/hoverProps");
|
|
@@ -67,30 +65,4 @@ const listViewItemArgTypes = exports.listViewItemArgTypes = {
|
|
|
67
65
|
...SharedItemArgTypes,
|
|
68
66
|
..._hoverProps.onHoverArgTypes,
|
|
69
67
|
..._ariaAttributes.ariaAttributeBaseArgTypes
|
|
70
|
-
};
|
|
71
|
-
const SharedItemPropTypes = exports.SharedItemPropTypes = {
|
|
72
|
-
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
73
|
-
colorId: _propTypes.default.string,
|
|
74
|
-
data: _propTypes.default.shape({
|
|
75
|
-
icon: _propTypes.default.elementType,
|
|
76
|
-
image: _propTypes.default.shape({
|
|
77
|
-
src: _propTypes.default.string,
|
|
78
|
-
alt: _propTypes.default.string,
|
|
79
|
-
'aria-label': _propTypes.default.string
|
|
80
|
-
}),
|
|
81
|
-
subtext: _propTypes.default.string,
|
|
82
|
-
text: _propTypes.default.string
|
|
83
|
-
})
|
|
84
|
-
};
|
|
85
|
-
const listViewItemPropTypes = exports.listViewItemPropTypes = {
|
|
86
|
-
isSelected: _propTypes.default.bool,
|
|
87
|
-
linkProps: _propTypes.default.object,
|
|
88
|
-
onMetaClick: _propTypes.default.func,
|
|
89
|
-
slots: _propTypes.default.shape({
|
|
90
|
-
leftOfData: _propTypes.default.node,
|
|
91
|
-
rightOfData: _propTypes.default.node
|
|
92
|
-
}),
|
|
93
|
-
...SharedItemPropTypes,
|
|
94
|
-
..._hoverProps.onHoverPropTypes,
|
|
95
|
-
..._ariaAttributes.ariaAttributesBasePropTypes
|
|
96
68
|
};
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _hooks = require("../../hooks");
|
|
12
12
|
var _index = require("../../index");
|
|
13
|
-
var _listViewItemAttributes = require("../ListViewItem/listViewItemAttributes");
|
|
14
13
|
var _react2 = require("@emotion/react");
|
|
15
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
const PANEL_HEADER_ICON = exports.PANEL_HEADER_ICON = '-panel-header-icon';
|
|
@@ -150,12 +149,28 @@ const PanelHeader = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
150
149
|
}, children)));
|
|
151
150
|
});
|
|
152
151
|
PanelHeader.propTypes = {
|
|
153
|
-
|
|
152
|
+
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
154
153
|
colorId: _propTypes.default.string,
|
|
155
|
-
|
|
154
|
+
data: _propTypes.default.shape({
|
|
155
|
+
icon: _propTypes.default.elementType,
|
|
156
|
+
image: _propTypes.default.shape({
|
|
157
|
+
src: _propTypes.default.string,
|
|
158
|
+
alt: _propTypes.default.string,
|
|
159
|
+
'aria-label': _propTypes.default.string
|
|
160
|
+
}),
|
|
161
|
+
subtext: _propTypes.default.string,
|
|
162
|
+
text: _propTypes.default.string,
|
|
163
|
+
avatarDefaultText: _propTypes.default.string
|
|
164
|
+
}),
|
|
165
|
+
avatarProps: _propTypes.default.object,
|
|
166
|
+
headerProps: _propTypes.default.object,
|
|
167
|
+
headerWrapperProps: _propTypes.default.object,
|
|
156
168
|
iconProps: _propTypes.default.object,
|
|
169
|
+
isCopyable: _propTypes.default.bool,
|
|
157
170
|
slots: _propTypes.default.shape({
|
|
171
|
+
leftOfData: _propTypes.default.node,
|
|
158
172
|
rightOfData: _propTypes.default.node
|
|
159
|
-
})
|
|
173
|
+
}),
|
|
174
|
+
subtextProps: _propTypes.default.object
|
|
160
175
|
};
|
|
161
176
|
var _default = exports.default = PanelHeader;
|
|
@@ -18,6 +18,7 @@ const TableBaseEmptyState = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
18
18
|
descriptionLabel = 'Take action by doing x, y, z',
|
|
19
19
|
addButtonLabel,
|
|
20
20
|
onAddButtonPress,
|
|
21
|
+
iconProps,
|
|
21
22
|
...others
|
|
22
23
|
} = props;
|
|
23
24
|
return (0, _react2.jsx)(_.Box, (0, _extends2.default)({
|
|
@@ -27,7 +28,7 @@ const TableBaseEmptyState = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
27
28
|
justifyContent: "center",
|
|
28
29
|
gap: "sm",
|
|
29
30
|
py: "lg"
|
|
30
|
-
}, others), (0, _react2.jsx)(_.Icon, {
|
|
31
|
+
}, others), (0, _react2.jsx)(_.Icon, (0, _extends2.default)({
|
|
31
32
|
icon: defaultIcon,
|
|
32
33
|
color: "text.secondary",
|
|
33
34
|
size: 60,
|
|
@@ -37,7 +38,7 @@ const TableBaseEmptyState = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
|
|
|
37
38
|
sx: {
|
|
38
39
|
opacity: 0.2
|
|
39
40
|
}
|
|
40
|
-
}), (0, _react2.jsx)(_.Text, {
|
|
41
|
+
}, iconProps)), (0, _react2.jsx)(_.Text, {
|
|
41
42
|
variant: "H4",
|
|
42
43
|
as: "h4",
|
|
43
44
|
textAlign: "center"
|
package/lib/cjs/types/index.d.ts
CHANGED
package/lib/cjs/types/index.js
CHANGED
|
@@ -542,6 +542,17 @@ Object.keys(_listItem).forEach(function (key) {
|
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
});
|
|
545
|
+
var _listViewItem = require("./listViewItem");
|
|
546
|
+
Object.keys(_listViewItem).forEach(function (key) {
|
|
547
|
+
if (key === "default" || key === "__esModule") return;
|
|
548
|
+
if (key in exports && exports[key] === _listViewItem[key]) return;
|
|
549
|
+
Object.defineProperty(exports, key, {
|
|
550
|
+
enumerable: true,
|
|
551
|
+
get: function () {
|
|
552
|
+
return _listViewItem[key];
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
});
|
|
545
556
|
var _loader = require("./loader");
|
|
546
557
|
Object.keys(_loader).forEach(function (key) {
|
|
547
558
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { TestingAttributes } from './shared/test';
|
|
3
|
+
import { BoxProps } from './box';
|
|
4
|
+
import { ButtonProps } from './button';
|
|
5
|
+
import { IconProps } from './icon';
|
|
6
|
+
import { IconButtonProps } from './iconButton';
|
|
7
|
+
import { IconWrapperProps } from './iconWrapper';
|
|
8
|
+
import { MenuProps } from './menu';
|
|
9
|
+
import { HoverProps } from './shared';
|
|
10
|
+
import { SwitchFieldProps } from './switchField';
|
|
11
|
+
export interface ListViewItemData {
|
|
12
|
+
/** Icon component rendered at the start of the item. */
|
|
13
|
+
icon?: ComponentType;
|
|
14
|
+
image?: {
|
|
15
|
+
src?: string;
|
|
16
|
+
alt?: string;
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
};
|
|
19
|
+
text?: string;
|
|
20
|
+
subtext?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ListViewItemSlots {
|
|
23
|
+
leftOfData?: ReactNode;
|
|
24
|
+
rightOfData?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export interface ListViewItemLinkProps {
|
|
27
|
+
href?: string;
|
|
28
|
+
target?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ListViewItemProps extends BoxProps, HoverProps, TestingAttributes {
|
|
31
|
+
/** Object with User/Group data. */
|
|
32
|
+
data: ListViewItemData;
|
|
33
|
+
/** Provides a way to insert markup in specified places. */
|
|
34
|
+
slots?: ListViewItemSlots;
|
|
35
|
+
/** Props forwarded to the icon element. */
|
|
36
|
+
iconProps?: IconProps;
|
|
37
|
+
/** Props forwarded to the icon wrapper element. */
|
|
38
|
+
iconWrapperProps?: IconWrapperProps;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the selected state of the ListViewItem
|
|
41
|
+
*/
|
|
42
|
+
isSelected?: boolean;
|
|
43
|
+
/** Overrides the hover state; defaults to internal hover tracking. */
|
|
44
|
+
isHovered?: boolean;
|
|
45
|
+
/** When present, provides meta click functionality. */
|
|
46
|
+
linkProps?: ListViewItemLinkProps;
|
|
47
|
+
/** Deterministically derives the avatar color when no explicit color is set. */
|
|
48
|
+
colorId?: string;
|
|
49
|
+
/** Shows a separator border under the item. */
|
|
50
|
+
hasSeparator?: boolean;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
}
|
|
53
|
+
export type ListViewItemEditButtonProps = IconButtonProps;
|
|
54
|
+
export interface ListViewItemMenuProps extends MenuProps {
|
|
55
|
+
/** Props forwarded to the internal IconButton. */
|
|
56
|
+
iconButtonProps?: IconButtonProps;
|
|
57
|
+
}
|
|
58
|
+
export interface ListViewItemSwitchFieldProps extends SwitchFieldProps {
|
|
59
|
+
/** Margin-right applied to the field container. */
|
|
60
|
+
mr?: number | string;
|
|
61
|
+
}
|
|
62
|
+
export interface ListViewItemChartProps extends BoxProps {
|
|
63
|
+
/** Ref-like object pointing at the chart's container element. */
|
|
64
|
+
containerRef?: {
|
|
65
|
+
current: HTMLElement | null;
|
|
66
|
+
};
|
|
67
|
+
/** Props forwarded to the internal Button. */
|
|
68
|
+
buttonProps?: ButtonProps;
|
|
69
|
+
/** Array of data points rendered by the chart. */
|
|
70
|
+
chartData: Array<{
|
|
71
|
+
id: number;
|
|
72
|
+
fullData: number;
|
|
73
|
+
}>;
|
|
74
|
+
/** Name of the data key in `chartData` to plot. */
|
|
75
|
+
chartDataKey?: string;
|
|
76
|
+
/** Label under chart. */
|
|
77
|
+
chartLabel?: string;
|
|
78
|
+
/** Container width breakpoint to hide content (counter and counter label). */
|
|
79
|
+
tabletBreakPoint?: number;
|
|
80
|
+
/** Container width breakpoint to hide the whole chart. */
|
|
81
|
+
mobileBreakPoint?: number;
|
|
82
|
+
/** Main title of chart. */
|
|
83
|
+
title?: string;
|
|
84
|
+
/** Text inside tooltip. */
|
|
85
|
+
tooltipText?: string;
|
|
86
|
+
/** Number of events. */
|
|
87
|
+
contentCount?: string;
|
|
88
|
+
/** Label under `contentCount`. */
|
|
89
|
+
contentCountLabel?: string;
|
|
90
|
+
/** Text for trend. */
|
|
91
|
+
trend?: string;
|
|
92
|
+
/** Accessible name for the chart region. */
|
|
93
|
+
ariaLabel?: string;
|
|
94
|
+
}
|
|
@@ -6,6 +6,7 @@ import type { FocusableElement, Key, Node } from '@react-types/shared';
|
|
|
6
6
|
import type { ColumnSize, TableProps } from '@react-types/table';
|
|
7
7
|
import { TestingAttributes } from './shared/test';
|
|
8
8
|
import { BoxProps } from './box';
|
|
9
|
+
import { IconProps } from './icon';
|
|
9
10
|
import { DOMAttributes, loadingState } from './shared';
|
|
10
11
|
export type ResizeHandler = (widths: Map<Key, ColumnSize>) => void;
|
|
11
12
|
export interface BaseProp extends BoxProps, TestingAttributes, DOMAttributes {
|
|
@@ -87,6 +88,7 @@ export interface TableCaptionProps {
|
|
|
87
88
|
}
|
|
88
89
|
export interface TableBaseEmptyStateProps extends BoxProps {
|
|
89
90
|
defaultIcon?: React.ElementType;
|
|
91
|
+
iconProps?: IconProps;
|
|
90
92
|
headerLabel?: string;
|
|
91
93
|
descriptionLabel?: string;
|
|
92
94
|
addButtonLabel?: string;
|
|
@@ -21,7 +21,7 @@ const getColor = index => {
|
|
|
21
21
|
return colors[lastDigit];
|
|
22
22
|
};
|
|
23
23
|
export const ListViewNextGen = () => {
|
|
24
|
-
const chartContainerRef = useRef();
|
|
24
|
+
const chartContainerRef = useRef(null);
|
|
25
25
|
const Controls = () => ___EmotionJSX(React.Fragment, null, ___EmotionJSX(ListViewItemSwitchField, null), ___EmotionJSX(ListViewItemMenu, null, ___EmotionJSX(Item, {
|
|
26
26
|
key: "enable"
|
|
27
27
|
}, "Enable user"), ___EmotionJSX(Item, {
|
|
@@ -106,6 +106,7 @@ export const ListViewNextGen = () => {
|
|
|
106
106
|
color: 'text.secondary'
|
|
107
107
|
},
|
|
108
108
|
iconWrapperProps: {
|
|
109
|
+
size: 'sm',
|
|
109
110
|
color: 'cyan'
|
|
110
111
|
}
|
|
111
112
|
}, ___EmotionJSX(ListViewItemChart, {
|
|
@@ -4,7 +4,6 @@ import { useHover } from '@react-aria/interactions';
|
|
|
4
4
|
import { Box, Icon, IconWrapper, Image, Text } from '../..';
|
|
5
5
|
import { useGetTheme, useStatusClasses } from '../../hooks';
|
|
6
6
|
import { getPendoID } from '../../utils/devUtils/constants/pendoID';
|
|
7
|
-
import { listViewItemPropTypes } from './listViewItemAttributes';
|
|
8
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
9
8
|
export const LIST_ITEM_ICON = '-list-item-icon';
|
|
10
9
|
const displayName = 'ListViewItem';
|
|
@@ -120,6 +119,5 @@ const ListViewItem = /*#__PURE__*/forwardRef(({
|
|
|
120
119
|
variant: "listViewItem.controls"
|
|
121
120
|
}, children)));
|
|
122
121
|
});
|
|
123
|
-
ListViewItem.propTypes = listViewItemPropTypes;
|
|
124
122
|
ListViewItem.displayName = displayName;
|
|
125
123
|
export default ListViewItem;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import CreateIcon from '@pingux/mdi-react/CreateIcon';
|
|
3
3
|
import { Box, Icon, IconButton } from '../../..';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
6
5
|
/**
|
|
7
6
|
* ListViewItemEditButton is one of several styled control components that can be used as a child
|
|
8
7
|
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
@@ -10,7 +9,7 @@ import { iconButtonPropTypes } from '../../IconButton/iconButtonAttributes';
|
|
|
10
9
|
* intended to make matching specs easy. Most props available to the IconButton are also available
|
|
11
10
|
* to ListItemEditButton.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
const ListViewItemEditButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
14
|
return ___EmotionJSX(Box, {
|
|
16
15
|
ref: ref,
|
|
@@ -20,6 +19,5 @@ const ListViewItemEditButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
19
|
size: "md"
|
|
21
20
|
})));
|
|
22
21
|
});
|
|
23
|
-
ListViewItemEditButton.propTypes = iconButtonPropTypes;
|
|
24
22
|
ListViewItemEditButton.displayName = 'ListViewItemEditButton';
|
|
25
23
|
export default ListViewItemEditButton;
|
|
@@ -2,8 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Icon, IconButton, Menu, PopoverMenu } from '../../..';
|
|
4
4
|
import { useGetTheme } from '../../../hooks';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
6
|
/**
|
|
8
7
|
* ListViewItemEditButton is one of several styled control components that can be used as a child
|
|
9
8
|
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
@@ -11,7 +10,7 @@ import { menuPropTypes } from '../../Menu/menuAttributes';
|
|
|
11
10
|
* and [Menu](./?path=/docs/components-menu--docs) component, intended to make matching
|
|
12
11
|
* specs easy. Most props available to the Menu component are available to ListItemMenu.
|
|
13
12
|
*/
|
|
14
|
-
|
|
13
|
+
|
|
15
14
|
const ListViewItemMenu = /*#__PURE__*/forwardRef(({
|
|
16
15
|
children,
|
|
17
16
|
iconButtonProps,
|
|
@@ -34,6 +33,5 @@ const ListViewItemMenu = /*#__PURE__*/forwardRef(({
|
|
|
34
33
|
}
|
|
35
34
|
})), ___EmotionJSX(Menu, others, children));
|
|
36
35
|
});
|
|
37
|
-
ListViewItemMenu.propTypes = menuPropTypes;
|
|
38
36
|
ListViewItemMenu.displayName = 'ListViewItemMenu';
|
|
39
37
|
export default ListViewItemMenu;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { SwitchField } from '../../..';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
6
5
|
/**
|
|
7
6
|
* ListViewItemSwitchField is one of several styled control components that can be used as a child
|
|
8
7
|
* nested inside of the [ListViewItem](./?path=/docs/components-listviewitem--docs).
|
|
@@ -10,7 +9,7 @@ import { SwitchField } from '../../..';
|
|
|
10
9
|
* intended to make matching specs easy. Most props available to the SwitchField are also
|
|
11
10
|
* available to ListItemEditButton.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
const ListViewItemSwitchField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
14
|
return ___EmotionJSX(SwitchField, _extends({
|
|
16
15
|
ref: ref,
|
|
@@ -21,7 +20,4 @@ const ListViewItemSwitchField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
21
20
|
}, props));
|
|
22
21
|
});
|
|
23
22
|
ListViewItemSwitchField.displayName = 'ListViewItemSwitchField';
|
|
24
|
-
|
|
25
|
-
// ListViewItemSwitchField.propTypes = switchFieldPropTypes;
|
|
26
|
-
|
|
27
23
|
export default ListViewItemSwitchField;
|
|
@@ -7,8 +7,12 @@ import useResizeObserver from 'use-resize-observer';
|
|
|
7
7
|
import { useGetTheme } from '../../../../hooks';
|
|
8
8
|
import { Box, Button, Text, Tooltip, TooltipTrigger } from '../../../../index';
|
|
9
9
|
import { neutral } from '../../../../styles/colors';
|
|
10
|
-
import { listViewItemChartPropTypes } from './ListViewItemChartAttributes';
|
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
11
|
+
// `variant` keys into the theme's style objects but is not part of recharts'
|
|
12
|
+
// prop types; these aliases keep the extra prop typecheckable without
|
|
13
|
+
// changing what is passed through at runtime.
|
|
14
|
+
const TypedResponsiveContainer = ResponsiveContainer;
|
|
15
|
+
const TypedLineChart = LineChart;
|
|
12
16
|
const ListViewItemChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
13
17
|
const {
|
|
14
18
|
buttonProps,
|
|
@@ -33,15 +37,19 @@ const ListViewItemChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
33
37
|
const {
|
|
34
38
|
visuallyHiddenProps
|
|
35
39
|
} = useVisuallyHidden();
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
// Before the observer's first measurement, width is undefined; the old JS
|
|
41
|
+
// compared `undefined <= n` (false), so treat unmeasured as infinitely wide.
|
|
42
|
+
const isTablet = useMemo(() => (width ?? Number.POSITIVE_INFINITY) <= tabletBreakPoint, [tabletBreakPoint, width]);
|
|
43
|
+
const isMobile = useMemo(() => (width ?? Number.POSITIVE_INFINITY) <= mobileBreakPoint, [mobileBreakPoint, width]);
|
|
38
44
|
const hideIfTablet = useCallback(() => isTablet && visuallyHiddenProps, [isTablet, visuallyHiddenProps]);
|
|
39
45
|
const hideIfMobile = useCallback(() => isMobile && visuallyHiddenProps, [isMobile, visuallyHiddenProps]);
|
|
40
46
|
useEffect(() => {
|
|
41
47
|
async function setAriaLabel() {
|
|
42
48
|
if (containerRef && containerRef.current) {
|
|
43
|
-
const [rechartsWrapper] =
|
|
44
|
-
rechartsWrapper
|
|
49
|
+
const [rechartsWrapper] = Array.from(containerRef.current.getElementsByClassName('recharts-wrapper'));
|
|
50
|
+
if (rechartsWrapper && ariaLabel) {
|
|
51
|
+
rechartsWrapper.setAttribute('aria-label', ariaLabel);
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
55
|
setAriaLabel();
|
|
@@ -77,9 +85,9 @@ const ListViewItemChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
77
85
|
}, ___EmotionJSX(Box, {
|
|
78
86
|
variant: "lisViewItemChart.chartContainer",
|
|
79
87
|
id: ariaLabel
|
|
80
|
-
}, ___EmotionJSX(
|
|
88
|
+
}, ___EmotionJSX(TypedResponsiveContainer, {
|
|
81
89
|
variant: "lisViewItemChart.responsiveContainer"
|
|
82
|
-
}, ___EmotionJSX(
|
|
90
|
+
}, ___EmotionJSX(TypedLineChart, {
|
|
83
91
|
data: chartData,
|
|
84
92
|
variant: "lisViewItemChart.chart"
|
|
85
93
|
}, ___EmotionJSX(Line, {
|
|
@@ -96,6 +104,5 @@ const ListViewItemChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
96
104
|
variant: "variants.lisViewItemChart.trend"
|
|
97
105
|
}, trend))), ___EmotionJSX(Tooltip, null, tooltipText)));
|
|
98
106
|
});
|
|
99
|
-
ListViewItemChart.propTypes = listViewItemChartPropTypes;
|
|
100
107
|
ListViewItemChart.displayName = 'ListViewItemChart';
|
|
101
108
|
export default ListViewItemChart;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import { docArgTypes } from '../../../../utils/docUtils/docArgTypes';
|
|
3
2
|
import { buttonArgTypes } from '../../../Button/buttonAttributes';
|
|
4
3
|
const descriptions = {
|
|
@@ -93,16 +92,4 @@ export const listViewItemChartArgTypes = {
|
|
|
93
92
|
},
|
|
94
93
|
control: 'text'
|
|
95
94
|
}
|
|
96
|
-
};
|
|
97
|
-
export const listViewItemChartPropTypes = {
|
|
98
|
-
chartData: PropTypes.arrayOf(PropTypes.shape({})),
|
|
99
|
-
chartLabel: PropTypes.string,
|
|
100
|
-
chartDataKey: PropTypes.string,
|
|
101
|
-
contentCount: PropTypes.string,
|
|
102
|
-
contentCountLabel: PropTypes.string,
|
|
103
|
-
mobileBreakPoint: PropTypes.number,
|
|
104
|
-
tabletBreakPoint: PropTypes.number,
|
|
105
|
-
title: PropTypes.string,
|
|
106
|
-
tooltipText: PropTypes.string,
|
|
107
|
-
trend: PropTypes.string
|
|
108
95
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ariaAttributeBaseArgTypes, ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
|
1
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
|
3
2
|
import { booleanArg, stringOrStringArray } from '../../utils/docUtils/docArgTypes';
|
|
4
|
-
import { onHoverArgTypes
|
|
3
|
+
import { onHoverArgTypes } from '../../utils/docUtils/hoverProps';
|
|
5
4
|
const descriptions = {
|
|
6
5
|
data: 'Object with User/Group data.',
|
|
7
6
|
className: 'A list of class names to apply to the element',
|
|
@@ -60,30 +59,4 @@ export const listViewItemArgTypes = {
|
|
|
60
59
|
...SharedItemArgTypes,
|
|
61
60
|
...onHoverArgTypes,
|
|
62
61
|
...ariaAttributeBaseArgTypes
|
|
63
|
-
};
|
|
64
|
-
export const SharedItemPropTypes = {
|
|
65
|
-
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
66
|
-
colorId: PropTypes.string,
|
|
67
|
-
data: PropTypes.shape({
|
|
68
|
-
icon: PropTypes.elementType,
|
|
69
|
-
image: PropTypes.shape({
|
|
70
|
-
src: PropTypes.string,
|
|
71
|
-
alt: PropTypes.string,
|
|
72
|
-
'aria-label': PropTypes.string
|
|
73
|
-
}),
|
|
74
|
-
subtext: PropTypes.string,
|
|
75
|
-
text: PropTypes.string
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
export const listViewItemPropTypes = {
|
|
79
|
-
isSelected: PropTypes.bool,
|
|
80
|
-
linkProps: PropTypes.object,
|
|
81
|
-
onMetaClick: PropTypes.func,
|
|
82
|
-
slots: PropTypes.shape({
|
|
83
|
-
leftOfData: PropTypes.node,
|
|
84
|
-
rightOfData: PropTypes.node
|
|
85
|
-
}),
|
|
86
|
-
...SharedItemPropTypes,
|
|
87
|
-
...onHoverPropTypes,
|
|
88
|
-
...ariaAttributesBasePropTypes
|
|
89
62
|
};
|
|
@@ -3,7 +3,6 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useGetTheme } from '../../hooks';
|
|
5
5
|
import { Avatar, Box, CopyText, Icon, IconWrapper, Image, Text } from '../../index';
|
|
6
|
-
import { SharedItemPropTypes } from '../ListViewItem/listViewItemAttributes';
|
|
7
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
8
7
|
export const PANEL_HEADER_ICON = '-panel-header-icon';
|
|
9
8
|
const PanelHeader = /*#__PURE__*/forwardRef(({
|
|
@@ -142,12 +141,28 @@ const PanelHeader = /*#__PURE__*/forwardRef(({
|
|
|
142
141
|
}, children)));
|
|
143
142
|
});
|
|
144
143
|
PanelHeader.propTypes = {
|
|
145
|
-
|
|
144
|
+
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
146
145
|
colorId: PropTypes.string,
|
|
147
|
-
|
|
146
|
+
data: PropTypes.shape({
|
|
147
|
+
icon: PropTypes.elementType,
|
|
148
|
+
image: PropTypes.shape({
|
|
149
|
+
src: PropTypes.string,
|
|
150
|
+
alt: PropTypes.string,
|
|
151
|
+
'aria-label': PropTypes.string
|
|
152
|
+
}),
|
|
153
|
+
subtext: PropTypes.string,
|
|
154
|
+
text: PropTypes.string,
|
|
155
|
+
avatarDefaultText: PropTypes.string
|
|
156
|
+
}),
|
|
157
|
+
avatarProps: PropTypes.object,
|
|
158
|
+
headerProps: PropTypes.object,
|
|
159
|
+
headerWrapperProps: PropTypes.object,
|
|
148
160
|
iconProps: PropTypes.object,
|
|
161
|
+
isCopyable: PropTypes.bool,
|
|
149
162
|
slots: PropTypes.shape({
|
|
163
|
+
leftOfData: PropTypes.node,
|
|
150
164
|
rightOfData: PropTypes.node
|
|
151
|
-
})
|
|
165
|
+
}),
|
|
166
|
+
subtextProps: PropTypes.object
|
|
152
167
|
};
|
|
153
168
|
export default PanelHeader;
|
|
@@ -10,6 +10,7 @@ const TableBaseEmptyState = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
10
10
|
descriptionLabel = 'Take action by doing x, y, z',
|
|
11
11
|
addButtonLabel,
|
|
12
12
|
onAddButtonPress,
|
|
13
|
+
iconProps,
|
|
13
14
|
...others
|
|
14
15
|
} = props;
|
|
15
16
|
return ___EmotionJSX(Box, _extends({
|
|
@@ -19,7 +20,7 @@ const TableBaseEmptyState = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
19
20
|
justifyContent: "center",
|
|
20
21
|
gap: "sm",
|
|
21
22
|
py: "lg"
|
|
22
|
-
}, others), ___EmotionJSX(Icon, {
|
|
23
|
+
}, others), ___EmotionJSX(Icon, _extends({
|
|
23
24
|
icon: defaultIcon,
|
|
24
25
|
color: "text.secondary",
|
|
25
26
|
size: 60,
|
|
@@ -29,7 +30,7 @@ const TableBaseEmptyState = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
29
30
|
sx: {
|
|
30
31
|
opacity: 0.2
|
|
31
32
|
}
|
|
32
|
-
}), ___EmotionJSX(Text, {
|
|
33
|
+
}, iconProps)), ___EmotionJSX(Text, {
|
|
33
34
|
variant: "H4",
|
|
34
35
|
as: "h4",
|
|
35
36
|
textAlign: "center"
|
package/lib/types/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|