@visns-studio/visns-components 4.5.9 → 4.5.11

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.
@@ -11,7 +11,14 @@ import { confirmAlert } from 'react-confirm-alert';
11
11
  import truncate from 'truncate';
12
12
  import { CopyToClipboard } from 'react-copy-to-clipboard';
13
13
  import { toast } from 'react-toastify';
14
- import { CircleCheck, Copy, File, TrashCan } from 'akar-icons';
14
+ import {
15
+ CircleCheck,
16
+ Copy,
17
+ EyeOpen,
18
+ EyeSlashed,
19
+ File,
20
+ TrashCan,
21
+ } from 'akar-icons';
15
22
 
16
23
  import 'react-confirm-alert/src/react-confirm-alert.css';
17
24
 
@@ -52,6 +59,12 @@ function GenericDetail({
52
59
  const [total, setTotal] = useState(0);
53
60
  const [windowHeight, setWindowHeight] = useState(window.innerHeight);
54
61
 
62
+ const [passwordVisible, setPasswordVisible] = useState(false);
63
+
64
+ const togglePasswordVisibility = () => {
65
+ setPasswordVisible(!passwordVisible);
66
+ };
67
+
55
68
  /** General Functions */
56
69
  const handleStageUpdate = async (stage, type) => {
57
70
  try {
@@ -327,6 +340,30 @@ function GenericDetail({
327
340
 
328
341
  const renderTotal = () => formatTotalValue();
329
342
 
343
+ const renderPassword = () => {
344
+ return (
345
+ <>
346
+ {passwordVisible ? stringValue : '******'}
347
+ <button
348
+ type="button"
349
+ onClick={togglePasswordVisibility}
350
+ style={{
351
+ marginLeft: '10px',
352
+ background: 'none',
353
+ border: 'none',
354
+ cursor: 'pointer',
355
+ }}
356
+ >
357
+ {passwordVisible ? (
358
+ <EyeSlashed size={24} />
359
+ ) : (
360
+ <EyeOpen size={24} />
361
+ )}
362
+ </button>
363
+ </>
364
+ );
365
+ };
366
+
330
367
  // Render based on the item's type
331
368
  switch (type) {
332
369
  case 'boolean':
@@ -353,6 +390,8 @@ function GenericDetail({
353
390
  return renderRichText();
354
391
  case 'total':
355
392
  return renderTotal();
393
+ case 'password':
394
+ return renderPassword();
356
395
  default:
357
396
  return size === 'full' && truncatedValue
358
397
  ? parse(`<br /><p>${truncatedValue}</p>`)
@@ -6,7 +6,7 @@
6
6
 
7
7
  .hwrap .logo {
8
8
  width: var(--logo-width, 100px);
9
- padding: 0 1rem 0 0.5rem;
9
+ padding: 0 2rem;
10
10
  margin: 0;
11
11
  line-height: 1.45;
12
12
  }
@@ -67,7 +67,7 @@
67
67
  align-items: center;
68
68
  gap: 0.25rem;
69
69
  box-sizing: border-box;
70
- padding: 0.5em 1em;
70
+ padding: 0.5em;
71
71
  margin: 0.25em;
72
72
  text-decoration: none;
73
73
  outline: none;
@@ -102,14 +102,14 @@
102
102
  .app-nav .nav-item:hover span,
103
103
  .app-nav .nav-item.active span {
104
104
  background: var(--primary-color-lighter);
105
- color: var(--tertiary-color);
105
+ color: var(--highlight-color);
106
106
  }
107
107
 
108
108
  .app-nav .nav-item:hover a svg,
109
109
  .app-nav .nav-item.active a svg,
110
110
  .app-nav .nav-item:hover span svg,
111
111
  .app-nav .nav-item.active span svg {
112
- color: var(--secondary-color);
112
+ color: var(--highlight-color);
113
113
  }
114
114
 
115
115
  .app-nav .nav-item-alternate:hover a,
package/package.json CHANGED
@@ -58,7 +58,7 @@
58
58
  "react-dom": "^17.0.1"
59
59
  },
60
60
  "name": "@visns-studio/visns-components",
61
- "version": "4.5.9",
61
+ "version": "4.5.11",
62
62
  "description": "Various packages to assist in the development of our Custom Applications.",
63
63
  "main": "index.js",
64
64
  "scripts": {