@atlaskit/section-message 6.4.0 → 6.4.2

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,17 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 6.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 6.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 6.4.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  /**
4
4
  * Appearance determines the icon and background color pairing indicating the message type
5
5
  */
6
- export declare type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
6
+ export type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
7
7
  export interface SectionMessageProps {
8
8
  /**
9
9
  * The appearance styling to use for the section message.
@@ -0,0 +1,2 @@
1
+ export { default } from '../section-message-action';
2
+ export type { SectionMessageActionProps } from '../types';
@@ -0,0 +1,2 @@
1
+ export { default } from '../section-message';
2
+ export type { SectionMessageProps } from '../types';
@@ -0,0 +1 @@
1
+ export type { Appearance, SectionMessageProps, SectionMessageActionProps, } from '../types';
@@ -0,0 +1,3 @@
1
+ export { default } from './section-message';
2
+ export { default as SectionMessageAction } from './section-message-action';
3
+ export type { Appearance, SectionMessageProps, SectionMessageActionProps, } from './types';
@@ -0,0 +1,16 @@
1
+ import { ComponentType } from 'react';
2
+ import type { Appearance, SectionMessageProps } from '../types';
3
+ interface AppearanceIconSchema {
4
+ backgroundColor: string;
5
+ primaryIconColor: string;
6
+ Icon: ComponentType<any>;
7
+ }
8
+ export declare const appearanceIconSchema: {
9
+ [key in Appearance]: AppearanceIconSchema;
10
+ };
11
+ export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
12
+ Icon: "symbol" | "object" | "head" | "link" | "source" | "body" | "path" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any>;
13
+ backgroundColor: string;
14
+ primaryIconColor: string;
15
+ };
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
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 separator in between actions.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/section-message/examples#actions)
11
+ */
12
+ declare const SectionMessageAction: React.NamedExoticComponent<SectionMessageActionProps>;
13
+ export default SectionMessageAction;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { SectionMessageProps } from './types';
3
+ /**
4
+ * __Section message__
5
+ *
6
+ * A section message is used to alert users to a particular section of the screen.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/section-message/examples)
9
+ * - [Code](https://atlassian.design/components/section-message/code)
10
+ * - [Usage](https://atlassian.design/components/section-message/usage)
11
+ */
12
+ declare const SectionMessage: React.ForwardRefExoticComponent<SectionMessageProps & React.RefAttributes<HTMLElement>>;
13
+ export default SectionMessage;
@@ -0,0 +1,70 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ /**
4
+ * Appearance determines the icon and background color pairing indicating the message type
5
+ */
6
+ export type Appearance = 'information' | 'warning' | 'error' | 'success' | 'discovery';
7
+ export interface SectionMessageProps {
8
+ /**
9
+ * The appearance styling to use for the section message.
10
+ */
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
+ */
16
+ children: React.ReactNode;
17
+ /**
18
+ * The heading of the section message.
19
+ */
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
+ */
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
+ */
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
+ */
40
+ testId?: string;
41
+ }
42
+ export interface SectionMessageActionProps {
43
+ /**
44
+ * The text that needs to be displayed for section message action.
45
+ */
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
+ */
55
+ linkComponent?: React.ComponentType<any>;
56
+ /**
57
+ * Click handler which will be attached to the rendered link button. The second argument can be used to
58
+ * track analytics data. See the tutorial in the analytics-next package for details.
59
+ */
60
+ onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
61
+ /**
62
+ * The URL that the rendered link button will point to.
63
+ */
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
+ */
69
+ testId?: string;
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
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/"
@@ -12,6 +12,14 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.5 <4.9": {
17
+ "*": [
18
+ "dist/types-ts4.5/*",
19
+ "dist/types-ts4.5/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.tsx",
17
25
  "atlassian": {
@@ -36,7 +44,7 @@
36
44
  "@atlaskit/icon": "^21.12.0",
37
45
  "@atlaskit/primitives": "^0.9.0",
38
46
  "@atlaskit/theme": "^12.5.0",
39
- "@atlaskit/tokens": "^1.3.0",
47
+ "@atlaskit/tokens": "^1.4.0",
40
48
  "@babel/runtime": "^7.0.0"
41
49
  },
42
50
  "peerDependencies": {
@@ -59,7 +67,7 @@
59
67
  "react-dom": "^16.8.0",
60
68
  "react-test-renderer": "^16.8.0",
61
69
  "storybook-addon-performance": "^0.16.0",
62
- "typescript": "4.5.5"
70
+ "typescript": "~4.9.5"
63
71
  },
64
72
  "techstack": {
65
73
  "@atlassian/frontend": {
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/entry-points/section-message.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/entry-points/section-message.d.ts"
11
+ "../dist/types-ts4.5/entry-points/section-message.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/entry-points/section-message-action.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/entry-points/section-message-action.d.ts"
11
+ "../dist/types-ts4.5/entry-points/section-message-action.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/entry-points/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/entry-points/types.d.ts"
11
+ "../dist/types-ts4.5/entry-points/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }