@ctlyst.id/internal-ui 5.4.5 → 5.4.7

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.
package/dist/index.d.mts CHANGED
@@ -15,9 +15,8 @@ import { GroupBase, Props as Props$1, DropdownIndicatorProps, ClearIndicatorProp
15
15
  import { AsyncPaginateProps } from 'react-select-async-paginate';
16
16
  import { AsyncCreatableProps } from 'react-select/async-creatable';
17
17
  import { CreatableProps } from 'react-select/creatable';
18
- import { ToastOptions } from 'react-toastify';
18
+ import { Id, ToastOptions, IconProps } from 'react-toastify';
19
19
  export { ToastContainer } from 'react-toastify';
20
- import { Id, ToastIcon } from 'react-toastify/dist/types';
21
20
  import { FileError, FileRejection } from 'react-dropzone';
22
21
  import * as axios from 'axios';
23
22
  import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
@@ -764,6 +763,7 @@ interface TimeInputProps {
764
763
  }
765
764
  declare const TimeInput: _chakra_ui_react.ComponentWithAs<"div", TimeInputProps>;
766
765
 
766
+ type ToastIcon = false | ((props: IconProps) => React.ReactNode) | React.ReactElement<IconProps>;
767
767
  interface CustomToastOptions extends Omit<ToastOptions, 'icon'> {
768
768
  icon?: ToastIcon;
769
769
  link?: {
package/dist/index.d.ts CHANGED
@@ -15,9 +15,8 @@ import { GroupBase, Props as Props$1, DropdownIndicatorProps, ClearIndicatorProp
15
15
  import { AsyncPaginateProps } from 'react-select-async-paginate';
16
16
  import { AsyncCreatableProps } from 'react-select/async-creatable';
17
17
  import { CreatableProps } from 'react-select/creatable';
18
- import { ToastOptions } from 'react-toastify';
18
+ import { Id, ToastOptions, IconProps } from 'react-toastify';
19
19
  export { ToastContainer } from 'react-toastify';
20
- import { Id, ToastIcon } from 'react-toastify/dist/types';
21
20
  import { FileError, FileRejection } from 'react-dropzone';
22
21
  import * as axios from 'axios';
23
22
  import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
@@ -764,6 +763,7 @@ interface TimeInputProps {
764
763
  }
765
764
  declare const TimeInput: _chakra_ui_react.ComponentWithAs<"div", TimeInputProps>;
766
765
 
766
+ type ToastIcon = false | ((props: IconProps) => React.ReactNode) | React.ReactElement<IconProps>;
767
767
  interface CustomToastOptions extends Omit<ToastOptions, 'icon'> {
768
768
  icon?: ToastIcon;
769
769
  link?: {
package/dist/index.js CHANGED
@@ -860,19 +860,18 @@ var import_jsx_runtime16 = require("react/jsx-runtime");
860
860
  var CheckboxComponent = (0, import_react13.forwardRef)(
861
861
  ({ isError = false, animated = false, helpText, errorText, boxProps, children, isDisabled, throttleTime, ...rest }, ref) => {
862
862
  const { state } = (0, import_react13.useCheckbox)(rest);
863
- const [isChecked, setIsChecked] = (0, import_react14.useState)(!!rest.isChecked);
864
- (0, import_react14.useEffect)(() => {
865
- setIsChecked(!!rest.isChecked);
866
- }, [rest.isChecked]);
867
863
  const throttleFn = (0, import_react14.useCallback)(
868
- throttle((val) => setIsChecked(val), throttleTime),
864
+ throttle((event) => {
865
+ var _a;
866
+ return (_a = rest.onChange) == null ? void 0 : _a.call(rest, event);
867
+ }, throttleTime),
869
868
  []
870
869
  );
871
870
  const handleOnChange = (0, import_react14.useCallback)(
872
871
  (event) => {
873
- if (throttleTime) throttleFn(event.target.checked);
874
- else setIsChecked(event.target.checked);
875
- if (rest.onChange) rest.onChange(event);
872
+ var _a;
873
+ if (throttleTime) throttleFn(event);
874
+ else (_a = rest.onChange) == null ? void 0 : _a.call(rest, event);
876
875
  },
877
876
  [rest.onChange]
878
877
  );
@@ -890,7 +889,7 @@ var CheckboxComponent = (0, import_react13.forwardRef)(
890
889
  variant,
891
890
  ref,
892
891
  ...rest,
893
- isChecked,
892
+ isChecked: rest.isChecked,
894
893
  onChange: handleOnChange,
895
894
  isDisabled,
896
895
  color: "white",
@@ -5906,7 +5905,7 @@ var styles_default2 = Styles2;
5906
5905
  var import_jsx_runtime65 = require("react/jsx-runtime");
5907
5906
  var CustomCloseButton = (props) => {
5908
5907
  const { closeToast } = props;
5909
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.Box, { p: 2, mb: 1, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_internal_icon11.Close, { size: 4, color: "white" }) });
5908
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.Box, { p: 2, mb: 1, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: () => closeToast(), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_internal_icon11.Close, { size: 4, color: "white" }) });
5910
5909
  };
5911
5910
  var DEFAULT_OPTIONS = {
5912
5911
  position: "top-right",
@@ -5940,7 +5939,7 @@ var useToast = () => {
5940
5939
  const content = (icon, message, link) => {
5941
5940
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
5942
5941
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(styles_default2, {}),
5943
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, children: [
5942
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, flex: 1, children: [
5944
5943
  /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { alignItems: "center", children: [
5945
5944
  icon && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.chakra.span, { mr: 2, w: 4, h: 4, children: renderIcon(icon, "default") }),
5946
5945
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.chakra.span, { noOfLines: 2, children: message })