@lets-events/react 12.2.1 → 12.2.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 (99) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +19 -21
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.css +138 -1023
  5. package/dist/index.js +25 -9
  6. package/dist/index.mjs +25 -9
  7. package/package.json +1 -1
  8. package/src/components/Alert.tsx +303 -303
  9. package/src/components/Avatar.tsx +55 -55
  10. package/src/components/Badge.tsx +125 -125
  11. package/src/components/Box.tsx +3 -3
  12. package/src/components/Button/index.tsx +16 -16
  13. package/src/components/Button/styledComponents.ts +290 -288
  14. package/src/components/ButtonGroup.tsx +484 -484
  15. package/src/components/Calendar/index.tsx +146 -146
  16. package/src/components/Calendar/styledComponents.ts +250 -250
  17. package/src/components/Card.tsx +48 -48
  18. package/src/components/CheckboxGroup.tsx +176 -176
  19. package/src/components/Container.tsx +39 -39
  20. package/src/components/Drawer/index.tsx +138 -138
  21. package/src/components/Drawer/styledComponents.ts +52 -52
  22. package/src/components/Dropdown.tsx +302 -302
  23. package/src/components/Filter.tsx +164 -164
  24. package/src/components/Flex.tsx +118 -118
  25. package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
  26. package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
  27. package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
  28. package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
  29. package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
  30. package/src/components/FormFields/BirthDateFormField.tsx +84 -84
  31. package/src/components/FormFields/CNPJFormField.tsx +87 -87
  32. package/src/components/FormFields/CPFFormField.tsx +78 -78
  33. package/src/components/FormFields/CalendarFormField.tsx +92 -92
  34. package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
  35. package/src/components/FormFields/EmailFormField.tsx +27 -27
  36. package/src/components/FormFields/Form.tsx +39 -39
  37. package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
  38. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  39. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  40. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  41. package/src/components/FormFields/RichEditorFormField.tsx +98 -98
  42. package/src/components/FormFields/SelectFormField.tsx +93 -93
  43. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  44. package/src/components/FormFields/TextAreaFormField.tsx +57 -57
  45. package/src/components/FormFields/TextFormField.tsx +112 -112
  46. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  47. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  48. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  49. package/src/components/FormFields/utils/validation.ts +23 -23
  50. package/src/components/Grid.tsx +137 -137
  51. package/src/components/Icon.tsx +47 -47
  52. package/src/components/MenuDropdown/index.tsx +38 -38
  53. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  54. package/src/components/Modal.tsx +90 -90
  55. package/src/components/MultiSelect/index.tsx +243 -243
  56. package/src/components/MultiSelect/styledComponents.ts +160 -158
  57. package/src/components/RadioGroup.tsx +210 -210
  58. package/src/components/RichEditor/QuillComponent.tsx +444 -431
  59. package/src/components/RichEditor/RichEditor.tsx +48 -48
  60. package/src/components/RichEditor/index.ts +2 -2
  61. package/src/components/RichEditor/styledComponents.ts +1151 -1150
  62. package/src/components/Section.tsx +33 -33
  63. package/src/components/Step.tsx +164 -164
  64. package/src/components/Switch.tsx +108 -108
  65. package/src/components/Text.tsx +38 -38
  66. package/src/components/TextField.tsx +372 -372
  67. package/src/components/TextareaField.tsx +127 -127
  68. package/src/components/TimePicker.tsx +328 -328
  69. package/src/components/Toast/components/ToastItem.tsx +41 -41
  70. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  71. package/src/components/Toast/hooks/useToast.ts +12 -12
  72. package/src/components/Toast/index.tsx +5 -5
  73. package/src/components/Toast/styles/index.ts +135 -135
  74. package/src/components/Toast/types/index.ts +46 -46
  75. package/src/components/Tooltip/index.tsx +66 -66
  76. package/src/components/Tooltip/styles.ts +77 -77
  77. package/src/hooks/useCountries.ts +41 -41
  78. package/src/hooks/useImageUpload.ts +139 -139
  79. package/src/hooks/useOnClickOutside.tsx +42 -42
  80. package/src/index.tsx +68 -68
  81. package/src/styles/index.ts +38 -38
  82. package/src/types/typographyValues.ts +178 -178
  83. package/src/utils/getNestedValue.ts +3 -3
  84. package/src/utils/states.ts +29 -29
  85. package/src/utils/uploadService.ts +180 -180
  86. package/tsconfig.json +3 -3
  87. package/tsup.config.ts +38 -38
  88. package/dist/QuillComponent-2YO26WOT.mjs +0 -458
  89. package/dist/QuillComponent-36H54CRL.mjs +0 -451
  90. package/dist/QuillComponent-A5KIFPCL.mjs +0 -438
  91. package/dist/QuillComponent-C2NXFWIZ.mjs +0 -459
  92. package/dist/QuillComponent-EIWPUIIH.mjs +0 -456
  93. package/dist/QuillComponent-FPVFLYUK.mjs +0 -448
  94. package/dist/QuillComponent-O5RSHCDS.mjs +0 -459
  95. package/dist/QuillComponent-PPWKGS74.mjs +0 -452
  96. package/dist/QuillComponent-QFVVQA6K.mjs +0 -459
  97. package/dist/QuillComponent-TLIZCM6V.mjs +0 -458
  98. package/dist/QuillComponent-ZLQ2VKPD.mjs +0 -457
  99. package/dist/chunk-TU7LKUXZ.mjs +0 -1927
package/dist/index.js CHANGED
@@ -1783,6 +1783,7 @@ var ButtonStyled = styled(import_themes2.Button, {
1783
1783
  color: "$$buttonOutlinedColor",
1784
1784
  border: "1px solid $$buttonOutlinedColor",
1785
1785
  backgroundColor: "$$buttonBgColor",
1786
+ boxShadow: "none",
1786
1787
  "&:disabled": {
1787
1788
  boxShadow: "none",
1788
1789
  borderColor: "$colors$neutral100",
@@ -1826,7 +1827,8 @@ var ButtonStyled = styled(import_themes2.Button, {
1826
1827
  variant: "contained",
1827
1828
  color: "brand",
1828
1829
  size: "medium",
1829
- fontWeight: "medium"
1830
+ fontWeight: "medium",
1831
+ outlinedBgColor: "transparent"
1830
1832
  }
1831
1833
  });
1832
1834
 
@@ -8183,7 +8185,7 @@ function Drawer({
8183
8185
  },
8184
8186
  children: [
8185
8187
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DrawerHeaderDiv, { children: [
8186
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, children: [
8188
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Flex2, { gap: 8, align: "center", children: [
8187
8189
  goBackIcon && goBackIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8188
8190
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DrawerHeaderTitle, { children: title })
8189
8191
  ] }),
@@ -9466,8 +9468,10 @@ var itemStyle = {
9466
9468
  }
9467
9469
  };
9468
9470
  var StyledItem2 = styled("div", __spreadValues({}, itemStyle));
9469
- var BadgeCloseBtn = styled("div", {
9470
- cursor: "pointer"
9471
+ var CloseBtnStyled = styled("button", {
9472
+ cursor: "pointer",
9473
+ background: "none",
9474
+ border: "none"
9471
9475
  });
9472
9476
  var StyledFlexWithMaxHeight = styled(Flex2, {
9473
9477
  variants: {
@@ -9734,13 +9738,13 @@ var MultiSelect = import_react16.default.forwardRef(
9734
9738
  css: { flexWrap: "wrap" },
9735
9739
  children: [
9736
9740
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
9737
- BadgeCloseBtn,
9741
+ CloseBtnStyled,
9738
9742
  {
9739
9743
  onClick: (e) => {
9740
9744
  e.stopPropagation();
9741
9745
  handleRemove(value);
9742
9746
  },
9743
- role: "button",
9747
+ type: "button",
9744
9748
  children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons3.faSquareXmark, size: "sm" })
9745
9749
  }
9746
9750
  ),
@@ -11308,7 +11312,8 @@ var QuillEditor = styled("div", {
11308
11312
  marginBottom: 0
11309
11313
  },
11310
11314
  "& h1": {
11311
- fontSize: "2em"
11315
+ fontSize: "2em",
11316
+ lineHeight: "2em!important"
11312
11317
  },
11313
11318
  "& h2": {
11314
11319
  fontSize: "1.5em"
@@ -12167,6 +12172,17 @@ var QuillComponent = ({
12167
12172
  const videoModalRef = (0, import_react20.useRef)(null);
12168
12173
  const linkModalRef = (0, import_react20.useRef)(null);
12169
12174
  const { addToast, removeToast } = useToast();
12175
+ const formatHTML = (html) => {
12176
+ const parser = new DOMParser();
12177
+ const doc = parser.parseFromString(html, "text/html");
12178
+ doc.querySelectorAll("h1").forEach((h1) => {
12179
+ h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
12180
+ });
12181
+ doc.querySelectorAll("img").forEach((img) => {
12182
+ img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
12183
+ });
12184
+ return doc.body.innerHTML;
12185
+ };
12170
12186
  const modules = simpleVersion ? {
12171
12187
  toolbar: [
12172
12188
  ["bold", "italic", "underline"],
@@ -12229,7 +12245,7 @@ var QuillComponent = ({
12229
12245
  const index = selection ? selection.index : quill.getLength();
12230
12246
  quill.insertEmbed(index, "image", uploadedFile.url);
12231
12247
  quill.setSelection(index + 1, 0);
12232
- onChange == null ? void 0 : onChange(quill.root.innerHTML);
12248
+ onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12233
12249
  } catch (error) {
12234
12250
  console.error("Erro no upload:", error);
12235
12251
  addToast({
@@ -12264,7 +12280,7 @@ var QuillComponent = ({
12264
12280
  quill.deleteText(maxLength, count - maxLength);
12265
12281
  return;
12266
12282
  }
12267
- onChange == null ? void 0 : onChange(quill.root.innerHTML);
12283
+ onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12268
12284
  onCharacterCountChange == null ? void 0 : onCharacterCountChange(count);
12269
12285
  }
12270
12286
  });
package/dist/index.mjs CHANGED
@@ -1668,6 +1668,7 @@ var ButtonStyled = styled(ButtonRadix, {
1668
1668
  color: "$$buttonOutlinedColor",
1669
1669
  border: "1px solid $$buttonOutlinedColor",
1670
1670
  backgroundColor: "$$buttonBgColor",
1671
+ boxShadow: "none",
1671
1672
  "&:disabled": {
1672
1673
  boxShadow: "none",
1673
1674
  borderColor: "$colors$neutral100",
@@ -1711,7 +1712,8 @@ var ButtonStyled = styled(ButtonRadix, {
1711
1712
  variant: "contained",
1712
1713
  color: "brand",
1713
1714
  size: "medium",
1714
- fontWeight: "medium"
1715
+ fontWeight: "medium",
1716
+ outlinedBgColor: "transparent"
1715
1717
  }
1716
1718
  });
1717
1719
 
@@ -8072,7 +8074,7 @@ function Drawer({
8072
8074
  },
8073
8075
  children: [
8074
8076
  /* @__PURE__ */ jsxs7(DrawerHeaderDiv, { children: [
8075
- /* @__PURE__ */ jsxs7(Flex2, { gap: 8, children: [
8077
+ /* @__PURE__ */ jsxs7(Flex2, { gap: 8, align: "center", children: [
8076
8078
  goBackIcon && goBackIcon && /* @__PURE__ */ jsx16(GoBackButtonStyled, { type: "button", onClick: goBackAction, children: goBackIcon }),
8077
8079
  /* @__PURE__ */ jsx16(DrawerHeaderTitle, { children: title })
8078
8080
  ] }),
@@ -9359,8 +9361,10 @@ var itemStyle = {
9359
9361
  }
9360
9362
  };
9361
9363
  var StyledItem2 = styled("div", __spreadValues({}, itemStyle));
9362
- var BadgeCloseBtn = styled("div", {
9363
- cursor: "pointer"
9364
+ var CloseBtnStyled = styled("button", {
9365
+ cursor: "pointer",
9366
+ background: "none",
9367
+ border: "none"
9364
9368
  });
9365
9369
  var StyledFlexWithMaxHeight = styled(Flex2, {
9366
9370
  variants: {
@@ -9627,13 +9631,13 @@ var MultiSelect = React9.forwardRef(
9627
9631
  css: { flexWrap: "wrap" },
9628
9632
  children: [
9629
9633
  /* @__PURE__ */ jsx26(
9630
- BadgeCloseBtn,
9634
+ CloseBtnStyled,
9631
9635
  {
9632
9636
  onClick: (e) => {
9633
9637
  e.stopPropagation();
9634
9638
  handleRemove(value);
9635
9639
  },
9636
- role: "button",
9640
+ type: "button",
9637
9641
  children: /* @__PURE__ */ jsx26(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
9638
9642
  }
9639
9643
  ),
@@ -11206,7 +11210,8 @@ var QuillEditor = styled("div", {
11206
11210
  marginBottom: 0
11207
11211
  },
11208
11212
  "& h1": {
11209
- fontSize: "2em"
11213
+ fontSize: "2em",
11214
+ lineHeight: "2em!important"
11210
11215
  },
11211
11216
  "& h2": {
11212
11217
  fontSize: "1.5em"
@@ -12065,6 +12070,17 @@ var QuillComponent = ({
12065
12070
  const videoModalRef = useRef8(null);
12066
12071
  const linkModalRef = useRef8(null);
12067
12072
  const { addToast, removeToast } = useToast();
12073
+ const formatHTML = (html) => {
12074
+ const parser = new DOMParser();
12075
+ const doc = parser.parseFromString(html, "text/html");
12076
+ doc.querySelectorAll("h1").forEach((h1) => {
12077
+ h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
12078
+ });
12079
+ doc.querySelectorAll("img").forEach((img) => {
12080
+ img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
12081
+ });
12082
+ return doc.body.innerHTML;
12083
+ };
12068
12084
  const modules = simpleVersion ? {
12069
12085
  toolbar: [
12070
12086
  ["bold", "italic", "underline"],
@@ -12127,7 +12143,7 @@ var QuillComponent = ({
12127
12143
  const index = selection ? selection.index : quill.getLength();
12128
12144
  quill.insertEmbed(index, "image", uploadedFile.url);
12129
12145
  quill.setSelection(index + 1, 0);
12130
- onChange == null ? void 0 : onChange(quill.root.innerHTML);
12146
+ onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12131
12147
  } catch (error) {
12132
12148
  console.error("Erro no upload:", error);
12133
12149
  addToast({
@@ -12162,7 +12178,7 @@ var QuillComponent = ({
12162
12178
  quill.deleteText(maxLength, count - maxLength);
12163
12179
  return;
12164
12180
  }
12165
- onChange == null ? void 0 : onChange(quill.root.innerHTML);
12181
+ onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12166
12182
  onCharacterCountChange == null ? void 0 : onCharacterCountChange(count);
12167
12183
  }
12168
12184
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.2.1",
3
+ "version": "12.2.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",