nexaas-ui-components 1.0.17 → 1.0.19

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
@@ -1,8 +1,8 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import clsx7, { clsx } from 'clsx';
1
+ import * as React4 from 'react';
2
+ import React4__default, { forwardRef, useEffect, useState, useRef, useMemo, cloneElement, Fragment as Fragment$1 } from 'react';
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import clsx9, { clsx } from 'clsx';
3
5
  import { DateInput3, DateRangePicker3, DatePicker3 } from '@blueprintjs/datetime2';
4
- import * as React2 from 'react';
5
- import React2__default, { forwardRef, useState, useRef, useEffect, useMemo, cloneElement, Fragment as Fragment$1 } from 'react';
6
6
  import { Controller } from 'react-hook-form';
7
7
  import { create } from 'zustand';
8
8
  import { parse, format, set, startOfWeek, endOfWeek, startOfMonth, endOfMonth, sub, subYears } from 'date-fns';
@@ -18,37 +18,23 @@ import AsyncSelect from 'react-select/async';
18
18
  import { useReactTable, getExpandedRowModel, getFacetedUniqueValues, getFacetedRowModel, getFilteredRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
19
19
  import { rankItem } from '@tanstack/match-sorter-utils';
20
20
 
21
- // src/assets/spinner.tsx
22
- var SpinnerIcon = (props) => /* @__PURE__ */ jsxs(
21
+ // src/components/Button.tsx
22
+ var SpinnerIcon = (props) => /* @__PURE__ */ jsx(
23
23
  "svg",
24
24
  {
25
- width: 16,
26
- height: 16,
27
- viewBox: "0 0 24 24",
25
+ ...props,
26
+ width: `${props.width || 33}`,
27
+ height: `${props.height || 33}`,
28
+ viewBox: "0 0 33 33",
28
29
  fill: "none",
29
30
  xmlns: "http://www.w3.org/2000/svg",
30
- ...props,
31
- children: [
32
- /* @__PURE__ */ jsx(
33
- "circle",
34
- {
35
- className: "opacity-25",
36
- cx: "12",
37
- cy: "12",
38
- r: "10",
39
- stroke: "currentColor",
40
- strokeWidth: "4"
41
- }
42
- ),
43
- /* @__PURE__ */ jsx(
44
- "path",
45
- {
46
- className: "opacity-75",
47
- fill: "currentColor",
48
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
49
- }
50
- )
51
- ]
31
+ children: /* @__PURE__ */ jsx(
32
+ "path",
33
+ {
34
+ d: "M21.4671 32.1821C18.269 33.1951 14.8378 33.2061 11.6333 32.2137C8.42885 31.2213 5.6044 29.2729 3.53866 26.6297C1.47293 23.9866 0.264665 20.7751 0.0758752 17.4258C-0.112914 14.0765 0.726798 10.7495 2.48242 7.89096C4.23804 5.03242 6.82565 2.77896 9.89828 1.43272C12.9709 0.0864894 16.3817 -0.288163 19.6733 0.359002C22.9649 1.00617 25.98 2.64421 28.3142 5.0535C30.6485 7.46279 32.1903 10.5282 32.7331 13.8386L28.9102 14.4653C28.4953 11.9345 27.3165 9.59102 25.532 7.74911C23.7474 5.9072 21.4424 4.65491 18.926 4.16015C16.4095 3.66539 13.802 3.95181 11.4529 4.98101C9.10388 6.01021 7.12564 7.73299 5.78346 9.91835C4.44128 12.1037 3.79932 14.6472 3.94365 17.2077C4.08798 19.7683 5.01171 22.2235 6.59097 24.2442C8.17023 26.2649 10.3295 27.7544 12.7794 28.5132C15.2292 29.2719 17.8524 29.2634 20.2973 28.489L21.4671 32.1821Z",
35
+ fill: "#009EDB"
36
+ }
37
+ )
52
38
  }
53
39
  );
54
40
  var sizes = {
@@ -101,9 +87,6 @@ var variants = {
101
87
  blue: {
102
88
  text: "shadow-button bg-blue-500 text-white text-bold"
103
89
  },
104
- link: {
105
- text: "text-left text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 disabled:text-blue-500 disabled:no-underline shadow-none font-normal disabled:opacity-50"
106
- },
107
90
  iconSecondary: {
108
91
  text: "border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
109
92
  },
@@ -136,6 +119,8 @@ var paddingConfig = {
136
119
  var Button = ({
137
120
  variant = "primary",
138
121
  size = "lg",
122
+ hotkey,
123
+ hotkeyPosition = "bottom",
139
124
  ...props
140
125
  }) => {
141
126
  const applyGap = props.icon && props.children;
@@ -143,14 +128,47 @@ var Button = ({
143
128
  const appliedSize = sizes[size];
144
129
  const appliedPadding = props.icon ? paddingConfig[size].icon : paddingConfig[size].normal;
145
130
  const gapText = applyGap ? "gap-[6px]" : "gap-0";
146
- return /* @__PURE__ */ jsx(
147
- "button",
131
+ useEffect(() => {
132
+ if (!hotkey || !props.onClick) return;
133
+ const handleKeyDown = (event) => {
134
+ var _a;
135
+ if (props.disabled || props.loading) return;
136
+ const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
137
+ const primaryKey = keys.pop();
138
+ if (!primaryKey) return;
139
+ const requiredCtrl = keys.includes("ctrl");
140
+ const requiredAlt = keys.includes("alt");
141
+ const requiredShift = keys.includes("shift");
142
+ const requiredMeta = keys.includes("meta") || keys.includes("cmd");
143
+ const match = event.key.toLowerCase() === primaryKey && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
144
+ if (match) {
145
+ event.preventDefault();
146
+ (_a = props.onClick) == null ? void 0 : _a.call(props, event);
147
+ }
148
+ };
149
+ window.addEventListener("keydown", handleKeyDown);
150
+ return () => {
151
+ window.removeEventListener("keydown", handleKeyDown);
152
+ };
153
+ }, [hotkey, props.onClick, props.disabled, props.loading]);
154
+ const hotkeyLabel = hotkey && /* @__PURE__ */ jsx("span", { className: "text-p-sm font-normal", children: hotkey.toUpperCase() });
155
+ return /* @__PURE__ */ jsxs(
156
+ "div",
148
157
  {
149
- type: props.type,
150
- id: "button-component",
151
- ...props,
152
- disabled: props.disabled || props.loading,
153
- className: `
158
+ className: clsx9("inline-flex gap-[8px]", {
159
+ "flex-col items-center": hotkeyPosition === "top" || hotkeyPosition === "bottom",
160
+ "flex-row items-center": hotkeyPosition === "left" || hotkeyPosition === "right"
161
+ }),
162
+ children: [
163
+ hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsx("span", { style: { color: "var(--label)" }, className: "text-p-sm font-normal -mt-[5px]", children: hotkeyLabel }),
164
+ /* @__PURE__ */ jsx(
165
+ "button",
166
+ {
167
+ type: props.type,
168
+ id: "button-component",
169
+ ...props,
170
+ disabled: props.disabled || props.loading,
171
+ className: `
154
172
  ${props.className}
155
173
  ${appliedVariant}
156
174
  ${appliedSize.text}
@@ -158,20 +176,193 @@ var Button = ({
158
176
  ${gapText}
159
177
  whitespace-nowrap group rounded-lg font-bold disabled:shadow-none active:shadow-none flex items-center
160
178
  `,
161
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
162
- props.icon && /* @__PURE__ */ jsx(
163
- "div",
164
- {
165
- className: `flex items-center justify-center ${appliedSize.icon}`,
166
- children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsx(SpinnerIcon, { className: "animate-spin" })
179
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
180
+ props.icon && /* @__PURE__ */ jsx(
181
+ "div",
182
+ {
183
+ className: `flex items-center justify-center ${appliedSize.icon}`,
184
+ children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsx(SpinnerIcon, { className: "animate-spin" })
185
+ }
186
+ ),
187
+ props.children,
188
+ props.dropdown && /* @__PURE__ */ jsx("i", { className: "uil uil-angle-down text-[18px]" })
189
+ ] })
167
190
  }
168
191
  ),
169
- props.children,
170
- props.dropdown && /* @__PURE__ */ jsx("i", { className: "uil uil-angle-down text-[18px]" })
171
- ] })
192
+ hotkey && (hotkeyPosition === "bottom" || hotkeyPosition === "right") && /* @__PURE__ */ jsx(
193
+ "span",
194
+ {
195
+ style: { color: "var(--label)" },
196
+ className: "text-p-sm font-normal -mt-[5px]",
197
+ children: hotkeyLabel
198
+ }
199
+ )
200
+ ]
172
201
  }
173
202
  );
174
203
  };
204
+ var sizes2 = {
205
+ xxs: {
206
+ text: "min-h-[14px] max-h-[40px]"
207
+ },
208
+ xs: {
209
+ text: "h-[36px]"
210
+ },
211
+ sm: {
212
+ text: "h-[40px]"
213
+ },
214
+ md: {
215
+ text: "h-[46px]"
216
+ },
217
+ table: {
218
+ text: "h-8 w-8"
219
+ }
220
+ };
221
+ var variants2 = {
222
+ primary: {
223
+ text: "shadow-button text-button-label bg-gradient-to-b hover:text-white from-rose-start to-rose-end active:bg-gradient-to-b active:from-rose-800 active:to-rose-800 disabled:bg-gradient-to-b disabled:from-rose-800 disabled:to-rose-800 disabled:opacity-50 hover:from-[#FD467F] hover:to-[#DF4573]"
224
+ },
225
+ secondary: {
226
+ text: "shadow-button bg-white border-[0.5px] border-paragraph text-dark-blue-600 hover:text-dark-blue-600 hover:bg-[#f5f5f5] active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:bg-white disabled:border-[0.5px] disabled:border-dark-blue-400"
227
+ },
228
+ link: {
229
+ text: "text-blue-700 hover:text-blue-800 hover:underline active:text-blue-900 active:underline disabled:text-blue-700 disabled:no-underline shadow-none font-normal"
230
+ },
231
+ icon: {
232
+ text: "bg-white border-[0.5px] border-dark-blue-300 hover:bg-[#f5f5f5] active:bg-light-gray-100 hover:text-paragraph disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
233
+ },
234
+ iconSecondary: {
235
+ text: "border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
236
+ },
237
+ outline: {
238
+ text: "shadow-button bg-white border-[0.5px] border-rose-700 text-rose-700 hover:bg-[#f5f5f5] active:bg-light-gray-100 disabled:text-rose-700 disabled:bg-white disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50"
239
+ },
240
+ dark: {
241
+ text: "shadow-button text-white hover:bg-[#f5f5f526] active:bg-[#0a0a0a40] disabled:opacity-50 disabled:bg-transparent"
242
+ },
243
+ dangerLight: {
244
+ text: "shadow-button text-dangerous-700 font-bold bg-white border-[0.5px] border-dangerous-700 hover:bg-dangerous-100 active:bg-dangerous-700 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-700"
245
+ },
246
+ danger: {
247
+ text: "shadow-button text-white bg-gradient-to-b from-danger-start to-danger-end hover:from-[#FD6363] hover:to-[#E34E4E] active:from-dangerous-800 active:to-dangerous-800 disabled:opacity-50 disabled:from-dangerous-700 disabled:to-dangerous-700"
248
+ },
249
+ success: {
250
+ text: "shadow-button text-white bg-gradient-to-b from-success-start to-success-end hover:from-[#3FF09B] hover:to-[#27C579] active:from-success-800 active:to-success-800 disabled:opacity-50 disabled:from-success-700 disabled:to-success-700"
251
+ },
252
+ warn: {
253
+ text: "shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#FEBD5D] hover:to-[#F4A42D] active:from-warning-800 active:to-warning-800 disabled:opacity-50 disabled:from-warning-700 disabled:to-warning-700"
254
+ },
255
+ blue: {
256
+ text: "shadow-button bg-blue-700 text-white text-bold"
257
+ },
258
+ filter: {
259
+ text: "shadow-button rounded-3xl border border-dark-blue-300 text-paragraph shadow-button hover:bg-light-gray-100 active:border active:border-blue-700 active:text-blue-700 active:bg-blue-100 focus:border focus:border-blue-700 focus:text-blue-700 focus:bg-blue-100"
260
+ },
261
+ filterActive: {
262
+ text: "shadow-button rounded-3xl border border-blue-700 text-blue-700 bg-blue-100 shadow-button hover:bg-blue-700 hover:text-white active:text-white active:bg-blue-900 active:border-blue-900 focus:text-white focus:bg-blue-900 focus:border-blue-900"
263
+ }
264
+ };
265
+ var ButtonLink = forwardRef(
266
+ ({
267
+ size = "md",
268
+ icon,
269
+ padding = "px-3",
270
+ label,
271
+ disabled,
272
+ name,
273
+ target,
274
+ variant = "link",
275
+ className,
276
+ as: LinkComponent = "a",
277
+ hotkey,
278
+ hotkeyPosition = "bottom",
279
+ ...props
280
+ }, ref) => {
281
+ var _a;
282
+ const applyGap = icon;
283
+ useEffect(() => {
284
+ if (!hotkey) return;
285
+ const handleKeyDown = (event) => {
286
+ var _a2;
287
+ if (disabled) return;
288
+ const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
289
+ const primaryKey = keys.pop();
290
+ if (!primaryKey) return;
291
+ const requiredCtrl = keys.includes("ctrl");
292
+ const requiredAlt = keys.includes("alt");
293
+ const requiredShift = keys.includes("shift");
294
+ const requiredMeta = keys.includes("meta") || keys.includes("cmd");
295
+ const match = event.key.toLowerCase() === primaryKey && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
296
+ if (match) {
297
+ event.preventDefault();
298
+ if (props.onClick) {
299
+ (_a2 = props.onClick) == null ? void 0 : _a2.call(props, event);
300
+ } else {
301
+ const linkElement = document.querySelector(`a[href="${props.href}"]`);
302
+ linkElement == null ? void 0 : linkElement.click();
303
+ }
304
+ }
305
+ };
306
+ window.addEventListener("keydown", handleKeyDown);
307
+ return () => {
308
+ window.removeEventListener("keydown", handleKeyDown);
309
+ };
310
+ }, [hotkey, props.onClick, props.href, disabled]);
311
+ const hotkeyLabel = hotkey && /* @__PURE__ */ jsx("span", { className: "text-p-sm font-normal", children: hotkey.toUpperCase() });
312
+ return /* @__PURE__ */ jsxs(
313
+ "div",
314
+ {
315
+ className: clsx9("inline-flex gap-[8px]", {
316
+ "flex-col items-center justify-center": hotkeyPosition === "top" || hotkeyPosition === "bottom",
317
+ "flex-row items-center justify-center": hotkeyPosition === "left" || hotkeyPosition === "right"
318
+ }),
319
+ children: [
320
+ hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsx(
321
+ "span",
322
+ {
323
+ style: { color: "var(--label)" },
324
+ className: "text-p-sm font-normal -mt-[5px]",
325
+ children: hotkeyLabel
326
+ }
327
+ ),
328
+ /* @__PURE__ */ jsxs(
329
+ LinkComponent,
330
+ {
331
+ ref,
332
+ className: clsx9(
333
+ {
334
+ [(_a = variants2[variant]) == null ? void 0 : _a.text]: true,
335
+ [sizes2[size].text]: true,
336
+ ["pointer-events-none shadow-none text-label"]: disabled,
337
+ ["px-2"]: variant !== "link"
338
+ },
339
+ `group rounded-lg font-bold active:shadow-none font-title flex items-center justify-start cursor-pointer
340
+ ${applyGap ? "gap-2" : "gap-0"} ${className}
341
+ `
342
+ ),
343
+ target,
344
+ ...props,
345
+ download: name,
346
+ children: [
347
+ icon && /* @__PURE__ */ jsx("div", { className: "text-[20px] flex items-center justify-center", children: icon }),
348
+ /* @__PURE__ */ jsx("span", { className: "cursor-pointer line-clamp-2", children: label })
349
+ ]
350
+ }
351
+ ),
352
+ hotkey && (hotkeyPosition === "bottom" || hotkeyPosition === "right") && /* @__PURE__ */ jsx(
353
+ "span",
354
+ {
355
+ style: { color: "var(--label)" },
356
+ className: "text-p-sm font-normal -mt-[5px]",
357
+ children: hotkeyLabel
358
+ }
359
+ )
360
+ ]
361
+ }
362
+ );
363
+ }
364
+ );
365
+ ButtonLink.displayName = "ButtonLink";
175
366
  var Input = ({
176
367
  label,
177
368
  type,
@@ -222,7 +413,7 @@ var Input = ({
222
413
  value,
223
414
  defaultValue,
224
415
  style: !label && placeholder && icon || icon ? inlineStyles.inputWithIcon : void 0,
225
- className: clsx7({
416
+ className: clsx9({
226
417
  [styles.error]: hasError,
227
418
  [styles.input]: true,
228
419
  ["pr-10"]: clearField,
@@ -243,14 +434,14 @@ var Input = ({
243
434
  icon && /* @__PURE__ */ jsx(
244
435
  "div",
245
436
  {
246
- className: clsx7(styles.icon, "flex justify-center items-center"),
437
+ className: clsx9(styles.icon, "flex justify-center items-center"),
247
438
  children: icon
248
439
  }
249
440
  ),
250
441
  hideInput && /* @__PURE__ */ jsx(
251
442
  "div",
252
443
  {
253
- className: clsx7(
444
+ className: clsx9(
254
445
  styles.rightIcon,
255
446
  "flex justify-center items-center"
256
447
  ),
@@ -261,7 +452,7 @@ var Input = ({
261
452
  "label",
262
453
  {
263
454
  style: icon ? inlineStyles.labelWithIcon : void 0,
264
- className: clsx7(
455
+ className: clsx9(
265
456
  {
266
457
  [styles.label]: true,
267
458
  ["left-2.5"]: !icon
@@ -278,7 +469,7 @@ var Input = ({
278
469
  clearField && value && value !== "" && !disabled && /* @__PURE__ */ jsx(
279
470
  "i",
280
471
  {
281
- className: clsx7(
472
+ className: clsx9(
282
473
  {
283
474
  [styles.clear]: true
284
475
  },
@@ -483,7 +674,7 @@ var DatePickerInput = forwardRef(
483
674
  "div",
484
675
  {
485
676
  id: "icon",
486
- className: clsx7(
677
+ className: clsx9(
487
678
  styles.icon,
488
679
  "flex justify-center items-center text-[20px] bg-gray-100"
489
680
  ),
@@ -530,7 +721,7 @@ var DatePickerInput = forwardRef(
530
721
  /* @__PURE__ */ jsxs(
531
722
  "label",
532
723
  {
533
- className: clsx7(
724
+ className: clsx9(
534
725
  "pointer-events-none ",
535
726
  styles.label,
536
727
  `
@@ -547,7 +738,7 @@ var DatePickerInput = forwardRef(
547
738
  clearField && (field == null ? void 0 : field.value) && (field == null ? void 0 : field.value) !== "" && !disabled && /* @__PURE__ */ jsx(
548
739
  "i",
549
740
  {
550
- className: clsx7(
741
+ className: clsx9(
551
742
  {
552
743
  [styles.clear]: true
553
744
  },
@@ -582,7 +773,7 @@ var DatePickerInput = forwardRef(
582
773
  ] });
583
774
  }
584
775
  );
585
- var variants2 = {
776
+ var variants3 = {
586
777
  success: "bg-success-100 text-success-600",
587
778
  warning: "bg-warning-100 text-warning-600",
588
779
  blue: "bg-blue-100 text-blue-500",
@@ -604,8 +795,8 @@ var Badge = ({
604
795
  return /* @__PURE__ */ jsx(
605
796
  "span",
606
797
  {
607
- className: clsx7(
608
- { [variants2[variant]]: (variant == null ? void 0 : variant.length) > 0 },
798
+ className: clsx9(
799
+ { [variants3[variant]]: (variant == null ? void 0 : variant.length) > 0 },
609
800
  "py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",
610
801
  className
611
802
  ),
@@ -879,7 +1070,7 @@ var Checkbox = ({
879
1070
  id: registration ? registration.name : key,
880
1071
  disabled,
881
1072
  type: "checkbox",
882
- className: clsx7(
1073
+ className: clsx9(
883
1074
  "disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100"
884
1075
  )
885
1076
  }
@@ -1145,7 +1336,7 @@ var FilterCalendar = ({
1145
1336
  return /* @__PURE__ */ jsx(
1146
1337
  Popover,
1147
1338
  {
1148
- className: clsx7(
1339
+ className: clsx9(
1149
1340
  { ["w-full"]: isMobileSize },
1150
1341
  "relative text-paragraph"
1151
1342
  ),
@@ -1155,7 +1346,7 @@ var FilterCalendar = ({
1155
1346
  /* @__PURE__ */ jsx(Float.Reference, { children: /* @__PURE__ */ jsx(PopoverButton, { as: "button", children: /* @__PURE__ */ jsxs(
1156
1347
  "div",
1157
1348
  {
1158
- className: clsx7(
1349
+ className: clsx9(
1159
1350
  {
1160
1351
  [style.filter]: !hasValue && !open,
1161
1352
  [style.filterOpen]: open && !hasValue,
@@ -1167,7 +1358,7 @@ var FilterCalendar = ({
1167
1358
  icon && /* @__PURE__ */ jsx(
1168
1359
  "div",
1169
1360
  {
1170
- className: clsx7({
1361
+ className: clsx9({
1171
1362
  ["text-label group-active:text-blue-500"]: !field.value && !open,
1172
1363
  ["text-blue-500"]: open && !field.value,
1173
1364
  ["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
@@ -1178,7 +1369,7 @@ var FilterCalendar = ({
1178
1369
  /* @__PURE__ */ jsx(
1179
1370
  "label",
1180
1371
  {
1181
- className: clsx7(
1372
+ className: clsx9(
1182
1373
  {
1183
1374
  ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1184
1375
  ["text-blue-500"]: open && !field.value,
@@ -1194,7 +1385,7 @@ var FilterCalendar = ({
1194
1385
  /* @__PURE__ */ jsx(
1195
1386
  "i",
1196
1387
  {
1197
- className: clsx7(
1388
+ className: clsx9(
1198
1389
  {
1199
1390
  ["text-label group-active:text-blue-500"]: !field.value && !open,
1200
1391
  ["text-blue-500"]: open && !field.value,
@@ -1221,7 +1412,7 @@ var FilterCalendar = ({
1221
1412
  onClear && /* @__PURE__ */ jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsx(
1222
1413
  Button,
1223
1414
  {
1224
- variant: "link",
1415
+ variant: "secondary",
1225
1416
  size: "xxs",
1226
1417
  onClick: () => {
1227
1418
  if (onClear) {
@@ -1296,8 +1487,8 @@ function InputSmall({
1296
1487
  clear: "pr-[5px] cursor-pointer text-label text-[16px]"
1297
1488
  };
1298
1489
  const elem = inputRef == null ? void 0 : inputRef.current;
1299
- return /* @__PURE__ */ jsxs("div", { className: clsx7(styles.wrapper), children: [
1300
- icon && !searchOnClick && /* @__PURE__ */ jsx("div", { className: clsx7(styles.icon), children: icon }),
1490
+ return /* @__PURE__ */ jsxs("div", { className: clsx9(styles.wrapper), children: [
1491
+ icon && !searchOnClick && /* @__PURE__ */ jsx("div", { className: clsx9(styles.icon), children: icon }),
1301
1492
  /* @__PURE__ */ jsx(
1302
1493
  "input",
1303
1494
  {
@@ -1305,7 +1496,7 @@ function InputSmall({
1305
1496
  ...inputProps,
1306
1497
  type: "search-text",
1307
1498
  ref: inputRef,
1308
- className: clsx7(
1499
+ className: clsx9(
1309
1500
  {
1310
1501
  ["pl-1"]: collapsed
1311
1502
  },
@@ -1322,7 +1513,7 @@ function InputSmall({
1322
1513
  clearField && value && !disabled && /* @__PURE__ */ jsx(
1323
1514
  "i",
1324
1515
  {
1325
- className: clsx7(styles.clear, "uil uil-times"),
1516
+ className: clsx9(styles.clear, "uil uil-times"),
1326
1517
  onClick: () => {
1327
1518
  elem.value = "";
1328
1519
  elem == null ? void 0 : elem.focus();
@@ -1337,7 +1528,7 @@ function InputSmall({
1337
1528
  "button",
1338
1529
  {
1339
1530
  type: "button",
1340
- className: clsx7({
1531
+ className: clsx9({
1341
1532
  ["border-l border-input pl-1"]: clearField && value && !disabled,
1342
1533
  ["text-blue-500"]: !disabled,
1343
1534
  ["text-neutral-300"]: disabled,
@@ -1417,7 +1608,7 @@ var FilterOptions = ({
1417
1608
  children: /* @__PURE__ */ jsxs(
1418
1609
  "div",
1419
1610
  {
1420
- className: clsx7(
1611
+ className: clsx9(
1421
1612
  "relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",
1422
1613
  {
1423
1614
  ["hover:bg-neutral-200"]: !option.disabled && !isSelected,
@@ -1429,7 +1620,7 @@ var FilterOptions = ({
1429
1620
  /* @__PURE__ */ jsx(
1430
1621
  "span",
1431
1622
  {
1432
- className: clsx7(
1623
+ className: clsx9(
1433
1624
  {
1434
1625
  ["font-semibold text-white"]: isSelected
1435
1626
  },
@@ -1441,7 +1632,7 @@ var FilterOptions = ({
1441
1632
  /* @__PURE__ */ jsx(
1442
1633
  "span",
1443
1634
  {
1444
- className: clsx7(
1635
+ className: clsx9(
1445
1636
  {
1446
1637
  ["font-semibold text-white"]: isSelected
1447
1638
  },
@@ -1453,7 +1644,7 @@ var FilterOptions = ({
1453
1644
  isSelected ? /* @__PURE__ */ jsx(
1454
1645
  "span",
1455
1646
  {
1456
- className: clsx7(
1647
+ className: clsx9(
1457
1648
  "absolute inset-y-0 text-white right-0 flex items-center pr-4"
1458
1649
  ),
1459
1650
  children: /* @__PURE__ */ jsx("i", { className: "uil uil-check text-lg" })
@@ -1478,7 +1669,7 @@ var FilterOptions = ({
1478
1669
  return /* @__PURE__ */ jsx(
1479
1670
  Popover,
1480
1671
  {
1481
- className: clsx7(
1672
+ className: clsx9(
1482
1673
  { ["w-full"]: isMobileSize },
1483
1674
  "relative text-paragraph"
1484
1675
  ),
@@ -1488,7 +1679,7 @@ var FilterOptions = ({
1488
1679
  /* @__PURE__ */ jsx(Float.Reference, { children: /* @__PURE__ */ jsx(PopoverButton, { as: "button", children: /* @__PURE__ */ jsxs(
1489
1680
  "div",
1490
1681
  {
1491
- className: clsx7(
1682
+ className: clsx9(
1492
1683
  {
1493
1684
  [style.filter]: !hasValue && !open,
1494
1685
  [style.filterOpen]: open && !hasValue,
@@ -1500,7 +1691,7 @@ var FilterOptions = ({
1500
1691
  icon && /* @__PURE__ */ jsx(
1501
1692
  "div",
1502
1693
  {
1503
- className: clsx7({
1694
+ className: clsx9({
1504
1695
  ["text-label group-active:text-blue-500"]: !field.value && !open,
1505
1696
  ["text-blue-500"]: open && !field.value,
1506
1697
  ["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
@@ -1511,7 +1702,7 @@ var FilterOptions = ({
1511
1702
  /* @__PURE__ */ jsx(
1512
1703
  "label",
1513
1704
  {
1514
- className: clsx7(
1705
+ className: clsx9(
1515
1706
  {
1516
1707
  ["text-paragraph group-active:text-blue-500"]: !field.value && !open,
1517
1708
  ["text-blue-500"]: open && !field.value,
@@ -1526,7 +1717,7 @@ var FilterOptions = ({
1526
1717
  /* @__PURE__ */ jsx(
1527
1718
  "i",
1528
1719
  {
1529
- className: clsx7(
1720
+ className: clsx9(
1530
1721
  {
1531
1722
  ["text-label group-active:text-blue-500"]: !field.value && !open,
1532
1723
  ["text-blue-500"]: open && !field.value,
@@ -1581,7 +1772,7 @@ var FilterOptions = ({
1581
1772
  return /* @__PURE__ */ jsx(
1582
1773
  "button",
1583
1774
  {
1584
- className: clsx7(
1775
+ className: clsx9(
1585
1776
  {
1586
1777
  ["bg-blue-500 text-white"]: active,
1587
1778
  ["text-paragraph"]: !active
@@ -1640,7 +1831,7 @@ var FilterOptions = ({
1640
1831
  isMulti && onSelectAll && /* @__PURE__ */ jsx("div", { className: "border-r pr-2 border-neutral-300", children: /* @__PURE__ */ jsx(
1641
1832
  Button,
1642
1833
  {
1643
- variant: "link",
1834
+ variant: "secondary",
1644
1835
  size: "xxs",
1645
1836
  onClick: () => {
1646
1837
  onSelectAll();
@@ -1654,7 +1845,7 @@ var FilterOptions = ({
1654
1845
  onClear && /* @__PURE__ */ jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsx(
1655
1846
  Button,
1656
1847
  {
1657
- variant: "link",
1848
+ variant: "secondary",
1658
1849
  size: "xxs",
1659
1850
  onClick: () => {
1660
1851
  if (onClear) {
@@ -1772,7 +1963,7 @@ function InputMoney({
1772
1963
  icon && /* @__PURE__ */ jsx(
1773
1964
  "div",
1774
1965
  {
1775
- className: clsx7(
1966
+ className: clsx9(
1776
1967
  styles.icon,
1777
1968
  "flex justify-center items-center"
1778
1969
  ),
@@ -1786,7 +1977,7 @@ function InputMoney({
1786
1977
  ...inputProps,
1787
1978
  ...field,
1788
1979
  type: "text",
1789
- className: clsx7({
1980
+ className: clsx9({
1790
1981
  [styles.input]: true,
1791
1982
  ["pr-10"]: clearField,
1792
1983
  ["pr-2"]: !clearField,
@@ -1808,7 +1999,7 @@ function InputMoney({
1808
1999
  /* @__PURE__ */ jsxs(
1809
2000
  "label",
1810
2001
  {
1811
- className: clsx7(
2002
+ className: clsx9(
1812
2003
  {
1813
2004
  [styles.label]: true,
1814
2005
  ["left-[46px]"]: icon,
@@ -1918,7 +2109,7 @@ function InputNumber({
1918
2109
  icon && /* @__PURE__ */ jsx(
1919
2110
  "div",
1920
2111
  {
1921
- className: clsx7(
2112
+ className: clsx9(
1922
2113
  styles.icon,
1923
2114
  "flex justify-center items-center"
1924
2115
  ),
@@ -1932,7 +2123,7 @@ function InputNumber({
1932
2123
  type: "number",
1933
2124
  autoComplete: "off",
1934
2125
  id: name,
1935
- className: clsx7({
2126
+ className: clsx9({
1936
2127
  [styles.input]: true,
1937
2128
  ["pr-10"]: clearField,
1938
2129
  ["pr-2"]: !clearField,
@@ -1983,7 +2174,7 @@ function InputNumber({
1983
2174
  /* @__PURE__ */ jsxs(
1984
2175
  "label",
1985
2176
  {
1986
- className: clsx7(
2177
+ className: clsx9(
1987
2178
  {
1988
2179
  [styles.label]: true,
1989
2180
  ["left-[3.5rem]"]: icon,
@@ -1999,12 +2190,12 @@ function InputNumber({
1999
2190
  }
2000
2191
  )
2001
2192
  ] }),
2002
- !hideArrows && /* @__PURE__ */ jsxs("div", { className: clsx7([styles.buttonsWrapper]), children: [
2193
+ !hideArrows && /* @__PURE__ */ jsxs("div", { className: clsx9([styles.buttonsWrapper]), children: [
2003
2194
  /* @__PURE__ */ jsx(
2004
2195
  "button",
2005
2196
  {
2006
2197
  type: "button",
2007
- className: clsx7([styles.button]),
2198
+ className: clsx9([styles.button]),
2008
2199
  disabled,
2009
2200
  onClick: () => {
2010
2201
  if (!maxValue || maxValue && Number(value2 || 0) + 1 <= maxValue) {
@@ -2018,7 +2209,7 @@ function InputNumber({
2018
2209
  "button",
2019
2210
  {
2020
2211
  type: "button",
2021
- className: clsx7([styles.button]),
2212
+ className: clsx9([styles.button]),
2022
2213
  disabled,
2023
2214
  onClick: () => {
2024
2215
  if (!maxValue || maxValue && Number(value2 === 0 ? 0 : Number(value2) - 1) <= maxValue) {
@@ -2108,7 +2299,7 @@ function InputPercentage({
2108
2299
  icon && /* @__PURE__ */ jsx(
2109
2300
  "div",
2110
2301
  {
2111
- className: clsx7(
2302
+ className: clsx9(
2112
2303
  styles.icon,
2113
2304
  "flex justify-center items-center"
2114
2305
  ),
@@ -2122,7 +2313,7 @@ function InputPercentage({
2122
2313
  ...inputProps,
2123
2314
  ...field,
2124
2315
  type: "text",
2125
- className: clsx7({
2316
+ className: clsx9({
2126
2317
  [styles.input]: true,
2127
2318
  ["pr-10"]: clearField,
2128
2319
  ["pr-2"]: !clearField,
@@ -2140,7 +2331,7 @@ function InputPercentage({
2140
2331
  /* @__PURE__ */ jsxs(
2141
2332
  "label",
2142
2333
  {
2143
- className: clsx7(
2334
+ className: clsx9(
2144
2335
  {
2145
2336
  [styles.label]: true,
2146
2337
  ["left-[3rem]"]: icon,
@@ -2259,7 +2450,7 @@ var alertTypes = {
2259
2450
  info: "text-blue-500",
2260
2451
  primary: "text-rose-700"
2261
2452
  };
2262
- var sizes2 = {
2453
+ var sizes3 = {
2263
2454
  xs: "w-[350px]",
2264
2455
  sm: "w-[662px]",
2265
2456
  md: "w-[960px]",
@@ -2283,7 +2474,7 @@ var ModalDialog = ({
2283
2474
  description,
2284
2475
  children
2285
2476
  }) => {
2286
- const customStyles2 = {
2477
+ const customStyles3 = {
2287
2478
  content: {
2288
2479
  top: "50%",
2289
2480
  left: "50%",
@@ -2314,12 +2505,12 @@ var ModalDialog = ({
2314
2505
  ariaHideApp: false,
2315
2506
  isOpen: open,
2316
2507
  onRequestClose: onClose,
2317
- style: customStyles2,
2508
+ style: customStyles3,
2318
2509
  contentLabel: "Example Modal",
2319
- children: /* @__PURE__ */ jsxs("div", { className: clsx7(sizes2[size]), children: [
2510
+ children: /* @__PURE__ */ jsxs("div", { className: clsx9(sizes3[size]), children: [
2320
2511
  /* @__PURE__ */ jsxs("div", { className: "pb-2 border-b border-b-neutral-200 flex items-center justify-between", children: [
2321
2512
  /* @__PURE__ */ jsxs("h3", { className: "text-[24px] font-bold flex items-center gap-2", children: [
2322
- alertType && /* @__PURE__ */ jsx("div", { className: clsx7([alertTypes[alertType]], "text-[30px]"), children: icon }),
2513
+ alertType && /* @__PURE__ */ jsx("div", { className: clsx9([alertTypes[alertType]], "text-[30px]"), children: icon }),
2323
2514
  title
2324
2515
  ] }),
2325
2516
  /* @__PURE__ */ jsx("button", { onClick: onCancel, className: "text-neutral-500 text-[24px]", children: /* @__PURE__ */ jsx("i", { className: "uil uil-times" }) })
@@ -2329,7 +2520,7 @@ var ModalDialog = ({
2329
2520
  /* @__PURE__ */ jsx(
2330
2521
  "div",
2331
2522
  {
2332
- className: clsx7({
2523
+ className: clsx9({
2333
2524
  ["flex-1"]: info
2334
2525
  }),
2335
2526
  children: info
@@ -2603,7 +2794,7 @@ var SelectField = ({
2603
2794
  alignItems: "center",
2604
2795
  justifyContent: "space-between"
2605
2796
  },
2606
- children: /* @__PURE__ */ jsx("span", { className: clsx7("text-p-md focus:text-white"), children: props.data.label })
2797
+ children: /* @__PURE__ */ jsx("span", { className: clsx9("text-p-md focus:text-white"), children: props.data.label })
2607
2798
  }
2608
2799
  ) });
2609
2800
  };
@@ -2680,7 +2871,7 @@ var SelectField = ({
2680
2871
  icon && /* @__PURE__ */ jsx(
2681
2872
  "div",
2682
2873
  {
2683
- className: clsx7(
2874
+ className: clsx9(
2684
2875
  "z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",
2685
2876
  {
2686
2877
  "text-blue-500": isFocused && hasIcon.hasIcon,
@@ -2732,7 +2923,7 @@ var SelectField = ({
2732
2923
  /* @__PURE__ */ jsxs(
2733
2924
  "span",
2734
2925
  {
2735
- className: clsx7(
2926
+ className: clsx9(
2736
2927
  "text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",
2737
2928
  {
2738
2929
  "scale-75 -translate-y-3": field.value || inputValue,
@@ -2767,6 +2958,393 @@ var SelectField = ({
2767
2958
  var ValueContainer = ({ children, ...props }) => {
2768
2959
  return /* @__PURE__ */ jsx(components.ValueContainer, { ...props, children });
2769
2960
  };
2961
+
2962
+ // src/components/SelectFieldBip/SelectFieldBip.styles.tsx
2963
+ var customStyles2 = {
2964
+ indicatorSeparator: (provided, props) => {
2965
+ var _a;
2966
+ return {
2967
+ ...provided,
2968
+ backgroundColor: props.hasValue && ((_a = provided == null ? void 0 : provided.selectProps) == null ? void 0 : _a.isSearchable) ? "var(--input)" : "transparent",
2969
+ padding: "0px"
2970
+ };
2971
+ },
2972
+ clearIndicator: (provided) => ({
2973
+ ...provided,
2974
+ color: "var(--label)",
2975
+ ":hover": {
2976
+ color: "var(--label)"
2977
+ }
2978
+ }),
2979
+ dropdownIndicator: (provided, state) => {
2980
+ var _a;
2981
+ return {
2982
+ ...provided,
2983
+ color: "var(--paragraph)",
2984
+ transform: ((_a = state == null ? void 0 : state.selectProps) == null ? void 0 : _a.menuIsOpen) ? "rotate(180deg)" : "rotate(0)",
2985
+ ":hover": {
2986
+ color: "var(--paragraph)"
2987
+ }
2988
+ };
2989
+ },
2990
+ input: (provided, state) => ({
2991
+ ...provided,
2992
+ paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
2993
+ paddingTop: state.selectProps.hasLabel ? "10px" : "0px"
2994
+ }),
2995
+ menu: (provided) => ({
2996
+ ...provided,
2997
+ marginTop: "4px",
2998
+ border: "1px solid var(--dark-blue-300)",
2999
+ boxShadow: "none",
3000
+ borderRadius: "8px",
3001
+ background: "white",
3002
+ zIndex: 60
3003
+ }),
3004
+ menuList: (provided) => ({
3005
+ ...provided,
3006
+ padding: "0px 8px"
3007
+ }),
3008
+ singleValue: (base, state) => ({
3009
+ ...base,
3010
+ paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
3011
+ paddingTop: state.selectProps.hasLabel ? "10px" : "0",
3012
+ color: state.data.value === "active" ? "#0EAF86" : "black",
3013
+ display: "flex"
3014
+ }),
3015
+ placeholder: (provided, state) => ({
3016
+ ...provided,
3017
+ paddingLeft: state.selectProps.hasIcon ? "34px" : "0px"
3018
+ }),
3019
+ control: (provided, state) => ({
3020
+ ...provided,
3021
+ cursor: "pointer",
3022
+ border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--dark-blue-300)",
3023
+ boxShadow: "none",
3024
+ outline: "none",
3025
+ borderRadius: "0.5rem",
3026
+ placeholder: " ",
3027
+ height: "46px",
3028
+ backgroundColor: state.isDisabled ? "var(--light-100)" : "white",
3029
+ ":hover": {
3030
+ border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--dark-blue-300)"
3031
+ }
3032
+ }),
3033
+ multiValue: (provided) => ({
3034
+ ...provided,
3035
+ borderRadius: "20px",
3036
+ backgroundColor: "var(--light-100)",
3037
+ padding: "0px 8px"
3038
+ }),
3039
+ multiValueLabel: (provided) => ({
3040
+ ...provided,
3041
+ color: "var(--paragraph)"
3042
+ }),
3043
+ multiValueRemove: (provided) => ({
3044
+ ...provided,
3045
+ color: "var(--dark-blue-400)",
3046
+ ":hover": {
3047
+ color: "var(--dangerous-700)"
3048
+ }
3049
+ }),
3050
+ option: (provided, state) => {
3051
+ let color = state.isSelected ? "white" : (state == null ? void 0 : state.isDisabled) ? "var(--label)" : "var(--paragraph)";
3052
+ return {
3053
+ ...provided,
3054
+ cursor: state.isDisabled ? "auto" : "pointer",
3055
+ pointerEvents: state.isDisabled ? "none" : "",
3056
+ borderRadius: "8px",
3057
+ margin: "4px 0px",
3058
+ padding: "10px 12px",
3059
+ backgroundColor: state.isSelected ? "var(--blue-700)" : "white",
3060
+ color,
3061
+ fontWeight: state.isSelected ? 700 : 400,
3062
+ "&:hover": {
3063
+ backgroundColor: state.isSelected ? "var(--blue-700)" : "var(--light-200)"
3064
+ },
3065
+ "&:active": {
3066
+ backgroundColor: "var(--blue-700)",
3067
+ color: "white !important",
3068
+ fontWeight: 700
3069
+ },
3070
+ "&:active i": {
3071
+ color: "white !important",
3072
+ fontWeight: 700
3073
+ },
3074
+ " i": {
3075
+ color: "white !important"
3076
+ }
3077
+ };
3078
+ },
3079
+ container: (provided) => ({
3080
+ ...provided,
3081
+ border: "none",
3082
+ outline: "none",
3083
+ boxShadow: "none",
3084
+ padding: "none",
3085
+ margin: "none"
3086
+ })
3087
+ };
3088
+ var SelectFieldBip = ({
3089
+ name,
3090
+ label,
3091
+ error,
3092
+ defaultValue,
3093
+ control,
3094
+ placeholder,
3095
+ isSearchable = false,
3096
+ required,
3097
+ debounce: debounce2,
3098
+ filterOptions,
3099
+ disabled,
3100
+ onChangeValue,
3101
+ optionStyle,
3102
+ valueStyle,
3103
+ icon,
3104
+ onErrorBip,
3105
+ clearAfterSelect = true,
3106
+ messages = {
3107
+ searching: "Searching...",
3108
+ debounce: `Type at least {debounce} characters`,
3109
+ emptyMessage: "No options found",
3110
+ loading: "Loading..."
3111
+ }
3112
+ }) => {
3113
+ var _a;
3114
+ const { Option, SingleValue } = components;
3115
+ const selectRef = useRef(null);
3116
+ const [inputValue, setInputValue] = useState("");
3117
+ const [loading, setLoading] = useState(false);
3118
+ const [cachedOptions, setCachedOptions] = useState([]);
3119
+ const fetchOptions = async (value) => {
3120
+ if (isSearchable && filterOptions) {
3121
+ if (!debounce2 || debounce2 && value.length >= debounce2) {
3122
+ setLoading(true);
3123
+ const result = await filterOptions(value);
3124
+ setCachedOptions(result);
3125
+ setLoading(false);
3126
+ return result;
3127
+ }
3128
+ }
3129
+ return [];
3130
+ };
3131
+ const fieldValidation = useFieldErrorsStore((state) => state.field);
3132
+ const fieldValidationMessages = [
3133
+ (_a = fieldValidation[name]) == null ? void 0 : _a.message,
3134
+ error == null ? void 0 : error.message
3135
+ ];
3136
+ const hasError = {
3137
+ hasError: fieldValidationMessages.some((item) => item !== void 0)
3138
+ };
3139
+ const hasLabel = {
3140
+ hasLabel: (label == null ? void 0 : label.length) > 0
3141
+ };
3142
+ const hasIcon = {
3143
+ hasIcon: icon
3144
+ };
3145
+ const iconStyle = `z-[70] absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] rounded-l-lg flex justify-center items-center w-[38px] text-[22px] ${hasError.hasError ? "text-dangerous-500" : "text-label"}`;
3146
+ const debouncedFetchOptions = useMemo(() => {
3147
+ return debounce_default((value, callback) => {
3148
+ fetchOptions(value).then(callback);
3149
+ }, 300);
3150
+ }, [filterOptions]);
3151
+ useEffect(() => {
3152
+ return () => {
3153
+ debouncedFetchOptions.cancel();
3154
+ };
3155
+ }, [debouncedFetchOptions]);
3156
+ return /* @__PURE__ */ jsx(
3157
+ Controller,
3158
+ {
3159
+ name,
3160
+ control,
3161
+ defaultValue,
3162
+ render: ({ field }) => {
3163
+ const CustomSingleValue = (props) => {
3164
+ return /* @__PURE__ */ jsx(SingleValue, { ...props, children: valueStyle ? valueStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsxs(Fragment, { children: [
3165
+ props.data.label,
3166
+ " "
3167
+ ] }) });
3168
+ };
3169
+ const IconOption = (props) => {
3170
+ return /* @__PURE__ */ jsx(Option, { ...props, children: optionStyle ? optionStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsx(
3171
+ "div",
3172
+ {
3173
+ style: {
3174
+ display: "flex",
3175
+ alignItems: "center",
3176
+ justifyContent: "space-between"
3177
+ },
3178
+ children: /* @__PURE__ */ jsx("span", { className: clsx9("text-p-md focus:text-white"), children: props.data.label })
3179
+ }
3180
+ ) });
3181
+ };
3182
+ const LoadingMessage = (props) => {
3183
+ if (!debounce2 || debounce2 && inputValue.length >= debounce2) {
3184
+ return /* @__PURE__ */ jsxs(
3185
+ "div",
3186
+ {
3187
+ ...props.innerProps,
3188
+ className: "flex items-center gap-[6px] p-2",
3189
+ children: [
3190
+ /* @__PURE__ */ jsx(SpinnerIcon, { width: 16, height: 16, className: "animate-spin" }),
3191
+ messages.searching
3192
+ ]
3193
+ }
3194
+ );
3195
+ } else if (debounce2 && inputValue.length < debounce2) {
3196
+ return /* @__PURE__ */ jsx("div", { className: "p-2 text-dark-blue-300", children: messages.debounce.replace("{debounce}", String(debounce2)) });
3197
+ }
3198
+ };
3199
+ const NoOptionsMessage = (props) => {
3200
+ var _a2;
3201
+ if (inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && inputValue.length < debounce2) {
3202
+ return /* @__PURE__ */ jsx("div", { className: "p-2 text-dark-blue-300", children: messages.debounce.replace("{debounce}", String(debounce2)) });
3203
+ } else if (inputValue.length > 0 && ((_a2 = props == null ? void 0 : props.options) == null ? void 0 : _a2.length) == 0) {
3204
+ return /* @__PURE__ */ jsx("div", { className: "p-2 text-dark-blue-300", children: messages.emptyMessage });
3205
+ }
3206
+ };
3207
+ const DropdownIndicatorCustom = (props) => {
3208
+ return null;
3209
+ };
3210
+ const handleKeyDown = async (event) => {
3211
+ var _a2;
3212
+ if (event.key === "Enter") {
3213
+ event.preventDefault();
3214
+ debouncedFetchOptions.cancel();
3215
+ const fetchedOptions = await fetchOptions(event.target.value);
3216
+ if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
3217
+ onChange(fetchedOptions[0]);
3218
+ setTimeout(() => {
3219
+ var _a3, _b, _c;
3220
+ setInputValue("");
3221
+ (_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.clearValue();
3222
+ (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.focus();
3223
+ (_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.onMenuClose();
3224
+ field.onChange(null);
3225
+ }, 10);
3226
+ } else {
3227
+ onErrorBip((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.value);
3228
+ selectRef.current.inputRef.select();
3229
+ selectRef.current.onMenuClose();
3230
+ }
3231
+ }
3232
+ };
3233
+ const handleInputChange = (value, actionMeta) => {
3234
+ if (actionMeta.action === "input-change") {
3235
+ setInputValue(value);
3236
+ }
3237
+ return value;
3238
+ };
3239
+ const onChange = async (value, action) => {
3240
+ var _a2, _b, _c, _d, _e;
3241
+ if (onChangeValue) onChangeValue(value);
3242
+ if ((action == null ? void 0 : action.action) === "select-option") {
3243
+ if (clearAfterSelect) {
3244
+ setInputValue("");
3245
+ (_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.clearValue();
3246
+ (_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.onMenuClose();
3247
+ (_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.focus();
3248
+ field.onChange(null);
3249
+ } else {
3250
+ field.onChange(value);
3251
+ setInputValue("");
3252
+ (_d = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _d.onMenuClose();
3253
+ }
3254
+ }
3255
+ if (action === "clear-value") {
3256
+ setInputValue("");
3257
+ setCachedOptions([]);
3258
+ (_e = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _e.clearValue();
3259
+ field.onChange(null);
3260
+ }
3261
+ };
3262
+ const loadOptions = (value, callback) => {
3263
+ debouncedFetchOptions(value, callback);
3264
+ };
3265
+ return /* @__PURE__ */ jsxs("div", { className: "relative", id: "multiselect", children: [
3266
+ icon && /* @__PURE__ */ jsx("div", { className: iconStyle, children: icon }),
3267
+ /* @__PURE__ */ jsx(
3268
+ AsyncSelect,
3269
+ {
3270
+ onKeyDown: handleKeyDown,
3271
+ ...field,
3272
+ ...hasError,
3273
+ ...hasLabel,
3274
+ ...hasIcon,
3275
+ ref: selectRef,
3276
+ isDisabled: disabled,
3277
+ onBlur: () => handleInputChange("", {
3278
+ action: "input-change"
3279
+ }),
3280
+ loadingMessage: () => /* @__PURE__ */ jsx("div", { children: messages.loading }),
3281
+ isLoading: loading,
3282
+ loadOptions,
3283
+ defaultOptions: false,
3284
+ name: field.name,
3285
+ isClearable: false,
3286
+ styles: customStyles2,
3287
+ placeholder: placeholder || " ",
3288
+ isSearchable,
3289
+ tabSelectsValue: true,
3290
+ components: {
3291
+ SingleValue: CustomSingleValue,
3292
+ ValueContainer: ValueContainer2,
3293
+ Option: IconOption,
3294
+ LoadingIndicator: () => /* @__PURE__ */ jsx(Fragment, {}),
3295
+ LoadingMessage,
3296
+ NoOptionsMessage,
3297
+ DropdownIndicator: DropdownIndicatorCustom
3298
+ },
3299
+ closeMenuOnSelect: false,
3300
+ blurInputOnSelect: true,
3301
+ hideSelectedOptions: false,
3302
+ onChange,
3303
+ inputValue,
3304
+ onInputChange: handleInputChange
3305
+ }
3306
+ ),
3307
+ inputValue !== "" && /* @__PURE__ */ jsx(
3308
+ "i",
3309
+ {
3310
+ onClick: () => onChange(null, "clear-value"),
3311
+ className: "uil uil-times text-[18px] absolute right-2 top-[11px] cursor-pointer text-label"
3312
+ }
3313
+ ),
3314
+ /* @__PURE__ */ jsxs(
3315
+ "span",
3316
+ {
3317
+ className: clsx9(
3318
+ "text-label text-sm left-2.5 cursor-pointer pointer-events-none",
3319
+ {
3320
+ [" scale-75 -translate-y-3 "]: field.value,
3321
+ ["text-dangerous-700"]: hasError.hasError
3322
+ }
3323
+ ),
3324
+ children: [
3325
+ label,
3326
+ required && label && /* @__PURE__ */ jsx("strong", { className: "text-dangerous-700", children: "\xA0*" })
3327
+ ]
3328
+ }
3329
+ ),
3330
+ fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsx(
3331
+ "div",
3332
+ {
3333
+ className: "text-dangerous-700 text-xs mt-1 ml-[2px]",
3334
+ role: "alert",
3335
+ "aria-label": message,
3336
+ children: message
3337
+ },
3338
+ index
3339
+ ))
3340
+ ] });
3341
+ }
3342
+ }
3343
+ );
3344
+ };
3345
+ var ValueContainer2 = ({ children, ...props }) => {
3346
+ return /* @__PURE__ */ jsx(components.ValueContainer, { ...props, children });
3347
+ };
2770
3348
  var Radio = ({
2771
3349
  disabled,
2772
3350
  control,
@@ -2970,7 +3548,7 @@ function PaginationSelect({
2970
3548
  Combobox.Option,
2971
3549
  {
2972
3550
  value: opt,
2973
- className: clsx7(
3551
+ className: clsx9(
2974
3552
  "p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
2975
3553
  {
2976
3554
  "bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
@@ -3045,7 +3623,7 @@ function PaginationSelect({
3045
3623
  Combobox.Option,
3046
3624
  {
3047
3625
  value: opt,
3048
- className: clsx7(
3626
+ className: clsx9(
3049
3627
  "p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
3050
3628
  {
3051
3629
  "bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
@@ -3065,7 +3643,7 @@ function PaginationSelect({
3065
3643
  ] })
3066
3644
  ] });
3067
3645
  }
3068
- var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3646
+ var Table = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3069
3647
  "table",
3070
3648
  {
3071
3649
  ref,
@@ -3078,7 +3656,7 @@ var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
3078
3656
  }
3079
3657
  ));
3080
3658
  Table.displayName = "Table";
3081
- var TableHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3659
+ var TableHeader = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3082
3660
  "thead",
3083
3661
  {
3084
3662
  ref,
@@ -3087,9 +3665,9 @@ var TableHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
3087
3665
  }
3088
3666
  ));
3089
3667
  TableHeader.displayName = "TableHeader";
3090
- var TableBody = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: clsx(className), ...props }));
3668
+ var TableBody = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: clsx(className), ...props }));
3091
3669
  TableBody.displayName = "TableBody";
3092
- var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3670
+ var TableFooter = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3093
3671
  "div",
3094
3672
  {
3095
3673
  ref,
@@ -3101,9 +3679,9 @@ var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
3101
3679
  }
3102
3680
  ));
3103
3681
  TableFooter.displayName = "TableFooter";
3104
- var TableRow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: clsx(className), ...props }));
3682
+ var TableRow = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: clsx(className), ...props }));
3105
3683
  TableRow.displayName = "TableRow";
3106
- var TableHead = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3684
+ var TableHead = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3107
3685
  "th",
3108
3686
  {
3109
3687
  ref,
@@ -3118,7 +3696,7 @@ var TableHead = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
3118
3696
  }
3119
3697
  ));
3120
3698
  TableHead.displayName = "TableHead";
3121
- var TableCell = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3699
+ var TableCell = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3122
3700
  "td",
3123
3701
  {
3124
3702
  ref,
@@ -3130,7 +3708,7 @@ var TableCell = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__
3130
3708
  }
3131
3709
  ));
3132
3710
  TableCell.displayName = "TableCell";
3133
- var TableCaption = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3711
+ var TableCaption = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3134
3712
  "caption",
3135
3713
  {
3136
3714
  ref,
@@ -3184,10 +3762,10 @@ function DataTablePagination({
3184
3762
  (pageSizeOptions == null ? void 0 : pageSizeOptions.length) > 0 && /* @__PURE__ */ jsx(PaginationSelect, { table, pageSizeOptions }),
3185
3763
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4", children: [
3186
3764
  footer,
3187
- selectAllOption && /* @__PURE__ */ jsx("div", { children: rowsSelected !== totalData ? /* @__PURE__ */ jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxs(Button, { size: "xxs", onClick: onSelectAll, variant: "link", children: [
3765
+ selectAllOption && /* @__PURE__ */ jsx("div", { children: rowsSelected !== totalData ? /* @__PURE__ */ jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxs(Button, { size: "xxs", onClick: onSelectAll, variant: "secondary", children: [
3188
3766
  "Selecionar todos os ",
3189
3767
  totalData
3190
- ] }) }) : /* @__PURE__ */ jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsx(Button, { size: "xxs", onClick: onRemoveAll, variant: "link", children: "Desmarcar todos" }) }) })
3768
+ ] }) }) : /* @__PURE__ */ jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsx(Button, { size: "xxs", onClick: onRemoveAll, variant: "secondary", children: "Desmarcar todos" }) }) })
3191
3769
  ] }),
3192
3770
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1", children: [
3193
3771
  /* @__PURE__ */ jsxs("span", { className: "text-p-md text-paragraph mr-1", children: [
@@ -3585,7 +4163,7 @@ function DataTable({
3585
4163
  /* @__PURE__ */ jsxs(
3586
4164
  "div",
3587
4165
  {
3588
- className: clsx7("w-full flex mt-4 flex-col justify-between", {
4166
+ className: clsx9("w-full flex mt-4 flex-col justify-between", {
3589
4167
  "flex-1": !hideTableData,
3590
4168
  [tableClass]: tableClass
3591
4169
  }),
@@ -3593,7 +4171,7 @@ function DataTable({
3593
4171
  /* @__PURE__ */ jsxs(
3594
4172
  Table,
3595
4173
  {
3596
- className: clsx7(
4174
+ className: clsx9(
3597
4175
  "w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"
3598
4176
  ),
3599
4177
  onScroll,
@@ -3620,7 +4198,7 @@ function DataTable({
3620
4198
  width: header.getSize()
3621
4199
  },
3622
4200
  scope: "col",
3623
- className: clsx7(
4201
+ className: clsx9(
3624
4202
  {
3625
4203
  "hover:bg-neutral-100 th-shadow cursor-pointer": header.column.getCanSort(),
3626
4204
  ["with-shadow"]: (arrRowSelected == null ? void 0 : arrRowSelected.length) == 0 && withShadow
@@ -3636,7 +4214,7 @@ function DataTable({
3636
4214
  ((_a2 = sorting[0]) == null ? void 0 : _a2.id) == header.column.id ? /* @__PURE__ */ jsx(
3637
4215
  "i",
3638
4216
  {
3639
- className: clsx7(
4217
+ className: clsx9(
3640
4218
  {
3641
4219
  ["rotate-0"]: !((_b2 = sorting[0]) == null ? void 0 : _b2.desc),
3642
4220
  ["rotate-180"]: (_c2 = sorting[0]) == null ? void 0 : _c2.desc
@@ -3651,7 +4229,7 @@ function DataTable({
3651
4229
  );
3652
4230
  }) }, headerGroup.id + headerIndex + "header")) }),
3653
4231
  /* @__PURE__ */ jsx(TableBody, { children: (_f = (_e = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _e.rows) == null ? void 0 : _f.map((row, rowIndex) => {
3654
- return /* @__PURE__ */ jsx(React2__default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxs(React2__default.Fragment, { children: [
4232
+ return /* @__PURE__ */ jsx(React4__default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxs(React4__default.Fragment, { children: [
3655
4233
  /* @__PURE__ */ jsx(
3656
4234
  TableRow,
3657
4235
  {
@@ -3669,7 +4247,7 @@ function DataTable({
3669
4247
  backgroundColor: backgroundColor ? backgroundColor : "",
3670
4248
  ...stylesRow(row)
3671
4249
  },
3672
- className: clsx7(
4250
+ className: clsx9(
3673
4251
  {
3674
4252
  ["hidden"]: cell.row.original._destroy,
3675
4253
  ["first:border-l last:border-r"]: borderFull,
@@ -3705,6 +4283,6 @@ function DataTable({
3705
4283
  ] });
3706
4284
  }
3707
4285
 
3708
- export { Badge, Button, Calendar, Checkbox, DataTable, DataTablePagination, DatePickerInput, FilterCalendar, FilterOptions, Input, InputMoney, InputNumber, InputPercentage, Logo, MaskedInput, ModalDialog, PaginationSelect, Popover3 as Popover, Radio, RocketIcon, SelectField, SpinnerIcon, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Toggle, ValueContainer };
4286
+ export { Badge, Button, ButtonLink, Calendar, Checkbox, DataTable, DataTablePagination, DatePickerInput, FilterCalendar, FilterOptions, Input, InputMoney, InputNumber, InputPercentage, Logo, MaskedInput, ModalDialog, PaginationSelect, Popover3 as Popover, Radio, RocketIcon, SelectField, SelectFieldBip, SpinnerIcon, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Toggle, ValueContainer, sizes2 as sizes };
3709
4287
  //# sourceMappingURL=index.js.map
3710
4288
  //# sourceMappingURL=index.js.map