@carbon/ibm-products 2.43.2-canary.102 → 2.43.2-canary.103

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,76 @@
1
- export namespace defaults {
2
- let position: string;
3
- let size: string;
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React, { ReactNode } from 'react';
9
+ import '../../global/js/utils/props-helper';
10
+ import { ButtonProps } from '@carbon/react';
11
+ import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
12
+ declare enum sizes {
13
+ lg = "lg",
14
+ sm = "sm"
15
+ }
16
+ export declare const defaults: {
17
+ position: string;
18
+ size: sizes;
19
+ };
20
+ interface EmptyStateProps {
21
+ /**
22
+ * Empty state action button
23
+ */
24
+ action?: {
25
+ kind?: 'primary' | 'secondary' | 'tertiary';
26
+ renderIcon?: CarbonIconType;
27
+ onClick?: ButtonProps['onClick'];
28
+ text?: string;
29
+ };
30
+ /**
31
+ * Provide an optional class to be applied to the containing node.
32
+ */
33
+ className?: string;
34
+ /**
35
+ * Empty state illustration, specify the `src` for a provided illustration to be displayed. In the case of requiring a light and dark illustration of your own, simply pass the corresponding illustration based on the current theme of your application.
36
+ * For example: `illustration={appTheme === 'dark' ? darkIllustration : lightIllustration}`
37
+ */
38
+ illustration?: string;
39
+ /**
40
+ * The alt text for empty state svg images. If not provided , title will be used.
41
+ */
42
+ illustrationDescription?: string;
43
+ /**
44
+ * Designates the position of the illustration relative to the content
45
+ */
46
+ illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
47
+ /**
48
+ * Empty state link object
49
+ */
50
+ link?: {
51
+ text?: string | ReactNode;
52
+ href?: string;
53
+ };
54
+ /**
55
+ * Empty state size
56
+ */
57
+ size?: 'lg' | 'sm';
58
+ /**
59
+ * Empty state subtitle
60
+ */
61
+ subtitle?: string | ReactNode;
62
+ /**
63
+ * Empty state title
64
+ */
65
+ title: string | ReactNode;
66
+ /**
67
+ * Designates which version of the EmptyState component is being used.
68
+ * Refer to V2 documentation separately.
69
+ */
70
+ v2?: boolean;
4
71
  }
5
72
  /**
6
73
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
7
74
  */
8
- export let EmptyState: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
9
- import React from 'react';
75
+ export declare let EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
76
+ export {};
@@ -22,13 +22,15 @@ var _excluded = ["v2"],
22
22
  // The block part of our conventional BEM class names (blockClass__E--M).
23
23
  var blockClass = "".concat(pkg.prefix, "--empty-state");
24
24
  var componentName = 'EmptyState';
25
-
26
- // Default values for props
25
+ var sizes = /*#__PURE__*/function (sizes) {
26
+ sizes["lg"] = "lg";
27
+ sizes["sm"] = "sm";
28
+ return sizes;
29
+ }(sizes || {}); // Default values for props
27
30
  var defaults = {
28
31
  position: 'top',
29
- size: 'lg'
32
+ size: sizes.lg
30
33
  };
31
-
32
34
  /**
33
35
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
34
36
  */
@@ -64,7 +66,7 @@ var EmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
64
66
  link: link,
65
67
  size: size,
66
68
  subtitle: subtitle,
67
- title: title
69
+ title: title !== null && title !== void 0 ? title : ''
68
70
  }));
69
71
  });
70
72
 
@@ -92,6 +94,7 @@ EmptyState.propTypes = {
92
94
  /**
93
95
  * The alt text for custom provided illustrations
94
96
  */
97
+ /**@ts-ignore*/
95
98
  illustrationDescription: PropTypes.string.isRequired.if(function (_ref2) {
96
99
  var illustration = _ref2.illustration;
97
100
  return illustration;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023, 2023
2
+ * Copyright IBM Corp. 2023, 2024
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -44,7 +44,7 @@ interface EmptyStateV2Props {
44
44
  * Props for the link. Refer to the Carbon Components link documentation for full list of props.
45
45
  */
46
46
  link?: {
47
- text?: string;
47
+ text?: string | ReactNode;
48
48
  };
49
49
  /**
50
50
  * Empty state size
@@ -107,7 +107,7 @@ EmptyStateV2.propTypes = {
107
107
  */
108
108
  /**@ts-ignore*/
109
109
  link: PropTypes.shape({
110
- text: PropTypes.string
110
+ text: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
111
111
  }),
112
112
  /**
113
113
  * Empty state size
@@ -1,9 +1,76 @@
1
- export namespace defaults {
2
- let position: string;
3
- let size: string;
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React, { ReactNode } from 'react';
9
+ import '../../global/js/utils/props-helper';
10
+ import { ButtonProps } from '@carbon/react';
11
+ import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
12
+ declare enum sizes {
13
+ lg = "lg",
14
+ sm = "sm"
15
+ }
16
+ export declare const defaults: {
17
+ position: string;
18
+ size: sizes;
19
+ };
20
+ interface EmptyStateProps {
21
+ /**
22
+ * Empty state action button
23
+ */
24
+ action?: {
25
+ kind?: 'primary' | 'secondary' | 'tertiary';
26
+ renderIcon?: CarbonIconType;
27
+ onClick?: ButtonProps['onClick'];
28
+ text?: string;
29
+ };
30
+ /**
31
+ * Provide an optional class to be applied to the containing node.
32
+ */
33
+ className?: string;
34
+ /**
35
+ * Empty state illustration, specify the `src` for a provided illustration to be displayed. In the case of requiring a light and dark illustration of your own, simply pass the corresponding illustration based on the current theme of your application.
36
+ * For example: `illustration={appTheme === 'dark' ? darkIllustration : lightIllustration}`
37
+ */
38
+ illustration?: string;
39
+ /**
40
+ * The alt text for empty state svg images. If not provided , title will be used.
41
+ */
42
+ illustrationDescription?: string;
43
+ /**
44
+ * Designates the position of the illustration relative to the content
45
+ */
46
+ illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
47
+ /**
48
+ * Empty state link object
49
+ */
50
+ link?: {
51
+ text?: string | ReactNode;
52
+ href?: string;
53
+ };
54
+ /**
55
+ * Empty state size
56
+ */
57
+ size?: 'lg' | 'sm';
58
+ /**
59
+ * Empty state subtitle
60
+ */
61
+ subtitle?: string | ReactNode;
62
+ /**
63
+ * Empty state title
64
+ */
65
+ title: string | ReactNode;
66
+ /**
67
+ * Designates which version of the EmptyState component is being used.
68
+ * Refer to V2 documentation separately.
69
+ */
70
+ v2?: boolean;
4
71
  }
5
72
  /**
6
73
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
7
74
  */
8
- export let EmptyState: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
9
- import React from 'react';
75
+ export declare let EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
76
+ export {};
@@ -31,13 +31,15 @@ var _excluded = ["v2"],
31
31
  // The block part of our conventional BEM class names (blockClass__E--M).
32
32
  var blockClass = "".concat(settings.pkg.prefix, "--empty-state");
33
33
  var componentName = 'EmptyState';
34
-
35
- // Default values for props
34
+ var sizes = /*#__PURE__*/function (sizes) {
35
+ sizes["lg"] = "lg";
36
+ sizes["sm"] = "sm";
37
+ return sizes;
38
+ }(sizes || {}); // Default values for props
36
39
  var defaults = {
37
40
  position: 'top',
38
- size: 'lg'
41
+ size: sizes.lg
39
42
  };
40
-
41
43
  /**
42
44
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
43
45
  */
@@ -73,7 +75,7 @@ exports.EmptyState = /*#__PURE__*/React__default["default"].forwardRef(function
73
75
  link: link,
74
76
  size: size,
75
77
  subtitle: subtitle,
76
- title: title
78
+ title: title !== null && title !== void 0 ? title : ''
77
79
  }));
78
80
  });
79
81
 
@@ -101,6 +103,7 @@ exports.EmptyState.propTypes = {
101
103
  /**
102
104
  * The alt text for custom provided illustrations
103
105
  */
106
+ /**@ts-ignore*/
104
107
  illustrationDescription: index["default"].string.isRequired.if(function (_ref2) {
105
108
  var illustration = _ref2.illustration;
106
109
  return illustration;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023, 2023
2
+ * Copyright IBM Corp. 2023, 2024
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -44,7 +44,7 @@ interface EmptyStateV2Props {
44
44
  * Props for the link. Refer to the Carbon Components link documentation for full list of props.
45
45
  */
46
46
  link?: {
47
- text?: string;
47
+ text?: string | ReactNode;
48
48
  };
49
49
  /**
50
50
  * Empty state size
@@ -116,7 +116,7 @@ exports.EmptyStateV2.propTypes = {
116
116
  */
117
117
  /**@ts-ignore*/
118
118
  link: index["default"].shape({
119
- text: index["default"].string
119
+ text: index["default"].oneOfType([index["default"].string, index["default"].node])
120
120
  }),
121
121
  /**
122
122
  * Empty state size
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.43.2-canary.102+5d21bf822",
4
+ "version": "2.43.2-canary.103+95b756345",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -120,5 +120,5 @@
120
120
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
121
121
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
122
122
  },
123
- "gitHead": "5d21bf822fff0fef64e06de74c59c37470ffd900"
123
+ "gitHead": "95b7563457730ea24fed77e9aca2c964d9d713ac"
124
124
  }