@atlaskit/section-message 6.1.13 → 6.1.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 6.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8202e37941b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8202e37941b) - Internal code change turning on new linting rules.
8
+
3
9
  ## 6.1.13
4
10
 
5
11
  ### Patch Changes
File without changes
@@ -129,7 +129,7 @@ export const mapActionsProp = (
129
129
  const linkComponentAttributeValue = transferLinkComponentProp(j, element);
130
130
  actionsAttributes = getJSXAttributesByName(j, element, ACTIONS_PROP_NAME);
131
131
 
132
- actionsAttributes.forEach((attribute: ASTPath<JSXAttribute>) => {
132
+ actionsAttributes?.forEach((attribute: ASTPath<JSXAttribute>) => {
133
133
  j(attribute)
134
134
  .find(j.JSXExpressionContainer)
135
135
  .forEach((expressionContainer: ASTPath<JSXExpressionContainer>) => {
File without changes
@@ -33,6 +33,16 @@ var actionStyles = (0, _core.css)({
33
33
  verticalAlign: 'middle'
34
34
  }
35
35
  });
36
+ /**
37
+ * __Section message action__
38
+ *
39
+ * A section message action is designed to work with the `action` prop from
40
+ * `SectionMessage`. It renders either a button or a link depending on whether
41
+ * an `onClick` or `href` prop is supplied, with a dot seperator in between actions.
42
+ *
43
+ * - [Examples](https://atlassian.design/components/section-message/examples#actions)
44
+ */
45
+
36
46
  var SectionMessageAction = /*#__PURE__*/(0, _react.memo)(function SectionMessageAction(_ref) {
37
47
  var children = _ref.children,
38
48
  onClick = _ref.onClick,
@@ -121,6 +121,16 @@ var SectionMessageWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Sectio
121
121
  "data-testid": testId && "".concat(testId, "--actions")
122
122
  }, actionsArray) : null));
123
123
  });
124
+ /**
125
+ * __Section message__
126
+ *
127
+ * A section message is used to alert users to a particular section of the screen.
128
+ *
129
+ * - [Examples](https://atlassian.design/components/section-message/examples)
130
+ * - [Code](https://atlassian.design/components/section-message/code)
131
+ * - [Usage](https://atlassian.design/components/section-message/usage)
132
+ */
133
+
124
134
  var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage(props, ref) {
125
135
  return (0, _core.jsx)(_components.default.Consumer, null, function (_ref2) {
126
136
  var mode = _ref2.mode;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.13",
3
+ "version": "6.1.14",
4
4
  "sideEffects": false
5
5
  }
@@ -19,6 +19,16 @@ const actionStyles = css({
19
19
  verticalAlign: 'middle'
20
20
  }
21
21
  });
22
+ /**
23
+ * __Section message action__
24
+ *
25
+ * A section message action is designed to work with the `action` prop from
26
+ * `SectionMessage`. It renders either a button or a link depending on whether
27
+ * an `onClick` or `href` prop is supplied, with a dot seperator in between actions.
28
+ *
29
+ * - [Examples](https://atlassian.design/components/section-message/examples#actions)
30
+ */
31
+
22
32
  const SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction({
23
33
  children,
24
34
  onClick,
@@ -92,6 +92,16 @@ const SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage({
92
92
  "data-testid": testId && `${testId}--actions`
93
93
  }, actionsArray) : null));
94
94
  });
95
+ /**
96
+ * __Section message__
97
+ *
98
+ * A section message is used to alert users to a particular section of the screen.
99
+ *
100
+ * - [Examples](https://atlassian.design/components/section-message/examples)
101
+ * - [Code](https://atlassian.design/components/section-message/code)
102
+ * - [Usage](https://atlassian.design/components/section-message/usage)
103
+ */
104
+
95
105
  const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(props, ref) {
96
106
  return jsx(GlobalTheme.Consumer, null, ({
97
107
  mode
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.13",
3
+ "version": "6.1.14",
4
4
  "sideEffects": false
5
5
  }
@@ -19,6 +19,16 @@ var actionStyles = css({
19
19
  verticalAlign: 'middle'
20
20
  }
21
21
  });
22
+ /**
23
+ * __Section message action__
24
+ *
25
+ * A section message action is designed to work with the `action` prop from
26
+ * `SectionMessage`. It renders either a button or a link depending on whether
27
+ * an `onClick` or `href` prop is supplied, with a dot seperator in between actions.
28
+ *
29
+ * - [Examples](https://atlassian.design/components/section-message/examples#actions)
30
+ */
31
+
22
32
  var SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction(_ref) {
23
33
  var children = _ref.children,
24
34
  onClick = _ref.onClick,
@@ -97,6 +97,16 @@ var SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage(_re
97
97
  "data-testid": testId && "".concat(testId, "--actions")
98
98
  }, actionsArray) : null));
99
99
  });
100
+ /**
101
+ * __Section message__
102
+ *
103
+ * A section message is used to alert users to a particular section of the screen.
104
+ *
105
+ * - [Examples](https://atlassian.design/components/section-message/examples)
106
+ * - [Code](https://atlassian.design/components/section-message/code)
107
+ * - [Usage](https://atlassian.design/components/section-message/usage)
108
+ */
109
+
100
110
  var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(props, ref) {
101
111
  return jsx(GlobalTheme.Consumer, null, function (_ref2) {
102
112
  var mode = _ref2.mode;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.13",
3
+ "version": "6.1.14",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import type { SectionMessageActionProps } from './types';
3
+ /**
4
+ * __Section message action__
5
+ *
6
+ * A section message action is designed to work with the `action` prop from
7
+ * `SectionMessage`. It renders either a button or a link depending on whether
8
+ * an `onClick` or `href` prop is supplied, with a dot seperator in between actions.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/section-message/examples#actions)
11
+ */
3
12
  declare const SectionMessageAction: import("react").NamedExoticComponent<SectionMessageActionProps>;
4
13
  export default SectionMessageAction;
@@ -1,5 +1,14 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import type { SectionMessageProps } from './types';
4
+ /**
5
+ * __Section message__
6
+ *
7
+ * A section message is used to alert users to a particular section of the screen.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/section-message/examples)
10
+ * - [Code](https://atlassian.design/components/section-message/code)
11
+ * - [Usage](https://atlassian.design/components/section-message/usage)
12
+ */
4
13
  declare const SectionMessage: React.ForwardRefExoticComponent<SectionMessageProps & React.RefAttributes<HTMLElement>>;
5
14
  export default SectionMessage;
@@ -1,18 +1,57 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- /** Appearance determines the icon and background color pairing indicating the message type */
3
+ /**
4
+ * Appearance determines the icon and background color pairing indicating the message type
5
+ */
4
6
  export declare type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
5
7
  export interface SectionMessageProps {
6
- /** The appearance styling to use for the section message. */
8
+ /**
9
+ * The appearance styling to use for the section message.
10
+ */
7
11
  appearance?: Appearance;
12
+ /**
13
+ * The main content of the section message. This accepts a react node, although
14
+ * we recommend that this should be a paragraph.
15
+ */
8
16
  children: React.ReactNode;
17
+ /**
18
+ * The heading of the section message.
19
+ */
9
20
  title?: string;
21
+ /**
22
+ * Actions for the user to take after reading the section message. Accepts a ReactElement
23
+ * or an array of one or more SectionMessageAction React elements, which are applied as link buttons.
24
+ * Middle dots are automatically added between multiple link buttons, so no elements
25
+ * should be present between multiple actions.
26
+ *
27
+ * In general, avoid using more than two actions.
28
+ */
10
29
  actions?: ReactElement | ReactElement<SectionMessageActionProps>[];
30
+ /**
31
+ * An Icon component to be rendered instead of the default icon for the component.
32
+ * This should only be an `@atlaskit/icon` icon. You can check out [this example](/packages/design-system/section-message/example/custom-icon)
33
+ * to see how to provide this icon.
34
+ */
11
35
  icon?: React.ElementType;
36
+ /**
37
+ * A `testId` prop is a unique string that appears as a data attribute `data-testid`
38
+ * in the rendered code, serving as a hook for automated tests.
39
+ */
12
40
  testId?: string;
13
41
  }
14
42
  export interface SectionMessageActionProps {
43
+ /**
44
+ * The text that needs to be displayed for section message action.
45
+ */
15
46
  children: React.ReactNode;
47
+ /**
48
+ * A custom link component. This prop is designed to allow a custom link
49
+ * component to be passed to the rendered link button. The
50
+ * intended use-case is for when a custom router component such as react router
51
+ * is being used within the application.
52
+ *
53
+ * This component will only be used if a href prop is passed.
54
+ */
16
55
  linkComponent?: React.ComponentType<any>;
17
56
  /**
18
57
  * Click handler which will be attached to the rendered link button. The second argument can be used to
@@ -23,5 +62,9 @@ export interface SectionMessageActionProps {
23
62
  * The URL that the rendered link button will point to.
24
63
  */
25
64
  href?: string;
65
+ /**
66
+ * A `testId` prop is a unique string that appears as a data attribute `data-testid`
67
+ * in the rendered code, serving as a hook for automated tests.
68
+ */
26
69
  testId?: string;
27
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.13",
3
+ "version": "6.1.14",
4
4
  "description": "A section message is used to alert users to a particular section of the screen.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -13,19 +13,20 @@
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
15
  "sideEffects": false,
16
- "atlaskit:src": "src/index.ts",
16
+ "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
19
  "releaseModel": "scheduled",
20
20
  "website": {
21
- "name": "Section message"
21
+ "name": "Section message",
22
+ "category": "Components"
22
23
  }
23
24
  },
24
25
  "af:exports": {
25
- "./section-message": "./src/entry-points/section-message.ts",
26
- "./section-message-action": "./src/entry-points/section-message-action.ts",
27
- "./types": "./src/entry-points/types.ts",
28
- ".": "./src/index.ts"
26
+ "./section-message": "./src/entry-points/section-message.tsx",
27
+ "./section-message-action": "./src/entry-points/section-message-action.tsx",
28
+ "./types": "./src/entry-points/types.tsx",
29
+ ".": "./src/index.tsx"
29
30
  },
30
31
  "dependencies": {
31
32
  "@atlaskit/button": "^16.3.0",
@@ -43,6 +44,7 @@
43
44
  "@atlaskit/analytics-next": "^8.1.2",
44
45
  "@atlaskit/code": "^14.3.0",
45
46
  "@atlaskit/docs": "*",
47
+ "@atlaskit/ds-lib": "^2.1.0",
46
48
  "@atlaskit/range": "^6.0.0",
47
49
  "@atlaskit/ssr": "*",
48
50
  "@atlaskit/visual-regression": "*",
@@ -62,6 +64,8 @@
62
64
  "import-structure": "atlassian-conventions"
63
65
  },
64
66
  "@repo/internal": {
67
+ "design-system": "v1",
68
+ "dom-events": "use-bind-event-listener",
65
69
  "ui-components": "lite-mode",
66
70
  "analytics": "analytics-next",
67
71
  "styling": [
package/report.api.md ADDED
@@ -0,0 +1,57 @@
1
+ ## API Report File for "@atlaskit/section-message"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ /// <reference types="react" />
7
+
8
+ import { NamedExoticComponent } from 'react';
9
+ import { default as React_2 } from 'react';
10
+ import type { ReactElement } from 'react';
11
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
12
+
13
+ /** Appearance determines the icon and background color pairing indicating the message type */
14
+ export declare type Appearance =
15
+ | 'information'
16
+ | 'warning'
17
+ | 'error'
18
+ | 'success'
19
+ | 'discovery';
20
+
21
+ declare const SectionMessage: React_2.ForwardRefExoticComponent<
22
+ SectionMessageProps & React_2.RefAttributes<HTMLElement>
23
+ >;
24
+ export default SectionMessage;
25
+
26
+ export declare const SectionMessageAction: NamedExoticComponent<SectionMessageActionProps>;
27
+
28
+ export declare interface SectionMessageActionProps {
29
+ children: React.ReactNode;
30
+ linkComponent?: React.ComponentType<any>;
31
+ /**
32
+ * Click handler which will be attached to the rendered link button. The second argument can be used to
33
+ * track analytics data. See the tutorial in the analytics-next package for details.
34
+ */
35
+ onClick?: (
36
+ e: React.MouseEvent<HTMLElement>,
37
+ analyticsEvent: UIAnalyticsEvent,
38
+ ) => void;
39
+ /**
40
+ * The URL that the rendered link button will point to.
41
+ */
42
+ href?: string;
43
+ testId?: string;
44
+ }
45
+
46
+ export declare interface SectionMessageProps {
47
+ /** The appearance styling to use for the section message. */
48
+ appearance?: Appearance;
49
+ children: React.ReactNode;
50
+ title?: string;
51
+ actions?: ReactElement | ReactElement<SectionMessageActionProps>[];
52
+ icon?: React.ElementType;
53
+ testId?: string;
54
+ }
55
+
56
+ export {};
57
+ ```