sprint-asia-custom-component 0.1.64 → 0.1.66

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.64",
4
+ "version": "0.1.66",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
- import { PiInfoFill, PiCheckCircleFill, PiX } from 'react-icons/pi'
2
+ import { PiInfoFill, PiCheckCircleFill, PiX, PiCheck, PiCheckBold, PiXBold } from 'react-icons/pi'
3
3
  import OutlineButton from '../button/outlinebutton'
4
+ import PrimaryButton from '../button/primarybutton'
4
5
 
5
6
  const Alert = ({
6
7
  title = "Title",
@@ -8,6 +9,8 @@ const Alert = ({
8
9
  type = "primary",
9
10
  titleLeftButton,
10
11
  titleRightButton,
12
+ titleLeftButtonClient,
13
+ titleRightButtonClient,
11
14
  onCloseButton,
12
15
  onClickLeftButton,
13
16
  onClickRightButton,
@@ -59,6 +62,18 @@ const Alert = ({
59
62
  <OutlineButton title={titleRightButton} onClick={onClickRightButton} size='small'/>
60
63
  </div>
61
64
  }
65
+ {
66
+ titleLeftButtonClient &&
67
+ <div className='m-1'>
68
+ <OutlineButton title={titleLeftButtonClient} onClick={onClickLeftButton} size='client approval' icon={<PiXBold />} isIconVisible={true} color="blue" />
69
+ </div>
70
+ }
71
+ {
72
+ titleRightButtonClient &&
73
+ <div className='m-1'>
74
+ <PrimaryButton title={titleRightButtonClient} onClick={onClickRightButton} size='client approval' icon={<PiCheckBold />} isIconVisible={true} color="blue"/>
75
+ </div>
76
+ }
62
77
  </div>
63
78
  {
64
79
  onCloseButton &&
@@ -1,5 +1,4 @@
1
1
  import React, { useState } from 'react';
2
- import { PiDownloadSimpleDuotone } from 'react-icons/pi';
3
2
 
4
3
  const OutlineButton = ({
5
4
  title = "Button",
@@ -7,6 +6,7 @@ const OutlineButton = ({
7
6
  isActive = true,
8
7
  size = "large",
9
8
  isIconVisible = false,
9
+ icon = null,
10
10
  onClick = () => {}
11
11
  }) => {
12
12
  const [isPressed, setIsPressed] = useState(false);
@@ -23,34 +23,35 @@ const OutlineButton = ({
23
23
  onClick();
24
24
  };
25
25
 
26
- return (
27
- <button
28
- className={`
29
- ${(isPressed && isActive) ? 'bg-white text-primary500 border-2 border-primary500 text-primary500' : (isActive ? 'bg-white border-2 border-primary500 text-primary500' : 'bg-neutral30 text-neutral80 cursor-default')}
30
- ${type === "full" && "w-full"}
31
- ${size === "small" && "text-sm h-7 w-32"}
32
- ${size === "medium" && "text-md h-8"}
33
- ${size === "large" && "text-lg h-10"}
34
- ${size === "very large" && "text-xl h-12"}
35
- ${size === "extra very large" && "text-2xl h-14"}
36
- ${size === "detail division" && "text-sm h-10 w-24"}
37
- rounded-lg drop-shadow-md text-center py-1.5 px-4 flex justify-center items-center`
38
- }
39
- disabled={!isActive}
40
- onClick={handleClick}
41
- onMouseDown={handleButtonPress}
42
- onMouseUp={handleButtonRelease}
43
- onTouchStart={handleButtonPress}
44
- onTouchEnd={handleButtonRelease}
45
- >
46
- <div className='flex items-center'>
47
- {
48
- isIconVisible && <PiDownloadSimpleDuotone size={16} className='mr-1'/>
26
+ return (
27
+ <button
28
+ className={`
29
+ ${(isPressed && isActive) ? 'bg-white text-primary500 border-2 border-primary500' : (isActive ? 'bg-white border-2 border-primary500 text-primary500' : 'bg-neutral30 text-neutral80 cursor-default')}
30
+ ${type === "full" && "w-full"}
31
+ ${size === "small" && "text-sm h-7 w-32"}
32
+ ${size === "medium" && "text-md h-8"}
33
+ ${size === "large" && "text-lg h-10"}
34
+ ${size === "very large" && "text-xl h-12"}
35
+ ${size === "extra very large" && "text-2xl h-14"}
36
+ ${size === "detail division" && "text-sm h-10 w-24"}
37
+ ${size === "client approval" && "text-sm h-8"}
38
+ rounded-lg drop-shadow-md text-center py-1.5 px-4 flex justify-center items-center`
49
39
  }
50
- <p>{title}</p>
51
- </div>
52
- </button>
53
- );
40
+ disabled={!isActive}
41
+ onClick={handleClick}
42
+ onMouseDown={handleButtonPress}
43
+ onMouseUp={handleButtonRelease}
44
+ onTouchStart={handleButtonPress}
45
+ onTouchEnd={handleButtonRelease}
46
+ >
47
+ <div className='flex items-center'>
48
+ {
49
+ isIconVisible && icon && <span className='mr-1'>{icon}</span>
50
+ }
51
+ <p>{title}</p>
52
+ </div>
53
+ </button>
54
+ );
54
55
  };
55
56
 
56
- export default OutlineButton;
57
+ export default OutlineButton;
@@ -5,6 +5,8 @@ const PrimaryButton = ({
5
5
  type = "wrap",
6
6
  isActive = true,
7
7
  size = "large",
8
+ isIconVisible = false,
9
+ icon = null,
8
10
  onClick = () => {}
9
11
  }) => {
10
12
  const [isPressed, setIsPressed] = useState(false);
@@ -32,6 +34,7 @@ const PrimaryButton = ({
32
34
  ${size === "very large" && "text-xl h-12"}
33
35
  ${size === "extra very large" && "text-2xl h-14"}
34
36
  ${size === "detail division" && "text-sm h-10"}
37
+ ${size === "client approval" && "text-sm h-8"}
35
38
  rounded-lg drop-shadow-md text-center py-1.5 px-4 flex justify-center items-center`
36
39
  }
37
40
  disabled={!isActive}
@@ -41,7 +44,12 @@ const PrimaryButton = ({
41
44
  onTouchStart={handleButtonPress}
42
45
  onTouchEnd={handleButtonRelease}
43
46
  >
44
- {title}
47
+ <div className='flex items-center'>
48
+ {
49
+ isIconVisible && icon && <span className='mr-1'>{icon}</span>
50
+ }
51
+ <p>{title}</p>
52
+ </div>
45
53
  </button>
46
54
  );
47
55
  };
@@ -16,7 +16,7 @@ const Chip = ({
16
16
  ${type == "danger" && "text-danger800 border-danger800 bg-danger50"}
17
17
  ' rounded-full text-xs border-2 flex items-center px-3.5`}>
18
18
 
19
- <div className='flex items-center'>
19
+ <div className='flex items-center justify-center'>
20
20
  <p className='py-1 text-center'>{title}</p>
21
21
  {
22
22
  type == "dropdown" && <p className='text-md pl-2 cursor-pointer' onClick={onClick}>x</p>
@@ -863,6 +863,9 @@ const Templates = () => {
863
863
  <div className='w-full py-3'>
864
864
  <Alert title='Client & Division Reminder' subtitle='Please ensure you have created the appropriate Client and division for the user before proceeding.' titleLeftButton="Add Client" titleRightButton="Add Division" onClickLeftButton={() => console.log("left button clicked")} onClickRightButton={() => console.log("right button clicked")}/>
865
865
  </div>
866
+ <div className='w-full py-3'>
867
+ <Alert title='Client & Division Reminder' subtitle='Please ensure you have created the appropriate Client and division for the user before proceeding.' titleLeftButtonClient="Reject" titleRightButtonClient="Approve" onClickLeftButton={() => console.log("left button clicked")} onClickRightButton={() => console.log("right button clicked")}/>
868
+ </div>
866
869
  {
867
870
  isOpenAlert &&
868
871
  <div className='w-full py-3'>