namirasoft-site-react 1.3.184 → 1.3.186
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/dist/App.js +22 -22
- package/dist/components/NSBoxEmail.d.ts +23 -23
- package/dist/components/NSBoxEmail.js +46 -46
- package/dist/components/NSLayout.js +10 -2
- package/dist/components/NSLayout.js.map +1 -1
- package/dist/components/NSLayoutAction.d.ts +5 -5
- package/dist/components/NSLayoutHeroBanner.d.ts +2 -2
- package/dist/components/NSLayoutTitle.d.ts +2 -2
- package/dist/components/NSNotification.d.ts +21 -21
- package/package.json +1 -1
- package/src/components/NSLayout.tsx +17 -2
package/dist/App.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './App.css';
|
|
3
|
-
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
|
-
import { NSLayout } from './main';
|
|
5
|
-
export function App() {
|
|
6
|
-
const onClicked = () => {
|
|
7
|
-
console.log("clicked");
|
|
8
|
-
};
|
|
9
|
-
let icons = [
|
|
10
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked, count: 1 },
|
|
11
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
12
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
13
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
14
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
15
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
16
|
-
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
17
|
-
];
|
|
18
|
-
return (_jsx(_Fragment, { children: _jsx(NSLayout, { header: {
|
|
19
|
-
title: "any",
|
|
20
|
-
icons: icons
|
|
21
|
-
}, scope: "exampleScope", logo: "exampleLogoUrl", notifications: [], background: "", children: _jsx(_Fragment, {}) }) }));
|
|
22
|
-
}
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './App.css';
|
|
3
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
|
+
import { NSLayout } from './main';
|
|
5
|
+
export function App() {
|
|
6
|
+
const onClicked = () => {
|
|
7
|
+
console.log("clicked");
|
|
8
|
+
};
|
|
9
|
+
let icons = [
|
|
10
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked, count: 1 },
|
|
11
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
12
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
13
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
14
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
15
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
16
|
+
{ src: "https://static.namirasoft.com/image/concept/logout/white.svg", alt: "", onClicked },
|
|
17
|
+
];
|
|
18
|
+
return (_jsx(_Fragment, { children: _jsx(NSLayout, { header: {
|
|
19
|
+
title: "any",
|
|
20
|
+
icons: icons
|
|
21
|
+
}, scope: "exampleScope", logo: "exampleLogoUrl", notifications: [], background: "", children: _jsx(_Fragment, {}) }) }));
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=App.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IValidationProps } from "../props/IValidationProps";
|
|
3
|
-
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
4
|
-
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
|
-
export interface INSBoxEmailProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
|
|
6
|
-
title: string;
|
|
7
|
-
defaultValue?: string;
|
|
8
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface INSBoxEmailState {
|
|
12
|
-
value: string;
|
|
13
|
-
error?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class NSBoxEmail extends React.Component<INSBoxEmailProps, INSBoxEmailState> {
|
|
16
|
-
constructor(props: INSBoxEmailProps);
|
|
17
|
-
getError(): string | null;
|
|
18
|
-
getValue(): string;
|
|
19
|
-
setValue(value: string): void;
|
|
20
|
-
private onChanged;
|
|
21
|
-
private copyToClipboard;
|
|
22
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
3
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
4
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
|
+
export interface INSBoxEmailProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
|
|
6
|
+
title: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface INSBoxEmailState {
|
|
12
|
+
value: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class NSBoxEmail extends React.Component<INSBoxEmailProps, INSBoxEmailState> {
|
|
16
|
+
constructor(props: INSBoxEmailProps);
|
|
17
|
+
getError(): string | null;
|
|
18
|
+
getValue(): string;
|
|
19
|
+
setValue(value: string): void;
|
|
20
|
+
private onChanged;
|
|
21
|
+
private copyToClipboard;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import Styles from "./NSBox.module.css";
|
|
5
|
-
import IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
|
-
import { Validator } from "../Validator";
|
|
7
|
-
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
8
|
-
export class NSBoxEmail extends React.Component {
|
|
9
|
-
constructor(props) {
|
|
10
|
-
var _a;
|
|
11
|
-
super(props);
|
|
12
|
-
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
13
|
-
this.setValue = this.setValue.bind(this);
|
|
14
|
-
this.getValue = this.getValue.bind(this);
|
|
15
|
-
this.onChanged = this.onChanged.bind(this);
|
|
16
|
-
this.copyToClipboard = this.copyToClipboard.bind(this);
|
|
17
|
-
}
|
|
18
|
-
getError() {
|
|
19
|
-
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
20
|
-
Validator.getErrorString(this.props.title, this.state.value, this.props) &&
|
|
21
|
-
Validator.getErrorEmail(this.props.title, this.state.value));
|
|
22
|
-
}
|
|
23
|
-
getValue() {
|
|
24
|
-
let error = this.getError();
|
|
25
|
-
if (error) {
|
|
26
|
-
this.setState({ error });
|
|
27
|
-
throw new Error(error);
|
|
28
|
-
}
|
|
29
|
-
return this.state.value;
|
|
30
|
-
}
|
|
31
|
-
setValue(value) {
|
|
32
|
-
this.setState({ value });
|
|
33
|
-
}
|
|
34
|
-
onChanged(e) {
|
|
35
|
-
this.setValue(e.target.value);
|
|
36
|
-
if (this.props.onChanged)
|
|
37
|
-
this.props.onChanged(e);
|
|
38
|
-
}
|
|
39
|
-
copyToClipboard() {
|
|
40
|
-
navigator.clipboard.writeText(this.getValue());
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
var _a;
|
|
44
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("div", { className: "d-flex justify-content-between align-item-center", children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsxs("div", { className: "d-flex gap-2", children: [_jsx("button", { className: Styles.ns_btn_box, onClick: this.copyToClipboard, children: "Copy" }), _jsx("button", { className: Styles.ns_btn_box, onClick: () => { }, children: "FullScreen" })] })] }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputEmail, alt: "Email Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "email", className: Styles.ns_input, placeholder: this.props.placeholder })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBox.module.css";
|
|
5
|
+
import IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
8
|
+
export class NSBoxEmail extends React.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
var _a;
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
13
|
+
this.setValue = this.setValue.bind(this);
|
|
14
|
+
this.getValue = this.getValue.bind(this);
|
|
15
|
+
this.onChanged = this.onChanged.bind(this);
|
|
16
|
+
this.copyToClipboard = this.copyToClipboard.bind(this);
|
|
17
|
+
}
|
|
18
|
+
getError() {
|
|
19
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
20
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props) &&
|
|
21
|
+
Validator.getErrorEmail(this.props.title, this.state.value));
|
|
22
|
+
}
|
|
23
|
+
getValue() {
|
|
24
|
+
let error = this.getError();
|
|
25
|
+
if (error) {
|
|
26
|
+
this.setState({ error });
|
|
27
|
+
throw new Error(error);
|
|
28
|
+
}
|
|
29
|
+
return this.state.value;
|
|
30
|
+
}
|
|
31
|
+
setValue(value) {
|
|
32
|
+
this.setState({ value });
|
|
33
|
+
}
|
|
34
|
+
onChanged(e) {
|
|
35
|
+
this.setValue(e.target.value);
|
|
36
|
+
if (this.props.onChanged)
|
|
37
|
+
this.props.onChanged(e);
|
|
38
|
+
}
|
|
39
|
+
copyToClipboard() {
|
|
40
|
+
navigator.clipboard.writeText(this.getValue());
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
var _a;
|
|
44
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("div", { className: "d-flex justify-content-between align-item-center", children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsxs("div", { className: "d-flex gap-2", children: [_jsx("button", { className: Styles.ns_btn_box, onClick: this.copyToClipboard, children: "Copy" }), _jsx("button", { className: Styles.ns_btn_box, onClick: () => { }, children: "FullScreen" })] })] }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputEmail, alt: "Email Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "email", className: Styles.ns_input, placeholder: this.props.placeholder })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
47
|
//# sourceMappingURL=NSBoxEmail.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Styles from './NSLayout.module.css';
|
|
3
3
|
import { NSHeader } from './NSHeader';
|
|
4
4
|
import { NSFooter } from './NSFooter';
|
|
@@ -6,8 +6,15 @@ import { NSBarNotification } from './NSBarNotification';
|
|
|
6
6
|
import { NSBarAction } from './NSBarAction';
|
|
7
7
|
import { NSBarHeroBanner } from './NSBarHeroBanner';
|
|
8
8
|
import { NSBarTitle } from './NSBarTitle';
|
|
9
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
9
10
|
export function NSLayout(props) {
|
|
10
11
|
var _a;
|
|
12
|
+
function isValidAction(action) {
|
|
13
|
+
if (action)
|
|
14
|
+
if (action.title || action.description || Object.keys(action.menus).length > 0)
|
|
15
|
+
return true;
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
11
18
|
return (_jsxs("div", { id: props.id, className: `${Styles.ns_container} ${(_a = props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: {
|
|
12
19
|
minHeight: "100vh",
|
|
13
20
|
width: "100%",
|
|
@@ -17,6 +24,7 @@ export function NSLayout(props) {
|
|
|
17
24
|
background: props.background,
|
|
18
25
|
backgroundSize: "cover",
|
|
19
26
|
backgroundAttachment: "fixed"
|
|
20
|
-
}, children: [_jsx(NSHeader, { scope: props.scope, name: "Header", logo: props.logo, header: props.header }), props.notifications.map(props => _jsx(NSBarNotification, Object.assign({}, props))), props.action && _jsx(NSBarAction, Object.assign({}, props.action)), props.banner && _jsx(NSBarHeroBanner, Object.assign({}, props.banner)),
|
|
27
|
+
}, children: [_jsx(NSHeader, { scope: props.scope, name: "Header", logo: props.logo, header: props.header }), props.notifications.map(props => _jsx(NSBarNotification, Object.assign({}, props))), isValidAction(props.action) && _jsx(NSBarAction, Object.assign({}, props.action)), props.banner && _jsx(NSBarHeroBanner, Object.assign({}, props.banner)), _jsx(NSSpace, { size: NSSpaceSizeType.MEDUIM }), props.title &&
|
|
28
|
+
_jsxs(_Fragment, { children: [_jsx(NSBarTitle, Object.assign({}, props.title)), _jsx(NSSpace, { size: NSSpaceSizeType.MEDUIM })] }), _jsx("main", { className: `d-flex flex-column text-white ${Styles.ns_layout_main}`, children: props.children }), _jsx(NSSpace, { size: NSSpaceSizeType.MEDUIM }), _jsx(NSFooter, { scope: props.scope, name: "Footer", logo: props.logo })] }));
|
|
21
29
|
}
|
|
22
30
|
//# sourceMappingURL=NSLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSLayout.js","sourceRoot":"","sources":["../../src/components/NSLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAqB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAoB,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"NSLayout.js","sourceRoot":"","sources":["../../src/components/NSLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAqB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAoB,UAAU,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAoBrD,MAAM,UAAU,QAAQ,CAAC,KAAqB;;IAE7C,SAAS,aAAa,CAAC,MAA0B;QAEhD,IAAI,MAAM;YACT,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;gBAC7E,OAAO,IAAI,CAAC;QACd,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,CACN,eAAK,EAAE,EAAE,KAAK,CAAC,EAAE,EAChB,SAAS,EAAE,GAAG,MAAM,CAAC,YAAY,IAAI,MAAA,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EACjE,KAAK,EAAE;YACN,SAAS,EAAE,OAAO;YAClB,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,cAAc,EAAE,OAAO;YACvB,oBAAoB,EAAE,OAAO;SAC7B,aACD,KAAC,QAAQ,IACR,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,GACnB,EACD,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAC,iBAAiB,oBAAK,KAAK,EAAsB,CAAC,EACpF,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAC,WAAW,oBAAK,KAAK,CAAC,MAAM,EAAkB,EAC9E,KAAK,CAAC,MAAM,IAAI,KAAC,eAAe,oBAAK,KAAK,CAAC,MAAM,EAAsB,EACxE,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACxC,KAAK,CAAC,KAAK;gBACX,8BACC,KAAC,UAAU,oBAAK,KAAK,CAAC,KAAK,EAAiB,EAC5C,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,IACvC,EAEJ,eAAM,SAAS,EAAE,iCAAiC,MAAM,CAAC,cAAc,EAAE,YACvE,KAAK,CAAC,QAAQ,GACT,EACP,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACzC,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAI,IAC1D,CACP,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { INSLayoutActionProps } from './NSLayout';
|
|
2
|
-
export interface INSLaoutActionState {
|
|
3
|
-
show: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare function NSLayoutAction(props: INSLayoutActionProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { INSLayoutActionProps } from './NSLayout';
|
|
2
|
+
export interface INSLaoutActionState {
|
|
3
|
+
show: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function NSLayoutAction(props: INSLayoutActionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { INSLayoutHeroBannerProps } from './NSLayout';
|
|
2
|
-
export declare function NSLayoutHeroBanner(props: INSLayoutHeroBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { INSLayoutHeroBannerProps } from './NSLayout';
|
|
2
|
+
export declare function NSLayoutHeroBanner(props: INSLayoutHeroBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { INSLayoutTitleProps } from './NSLayout';
|
|
2
|
-
export declare function NSLayoutTitle(props: INSLayoutTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { INSLayoutTitleProps } from './NSLayout';
|
|
2
|
+
export declare function NSLayoutTitle(props: INSLayoutTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
|
-
export interface INSNotificationProps extends IBaseComponentProps {
|
|
3
|
-
text: string;
|
|
4
|
-
type: NotificationType;
|
|
5
|
-
color: NSNotificationColor;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare enum NSNotificationColor {
|
|
9
|
-
GRAY = "GRAY",
|
|
10
|
-
BLUE = "BLUE",
|
|
11
|
-
GREEN = "GREEN",
|
|
12
|
-
YELLOW = "YELLOW",
|
|
13
|
-
RED = "RED"
|
|
14
|
-
}
|
|
15
|
-
export declare enum NotificationType {
|
|
16
|
-
Information = "Information",
|
|
17
|
-
Warning = "Warning",
|
|
18
|
-
Success = "Success",
|
|
19
|
-
Error = "Error"
|
|
20
|
-
}
|
|
21
|
-
export declare function NSNotification(props: INSNotificationProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
|
+
export interface INSNotificationProps extends IBaseComponentProps {
|
|
3
|
+
text: string;
|
|
4
|
+
type: NotificationType;
|
|
5
|
+
color: NSNotificationColor;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare enum NSNotificationColor {
|
|
9
|
+
GRAY = "GRAY",
|
|
10
|
+
BLUE = "BLUE",
|
|
11
|
+
GREEN = "GREEN",
|
|
12
|
+
YELLOW = "YELLOW",
|
|
13
|
+
RED = "RED"
|
|
14
|
+
}
|
|
15
|
+
export declare enum NotificationType {
|
|
16
|
+
Information = "Information",
|
|
17
|
+
Warning = "Warning",
|
|
18
|
+
Success = "Success",
|
|
19
|
+
Error = "Error"
|
|
20
|
+
}
|
|
21
|
+
export declare function NSNotification(props: INSNotificationProps): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { IHeaderProps } from '../props/IHeaderProps';
|
|
|
8
8
|
import { INSBarActionProps, NSBarAction } from './NSBarAction';
|
|
9
9
|
import { INSBarHeroBannerProps, NSBarHeroBanner } from './NSBarHeroBanner';
|
|
10
10
|
import { INSBarTitleProps, NSBarTitle } from './NSBarTitle';
|
|
11
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
11
12
|
|
|
12
13
|
export interface INSLayoutProps extends IBaseComponentProps
|
|
13
14
|
{
|
|
@@ -29,6 +30,13 @@ export interface NSLayoutState
|
|
|
29
30
|
|
|
30
31
|
export function NSLayout(props: INSLayoutProps)
|
|
31
32
|
{
|
|
33
|
+
function isValidAction(action?: INSBarActionProps): action is INSBarActionProps
|
|
34
|
+
{
|
|
35
|
+
if (action)
|
|
36
|
+
if (action.title || action.description || Object.keys(action.menus).length > 0)
|
|
37
|
+
return true;
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
32
40
|
return (
|
|
33
41
|
<div id={props.id}
|
|
34
42
|
className={`${Styles.ns_container} ${props.classList?.join(" ")}`}
|
|
@@ -49,12 +57,19 @@ export function NSLayout(props: INSLayoutProps)
|
|
|
49
57
|
header={props.header}
|
|
50
58
|
/>
|
|
51
59
|
{props.notifications.map(props => <NSBarNotification {...props}></NSBarNotification>)}
|
|
52
|
-
{props.action && <NSBarAction {...props.action} ></NSBarAction >}
|
|
60
|
+
{isValidAction(props.action) && <NSBarAction {...props.action} ></NSBarAction >}
|
|
53
61
|
{props.banner && <NSBarHeroBanner {...props.banner} ></NSBarHeroBanner >}
|
|
54
|
-
|
|
62
|
+
<NSSpace size={NSSpaceSizeType.MEDUIM} />
|
|
63
|
+
{props.title &&
|
|
64
|
+
<>
|
|
65
|
+
<NSBarTitle {...props.title} ></NSBarTitle >
|
|
66
|
+
<NSSpace size={NSSpaceSizeType.MEDUIM} />
|
|
67
|
+
</>
|
|
68
|
+
}
|
|
55
69
|
<main className={`d-flex flex-column text-white ${Styles.ns_layout_main}`}>
|
|
56
70
|
{props.children}
|
|
57
71
|
</main>
|
|
72
|
+
<NSSpace size={NSSpaceSizeType.MEDUIM} />
|
|
58
73
|
<NSFooter scope={props.scope} name="Footer" logo={props.logo} />
|
|
59
74
|
</div >
|
|
60
75
|
);
|