@lets-events/react 12.2.6 → 12.2.8

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @lets-events/react@12.2.6 build
3
+ > @lets-events/react@12.2.8 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@
10
10
  CLI Target: es6
11
11
  ESM Build start
12
12
  CJS Build start
13
- CJS dist/index.js 393.82 KB
14
- CJS ⚡️ Build success in 285ms
15
- ESM dist/index.mjs 379.87 KB
16
- ESM ⚡️ Build success in 286ms
13
+ CJS dist/index.js 394.03 KB
14
+ CJS ⚡️ Build success in 600ms
15
+ ESM dist/index.mjs 380.08 KB
16
+ ESM ⚡️ Build success in 602ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 5185ms
19
- DTS dist/index.d.mts 389.16 KB
20
- DTS dist/index.d.ts 389.16 KB
18
+ DTS ⚡️ Build success in 9746ms
19
+ DTS dist/index.d.mts 389.25 KB
20
+ DTS dist/index.d.ts 389.25 KB
21
21
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Calendar maxYearsFromNow and multiSelect close
8
+
9
+ ## 12.2.7
10
+
11
+ ### Patch Changes
12
+
13
+ - fix button background prop
14
+
3
15
  ## 12.2.6
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
@@ -1814,7 +1814,7 @@ var ButtonStyled = styled(import_themes2.Button, {
1814
1814
  outlinedBgColor: {
1815
1815
  neutral: {},
1816
1816
  transparent: {
1817
- backgroundColor: "transparent"
1817
+ $$buttonBgColor: "transparent"
1818
1818
  }
1819
1819
  },
1820
1820
  radii: {
@@ -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" : "" }),
@@ -12679,7 +12683,8 @@ var CalendarFormField = (_a) => {
12679
12683
  validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
12680
12684
  rules,
12681
12685
  onChange,
12682
- allowPastDates
12686
+ allowPastDates,
12687
+ maxYearsFromNow = 20
12683
12688
  } = _b, calendarProps = __objRest(_b, [
12684
12689
  "name",
12685
12690
  "label",
@@ -12688,7 +12693,8 @@ var CalendarFormField = (_a) => {
12688
12693
  "validationErrorMessage",
12689
12694
  "rules",
12690
12695
  "onChange",
12691
- "allowPastDates"
12696
+ "allowPastDates",
12697
+ "maxYearsFromNow"
12692
12698
  ]);
12693
12699
  const handleValidate = (0, import_react23.useCallback)(
12694
12700
  (value) => {
@@ -12735,7 +12741,8 @@ var CalendarFormField = (_a) => {
12735
12741
  handleCalendarChange(date);
12736
12742
  },
12737
12743
  hasError: haveError,
12738
- allowPastDates
12744
+ allowPastDates,
12745
+ maxYearsFromNow
12739
12746
  }, calendarProps)
12740
12747
  ),
12741
12748
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
package/dist/index.mjs CHANGED
@@ -1699,7 +1699,7 @@ var ButtonStyled = styled(ButtonRadix, {
1699
1699
  outlinedBgColor: {
1700
1700
  neutral: {},
1701
1701
  transparent: {
1702
- backgroundColor: "transparent"
1702
+ $$buttonBgColor: "transparent"
1703
1703
  }
1704
1704
  },
1705
1705
  radii: {
@@ -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" : "" }),
@@ -12577,7 +12581,8 @@ var CalendarFormField = (_a) => {
12577
12581
  validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
12578
12582
  rules,
12579
12583
  onChange,
12580
- allowPastDates
12584
+ allowPastDates,
12585
+ maxYearsFromNow = 20
12581
12586
  } = _b, calendarProps = __objRest(_b, [
12582
12587
  "name",
12583
12588
  "label",
@@ -12586,7 +12591,8 @@ var CalendarFormField = (_a) => {
12586
12591
  "validationErrorMessage",
12587
12592
  "rules",
12588
12593
  "onChange",
12589
- "allowPastDates"
12594
+ "allowPastDates",
12595
+ "maxYearsFromNow"
12590
12596
  ]);
12591
12597
  const handleValidate = useCallback5(
12592
12598
  (value) => {
@@ -12633,7 +12639,8 @@ var CalendarFormField = (_a) => {
12633
12639
  handleCalendarChange(date);
12634
12640
  },
12635
12641
  hasError: haveError,
12636
- allowPastDates
12642
+ allowPastDates,
12643
+ maxYearsFromNow
12637
12644
  }, calendarProps)
12638
12645
  ),
12639
12646
  /* @__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.6",
3
+ "version": "12.2.8",
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
+ }
@@ -270,7 +270,7 @@ export const ButtonStyled = styled(ButtonRadix, {
270
270
  outlinedBgColor: {
271
271
  neutral: {},
272
272
  transparent: {
273
- backgroundColor: "transparent",
273
+ $$buttonBgColor: "transparent",
274
274
  },
275
275
  },
276
276
  radii: {
@@ -25,6 +25,7 @@ export type CalendarProps = ComponentProps<typeof CalendarStyled> & {
25
25
  hasError?: boolean;
26
26
  expand?: boolean;
27
27
  allowPastDates?: boolean;
28
+ maxYearsFromNow?: number;
28
29
  };
29
30
 
30
31
  function formatToDateMask(value: string): string {
@@ -45,6 +46,7 @@ export function Calendar({
45
46
  hasError,
46
47
  expand,
47
48
  allowPastDates = false,
49
+ maxYearsFromNow = 20,
48
50
  ...props
49
51
  }: CalendarProps) {
50
52
  const [inputValue, setInputValue] = useState("");
@@ -56,7 +58,7 @@ export function Calendar({
56
58
  setShowCalendar(false);
57
59
  });
58
60
  const today = new Date();
59
- const maxDate = addYears(today, 20);
61
+ const maxDate = addYears(today, maxYearsFromNow);
60
62
 
61
63
  useEffect(() => {
62
64
  if (selected) {
@@ -20,6 +20,7 @@ export type CalendarFormFieldProps = Omit<
20
20
  "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled"
21
21
  >;
22
22
  allowPastDates?: boolean;
23
+ maxYearsFromNow?: number;
23
24
  };
24
25
 
25
26
  export const CalendarFormField = ({
@@ -31,6 +32,7 @@ export const CalendarFormField = ({
31
32
  rules,
32
33
  onChange,
33
34
  allowPastDates,
35
+ maxYearsFromNow = 20,
34
36
  ...calendarProps
35
37
  }: CalendarFormFieldProps) => {
36
38
  const handleValidate = useCallback(
@@ -83,6 +85,7 @@ export const CalendarFormField = ({
83
85
  }}
84
86
  hasError={haveError}
85
87
  allowPastDates={allowPastDates}
88
+ maxYearsFromNow={maxYearsFromNow}
86
89
  {...calendarProps}
87
90
  />
88
91
 
@@ -169,7 +169,7 @@ export const MultiSelect = React.forwardRef<HTMLDivElement, MultiSelectProps>(
169
169
  {selectedAllOptions && (
170
170
  <ButtonSelectAllStyled
171
171
  css={itemStyle}
172
- onClick={(e) => handleSelectAll(e)}
172
+ onClick={(e) => { handleSelectAll(e), setIsOpen(false) }}
173
173
  type="button"
174
174
  >
175
175
  <div className={allOptionsSelected ? "checked" : ""}></div>