sprint-asia-custom-component 0.1.73 → 0.1.75

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/index.js CHANGED
@@ -23816,14 +23816,17 @@
23816
23816
  endDate,
23817
23817
  onChangeEndDate,
23818
23818
  isRequired,
23819
- title
23819
+ title,
23820
+ className
23820
23821
  }) => {
23821
23822
  const onChange = dates => {
23822
23823
  const [start, end] = dates;
23823
23824
  onChangeStartDate(start);
23824
23825
  onChangeEndDate(end);
23825
23826
  };
23826
- return /*#__PURE__*/React__default["default"].createElement("div", null, title && /*#__PURE__*/React__default["default"].createElement("div", {
23827
+ return /*#__PURE__*/React__default["default"].createElement("div", {
23828
+ className: `w-full ${className}`
23829
+ }, title && /*#__PURE__*/React__default["default"].createElement("div", {
23827
23830
  className: "flex"
23828
23831
  }, /*#__PURE__*/React__default["default"].createElement("p", {
23829
23832
  className: "text-sm font-normal text-black mb-1"
@@ -44147,7 +44150,8 @@
44147
44150
  title = "",
44148
44151
  value,
44149
44152
  onChange,
44150
- isRequired = true
44153
+ isRequired = true,
44154
+ className
44151
44155
  }) => {
44152
44156
  // ADDED function to handle the change from parent
44153
44157
 
@@ -44155,7 +44159,7 @@
44155
44159
  onChange(content);
44156
44160
  };
44157
44161
  return /*#__PURE__*/React__default["default"].createElement("div", {
44158
- className: "w-full h-60"
44162
+ className: "w-full"
44159
44163
  }, title && /*#__PURE__*/React__default["default"].createElement("div", {
44160
44164
  className: "flex"
44161
44165
  }, /*#__PURE__*/React__default["default"].createElement("p", {
@@ -44165,20 +44169,21 @@
44165
44169
  }, "*")), /*#__PURE__*/React__default["default"].createElement(ReactQuill$1, {
44166
44170
  value: value,
44167
44171
  onChange: handleChange,
44172
+ className: className,
44168
44173
  modules: {
44169
44174
  toolbar: [[{
44170
- 'header': [1, 3, 4, 5, 6, false]
44171
- }], ['bold', 'italic', 'link', {
44172
- 'list': 'bullet'
44175
+ header: [1, 3, 4, 5, 6, false]
44176
+ }], ["bold", "italic", "link", {
44177
+ list: "bullet"
44173
44178
  }, {
44174
- 'list': 'ordered'
44179
+ list: "ordered"
44175
44180
  }], [{
44176
- 'indent': '-1'
44181
+ indent: "-1"
44177
44182
  }, {
44178
- 'indent': '+1'
44183
+ indent: "+1"
44179
44184
  }]]
44180
44185
  },
44181
- formats: ['header', 'bold', 'italic', 'strike', 'blockquote', 'list', 'bullet', 'link', 'indent']
44186
+ formats: ["header", "bold", "italic", "strike", "blockquote", "list", "bullet", "link", "indent"]
44182
44187
  }));
44183
44188
  };
44184
44189
 
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.73",
4
+ "version": "0.1.75",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -1,46 +1,42 @@
1
1
  import React from "react";
2
2
  import DatePicker from "react-datepicker";
3
- import 'react-datepicker/dist/react-datepicker.css';
3
+ import "react-datepicker/dist/react-datepicker.css";
4
4
  import { PiCalendarBlankDuotone } from "react-icons/pi";
5
5
 
6
- const CustomDatePicker = ({
7
- startDate,
8
- onChangeStartDate,
9
- endDate,
10
- onChangeEndDate,
11
- isRequired,
12
- title
13
- }) => {
14
- const onChange = (dates) => {
15
- const [start, end] = dates
16
- onChangeStartDate(start)
17
- onChangeEndDate(end)
18
- };
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
+ };
19
12
 
20
13
  return (
21
- <div>
22
- {title && (
23
- <div className="flex">
24
- <p className="text-sm font-normal text-black mb-1">{title}</p>
25
- {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
26
- </div>
27
- )}
28
- <div className="cursor-pointer py-1 border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
29
- <div className="p-2">
30
- <PiCalendarBlankDuotone size={16} className="text-neutral300"/>
31
- </div>
32
- <DatePicker
33
- selected={startDate}
34
- onChange={onChange}
35
- startDate={startDate}
36
- endDate={endDate}
37
- selectsRange
38
- utcOffset={0}
39
- dateFormat="d MMM yyyy"
40
- className="cursor-pointer bg-neutral20 text-neutral300 rounded-md pr-2 focus:outline-none text-sm"
41
- />
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>}
42
19
  </div>
20
+ )}
21
+
22
+ <div className="cursor-pointer py-1 border border-neutral40 bg-neutral20 rounded-md w-fit flex items-center">
23
+ <div className="p-2">
24
+ <PiCalendarBlankDuotone size={16} className="text-neutral300" />
25
+ </div>
26
+
27
+ <DatePicker
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"
36
+ />
37
+ </div>
43
38
  </div>
44
- )}
39
+ );
40
+ };
45
41
 
46
- export default CustomDatePicker;
42
+ export default CustomDatePicker;
@@ -1,56 +1,42 @@
1
- import React from 'react';
2
- import ReactQuill from 'react-quill';
3
- import '../../assets/css/reactquill/quill.snow.css';
4
-
1
+ import React from "react";
2
+ import ReactQuill from "react-quill";
3
+ import "../../assets/css/reactquill/quill.snow.css";
5
4
 
6
5
  // ADDED value and onChange
7
6
 
8
- const TextEditor = ({
9
- title = "",
10
- value,
11
- onChange,
12
- isRequired = true,
13
- }) => {
14
-
15
-
16
- // ADDED function to handle the change from parent
17
-
18
- const handleChange = (content) => {
19
- onChange(content);
20
- };
21
-
22
- return (
23
- <div className='w-full h-60'>
24
- {title &&
25
- <div className='flex'>
26
- <p className="text-sm font-normal text-black mb-1">{title}</p>
27
- {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
28
- </div>
29
- }
30
-
7
+ const TextEditor = ({ title = "", value, onChange, isRequired = true, className }) => {
8
+ // ADDED function to handle the change from parent
31
9
 
32
- {/* ADDED the parameters to be used in Parent*/}
10
+ const handleChange = (content) => {
11
+ onChange(content);
12
+ };
33
13
 
34
- <ReactQuill
35
- value={value}
36
- onChange={handleChange}
37
- modules={{
38
- toolbar: [
39
- [{ 'header': [1, 3, 4, 5, 6, false] }],
40
- ['bold', 'italic', 'link', { 'list': 'bullet' }, { 'list': 'ordered' }],
41
- [{ 'indent': '-1' }, { 'indent': '+1' }],
42
- ],
43
- }}
44
- formats={[
45
- 'header',
46
- 'bold', 'italic', 'strike', 'blockquote',
47
- 'list', 'bullet',
48
- 'link',
49
- 'indent',
50
- ]}
51
- />
14
+ return (
15
+ <div className="w-full">
16
+ {title && (
17
+ <div className="flex">
18
+ <p className="text-sm font-normal text-black mb-1">{title}</p>
19
+ {isRequired && <p className="text-sm font-normal text-danger500 ml-1">*</p>}
52
20
  </div>
53
- );
21
+ )}
22
+
23
+ {/* ADDED the parameters to be used in Parent*/}
24
+
25
+ <ReactQuill
26
+ value={value}
27
+ onChange={handleChange}
28
+ className={className}
29
+ modules={{
30
+ toolbar: [
31
+ [{ header: [1, 3, 4, 5, 6, false] }],
32
+ ["bold", "italic", "link", { list: "bullet" }, { list: "ordered" }],
33
+ [{ indent: "-1" }, { indent: "+1" }],
34
+ ],
35
+ }}
36
+ formats={["header", "bold", "italic", "strike", "blockquote", "list", "bullet", "link", "indent"]}
37
+ />
38
+ </div>
39
+ );
54
40
  };
55
41
 
56
42
  export default TextEditor;