@synerise/ds-section-message 1.0.24 → 1.0.26
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 +10 -0
- package/README.md +21 -17
- package/dist/SectionMessage.const.d.ts +2 -2
- package/dist/SectionMessage.const.js +17 -12
- package/dist/SectionMessage.d.ts +2 -2
- package/dist/SectionMessage.js +52 -49
- package/dist/SectionMessage.styles.d.ts +20 -20
- package/dist/SectionMessage.styles.js +50 -62
- package/dist/SectionMessage.types.d.ts +2 -2
- package/dist/SectionMessage.types.js +1 -1
- package/dist/SectionMessage.utils.d.ts +2 -2
- package/dist/SectionMessage.utils.js +51 -45
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.26](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.25...@synerise/ds-section-message@1.0.26) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-section-message
|
|
9
|
+
|
|
10
|
+
## [1.0.25](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.24...@synerise/ds-section-message@1.0.25) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **section-message:** change border to be ass div ([bf52965](https://github.com/Synerise/synerise-design/commit/bf5296551846c1c271f3130926ed6a2b6727fb24))
|
|
15
|
+
|
|
6
16
|
## [1.0.24](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.23...@synerise/ds-section-message@1.0.24) (2026-02-19)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @synerise/ds-section-message
|
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ SectionMessage UI Component
|
|
|
11
11
|
npm i @synerise/ds-section-message
|
|
12
12
|
or
|
|
13
13
|
yarn add @synerise/ds-section-message
|
|
14
|
+
or
|
|
15
|
+
pnpm add @synerise/ds-section-message
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
## Usage
|
|
@@ -28,20 +30,22 @@ import SectionMessage from '@synerise/ds-section-message'
|
|
|
28
30
|
|
|
29
31
|
## API
|
|
30
32
|
|
|
31
|
-
| Property | Description
|
|
32
|
-
| --------------- |
|
|
33
|
-
| type |
|
|
34
|
-
| message |
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| withClose |
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
33
|
+
| Property | Description | Type | Default |
|
|
34
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------- |
|
|
35
|
+
| type | Visual variant. Options: `notice`, `negative`, `positive`, `neutral`, `supply`, `service`, `entity` | `SectionType` | — (required) |
|
|
36
|
+
| message | Bold heading text | `ReactNode` | - |
|
|
37
|
+
| description | Regular-weight body text rendered below the message | `ReactNode` | - |
|
|
38
|
+
| icon | Overrides the automatic type-derived icon (passed as `component` prop to `<Icon>`) | `ReactNode` | - |
|
|
39
|
+
| customIcon | Renders a React element directly inside the icon wrapper, bypassing the `<Icon>` wrapper; takes precedence over `icon` | `ReactElement` | - |
|
|
40
|
+
| customColor | Overrides background and border colours. Options: `red`, `blue`, `green`, `yellow`, `grey`, `purple`, `violet`, `cyan`, `fern`, `orange`, `mars`, `pink` | `CustomColorType` | - |
|
|
41
|
+
| customColorIcon | Overrides the icon and top-border colour. Same options as `customColor` | `CustomColorType` | - |
|
|
42
|
+
| showMoreLabel | Label for the "show more" link; only rendered when `onShowMore` is also provided | `ReactNode` | - |
|
|
43
|
+
| onShowMore | Callback executed when the "show more" link is clicked; requires `showMoreLabel` | `() => void` | - |
|
|
44
|
+
| onClose | Callback executed when the close button is clicked; requires `withClose` to be truthy | `() => void` | - |
|
|
45
|
+
| withClose | When truthy, shows a close button in the right-hand area | `ReactNode` | - |
|
|
46
|
+
| suffixel | Content placed in the right-hand action area, before the close button | `ReactNode` | - |
|
|
47
|
+
| moreButtons | Additional action content rendered inside the content area | `ReactNode` | - |
|
|
48
|
+
| withEmphasis | Bold inline content; only rendered when `withLink` is falsy | `ReactNode` | - |
|
|
49
|
+
| withLink | Underlined link content; rendered instead of `withEmphasis`; also adjusts content area padding | `ReactNode` | - |
|
|
50
|
+
| unorderedList | List content; only rendered when `moreButtons` is falsy | `ReactNode` | - |
|
|
51
|
+
| color | **Deprecated** — use `customColor` instead | `ColorType` | - |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { SectionType } from './SectionMessage.types';
|
|
3
3
|
export declare const ICONS: Record<SectionType, ReactNode>;
|
|
4
4
|
export declare const DEFAULT_ICON: React.JSX.Element;
|
|
5
5
|
export declare const SECTION_TYPES: SectionType[];
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
positive:
|
|
5
|
-
notice:
|
|
6
|
-
negative:
|
|
7
|
-
neutral:
|
|
8
|
-
supply:
|
|
9
|
-
service:
|
|
10
|
-
entity:
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WarningM, NotificationsReceiveM, UpdateDataM, UserUpM, InfoM, Check2M } from "@synerise/ds-icon";
|
|
3
|
+
const ICONS = {
|
|
4
|
+
positive: /* @__PURE__ */ jsx(Check2M, {}),
|
|
5
|
+
notice: /* @__PURE__ */ jsx(WarningM, {}),
|
|
6
|
+
negative: /* @__PURE__ */ jsx(WarningM, {}),
|
|
7
|
+
neutral: /* @__PURE__ */ jsx(InfoM, {}),
|
|
8
|
+
supply: /* @__PURE__ */ jsx(UserUpM, {}),
|
|
9
|
+
service: /* @__PURE__ */ jsx(UpdateDataM, {}),
|
|
10
|
+
entity: /* @__PURE__ */ jsx(NotificationsReceiveM, {})
|
|
11
|
+
};
|
|
12
|
+
const DEFAULT_ICON = /* @__PURE__ */ jsx(WarningM, {});
|
|
13
|
+
const SECTION_TYPES = ["positive", "notice", "negative", "neutral", "supply", "service", "entity"];
|
|
14
|
+
export {
|
|
15
|
+
DEFAULT_ICON,
|
|
16
|
+
ICONS,
|
|
17
|
+
SECTION_TYPES
|
|
11
18
|
};
|
|
12
|
-
export var DEFAULT_ICON = /*#__PURE__*/React.createElement(WarningM, null);
|
|
13
|
-
export var SECTION_TYPES = ['positive', 'notice', 'negative', 'neutral', 'supply', 'service', 'entity'];
|
package/dist/SectionMessage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SectionMessageProps } from './SectionMessage.types';
|
|
3
3
|
declare const SectionMessage: ({ icon, type, message, description, showMoreLabel, onShowMore, onClose, suffixel, moreButtons, withEmphasis, withLink, unorderedList, withClose, customColor, customColorIcon, customIcon, ...htmlAttributes }: SectionMessageProps) => React.JSX.Element;
|
|
4
4
|
export default SectionMessage;
|
package/dist/SectionMessage.js
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import Icon, { CloseM } from "@synerise/ds-icon";
|
|
4
|
+
import { ICONS, DEFAULT_ICON } from "./SectionMessage.const.js";
|
|
5
|
+
import { AlertContent, AlertMessage, Text, AlertDescription, LinkWrapper, EmphasisWrapper, AlertShowMore, Container, WrapperSectionMessage, AllContent, IconWrapper, ButtonWrapper, SuffixWrapper, IconCloseWrapper } from "./SectionMessage.styles.js";
|
|
6
|
+
import { isSectionType } from "./SectionMessage.utils.js";
|
|
7
|
+
const SectionMessage = ({
|
|
8
|
+
icon,
|
|
9
|
+
type,
|
|
10
|
+
message,
|
|
11
|
+
description,
|
|
12
|
+
showMoreLabel,
|
|
13
|
+
onShowMore,
|
|
14
|
+
onClose,
|
|
15
|
+
suffixel,
|
|
16
|
+
moreButtons,
|
|
17
|
+
withEmphasis,
|
|
18
|
+
withLink,
|
|
19
|
+
unorderedList,
|
|
20
|
+
withClose,
|
|
21
|
+
customColor,
|
|
22
|
+
customColorIcon,
|
|
23
|
+
customIcon,
|
|
24
|
+
...htmlAttributes
|
|
25
|
+
}) => {
|
|
26
|
+
const renderMessage = useMemo(() => {
|
|
27
|
+
return /* @__PURE__ */ jsxs(AlertContent, { withLink, children: [
|
|
28
|
+
message && /* @__PURE__ */ jsx(AlertMessage, { children: message }),
|
|
29
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
30
|
+
description && /* @__PURE__ */ jsx(AlertDescription, { children: description }),
|
|
31
|
+
withLink && /* @__PURE__ */ jsx(LinkWrapper, { children: withLink }),
|
|
32
|
+
withEmphasis && !withLink && /* @__PURE__ */ jsx(EmphasisWrapper, { children: withEmphasis })
|
|
33
|
+
] }),
|
|
34
|
+
onShowMore && showMoreLabel && /* @__PURE__ */ jsx(AlertShowMore, { onClick: onShowMore, children: showMoreLabel }),
|
|
35
|
+
moreButtons,
|
|
36
|
+
unorderedList && !moreButtons && unorderedList
|
|
37
|
+
] });
|
|
33
38
|
}, [message, description, showMoreLabel, onShowMore, moreButtons, withEmphasis, withLink, unorderedList]);
|
|
34
|
-
|
|
39
|
+
const renderIcon = useMemo(() => {
|
|
35
40
|
if (icon) {
|
|
36
41
|
return icon;
|
|
37
42
|
}
|
|
@@ -40,22 +45,20 @@ var SectionMessage = function SectionMessage(_ref) {
|
|
|
40
45
|
}
|
|
41
46
|
return DEFAULT_ICON;
|
|
42
47
|
}, [icon, type]);
|
|
43
|
-
|
|
48
|
+
const handleClose = () => {
|
|
44
49
|
onClose && onClose();
|
|
45
50
|
};
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})))));
|
|
51
|
+
return /* @__PURE__ */ jsx(Container, { "data-testid": `ds-section-message-${type}`, type, customColor, ...htmlAttributes, children: /* @__PURE__ */ jsxs(WrapperSectionMessage, { children: [
|
|
52
|
+
/* @__PURE__ */ jsxs(AllContent, { children: [
|
|
53
|
+
/* @__PURE__ */ jsx(IconWrapper, { type, customColorIcon, children: customIcon || /* @__PURE__ */ jsx(Icon, { component: renderIcon }) }),
|
|
54
|
+
renderMessage
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsxs(ButtonWrapper, { children: [
|
|
57
|
+
suffixel && /* @__PURE__ */ jsx(SuffixWrapper, { children: suffixel }),
|
|
58
|
+
withClose && /* @__PURE__ */ jsx(IconCloseWrapper, { onClick: handleClose, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) })
|
|
59
|
+
] })
|
|
60
|
+
] }) });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
SectionMessage as default
|
|
60
64
|
};
|
|
61
|
-
export default SectionMessage;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export declare const AlertContent: import(
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CustomColorType, SectionType } from './SectionMessage.types';
|
|
3
|
+
export declare const AlertContent: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
withLink?: ReactNode;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const AllContent: import(
|
|
7
|
-
export declare const Text: import(
|
|
8
|
-
export declare const IconWrapper: import(
|
|
6
|
+
export declare const AllContent: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const Text: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
9
9
|
type?: SectionType;
|
|
10
10
|
customColorIcon?: CustomColorType;
|
|
11
11
|
}, never>;
|
|
12
|
-
export declare const IconCloseWrapper: import(
|
|
13
|
-
export declare const ButtonWrapper: import(
|
|
14
|
-
export declare const SuffixWrapper: import(
|
|
15
|
-
export declare const Container: import(
|
|
12
|
+
export declare const IconCloseWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const ButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const SuffixWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const Container: import('styled-components').StyledComponent<"div", any, {
|
|
16
16
|
type?: SectionType;
|
|
17
17
|
customColor?: CustomColorType;
|
|
18
18
|
}, never>;
|
|
19
|
-
export declare const WrapperSectionMessage: import(
|
|
20
|
-
export declare const AlertMessage: import(
|
|
21
|
-
export declare const AlertDescription: import(
|
|
22
|
-
export declare const EmphasisWrapper: import(
|
|
23
|
-
export declare const LinkWrapper: import(
|
|
24
|
-
export declare const AlertShowMore: import(
|
|
25
|
-
export declare const NumberWrapper: import(
|
|
26
|
-
export declare const IconOrderWrapper: import(
|
|
27
|
-
export declare const OrderWrapper: import(
|
|
28
|
-
export declare const Wrapper: import(
|
|
19
|
+
export declare const WrapperSectionMessage: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const AlertMessage: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
21
|
+
export declare const AlertDescription: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
22
|
+
export declare const EmphasisWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
23
|
+
export declare const LinkWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
24
|
+
export declare const AlertShowMore: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
25
|
+
export declare const NumberWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
26
|
+
export declare const IconOrderWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
27
|
+
export declare const OrderWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
28
|
+
export declare const Wrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,106 +1,94 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { getColorBackground, getColorBorder, getColorIconAndBorderTop } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { getColorBackground, getColorBorder, getColorIconAndBorderTop } from "./SectionMessage.utils.js";
|
|
3
|
+
const AlertContent = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "SectionMessagestyles__AlertContent",
|
|
5
5
|
componentId: "sc-1qohcjm-0"
|
|
6
|
-
})(["display:flex;min-width:0;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding:", ";"],
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
export var AllContent = styled.div.withConfig({
|
|
6
|
+
})(["display:flex;min-width:0;flex-direction:column;align-items:flex-start;justify-content:flex-start;padding:", ";"], (props) => props.withLink ? "12px 0 11px" : "12px 0");
|
|
7
|
+
const AllContent = /* @__PURE__ */ styled.div.withConfig({
|
|
10
8
|
displayName: "SectionMessagestyles__AllContent",
|
|
11
9
|
componentId: "sc-1qohcjm-1"
|
|
12
10
|
})(["display:flex;min-width:0;color:inherit;"]);
|
|
13
|
-
|
|
11
|
+
const Text = /* @__PURE__ */ styled.div.withConfig({
|
|
14
12
|
displayName: "SectionMessagestyles__Text",
|
|
15
13
|
componentId: "sc-1qohcjm-2"
|
|
16
14
|
})(["display:flex;min-width:0;width:100%;"]);
|
|
17
|
-
|
|
15
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
18
16
|
displayName: "SectionMessagestyles__IconWrapper",
|
|
19
17
|
componentId: "sc-1qohcjm-3"
|
|
20
|
-
})(["margin:10px 12px;display:flex;color:", ";"],
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
export var IconCloseWrapper = styled.div.withConfig({
|
|
18
|
+
})(["margin:10px 12px;display:flex;color:", ";"], (props) => props.customColorIcon ? props.theme.palette[`${props.customColorIcon}-600`] : getColorIconAndBorderTop(props.type, props.theme));
|
|
19
|
+
const IconCloseWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
24
20
|
displayName: "SectionMessagestyles__IconCloseWrapper",
|
|
25
21
|
componentId: "sc-1qohcjm-4"
|
|
26
|
-
})(["margin:3px 5px 2px;cursor:pointer;color:", ";"],
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
export var ButtonWrapper = styled.div.withConfig({
|
|
22
|
+
})(["margin:3px 5px 2px;cursor:pointer;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
23
|
+
const ButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
30
24
|
displayName: "SectionMessagestyles__ButtonWrapper",
|
|
31
25
|
componentId: "sc-1qohcjm-5"
|
|
32
26
|
})(["padding:6px 8px 0 8px;display:flex;"]);
|
|
33
|
-
|
|
27
|
+
const SuffixWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
34
28
|
displayName: "SectionMessagestyles__SuffixWrapper",
|
|
35
29
|
componentId: "sc-1qohcjm-6"
|
|
36
30
|
})(["display:flex;"]);
|
|
37
|
-
|
|
31
|
+
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
38
32
|
displayName: "SectionMessagestyles__Container",
|
|
39
33
|
componentId: "sc-1qohcjm-7"
|
|
40
|
-
})(["width:100%;align-items:center;justify-content:center;background-color:", ";border:1px solid ", ";border-top:2px
|
|
41
|
-
|
|
42
|
-
}, function (props) {
|
|
43
|
-
return props.customColor ? props.theme.palette[props.customColor + "-200"] : getColorBorder(props.type, props.theme);
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return props.customColor ? props.theme.palette[props.customColor + "-600"] : getColorIconAndBorderTop(props.type, props.theme);
|
|
46
|
-
});
|
|
47
|
-
export var WrapperSectionMessage = styled.div.withConfig({
|
|
34
|
+
})(["width:100%;align-items:center;justify-content:center;position:relative;background-color:", ";border:1px solid ", ";border-radius:3px;&::after{content:'';position:absolute;top:-1px;left:-1px;right:-1px;height:2px;border-radius:3px 3px 0 0;background-color:", ";}"], (props) => props.customColor ? props.theme.palette[`${props.customColor}-050`] : getColorBackground(props.type, props.theme), (props) => props.customColor ? props.theme.palette[`${props.customColor}-200`] : getColorBorder(props.type, props.theme), (props) => props.customColor ? props.theme.palette[`${props.customColor}-600`] : getColorIconAndBorderTop(props.type, props.theme));
|
|
35
|
+
const WrapperSectionMessage = /* @__PURE__ */ styled.div.withConfig({
|
|
48
36
|
displayName: "SectionMessagestyles__WrapperSectionMessage",
|
|
49
37
|
componentId: "sc-1qohcjm-8"
|
|
50
38
|
})(["display:flex;font-size:13px;color:inherit;justify-content:space-between;"]);
|
|
51
|
-
|
|
39
|
+
const AlertMessage = /* @__PURE__ */ styled.span.withConfig({
|
|
52
40
|
displayName: "SectionMessagestyles__AlertMessage",
|
|
53
41
|
componentId: "sc-1qohcjm-9"
|
|
54
|
-
})(["font-size:13px;line-height:1.39;font-weight:500;overflow-wrap:break-word;min-width:0;width:100%;color:", ";"],
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
export var AlertDescription = styled.span.withConfig({
|
|
42
|
+
})(["font-size:13px;line-height:1.39;font-weight:500;overflow-wrap:break-word;min-width:0;width:100%;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
43
|
+
const AlertDescription = /* @__PURE__ */ styled.span.withConfig({
|
|
58
44
|
displayName: "SectionMessagestyles__AlertDescription",
|
|
59
45
|
componentId: "sc-1qohcjm-10"
|
|
60
|
-
})(["overflow-wrap:break-word;min-width:0;font-size:13px;line-height:1.39;font-weight:normal;padding-right:3px;margin-top:2px;color:", ";"],
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
export var EmphasisWrapper = styled.span.withConfig({
|
|
46
|
+
})(["overflow-wrap:break-word;min-width:0;font-size:13px;line-height:1.39;font-weight:normal;padding-right:3px;margin-top:2px;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
47
|
+
const EmphasisWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
64
48
|
displayName: "SectionMessagestyles__EmphasisWrapper",
|
|
65
49
|
componentId: "sc-1qohcjm-11"
|
|
66
50
|
})(["display:flex;font-size:13px;line-height:1.39;font-weight:500;margin-top:2px;color:inherit;"]);
|
|
67
|
-
|
|
51
|
+
const LinkWrapper = /* @__PURE__ */ styled.span.withConfig({
|
|
68
52
|
displayName: "SectionMessagestyles__LinkWrapper",
|
|
69
53
|
componentId: "sc-1qohcjm-12"
|
|
70
54
|
})(["display:flex;font-size:13px;line-height:1.5;font-weight:400;margin-top:2px;color:inherit;text-decoration:underline;cursor:pointer;a{color:inherit;}"]);
|
|
71
|
-
|
|
55
|
+
const AlertShowMore = /* @__PURE__ */ styled.span.withConfig({
|
|
72
56
|
displayName: "SectionMessagestyles__AlertShowMore",
|
|
73
57
|
componentId: "sc-1qohcjm-13"
|
|
74
58
|
})(["display:flex;font-size:13px;font-weight:500;color:inherit;text-decoration:underline;cursor:pointer;margin-top:6px;"]);
|
|
75
|
-
|
|
59
|
+
const NumberWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
76
60
|
displayName: "SectionMessagestyles__NumberWrapper",
|
|
77
61
|
componentId: "sc-1qohcjm-14"
|
|
78
|
-
})(["margin-left:4px;color:", ";cursor:pointer;&:hover{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;color:", ";}"],
|
|
79
|
-
|
|
80
|
-
}, function (props) {
|
|
81
|
-
return props.theme.palette['grey-400'];
|
|
82
|
-
}, function (props) {
|
|
83
|
-
return props.theme.palette['grey-700'];
|
|
84
|
-
});
|
|
85
|
-
export var IconOrderWrapper = styled.div.withConfig({
|
|
62
|
+
})(["margin-left:4px;color:", ";cursor:pointer;&:hover{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;color:", ";}"], (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-700"]);
|
|
63
|
+
const IconOrderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
86
64
|
displayName: "SectionMessagestyles__IconOrderWrapper",
|
|
87
65
|
componentId: "sc-1qohcjm-15"
|
|
88
|
-
})(["display:none;margin:-4px 0;svg{fill:", ";}&:hover{svg{fill:", ";cursor:pointer;}}"],
|
|
89
|
-
|
|
90
|
-
}, function (props) {
|
|
91
|
-
return props.theme.palette['blue-600'];
|
|
92
|
-
});
|
|
93
|
-
export var OrderWrapper = styled.div.withConfig({
|
|
66
|
+
})(["display:none;margin:-4px 0;svg{fill:", ";}&:hover{svg{fill:", ";cursor:pointer;}}"], (props) => props.theme.palette["grey-700"], (props) => props.theme.palette["blue-600"]);
|
|
67
|
+
const OrderWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
94
68
|
displayName: "SectionMessagestyles__OrderWrapper",
|
|
95
69
|
componentId: "sc-1qohcjm-16"
|
|
96
|
-
})(["display:flex;&:hover{", "{display:block;}", "{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;color:", ";}}"], IconOrderWrapper, NumberWrapper,
|
|
97
|
-
|
|
98
|
-
}, function (props) {
|
|
99
|
-
return props.theme.palette['grey-700'];
|
|
100
|
-
});
|
|
101
|
-
export var Wrapper = styled.div.withConfig({
|
|
70
|
+
})(["display:flex;&:hover{", "{display:block;}", "{background-image:linear-gradient( to right,", " 20%,rgba(255,255,255,0) 10% );background-color:transparent;background-position:bottom left;background-size:5px 1px;background-repeat:repeat-x;color:", ";}}"], IconOrderWrapper, NumberWrapper, (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-700"]);
|
|
71
|
+
const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
102
72
|
displayName: "SectionMessagestyles__Wrapper",
|
|
103
73
|
componentId: "sc-1qohcjm-17"
|
|
104
|
-
})(["margin-top:10px;color:", ";"],
|
|
105
|
-
|
|
106
|
-
|
|
74
|
+
})(["margin-top:10px;color:", ";"], (props) => props.theme.palette["grey-700"]);
|
|
75
|
+
export {
|
|
76
|
+
AlertContent,
|
|
77
|
+
AlertDescription,
|
|
78
|
+
AlertMessage,
|
|
79
|
+
AlertShowMore,
|
|
80
|
+
AllContent,
|
|
81
|
+
ButtonWrapper,
|
|
82
|
+
Container,
|
|
83
|
+
EmphasisWrapper,
|
|
84
|
+
IconCloseWrapper,
|
|
85
|
+
IconOrderWrapper,
|
|
86
|
+
IconWrapper,
|
|
87
|
+
LinkWrapper,
|
|
88
|
+
NumberWrapper,
|
|
89
|
+
OrderWrapper,
|
|
90
|
+
SuffixWrapper,
|
|
91
|
+
Text,
|
|
92
|
+
Wrapper,
|
|
93
|
+
WrapperSectionMessage
|
|
94
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type CustomColorType = 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
|
|
4
4
|
/** @deprecated */
|
|
5
5
|
export type ColorType = 'grey' | 'red' | 'green' | 'yellow' | 'violet' | 'purple' | 'cyan';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ThemePropsVars } from '@synerise/ds-core';
|
|
2
|
+
import { SectionType } from './SectionMessage.types';
|
|
3
3
|
export declare const isSectionType: (type: string) => type is SectionType;
|
|
4
4
|
export declare const getColorBackground: (type: SectionType, theme: ThemePropsVars) => string;
|
|
5
5
|
export declare const getColorIconAndBorderTop: (type: SectionType, theme: ThemePropsVars) => string;
|
|
@@ -1,67 +1,73 @@
|
|
|
1
|
-
import { SECTION_TYPES } from
|
|
2
|
-
|
|
1
|
+
import { SECTION_TYPES } from "./SectionMessage.const.js";
|
|
2
|
+
const isSectionType = (type) => {
|
|
3
3
|
return SECTION_TYPES.includes(type);
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
if (type ===
|
|
7
|
-
return theme.palette[
|
|
5
|
+
const getColorBackground = (type, theme) => {
|
|
6
|
+
if (type === "positive") {
|
|
7
|
+
return theme.palette["green-050"];
|
|
8
8
|
}
|
|
9
|
-
if (type ===
|
|
10
|
-
return theme.palette[
|
|
9
|
+
if (type === "negative") {
|
|
10
|
+
return theme.palette["red-050"];
|
|
11
11
|
}
|
|
12
|
-
if (type ===
|
|
13
|
-
return theme.palette[
|
|
12
|
+
if (type === "notice") {
|
|
13
|
+
return theme.palette["yellow-050"];
|
|
14
14
|
}
|
|
15
|
-
if (type ===
|
|
16
|
-
return theme.palette[
|
|
15
|
+
if (type === "service") {
|
|
16
|
+
return theme.palette["purple-050"];
|
|
17
17
|
}
|
|
18
|
-
if (type ===
|
|
19
|
-
return theme.palette[
|
|
18
|
+
if (type === "supply") {
|
|
19
|
+
return theme.palette["violet-050"];
|
|
20
20
|
}
|
|
21
|
-
if (type ===
|
|
22
|
-
return theme.palette[
|
|
21
|
+
if (type === "entity") {
|
|
22
|
+
return theme.palette["cyan-050"];
|
|
23
23
|
}
|
|
24
|
-
return theme.palette[
|
|
24
|
+
return theme.palette[`grey-050`];
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
if (type ===
|
|
28
|
-
return theme.palette[
|
|
26
|
+
const getColorIconAndBorderTop = (type, theme) => {
|
|
27
|
+
if (type === "positive") {
|
|
28
|
+
return theme.palette["green-600"];
|
|
29
29
|
}
|
|
30
|
-
if (type ===
|
|
31
|
-
return theme.palette[
|
|
30
|
+
if (type === "negative") {
|
|
31
|
+
return theme.palette["red-600"];
|
|
32
32
|
}
|
|
33
|
-
if (type ===
|
|
34
|
-
return theme.palette[
|
|
33
|
+
if (type === "notice") {
|
|
34
|
+
return theme.palette["yellow-600"];
|
|
35
35
|
}
|
|
36
|
-
if (type ===
|
|
37
|
-
return theme.palette[
|
|
36
|
+
if (type === "service") {
|
|
37
|
+
return theme.palette["purple-600"];
|
|
38
38
|
}
|
|
39
|
-
if (type ===
|
|
40
|
-
return theme.palette[
|
|
39
|
+
if (type === "supply") {
|
|
40
|
+
return theme.palette["violet-600"];
|
|
41
41
|
}
|
|
42
|
-
if (type ===
|
|
43
|
-
return theme.palette[
|
|
42
|
+
if (type === "entity") {
|
|
43
|
+
return theme.palette["cyan-600"];
|
|
44
44
|
}
|
|
45
|
-
return theme.palette[
|
|
45
|
+
return theme.palette[`grey-600`];
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
if (type ===
|
|
49
|
-
return theme.palette[
|
|
47
|
+
const getColorBorder = (type, theme) => {
|
|
48
|
+
if (type === "positive") {
|
|
49
|
+
return theme.palette["green-200"];
|
|
50
50
|
}
|
|
51
|
-
if (type ===
|
|
52
|
-
return theme.palette[
|
|
51
|
+
if (type === "negative") {
|
|
52
|
+
return theme.palette["red-200"];
|
|
53
53
|
}
|
|
54
|
-
if (type ===
|
|
55
|
-
return theme.palette[
|
|
54
|
+
if (type === "notice") {
|
|
55
|
+
return theme.palette["yellow-200"];
|
|
56
56
|
}
|
|
57
|
-
if (type ===
|
|
58
|
-
return theme.palette[
|
|
57
|
+
if (type === "service") {
|
|
58
|
+
return theme.palette["purple-200"];
|
|
59
59
|
}
|
|
60
|
-
if (type ===
|
|
61
|
-
return theme.palette[
|
|
60
|
+
if (type === "supply") {
|
|
61
|
+
return theme.palette["violet-200"];
|
|
62
62
|
}
|
|
63
|
-
if (type ===
|
|
64
|
-
return theme.palette[
|
|
63
|
+
if (type === "entity") {
|
|
64
|
+
return theme.palette["cyan-200"];
|
|
65
65
|
}
|
|
66
|
-
return theme.palette[
|
|
67
|
-
};
|
|
66
|
+
return theme.palette[`grey-200`];
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
getColorBackground,
|
|
70
|
+
getColorBorder,
|
|
71
|
+
getColorIconAndBorderTop,
|
|
72
|
+
isSectionType
|
|
73
|
+
};
|
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-section-message",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "SectionMessage UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"prepublish": "pnpm run build",
|
|
25
25
|
"types": "tsc --noEmit",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-icon": "^1.
|
|
39
|
-
"@synerise/ds-utils": "^1.
|
|
38
|
+
"@synerise/ds-icon": "^1.15.1",
|
|
39
|
+
"@synerise/ds-utils": "^1.7.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@synerise/ds-core": "*",
|
|
43
43
|
"react": ">=16.9.0 <= 18.3.1",
|
|
44
44
|
"styled-components": "^5.3.3"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
47
47
|
}
|