@atlaskit/section-message 6.4.1 → 6.4.3
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 +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/entry-points/section-message-action.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/section-message.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +3 -0
- package/dist/types-ts4.5/internal/appearance-icon.d.ts +16 -0
- package/dist/types-ts4.5/section-message-action.d.ts +13 -0
- package/dist/types-ts4.5/section-message.d.ts +13 -0
- package/dist/types-ts4.5/types.d.ts +70 -0
- package/package.json +5 -5
- package/tmp/api-report-tmp.d.ts +42 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/section-message
|
|
2
2
|
|
|
3
|
+
## 6.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 6.4.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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.
|
|
3
|
+
"version": "6.4.3",
|
|
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/"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"atlaskit:src": "src/index.tsx",
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Design System Team",
|
|
27
|
-
"releaseModel": "
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
28
|
"website": {
|
|
29
29
|
"name": "Section message",
|
|
30
30
|
"category": "Components"
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@atlaskit/button": "^16.7.0",
|
|
41
41
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
42
|
-
"@atlaskit/ds-explorations": "^2.
|
|
42
|
+
"@atlaskit/ds-explorations": "^2.2.0",
|
|
43
43
|
"@atlaskit/heading": "^1.3.0",
|
|
44
44
|
"@atlaskit/icon": "^21.12.0",
|
|
45
|
-
"@atlaskit/primitives": "^0.
|
|
45
|
+
"@atlaskit/primitives": "^0.10.0",
|
|
46
46
|
"@atlaskit/theme": "^12.5.0",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
|
|
7
|
+
import { default as React_2 } from 'react';
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
10
|
+
|
|
11
|
+
// @public
|
|
12
|
+
export type Appearance = 'discovery' | 'error' | 'information' | 'success' | 'warning';
|
|
13
|
+
|
|
14
|
+
// @public
|
|
15
|
+
const SectionMessage: React_2.ForwardRefExoticComponent<SectionMessageProps & React_2.RefAttributes<HTMLElement>>;
|
|
16
|
+
export default SectionMessage;
|
|
17
|
+
|
|
18
|
+
// @public
|
|
19
|
+
export const SectionMessageAction: React_2.NamedExoticComponent<SectionMessageActionProps>;
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
export interface SectionMessageActionProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
href?: string;
|
|
25
|
+
linkComponent?: React.ComponentType<any>;
|
|
26
|
+
onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
27
|
+
testId?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// @public (undocumented)
|
|
31
|
+
export interface SectionMessageProps {
|
|
32
|
+
actions?: ReactElement | ReactElement<SectionMessageActionProps>[];
|
|
33
|
+
appearance?: Appearance;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
icon?: React.ElementType;
|
|
36
|
+
testId?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// (No @packageDocumentation comment for this package)
|
|
41
|
+
|
|
42
|
+
```
|