@lets-events/react 12.2.7 → 12.2.9

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 (89) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.turbo/turbo-build.log +21 -19
  3. package/CHANGELOG.md +12 -0
  4. package/dist/index.d.mts +4 -2
  5. package/dist/index.d.ts +4 -2
  6. package/dist/index.js +18 -15
  7. package/dist/index.mjs +18 -15
  8. package/package.json +2 -2
  9. package/src/components/Alert.tsx +303 -303
  10. package/src/components/Avatar.tsx +55 -55
  11. package/src/components/Badge.tsx +125 -125
  12. package/src/components/Box.tsx +3 -3
  13. package/src/components/Button/index.tsx +16 -16
  14. package/src/components/Button/styledComponents.ts +300 -300
  15. package/src/components/ButtonGroup.tsx +484 -484
  16. package/src/components/Calendar/index.tsx +148 -146
  17. package/src/components/Calendar/styledComponents.ts +250 -250
  18. package/src/components/Card.tsx +48 -48
  19. package/src/components/CheckboxGroup.tsx +176 -176
  20. package/src/components/Container.tsx +39 -39
  21. package/src/components/Drawer/index.tsx +138 -138
  22. package/src/components/Drawer/styledComponents.ts +52 -52
  23. package/src/components/Dropdown.tsx +302 -302
  24. package/src/components/Filter.tsx +164 -164
  25. package/src/components/Flex.tsx +118 -118
  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 +95 -92
  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 +32 -32
  39. package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
  40. package/src/components/FormFields/PhoneFormField.tsx +40 -40
  41. package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
  42. package/src/components/FormFields/RichEditorFormField.tsx +102 -102
  43. package/src/components/FormFields/SelectFormField.tsx +93 -93
  44. package/src/components/FormFields/SwitchFormField.tsx +46 -46
  45. package/src/components/FormFields/TextAreaFormField.tsx +57 -57
  46. package/src/components/FormFields/TextFormField.tsx +112 -112
  47. package/src/components/FormFields/TimePickerFormField.tsx +88 -88
  48. package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
  49. package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
  50. package/src/components/FormFields/utils/validation.ts +23 -23
  51. package/src/components/Grid.tsx +137 -137
  52. package/src/components/Icon.tsx +47 -47
  53. package/src/components/MenuDropdown/index.tsx +38 -38
  54. package/src/components/MenuDropdown/styledComponents.ts +31 -31
  55. package/src/components/Modal.tsx +90 -90
  56. package/src/components/MultiSelect/index.tsx +243 -243
  57. package/src/components/MultiSelect/styledComponents.ts +160 -160
  58. package/src/components/RadioGroup.tsx +210 -210
  59. package/src/components/RichEditor/QuillComponent.tsx +455 -458
  60. package/src/components/RichEditor/RichEditor.tsx +49 -49
  61. package/src/components/RichEditor/index.ts +2 -2
  62. package/src/components/RichEditor/styledComponents.ts +1151 -1151
  63. package/src/components/Section.tsx +33 -33
  64. package/src/components/Step.tsx +164 -164
  65. package/src/components/Switch.tsx +108 -108
  66. package/src/components/Text.tsx +38 -38
  67. package/src/components/TextField.tsx +372 -372
  68. package/src/components/TextareaField.tsx +127 -127
  69. package/src/components/TimePicker.tsx +328 -328
  70. package/src/components/Toast/components/ToastItem.tsx +41 -41
  71. package/src/components/Toast/components/ToastProvider.tsx +63 -63
  72. package/src/components/Toast/hooks/useToast.ts +12 -12
  73. package/src/components/Toast/index.tsx +5 -5
  74. package/src/components/Toast/styles/index.ts +135 -135
  75. package/src/components/Toast/types/index.ts +46 -46
  76. package/src/components/Tooltip/index.tsx +66 -66
  77. package/src/components/Tooltip/styles.ts +77 -77
  78. package/src/hooks/useCountries.ts +41 -41
  79. package/src/hooks/useImageUpload.ts +139 -139
  80. package/src/hooks/useOnClickOutside.tsx +42 -42
  81. package/src/index.tsx +68 -68
  82. package/src/styles/index.ts +38 -38
  83. package/src/types/typographyValues.ts +178 -178
  84. package/src/utils/getNestedValue.ts +3 -3
  85. package/src/utils/states.ts +29 -29
  86. package/src/utils/uploadService.ts +180 -180
  87. package/tsconfig.json +3 -3
  88. package/tsup.config.ts +38 -38
  89. package/dist/index.css +0 -171
package/.eslintrc.json CHANGED
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "@lets-events/eslint-config"
1
+ {
2
+ "extends": "@lets-events/eslint-config"
3
3
  }
@@ -1,19 +1,21 @@
1
-
2
- > @lets-events/react@12.2.7 build
3
- > tsup src/index.tsx --format esm,cjs --dts --external react
4
-
5
- CLI Building entry: src/index.tsx
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.0
8
- CLI Using tsup config: C:\Users\cazuz\OneDrive\Desktop\Web\design-system\packages\react\tsup.config.ts
9
- CLI Target: es6
10
- ESM Build start
11
- CJS Build start
12
- CJS dist\index.js 393.82 KB
13
- CJS ⚡️ Build success in 950ms
14
- ESM dist\index.mjs 379.87 KB
15
- ESM ⚡️ Build success in 951ms
16
- DTS Build start
17
- DTS ⚡️ Build success in 5292ms
18
- DTS dist\index.d.mts 389.16 KB
19
- DTS dist\index.d.ts 389.16 KB
1
+
2
+
3
+ > @lets-events/react@12.2.9 build
4
+ > tsup src/index.tsx --format esm,cjs --dts --external react
5
+
6
+ CLI Building entry: src/index.tsx
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.0
9
+ CLI Using tsup config: /home/bia3003/Lets/design-system/packages/react/tsup.config.ts
10
+ CLI Target: es6
11
+ ESM Build start
12
+ CJS Build start
13
+ CJS dist/index.js 393.79 KB
14
+ CJS ⚡️ Build success in 326ms
15
+ ESM dist/index.mjs 379.85 KB
16
+ ESM ⚡️ Build success in 327ms
17
+ DTS Build start
18
+ DTS ⚡️ Build success in 6004ms
19
+ DTS dist/index.d.mts 389.25 KB
20
+ DTS dist/index.d.ts 389.25 KB
21
+ ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - RichEditor stylization
8
+
9
+ ## 12.2.8
10
+
11
+ ### Patch Changes
12
+
13
+ - Calendar maxYearsFromNow and multiSelect close
14
+
3
15
  ## 12.2.7
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -4673,8 +4673,9 @@ type CalendarProps = ComponentProps<typeof CalendarStyled> & {
4673
4673
  hasError?: boolean;
4674
4674
  expand?: boolean;
4675
4675
  allowPastDates?: boolean;
4676
+ maxYearsFromNow?: number;
4676
4677
  };
4677
- declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
4678
+ declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
4678
4679
 
4679
4680
  declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {}, {}, _stitches_react_types_css_util.CSS<{}, {
4680
4681
  colors: {
@@ -14759,8 +14760,9 @@ type CalendarFormFieldProps = Omit<CalendarProps, "selected" | "setSelected"> &
14759
14760
  validationErrorMessage?: string;
14760
14761
  rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
14761
14762
  allowPastDates?: boolean;
14763
+ maxYearsFromNow?: number;
14762
14764
  };
14763
- declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
14765
+ declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, maxYearsFromNow, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
14764
14766
 
14765
14767
  type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
14766
14768
  name: string;
package/dist/index.d.ts CHANGED
@@ -4673,8 +4673,9 @@ type CalendarProps = ComponentProps<typeof CalendarStyled> & {
4673
4673
  hasError?: boolean;
4674
4674
  expand?: boolean;
4675
4675
  allowPastDates?: boolean;
4676
+ maxYearsFromNow?: number;
4676
4677
  };
4677
- declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
4678
+ declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, maxYearsFromNow, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
4678
4679
 
4679
4680
  declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {}, {}, _stitches_react_types_css_util.CSS<{}, {
4680
4681
  colors: {
@@ -14759,8 +14760,9 @@ type CalendarFormFieldProps = Omit<CalendarProps, "selected" | "setSelected"> &
14759
14760
  validationErrorMessage?: string;
14760
14761
  rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
14761
14762
  allowPastDates?: boolean;
14763
+ maxYearsFromNow?: number;
14762
14764
  };
14763
- declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
14765
+ declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, maxYearsFromNow, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
14764
14766
 
14765
14767
  type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
14766
14768
  name: string;
package/dist/index.js CHANGED
@@ -7981,7 +7981,8 @@ function Calendar(_a) {
7981
7981
  position = "bottom",
7982
7982
  hasError,
7983
7983
  expand,
7984
- allowPastDates = false
7984
+ allowPastDates = false,
7985
+ maxYearsFromNow = 20
7985
7986
  } = _b, props = __objRest(_b, [
7986
7987
  "action",
7987
7988
  "actionText",
@@ -7991,7 +7992,8 @@ function Calendar(_a) {
7991
7992
  "position",
7992
7993
  "hasError",
7993
7994
  "expand",
7994
- "allowPastDates"
7995
+ "allowPastDates",
7996
+ "maxYearsFromNow"
7995
7997
  ]);
7996
7998
  const [inputValue, setInputValue] = (0, import_react7.useState)("");
7997
7999
  const [showContainer, setShowCalendar] = (0, import_react7.useState)(false);
@@ -8000,7 +8002,7 @@ function Calendar(_a) {
8000
8002
  setShowCalendar(false);
8001
8003
  });
8002
8004
  const today = /* @__PURE__ */ new Date();
8003
- const maxDate = addYears(today, 20);
8005
+ const maxDate = addYears(today, maxYearsFromNow);
8004
8006
  (0, import_react7.useEffect)(() => {
8005
8007
  if (selected) {
8006
8008
  setInputValue(format2(selected, "dd/MM/yyyy"));
@@ -9705,7 +9707,9 @@ var MultiSelect = import_react16.default.forwardRef(
9705
9707
  ButtonSelectAllStyled,
9706
9708
  {
9707
9709
  css: itemStyle,
9708
- onClick: (e) => handleSelectAll(e),
9710
+ onClick: (e) => {
9711
+ handleSelectAll(e), setIsOpen(false);
9712
+ },
9709
9713
  type: "button",
9710
9714
  children: [
9711
9715
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: allOptionsSelected ? "checked" : "" }),
@@ -12185,12 +12189,6 @@ var QuillComponent = ({
12185
12189
  const formatHTML = (html) => {
12186
12190
  const parser = new DOMParser();
12187
12191
  const doc = parser.parseFromString(html, "text/html");
12188
- doc.querySelectorAll("h1").forEach((h1) => {
12189
- h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
12190
- });
12191
- doc.querySelectorAll("img").forEach((img) => {
12192
- img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
12193
- });
12194
12192
  return doc.body.innerHTML;
12195
12193
  };
12196
12194
  const modules = simpleVersion ? {
@@ -12266,7 +12264,9 @@ var QuillComponent = ({
12266
12264
  const selection = quill.getSelection();
12267
12265
  const index = selection ? selection.index : quill.getLength();
12268
12266
  quill.insertEmbed(index, "image", uploadedFile.url);
12269
- quill.setSelection(index + 1, 0);
12267
+ quill.insertText(index + 1, "\n");
12268
+ quill.setSelection(index + 2, 0);
12269
+ quill.focus();
12270
12270
  onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12271
12271
  } catch (error) {
12272
12272
  console.error("Erro no upload:", error);
@@ -12276,7 +12276,7 @@ var QuillComponent = ({
12276
12276
  });
12277
12277
  }
12278
12278
  }),
12279
- [disabled, quill, addToast, removeToast, uploadConfig]
12279
+ [disabled, quill, addToast, removeToast, uploadConfig, onChange]
12280
12280
  );
12281
12281
  (0, import_react20.useEffect)(() => {
12282
12282
  if (quill && value) {
@@ -12679,7 +12679,8 @@ var CalendarFormField = (_a) => {
12679
12679
  validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
12680
12680
  rules,
12681
12681
  onChange,
12682
- allowPastDates
12682
+ allowPastDates,
12683
+ maxYearsFromNow = 20
12683
12684
  } = _b, calendarProps = __objRest(_b, [
12684
12685
  "name",
12685
12686
  "label",
@@ -12688,7 +12689,8 @@ var CalendarFormField = (_a) => {
12688
12689
  "validationErrorMessage",
12689
12690
  "rules",
12690
12691
  "onChange",
12691
- "allowPastDates"
12692
+ "allowPastDates",
12693
+ "maxYearsFromNow"
12692
12694
  ]);
12693
12695
  const handleValidate = (0, import_react23.useCallback)(
12694
12696
  (value) => {
@@ -12735,7 +12737,8 @@ var CalendarFormField = (_a) => {
12735
12737
  handleCalendarChange(date);
12736
12738
  },
12737
12739
  hasError: haveError,
12738
- allowPastDates
12740
+ allowPastDates,
12741
+ maxYearsFromNow
12739
12742
  }, calendarProps)
12740
12743
  ),
12741
12744
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
package/dist/index.mjs CHANGED
@@ -7870,7 +7870,8 @@ function Calendar(_a) {
7870
7870
  position = "bottom",
7871
7871
  hasError,
7872
7872
  expand,
7873
- allowPastDates = false
7873
+ allowPastDates = false,
7874
+ maxYearsFromNow = 20
7874
7875
  } = _b, props = __objRest(_b, [
7875
7876
  "action",
7876
7877
  "actionText",
@@ -7880,7 +7881,8 @@ function Calendar(_a) {
7880
7881
  "position",
7881
7882
  "hasError",
7882
7883
  "expand",
7883
- "allowPastDates"
7884
+ "allowPastDates",
7885
+ "maxYearsFromNow"
7884
7886
  ]);
7885
7887
  const [inputValue, setInputValue] = useState2("");
7886
7888
  const [showContainer, setShowCalendar] = useState2(false);
@@ -7889,7 +7891,7 @@ function Calendar(_a) {
7889
7891
  setShowCalendar(false);
7890
7892
  });
7891
7893
  const today = /* @__PURE__ */ new Date();
7892
- const maxDate = addYears(today, 20);
7894
+ const maxDate = addYears(today, maxYearsFromNow);
7893
7895
  useEffect3(() => {
7894
7896
  if (selected) {
7895
7897
  setInputValue(format2(selected, "dd/MM/yyyy"));
@@ -9598,7 +9600,9 @@ var MultiSelect = React9.forwardRef(
9598
9600
  ButtonSelectAllStyled,
9599
9601
  {
9600
9602
  css: itemStyle,
9601
- onClick: (e) => handleSelectAll(e),
9603
+ onClick: (e) => {
9604
+ handleSelectAll(e), setIsOpen(false);
9605
+ },
9602
9606
  type: "button",
9603
9607
  children: [
9604
9608
  /* @__PURE__ */ jsx26("div", { className: allOptionsSelected ? "checked" : "" }),
@@ -12083,12 +12087,6 @@ var QuillComponent = ({
12083
12087
  const formatHTML = (html) => {
12084
12088
  const parser = new DOMParser();
12085
12089
  const doc = parser.parseFromString(html, "text/html");
12086
- doc.querySelectorAll("h1").forEach((h1) => {
12087
- h1.setAttribute("style", `${h1.getAttribute("style") || ""}line-height: 2em;`);
12088
- });
12089
- doc.querySelectorAll("img").forEach((img) => {
12090
- img.setAttribute("style", `${img.getAttribute("style") || ""}max-width: 100%; height: auto; width: auto;`);
12091
- });
12092
12090
  return doc.body.innerHTML;
12093
12091
  };
12094
12092
  const modules = simpleVersion ? {
@@ -12164,7 +12162,9 @@ var QuillComponent = ({
12164
12162
  const selection = quill.getSelection();
12165
12163
  const index = selection ? selection.index : quill.getLength();
12166
12164
  quill.insertEmbed(index, "image", uploadedFile.url);
12167
- quill.setSelection(index + 1, 0);
12165
+ quill.insertText(index + 1, "\n");
12166
+ quill.setSelection(index + 2, 0);
12167
+ quill.focus();
12168
12168
  onChange == null ? void 0 : onChange(formatHTML(quill.root.innerHTML));
12169
12169
  } catch (error) {
12170
12170
  console.error("Erro no upload:", error);
@@ -12174,7 +12174,7 @@ var QuillComponent = ({
12174
12174
  });
12175
12175
  }
12176
12176
  }),
12177
- [disabled, quill, addToast, removeToast, uploadConfig]
12177
+ [disabled, quill, addToast, removeToast, uploadConfig, onChange]
12178
12178
  );
12179
12179
  useEffect6(() => {
12180
12180
  if (quill && value) {
@@ -12577,7 +12577,8 @@ var CalendarFormField = (_a) => {
12577
12577
  validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
12578
12578
  rules,
12579
12579
  onChange,
12580
- allowPastDates
12580
+ allowPastDates,
12581
+ maxYearsFromNow = 20
12581
12582
  } = _b, calendarProps = __objRest(_b, [
12582
12583
  "name",
12583
12584
  "label",
@@ -12586,7 +12587,8 @@ var CalendarFormField = (_a) => {
12586
12587
  "validationErrorMessage",
12587
12588
  "rules",
12588
12589
  "onChange",
12589
- "allowPastDates"
12590
+ "allowPastDates",
12591
+ "maxYearsFromNow"
12590
12592
  ]);
12591
12593
  const handleValidate = useCallback5(
12592
12594
  (value) => {
@@ -12633,7 +12635,8 @@ var CalendarFormField = (_a) => {
12633
12635
  handleCalendarChange(date);
12634
12636
  },
12635
12637
  hasError: haveError,
12636
- allowPastDates
12638
+ allowPastDates,
12639
+ maxYearsFromNow
12637
12640
  }, calendarProps)
12638
12641
  ),
12639
12642
  /* @__PURE__ */ jsx54(ErrorFormMessage, { message: errorMsg })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.2.7",
3
+ "version": "12.2.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -47,4 +47,4 @@
47
47
  "react-hook-form": "^7.57.0",
48
48
  "react-quilljs": "^2.0.5"
49
49
  }
50
- }
50
+ }