@pingux/astro 2.120.0 → 2.121.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 (122) hide show
  1. package/lib/cjs/components/AIComponents/Attachment/Attachment.d.ts +1 -6
  2. package/lib/cjs/components/AIComponents/Attachment/Attachment.js +10 -15
  3. package/lib/cjs/components/AIComponents/Attachment/Attachment.test.d.ts +1 -0
  4. package/lib/cjs/components/AIComponents/Attachment/Attachment.test.js +67 -0
  5. package/lib/cjs/components/AIComponents/Attachment/constants.d.ts +38 -0
  6. package/lib/cjs/components/AIComponents/Attachment/constants.js +51 -0
  7. package/lib/cjs/components/AIComponents/PromptInput/PromptInput.stories.js +2 -4
  8. package/lib/cjs/components/Icon/Icon.js +13 -10
  9. package/lib/cjs/components/IconButton/IconButton.styles.d.ts +37 -0
  10. package/lib/cjs/components/IconButton/IconButton.styles.js +6 -1
  11. package/lib/cjs/components/IconWrapper/iconWrapperAttributes.js +1 -1
  12. package/lib/cjs/components/ListView/ListView.js +5 -0
  13. package/lib/cjs/components/ListView/ListView.stories.d.ts +3 -3
  14. package/lib/cjs/components/ListView/ListView.stories.js +27 -458
  15. package/lib/cjs/components/ListView/ListViewExpandableItem.js +1 -0
  16. package/lib/cjs/components/ListView/ListViewItem.js +4 -1
  17. package/lib/cjs/{styles/themes/next-gen/stories/NextGenListView.chromatic.stories.js → components/ListView/stories/ListView.chromatic.stories.js} +2 -2
  18. package/lib/cjs/components/ListView/stories/ListViewNextGenComponent.js +144 -0
  19. package/lib/cjs/{styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.js → components/ListView/stories/ListViewOnyxDark.stories.js} +3 -3
  20. package/lib/cjs/components/ListViewItem/ListViewItem.js +16 -5
  21. package/lib/cjs/components/ListViewItem/ListViewItem.stories.js +40 -3
  22. package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +15 -1
  23. package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.js +1 -1
  24. package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.js +9 -3
  25. package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.test.js +1 -0
  26. package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +5 -1
  27. package/lib/cjs/components/Pagination/Pagination.stories.js +3 -3
  28. package/lib/cjs/components/SearchField/SearchField.js +2 -8
  29. package/lib/cjs/components/Text/Text.styles.d.ts +840 -0
  30. package/lib/cjs/components/Text/Text.styles.js +5 -1
  31. package/lib/cjs/hooks/useExpandableListViewItem/useExpandableListViewItem.js +9 -3
  32. package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +2 -0
  33. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +15 -0
  34. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +18 -3
  35. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +1 -0
  36. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +1 -0
  37. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/nextGenDarkModeOverride.js +2 -0
  38. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +7 -0
  39. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +7 -0
  40. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/listview.d.ts +58 -0
  41. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/{lsitview.js → listview.js} +37 -2
  42. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.d.ts +15 -0
  43. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.js +23 -0
  44. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +40 -0
  45. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +11 -3
  46. package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +1 -0
  47. package/lib/cjs/styles/themes/astro/customProperties/icons.js +2 -1
  48. package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +1 -0
  49. package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +14 -0
  50. package/lib/cjs/styles/themes/next-gen/colors/iconWrapper.d.ts +14 -0
  51. package/lib/cjs/styles/themes/next-gen/colors/iconWrapper.js +16 -2
  52. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
  53. package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +1 -0
  54. package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +2 -1
  55. package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +1 -0
  56. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +136 -24
  57. package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +27 -6
  58. package/lib/cjs/styles/themes/next-gen/variants/button.js +17 -3
  59. package/lib/cjs/styles/themes/next-gen/variants/listview.d.ts +79 -17
  60. package/lib/cjs/styles/themes/next-gen/variants/listview.js +89 -24
  61. package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +13 -1
  62. package/lib/cjs/styles/themes/next-gen/variants/text.js +16 -4
  63. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +82 -17
  64. package/lib/cjs/styles/themes/next-gen/variants/variants.js +8 -1
  65. package/lib/cjs/types/iconWrapper.d.ts +1 -1
  66. package/lib/cjs/utils/devUtils/constants/animals.js +449 -1
  67. package/lib/components/AIComponents/Attachment/Attachment.js +10 -15
  68. package/lib/components/AIComponents/Attachment/Attachment.test.js +64 -0
  69. package/lib/components/AIComponents/Attachment/constants.js +42 -0
  70. package/lib/components/AIComponents/PromptInput/PromptInput.stories.js +3 -5
  71. package/lib/components/Icon/Icon.js +13 -10
  72. package/lib/components/IconButton/IconButton.styles.js +6 -1
  73. package/lib/components/IconWrapper/iconWrapperAttributes.js +1 -1
  74. package/lib/components/ListView/ListView.js +5 -0
  75. package/lib/components/ListView/ListView.stories.js +25 -455
  76. package/lib/components/ListView/ListViewExpandableItem.js +1 -0
  77. package/lib/components/ListView/ListViewItem.js +4 -1
  78. package/lib/{styles/themes/next-gen/stories/NextGenListView.chromatic.stories.js → components/ListView/stories/ListView.chromatic.stories.js} +2 -2
  79. package/lib/components/ListView/stories/ListViewNextGenComponent.js +130 -0
  80. package/lib/{styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.js → components/ListView/stories/ListViewOnyxDark.stories.js} +3 -3
  81. package/lib/components/ListViewItem/ListViewItem.js +18 -7
  82. package/lib/components/ListViewItem/ListViewItem.stories.js +40 -3
  83. package/lib/components/ListViewItem/ListViewItem.styles.js +15 -1
  84. package/lib/components/ListViewItem/controls/ListViewItemEditButton.js +1 -1
  85. package/lib/components/ListViewItem/controls/ListViewItemMenu.js +9 -3
  86. package/lib/components/ListViewItem/controls/ListViewItemMenu.test.js +1 -0
  87. package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +5 -1
  88. package/lib/components/Pagination/Pagination.stories.js +1 -1
  89. package/lib/components/SearchField/SearchField.js +2 -8
  90. package/lib/components/Text/Text.styles.js +5 -1
  91. package/lib/hooks/useExpandableListViewItem/useExpandableListViewItem.js +9 -3
  92. package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +18 -3
  93. package/lib/styles/themeOverrides/nextGenDarkMode/nextGenDarkModeOverride.js +2 -0
  94. package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +7 -0
  95. package/lib/styles/themeOverrides/nextGenDarkMode/variants/listview.js +58 -0
  96. package/lib/styles/themeOverrides/nextGenDarkMode/variants/text.js +15 -0
  97. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +9 -1
  98. package/lib/styles/themes/astro/customProperties/icons.js +2 -1
  99. package/lib/styles/themes/next-gen/colors/iconWrapper.js +16 -2
  100. package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
  101. package/lib/styles/themes/next-gen/customProperties/icons.js +2 -1
  102. package/lib/styles/themes/next-gen/variants/button.js +17 -3
  103. package/lib/styles/themes/next-gen/variants/listview.js +84 -22
  104. package/lib/styles/themes/next-gen/variants/text.js +16 -4
  105. package/lib/styles/themes/next-gen/variants/variants.js +9 -2
  106. package/lib/utils/devUtils/constants/animals.js +449 -1
  107. package/package.json +1 -1
  108. package/lib/cjs/recipes/NextGen/ListViewNextGen.stories.js +0 -23
  109. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/lsitview.d.ts +0 -24
  110. package/lib/cjs/styles/themes/next-gen/stories/ListViewItemNextGen.d.ts +0 -29
  111. package/lib/cjs/styles/themes/next-gen/stories/ListViewItemNextGen.js +0 -84
  112. package/lib/cjs/styles/themes/next-gen/stories/ListViewNextGenComponent.js +0 -67
  113. package/lib/cjs/styles/themes/next-gen/stories/NextGenListViewItem.stories.d.ts +0 -6
  114. package/lib/cjs/styles/themes/next-gen/stories/NextGenListViewItem.stories.js +0 -35
  115. package/lib/recipes/NextGen/ListViewNextGen.stories.js +0 -13
  116. package/lib/styles/themeOverrides/nextGenDarkMode/variants/lsitview.js +0 -24
  117. package/lib/styles/themes/next-gen/stories/ListViewItemNextGen.js +0 -75
  118. package/lib/styles/themes/next-gen/stories/ListViewNextGenComponent.js +0 -58
  119. package/lib/styles/themes/next-gen/stories/NextGenListViewItem.stories.js +0 -25
  120. /package/lib/cjs/{styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.d.ts → components/ListView/stories/ListView.chromatic.stories.d.ts} +0 -0
  121. /package/lib/cjs/{styles/themes/next-gen → components/ListView}/stories/ListViewNextGenComponent.d.ts +0 -0
  122. /package/lib/cjs/{styles/themes/next-gen/stories/NextGenListView.chromatic.stories.d.ts → components/ListView/stories/ListViewOnyxDark.stories.d.ts} +0 -0
@@ -0,0 +1,64 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import { render, screen } from '../../../utils/testUtils/testWrapper';
4
+ import Attachment from './Attachment';
5
+ import { jsx as ___EmotionJSX } from "@emotion/react";
6
+ var mockFileName = 'sampleFile';
7
+ var defaultProps = {
8
+ key: 'file_key',
9
+ title: mockFileName,
10
+ fileType: 'PPT',
11
+ removeFile: function removeFile() {
12
+ return false;
13
+ },
14
+ id: 'Example Title'
15
+ };
16
+ var getComponent = function getComponent() {
17
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18
+ return render(___EmotionJSX(Attachment, _extends({}, defaultProps, props)));
19
+ };
20
+ describe('Attachment', function () {
21
+ test('renders with PPT file format ', function () {
22
+ getComponent();
23
+ screen.getByRole('img', {
24
+ name: /ppt file icon/i
25
+ });
26
+ screen.getByRole('heading', {
27
+ name: mockFileName
28
+ });
29
+ screen.getAllByText(/ppt/i);
30
+ screen.getByRole('button', {
31
+ name: /remove attachment/i
32
+ });
33
+ });
34
+ test('renders with PDF file format', function () {
35
+ getComponent({
36
+ fileType: 'pdf'
37
+ });
38
+ screen.getByRole('img', {
39
+ name: /pdf file icon/i
40
+ });
41
+ screen.getByRole('heading', {
42
+ name: mockFileName
43
+ });
44
+ screen.getAllByText(/pdf/i);
45
+ });
46
+ test('renders with CSV file format', function () {
47
+ getComponent({
48
+ fileType: 'csv'
49
+ });
50
+ screen.getAllByText(/csv/i);
51
+ });
52
+ test('renders with JS file format', function () {
53
+ getComponent({
54
+ fileType: 'js'
55
+ });
56
+ screen.getAllByText(/js/i);
57
+ });
58
+ test('renders with ZIP file format', function () {
59
+ getComponent({
60
+ fileType: 'zip'
61
+ });
62
+ screen.getAllByText(/zip/i);
63
+ });
64
+ });
@@ -0,0 +1,42 @@
1
+ import CodeTagsIcon from '@pingux/mdi-react/CodeTagsIcon';
2
+ import FileDocumentOutlineIcon from '@pingux/mdi-react/FileDocumentOutlineIcon';
3
+ import FolderZipOutlineIcon from '@pingux/mdi-react/FolderZipOutlineIcon';
4
+ import TableLargeIcon from '@pingux/mdi-react/TableLargeIcon';
5
+ export var fileTypeConfig = {
6
+ pdf: {
7
+ icon: FileDocumentOutlineIcon,
8
+ color: 'lightPink'
9
+ },
10
+ doc: {
11
+ icon: FileDocumentOutlineIcon,
12
+ color: 'lightPink'
13
+ },
14
+ docx: {
15
+ icon: FileDocumentOutlineIcon,
16
+ color: 'lightPink'
17
+ },
18
+ text: {
19
+ icon: FileDocumentOutlineIcon,
20
+ color: 'lightPink'
21
+ },
22
+ csv: {
23
+ icon: TableLargeIcon,
24
+ color: 'lightGreen'
25
+ },
26
+ xls: {
27
+ icon: TableLargeIcon,
28
+ color: 'lightGreen'
29
+ },
30
+ xlsx: {
31
+ icon: TableLargeIcon,
32
+ color: 'lightGreen'
33
+ },
34
+ js: {
35
+ icon: CodeTagsIcon,
36
+ color: 'lightYellow'
37
+ },
38
+ zip: {
39
+ icon: FolderZipOutlineIcon,
40
+ color: 'lightIndigo'
41
+ }
42
+ };
@@ -13,7 +13,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
13
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
14
  import React, { useState } from 'react';
15
15
  import DocsLayout from '../../../../.storybook/storybookDocsLayout';
16
- import { AstroProvider, Box, NextGenTheme } from '../../..';
16
+ import { Box } from '../../..';
17
17
  import { booleanArg } from '../../../utils/docUtils/docArgTypes';
18
18
  import PromptInput from './PromptInput';
19
19
  import PromptInputReadMe from './PromptInputReadMe.mdx';
@@ -54,9 +54,7 @@ export var Default = function Default(args) {
54
54
  console.log('submit');
55
55
  setValue('');
56
56
  };
57
- return ___EmotionJSX(AstroProvider, {
58
- themeOverrides: [NextGenTheme]
59
- }, ___EmotionJSX(Box, {
57
+ return ___EmotionJSX(Box, {
60
58
  maxWidth: "768px"
61
59
  }, ___EmotionJSX(PromptInput, _extends({}, args, {
62
60
  placeholder: "Enter a prompt here",
@@ -68,5 +66,5 @@ export var Default = function Default(args) {
68
66
  onFileChange: onFileChange,
69
67
  onSubmit: onSubmit,
70
68
  onCancel: onCancel
71
- }))));
69
+ })));
72
70
  };
@@ -9,6 +9,8 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
9
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
10
  import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
11
  import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
12
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
13
+ var _excluded = ["color", "icon", "sx", "size", "variant", "title"];
12
14
  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
15
  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
16
  import React, { forwardRef } from 'react';
@@ -19,31 +21,32 @@ var Icon = /*#__PURE__*/forwardRef(function (props, ref) {
19
21
  var color = props.color,
20
22
  IconComponent = props.icon,
21
23
  sx = props.sx,
22
- size = props.size;
24
+ _props$size = props.size,
25
+ size = _props$size === void 0 ? 'sm' : _props$size,
26
+ variant = props.variant,
27
+ title = props.title,
28
+ others = _objectWithoutProperties(props, _excluded);
23
29
  var theme = useGetTheme();
24
30
  var _useTShirtSize = useTShirtSize({
25
31
  size: size,
26
32
  sizes: theme.tShirtSizes
27
33
  }),
28
34
  sizeProps = _useTShirtSize.sizeProps;
29
- var title = props.title || (_typeof(IconComponent) === 'object' && 'type' in IconComponent ? {
35
+ var resolvedTitle = title !== null && title !== void 0 ? title : _typeof(IconComponent) === 'object' && 'type' in IconComponent ? {
30
36
  name: IconComponent.type.name
31
- } : '');
37
+ } : '';
32
38
  return ___EmotionJSX(Box, _extends({
33
39
  as: IconComponent,
34
40
  ref: ref,
35
- title: title
36
- }, props, {
37
- size: sizeProps.size,
38
41
  role: "img",
42
+ title: resolvedTitle,
43
+ variant: variant,
44
+ size: sizeProps.size,
39
45
  sx: _objectSpread({
40
46
  fill: color,
41
47
  minWidth: sizeProps.size
42
48
  }, sx)
43
- }));
49
+ }, others));
44
50
  });
45
- Icon.defaultProps = {
46
- size: 20
47
- };
48
51
  Icon.displayName = 'Icon';
49
52
  export default Icon;
@@ -134,6 +134,10 @@ var applicationPortalPinned = _objectSpread(_objectSpread({}, base), {}, {
134
134
  }
135
135
  }
136
136
  });
137
+ var searchClearButton = _objectSpread(_objectSpread({}, base), {}, {
138
+ position: 'absolute',
139
+ right: 10
140
+ });
137
141
  export default {
138
142
  base: base,
139
143
  bidirectional: bidirectional,
@@ -159,5 +163,6 @@ export default {
159
163
  },
160
164
  // Recipe related variants
161
165
  applicationPortal: applicationPortal,
162
- applicationPortalPinned: applicationPortalPinned
166
+ applicationPortalPinned: applicationPortalPinned,
167
+ searchClearButton: searchClearButton
163
168
  };
@@ -1,4 +1,4 @@
1
- var colorOptions = ['cyan', 'orange', 'red', 'green', 'purple', 'yellow', 'teal', 'pink'];
1
+ var colorOptions = ['cyan', 'orange', 'red', 'green', 'purple', 'yellow', 'teal', 'pink', 'blue', 'indigo'];
2
2
  var sizes = ['sm', 'md', 'lg'];
3
3
  export var iconWrapperArgTypes = {
4
4
  color: {
@@ -160,6 +160,11 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
160
160
  onScroll: resetHoverState,
161
161
  tabIndex: isFocusable ? 0 : -1,
162
162
  shouldUseVirtualFocus: !isFocusable
163
+ // added to remove the outline when using keyboard navigation encountered during UIP-7501
164
+ ,
165
+ style: {
166
+ outline: 'none'
167
+ }
163
168
  }), function (type, item) {
164
169
  if (type === 'item') {
165
170
  if (props.selectionMode === 'expansion') {