namirasoft-site-react 1.3.59 → 1.3.61

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.
Files changed (192) hide show
  1. package/dist/App.js +2 -15
  2. package/dist/App.js.map +1 -1
  3. package/dist/components/NSButton.d.ts +2 -10
  4. package/dist/components/NSButton.js +2 -9
  5. package/dist/components/NSButton.js.map +1 -1
  6. package/dist/components/NSButton.module.css +8 -7
  7. package/dist/components/NSButtonBlue.d.ts +2 -13
  8. package/dist/components/NSButtonBlue.js +6 -13
  9. package/dist/components/NSButtonBlue.js.map +1 -1
  10. package/dist/components/NSButtonBlue.module.css +0 -8
  11. package/dist/components/NSButtonGreen.d.ts +2 -13
  12. package/dist/components/NSButtonGreen.js +6 -13
  13. package/dist/components/NSButtonGreen.js.map +1 -1
  14. package/dist/components/NSButtonGreen.module.css +0 -8
  15. package/dist/components/NSButtonRed.d.ts +2 -13
  16. package/dist/components/NSButtonRed.js +7 -14
  17. package/dist/components/NSButtonRed.js.map +1 -1
  18. package/dist/components/NSButtonRed.module.css +0 -8
  19. package/dist/components/NSCard.d.ts +5 -10
  20. package/dist/components/NSCard.js +12 -16
  21. package/dist/components/NSCard.js.map +1 -1
  22. package/dist/components/NSCopyToClipboard.d.ts +3 -9
  23. package/dist/components/NSCopyToClipboard.js +6 -14
  24. package/dist/components/NSCopyToClipboard.js.map +1 -1
  25. package/dist/components/NSCopyToClipboard.module.css +1 -1
  26. package/dist/components/NSEntityBar.d.ts +5 -10
  27. package/dist/components/NSEntityBar.js +3 -6
  28. package/dist/components/NSEntityBar.js.map +1 -1
  29. package/dist/components/NSEntityBar.module.css +1 -1
  30. package/dist/components/NSEntityCardBackground.d.ts +3 -12
  31. package/dist/components/NSEntityCardBackground.js +4 -23
  32. package/dist/components/NSEntityCardBackground.js.map +1 -1
  33. package/dist/components/NSFooter.d.ts +2 -1
  34. package/dist/components/NSFooter.js +2 -1
  35. package/dist/components/NSFooter.js.map +1 -1
  36. package/dist/components/NSHeader.d.ts +3 -3
  37. package/dist/components/NSHeader.js +9 -4
  38. package/dist/components/NSHeader.js.map +1 -1
  39. package/dist/components/NSInputDate.d.ts +1 -0
  40. package/dist/components/NSInputDate.js +4 -3
  41. package/dist/components/NSInputDate.js.map +1 -1
  42. package/dist/components/NSInputDuration.js.map +1 -1
  43. package/dist/components/NSInputEmail.js +2 -1
  44. package/dist/components/NSInputEmail.js.map +1 -1
  45. package/dist/components/NSInputErrorNotifier.d.ts +5 -0
  46. package/dist/components/NSInputErrorNotifier.js +7 -0
  47. package/dist/components/NSInputErrorNotifier.js.map +1 -0
  48. package/dist/components/NSInputIP.js.map +1 -1
  49. package/dist/components/NSInputInteger.js.map +1 -1
  50. package/dist/components/NSInputPhone.js.map +1 -1
  51. package/dist/components/NSInputPrice.js.map +1 -1
  52. package/dist/components/NSInputSearch.js.map +1 -1
  53. package/dist/components/NSInputText.js.map +1 -1
  54. package/dist/components/NSInputTime.js.map +1 -1
  55. package/dist/components/NSLayout.d.ts +4 -1
  56. package/dist/components/NSLayout.js +3 -2
  57. package/dist/components/NSLayout.js.map +1 -1
  58. package/dist/components/NSLayoutHeroBanner.d.ts +3 -3
  59. package/dist/components/NSLayoutHeroBanner.js +1 -1
  60. package/dist/components/NSLayoutHeroBanner.js.map +1 -1
  61. package/dist/components/NSLayoutTitle.d.ts +3 -4
  62. package/dist/components/NSLayoutTitle.js +2 -2
  63. package/dist/components/NSLayoutTitle.js.map +1 -1
  64. package/dist/components/NSLinkBlue.d.ts +3 -11
  65. package/dist/components/NSLinkBlue.js +3 -17
  66. package/dist/components/NSLinkBlue.js.map +1 -1
  67. package/dist/components/NSLinkGreen.d.ts +2 -1
  68. package/dist/components/NSLinkGreen.js.map +1 -1
  69. package/dist/components/NSLinkRed.d.ts +2 -1
  70. package/dist/components/NSLinkRed.js.map +1 -1
  71. package/dist/components/NSLoading.d.ts +3 -8
  72. package/dist/components/NSLoading.js +2 -6
  73. package/dist/components/NSLoading.js.map +1 -1
  74. package/dist/components/NSNotification.d.ts +22 -0
  75. package/dist/components/NSNotification.js +32 -0
  76. package/dist/components/NSNotification.js.map +1 -0
  77. package/dist/components/NSNotification.module.css +32 -0
  78. package/dist/components/NSPagination.d.ts +3 -2
  79. package/dist/components/NSPagination.js +2 -1
  80. package/dist/components/NSPagination.js.map +1 -1
  81. package/dist/components/NSPanel.d.ts +4 -8
  82. package/dist/components/NSPanel.js +3 -9
  83. package/dist/components/NSPanel.js.map +1 -1
  84. package/dist/components/NSSection.d.ts +4 -11
  85. package/dist/components/NSSection.js +6 -25
  86. package/dist/components/NSSection.js.map +1 -1
  87. package/dist/components/NSSectionBars.d.ts +3 -7
  88. package/dist/components/NSSectionBars.js +4 -8
  89. package/dist/components/NSSectionBars.js.map +1 -1
  90. package/dist/components/NSSectionCards.d.ts +7 -15
  91. package/dist/components/NSSectionCards.js +7 -11
  92. package/dist/components/NSSectionCards.js.map +1 -1
  93. package/dist/components/NSSectionTitle.d.ts +6 -11
  94. package/dist/components/NSSectionTitle.js +2 -6
  95. package/dist/components/NSSectionTitle.js.map +1 -1
  96. package/dist/components/NSSelectBox.d.ts +8 -4
  97. package/dist/components/NSSelectBox.js +11 -3
  98. package/dist/components/NSSelectBox.js.map +1 -1
  99. package/dist/components/NSSpace.d.ts +2 -1
  100. package/dist/components/NSSpace.js +2 -1
  101. package/dist/components/NSSpace.js.map +1 -1
  102. package/dist/components/NSTable.d.ts +2 -1
  103. package/dist/components/NSTable.js +2 -1
  104. package/dist/components/NSTable.js.map +1 -1
  105. package/dist/components/NSTitle.d.ts +3 -7
  106. package/dist/components/NSTitle.js +3 -6
  107. package/dist/components/NSTitle.js.map +1 -1
  108. package/dist/main.d.ts +2 -3
  109. package/dist/main.js +2 -3
  110. package/dist/main.js.map +1 -1
  111. package/dist/pages/NSLoginPage.d.ts +2 -3
  112. package/dist/pages/NSLoginPage.js +4 -3
  113. package/dist/pages/NSLoginPage.js.map +1 -1
  114. package/dist/props/BaseComponentProps.d.ts +1 -0
  115. package/package.json +2 -3
  116. package/src/App.tsx +4 -25
  117. package/src/components/NSButton.module.css +8 -7
  118. package/src/components/NSButton.tsx +8 -24
  119. package/src/components/NSButtonBlue.module.css +0 -8
  120. package/src/components/NSButtonBlue.tsx +7 -28
  121. package/src/components/NSButtonGreen.module.css +0 -8
  122. package/src/components/NSButtonGreen.tsx +7 -28
  123. package/src/components/NSButtonRed.module.css +0 -8
  124. package/src/components/NSButtonRed.tsx +8 -29
  125. package/src/components/NSCard.tsx +51 -57
  126. package/src/components/NSCopyToClipboard.module.css +1 -1
  127. package/src/components/NSCopyToClipboard.tsx +23 -37
  128. package/src/components/NSEntityBar.module.css +1 -1
  129. package/src/components/NSEntityBar.tsx +20 -24
  130. package/src/components/NSEntityCardBackground.tsx +24 -58
  131. package/src/components/NSFooter.tsx +13 -9
  132. package/src/components/NSHeader.tsx +25 -15
  133. package/src/components/NSInputDate.tsx +22 -15
  134. package/src/components/NSInputDuration.tsx +10 -9
  135. package/src/components/NSInputEmail.tsx +2 -0
  136. package/src/components/NSInputErrorNotifier.tsx +28 -0
  137. package/src/components/NSInputFloat.tsx +1 -1
  138. package/src/components/NSInputIP.tsx +4 -3
  139. package/src/components/NSInputInteger.tsx +2 -1
  140. package/src/components/NSInputPhone.tsx +2 -1
  141. package/src/components/NSInputPrice.tsx +2 -1
  142. package/src/components/NSInputSearch.tsx +3 -3
  143. package/src/components/NSInputText.tsx +2 -1
  144. package/src/components/NSInputTime.tsx +2 -1
  145. package/src/components/NSLayout.tsx +8 -4
  146. package/src/components/NSLayoutHeroBanner.tsx +4 -7
  147. package/src/components/NSLayoutTitle.tsx +4 -6
  148. package/src/components/NSLinkBlue.tsx +14 -35
  149. package/src/components/NSLinkGreen.tsx +2 -1
  150. package/src/components/NSLinkRed.tsx +2 -1
  151. package/src/components/NSLoading.tsx +10 -18
  152. package/src/components/NSNotification.module.css +32 -0
  153. package/src/components/NSNotification.tsx +72 -0
  154. package/src/components/NSPagination.tsx +18 -16
  155. package/src/components/NSPanel.tsx +14 -23
  156. package/src/components/NSSection.tsx +15 -40
  157. package/src/components/NSSectionBars.tsx +14 -23
  158. package/src/components/NSSectionCards.tsx +33 -47
  159. package/src/components/NSSectionTitle.tsx +13 -22
  160. package/src/components/NSSelectBox.tsx +21 -8
  161. package/src/components/NSSpace.tsx +6 -2
  162. package/src/components/NSTable.tsx +7 -4
  163. package/src/components/NSTitle.tsx +12 -16
  164. package/src/main.ts +2 -3
  165. package/src/pages/NSLoginPage.tsx +8 -6
  166. package/src/props/BaseComponentProps.ts +1 -0
  167. package/dist/components/NSButtonBlueVector.d.ts +0 -15
  168. package/dist/components/NSButtonBlueVector.js +0 -17
  169. package/dist/components/NSButtonBlueVector.js.map +0 -1
  170. package/dist/components/NSButtonBlueVector.module.css +0 -17
  171. package/dist/components/NSError.d.ts +0 -11
  172. package/dist/components/NSError.js +0 -14
  173. package/dist/components/NSError.js.map +0 -1
  174. package/dist/components/NSMessenger.d.ts +0 -14
  175. package/dist/components/NSMessenger.js +0 -23
  176. package/dist/components/NSMessenger.js.map +0 -1
  177. package/dist/components/NSMessenger.module.css +0 -16
  178. package/dist/props/BackgroundProps.d.ts +0 -6
  179. package/dist/props/BackgroundProps.js +0 -2
  180. package/dist/props/BackgroundProps.js.map +0 -1
  181. package/dist/props/NSButtonProps.d.ts +0 -10
  182. package/dist/props/NSButtonProps.js +0 -2
  183. package/dist/props/NSButtonProps.js.map +0 -1
  184. package/src/components/NSButtonBlueVector.module.css +0 -17
  185. package/src/components/NSButtonBlueVector.tsx +0 -41
  186. package/src/components/NSError.tsx +0 -42
  187. package/src/components/NSMessenger.module.css +0 -16
  188. package/src/components/NSMessenger.tsx +0 -56
  189. package/src/props/BackgroundProps.ts +0 -7
  190. package/src/props/NSButtonProps.ts +0 -11
  191. /package/dist/components/{NSError.module.css → NSInputErrorNotifier.module.css} +0 -0
  192. /package/src/components/{NSError.module.css → NSInputErrorNotifier.module.css} +0 -0
@@ -3,8 +3,9 @@
3
3
  import Style from "./NSLinkRed.module.css";
4
4
  import React from "react";
5
5
  import { Link } from "react-router-dom";
6
+ import { BaseComponentProps } from "../props/BaseComponentProps";
6
7
 
7
- export interface NSLinkRedProps
8
+ export interface NSLinkRedProps extends BaseComponentProps
8
9
  {
9
10
  title: string;
10
11
  href: string;
@@ -1,26 +1,18 @@
1
- "use client";
2
-
3
- import { Component } from 'react';
4
1
  import Styles from './NSLoading.module.css';
5
2
  import { NSSection } from './NSSection';
6
- import { BackgroundProps } from '../props/BackgroundProps';
3
+ import { BaseComponentProps } from "../props/BaseComponentProps";
7
4
 
8
- interface NSLoadingProps
5
+ export interface NSLoadingProps extends BaseComponentProps
9
6
  {
10
- background?: BackgroundProps;
11
7
  }
12
8
 
13
- export class NSLoading extends Component<NSLoadingProps>
9
+ export function NSLoading(props: NSLoadingProps)
14
10
  {
15
- override render()
16
- {
17
- return (
18
- <NSSection background={this.props.background} >
19
- <div className={Styles.ns_loading_parent}>
20
- <div className={Styles.ns_loader}></div>
21
- </div>
22
- </NSSection>
23
- );
24
- }
11
+ return (
12
+ <NSSection {...props}>
13
+ <div className={Styles.ns_loading_parent}>
14
+ <div className={Styles.ns_loader}></div>
15
+ </div>
16
+ </NSSection>
17
+ );
25
18
  }
26
-
@@ -0,0 +1,32 @@
1
+ .ns_messenger {
2
+ background-color: #fff;
3
+ padding: 12px 15px;
4
+ display: flex;
5
+ justify-content: space-between;
6
+ align-items: center;
7
+ }
8
+
9
+ .ns_gray {
10
+ border: 3px solid gray;
11
+ box-shadow: 1px 1px 8px 0px gray;
12
+ }
13
+
14
+ .ns_blue {
15
+ border: 3px solid blue;
16
+ box-shadow: 1px 1px 8px 0px blue;
17
+ }
18
+
19
+ .ns_green {
20
+ border: 3px solid rgba(112, 224, 0, 1);
21
+ box-shadow: 1px 1px 8px 0px rgba(112, 224, 0, 1);
22
+ }
23
+
24
+ .ns_yellow {
25
+ border: 3px solid yellow;
26
+ box-shadow: 1px 1px 8px 0px yellow;
27
+ }
28
+
29
+ .ns_red {
30
+ border: 3px solid red;
31
+ box-shadow: 1px 1px 8px 0px red;
32
+ }
@@ -0,0 +1,72 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import Exit from '../assets/images/close-vector.png';
5
+ import Styles from "./NSNotification.module.css";
6
+ import { BaseComponentProps } from "../props/BaseComponentProps";
7
+
8
+ export interface NSNotificationProps extends BaseComponentProps
9
+ {
10
+ title: string;
11
+ type: NSNotificationType;
12
+ }
13
+
14
+ export interface NSNotificationState
15
+ {
16
+ show: boolean;
17
+ }
18
+
19
+ export enum NSNotificationType
20
+ {
21
+ GRAY = "GRAY",
22
+ BLUE = "BLUE",
23
+ GREEN = "GREEN",
24
+ YELLOW = "YELLOW",
25
+ RED = "RED",
26
+ }
27
+
28
+ export class NSNotification extends React.Component<NSNotificationProps, NSNotificationState>
29
+ {
30
+ constructor(props: NSNotificationProps)
31
+ {
32
+ super(props);
33
+ this.state = {
34
+ show: true,
35
+ };
36
+ }
37
+
38
+ override componentDidMount(): void
39
+ {
40
+ setTimeout(() => { this.handleDestroy() }, 8000);
41
+ }
42
+
43
+ handleDestroy = () =>
44
+ {
45
+ this.setState({ show: false });
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
+ }
72
+ }
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
 
3
+ import { BaseComponentProps } from '../props/BaseComponentProps';
3
4
  import Styles from './NSPagination.module.css';
4
5
  import { Component } from 'react';
5
6
 
6
- export interface NSPaginationProps
7
+ export interface NSPaginationProps extends BaseComponentProps
7
8
  {
8
9
  size: number;
9
10
  page: number;
@@ -14,8 +15,7 @@ export interface NSPaginationState
14
15
  size: number;
15
16
  page: number;
16
17
  }
17
-
18
- export class NSPagination extends Component<NSPaginationState, NSPaginationProps>
18
+ export class NSPagination extends Component<NSPaginationProps, NSPaginationState>
19
19
  {
20
20
  constructor(props: NSPaginationProps)
21
21
  {
@@ -48,12 +48,12 @@ export class NSPagination extends Component<NSPaginationState, NSPaginationProps
48
48
  arr.push(
49
49
  <div>
50
50
  <a href='#'>
51
- <img
52
- src='https://static.namirasoft.com/icons/base/circle-chevron-left.png'
53
- alt='left_vector'
54
- width={32}
55
- height={32}
56
- />
51
+ <img
52
+ src='https://static.namirasoft.com/icons/base/circle-chevron-left.png'
53
+ alt='left_vector'
54
+ width={32}
55
+ height={32}
56
+ />
57
57
  </a>
58
58
  </div>
59
59
  );
@@ -76,18 +76,20 @@ export class NSPagination extends Component<NSPaginationState, NSPaginationProps
76
76
  arr.push(
77
77
  <div>
78
78
  <a href='#'>
79
- <img
80
- src='https://static.namirasoft.com/icons/base/circle-chevron-right.png'
81
- width={32}
82
- height={32}
83
- alt='right_vector'
84
- />
79
+ <img
80
+ src='https://static.namirasoft.com/icons/base/circle-chevron-right.png'
81
+ width={32}
82
+ height={32}
83
+ alt='right_vector'
84
+ />
85
85
  </a>
86
86
  </div>
87
87
  );
88
88
 
89
89
  return (
90
- <div className={`${Styles.ns_pagination_container}`}>
90
+ <div id={this.props.id}
91
+ className={`${Styles.ns_pagination_container} ${this.props.classList?.join(" ")}`}
92
+ style={this.props.style}>
91
93
  {arr.map(x => (x))}
92
94
  </div>
93
95
  );
@@ -1,29 +1,20 @@
1
- "use client";
1
+ import { ReactNode } from "react";
2
+ import Styles from './NSPanel.module.css';
3
+ import { BaseComponentProps } from "../props/BaseComponentProps";
2
4
 
3
- import { Component, ReactNode } from "react";
4
- import Styles from './NSPanel.module.css'
5
-
6
- export interface NSSectionProps
5
+ export interface NSSectionProps extends BaseComponentProps
7
6
  {
8
7
  children: ReactNode;
9
8
  grid: boolean;
10
9
  }
11
-
12
- export interface NSSectionState
13
- {}
14
-
15
- export class NSPanel extends Component<NSSectionProps, NSSectionState> {
16
- constructor(props: NSSectionProps)
17
- {
18
- super(props);
19
- }
20
- override render()
21
- {
22
- return (
23
- <section
24
- className={this.props.grid ? Styles.ns_panel_grid : Styles.ns_panel_column } >
25
- {this.props.children}
26
- </section>
27
- );
28
- }
10
+ export function NSPanel(props: NSSectionProps)
11
+ {
12
+ return (
13
+ <section id={props.id}
14
+ className={`${props.grid ? Styles.ns_panel_grid : Styles.ns_panel_column} ${props.classList?.join(" ")}`}
15
+ style={props.style}
16
+ >
17
+ {props.children}
18
+ </section>
19
+ );
29
20
  }
@@ -1,49 +1,24 @@
1
- "use client";
2
-
3
- import { Component, ReactNode } from "react";
1
+ import { ReactNode } from "react";
4
2
  import Styles from './NSSection.module.css'
5
- import { BackgroundProps } from "../props/BackgroundProps";
3
+ import { BaseComponentProps } from "../props/BaseComponentProps";
6
4
 
7
- export interface NSSectionProps
5
+ export interface NSSectionProps extends BaseComponentProps
8
6
  {
9
7
  children: ReactNode;
10
- background?: BackgroundProps;
11
8
  center_items?: boolean;
12
9
  }
13
10
 
14
- export interface NSSectionState
15
- {
16
- background?: BackgroundProps;
17
- }
18
-
19
- export class NSSection extends Component<NSSectionProps, NSSectionState>
11
+ export function NSSection(props: NSSectionProps)
20
12
  {
21
- constructor(props: NSSectionProps)
22
- {
23
- super(props);
24
- this.state = {
25
- background: {
26
- image: `url(${props.background?.image})`,
27
- color: props.background?.color,
28
- position: props.background?.position
29
- }
30
- }
31
- }
32
- override render()
33
- {
34
- let styles = [Styles.ns_section];
35
- if (this.props.center_items)
36
- styles.push(Styles.ns_section_center);
37
- return (
38
- <section style=
39
- {{
40
- backgroundImage: this.state.background?.image,
41
- backgroundColor: this.state.background?.color,
42
- backgroundPosition: this.state.background?.position
43
- }}
44
- className={styles.join(" ")} >
45
- {this.props.children}
46
- </section>
47
- );
48
- }
13
+ let styles = [Styles.ns_section];
14
+ if (props.center_items)
15
+ styles.push(Styles.ns_section_center);
16
+ return (
17
+ <section id={props.id}
18
+ className={`${styles.join(" ")} ${props.classList?.join(" ")}`}
19
+ style={props.style}
20
+ >
21
+ {props.children}
22
+ </section>
23
+ );
49
24
  }
@@ -1,34 +1,25 @@
1
- "use client";
2
-
3
- import { Component } from 'react';
4
1
  import Styles from './NSSectionBars.module.css';
5
2
  import { NSEntityBar, NSEntityBarProps } from './NSEntityBar';
6
3
  import { NSSection } from './NSSection';
7
- import { BackgroundProps } from '../props/BackgroundProps';
8
4
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
5
+ import { BaseComponentProps } from "../props/BaseComponentProps";
9
6
 
10
- export interface NSSectionBarsProps
7
+ export interface NSSectionBarsProps extends BaseComponentProps
11
8
  {
12
- background?: BackgroundProps;
13
9
  bars: NSEntityBarProps[]
14
10
  }
15
11
 
16
- export class NSSectionBars extends Component<NSSectionBarsProps>
12
+ export function NSSectionBars(props: NSSectionBarsProps)
17
13
  {
18
- override render()
19
- {
20
- return (
21
- <>
22
- <NSSection background={this.props.background} >
23
- <NSSpace size={NSSpaceSizeType.NORMAL} />
24
- <div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_entity_bar_container}`}>
25
- {
26
- this.props.bars?.map((bar) => <NSEntityBar key={bar.id} {...bar} />)
27
- }
28
- </div>
29
- <NSSpace size={NSSpaceSizeType.NORMAL} />
30
- </NSSection>
31
- </>
32
- );
33
- }
14
+ return (
15
+ <NSSection {...props} >
16
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
17
+ <div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_entity_bar_container}`}>
18
+ {
19
+ props.bars?.map((bar) => <NSEntityBar key={bar.id} {...bar} />)
20
+ }
21
+ </div>
22
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
23
+ </NSSection>
24
+ );
34
25
  }
@@ -1,66 +1,52 @@
1
- "use client";
2
-
3
- import { Component } from 'react';
4
1
  import Styles from './NSSectionCards.module.css';
5
- import { NSTitle } from './NSTitle';
2
+ import { NSTitle, NSTitleProps } from './NSTitle';
6
3
  import { NSCard, NSCardProps } from './NSCard';
7
4
  import { NSSection } from './NSSection';
8
5
  import { NSLinkBlue } from './NSLinkBlue';
9
- import { BackgroundProps } from '../props/BackgroundProps';
10
6
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
7
+ import { BaseComponentProps } from "../props/BaseComponentProps";
8
+ import { LinkProps } from '../props/LinkProps';
11
9
 
12
- export interface NSSectionCardsProps
10
+ export interface NSSectionCardsProps extends BaseComponentProps
13
11
  {
14
- title?: {
15
- text: string,
16
- color?: string
17
- };
12
+ title?: NSTitleProps;
18
13
  description?: {
19
14
  text: string,
20
15
  color?: string
21
16
  };
22
- background?: BackgroundProps
23
- button?: {
24
- href: string;
25
- title: string;
26
- };
17
+ button?: LinkProps;
27
18
  cards: NSCardProps[];
28
19
  }
29
20
 
30
- export class NSSectionCards extends Component<NSSectionCardsProps>
21
+ export function NSSectionCards(props: NSSectionCardsProps)
31
22
  {
32
- override render()
33
- {
34
- return (
35
- <>
36
- <NSSection background={this.props.background} >
37
- <NSSpace size={NSSpaceSizeType.NORMAL} />
38
- <div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_section_cards_holder}`}>
39
- {
40
- this.props.title &&
41
- <div className={Styles.ns_section_cards_title_container}>
42
- <NSTitle color={this.props.title?.color} title={this.props.title?.text} />
43
- {
44
- this.props.description &&
45
- <p style={{ color: this.props.description?.color }} className={Styles.ns_description}> {this.props.description.text} </p>
46
- }
47
- </div>
48
- }
49
- <div className={` ${Styles.ns_card_container}`}>
50
- {
51
- this.props.cards?.map((card) => <NSCard key={card.id} {...card} />)
52
- }
53
- </div>
23
+ return (
24
+ <NSSection {...props} >
25
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
26
+ <div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_section_cards_holder}`}>
27
+ {
28
+ props.title &&
29
+ <div className={Styles.ns_section_cards_title_container}>
30
+ <NSTitle {...props.title} />
54
31
  {
55
- this.props.button &&
56
- <div className={`mt-12 w-full- text-center ${Styles.ns_section_cards_link_container}`}>
57
- <NSLinkBlue href={this.props.button?.href} title={this.props.button?.title} />
58
- </div>
32
+ props.description &&
33
+ <p style={{ color: props.description?.color }} className={Styles.ns_description}> {props.description.text} </p>
59
34
  }
60
35
  </div>
61
- <NSSpace size={NSSpaceSizeType.NORMAL} />
62
- </NSSection>
63
- </>
64
- );
65
- }
36
+ }
37
+ <div className={` ${Styles.ns_card_container}`}>
38
+ {
39
+ props.cards?.map((card) => <NSCard key={card.id} {...card} />)
40
+ }
41
+ </div>
42
+ {
43
+ props.button &&
44
+ <div className={`mt-12 w-full- text-center ${Styles.ns_section_cards_link_container}`}>
45
+ <NSLinkBlue {...props.button} />
46
+ </div>
47
+ }
48
+ </div>
49
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
50
+ </NSSection>
51
+ );
66
52
  }
@@ -1,31 +1,22 @@
1
- "use client";
2
-
3
- import { Component, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
4
2
  import { NSSection } from './NSSection';
5
- import { NSTitle } from './NSTitle';
6
- import { BackgroundProps } from '../props/BackgroundProps';
3
+ import { NSTitle, NSTitleProps } from './NSTitle';
7
4
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
5
+ import { BaseComponentProps } from "../props/BaseComponentProps";
8
6
 
9
- export interface NSSectionTitleProps
7
+ export interface NSSectionTitleProps extends BaseComponentProps
10
8
  {
11
- title: {
12
- text: string,
13
- color?: string
14
- };
15
- background?: BackgroundProps
9
+ title: NSTitleProps;
16
10
  children: ReactNode
17
11
  }
18
12
 
19
- export class NSSectionTitle extends Component<NSSectionTitleProps>
13
+ export function NSSectionTitle(props: NSSectionTitleProps)
20
14
  {
21
- override render()
22
- {
23
- return (
24
- <NSSection background={this.props.background} >
25
- <NSSpace size={NSSpaceSizeType.NORMAL} />
26
- <NSTitle color={this.props.title.color} title={this.props.title.text} />
27
- {this.props.children}
28
- </NSSection>
29
- );
30
- }
15
+ return (
16
+ <NSSection {...props} >
17
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
18
+ <NSTitle {...props.title} />
19
+ {props.children}
20
+ </NSSection>
21
+ );
31
22
  }
@@ -5,8 +5,9 @@ import Styles from "./NSSelectBox.module.css";
5
5
  import { Select, Space } from 'antd';
6
6
  import type { SelectProps } from 'antd';
7
7
  import IconSelectBox from '../assets/images/icon-select-box.svg';
8
+ import { BaseComponentProps } from "../props/BaseComponentProps";
8
9
 
9
- export interface NSSelectBoxProps
10
+ export interface NSSelectBoxProps extends BaseComponentProps
10
11
  {
11
12
  title: string;
12
13
  options: SelectProps['options'];
@@ -14,26 +15,38 @@ export interface NSSelectBoxProps
14
15
 
15
16
  export interface NSSelectBoxState
16
17
  {
17
- value: string[];
18
+ value: string | null;
19
+ values: string[];
18
20
  }
19
21
 
20
- export class NSSelectBox extends React.Component<NSSelectBoxProps, NSSelectBoxState> {
22
+ export class NSSelectBox extends React.Component<NSSelectBoxProps, NSSelectBoxState>
23
+ {
21
24
  constructor(props: NSSelectBoxProps)
22
25
  {
23
26
  super(props);
24
27
  this.state = {
25
- value: [],
28
+ value: null,
29
+ values: [],
26
30
  };
27
- this.setValue = this.setValue.bind(this);
31
+ this.getValues = this.getValues.bind(this);
32
+ this.setValues = this.setValues.bind(this);
28
33
  }
29
- setValue(value: string[]): void
34
+ setValue(value: string | null): void
30
35
  {
31
36
  this.setState({ value });
32
37
  }
33
- getValue(): string[]
38
+ getValue(): string | null
34
39
  {
35
40
  return this.state.value;
36
41
  }
42
+ setValues(values: string[]): void
43
+ {
44
+ this.setState({ values });
45
+ }
46
+ getValues(): string[]
47
+ {
48
+ return this.state.values;
49
+ }
37
50
  override render()
38
51
  {
39
52
  return (
@@ -44,7 +57,7 @@ export class NSSelectBox extends React.Component<NSSelectBoxProps, NSSelectBoxSt
44
57
  style={{ width: '100%' }}
45
58
  className={Styles.ns_input_select}
46
59
  placeholder="Combo Box"
47
- onChange={this.setValue}
60
+ onChange={this.setValues}
48
61
  optionLabelProp="label"
49
62
  options={this.props.options}
50
63
  optionRender={(option) => (
@@ -1,4 +1,6 @@
1
- export interface NSSpaceProps
1
+ import { BaseComponentProps } from "../props/BaseComponentProps";
2
+
3
+ export interface NSSpaceProps extends BaseComponentProps
2
4
  {
3
5
  size: NSSpaceSizeType;
4
6
  }
@@ -20,6 +22,8 @@ export enum NSSpaceSizeType
20
22
  export function NSSpace(props: NSSpaceProps)
21
23
  {
22
24
  return (
23
- <hr style={{ width: "100%", height: props.size, margin: "0px", padding: "0px", background: "transparent", color: "transparent", border: 0 }} />
25
+ <hr id={props.id}
26
+ className={props.classList?.join(" ")}
27
+ style={{ ...props.style, width: "100%", height: props.size, margin: "0px", padding: "0px", background: "transparent", color: "transparent", border: 0 }} />
24
28
  );
25
29
  }
@@ -6,8 +6,9 @@ import { NSPagination } from './NSPagination';
6
6
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
7
7
  import Styles from './NSTable.module.css';
8
8
  import { Component } from 'react';
9
+ import { BaseComponentProps } from "../props/BaseComponentProps";
9
10
 
10
- export interface NSTableProps<RowType>
11
+ export interface NSTableProps<RowType> extends BaseComponentProps
11
12
  {
12
13
  columns: { [key: string]: string };
13
14
  rows: RowType[];
@@ -54,7 +55,9 @@ export class NSTable<RowType> extends Component<NSTableProps<RowType>, NSTableSt
54
55
  return (row as any)[column];
55
56
  }
56
57
  return (
57
- <div className={`container ${Styles.ns_project_list_container}`}>
58
+ <div id={this.props.id}
59
+ className={`container ${Styles.ns_project_list_container} ${this.props.classList?.join(" ")}`}
60
+ style={this.props.style}>
58
61
  <section className={Styles.ns_search_input}>
59
62
  <NSInputSearch />
60
63
  </section>
@@ -85,8 +88,8 @@ export class NSTable<RowType> extends Component<NSTableProps<RowType>, NSTableSt
85
88
  <NSPagination size={50} page={5} />
86
89
  <NSSpace size={NSSpaceSizeType.SMALL} />
87
90
  <div className={Styles.ns_button}>
88
- <NSButton title='Export' icon={{ src: "/assets/images/export-vector.png" }} onClick={() => { }} border='1px solid rgba(255, 148, 50, 1)' />
89
- <NSButton title='Refresh' icon={{ src: "/assets/images/export-vector.png" }} onClick={() => { }} border='1px solid rgba(3, 119, 255, 1)' />
91
+ <NSButton title='Export' icon={{ src: "/assets/images/export-vector.png" }} onClick={() => { }} style={{ border: '1px solid rgba(255, 148, 50, 1)' }} />
92
+ <NSButton title='Refresh' icon={{ src: "/assets/images/export-vector.png" }} onClick={() => { }} style={{ border: '1px solid rgba(3, 119, 255, 1)' }} />
90
93
  </div>
91
94
  </section>
92
95
  <NSSpace size={NSSpaceSizeType.SMALL} />