sprint-asia-custom-component 0.1.72 → 0.1.74

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.72",
4
+ "version": "0.1.74",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -1,35 +1,42 @@
1
- import React, {useState} from "react";
1
+ import React from "react";
2
2
  import DatePicker from "react-datepicker";
3
- import 'react-datepicker/dist/react-datepicker.css';
4
- import { PiCalendarDuotone } from "react-icons/pi";
3
+ import "react-datepicker/dist/react-datepicker.css";
4
+ import { PiCalendarBlankDuotone } from "react-icons/pi";
5
5
 
6
- const CustomDatePicker = ({
7
- startDate,
8
- onChangeStartDate,
9
- endDate,
10
- onChangeEndDate
11
- }) => {
12
- const onChange = (dates) => {
13
- const [start, end] = dates
14
- onChangeStartDate(start)
15
- onChangeEndDate(end)
16
- };
6
+ const CustomDatePicker = ({ startDate, onChangeStartDate, endDate, onChangeEndDate, isRequired, title, className }) => {
7
+ const onChange = (dates) => {
8
+ const [start, end] = dates;
9
+ onChangeStartDate(start);
10
+ onChangeEndDate(end);
11
+ };
17
12
 
18
13
  return (
19
- <div className="cursor-pointer h-full border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
14
+ <div className={`w-full ${className}`}>
15
+ {title && (
16
+ <div className="flex">
17
+ <p className="text-sm font-normal text-black mb-1">{title}</p>
18
+ {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
19
+ </div>
20
+ )}
21
+
22
+ <div className="cursor-pointer py-1 border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
20
23
  <div className="p-2">
21
- <PiCalendarDuotone size={16} className="text-neutral300"/>
24
+ <PiCalendarBlankDuotone size={16} className="text-neutral300" />
22
25
  </div>
26
+
23
27
  <DatePicker
24
- selected={startDate}
25
- onChange={onChange}
26
- startDate={startDate}
27
- endDate={endDate}
28
- selectsRange
29
- utcOffset={0}
30
- className="cursor-pointer bg-neutral20 text-neutral300 rounded-md pr-2 focus:outline-none text-sm"
28
+ selected={startDate}
29
+ onChange={onChange}
30
+ startDate={startDate}
31
+ endDate={endDate}
32
+ selectsRange
33
+ utcOffset={0}
34
+ dateFormat="d MMM yyyy"
35
+ className="cursor-pointer bg-neutral20 text-neutral300 rounded-md pr-2 focus:outline-none text-sm"
31
36
  />
37
+ </div>
32
38
  </div>
33
- )}
39
+ );
40
+ };
34
41
 
35
- export default CustomDatePicker;
42
+ export default CustomDatePicker;
@@ -7,7 +7,7 @@ const HeaderTable = ({
7
7
  <thead>
8
8
  <tr>
9
9
  {dataHeader.map((value, index) => (
10
- <th key={index} className="py-3.5 px-4 bg-neutral40 text-neutral500 text-sm font-semibold text-left">
10
+ <th key={index} className="py-3.5 px-4 bg-neutral20 text-neutral500 text-sm font-medium text-left">
11
11
  <p>{value.toUpperCase()}</p>
12
12
  </th>
13
13
  ))}