namirasoft-site-react 1.3.61 → 1.3.63
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 +2 -2
- package/dist/App.js.map +1 -1
- package/dist/Validator.d.ts +7 -2
- package/dist/Validator.js +57 -15
- package/dist/Validator.js.map +1 -1
- package/dist/components/NSButton.module.css +1 -1
- package/dist/components/NSButtonBlue.js +5 -4
- package/dist/components/NSButtonBlue.js.map +1 -1
- package/dist/components/NSButtonGreen.js +5 -4
- package/dist/components/NSButtonGreen.js.map +1 -1
- package/dist/components/NSButtonRed.js +5 -4
- package/dist/components/NSButtonRed.js.map +1 -1
- package/dist/components/NSCard.module.css +2 -3
- package/dist/components/NSCopyToClipboard.js +1 -1
- package/dist/components/NSCopyToClipboard.js.map +1 -1
- package/dist/components/NSCopyToClipboard.module.css +1 -1
- package/dist/components/NSEntityBar.module.css +2 -2
- package/dist/components/NSEntityCardBackground.module.css +2 -2
- package/dist/components/NSFooter.js.map +1 -1
- package/dist/components/NSHeader.js +1 -1
- package/dist/components/NSHeader.js.map +1 -1
- package/dist/components/NSInput.module.css +29 -0
- package/dist/components/NSInputDate.d.ts +3 -1
- package/dist/components/NSInputDate.js +14 -4
- package/dist/components/NSInputDate.js.map +1 -1
- package/dist/components/NSInputDate.module.css +5 -2
- package/dist/components/NSInputDuration.d.ts +6 -1
- package/dist/components/NSInputDuration.js +15 -6
- package/dist/components/NSInputDuration.js.map +1 -1
- package/dist/components/NSInputEmail.d.ts +1 -1
- package/dist/components/NSInputEmail.js +5 -3
- package/dist/components/NSInputEmail.js.map +1 -1
- package/dist/components/NSInputFloat.d.ts +4 -4
- package/dist/components/NSInputFloat.js +8 -9
- package/dist/components/NSInputFloat.js.map +1 -1
- package/dist/components/NSInputIP.d.ts +5 -1
- package/dist/components/NSInputIP.js +17 -7
- package/dist/components/NSInputIP.js.map +1 -1
- package/dist/components/NSInputInteger.d.ts +9 -5
- package/dist/components/NSInputInteger.js +16 -8
- package/dist/components/NSInputInteger.js.map +1 -1
- package/dist/components/NSInputPassword.d.ts +5 -1
- package/dist/components/NSInputPassword.js +15 -6
- package/dist/components/NSInputPassword.js.map +1 -1
- package/dist/components/NSInputPhone.d.ts +8 -3
- package/dist/components/NSInputPhone.js +18 -12
- package/dist/components/NSInputPhone.js.map +1 -1
- package/dist/components/NSInputPrice.d.ts +7 -2
- package/dist/components/NSInputPrice.js +15 -7
- package/dist/components/NSInputPrice.js.map +1 -1
- package/dist/components/NSInputSearch.d.ts +6 -1
- package/dist/components/NSInputSearch.js +15 -6
- package/dist/components/NSInputSearch.js.map +1 -1
- package/dist/components/NSInputString.d.ts +5 -1
- package/dist/components/NSInputString.js +15 -6
- package/dist/components/NSInputString.js.map +1 -1
- package/dist/components/NSInputText.d.ts +5 -1
- package/dist/components/NSInputText.js +15 -6
- package/dist/components/NSInputText.js.map +1 -1
- package/dist/components/NSInputTime.d.ts +5 -1
- package/dist/components/NSInputTime.js +16 -6
- package/dist/components/NSInputTime.js.map +1 -1
- package/dist/components/NSLayoutTitle.d.ts +1 -4
- package/dist/components/NSLayoutTitle.js +7 -11
- package/dist/components/NSLayoutTitle.js.map +1 -1
- package/dist/components/NSLink.d.ts +5 -0
- package/dist/components/NSLink.js +7 -0
- package/dist/components/NSLink.js.map +1 -0
- package/dist/components/{NSLinkBlue.module.css → NSLink.module.css} +3 -3
- package/dist/components/NSLinkBlue.d.ts +2 -5
- package/dist/components/NSLinkBlue.js +2 -3
- package/dist/components/NSLinkBlue.js.map +1 -1
- package/dist/components/NSLinkGreen.d.ts +2 -16
- package/dist/components/NSLinkGreen.js +3 -18
- package/dist/components/NSLinkGreen.js.map +1 -1
- package/dist/components/NSLinkRed.d.ts +2 -16
- package/dist/components/NSLinkRed.js +3 -18
- package/dist/components/NSLinkRed.js.map +1 -1
- package/dist/components/NSNotification.d.ts +2 -10
- package/dist/components/NSNotification.js +4 -20
- package/dist/components/NSNotification.js.map +1 -1
- package/dist/components/NSPagination.d.ts +1 -9
- package/dist/components/NSPagination.js +25 -33
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSSectionBars.d.ts +1 -0
- package/dist/components/NSSectionBars.js.map +1 -1
- package/dist/components/NSSectionCards.d.ts +1 -2
- package/dist/components/NSSectionCards.js +1 -1
- package/dist/components/NSSectionCards.js.map +1 -1
- package/dist/components/NSSectionTitle.d.ts +1 -2
- package/dist/components/NSSectionTitle.js +1 -1
- package/dist/components/NSSectionTitle.js.map +1 -1
- package/dist/components/NSSelectBox.d.ts +6 -3
- package/dist/components/NSSelectBox.js +21 -6
- package/dist/components/NSSelectBox.js.map +1 -1
- package/dist/components/NSSelectBox.module.css +3 -3
- package/dist/components/NSTable.js +1 -1
- package/dist/components/NSTable.js.map +1 -1
- package/dist/pages/NSLoginPage.d.ts +1 -4
- package/dist/pages/NSLoginPage.js +8 -11
- package/dist/pages/NSLoginPage.js.map +1 -1
- package/dist/pages/NSNotFoundPage.d.ts +1 -4
- package/dist/pages/NSNotFoundPage.js +2 -6
- package/dist/pages/NSNotFoundPage.js.map +1 -1
- package/dist/props/ValidationNumberProps.d.ts +1 -2
- package/dist/props/ValidationProps.d.ts +1 -0
- package/dist/props/ValidationStringProps.d.ts +1 -2
- package/package.json +4 -4
- package/src/App.tsx +13 -3
- package/src/Validator.ts +67 -18
- package/src/components/NSButton.module.css +1 -1
- package/src/components/NSButtonBlue.tsx +6 -4
- package/src/components/NSButtonGreen.tsx +5 -4
- package/src/components/NSButtonRed.tsx +5 -4
- package/src/components/NSCard.module.css +2 -3
- package/src/components/NSCopyToClipboard.module.css +1 -1
- package/src/components/NSCopyToClipboard.tsx +3 -3
- package/src/components/NSEntityBar.module.css +2 -2
- package/src/components/NSEntityCardBackground.module.css +2 -2
- package/src/components/NSHeader.tsx +3 -3
- package/src/components/NSInput.module.css +29 -0
- package/src/components/NSInputDate.module.css +5 -2
- package/src/components/NSInputDate.tsx +29 -12
- package/src/components/NSInputDuration.tsx +44 -23
- package/src/components/NSInputEmail.tsx +10 -5
- package/src/components/NSInputFloat.tsx +33 -32
- package/src/components/NSInputIP.tsx +44 -24
- package/src/components/NSInputInteger.tsx +48 -31
- package/src/components/NSInputPassword.tsx +42 -23
- package/src/components/NSInputPhone.tsx +45 -29
- package/src/components/NSInputPrice.tsx +45 -23
- package/src/components/NSInputSearch.tsx +43 -21
- package/src/components/NSInputString.tsx +42 -23
- package/src/components/NSInputText.tsx +42 -23
- package/src/components/NSInputTime.tsx +44 -23
- package/src/components/NSLayoutTitle.tsx +24 -30
- package/src/components/{NSLinkBlue.module.css → NSLink.module.css} +3 -3
- package/src/components/NSLink.tsx +22 -0
- package/src/components/NSLinkBlue.tsx +3 -19
- package/src/components/NSLinkGreen.tsx +3 -42
- package/src/components/NSLinkRed.tsx +3 -42
- package/src/components/NSNotification.tsx +19 -51
- package/src/components/NSPagination.tsx +56 -72
- package/src/components/NSSectionBars.tsx +1 -0
- package/src/components/NSSectionCards.tsx +3 -3
- package/src/components/NSSectionTitle.tsx +3 -3
- package/src/components/NSSelectBox.module.css +3 -3
- package/src/components/NSSelectBox.tsx +48 -23
- package/src/components/NSTable.tsx +1 -1
- package/src/pages/NSLoginPage.tsx +20 -24
- package/src/pages/NSNotFoundPage.tsx +7 -13
- package/src/props/ValidationNumberProps.ts +1 -3
- package/src/props/ValidationProps.ts +1 -0
- package/src/props/ValidationStringProps.ts +1 -3
- package/dist/components/NSInputDuration.module.css +0 -26
- package/dist/components/NSInputEmail.module.css +0 -38
- package/dist/components/NSInputFloat.module.css +0 -26
- package/dist/components/NSInputIP.module.css +0 -26
- package/dist/components/NSInputInteger.module.css +0 -26
- package/dist/components/NSInputPassword.module.css +0 -27
- package/dist/components/NSInputPhone.module.css +0 -33
- package/dist/components/NSInputPrice.module.css +0 -27
- package/dist/components/NSInputSearch.module.css +0 -27
- package/dist/components/NSInputString.module.css +0 -27
- package/dist/components/NSInputText.module.css +0 -28
- package/dist/components/NSInputTime.module.css +0 -27
- package/dist/components/NSLinkGreen.module.css +0 -16
- package/dist/components/NSLinkRed.module.css +0 -16
- package/src/components/NSInputDuration.module.css +0 -26
- package/src/components/NSInputEmail.module.css +0 -38
- package/src/components/NSInputFloat.module.css +0 -26
- package/src/components/NSInputIP.module.css +0 -26
- package/src/components/NSInputInteger.module.css +0 -26
- package/src/components/NSInputPassword.module.css +0 -27
- package/src/components/NSInputPhone.module.css +0 -33
- package/src/components/NSInputPrice.module.css +0 -27
- package/src/components/NSInputSearch.module.css +0 -27
- package/src/components/NSInputString.module.css +0 -27
- package/src/components/NSInputText.module.css +0 -28
- package/src/components/NSInputTime.module.css +0 -27
- package/src/components/NSLinkGreen.module.css +0 -16
- package/src/components/NSLinkRed.module.css +0 -16
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import Styles from "./
|
|
4
|
+
import Styles from "./NSInput.module.css";
|
|
5
5
|
import IconInputText from '../assets/images/icon-input-text.svg';
|
|
6
6
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
8
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
9
|
+
import { Validator } from "../Validator";
|
|
10
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
7
11
|
|
|
8
|
-
export interface NSInputTextProps extends BaseComponentProps
|
|
12
|
+
export interface NSInputTextProps extends BaseComponentProps, ValidationProps, ValidationStringProps
|
|
9
13
|
{
|
|
10
14
|
title: string;
|
|
11
15
|
defaultValue?: string;
|
|
@@ -16,6 +20,7 @@ export interface NSInputTextProps extends BaseComponentProps
|
|
|
16
20
|
export interface NSInputTextState
|
|
17
21
|
{
|
|
18
22
|
value: string;
|
|
23
|
+
error?: string;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
export class NSInputText extends React.Component<NSInputTextProps, NSInputTextState>
|
|
@@ -23,15 +28,26 @@ export class NSInputText extends React.Component<NSInputTextProps, NSInputTextSt
|
|
|
23
28
|
constructor(props: NSInputTextProps)
|
|
24
29
|
{
|
|
25
30
|
super(props);
|
|
26
|
-
this.state = {
|
|
27
|
-
value: props.defaultValue ?? "",
|
|
28
|
-
};
|
|
31
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
29
32
|
this.getValue = this.getValue.bind(this);
|
|
30
33
|
this.setValue = this.setValue.bind(this);
|
|
31
34
|
this.onChanged = this.onChanged.bind(this);
|
|
32
35
|
}
|
|
36
|
+
getError(): string | null
|
|
37
|
+
{
|
|
38
|
+
return (
|
|
39
|
+
Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
40
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
33
43
|
getValue(): string
|
|
34
44
|
{
|
|
45
|
+
let error = this.getError();
|
|
46
|
+
if (error)
|
|
47
|
+
{
|
|
48
|
+
this.setState({ error });
|
|
49
|
+
throw new Error(error);
|
|
50
|
+
}
|
|
35
51
|
return this.state.value;
|
|
36
52
|
}
|
|
37
53
|
setValue(value: string): void
|
|
@@ -47,24 +63,27 @@ export class NSInputText extends React.Component<NSInputTextProps, NSInputTextSt
|
|
|
47
63
|
override render()
|
|
48
64
|
{
|
|
49
65
|
return (
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
<>
|
|
67
|
+
<div className={`${Styles.ns_input_parent} p-2 ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
68
|
+
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
69
|
+
<img
|
|
70
|
+
className={Styles.ns_input_icon}
|
|
71
|
+
src={IconInputText}
|
|
72
|
+
alt="Text Icon"
|
|
73
|
+
width={24}
|
|
74
|
+
height={24}
|
|
75
|
+
/>
|
|
76
|
+
<input
|
|
77
|
+
id={this.props.id}
|
|
78
|
+
value={this.state.value}
|
|
79
|
+
onChange={this.onChanged}
|
|
80
|
+
type="text"
|
|
81
|
+
className={Styles.ns_input}
|
|
82
|
+
placeholder={this.props.placeholder}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
<NSInputErrorNotifier error={this.state.error} />
|
|
86
|
+
</>
|
|
68
87
|
);
|
|
69
88
|
}
|
|
70
89
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
import Styles from "./
|
|
4
|
+
import Styles from "./NSInput.module.css";
|
|
5
5
|
import IconInputTime from '../assets/images/icon-input-time.svg';
|
|
6
6
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
8
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
9
|
+
import { Validator } from "../Validator";
|
|
10
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
7
11
|
|
|
8
|
-
export interface NSInputTimeProps extends BaseComponentProps
|
|
12
|
+
export interface NSInputTimeProps extends BaseComponentProps, ValidationProps, ValidationStringProps
|
|
9
13
|
{
|
|
10
14
|
title: string;
|
|
11
15
|
defaultValue?: string;
|
|
@@ -16,6 +20,7 @@ export interface NSInputTimeProps extends BaseComponentProps
|
|
|
16
20
|
export interface NSInputTimeState
|
|
17
21
|
{
|
|
18
22
|
value: string;
|
|
23
|
+
error?: string;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
export class NSInputTime extends React.Component<NSInputTimeProps, NSInputTimeState>
|
|
@@ -23,15 +28,27 @@ export class NSInputTime extends React.Component<NSInputTimeProps, NSInputTimeSt
|
|
|
23
28
|
constructor(props: NSInputTimeProps)
|
|
24
29
|
{
|
|
25
30
|
super(props);
|
|
26
|
-
this.state = {
|
|
27
|
-
value: props.defaultValue ?? "",
|
|
28
|
-
};
|
|
31
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
29
32
|
this.getValue = this.getValue.bind(this);
|
|
30
33
|
this.setValue = this.setValue.bind(this);
|
|
31
34
|
this.onChanged = this.onChanged.bind(this);
|
|
32
35
|
}
|
|
36
|
+
getError(): string | null
|
|
37
|
+
{
|
|
38
|
+
return (
|
|
39
|
+
Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
40
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props) &&
|
|
41
|
+
Validator.getErrorTime(this.props.title, this.state.value)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
33
44
|
getValue(): string
|
|
34
45
|
{
|
|
46
|
+
let error = this.getError();
|
|
47
|
+
if (error)
|
|
48
|
+
{
|
|
49
|
+
this.setState({ error });
|
|
50
|
+
throw new Error(error);
|
|
51
|
+
}
|
|
35
52
|
return this.state.value;
|
|
36
53
|
}
|
|
37
54
|
setValue(value: string): void
|
|
@@ -47,24 +64,28 @@ export class NSInputTime extends React.Component<NSInputTimeProps, NSInputTimeSt
|
|
|
47
64
|
override render()
|
|
48
65
|
{
|
|
49
66
|
return (
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
<>
|
|
68
|
+
<div className={`${Styles.ns_input_parent} p-2 ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
69
|
+
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
70
|
+
<img
|
|
71
|
+
className={Styles.ns_input_icon}
|
|
72
|
+
src={IconInputTime}
|
|
73
|
+
alt="Time Icon"
|
|
74
|
+
width={24}
|
|
75
|
+
height={24}
|
|
76
|
+
/>
|
|
77
|
+
<input
|
|
78
|
+
id={this.props.id}
|
|
79
|
+
value={this.state.value}
|
|
80
|
+
onChange={this.onChanged}
|
|
81
|
+
type="time"
|
|
82
|
+
className={Styles.ns_input}
|
|
83
|
+
placeholder={this.props.placeholder}
|
|
84
|
+
step="2"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
<NSInputErrorNotifier error={this.state.error} />
|
|
88
|
+
</>
|
|
68
89
|
);
|
|
69
90
|
}
|
|
70
91
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import Styles from './NSLayoutTitle.module.css';
|
|
4
|
-
import { Component } from 'react';
|
|
5
2
|
import { ReactNode } from 'react';
|
|
6
3
|
import { NSLayout, NSLayoutProps } from './NSLayout';
|
|
7
4
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
@@ -14,32 +11,29 @@ export interface NSLayoutTitleProps extends NSLayoutProps, BaseComponentProps
|
|
|
14
11
|
children: ReactNode;
|
|
15
12
|
}
|
|
16
13
|
|
|
17
|
-
export
|
|
14
|
+
export function NSLayoutTitle(props: NSLayoutTitleProps)
|
|
18
15
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</NSLayout>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
16
|
+
let lines = (props.description ?? "").split(/(\n|\\n|<br>|<br\s*\/>)/gm);
|
|
17
|
+
return (
|
|
18
|
+
<NSLayout {...props}>
|
|
19
|
+
<NSSpace size={NSSpaceSizeType.SMALL}></NSSpace>
|
|
20
|
+
<div>
|
|
21
|
+
<h1 className={Styles.title}>{props.title}</h1>
|
|
22
|
+
{
|
|
23
|
+
props.description && lines &&
|
|
24
|
+
<p className={Styles.description}>{
|
|
25
|
+
lines.map((line, index) =>
|
|
26
|
+
{
|
|
27
|
+
return <>
|
|
28
|
+
{line.trim()}
|
|
29
|
+
{index != lines.length - 1 && <br />}
|
|
30
|
+
</>;
|
|
31
|
+
})
|
|
32
|
+
}</p>
|
|
33
|
+
}
|
|
34
|
+
<NSSpace size={NSSpaceSizeType.NORMAL}></NSSpace>
|
|
35
|
+
</div>
|
|
36
|
+
{props.children}
|
|
37
|
+
</NSLayout>
|
|
38
|
+
);
|
|
45
39
|
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
.ns_link {
|
|
11
11
|
text-decoration: none;
|
|
12
|
-
|
|
13
|
-
box-shadow: inset
|
|
12
|
+
/* box-shadow: inset 2px 2px 2px 0 #1754F3; */
|
|
13
|
+
box-shadow: inset 0 -4px 4px 0px rgb(0 0 0 / 25%);
|
|
14
14
|
color: #fff;
|
|
15
15
|
font-size: 16px;
|
|
16
16
|
font-weight: 600;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
align-items: center;
|
|
21
21
|
padding: 16px 32px;
|
|
22
22
|
border-radius: 24px;
|
|
23
|
-
max-width:
|
|
23
|
+
max-width: 272px;
|
|
24
24
|
width: 100%;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
2
|
+
import { LinkProps } from "../props/LinkProps";
|
|
3
|
+
import Styles from "./NSLink.module.css";
|
|
4
|
+
|
|
5
|
+
export interface NSLinkProps extends LinkProps, BaseComponentProps
|
|
6
|
+
{
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function NSLink(props: NSLinkProps)
|
|
10
|
+
{
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
id={props.id}
|
|
14
|
+
className={`${Styles.ns_link_parent} ${props.classList?.join(" ")}`}
|
|
15
|
+
style={props.style}
|
|
16
|
+
>
|
|
17
|
+
<a className={`text-white text-decoration-none ${props.title ? Styles.ns_link : Styles.ns_link_absolute}`} href={props.href} target={props?.target ?? "_self"} >
|
|
18
|
+
{props.title}
|
|
19
|
+
</a>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LinkProps } from "../props/LinkProps";
|
|
3
|
-
import Styles from "./NSLinkBlue.module.css";
|
|
1
|
+
import { NSLink, NSLinkProps } from "./NSLink";
|
|
4
2
|
|
|
5
|
-
export
|
|
3
|
+
export function NSLinkBlue(props: NSLinkProps)
|
|
6
4
|
{
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function NSLinkBlue(props: NSLinkBlueProps)
|
|
10
|
-
{
|
|
11
|
-
return (
|
|
12
|
-
<div
|
|
13
|
-
id={props.id}
|
|
14
|
-
className={Styles.ns_link_parent}
|
|
15
|
-
style={props.style}
|
|
16
|
-
>
|
|
17
|
-
<a className={`text-white text-decoration-none ${props.title ? Styles.ns_link : Styles.ns_link_absolute}`} href={props.href} target={props?.target ?? "_self"} >
|
|
18
|
-
{props.title}
|
|
19
|
-
</a>
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
5
|
+
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "#366EFF" }} title={props.title} href={props.href} target={props.target} />;
|
|
22
6
|
}
|
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { NSLink, NSLinkProps } from "./NSLink";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Link } from "react-router-dom";
|
|
6
|
-
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
-
|
|
8
|
-
export interface NSLinkGreenProps extends BaseComponentProps
|
|
9
|
-
{
|
|
10
|
-
title: string;
|
|
11
|
-
href: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NSLinkGreenState
|
|
15
|
-
{
|
|
16
|
-
title: string;
|
|
17
|
-
href: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class NSLinkGreen extends React.Component<NSLinkGreenProps, NSLinkGreenState>
|
|
3
|
+
export function NSLinkGreen(props: NSLinkProps)
|
|
21
4
|
{
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
super(props);
|
|
25
|
-
this.state = { title: props.title, href: props.href };
|
|
26
|
-
}
|
|
27
|
-
setTitle(title: string)
|
|
28
|
-
{
|
|
29
|
-
this.setState({ title });
|
|
30
|
-
}
|
|
31
|
-
setHRef(href: string)
|
|
32
|
-
{
|
|
33
|
-
this.setState({ href });
|
|
34
|
-
}
|
|
35
|
-
override render()
|
|
36
|
-
{
|
|
37
|
-
return (
|
|
38
|
-
<Link className="text-white text-decoration-none" to={this.state.href}>
|
|
39
|
-
<div className={Style.ns_link_green}>
|
|
40
|
-
{this.state.title}
|
|
41
|
-
</div>
|
|
42
|
-
</Link>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
5
|
+
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "#06D182" }} title={props.title} href={props.href} target={props.target} />;
|
|
45
6
|
}
|
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { NSLink, NSLinkProps } from "./NSLink";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Link } from "react-router-dom";
|
|
6
|
-
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
-
|
|
8
|
-
export interface NSLinkRedProps extends BaseComponentProps
|
|
9
|
-
{
|
|
10
|
-
title: string;
|
|
11
|
-
href: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NSLinkRedState
|
|
15
|
-
{
|
|
16
|
-
title: string;
|
|
17
|
-
href: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class NSLinkRed extends React.Component<NSLinkRedProps, NSLinkRedState>
|
|
3
|
+
export function NSLinkRed(props: NSLinkProps)
|
|
21
4
|
{
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
super(props);
|
|
25
|
-
this.state = { title: props.title, href: props.href };
|
|
26
|
-
}
|
|
27
|
-
setTitle(title: string)
|
|
28
|
-
{
|
|
29
|
-
this.setState({ title });
|
|
30
|
-
}
|
|
31
|
-
setHRef(href: string)
|
|
32
|
-
{
|
|
33
|
-
this.setState({ href });
|
|
34
|
-
}
|
|
35
|
-
override render()
|
|
36
|
-
{
|
|
37
|
-
return (
|
|
38
|
-
<Link className="text-white text-decoration-none" to={this.state.href}>
|
|
39
|
-
<div className={Style.ns_link_red}>
|
|
40
|
-
{this.state.title}
|
|
41
|
-
</div>
|
|
42
|
-
</Link>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
5
|
+
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "rgb(265, 63, 63, 1)" }} title={props.title} href={props.href} target={props.target} />;
|
|
45
6
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
1
|
import Exit from '../assets/images/close-vector.png';
|
|
5
2
|
import Styles from "./NSNotification.module.css";
|
|
6
3
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
@@ -9,11 +6,7 @@ export interface NSNotificationProps extends BaseComponentProps
|
|
|
9
6
|
{
|
|
10
7
|
title: string;
|
|
11
8
|
type: NSNotificationType;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export interface NSNotificationState
|
|
15
|
-
{
|
|
16
|
-
show: boolean;
|
|
9
|
+
onClose: () => void;
|
|
17
10
|
}
|
|
18
11
|
|
|
19
12
|
export enum NSNotificationType
|
|
@@ -25,48 +18,23 @@ export enum NSNotificationType
|
|
|
25
18
|
RED = "RED",
|
|
26
19
|
}
|
|
27
20
|
|
|
28
|
-
export
|
|
21
|
+
export function NSNotification(props: NSNotificationProps)
|
|
29
22
|
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
override render()
|
|
49
|
-
{
|
|
50
|
-
let className = Styles["ns_" + this.props.type.toString().toLowerCase];
|
|
51
|
-
return <>
|
|
52
|
-
{
|
|
53
|
-
this.state.show && (
|
|
54
|
-
<div id={this.props.id}
|
|
55
|
-
className={`${Styles.ns_messenger} ${className}`}
|
|
56
|
-
style={this.props.style}
|
|
57
|
-
>
|
|
58
|
-
<p className={`mb-0 ns-font-16-normal`}>{this.props.title}</p>
|
|
59
|
-
<img
|
|
60
|
-
className={Styles.ns_exit_icon}
|
|
61
|
-
src={Exit}
|
|
62
|
-
alt="exit"
|
|
63
|
-
width={32}
|
|
64
|
-
height={32}
|
|
65
|
-
onClick={() => this.handleDestroy()}
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
</>
|
|
71
|
-
}
|
|
23
|
+
let className = Styles["ns_" + props.type.toString().toLowerCase];
|
|
24
|
+
return (
|
|
25
|
+
<div id={props.id}
|
|
26
|
+
className={`${Styles.ns_messenger} ${className}`}
|
|
27
|
+
style={props.style}
|
|
28
|
+
>
|
|
29
|
+
<p className={`mb-0 ns-font-16-normal`}>{props.title}</p>
|
|
30
|
+
<img
|
|
31
|
+
className={Styles.ns_exit_icon}
|
|
32
|
+
src={Exit}
|
|
33
|
+
alt="exit"
|
|
34
|
+
width={32}
|
|
35
|
+
height={32}
|
|
36
|
+
onClick={props.onClose}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
72
40
|
}
|