@synerise/ds-section-message 1.0.2 → 1.0.4

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
@@ -3,6 +3,22 @@
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.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.3...@synerise/ds-section-message@1.0.4) (2025-08-14)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-section-message
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.2...@synerise/ds-section-message@1.0.3) (2025-07-24)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-section-message
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.0.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-section-message@1.0.1...@synerise/ds-section-message@1.0.2) (2025-07-18)
7
23
 
8
24
 
@@ -0,0 +1,5 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type SectionType } from './SectionMessage.types';
3
+ export declare const ICONS: Record<SectionType, ReactNode>;
4
+ export declare const DEFAULT_ICON: React.JSX.Element;
5
+ export declare const SECTION_TYPES: readonly ["positive", "notice", "negative", "neutral", "supply", "service", "entity"];
@@ -9,4 +9,5 @@ export var ICONS = {
9
9
  service: /*#__PURE__*/React.createElement(UpdateDataM, null),
10
10
  entity: /*#__PURE__*/React.createElement(NotificationsReceiveM, null)
11
11
  };
12
- export var DEFAULT_ICON = /*#__PURE__*/React.createElement(WarningFillM, null);
12
+ export var DEFAULT_ICON = /*#__PURE__*/React.createElement(WarningFillM, null);
13
+ export var SECTION_TYPES = ['positive', 'notice', 'negative', 'neutral', 'supply', 'service', 'entity'];
@@ -3,8 +3,9 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
4
  import React, { useMemo } from 'react';
5
5
  import Icon, { CloseM } from '@synerise/ds-icon';
6
+ import { DEFAULT_ICON, ICONS } from './SectionMessage.const';
6
7
  import * as S from './SectionMessage.styles';
7
- import { DEFAULT_ICON, ICONS } from './utils/utils';
8
+ import { isSectionType } from './SectionMessage.utils';
8
9
  var SectionMessage = function SectionMessage(_ref) {
9
10
  var icon = _ref.icon,
10
11
  type = _ref.type,
@@ -35,7 +36,7 @@ var SectionMessage = function SectionMessage(_ref) {
35
36
  if (icon) {
36
37
  return icon;
37
38
  }
38
- if (ICONS[type]) {
39
+ if (isSectionType(type)) {
39
40
  return ICONS[type];
40
41
  }
41
42
  return DEFAULT_ICON;
@@ -6,15 +6,15 @@ export declare const AlertContent: import("styled-components").StyledComponent<"
6
6
  export declare const AllContent: import("styled-components").StyledComponent<"div", any, {}, never>;
7
7
  export declare const Text: import("styled-components").StyledComponent<"div", any, {}, never>;
8
8
  export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
9
- color?: ColorType | undefined;
10
- customColorIcon?: CustomColorType | undefined;
9
+ color?: ColorType;
10
+ customColorIcon?: CustomColorType;
11
11
  }, never>;
12
12
  export declare const IconCloseWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const ButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
14
14
  export declare const SuffixWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
15
15
  export declare const Container: import("styled-components").StyledComponent<"div", any, {
16
- color?: ColorType | undefined;
17
- customColor?: CustomColorType | undefined;
16
+ color?: ColorType;
17
+ customColor?: CustomColorType;
18
18
  }, never>;
19
19
  export declare const WrapperSectionMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
20
20
  export declare const AlertMessage: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -1,8 +1,9 @@
1
1
  import type { ReactElement, ReactNode } from 'react';
2
2
  import type { WithHTMLAttributes } from '@synerise/ds-utils';
3
+ import { type SECTION_TYPES } from './SectionMessage.const';
3
4
  export type CustomColorType = 'blue' | 'grey' | 'red' | 'green' | 'yellow' | 'pink' | 'mars' | 'orange' | 'fern' | 'cyan' | 'purple' | 'violet';
4
5
  export type ColorType = 'grey' | 'red' | 'green' | 'yellow' | 'violet' | 'purple' | 'cyan';
5
- export type SectionType = 'positive' | 'notice' | 'negative' | 'neutral' | 'supply' | 'service' | 'entity';
6
+ export type SectionType = (typeof SECTION_TYPES)[number];
6
7
  export type SectionMessageProps = WithHTMLAttributes<HTMLDivElement, {
7
8
  message?: ReactNode;
8
9
  type: string | SectionType;
@@ -0,0 +1,2 @@
1
+ import { type SectionType } from './SectionMessage.types';
2
+ export declare const isSectionType: (type: string) => type is SectionType;
@@ -0,0 +1,4 @@
1
+ import { SECTION_TYPES } from './SectionMessage.const';
2
+ export var isSectionType = function isSectionType(type) {
3
+ return SECTION_TYPES.includes(type);
4
+ };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { default } from './SectionMessage';
2
- export type { SectionMessageProps } from './SectionMessage.types';
2
+ export type { SectionMessageProps, SectionType, ColorType, CustomColorType, } from './SectionMessage.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-section-message",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "SectionMessage UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,13 +34,13 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-icon": "^1.6.1",
38
- "@synerise/ds-utils": "^1.3.1"
37
+ "@synerise/ds-icon": "^1.7.0",
38
+ "@synerise/ds-utils": "^1.4.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@synerise/ds-core": "*",
42
42
  "react": ">=16.9.0 <= 18.3.1",
43
43
  "styled-components": "^5.3.3"
44
44
  },
45
- "gitHead": "d43933cb79c98e808b61bbe341f03e1e602d6193"
45
+ "gitHead": "408d73cc145b6c8c61f3e70dce05badf3ad1ffde"
46
46
  }
@@ -1,4 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- import { type SectionType } from '../SectionMessage.types';
3
- export declare const ICONS: Record<SectionType, ReactNode>;
4
- export declare const DEFAULT_ICON: React.JSX.Element;