@lets-events/react 12.11.2 → 12.11.3

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 (96) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +24 -21
  3. package/CHANGELOG.md +6 -0
  4. package/dist/index.js +171 -139
  5. package/dist/index.mjs +171 -139
  6. package/package.json +1 -1
  7. package/src/components/Alert.tsx +303 -303
  8. package/src/components/Avatar.tsx +55 -55
  9. package/src/components/Badge.tsx +132 -132
  10. package/src/components/Box.tsx +3 -3
  11. package/src/components/Button/index.tsx +85 -85
  12. package/src/components/Button/styledComponents.ts +361 -361
  13. package/src/components/ButtonGroup.tsx +484 -484
  14. package/src/components/Calendar/index.tsx +172 -168
  15. package/src/components/Calendar/styledComponents.ts +508 -480
  16. package/src/components/Card.tsx +74 -74
  17. package/src/components/CheckboxGroup.tsx +176 -176
  18. package/src/components/Container.tsx +39 -39
  19. package/src/components/Divider.tsx +7 -7
  20. package/src/components/DoubleCalendar/index.tsx +208 -204
  21. package/src/components/Drawer/index.tsx +113 -113
  22. package/src/components/Drawer/styledComponents.ts +97 -97
  23. package/src/components/Dropdown.tsx +302 -302
  24. package/src/components/Filter.tsx +164 -164
  25. package/src/components/Flex.tsx +130 -130
  26. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  27. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  28. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  29. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  30. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  31. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  32. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  33. package/src/components/FormFields/CPFFormField.tsx +78 -78
  34. package/src/components/FormFields/CalendarFormField.tsx +98 -98
  35. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  36. package/src/components/FormFields/DateAndTimeFormField.tsx +217 -217
  37. package/src/components/FormFields/DoubleCalendarFormField.tsx +96 -96
  38. package/src/components/FormFields/EmailFormField.tsx +27 -27
  39. package/src/components/FormFields/Form.tsx +39 -39
  40. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  41. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  42. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  43. package/src/components/FormFields/RadioGroupFormField.tsx +88 -88
  44. package/src/components/FormFields/RichEditorFormField.tsx +128 -128
  45. package/src/components/FormFields/SelectFormField.tsx +113 -113
  46. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  47. package/src/components/FormFields/TextAreaFormField.tsx +61 -61
  48. package/src/components/FormFields/TextFormField.tsx +112 -112
  49. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  50. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  51. package/src/components/FormFields/subComponents/FormLabel.tsx +36 -36
  52. package/src/components/FormFields/utils/validation.ts +23 -23
  53. package/src/components/Grid.tsx +137 -137
  54. package/src/components/Icon.tsx +47 -47
  55. package/src/components/MenuDropdown/index.tsx +38 -38
  56. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  57. package/src/components/Modal.tsx +135 -135
  58. package/src/components/MultiSelect/index.tsx +418 -418
  59. package/src/components/MultiSelect/styledComponents.ts +176 -176
  60. package/src/components/RadioGroup.tsx +210 -210
  61. package/src/components/RichEditor/QuillComponent.tsx +419 -419
  62. package/src/components/RichEditor/RichEditor.tsx +53 -53
  63. package/src/components/RichEditor/RichTextPresenter.tsx +18 -18
  64. package/src/components/RichEditor/editorConfig.ts +149 -149
  65. package/src/components/RichEditor/index.ts +3 -3
  66. package/src/components/RichEditor/styledComponents.ts +1175 -1175
  67. package/src/components/RichEditor/types.ts +12 -12
  68. package/src/components/Section.tsx +33 -33
  69. package/src/components/Step.tsx +164 -164
  70. package/src/components/Switch.tsx +108 -108
  71. package/src/components/Text.tsx +54 -54
  72. package/src/components/TextField.tsx +423 -423
  73. package/src/components/TextareaField.tsx +116 -116
  74. package/src/components/TimePicker.tsx +357 -357
  75. package/src/components/Toast/components/ToastItem.tsx +41 -41
  76. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  77. package/src/components/Toast/hooks/useToast.ts +12 -12
  78. package/src/components/Toast/index.tsx +5 -5
  79. package/src/components/Toast/styles/index.ts +135 -135
  80. package/src/components/Toast/types/index.ts +46 -46
  81. package/src/components/ToggleElement/index.tsx +58 -58
  82. package/src/components/Tooltip/index.tsx +126 -126
  83. package/src/components/Tooltip/styles.ts +77 -77
  84. package/src/hooks/useCountries.ts +41 -41
  85. package/src/hooks/useHasHover.ts +21 -21
  86. package/src/hooks/useImageUpload.ts +139 -139
  87. package/src/hooks/useMediaQuery.ts +19 -19
  88. package/src/hooks/useOnClickOutside.tsx +42 -42
  89. package/src/index.tsx +72 -72
  90. package/src/styles/index.ts +41 -41
  91. package/src/types/typographyValues.ts +178 -178
  92. package/src/utils/getNestedValue.ts +3 -3
  93. package/src/utils/states.ts +29 -29
  94. package/src/utils/uploadService.ts +180 -180
  95. package/tsconfig.json +3 -3
  96. package/tsup.config.ts +38 -38
package/dist/index.mjs CHANGED
@@ -7819,6 +7819,27 @@ var CalendarStyled = styled("div", {
7819
7819
  }
7820
7820
  }
7821
7821
  });
7822
+ var calendarMobileCentered = {
7823
+ position: "fixed",
7824
+ top: "50%",
7825
+ left: "50%",
7826
+ right: "auto",
7827
+ bottom: "auto",
7828
+ transform: "translate(-50%, -50%)",
7829
+ maxWidth: "calc(100vw - 32px)",
7830
+ maxHeight: "90vh",
7831
+ overflowY: "auto"
7832
+ };
7833
+ var CalendarOverlayStyled = styled("div", {
7834
+ display: "none",
7835
+ "@media (max-width: 748px)": {
7836
+ display: "block",
7837
+ position: "fixed",
7838
+ inset: 0,
7839
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
7840
+ zIndex: 999998
7841
+ }
7842
+ });
7822
7843
  var CalendarButtonStyled = styled("button", {
7823
7844
  backgroundColor: "transparent",
7824
7845
  border: "none",
@@ -7852,23 +7873,28 @@ var CalendarContentStyled = styled("div", {
7852
7873
  position: "absolute",
7853
7874
  backgroundColor: "$neutral50",
7854
7875
  zIndex: "999999",
7876
+ "@media (max-width: 748px)": calendarMobileCentered,
7855
7877
  variants: {
7856
7878
  position: {
7857
7879
  top: {
7858
7880
  bottom: "110%",
7859
- left: "0"
7881
+ left: "0",
7882
+ "@media (max-width: 748px)": calendarMobileCentered
7860
7883
  },
7861
7884
  bottom: {
7862
7885
  top: "110%",
7863
- left: "0"
7886
+ left: "0",
7887
+ "@media (max-width: 748px)": calendarMobileCentered
7864
7888
  },
7865
7889
  "top-right": {
7866
7890
  bottom: "110%",
7867
- right: "0"
7891
+ right: "0",
7892
+ "@media (max-width: 748px)": calendarMobileCentered
7868
7893
  },
7869
7894
  "bottom-right": {
7870
7895
  top: "110%",
7871
- right: "0"
7896
+ right: "0",
7897
+ "@media (max-width: 748px)": calendarMobileCentered
7872
7898
  }
7873
7899
  }
7874
7900
  }
@@ -8346,60 +8372,63 @@ function Calendar(_a) {
8346
8372
  console.warn("Data inv\xE1lida inserida no input:", masked);
8347
8373
  }
8348
8374
  };
8349
- return /* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsxs7(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
8350
- /* @__PURE__ */ jsx15(
8351
- CalendarButtonStyled,
8352
- {
8353
- expand,
8354
- type: "button",
8355
- onClick: () => setShowCalendar((prev) => !prev),
8356
- children: /* @__PURE__ */ jsx15(
8357
- TextField,
8358
- {
8359
- placeholder: "00/00/0000",
8360
- type: "text",
8361
- value: inputValue,
8362
- onChange: handleInputChange,
8363
- inputMode: "numeric",
8364
- textAlign: "right",
8365
- color: hasError ? "error" : "default",
8366
- disabled,
8367
- children: /* @__PURE__ */ jsx15(TextFieldSlot, { children: /* @__PURE__ */ jsx15(Icon_default, { name: "calendar", size: "xl", color: "#4C4F54" }) })
8368
- }
8369
- )
8370
- }
8371
- ),
8372
- showContainer && /* @__PURE__ */ jsxs7(CalendarContentStyled, { position, children: [
8373
- /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(DayPickerWrapperStyled, { children: /* @__PURE__ */ jsx15(
8374
- DayPicker,
8375
- {
8376
- mode: "single",
8377
- captionLayout: calendarLayout,
8378
- selected,
8379
- onSelect: setSelected,
8380
- required: true,
8381
- locale: ptBR,
8382
- disabled: disabledDays.length > 0 ? disabledDays : void 0,
8383
- startMonth: allowPastDates ? void 0 : today,
8384
- endMonth: resolvedMaxDate
8385
- }
8386
- ) }) }),
8387
- action && /* @__PURE__ */ jsx15(CalendarFooterStyled, { actionAlign, children: /* @__PURE__ */ jsx15(
8388
- Button,
8375
+ return /* @__PURE__ */ jsxs7("div", { children: [
8376
+ showContainer && /* @__PURE__ */ jsx15(CalendarOverlayStyled, { onClick: () => setShowCalendar(false) }),
8377
+ /* @__PURE__ */ jsxs7(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
8378
+ /* @__PURE__ */ jsx15(
8379
+ CalendarButtonStyled,
8389
8380
  {
8390
- variant: "text",
8391
- color: "brand",
8381
+ expand,
8392
8382
  type: "button",
8393
- onClick: () => {
8394
- setShowCalendar(false);
8395
- },
8396
- size: "medium",
8397
- fontWeight: "medium",
8398
- children: actionText != null ? actionText : "Aplicar"
8383
+ onClick: () => setShowCalendar((prev) => !prev),
8384
+ children: /* @__PURE__ */ jsx15(
8385
+ TextField,
8386
+ {
8387
+ placeholder: "00/00/0000",
8388
+ type: "text",
8389
+ value: inputValue,
8390
+ onChange: handleInputChange,
8391
+ inputMode: "numeric",
8392
+ textAlign: "right",
8393
+ color: hasError ? "error" : "default",
8394
+ disabled,
8395
+ children: /* @__PURE__ */ jsx15(TextFieldSlot, { children: /* @__PURE__ */ jsx15(Icon_default, { name: "calendar", size: "xl", color: "#4C4F54" }) })
8396
+ }
8397
+ )
8399
8398
  }
8400
- ) })
8401
- ] })
8402
- ] })) });
8399
+ ),
8400
+ showContainer && /* @__PURE__ */ jsxs7(CalendarContentStyled, { position, children: [
8401
+ /* @__PURE__ */ jsx15(Box, { children: /* @__PURE__ */ jsx15(DayPickerWrapperStyled, { children: /* @__PURE__ */ jsx15(
8402
+ DayPicker,
8403
+ {
8404
+ mode: "single",
8405
+ captionLayout: calendarLayout,
8406
+ selected,
8407
+ onSelect: setSelected,
8408
+ required: true,
8409
+ locale: ptBR,
8410
+ disabled: disabledDays.length > 0 ? disabledDays : void 0,
8411
+ startMonth: allowPastDates ? void 0 : today,
8412
+ endMonth: resolvedMaxDate
8413
+ }
8414
+ ) }) }),
8415
+ action && /* @__PURE__ */ jsx15(CalendarFooterStyled, { actionAlign, children: /* @__PURE__ */ jsx15(
8416
+ Button,
8417
+ {
8418
+ variant: "text",
8419
+ color: "brand",
8420
+ type: "button",
8421
+ onClick: () => {
8422
+ setShowCalendar(false);
8423
+ },
8424
+ size: "medium",
8425
+ fontWeight: "medium",
8426
+ children: actionText != null ? actionText : "Aplicar"
8427
+ }
8428
+ ) })
8429
+ ] })
8430
+ ] }))
8431
+ ] });
8403
8432
  }
8404
8433
 
8405
8434
  // src/components/DoubleCalendar/index.tsx
@@ -8465,89 +8494,71 @@ function DoubleCalendar(_a) {
8465
8494
  setEndValue("");
8466
8495
  }
8467
8496
  }, [selected]);
8468
- return /* @__PURE__ */ jsx16("div", { children: /* @__PURE__ */ jsxs8(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
8469
- /* @__PURE__ */ jsx16(
8470
- CalendarButtonStyled,
8471
- {
8472
- expand,
8473
- type: "button",
8474
- onClick: () => setShowCalendar((prev) => {
8475
- const next = !prev;
8476
- if (!prev) initialSelectedRef.current = selected;
8477
- return next;
8478
- }),
8479
- disabled,
8480
- children: /* @__PURE__ */ jsx16("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ jsx16(
8481
- TextField,
8482
- {
8483
- placeholder: "00/00/0000 - 00/00/0000",
8484
- type: "text",
8485
- value: `${startValue || "00/00/0000"} - ${endValue || "00/00/0000"}`,
8486
- readOnly: true,
8487
- inputMode: "numeric",
8488
- textAlign: "right",
8489
- color: hasError ? "error" : "default",
8490
- disabled,
8491
- children: /* @__PURE__ */ jsx16(TextFieldSlot, { children: /* @__PURE__ */ jsx16(Icon_default, { name: "calendar", size: "xl", color: "#4C4F54" }) })
8492
- }
8493
- ) })
8494
- }
8495
- ),
8496
- showContainer && /* @__PURE__ */ jsxs8(CalendarContentStyled, { position, children: [
8497
- /* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(DayPickerWrapperStyledToDoubleCalendar, { children: /* @__PURE__ */ jsx16(
8498
- DayPicker2,
8497
+ return /* @__PURE__ */ jsxs8("div", { children: [
8498
+ showContainer && /* @__PURE__ */ jsx16(CalendarOverlayStyled, { onClick: () => setShowCalendar(false) }),
8499
+ /* @__PURE__ */ jsxs8(CalendarStyled, __spreadProps(__spreadValues({}, props), { expand, ref: dropdownRef, children: [
8500
+ /* @__PURE__ */ jsx16(
8501
+ CalendarButtonStyled,
8499
8502
  {
8500
- mode: "range",
8501
- numberOfMonths: 2,
8502
- captionLayout: calendarLayout,
8503
- selected,
8504
- onSelect: setSelected,
8505
- required: true,
8506
- locale: ptBR,
8507
- disabled: disabledDays.length > 0 ? disabledDays : void 0,
8508
- fromMonth: allowPastDates ? void 0 : today,
8509
- toMonth: resolvedMaxDate
8510
- }
8511
- ) }) }),
8512
- action && /* @__PURE__ */ jsxs8(CalendarFooterStyled, { children: [
8513
- /* @__PURE__ */ jsx16("div", { style: { textAlign: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx16("span", { children: `${(selected == null ? void 0 : selected.from) ? format2(selected.from, "dd/MM/yyyy") : "00/00/0000"} \u2014 ${(selected == null ? void 0 : selected.to) ? format2(selected.to, "dd/MM/yyyy") : "00/00/0000"}` }) }),
8514
- /* @__PURE__ */ jsx16(
8515
- Button,
8503
+ expand,
8504
+ type: "button",
8505
+ onClick: () => setShowCalendar((prev) => {
8506
+ const next = !prev;
8507
+ if (!prev) initialSelectedRef.current = selected;
8508
+ return next;
8509
+ }),
8510
+ disabled,
8511
+ children: /* @__PURE__ */ jsx16("div", { style: { display: "flex", gap: "8px", width: "100%" }, children: /* @__PURE__ */ jsx16(
8512
+ TextField,
8513
+ {
8514
+ placeholder: "00/00/0000 - 00/00/0000",
8515
+ type: "text",
8516
+ value: `${startValue || "00/00/0000"} - ${endValue || "00/00/0000"}`,
8517
+ readOnly: true,
8518
+ inputMode: "numeric",
8519
+ textAlign: "right",
8520
+ color: hasError ? "error" : "default",
8521
+ disabled,
8522
+ children: /* @__PURE__ */ jsx16(TextFieldSlot, { children: /* @__PURE__ */ jsx16(Icon_default, { name: "calendar", size: "xl", color: "#4C4F54" }) })
8523
+ }
8524
+ ) })
8525
+ }
8526
+ ),
8527
+ showContainer && /* @__PURE__ */ jsxs8(CalendarContentStyled, { position, children: [
8528
+ /* @__PURE__ */ jsx16(Box, { children: /* @__PURE__ */ jsx16(DayPickerWrapperStyledToDoubleCalendar, { children: /* @__PURE__ */ jsx16(
8529
+ DayPicker2,
8516
8530
  {
8517
- style: { margin: "0 0.5rem" },
8518
- variant: "text",
8519
- color: "neutral",
8520
- type: "button",
8521
- onClick: () => {
8522
- setSelected(initialSelectedRef.current);
8523
- setShowCalendar(false);
8524
- },
8525
- size: "medium",
8526
- fontWeight: "regular",
8527
- children: "Cancelar"
8531
+ mode: "range",
8532
+ numberOfMonths: 2,
8533
+ captionLayout: calendarLayout,
8534
+ selected,
8535
+ onSelect: setSelected,
8536
+ required: true,
8537
+ locale: ptBR,
8538
+ disabled: disabledDays.length > 0 ? disabledDays : void 0,
8539
+ fromMonth: allowPastDates ? void 0 : today,
8540
+ toMonth: resolvedMaxDate
8528
8541
  }
8529
- ),
8530
- /* @__PURE__ */ jsx16(
8531
- Button,
8532
- {
8533
- style: { margin: "0 0.5rem" },
8534
- variant: "text",
8535
- color: "brand",
8536
- type: "button",
8537
- onClick: () => {
8538
- setShowCalendar(false);
8539
- },
8540
- size: "medium",
8541
- fontWeight: "medium",
8542
- children: actionText != null ? actionText : "Aplicar"
8543
- }
8544
- )
8545
- ] }),
8546
- simpleAction && /* @__PURE__ */ jsx16(CalendarFooterStyled, { children: /* @__PURE__ */ jsx16(
8547
- "div",
8548
- {
8549
- style: { display: "flex", justifyContent: "center", padding: "1rem", width: "100%" },
8550
- children: /* @__PURE__ */ jsx16(
8542
+ ) }) }),
8543
+ action && /* @__PURE__ */ jsxs8(CalendarFooterStyled, { children: [
8544
+ /* @__PURE__ */ jsx16("div", { style: { textAlign: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx16("span", { children: `${(selected == null ? void 0 : selected.from) ? format2(selected.from, "dd/MM/yyyy") : "00/00/0000"} \u2014 ${(selected == null ? void 0 : selected.to) ? format2(selected.to, "dd/MM/yyyy") : "00/00/0000"}` }) }),
8545
+ /* @__PURE__ */ jsx16(
8546
+ Button,
8547
+ {
8548
+ style: { margin: "0 0.5rem" },
8549
+ variant: "text",
8550
+ color: "neutral",
8551
+ type: "button",
8552
+ onClick: () => {
8553
+ setSelected(initialSelectedRef.current);
8554
+ setShowCalendar(false);
8555
+ },
8556
+ size: "medium",
8557
+ fontWeight: "regular",
8558
+ children: "Cancelar"
8559
+ }
8560
+ ),
8561
+ /* @__PURE__ */ jsx16(
8551
8562
  Button,
8552
8563
  {
8553
8564
  style: { margin: "0 0.5rem" },
@@ -8562,10 +8573,31 @@ function DoubleCalendar(_a) {
8562
8573
  children: actionText != null ? actionText : "Aplicar"
8563
8574
  }
8564
8575
  )
8565
- }
8566
- ) })
8567
- ] })
8568
- ] })) });
8576
+ ] }),
8577
+ simpleAction && /* @__PURE__ */ jsx16(CalendarFooterStyled, { children: /* @__PURE__ */ jsx16(
8578
+ "div",
8579
+ {
8580
+ style: { display: "flex", justifyContent: "center", padding: "1rem", width: "100%" },
8581
+ children: /* @__PURE__ */ jsx16(
8582
+ Button,
8583
+ {
8584
+ style: { margin: "0 0.5rem" },
8585
+ variant: "text",
8586
+ color: "brand",
8587
+ type: "button",
8588
+ onClick: () => {
8589
+ setShowCalendar(false);
8590
+ },
8591
+ size: "medium",
8592
+ fontWeight: "medium",
8593
+ children: actionText != null ? actionText : "Aplicar"
8594
+ }
8595
+ )
8596
+ }
8597
+ ) })
8598
+ ] })
8599
+ ] }))
8600
+ ] });
8569
8601
  }
8570
8602
 
8571
8603
  // src/components/Drawer/index.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.11.2",
3
+ "version": "12.11.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",