gbs-add-block 1.0.20 → 1.0.22
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 (v1.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v1.0.22)
|
|
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 1.0.
|
|
9
|
+
## What's New 🎉 (Ver 1.0.22)
|
|
10
10
|
|
|
11
11
|
- Style Update
|
|
12
12
|
- General Bug Fix
|
package/package.json
CHANGED
|
@@ -123,39 +123,42 @@ const MultiSelect = forwardRef<MultiSelectHandle, MultiSelectProps>(
|
|
|
123
123
|
// Portal dropdown content
|
|
124
124
|
const dropdownContent = (
|
|
125
125
|
<>
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
<div className={selectStyle["input-parent"]}>
|
|
127
|
+
{showSearch && (
|
|
128
|
+
<div className="flex items-center gap-2 px-2 py-1">
|
|
129
|
+
<Icon elements={search} svgClass={iconClass["grey-common"]} />
|
|
130
|
+
<input
|
|
131
|
+
autoComplete="off"
|
|
132
|
+
type="text"
|
|
133
|
+
name="search"
|
|
134
|
+
id="search"
|
|
135
|
+
placeholder="Search a value"
|
|
136
|
+
className="w-full outline-none dark:bg-transparent"
|
|
137
|
+
ref={inputRef}
|
|
138
|
+
value={searchTerm}
|
|
139
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
142
144
|
|
|
143
145
|
{filteredItems.length > 0 ? (
|
|
144
146
|
filteredItems.map(({ value, label }) => (
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
147
|
+
<div className="w-full px-1" key={value}>
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
className={selectStyle["filter-button"]}
|
|
151
|
+
onClick={() => handleSelect(value)}
|
|
152
|
+
>
|
|
153
|
+
<Icon
|
|
154
|
+
elements={check}
|
|
155
|
+
svgClass={`h-4 w-4 fill-none ${
|
|
156
|
+
selected.includes(value) ? "stroke-gray-500" : ""
|
|
157
|
+
}`}
|
|
158
|
+
/>
|
|
159
|
+
{label.length > 20 ? `${label.substring(0, 20)}...` : label}
|
|
160
|
+
</button>
|
|
161
|
+
</div>
|
|
159
162
|
))
|
|
160
163
|
) : (
|
|
161
164
|
<div className="text-sm text-center">No Data Found</div>
|
|
@@ -131,49 +131,52 @@ const Select = forwardRef<SelectHandle, SelectProps>((props, ref) => {
|
|
|
131
131
|
// Portal dropdown content
|
|
132
132
|
const dropdownContent = (
|
|
133
133
|
<>
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
134
|
+
<div className={selectStyle["input-parent"]}>
|
|
135
|
+
{showSearch && (
|
|
136
|
+
<div className="flex items-center gap-2 px-2 py-1">
|
|
137
|
+
<Icon elements={search} svgClass={iconClass["grey-common"]} />
|
|
138
|
+
<input
|
|
139
|
+
autoComplete="off"
|
|
140
|
+
type="text"
|
|
141
|
+
name="search"
|
|
142
|
+
id="search"
|
|
143
|
+
placeholder="Search a value"
|
|
144
|
+
className="w-full outline-none "
|
|
145
|
+
ref={inputRef}
|
|
146
|
+
value={searchTerm}
|
|
147
|
+
onChange={(e) => {
|
|
148
|
+
setSearchTerm(e.target.value);
|
|
149
|
+
if (onFiltering) onFiltering(e.target.value);
|
|
150
|
+
setFocusedIndex(-1);
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
154
156
|
{filteredItems.length > 0 ? (
|
|
155
157
|
filteredItems.map(({ value, label }, index: number) => (
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}`}
|
|
166
|
-
onClick={() => handleSelect({ value, label })}
|
|
167
|
-
onMouseEnter={() => setFocusedIndex(index)}
|
|
168
|
-
>
|
|
169
|
-
<Icon
|
|
170
|
-
elements={check}
|
|
171
|
-
svgClass={`h-4 w-4 fill-none ${
|
|
172
|
-
selectedItem === value ? "stroke-gray-500" : ""
|
|
158
|
+
<div className="w-full px-1" key={value}>
|
|
159
|
+
<button
|
|
160
|
+
ref={(el: any) => {
|
|
161
|
+
if (itemRefs.current) {
|
|
162
|
+
itemRefs.current[index] = el;
|
|
163
|
+
}
|
|
164
|
+
}}
|
|
165
|
+
className={`${selectStyle["filter-button"]} ${
|
|
166
|
+
focusedIndex === index ? "bg-gray-100 dark:bg-gray-700" : ""
|
|
173
167
|
}`}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
onClick={() => handleSelect({ value, label })}
|
|
169
|
+
onMouseEnter={() => setFocusedIndex(index)}
|
|
170
|
+
>
|
|
171
|
+
<Icon
|
|
172
|
+
elements={check}
|
|
173
|
+
svgClass={`h-4 w-4 fill-none ${
|
|
174
|
+
selectedItem === value ? "stroke-gray-500" : ""
|
|
175
|
+
}`}
|
|
176
|
+
/>
|
|
177
|
+
{label.length > 20 ? `${label.substring(0, 20)}...` : label}
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
177
180
|
))
|
|
178
181
|
) : (
|
|
179
182
|
<div className="text-sm text-center p-2">No Data Found</div>
|
package/source/globalStyle.ts
CHANGED
|
@@ -5,7 +5,7 @@ export const primary = {
|
|
|
5
5
|
|
|
6
6
|
export const popUp = {
|
|
7
7
|
"pop-up-style":
|
|
8
|
-
"w-full
|
|
8
|
+
"w-full absolute overflow-y-auto border border-slate-200 rounded-lg mt-[2px] scrollbar bg-white z-90 scrollbar h-40 dark:bg-black dark:text-white animate-fade-down animate-once animate-duration-200",
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const iconClass = {
|
|
@@ -23,11 +23,11 @@ export const inputStyles = {
|
|
|
23
23
|
|
|
24
24
|
export const selectStyle = {
|
|
25
25
|
"select-button":
|
|
26
|
-
"flex items-center px-4 py-2 w-full justify-between rounded-lg font-medium text-
|
|
26
|
+
"flex items-center px-4 py-2 w-full justify-between rounded-lg font-medium text-md",
|
|
27
27
|
"filter-button":
|
|
28
28
|
"flex items-center w-full px-2 py-1 text-left hover:bg-blue-100 gap-2 rounded-lg mt-1 text-xs dark:hover:bg-blue-600",
|
|
29
29
|
"input-parent":
|
|
30
|
-
"text-sm flex
|
|
30
|
+
"text-sm flex w-full -mt-1 gap-1 items-center sticky top-0 border-b rounded-lg border-slate-200 z-50 bg-white dark:bg-black",
|
|
31
31
|
"selectedDisplay-Button":
|
|
32
|
-
"absolute right-8 top-0 h-full flex items-center px-2 z-20",
|
|
32
|
+
"absolute right-8 top-0 h-full flex items-center px-2 z-20 absolute right-4 top-1/2 transform -translate-y-1/2 z-10",
|
|
33
33
|
};
|