@sb1/ffe-message-box-react 10.0.31 → 11.0.1

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/lib/texts.js CHANGED
@@ -1,53 +1,46 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.texts = void 0;
7
4
  var nb = {
8
- error: {
9
- ariaLabel: 'Feilmelding'
10
- },
11
- info: {
12
- ariaLabel: 'Infomelding'
13
- },
14
- success: {
15
- ariaLabel: 'Suksessmelding'
16
- },
17
- tip: {
18
- ariaLabel: 'Tipsmelding'
19
- }
5
+ error: {
6
+ ariaLabel: 'Feilmelding',
7
+ },
8
+ info: {
9
+ ariaLabel: 'Infomelding',
10
+ },
11
+ success: {
12
+ ariaLabel: 'Suksessmelding',
13
+ },
14
+ tip: {
15
+ ariaLabel: 'Tipsmelding',
16
+ },
20
17
  };
21
18
  var nn = {
22
- error: {
23
- ariaLabel: 'Feilmelding'
24
- },
25
- info: {
26
- ariaLabel: 'Infomelding'
27
- },
28
- success: {
29
- ariaLabel: 'Suksessmelding'
30
- },
31
- tip: {
32
- ariaLabel: 'Tipsmelding'
33
- }
19
+ error: {
20
+ ariaLabel: 'Feilmelding',
21
+ },
22
+ info: {
23
+ ariaLabel: 'Infomelding',
24
+ },
25
+ success: {
26
+ ariaLabel: 'Suksessmelding',
27
+ },
28
+ tip: {
29
+ ariaLabel: 'Tipsmelding',
30
+ },
34
31
  };
35
32
  var en = {
36
- error: {
37
- ariaLabel: 'Error message'
38
- },
39
- info: {
40
- ariaLabel: 'Info message'
41
- },
42
- success: {
43
- ariaLabel: 'Success message'
44
- },
45
- tip: {
46
- ariaLabel: 'Tip message'
47
- }
33
+ error: {
34
+ ariaLabel: 'Error message',
35
+ },
36
+ info: {
37
+ ariaLabel: 'Info message',
38
+ },
39
+ success: {
40
+ ariaLabel: 'Success message',
41
+ },
42
+ tip: {
43
+ ariaLabel: 'Tip message',
44
+ },
48
45
  };
49
- var _default = exports.default = {
50
- nb: nb,
51
- nn: nn,
52
- en: en
53
- };
46
+ exports.texts = { nb: nb, nn: nn, en: en };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-message-box-react",
3
- "version": "10.0.31",
3
+ "version": "11.0.1",
4
4
  "license": "MIT",
5
5
  "author": "SpareBank 1",
6
6
  "files": [
@@ -17,10 +17,10 @@
17
17
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
18
18
  },
19
19
  "scripts": {
20
- "build": "ffe-buildtool babel",
20
+ "build": "ffe-buildtool tsc",
21
21
  "watch": "ffe-buildtool babel-watch",
22
- "lint": "eslint src",
23
- "lint:fix": "eslint src --fix",
22
+ "lint": "eslint src --ext ts,tsx",
23
+ "lint:fix": "eslint src --fix --ext ts,tsx",
24
24
  "test": "ffe-buildtool jest",
25
25
  "test:watch": "ffe-buildtool jest --watch"
26
26
  },
@@ -32,7 +32,6 @@
32
32
  "devDependencies": {
33
33
  "@sb1/ffe-buildtool": "^0.6.1",
34
34
  "eslint": "^8.57.0",
35
- "prop-types": "^15.7.2",
36
35
  "react": "^16.9.0",
37
36
  "react-dom": "^16.9.0"
38
37
  },
@@ -42,5 +41,5 @@
42
41
  "publishConfig": {
43
42
  "access": "public"
44
43
  },
45
- "gitHead": "cc48a1d6a065e4e79544b61959d62ada40030cae"
44
+ "gitHead": "f60e155135540d2dd5b2b8cd0ac379c2a2dcb09d"
46
45
  }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface BaseMessageProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {
3
+ icon?: React.ReactNode;
4
+ title?: React.ReactNode;
5
+ /** HTML element for the title */
6
+ titleElement?: string;
7
+ /**
8
+ * Internal type enum for specifying the style of message box. Should not be used directly
9
+ * @ignore
10
+ */
11
+ type: 'success' | 'error' | 'tips' | 'info';
12
+ /** Adds alternative styling for better contrast on certain backgrounds */
13
+ onColoredBg?: boolean;
14
+ ariaLabel?: string;
15
+ role?: 'alert' | 'group';
16
+ }
17
+ export declare const BaseMessage: React.FC<BaseMessageProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { BaseMessageProps } from './BaseMessage';
3
+ export interface ErrorMessageProps extends Omit<BaseMessageProps, 'type'> {
4
+ /** When false, role is not set to alert, avoids message from being read up immediately after page load. Default value is true. */
5
+ alert?: boolean;
6
+ locale?: 'nb' | 'nn' | 'en';
7
+ }
8
+ export declare const ErrorMessage: React.FC<ErrorMessageProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BaseMessageProps } from './BaseMessage';
3
+ export interface InfoMessageProps extends Omit<BaseMessageProps, 'type'> {
4
+ locale?: 'nb' | 'nn' | 'en';
5
+ }
6
+ export declare const InfoMessage: React.FC<InfoMessageProps>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface InfoMessageListItemProps {
3
+ href: string;
4
+ children: NonNullable<React.ReactNode>;
5
+ }
6
+ export declare const InfoMessageListItem: React.FC<InfoMessageListItemProps>;
7
+ export interface InfoMessageListProps {
8
+ children: NonNullable<React.ReactNode>;
9
+ }
10
+ export declare const InfoMessageList: React.FC<InfoMessageListProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BaseMessageProps } from './BaseMessage';
3
+ export interface SuccessMessageProps extends Omit<BaseMessageProps, 'type'> {
4
+ locale?: 'nb' | 'nn' | 'en';
5
+ }
6
+ export declare const SuccessMessage: React.FC<SuccessMessageProps>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BaseMessageProps } from './BaseMessage';
3
+ export interface TipsMessageProps extends Omit<BaseMessageProps, 'type'> {
4
+ locale?: 'nb' | 'nn' | 'en';
5
+ }
6
+ export declare const TipsMessage: React.FC<TipsMessageProps>;
package/types/index.d.ts CHANGED
@@ -1,38 +1,5 @@
1
- import * as React from 'react';
2
-
3
- export interface MessageBoxProps
4
- extends Omit<React.ComponentProps<'div'>, 'title' | 'content'> {
5
- children?: React.ReactNode;
6
- className?: string;
7
- icon?: React.ReactNode;
8
- title?: React.ReactNode;
9
- titleElement?: string;
10
- onColoredBg?: boolean;
11
- locale?: 'nb' | 'nn' | 'en';
12
- }
13
-
14
- export interface ErrorMessageBoxProps extends MessageBoxProps {
15
- alert?: boolean;
16
- }
17
-
18
- export interface InfoMessageListItemProps {
19
- children: string;
20
- href?: string;
21
- }
22
-
23
- export interface InfoMessageListProps {
24
- children: React.ReactNode;
25
- }
26
-
27
- declare class SuccessMessage extends React.Component<MessageBoxProps, any> {}
28
- declare class ErrorMessage extends React.Component<ErrorMessageBoxProps, any> {}
29
- declare class InfoMessage extends React.Component<MessageBoxProps, any> {}
30
- declare class TipsMessage extends React.Component<MessageBoxProps, any> {}
31
- declare class InfoMessageList extends React.Component<
32
- InfoMessageListProps,
33
- any
34
- > {}
35
- declare class InfoMessageListItem extends React.Component<
36
- InfoMessageListItemProps,
37
- any
38
- > {}
1
+ export { SuccessMessage, SuccessMessageProps } from './SuccessMessage';
2
+ export { ErrorMessage, ErrorMessageProps } from './ErrorMessage';
3
+ export { InfoMessage, InfoMessageProps } from './InfoMessage';
4
+ export { TipsMessage, TipsMessageProps } from './TipsMessage';
5
+ export { InfoMessageList, InfoMessageListProps, InfoMessageListItem, InfoMessageListItemProps, } from './InfoMessageList';
@@ -0,0 +1,44 @@
1
+ export declare const texts: {
2
+ nb: {
3
+ readonly error: {
4
+ readonly ariaLabel: "Feilmelding";
5
+ };
6
+ readonly info: {
7
+ readonly ariaLabel: "Infomelding";
8
+ };
9
+ readonly success: {
10
+ readonly ariaLabel: "Suksessmelding";
11
+ };
12
+ readonly tip: {
13
+ readonly ariaLabel: "Tipsmelding";
14
+ };
15
+ };
16
+ nn: {
17
+ readonly error: {
18
+ readonly ariaLabel: "Feilmelding";
19
+ };
20
+ readonly info: {
21
+ readonly ariaLabel: "Infomelding";
22
+ };
23
+ readonly success: {
24
+ readonly ariaLabel: "Suksessmelding";
25
+ };
26
+ readonly tip: {
27
+ readonly ariaLabel: "Tipsmelding";
28
+ };
29
+ };
30
+ en: {
31
+ readonly error: {
32
+ readonly ariaLabel: "Error message";
33
+ };
34
+ readonly info: {
35
+ readonly ariaLabel: "Info message";
36
+ };
37
+ readonly success: {
38
+ readonly ariaLabel: "Success message";
39
+ };
40
+ readonly tip: {
41
+ readonly ariaLabel: "Tip message";
42
+ };
43
+ };
44
+ };
package/es/index.d.js DELETED
@@ -1 +0,0 @@
1
- import * as React from 'react';
package/lib/index.d.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var React = _interopRequireWildcard(require("react"));
5
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
6
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }