@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
@@ -1,10 +1,5 @@
1
1
  import React from 'react';
2
2
  import { AttachmentProps } from '../../../types/promptInput';
3
3
  export declare const getFileExtension: (fullString: string) => string;
4
- declare const Attachment: {
5
- (props: AttachmentProps): React.JSX.Element;
6
- defaultProps: {
7
- icon: import("@pingux/mdi-react").MdiReactIconComponentType;
8
- };
9
- };
4
+ declare const Attachment: (props: AttachmentProps) => React.JSX.Element;
10
5
  export default Attachment;
@@ -20,6 +20,7 @@ var _CloseIcon = _interopRequireDefault(require("@pingux/mdi-react/CloseIcon"));
20
20
  var _PaperOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/PaperOutlineIcon"));
21
21
  var _hooks = require("../../../hooks");
22
22
  var _index = require("../../../index");
23
+ var _constants = require("./constants");
23
24
  var _react2 = require("@emotion/react");
24
25
  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; }
25
26
  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) { (0, _defineProperty2["default"])(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; }
@@ -41,12 +42,16 @@ var Attachment = function Attachment(props) {
41
42
  id = props.id,
42
43
  containerProps = props.containerProps,
43
44
  iconWrapperProps = props.iconWrapperProps,
44
- icon = props.icon,
45
45
  deleteButtonProps = props.deleteButtonProps;
46
46
  var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
47
47
  isFullScreen: isFullScreen
48
48
  }),
49
49
  classNames = _useStatusClasses.classNames;
50
+ var defaultIconProps = {
51
+ icon: _PaperOutlineIcon["default"],
52
+ color: 'lightBlue'
53
+ };
54
+ var iconProps = _constants.fileTypeConfig[fileType] || defaultIconProps;
50
55
  return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
51
56
  variant: "attachment.container",
52
57
  className: classNames
@@ -55,13 +60,11 @@ var Attachment = function Attachment(props) {
55
60
  alignItems: "center",
56
61
  px: "lg",
57
62
  py: "md"
58
- }, (0, _react2.jsx)(_index.IconWrapper, {
63
+ }, (0, _react2.jsx)(_index.IconWrapper, (0, _extends2["default"])({
59
64
  isCircle: true,
60
65
  title: {
61
- name: 'File Icon'
66
+ name: "".concat(fileType, " File Icon")
62
67
  },
63
- icon: icon,
64
- color: "red",
65
68
  size: "sm",
66
69
  wrapperProps: _objectSpread({
67
70
  size: '36px',
@@ -69,18 +72,13 @@ var Attachment = function Attachment(props) {
69
72
  minWidth: '36px',
70
73
  p: '9px'
71
74
  }, iconWrapperProps)
72
- }), (0, _react2.jsx)(_index.Box, {
75
+ }, iconProps)), (0, _react2.jsx)(_index.Box, {
73
76
  sx: {
74
77
  ml: 'md'
75
78
  }
76
79
  }, (0, _react2.jsx)(_index.Text, {
77
80
  as: "h5",
78
- sx: {
79
- fontWeight: 2,
80
- textOverflow: 'ellipsis',
81
- whiteSpace: 'nowrap',
82
- overflow: 'hidden'
83
- }
81
+ variant: "attachmentTitle"
84
82
  }, title), (0, _react2.jsx)(_index.Text, {
85
83
  sx: {
86
84
  textOverflow: 'ellipsis'
@@ -102,8 +100,5 @@ var Attachment = function Attachment(props) {
102
100
  icon: _CloseIcon["default"]
103
101
  }))));
104
102
  };
105
- Attachment.defaultProps = {
106
- icon: _PaperOutlineIcon["default"]
107
- };
108
103
  var _default = Attachment;
109
104
  exports["default"] = _default;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
5
+ var _react = _interopRequireDefault(require("react"));
6
+ var _testWrapper = require("../../../utils/testUtils/testWrapper");
7
+ var _Attachment = _interopRequireDefault(require("./Attachment"));
8
+ var _react2 = require("@emotion/react");
9
+ var mockFileName = 'sampleFile';
10
+ var defaultProps = {
11
+ key: 'file_key',
12
+ title: mockFileName,
13
+ fileType: 'PPT',
14
+ removeFile: function removeFile() {
15
+ return false;
16
+ },
17
+ id: 'Example Title'
18
+ };
19
+ var getComponent = function getComponent() {
20
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
+ return (0, _testWrapper.render)((0, _react2.jsx)(_Attachment["default"], (0, _extends2["default"])({}, defaultProps, props)));
22
+ };
23
+ describe('Attachment', function () {
24
+ test('renders with PPT file format ', function () {
25
+ getComponent();
26
+ _testWrapper.screen.getByRole('img', {
27
+ name: /ppt file icon/i
28
+ });
29
+ _testWrapper.screen.getByRole('heading', {
30
+ name: mockFileName
31
+ });
32
+ _testWrapper.screen.getAllByText(/ppt/i);
33
+ _testWrapper.screen.getByRole('button', {
34
+ name: /remove attachment/i
35
+ });
36
+ });
37
+ test('renders with PDF file format', function () {
38
+ getComponent({
39
+ fileType: 'pdf'
40
+ });
41
+ _testWrapper.screen.getByRole('img', {
42
+ name: /pdf file icon/i
43
+ });
44
+ _testWrapper.screen.getByRole('heading', {
45
+ name: mockFileName
46
+ });
47
+ _testWrapper.screen.getAllByText(/pdf/i);
48
+ });
49
+ test('renders with CSV file format', function () {
50
+ getComponent({
51
+ fileType: 'csv'
52
+ });
53
+ _testWrapper.screen.getAllByText(/csv/i);
54
+ });
55
+ test('renders with JS file format', function () {
56
+ getComponent({
57
+ fileType: 'js'
58
+ });
59
+ _testWrapper.screen.getAllByText(/js/i);
60
+ });
61
+ test('renders with ZIP file format', function () {
62
+ getComponent({
63
+ fileType: 'zip'
64
+ });
65
+ _testWrapper.screen.getAllByText(/zip/i);
66
+ });
67
+ });
@@ -0,0 +1,38 @@
1
+ export declare const fileTypeConfig: {
2
+ pdf: {
3
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
4
+ color: string;
5
+ };
6
+ doc: {
7
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
8
+ color: string;
9
+ };
10
+ docx: {
11
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
12
+ color: string;
13
+ };
14
+ text: {
15
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
16
+ color: string;
17
+ };
18
+ csv: {
19
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
20
+ color: string;
21
+ };
22
+ xls: {
23
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
24
+ color: string;
25
+ };
26
+ xlsx: {
27
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
28
+ color: string;
29
+ };
30
+ js: {
31
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
32
+ color: string;
33
+ };
34
+ zip: {
35
+ icon: import("@pingux/mdi-react").MdiReactIconComponentType;
36
+ color: string;
37
+ };
38
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.fileTypeConfig = void 0;
9
+ var _CodeTagsIcon = _interopRequireDefault(require("@pingux/mdi-react/CodeTagsIcon"));
10
+ var _FileDocumentOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/FileDocumentOutlineIcon"));
11
+ var _FolderZipOutlineIcon = _interopRequireDefault(require("@pingux/mdi-react/FolderZipOutlineIcon"));
12
+ var _TableLargeIcon = _interopRequireDefault(require("@pingux/mdi-react/TableLargeIcon"));
13
+ var fileTypeConfig = {
14
+ pdf: {
15
+ icon: _FileDocumentOutlineIcon["default"],
16
+ color: 'lightPink'
17
+ },
18
+ doc: {
19
+ icon: _FileDocumentOutlineIcon["default"],
20
+ color: 'lightPink'
21
+ },
22
+ docx: {
23
+ icon: _FileDocumentOutlineIcon["default"],
24
+ color: 'lightPink'
25
+ },
26
+ text: {
27
+ icon: _FileDocumentOutlineIcon["default"],
28
+ color: 'lightPink'
29
+ },
30
+ csv: {
31
+ icon: _TableLargeIcon["default"],
32
+ color: 'lightGreen'
33
+ },
34
+ xls: {
35
+ icon: _TableLargeIcon["default"],
36
+ color: 'lightGreen'
37
+ },
38
+ xlsx: {
39
+ icon: _TableLargeIcon["default"],
40
+ color: 'lightGreen'
41
+ },
42
+ js: {
43
+ icon: _CodeTagsIcon["default"],
44
+ color: 'lightYellow'
45
+ },
46
+ zip: {
47
+ icon: _FolderZipOutlineIcon["default"],
48
+ color: 'lightIndigo'
49
+ }
50
+ };
51
+ exports.fileTypeConfig = fileTypeConfig;
@@ -66,9 +66,7 @@ var Default = function Default(args) {
66
66
  console.log('submit');
67
67
  setValue('');
68
68
  };
69
- return (0, _react2.jsx)(_.AstroProvider, {
70
- themeOverrides: [_.NextGenTheme]
71
- }, (0, _react2.jsx)(_.Box, {
69
+ return (0, _react2.jsx)(_.Box, {
72
70
  maxWidth: "768px"
73
71
  }, (0, _react2.jsx)(_PromptInput["default"], (0, _extends2["default"])({}, args, {
74
72
  placeholder: "Enter a prompt here",
@@ -80,6 +78,6 @@ var Default = function Default(args) {
80
78
  onFileChange: onFileChange,
81
79
  onSubmit: onSubmit,
82
80
  onCancel: onCancel
83
- }))));
81
+ })));
84
82
  };
85
83
  exports.Default = Default;
@@ -18,10 +18,12 @@ exports["default"] = void 0;
18
18
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
20
20
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
21
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
21
22
  var _react = _interopRequireWildcard(require("react"));
22
23
  var _hooks = require("../../hooks");
23
24
  var _Box = _interopRequireDefault(require("../Box"));
24
25
  var _react2 = require("@emotion/react");
26
+ var _excluded = ["color", "icon", "sx", "size", "variant", "title"];
25
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
29
  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; }
@@ -30,32 +32,33 @@ var Icon = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
32
  var color = props.color,
31
33
  IconComponent = props.icon,
32
34
  sx = props.sx,
33
- size = props.size;
35
+ _props$size = props.size,
36
+ size = _props$size === void 0 ? 'sm' : _props$size,
37
+ variant = props.variant,
38
+ title = props.title,
39
+ others = (0, _objectWithoutProperties2["default"])(props, _excluded);
34
40
  var theme = (0, _hooks.useGetTheme)();
35
41
  var _useTShirtSize = (0, _hooks.useTShirtSize)({
36
42
  size: size,
37
43
  sizes: theme.tShirtSizes
38
44
  }),
39
45
  sizeProps = _useTShirtSize.sizeProps;
40
- var title = props.title || ((0, _typeof2["default"])(IconComponent) === 'object' && 'type' in IconComponent ? {
46
+ var resolvedTitle = title !== null && title !== void 0 ? title : (0, _typeof2["default"])(IconComponent) === 'object' && 'type' in IconComponent ? {
41
47
  name: IconComponent.type.name
42
- } : '');
48
+ } : '';
43
49
  return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
44
50
  as: IconComponent,
45
51
  ref: ref,
46
- title: title
47
- }, props, {
48
- size: sizeProps.size,
49
52
  role: "img",
53
+ title: resolvedTitle,
54
+ variant: variant,
55
+ size: sizeProps.size,
50
56
  sx: _objectSpread({
51
57
  fill: color,
52
58
  minWidth: sizeProps.size
53
59
  }, sx)
54
- }));
60
+ }, others));
55
61
  });
56
- Icon.defaultProps = {
57
- size: 20
58
- };
59
62
  Icon.displayName = 'Icon';
60
63
  var _default = Icon;
61
64
  exports["default"] = _default;
@@ -638,5 +638,42 @@ declare const _default: {
638
638
  height: string;
639
639
  outline: string;
640
640
  };
641
+ searchClearButton: {
642
+ position: string;
643
+ right: number;
644
+ justifyContent: string;
645
+ appearance: string;
646
+ alignItems: string;
647
+ alignSelf: string;
648
+ display: string;
649
+ flexGrow: number;
650
+ flexShrink: number;
651
+ borderRadius: string;
652
+ cursor: string;
653
+ bg: string;
654
+ p: string;
655
+ width: string;
656
+ height: string;
657
+ path: {
658
+ fill: string;
659
+ };
660
+ outline: string;
661
+ '&.is-focused': {
662
+ outline: string;
663
+ outlineColor: string;
664
+ outlineOffset: string;
665
+ };
666
+ '&.is-hovered': {
667
+ bg: string;
668
+ boxShadow: string;
669
+ };
670
+ '&.is-pressed': {
671
+ path: {
672
+ fill: string;
673
+ };
674
+ bg: string;
675
+ boxShadow: string;
676
+ };
677
+ };
641
678
  };
642
679
  export default _default;
@@ -143,6 +143,10 @@ var applicationPortalPinned = _objectSpread(_objectSpread({}, base), {}, {
143
143
  }
144
144
  }
145
145
  });
146
+ var searchClearButton = _objectSpread(_objectSpread({}, base), {}, {
147
+ position: 'absolute',
148
+ right: 10
149
+ });
146
150
  var _default = {
147
151
  base: base,
148
152
  bidirectional: bidirectional,
@@ -168,6 +172,7 @@ var _default = {
168
172
  },
169
173
  // Recipe related variants
170
174
  applicationPortal: applicationPortal,
171
- applicationPortalPinned: applicationPortalPinned
175
+ applicationPortalPinned: applicationPortalPinned,
176
+ searchClearButton: searchClearButton
172
177
  };
173
178
  exports["default"] = _default;
@@ -5,7 +5,7 @@ _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.iconWrapperArgTypes = void 0;
8
- var colorOptions = ['cyan', 'orange', 'red', 'green', 'purple', 'yellow', 'teal', 'pink'];
8
+ var colorOptions = ['cyan', 'orange', 'red', 'green', 'purple', 'yellow', 'teal', 'pink', 'blue', 'indigo'];
9
9
  var sizes = ['sm', 'md', 'lg'];
10
10
  var iconWrapperArgTypes = {
11
11
  color: {
@@ -173,6 +173,11 @@ var ListView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
173
173
  onScroll: resetHoverState,
174
174
  tabIndex: isFocusable ? 0 : -1,
175
175
  shouldUseVirtualFocus: !isFocusable
176
+ // added to remove the outline when using keyboard navigation encountered during UIP-7501
177
+ ,
178
+ style: {
179
+ outline: 'none'
180
+ }
176
181
  }), function (type, item) {
177
182
  if (type === 'item') {
178
183
  if (props.selectionMode === 'expansion') {
@@ -1,4 +1,5 @@
1
1
  import React, { Key } from 'react';
2
+ import { IconWrapperProps } from '../..';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  component: React.ForwardRefExoticComponent<import("../../types/listView").ListViewProps & React.RefAttributes<unknown>>;
@@ -139,10 +140,9 @@ export interface ExampleItemProps {
139
140
  subtext?: string;
140
141
  id: string | number;
141
142
  hasSeparator?: boolean;
143
+ icon?: React.ElementType;
144
+ iconWrapperProps?: IconWrapperProps;
142
145
  }
143
- export declare const animals: {
144
- name: string;
145
- }[];
146
146
  export declare const Default: {
147
147
  ({ ...args }: {
148
148
  [x: string]: any;