gbs-add-block 0.0.55 → 0.0.57
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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GBS Building Blocks 2.0 (v0.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v0.0.56)
|
|
2
2
|
|
|
3
3
|
Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
|
|
|
6
6
|
|
|
7
7
|
For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
|
|
8
8
|
|
|
9
|
-
## What's New 🎉 (Ver 0.0.
|
|
9
|
+
## What's New 🎉 (Ver 0.0.56)
|
|
10
10
|
|
|
11
11
|
- Updated for more general installation methods
|
|
12
12
|
- Fixed bug in Framework detection for more accuracy
|
package/package.json
CHANGED
|
@@ -54,10 +54,6 @@ export const DatePicker = ({
|
|
|
54
54
|
hasMounted,
|
|
55
55
|
} = useDatePickerState(selectedDateValue || null);
|
|
56
56
|
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
console.log("selectedDateValue", selectedDate);
|
|
59
|
-
}, [selectedDate]);
|
|
60
|
-
|
|
61
57
|
const { prevMonth, nextMonth } = useYearMonthNavigation(
|
|
62
58
|
currentMonth,
|
|
63
59
|
currentYear,
|
|
@@ -124,13 +120,13 @@ export const DatePicker = ({
|
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
return (
|
|
127
|
-
<div className="relative inline-block w-full
|
|
123
|
+
<div className="relative inline-block w-full" ref={dateRef}>
|
|
128
124
|
<button
|
|
129
125
|
type="button"
|
|
130
126
|
onClick={toggleDatepicker}
|
|
131
127
|
className={`${
|
|
132
128
|
error ? primary["error-border"] : "border"
|
|
133
|
-
} p-2 rounded-lg w-full flex items-center gap-2 dark:text-white ${
|
|
129
|
+
} p-2 rounded-lg w-full flex items-center gap-2 dark:text-white dark:bg-black ${
|
|
134
130
|
disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
135
131
|
}`}
|
|
136
132
|
disabled={disabled}
|
|
@@ -243,7 +239,7 @@ export const DatePicker = ({
|
|
|
243
239
|
onClick={() => selectYearMonth(currentYear, index)}
|
|
244
240
|
className={`w-full text-left p-2 cursor-pointer rounded hover:bg-gray-200 transition duration-150 ease-in-out ${
|
|
245
241
|
index === currentMonth
|
|
246
|
-
? "bg-black text-white
|
|
242
|
+
? "bg-black text-white dark:bg-zinc-500"
|
|
247
243
|
: ""
|
|
248
244
|
}`}
|
|
249
245
|
>
|
|
@@ -262,7 +258,7 @@ export const DatePicker = ({
|
|
|
262
258
|
onClick={() => selectYearMonth(year, currentMonth)}
|
|
263
259
|
className={`w-full text-left p-2 cursor-pointer rounded hover:bg-gray-200 transition duration-150 ease-in-out ${
|
|
264
260
|
year === currentYear
|
|
265
|
-
? "bg-black text-white
|
|
261
|
+
? "bg-black text-white dark:bg-zinc-500"
|
|
266
262
|
: ""
|
|
267
263
|
}`}
|
|
268
264
|
>
|
|
@@ -302,7 +298,7 @@ export const DatePicker = ({
|
|
|
302
298
|
disabled={isDisabled}
|
|
303
299
|
className={`text-center p-1 w-8 h-8 cursor-pointer rounded-md hover:bg-gray-200 transition duration-150 ease-in-out ${
|
|
304
300
|
isSelected
|
|
305
|
-
? "bg-black text-white hover:bg-gray-800 dark:bg-
|
|
301
|
+
? "bg-black text-white hover:bg-gray-800 dark:bg-zinc-500"
|
|
306
302
|
: ""
|
|
307
303
|
} ${
|
|
308
304
|
isDisabled
|
|
@@ -50,9 +50,29 @@ export const Input = ({
|
|
|
50
50
|
if (e.key === "Backspace" && otpValues[index] === "" && index > 0) {
|
|
51
51
|
inputRefs.current[index - 1]?.focus();
|
|
52
52
|
} else if (e.key === "ArrowLeft" && index > 0) {
|
|
53
|
+
e.preventDefault();
|
|
53
54
|
inputRefs.current[index - 1]?.focus();
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
if (inputRefs.current[index - 1]) {
|
|
57
|
+
const inputEl = inputRefs.current[index - 1];
|
|
58
|
+
if (inputEl) {
|
|
59
|
+
const length = inputEl.value.length;
|
|
60
|
+
inputEl.setSelectionRange(length, length);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, 0);
|
|
54
64
|
} else if (e.key === "ArrowRight" && index < OTPLength - 1) {
|
|
65
|
+
e.preventDefault();
|
|
55
66
|
inputRefs.current[index + 1]?.focus();
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
if (inputRefs.current[index + 1]) {
|
|
69
|
+
const inputEl = inputRefs.current[index + 1];
|
|
70
|
+
if (inputEl) {
|
|
71
|
+
const length = inputEl.value.length;
|
|
72
|
+
inputEl.setSelectionRange(length, length);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, 0);
|
|
56
76
|
}
|
|
57
77
|
};
|
|
58
78
|
|