@pingux/astro 2.112.0-alpha.1 → 2.112.0-alpha.3
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/AIComponents/Response/Response.stories.js +24 -24
- package/lib/cjs/components/AIComponents/Response/Response.test.jsx +40 -70
- package/lib/cjs/components/AIComponents/Response/ResponseAttachment.js +3 -2
- package/lib/cjs/components/AIComponents/Response/ResponseToolbar.js +23 -35
- package/lib/cjs/components/AIComponents/Response/ResponseToolbarIcon.d.ts +4 -0
- package/lib/cjs/components/AIComponents/Response/ResponseToolbarIcon.js +57 -0
- package/lib/cjs/components/AIComponents/Response/index.d.ts +1 -0
- package/lib/cjs/components/AIComponents/Response/index.js +8 -1
- package/lib/cjs/components/DataTable/DataTable.js +9 -1
- package/lib/cjs/components/DataTable/DataTable.stories.js +23 -16
- package/lib/cjs/components/DataTable/DataTable.styles.d.ts +7 -1
- package/lib/cjs/components/DataTable/DataTable.styles.js +10 -2
- package/lib/cjs/components/DataTable/DataTableBadge.js +5 -32
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/cjs/components/Loader/Loader.js +6 -5
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +33 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +33 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.js +6 -0
- package/lib/cjs/types/loader.d.ts +2 -0
- package/lib/cjs/types/response.d.ts +10 -3
- package/lib/components/AIComponents/Response/Response.stories.js +24 -24
- package/lib/components/AIComponents/Response/Response.test.jsx +40 -70
- package/lib/components/AIComponents/Response/ResponseAttachment.js +3 -2
- package/lib/components/AIComponents/Response/ResponseToolbar.js +25 -37
- package/lib/components/AIComponents/Response/ResponseToolbarIcon.js +43 -0
- package/lib/components/AIComponents/Response/index.js +2 -1
- package/lib/components/DataTable/DataTable.js +9 -1
- package/lib/components/DataTable/DataTable.stories.js +23 -16
- package/lib/components/DataTable/DataTable.styles.js +10 -2
- package/lib/components/DataTable/DataTableBadge.js +6 -33
- package/lib/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/components/Loader/Loader.js +6 -5
- package/lib/index.js +1 -0
- package/lib/styles/themes/next-gen/variants/button.js +6 -0
- package/package.json +1 -1
@@ -0,0 +1,43 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
+
var _excluded = ["title", "icon", "className", "parentIndex", "animationIndex", "setAnimationIndex", "delay", "iconProps"];
|
4
|
+
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
6
|
+
import { useStatusClasses } from '../../../hooks';
|
7
|
+
import { Icon, IconButton } from '../../../index';
|
8
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
|
+
var ResponseToolbarIcon = function ResponseToolbarIcon(props) {
|
10
|
+
var title = props.title,
|
11
|
+
icon = props.icon,
|
12
|
+
className = props.className,
|
13
|
+
parentIndex = props.parentIndex,
|
14
|
+
animationIndex = props.animationIndex,
|
15
|
+
setAnimationIndex = props.setAnimationIndex,
|
16
|
+
delay = props.delay,
|
17
|
+
iconProps = props.iconProps,
|
18
|
+
others = _objectWithoutProperties(props, _excluded);
|
19
|
+
var isLoaded = useRef(false);
|
20
|
+
useEffect(function () {
|
21
|
+
if (parentIndex === animationIndex && setAnimationIndex && parentIndex !== undefined) {
|
22
|
+
_setTimeout(function () {
|
23
|
+
isLoaded.current = true;
|
24
|
+
setAnimationIndex(parentIndex + 1);
|
25
|
+
}, delay);
|
26
|
+
}
|
27
|
+
}, [parentIndex, animationIndex, setAnimationIndex, delay]);
|
28
|
+
var _useStatusClasses = useStatusClasses(className, {
|
29
|
+
isNotLoaded: !isLoaded.current
|
30
|
+
}),
|
31
|
+
classNames = _useStatusClasses.classNames;
|
32
|
+
return ___EmotionJSX(IconButton, _extends({
|
33
|
+
title: title,
|
34
|
+
className: classNames,
|
35
|
+
variant: "responseToolbar"
|
36
|
+
}, others), ___EmotionJSX(Icon, _extends({
|
37
|
+
icon: icon,
|
38
|
+
title: {
|
39
|
+
name: title
|
40
|
+
}
|
41
|
+
}, iconProps)));
|
42
|
+
};
|
43
|
+
export default ResponseToolbarIcon;
|
@@ -2,4 +2,5 @@ export { default } from './Response';
|
|
2
2
|
export { default as ResponseAttachment } from './ResponseAttachment';
|
3
3
|
export { default as ResponseList } from './ResponseList';
|
4
4
|
export { default as ResponseText } from './ResponseText';
|
5
|
-
export { default as ResponseToolbar } from './ResponseToolbar';
|
5
|
+
export { default as ResponseToolbar } from './ResponseToolbar';
|
6
|
+
export { default as ResponseToolbarIcon } from './ResponseToolbarIcon';
|
@@ -192,7 +192,15 @@ var DataTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
192
192
|
case 'loader':
|
193
193
|
return ___EmotionJSX(CenteredWrapper, null, ___EmotionJSX(Loader, {
|
194
194
|
color: "accent.70",
|
195
|
-
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading'
|
195
|
+
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading',
|
196
|
+
sx: {
|
197
|
+
gap: '9px'
|
198
|
+
},
|
199
|
+
dotProps: {
|
200
|
+
sx: {
|
201
|
+
m: 0
|
202
|
+
}
|
203
|
+
}
|
196
204
|
}));
|
197
205
|
default:
|
198
206
|
return undefined;
|
@@ -142,6 +142,13 @@ export default {
|
|
142
142
|
overflowMode: 'truncate'
|
143
143
|
}
|
144
144
|
};
|
145
|
+
var getHeaderProps = function getHeaderProps() {
|
146
|
+
return {
|
147
|
+
sx: {
|
148
|
+
fontWeight: '3'
|
149
|
+
}
|
150
|
+
};
|
151
|
+
};
|
145
152
|
var getCellProps = function getCellProps(columnKey, align) {
|
146
153
|
return {
|
147
154
|
pr: columnKey !== 'menu' ? 'lg' : 0,
|
@@ -177,7 +184,7 @@ export var Default = function Default(args) {
|
|
177
184
|
id: 1,
|
178
185
|
timestamp: timestampCell,
|
179
186
|
eventType: 'User Access Allowed',
|
180
|
-
description: ___EmotionJSX(
|
187
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
181
188
|
status: ___EmotionJSX(DataTableBadge, {
|
182
189
|
cell: "Approved"
|
183
190
|
}),
|
@@ -187,13 +194,10 @@ export var Default = function Default(args) {
|
|
187
194
|
id: 2,
|
188
195
|
timestamp: timestampCell,
|
189
196
|
eventType: 'User Access Denied',
|
190
|
-
description: ___EmotionJSX(
|
191
|
-
display: "
|
192
|
-
|
193
|
-
|
194
|
-
}, "Control"), ___EmotionJSX(Box, {
|
195
|
-
display: "block"
|
196
|
-
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words")),
|
197
|
+
description: ___EmotionJSX(Box, {
|
198
|
+
display: "-webkit-box",
|
199
|
+
variant: "dataTable.truncateText"
|
200
|
+
}, "Passed Role Access Control Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
197
201
|
status: ___EmotionJSX(DataTableBadge, {
|
198
202
|
cell: "Rejected"
|
199
203
|
}),
|
@@ -203,7 +207,10 @@ export var Default = function Default(args) {
|
|
203
207
|
id: 3,
|
204
208
|
timestamp: timestampCell,
|
205
209
|
eventType: 'User Access Allowed',
|
206
|
-
description:
|
210
|
+
description: ___EmotionJSX(Box, {
|
211
|
+
display: "-webkit-box",
|
212
|
+
variant: "dataTable.truncateText"
|
213
|
+
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
207
214
|
status: ___EmotionJSX(DataTableBadge, {
|
208
215
|
cell: "Approved"
|
209
216
|
}),
|
@@ -213,7 +220,7 @@ export var Default = function Default(args) {
|
|
213
220
|
id: 4,
|
214
221
|
timestamp: timestampCell,
|
215
222
|
eventType: 'User Access Allowed',
|
216
|
-
description: ___EmotionJSX(
|
223
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
217
224
|
status: ___EmotionJSX(DataTableBadge, {
|
218
225
|
cell: "Approved"
|
219
226
|
}),
|
@@ -223,7 +230,7 @@ export var Default = function Default(args) {
|
|
223
230
|
id: 5,
|
224
231
|
timestamp: timestampCell,
|
225
232
|
eventType: 'User Access Allowed',
|
226
|
-
description: ___EmotionJSX(
|
233
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
227
234
|
status: ___EmotionJSX(DataTableBadge, {
|
228
235
|
cell: "Approved"
|
229
236
|
}),
|
@@ -236,7 +243,7 @@ export var Default = function Default(args) {
|
|
236
243
|
}), ___EmotionJSX(DataTableHeader, {
|
237
244
|
columns: columns
|
238
245
|
}, function (column) {
|
239
|
-
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, false), {
|
246
|
+
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, false), getHeaderProps(), {
|
240
247
|
minWidth: column.key !== 'menu' ? 175 : 32,
|
241
248
|
width: column.key !== 'menu' ? '19.4%' : 32
|
242
249
|
}), column.name);
|
@@ -295,7 +302,7 @@ export var Dynamic = function Dynamic(args) {
|
|
295
302
|
id: 5,
|
296
303
|
country: 'Mexico',
|
297
304
|
population: '126,000,000',
|
298
|
-
continent: '
|
305
|
+
continent: 'North America'
|
299
306
|
}, {
|
300
307
|
id: 6,
|
301
308
|
country: 'Ethiopia',
|
@@ -401,7 +408,7 @@ export var Sortable = function Sortable(args) {
|
|
401
408
|
id: 6,
|
402
409
|
country: 'Mexico',
|
403
410
|
population: '126,000,000',
|
404
|
-
continent: '
|
411
|
+
continent: 'North America'
|
405
412
|
}, {
|
406
413
|
id: 7,
|
407
414
|
country: 'USA',
|
@@ -535,7 +542,7 @@ export var Selection = function Selection(args) {
|
|
535
542
|
id: 5,
|
536
543
|
country: 'Mexico',
|
537
544
|
population: '126,000,000',
|
538
|
-
continent: '
|
545
|
+
continent: 'North America'
|
539
546
|
}, {
|
540
547
|
id: 6,
|
541
548
|
country: 'Ethiopia',
|
@@ -619,7 +626,7 @@ export var ControlledSelection = function ControlledSelection(args) {
|
|
619
626
|
id: 5,
|
620
627
|
country: 'Mexico',
|
621
628
|
population: '126,000,000',
|
622
|
-
continent: '
|
629
|
+
continent: 'North America'
|
623
630
|
}, {
|
624
631
|
id: 6,
|
625
632
|
country: 'Ethiopia',
|
@@ -41,7 +41,7 @@ var tableCell = _objectSpread(_objectSpread({}, text.tableData), {}, {
|
|
41
41
|
});
|
42
42
|
var tableCellContents = {
|
43
43
|
maxHeight: 80,
|
44
|
-
overflow: 'hidden',
|
44
|
+
// overflow: 'hidden',
|
45
45
|
display: '-webkit-box !important',
|
46
46
|
'-webkit-line-clamp': '4',
|
47
47
|
'-webkit-box-orient': 'vertical'
|
@@ -152,6 +152,13 @@ var tableMenu = {
|
|
152
152
|
borderRadius: '50px',
|
153
153
|
mr: 'md'
|
154
154
|
};
|
155
|
+
var truncateText = {
|
156
|
+
whiteSpace: 'normal',
|
157
|
+
WebkitBoxOrient: 'vertical',
|
158
|
+
display: '-webkit-box',
|
159
|
+
WebkitLineClamp: '2',
|
160
|
+
overflow: 'hidden'
|
161
|
+
};
|
155
162
|
export default {
|
156
163
|
selectableTableRow: selectableTableRow,
|
157
164
|
tableBody: tableBody,
|
@@ -161,5 +168,6 @@ export default {
|
|
161
168
|
tableCell: tableCell,
|
162
169
|
tableRow: tableRow,
|
163
170
|
tableHeadCell: tableHeadCell,
|
164
|
-
tableMenu: tableMenu
|
171
|
+
tableMenu: tableMenu,
|
172
|
+
truncateText: truncateText
|
165
173
|
};
|
@@ -1,62 +1,35 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
/* eslint-disable no-nested-ternary */
|
3
3
|
import React, { forwardRef } from 'react';
|
4
|
-
import
|
5
|
-
import AlertIcon from '@pingux/mdi-react/AlertIcon';
|
6
|
-
import CheckIcon from '@pingux/mdi-react/CheckIcon';
|
7
|
-
import { Badge, Icon } from '../../index';
|
4
|
+
import { Badge } from '../../index';
|
8
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
6
|
var DataTableBadge = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
10
7
|
var cell = _ref.cell;
|
11
8
|
var componentProps = {
|
12
9
|
'Pending': {
|
13
10
|
badgeProps: {
|
14
|
-
variant: '
|
15
|
-
},
|
16
|
-
iconProps: {
|
17
|
-
icon: CheckIcon
|
11
|
+
variant: 'activeStatusBadge'
|
18
12
|
}
|
19
13
|
},
|
20
14
|
'Failed': {
|
21
15
|
badgeProps: {
|
22
|
-
variant: '
|
23
|
-
},
|
24
|
-
iconProps: {
|
25
|
-
icon: AlertIcon,
|
26
|
-
title: {
|
27
|
-
name: 'Alert Icon'
|
28
|
-
}
|
16
|
+
variant: 'warningStatusBadge'
|
29
17
|
}
|
30
18
|
},
|
31
19
|
'Rejected': {
|
32
20
|
badgeProps: {
|
33
|
-
variant: '
|
34
|
-
},
|
35
|
-
iconProps: {
|
36
|
-
icon: AlertCircleIcon,
|
37
|
-
title: {
|
38
|
-
name: 'Alert Circle Icon'
|
39
|
-
}
|
21
|
+
variant: 'criticalStatusBadge'
|
40
22
|
}
|
41
23
|
},
|
42
24
|
'Approved': {
|
43
25
|
badgeProps: {
|
44
|
-
variant: '
|
45
|
-
},
|
46
|
-
iconProps: {
|
47
|
-
icon: CheckIcon,
|
48
|
-
title: {
|
49
|
-
name: 'Check Icon'
|
50
|
-
}
|
26
|
+
variant: 'healthyStatusBadge'
|
51
27
|
}
|
52
28
|
}
|
53
29
|
};
|
54
30
|
return ___EmotionJSX(Badge, _extends({
|
55
31
|
label: cell,
|
56
32
|
ref: ref
|
57
|
-
}, cell && componentProps[cell].badgeProps)
|
58
|
-
mr: "xs",
|
59
|
-
size: "14px"
|
60
|
-
}, cell && componentProps[cell].iconProps)));
|
33
|
+
}, cell && componentProps[cell].badgeProps));
|
61
34
|
});
|
62
35
|
export default DataTableBadge;
|
@@ -20,7 +20,6 @@ test('renders component with rejected label', function () {
|
|
20
20
|
cell: cell
|
21
21
|
});
|
22
22
|
expect(screen.queryByText('Rejected')).toBeInTheDocument();
|
23
|
-
expect(screen.queryByText('Alert Circle Icon')).toBeInTheDocument();
|
24
23
|
});
|
25
24
|
test('renders component with pending label', function () {
|
26
25
|
var cell = 'Pending';
|
@@ -35,7 +34,6 @@ test('renders component with failed label', function () {
|
|
35
34
|
cell: cell
|
36
35
|
});
|
37
36
|
expect(screen.queryByText('Failed')).toBeInTheDocument();
|
38
|
-
expect(screen.queryByText('Alert Icon')).toBeInTheDocument();
|
39
37
|
});
|
40
38
|
test('renders component with null cell', function () {
|
41
39
|
var cell = null;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["size"];
|
3
|
+
var _excluded = ["size", "dotProps"];
|
4
4
|
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var Loader = /*#__PURE__*/forwardRef(function (props, ref) {
|
8
8
|
var size = props.size,
|
9
|
+
dotProps = props.dotProps,
|
9
10
|
others = _objectWithoutProperties(props, _excluded);
|
10
11
|
return ___EmotionJSX(Box, _extends({
|
11
12
|
ref: ref,
|
@@ -15,12 +16,12 @@ var Loader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
15
16
|
role: "alert",
|
16
17
|
"aria-live": "assertive",
|
17
18
|
"aria-label": "Loading in progress"
|
18
|
-
}, others), ___EmotionJSX(Box, {
|
19
|
+
}, others), ___EmotionJSX(Box, _extends({
|
19
20
|
variant: "loader.dotLeft"
|
20
|
-
}), ___EmotionJSX(Box, {
|
21
|
+
}, dotProps)), ___EmotionJSX(Box, _extends({
|
21
22
|
variant: "loader.dotCenter"
|
22
|
-
}), ___EmotionJSX(Box, {
|
23
|
+
}, dotProps)), ___EmotionJSX(Box, _extends({
|
23
24
|
variant: "loader.dotRight"
|
24
|
-
}));
|
25
|
+
}, dotProps)));
|
25
26
|
});
|
26
27
|
export default Loader;
|
package/lib/index.js
CHANGED
@@ -20,6 +20,7 @@ export { default as ResponseAttachment } from './components/AIComponents/Respons
|
|
20
20
|
export { default as ResponseList } from './components/AIComponents/Response/ResponseList';
|
21
21
|
export { default as ResponseText } from './components/AIComponents/Response/ResponseText';
|
22
22
|
export { default as ResponseToolbar } from './components/AIComponents/Response/ResponseToolbar';
|
23
|
+
export { default as ResponseToolbarIcon } from './components/AIComponents/Response/ResponseToolbarIcon';
|
23
24
|
export { default as Suggestions } from './components/AIComponents/Suggestions';
|
24
25
|
export { default as Suggestion } from './components/AIComponents/Suggestions/Suggestion';
|
25
26
|
export { default as ArrayField } from './components/ArrayField';
|
@@ -243,6 +243,12 @@ var iconButtons = {
|
|
243
243
|
base: _objectSpread({}, baseIconButton),
|
244
244
|
nextGen: _objectSpread({}, onyxIconButton),
|
245
245
|
onyx: _objectSpread({}, onyxIconButton),
|
246
|
+
responseToolbar: _objectSpread(_objectSpread({}, baseIconButton), {}, {
|
247
|
+
'&.is-not-loaded': {
|
248
|
+
display: 'none'
|
249
|
+
},
|
250
|
+
display: 'inline-flex'
|
251
|
+
}),
|
246
252
|
modalCloseButton: modalCloseButton,
|
247
253
|
badge: {
|
248
254
|
deleteButton: _objectSpread(_objectSpread({}, baseIconButton), {}, {
|