@lets-events/react 11.7.9 → 11.8.0

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.
Files changed (77) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +18 -20
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.css +171 -0
  5. package/dist/index.d.mts +2 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +179 -138
  8. package/dist/index.mjs +154 -113
  9. package/package.json +1 -1
  10. package/src/components/Alert.tsx +303 -303
  11. package/src/components/Avatar.tsx +55 -55
  12. package/src/components/Badge.tsx +125 -125
  13. package/src/components/Box.tsx +3 -3
  14. package/src/components/Button/index.tsx +16 -16
  15. package/src/components/Button/styledComponents.ts +287 -287
  16. package/src/components/ButtonGroup.tsx +484 -484
  17. package/src/components/Calendar/index.tsx +136 -136
  18. package/src/components/Calendar/styledComponents.ts +209 -209
  19. package/src/components/Card.tsx +48 -48
  20. package/src/components/CheckboxGroup.tsx +176 -176
  21. package/src/components/Container.tsx +39 -39
  22. package/src/components/Drawer/index.tsx +55 -48
  23. package/src/components/Drawer/styledComponents.ts +46 -46
  24. package/src/components/Dropdown.tsx +302 -302
  25. package/src/components/Filter.tsx +164 -164
  26. package/src/components/Flex.tsx +118 -118
  27. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  28. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  29. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  30. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  31. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  32. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  33. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  34. package/src/components/FormFields/CPFFormField.tsx +78 -78
  35. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  36. package/src/components/FormFields/EmailFormField.tsx +27 -27
  37. package/src/components/FormFields/Form.tsx +39 -39
  38. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +40 -40
  39. package/src/components/FormFields/MultiSelectFormField.tsx +55 -55
  40. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  41. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  42. package/src/components/FormFields/SelectFormField.tsx +93 -93
  43. package/src/components/FormFields/TextAreaFormField.tsx +48 -48
  44. package/src/components/FormFields/TextFormField.tsx +112 -112
  45. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  46. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  47. package/src/components/FormFields/utils/validation.ts +23 -23
  48. package/src/components/Grid.tsx +137 -137
  49. package/src/components/Icon.tsx +47 -47
  50. package/src/components/MenuDropdown/index.tsx +38 -30
  51. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  52. package/src/components/Modal.tsx +90 -90
  53. package/src/components/MultiSelect.tsx +252 -218
  54. package/src/components/RadioGroup.tsx +210 -210
  55. package/src/components/Section.tsx +33 -33
  56. package/src/components/Step.tsx +164 -164
  57. package/src/components/Switch.tsx +108 -108
  58. package/src/components/Text.tsx +38 -38
  59. package/src/components/TextField.tsx +365 -365
  60. package/src/components/TextareaField.tsx +128 -128
  61. package/src/components/TimePicker.tsx +298 -298
  62. package/src/components/Toast/components/ToastItem.tsx +41 -41
  63. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  64. package/src/components/Toast/hooks/useToast.ts +12 -12
  65. package/src/components/Toast/index.tsx +5 -5
  66. package/src/components/Toast/styles/index.ts +135 -135
  67. package/src/components/Toast/types/index.ts +46 -46
  68. package/src/components/Tooltip/index.tsx +66 -66
  69. package/src/components/Tooltip/styles.ts +77 -77
  70. package/src/hooks/useCountries.ts +41 -41
  71. package/src/hooks/useOnClickOutside.tsx +20 -20
  72. package/src/index.tsx +54 -54
  73. package/src/styles/index.ts +38 -38
  74. package/src/types/typographyValues.ts +178 -178
  75. package/src/utils/getNestedValue.ts +3 -3
  76. package/src/utils/states.ts +29 -29
  77. package/tsconfig.json +3 -3
package/dist/index.js CHANGED
@@ -262,7 +262,7 @@ var require_react_is_development = __commonJS({
262
262
  var ContextProvider = REACT_PROVIDER_TYPE;
263
263
  var Element = REACT_ELEMENT_TYPE;
264
264
  var ForwardRef = REACT_FORWARD_REF_TYPE;
265
- var Fragment4 = REACT_FRAGMENT_TYPE;
265
+ var Fragment5 = REACT_FRAGMENT_TYPE;
266
266
  var Lazy = REACT_LAZY_TYPE;
267
267
  var Memo = REACT_MEMO_TYPE;
268
268
  var Portal = REACT_PORTAL_TYPE;
@@ -321,7 +321,7 @@ var require_react_is_development = __commonJS({
321
321
  exports2.ContextProvider = ContextProvider;
322
322
  exports2.Element = Element;
323
323
  exports2.ForwardRef = ForwardRef;
324
- exports2.Fragment = Fragment4;
324
+ exports2.Fragment = Fragment5;
325
325
  exports2.Lazy = Lazy;
326
326
  exports2.Memo = Memo;
327
327
  exports2.Portal = Portal;
@@ -3884,6 +3884,9 @@ function Modal(_a) {
3884
3884
  ] }));
3885
3885
  }
3886
3886
 
3887
+ // src/components/MenuDropdown/index.tsx
3888
+ var import_react6 = require("react");
3889
+
3887
3890
  // src/components/MenuDropdown/styledComponents.ts
3888
3891
  var MenuDropdownContainerStyled = styled("div", {
3889
3892
  position: "relative",
@@ -3915,22 +3918,6 @@ var MenuItemsContainerStyled = styled("div", {
3915
3918
  height: "fit-content"
3916
3919
  });
3917
3920
 
3918
- // src/components/MenuDropdown/index.tsx
3919
- var import_jsx_runtime14 = require("react/jsx-runtime");
3920
- function MenuDropdown({
3921
- children,
3922
- isOpen,
3923
- setIsOpen
3924
- }) {
3925
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(MenuDropdownContainerStyled, { children: [
3926
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TriggerButtonStyled, { onClick: () => setIsOpen(!isOpen), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon_default, { name: "ellipsis", size: "xl", color: "#FFFFFF" }) }),
3927
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuItemsContainerStyled, { children })
3928
- ] });
3929
- }
3930
-
3931
- // src/components/Calendar/index.tsx
3932
- var import_react6 = require("react");
3933
-
3934
3921
  // src/hooks/useOnClickOutside.tsx
3935
3922
  var import_react5 = require("react");
3936
3923
  function useOnClickOutside(ref, handler) {
@@ -3950,7 +3937,25 @@ function useOnClickOutside(ref, handler) {
3950
3937
  }, [ref, handler]);
3951
3938
  }
3952
3939
 
3940
+ // src/components/MenuDropdown/index.tsx
3941
+ var import_jsx_runtime14 = require("react/jsx-runtime");
3942
+ function MenuDropdown({
3943
+ children,
3944
+ isOpen,
3945
+ setIsOpen
3946
+ }) {
3947
+ const dropdownItemsContainerRef = (0, import_react6.useRef)(null);
3948
+ useOnClickOutside(dropdownItemsContainerRef, () => {
3949
+ setIsOpen(false);
3950
+ });
3951
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(MenuDropdownContainerStyled, { children: [
3952
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TriggerButtonStyled, { onClick: () => setIsOpen(!isOpen), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon_default, { name: "ellipsis", size: "xl", color: "#FFFFFF" }) }),
3953
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MenuItemsContainerStyled, { ref: dropdownItemsContainerRef, children })
3954
+ ] });
3955
+ }
3956
+
3953
3957
  // src/components/Calendar/index.tsx
3958
+ var import_react7 = require("react");
3954
3959
  var import_react_day_picker = require("react-day-picker");
3955
3960
 
3956
3961
  // ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
@@ -8071,15 +8076,15 @@ function Calendar(_a) {
8071
8076
  "setSelected",
8072
8077
  "position"
8073
8078
  ]);
8074
- const [inputValue, setInputValue] = (0, import_react6.useState)("");
8075
- const [showContainer, setShowCalendar] = (0, import_react6.useState)(false);
8076
- const dropdownRef = (0, import_react6.useRef)(null);
8079
+ const [inputValue, setInputValue] = (0, import_react7.useState)("");
8080
+ const [showContainer, setShowCalendar] = (0, import_react7.useState)(false);
8081
+ const dropdownRef = (0, import_react7.useRef)(null);
8077
8082
  useOnClickOutside(dropdownRef, () => {
8078
8083
  setShowCalendar(false);
8079
8084
  });
8080
8085
  const today = /* @__PURE__ */ new Date();
8081
8086
  const maxDate = addYears(today, 20);
8082
- (0, import_react6.useEffect)(() => {
8087
+ (0, import_react7.useEffect)(() => {
8083
8088
  if (selected) {
8084
8089
  setInputValue(format2(selected, "dd/MM/yyyy"));
8085
8090
  } else {
@@ -8155,6 +8160,9 @@ function Calendar(_a) {
8155
8160
  ] })) });
8156
8161
  }
8157
8162
 
8163
+ // src/components/Drawer/index.tsx
8164
+ var import_react8 = require("react");
8165
+
8158
8166
  // src/components/Drawer/styledComponents.ts
8159
8167
  var DrawerOverlayStyled = styled("div", {
8160
8168
  position: "fixed",
@@ -8210,9 +8218,14 @@ function Drawer({
8210
8218
  children
8211
8219
  }) {
8212
8220
  if (!isOpen) return null;
8221
+ const drawerContainerRef = (0, import_react8.useRef)(null);
8222
+ useOnClickOutside(drawerContainerRef, () => {
8223
+ onClose();
8224
+ });
8213
8225
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerOverlayStyled, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
8214
8226
  DrawerContainerStyled,
8215
8227
  {
8228
+ ref: drawerContainerRef,
8216
8229
  style: {
8217
8230
  width: width != null ? width : "34.25rem",
8218
8231
  backgroundColor: colors[backgroundColor != null ? backgroundColor : "neutral50"]
@@ -8229,7 +8242,7 @@ function Drawer({
8229
8242
  }
8230
8243
 
8231
8244
  // src/components/TimePicker.tsx
8232
- var import_react7 = require("react");
8245
+ var import_react9 = require("react");
8233
8246
  var import_jsx_runtime17 = require("react/jsx-runtime");
8234
8247
  var TimePickerStyled = styled("div", {
8235
8248
  position: "relative",
@@ -8333,14 +8346,14 @@ function TimePicker({
8333
8346
  setSelected,
8334
8347
  position = "bottom"
8335
8348
  }) {
8336
- const [hours, setHours] = (0, import_react7.useState)("00");
8337
- const [minutes, setMinutes] = (0, import_react7.useState)("00");
8338
- const [rawHours, setRawHours] = (0, import_react7.useState)("00");
8339
- const [rawMinutes, setRawMinutes] = (0, import_react7.useState)("00");
8340
- const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
8341
- const dropdownRef = (0, import_react7.useRef)(null);
8349
+ const [hours, setHours] = (0, import_react9.useState)("00");
8350
+ const [minutes, setMinutes] = (0, import_react9.useState)("00");
8351
+ const [rawHours, setRawHours] = (0, import_react9.useState)("00");
8352
+ const [rawMinutes, setRawMinutes] = (0, import_react9.useState)("00");
8353
+ const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
8354
+ const dropdownRef = (0, import_react9.useRef)(null);
8342
8355
  useOnClickOutside(dropdownRef, () => setIsOpen(false));
8343
- const handleIncrement = (0, import_react7.useCallback)(
8356
+ const handleIncrement = (0, import_react9.useCallback)(
8344
8357
  (type) => {
8345
8358
  if (type === "hours") {
8346
8359
  const next = (parseInt(hours) + 1) % 24;
@@ -8354,7 +8367,7 @@ function TimePicker({
8354
8367
  },
8355
8368
  [hours, minutes]
8356
8369
  );
8357
- const handleDecrement = (0, import_react7.useCallback)(
8370
+ const handleDecrement = (0, import_react9.useCallback)(
8358
8371
  (type) => {
8359
8372
  if (type === "hours") {
8360
8373
  const prev = (parseInt(hours) - 1 + 24) % 24;
@@ -8876,7 +8889,7 @@ function Switch(props) {
8876
8889
  }
8877
8890
 
8878
8891
  // src/components/Step.tsx
8879
- var import_react8 = __toESM(require("react"));
8892
+ var import_react10 = __toESM(require("react"));
8880
8893
  var import_themes15 = require("@radix-ui/themes");
8881
8894
  var import_jsx_runtime20 = require("react/jsx-runtime");
8882
8895
  var StepStyled = styled("div", {
@@ -8992,9 +9005,9 @@ function StepList(_a) {
8992
9005
  "children",
8993
9006
  "currentStep"
8994
9007
  ]);
8995
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react8.default.Children.map(children, (child) => {
8996
- if (import_react8.default.isValidElement(child) && child.type === StepTrigger) {
8997
- return import_react8.default.cloneElement(child, { currentStep });
9008
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StepListStyled, __spreadProps(__spreadValues({}, props), { children: import_react10.default.Children.map(children, (child) => {
9009
+ if (import_react10.default.isValidElement(child) && child.type === StepTrigger) {
9010
+ return import_react10.default.cloneElement(child, { currentStep });
8998
9011
  }
8999
9012
  return child;
9000
9013
  }) }));
@@ -9051,7 +9064,7 @@ function Card(_a) {
9051
9064
 
9052
9065
  // src/components/TextareaField.tsx
9053
9066
  var import_themes17 = require("@radix-ui/themes");
9054
- var import_react9 = __toESM(require("react"));
9067
+ var import_react11 = __toESM(require("react"));
9055
9068
  var import_jsx_runtime22 = require("react/jsx-runtime");
9056
9069
  var TextareaFieldStyle = styled(import_themes17.TextArea, {
9057
9070
  display: "flex",
@@ -9116,10 +9129,10 @@ var TextareaLimitIndicator = styled("div", {
9116
9129
  padding: "$4"
9117
9130
  }
9118
9131
  });
9119
- var TextareaField = import_react9.default.forwardRef((_a, fowardedRef) => {
9132
+ var TextareaField = import_react11.default.forwardRef((_a, fowardedRef) => {
9120
9133
  var _b = _a, { maxLength, color } = _b, props = __objRest(_b, ["maxLength", "color"]);
9121
- const inputRef = (0, import_react9.useRef)(null);
9122
- const badgeRef = (0, import_react9.useRef)(null);
9134
+ const inputRef = (0, import_react11.useRef)(null);
9135
+ const badgeRef = (0, import_react11.useRef)(null);
9123
9136
  const updateCharCountBadge = () => {
9124
9137
  var _a2, _b2;
9125
9138
  if (!maxLength || !badgeRef.current) return;
@@ -9155,12 +9168,12 @@ var TextareaField = import_react9.default.forwardRef((_a, fowardedRef) => {
9155
9168
  });
9156
9169
 
9157
9170
  // src/components/Toast/components/ToastItem.tsx
9158
- var import_react11 = require("react");
9171
+ var import_react13 = require("react");
9159
9172
 
9160
9173
  // src/components/Toast/styles/index.ts
9161
- var import_react10 = require("@stitches/react");
9174
+ var import_react12 = require("@stitches/react");
9162
9175
  var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
9163
- var slideIn = (0, import_react10.keyframes)({
9176
+ var slideIn = (0, import_react12.keyframes)({
9164
9177
  from: {
9165
9178
  transform: "translateX(calc(100% + 25px))",
9166
9179
  opacity: 0
@@ -9170,7 +9183,7 @@ var slideIn = (0, import_react10.keyframes)({
9170
9183
  opacity: 1
9171
9184
  }
9172
9185
  });
9173
- var slideOut = (0, import_react10.keyframes)({
9186
+ var slideOut = (0, import_react12.keyframes)({
9174
9187
  from: {
9175
9188
  transform: "translateX(0)",
9176
9189
  opacity: 1
@@ -9180,7 +9193,7 @@ var slideOut = (0, import_react10.keyframes)({
9180
9193
  opacity: 0
9181
9194
  }
9182
9195
  });
9183
- var swipeOut = (0, import_react10.keyframes)({
9196
+ var swipeOut = (0, import_react12.keyframes)({
9184
9197
  from: {
9185
9198
  transform: "translateX(var(--radix-toast-swipe-end-x))",
9186
9199
  opacity: 1
@@ -9286,7 +9299,7 @@ function ToastItem({
9286
9299
  toast,
9287
9300
  onRemove
9288
9301
  }) {
9289
- const [open, setOpen] = (0, import_react11.useState)(true);
9302
+ const [open, setOpen] = (0, import_react13.useState)(true);
9290
9303
  const handleOpenChange = (open2) => {
9291
9304
  setOpen(open2);
9292
9305
  if (!open2) {
@@ -9310,17 +9323,17 @@ function ToastItem({
9310
9323
  }
9311
9324
 
9312
9325
  // src/components/Toast/components/ToastProvider.tsx
9313
- var import_react12 = require("react");
9326
+ var import_react14 = require("react");
9314
9327
  var ToastPrimitive2 = __toESM(require("@radix-ui/react-toast"));
9315
9328
  var import_jsx_runtime24 = require("react/jsx-runtime");
9316
- var ToastContext = (0, import_react12.createContext)(null);
9329
+ var ToastContext = (0, import_react14.createContext)(null);
9317
9330
  function ToastProvider({
9318
9331
  children,
9319
9332
  defaultDuration = 5e3,
9320
9333
  maxToasts = 5,
9321
9334
  swipeDirection = "right"
9322
9335
  }) {
9323
- const [toasts, setToasts] = (0, import_react12.useState)([]);
9336
+ const [toasts, setToasts] = (0, import_react14.useState)([]);
9324
9337
  const addToast = (toastData) => {
9325
9338
  const id = Math.random().toString(36).substr(2, 9);
9326
9339
  const newToast = __spreadProps(__spreadValues({
@@ -9356,9 +9369,9 @@ function ToastProvider({
9356
9369
  }
9357
9370
 
9358
9371
  // src/components/Toast/hooks/useToast.ts
9359
- var import_react13 = require("react");
9372
+ var import_react15 = require("react");
9360
9373
  var useToast = () => {
9361
- const context = (0, import_react13.useContext)(ToastContext);
9374
+ const context = (0, import_react15.useContext)(ToastContext);
9362
9375
  if (!context) {
9363
9376
  throw new Error("useToast deve ser usado dentro de um ToastProvider");
9364
9377
  }
@@ -9419,8 +9432,8 @@ function Tooltip({
9419
9432
  var import_themes18 = require("@radix-ui/themes");
9420
9433
  var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
9421
9434
  var import_free_solid_svg_icons3 = require("@fortawesome/free-solid-svg-icons");
9422
- var import_react14 = require("react");
9423
- var import_react15 = __toESM(require("react"));
9435
+ var import_react16 = require("react");
9436
+ var import_react17 = __toESM(require("react"));
9424
9437
  var import_jsx_runtime26 = require("react/jsx-runtime");
9425
9438
  var StyledContent = styled(import_themes18.DropdownMenu.Content, {
9426
9439
  backgroundColor: "$dark50",
@@ -9460,31 +9473,23 @@ var itemStyle = {
9460
9473
  boxSizing: "border-box",
9461
9474
  backgroundColor: "$dark50",
9462
9475
  display: "block",
9476
+ cursor: "pointer",
9463
9477
  "&:hover": {
9464
9478
  backgroundColor: "$dark100"
9465
9479
  }
9466
9480
  };
9481
+ var StyledItem2 = styled("div", __spreadValues({}, itemStyle));
9467
9482
  var BadgeWrapper = styled("div", {
9468
9483
  flex: "1",
9469
9484
  display: "flex",
9470
- justifyContent: "start",
9471
- flexWrap: "wrap",
9472
- gap: "4px"
9485
+ gap: "4px",
9486
+ marginTop: "8px",
9487
+ flexDirection: "column"
9473
9488
  });
9474
9489
  var BadgeCloseBtn = styled("div", {
9475
- borderRadius: "100%",
9476
- width: "16px",
9477
- height: "16px",
9478
- minWidth: "16px",
9479
- minHeight: "16px",
9480
- display: "flex",
9481
- justifyContent: "center",
9482
- alignItems: "center",
9483
- "&:hover": {
9484
- backgroundColor: "$dark600"
9485
- }
9490
+ cursor: "pointer"
9486
9491
  });
9487
- var MultiSelect = import_react15.default.forwardRef(
9492
+ var MultiSelect = import_react17.default.forwardRef(
9488
9493
  ({
9489
9494
  placeholder,
9490
9495
  value: selectedValues = [],
@@ -9492,19 +9497,21 @@ var MultiSelect = import_react15.default.forwardRef(
9492
9497
  options,
9493
9498
  color,
9494
9499
  width = "100%",
9495
- zIndex = "auto"
9500
+ zIndex = "auto",
9501
+ showSelectedValues = true,
9502
+ singleSelect = false
9496
9503
  }, fowardedRef) => {
9497
9504
  var _a;
9498
- const [isOpen, setIsOpen] = (0, import_react14.useState)(false);
9499
- const triggerRef = (0, import_react14.useRef)(null);
9500
- const labelByValue = (0, import_react14.useMemo)(() => {
9505
+ const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
9506
+ const triggerRef = (0, import_react16.useRef)(null);
9507
+ const labelByValue = (0, import_react16.useMemo)(() => {
9501
9508
  return options.reduce((prev, curr) => {
9502
9509
  return __spreadProps(__spreadValues({}, prev), {
9503
9510
  [curr.value]: curr.label
9504
9511
  });
9505
9512
  }, {});
9506
9513
  }, [options]);
9507
- const handleRemove = (0, import_react14.useCallback)(
9514
+ const handleRemove = (0, import_react16.useCallback)(
9508
9515
  (value) => {
9509
9516
  const newValue = selectedValues.filter((v) => v !== value);
9510
9517
  onValueChange == null ? void 0 : onValueChange(newValue);
@@ -9512,72 +9519,106 @@ var MultiSelect = import_react15.default.forwardRef(
9512
9519
  [selectedValues, onValueChange]
9513
9520
  );
9514
9521
  const menuWidth = (_a = triggerRef.current) == null ? void 0 : _a.offsetWidth;
9515
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_themes18.Theme, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_themes18.DropdownMenu.Root, { open: isOpen, onOpenChange: () => setIsOpen(false), children: [
9516
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_themes18.DropdownMenu.Trigger, { onClick: () => setIsOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
9517
- StyledTrigger,
9518
- {
9519
- css: {
9520
- width
9521
- },
9522
- ref: (r) => {
9523
- if (!r) return;
9524
- triggerRef.current = r;
9525
- if (fowardedRef) {
9526
- if (typeof fowardedRef === "function") fowardedRef(r);
9527
- else {
9528
- fowardedRef.current = r;
9522
+ const text = (0, import_react16.useMemo)(() => {
9523
+ if (selectedValues.length > 0 && singleSelect) {
9524
+ const value = selectedValues[0];
9525
+ return labelByValue[value];
9526
+ }
9527
+ return placeholder != null ? placeholder : "Selecione";
9528
+ }, [selectedValues, placeholder, singleSelect]);
9529
+ const handleItemClick = (v) => {
9530
+ onValueChange == null ? void 0 : onValueChange([v]);
9531
+ setIsOpen(false);
9532
+ };
9533
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_themes18.Theme, { children: [
9534
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_themes18.DropdownMenu.Root, { open: isOpen, onOpenChange: () => setIsOpen(false), children: [
9535
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_themes18.DropdownMenu.Trigger, { onClick: () => setIsOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
9536
+ StyledTrigger,
9537
+ {
9538
+ css: {
9539
+ width
9540
+ },
9541
+ ref: (r) => {
9542
+ if (!r) return;
9543
+ triggerRef.current = r;
9544
+ if (fowardedRef) {
9545
+ if (typeof fowardedRef === "function") fowardedRef(r);
9546
+ else {
9547
+ fowardedRef.current = r;
9548
+ }
9529
9549
  }
9530
- }
9531
- },
9532
- color,
9533
- children: [
9534
- selectedValues.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelMedium", css: { flex: 1 }, children: placeholder != null ? placeholder : "Selecione" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BadgeWrapper, { children: selectedValues.map((value) => {
9535
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Badge, { size: "sm", color: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Flex2, { justify: "between", align: "center", children: [
9536
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "badgeSmall", color: "dark100", children: labelByValue[value] }),
9537
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9538
- BadgeCloseBtn,
9539
- {
9540
- onClick: (e) => {
9541
- e.stopPropagation();
9542
- handleRemove(value);
9543
- },
9544
- role: "button",
9545
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faX, size: "xs" })
9546
- }
9547
- )
9548
- ] }) }, value);
9549
- }) }),
9550
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9551
- import_react_fontawesome3.FontAwesomeIcon,
9550
+ },
9551
+ color,
9552
+ children: [
9553
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9554
+ Text,
9555
+ {
9556
+ typography: "labelMedium",
9557
+ css: {
9558
+ flex: 1,
9559
+ overflow: "hidden",
9560
+ whiteSpace: "nowrap",
9561
+ textOverflow: "ellipsis"
9562
+ },
9563
+ children: text
9564
+ }
9565
+ ),
9566
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9567
+ import_react_fontawesome3.FontAwesomeIcon,
9568
+ {
9569
+ icon: isOpen ? import_free_solid_svg_icons3.faChevronUp : import_free_solid_svg_icons3.faChevronDown,
9570
+ size: "sm",
9571
+ color: colors.dark600
9572
+ }
9573
+ )
9574
+ ]
9575
+ }
9576
+ ) }),
9577
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9578
+ StyledContent,
9579
+ {
9580
+ css: {
9581
+ width: menuWidth ? menuWidth + "px" : width,
9582
+ zIndex
9583
+ },
9584
+ children: !singleSelect ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9585
+ CheckboxGroup,
9552
9586
  {
9553
- icon: isOpen ? import_free_solid_svg_icons3.faChevronUp : import_free_solid_svg_icons3.faChevronDown,
9554
- size: "sm",
9555
- color: colors.dark600
9587
+ value: selectedValues,
9588
+ onValueChange: (v) => {
9589
+ onValueChange == null ? void 0 : onValueChange(v);
9590
+ },
9591
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex2, { direction: "column", gap: 8, children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: label }) }, i)) })
9556
9592
  }
9557
- )
9558
- ]
9559
- }
9560
- ) }),
9561
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9562
- StyledContent,
9563
- {
9564
- css: {
9565
- width: menuWidth ? menuWidth + "px" : width,
9566
- zIndex
9567
- },
9568
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9569
- CheckboxGroup,
9593
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex2, { direction: "column", gap: 8, children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: label }) }, i)) })
9594
+ }
9595
+ )
9596
+ ] }),
9597
+ selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BadgeWrapper, { children: selectedValues.map((value) => {
9598
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Flex2, { gap: 4, children: [
9599
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9600
+ BadgeCloseBtn,
9570
9601
  {
9571
- value: selectedValues,
9572
- onValueChange: (v) => {
9573
- onValueChange == null ? void 0 : onValueChange(v);
9602
+ onClick: (e) => {
9603
+ e.stopPropagation();
9604
+ handleRemove(value);
9574
9605
  },
9575
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex2, { direction: "column", gap: 8, children: options.map(({ value, label }, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { typography: "labelSmall", children: label }) }, i)) })
9606
+ role: "button",
9607
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faSquareXmark, size: "sm" })
9608
+ }
9609
+ ),
9610
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9611
+ Text,
9612
+ {
9613
+ typography: "captionMedium",
9614
+ fontWeight: "regular",
9615
+ color: "dark600",
9616
+ children: labelByValue[value]
9576
9617
  }
9577
9618
  )
9578
- }
9579
- )
9580
- ] }) });
9619
+ ] });
9620
+ }) }) })
9621
+ ] });
9581
9622
  }
9582
9623
  );
9583
9624
 
@@ -9857,7 +9898,7 @@ var TextAreaFormField = (_a) => {
9857
9898
 
9858
9899
  // src/components/FormFields/TextFormField.tsx
9859
9900
  var import_react_hook_form2 = require("react-hook-form");
9860
- var import_react16 = require("react");
9901
+ var import_react18 = require("react");
9861
9902
  var import_mask2 = require("@react-input/mask");
9862
9903
  var import_jsx_runtime33 = require("react/jsx-runtime");
9863
9904
  var TextFormField = (_a) => {
@@ -9880,7 +9921,7 @@ var TextFormField = (_a) => {
9880
9921
  "onChange",
9881
9922
  "valueFormatter"
9882
9923
  ]);
9883
- const handleValidate = (0, import_react16.useCallback)(
9924
+ const handleValidate = (0, import_react18.useCallback)(
9884
9925
  (value) => {
9885
9926
  var _a2;
9886
9927
  if (value === void 0 || value === null || !required && value.trim() === "")
@@ -9902,7 +9943,7 @@ var TextFormField = (_a) => {
9902
9943
  const haveError = !!fieldError;
9903
9944
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
9904
9945
  const { value: formValue, onChange: formChange } = field;
9905
- const formattedValue = (0, import_react16.useMemo)(() => {
9946
+ const formattedValue = (0, import_react18.useMemo)(() => {
9906
9947
  let value = formValue;
9907
9948
  if (valueFormatter) value = valueFormatter.format(value);
9908
9949
  if (mask) value = (0, import_mask2.format)(value != null ? value : "", mask);
@@ -10495,7 +10536,7 @@ function StateFormField({
10495
10536
  }
10496
10537
 
10497
10538
  // src/components/FormFields/AddressFormFields/CityFormField.tsx
10498
- var import_react17 = require("react");
10539
+ var import_react19 = require("react");
10499
10540
  var import_react_hook_form7 = require("react-hook-form");
10500
10541
  var import_jsx_runtime45 = require("react/jsx-runtime");
10501
10542
  function CityFormField({
@@ -10508,9 +10549,9 @@ function CityFormField({
10508
10549
  }) {
10509
10550
  const { control, watch } = (0, import_react_hook_form7.useFormContext)();
10510
10551
  const selectedState = watch(stateName);
10511
- const [cities, setCities] = (0, import_react17.useState)([]);
10512
- const [loading, setLoading] = (0, import_react17.useState)(false);
10513
- (0, import_react17.useEffect)(() => {
10552
+ const [cities, setCities] = (0, import_react19.useState)([]);
10553
+ const [loading, setLoading] = (0, import_react19.useState)(false);
10554
+ (0, import_react19.useEffect)(() => {
10514
10555
  if (!isBrazil) {
10515
10556
  setCities([]);
10516
10557
  return;