@inntechcorp/it-design 3.1.13 → 3.1.15

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
@@ -659,7 +659,7 @@ export { default as ImageCropper } from './cropper';
659
659
  * COMPONENTS (HAS SUB COMPONENTS)
660
660
  */
661
661
  export { default as Collapse } from './collapse';
662
- export { default as ModalManager } from './modal';
662
+ export { default as ModalManager, useModal, useModalState, useModalFull } from './modal';
663
663
  export { default as Notification } from './notification';
664
664
  export { default as Radio } from './radio';
665
665
  export { default as InlineSelect } from './inlineselect';
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { ModalProps as ModalProps$1 } from 'types/ModalProps';
10
10
  import { RadioButtonProps as RadioButtonProps$1, RadioGroupProps as RadioGroupProps$1 } from 'types/RadioProps';
11
11
  import { ITDImperativeFuncProps as ITDImperativeFuncProps$1 } from 'types/ITDImperativeFuncProps';
12
12
  import { ResultProps as ResultProps$1 } from 'types/ResultProps';
13
+ import { NavLinkProps } from 'react-router-dom';
13
14
 
14
15
  type ITDContextType = {
15
16
  theme: string;
@@ -407,7 +408,7 @@ type InlineSVGCachedProps = {
407
408
  onLoaded?: () => void;
408
409
  onError?: (error: unknown) => void;
409
410
  };
410
- declare const _default$5: react.MemoExoticComponent<({ src, className, style, title, role, onLoaded, onError }: InlineSVGCachedProps) => react_jsx_runtime.JSX.Element>;
411
+ declare const _default$4: react.MemoExoticComponent<({ src, className, style, title, role, onLoaded, onError }: InlineSVGCachedProps) => react_jsx_runtime.JSX.Element>;
411
412
 
412
413
  type OptionsTypeProps = {
413
414
  customKey?: string;
@@ -419,13 +420,13 @@ type OptionsTypeProps = {
419
420
  checked?: boolean;
420
421
  onChange?: (value: SelectValue$1, checked: boolean, label: ChildrenProps$1) => null;
421
422
  };
422
- declare const _default$4: react.MemoExoticComponent<{
423
+ declare const _default$3: react.MemoExoticComponent<{
423
424
  ({ multi, checked, icon, image, value, customKey, onChange, label }: OptionsTypeProps): react_jsx_runtime.JSX.Element;
424
425
  displayName: string;
425
426
  }>;
426
427
 
427
428
  type SelectSubComponentProps = {
428
- Option: typeof _default$4;
429
+ Option: typeof _default$3;
429
430
  };
430
431
  type SelectComponentProps = ForwardRefExoticComponent<PropsWithoutRef<SelectProps> & RefAttributes<ITDImperativeFuncProps>> & SelectSubComponentProps;
431
432
  declare const Select: SelectComponentProps;
@@ -637,33 +638,28 @@ declare namespace Collapse {
637
638
  export { Panel };
638
639
  }
639
640
 
640
- type ModalContextType = {
641
+ type ModalActionsContextType = {
641
642
  /**
642
643
  * Opens a new modal with the provided information of the modal to be opened.
643
- *
644
644
  * @param data Contains the desired parameters for opening a new modal `ModalProps`.
645
- * @returns
646
645
  */
647
646
  showModal: (data: ModalProps$1) => void;
648
647
  /**
649
648
  * Dismisses the currently open modal with the ID of the modal to be hidden.
650
- *
651
649
  * @param id ID of the modal to be hide.
652
- * @returns
653
650
  */
654
651
  hideModal: (id: string) => void;
655
652
  /**
656
653
  * Dismisses the currently open modal with the ID of the modal to be closed.
657
- *
658
654
  * @param id ID of the modal to be dismissed.
659
- * @returns
660
655
  */
661
656
  removeModal: (id: string) => void;
662
657
  /**
663
- *
664
- * @returns
658
+ * Removes all open modals.
665
659
  */
666
660
  removeAllModals: () => void;
661
+ };
662
+ type ModalStateContextType = {
667
663
  /**
668
664
  * Triggered whenever any event related to modals occurs.
669
665
  */
@@ -673,15 +669,34 @@ type ModalContextType = {
673
669
  };
674
670
  /**
675
671
  * Returns whether a modal is visible or not.
676
- *
677
672
  * @param id The visibility information of the desired modal with its ID.
678
- * @returns
679
673
  */
680
674
  isVisible: (id: string) => boolean;
681
675
  };
676
+ type ModalContextType = ModalActionsContextType & ModalStateContextType;
682
677
 
678
+ /**
679
+ * Use modal actions only (stable - won't cause rerenders on modal state changes)
680
+ * This is the recommended hook for most use cases.
681
+ * @returns showModal, hideModal, removeModal, removeAllModals
682
+ */
683
+ declare const useModal: () => ModalActionsContextType;
684
+ /**
685
+ * Use modal state (dynamic - will rerender on modal events)
686
+ * Only use this if you need to react to modal state changes.
687
+ * @returns modalEvent, isVisible
688
+ */
689
+ declare const useModalState: () => ModalStateContextType;
690
+ /**
691
+ * Use both modal actions and state (legacy - will rerender on modal events)
692
+ * @deprecated Use useModal() for actions and useModalState() for state separately
693
+ * @returns All modal context values
694
+ */
695
+ declare const useModalFull: () => ModalContextType;
683
696
  declare const ModalManager: {
684
- useModal: () => ModalContextType;
697
+ useModal: () => ModalActionsContextType;
698
+ useModalState: () => ModalStateContextType;
699
+ useModalFull: () => ModalContextType;
685
700
  };
686
701
 
687
702
  type NotificationContextType = {
@@ -695,15 +710,15 @@ declare const Notification: {
695
710
 
696
711
  declare function RadioButton({ id, name, value, type, buttonProps, checked, hasError, disabled, children, icon, image, component, onChange, }: RadioButtonProps$1): react_jsx_runtime.JSX.Element;
697
712
 
698
- declare const _default$3: react__default.NamedExoticComponent<RadioGroupProps$1 & react__default.RefAttributes<ITDImperativeFuncProps$1>>;
713
+ declare const _default$2: react__default.NamedExoticComponent<RadioGroupProps$1 & react__default.RefAttributes<ITDImperativeFuncProps$1>>;
699
714
 
700
715
  interface RadioComponent extends React.FC {
701
- Group: typeof _default$3;
716
+ Group: typeof _default$2;
702
717
  Button: typeof RadioButton;
703
718
  }
704
719
  declare const Radio: RadioComponent;
705
720
 
706
- declare const _default$2: react__default.MemoExoticComponent<({ value, checked, single, onChange, children }: {
721
+ declare const _default$1: react__default.MemoExoticComponent<({ value, checked, single, onChange, children }: {
707
722
  value?: string | undefined;
708
723
  checked?: boolean | undefined;
709
724
  single?: boolean | undefined;
@@ -721,7 +736,7 @@ declare function InlineSelect({ label, value, children, single, minWidth, classN
721
736
  onChange?: null | undefined;
722
737
  }): react_jsx_runtime.JSX.Element;
723
738
  declare namespace InlineSelect {
724
- export { _default$2 as Option };
739
+ export { _default$1 as Option };
725
740
  }
726
741
 
727
742
  interface ImageProps extends react__default.ImgHTMLAttributes<HTMLImageElement> {
@@ -733,7 +748,7 @@ interface ImageProps extends react__default.ImgHTMLAttributes<HTMLImageElement>
733
748
  onLoad?: () => void;
734
749
  onError?: () => void;
735
750
  }
736
- declare const _default$1: react__default.NamedExoticComponent<ImageProps>;
751
+ declare const _default: react__default.NamedExoticComponent<ImageProps>;
737
752
 
738
753
  declare namespace ConsoleLog {
739
754
  export { single };
@@ -756,7 +771,13 @@ declare const Result: {
756
771
  displayName: string;
757
772
  };
758
773
 
759
- declare const _default: react.MemoExoticComponent<(props: any) => react_jsx_runtime.JSX.Element>;
774
+ interface ALinkProps extends Omit<NavLinkProps, 'to'> {
775
+ to: string;
776
+ children?: ReactNode;
777
+ className?: string;
778
+ style?: React.CSSProperties;
779
+ }
780
+ declare const ALink: react.NamedExoticComponent<ALinkProps>;
760
781
 
761
782
  interface ISpin {
762
783
  updating?: boolean;
@@ -2323,5 +2344,5 @@ declare const resources: {
2323
2344
  };
2324
2345
  };
2325
2346
 
2326
- export { _default as ALink, Accordion, AddDefaultThemeStyle, AddDefaultUnit, AddZero, Alert, Arrow as ArrowIcon, BackToTop, BackTop, Base64Decode, Base64Encode, Button, Calendar, Card, CheckFileURL, Checkbox, Checkmark, ChunkArray, Collapse, ComponentPositions, ComponentSizes, ComponentSizesSlug, ConnectionStatus, ConsoleLog, ConvertCurrency, DatePicker, DetermineNewHeight, DetermineNewWidth, FileChecker, FileExtensions, FileTypes, FindSelector, Flex, Form, FormValidationTypes, FormatBytes, FormatDate, FormatDateTime, FormatSimpleDate, FormatSimpleDateTime, FormatTime, GetByCurrency, GetCountryCodeByCurrencyCode, GetCountryCodeByLanguage, GetCurrencyFormat, GetCurrencySymbol, GetDecimalByCurrency, GetTypeByFileType, H1, H2, H3, H4, ITDContext, ITDProvider, _default$1 as Image, ImageCropper, _default$5 as InlineSVGCached, InlineSelect, InlineSelectArrow, Input, IsValidJSON, Lock as LockIcon, ModalManager, ModalState, NoData, Notification, Picture, Progress, Radio, RemoveUnits, Result, SVGLoader, Select, Spin, Status, Switch, Table, Tabs, TextArea, TinyScrollbar, Trash, UniUpperCase, UpdateThemeStyle, Upload, Upload$1 as UploadIcon, Wait, ZoomIn, ZoomOut, resources, toKebabCase, useAddExternalCSS, useAvoidCollision, useComponentSize, useConnectionStatus, useConstructor, useContextBridge, useCoreFetch, useKeyboardShortcut, useMultiQuery, useOnClickOutside, useOnESCKeyDown, useOnResize, useOrientation, useReCaptcha, useSingleQuery };
2347
+ export { ALink, Accordion, AddDefaultThemeStyle, AddDefaultUnit, AddZero, Alert, Arrow as ArrowIcon, BackToTop, BackTop, Base64Decode, Base64Encode, Button, Calendar, Card, CheckFileURL, Checkbox, Checkmark, ChunkArray, Collapse, ComponentPositions, ComponentSizes, ComponentSizesSlug, ConnectionStatus, ConsoleLog, ConvertCurrency, DatePicker, DetermineNewHeight, DetermineNewWidth, FileChecker, FileExtensions, FileTypes, FindSelector, Flex, Form, FormValidationTypes, FormatBytes, FormatDate, FormatDateTime, FormatSimpleDate, FormatSimpleDateTime, FormatTime, GetByCurrency, GetCountryCodeByCurrencyCode, GetCountryCodeByLanguage, GetCurrencyFormat, GetCurrencySymbol, GetDecimalByCurrency, GetTypeByFileType, H1, H2, H3, H4, ITDContext, ITDProvider, _default as Image, ImageCropper, _default$4 as InlineSVGCached, InlineSelect, InlineSelectArrow, Input, IsValidJSON, Lock as LockIcon, ModalManager, ModalState, NoData, Notification, Picture, Progress, Radio, RemoveUnits, Result, SVGLoader, Select, Spin, Status, Switch, Table, Tabs, TextArea, TinyScrollbar, Trash, UniUpperCase, UpdateThemeStyle, Upload, Upload$1 as UploadIcon, Wait, ZoomIn, ZoomOut, resources, toKebabCase, useAddExternalCSS, useAvoidCollision, useComponentSize, useConnectionStatus, useConstructor, useContextBridge, useCoreFetch, useKeyboardShortcut, useModal, useModalFull, useModalState, useMultiQuery, useOnClickOutside, useOnESCKeyDown, useOnResize, useOrientation, useReCaptcha, useSingleQuery };
2327
2348
  export type { AccordionItemProps, AccordionProps, AccordionSubMenuProps, AlertProps, AlertSize, AlertType, ButtonProps, ButtonState, ButtonType, ButtonVariant, CalendarDayProps, CalendarProps, CalendarValueProps, CardProps, CheckboxEvent, CheckboxGroupProps, CheckboxProps, CropArea, CropSettings, DatePickerProps, Direction, FieldUpdateProps, FlexAlignProps, FlexGapProps, FlexJustifyProps, FlexProps, FormContextType, FormItemProps, FormProps, FormRuleProps, FormSubComponentProps, FormValueProps, GroupCheckboxOptionType, ITDContextType, ITDImperativeFuncProps, ITDProviderProps, ITDSize, ITDSizeSlug, ImageCropperProps, ImageCropperRef, InputProps, InputVariant, ModalContentProps, ModalProps, ModalRefProps, NotificationContextType, NotificationsProps, ProgressProps, ProgressStatus, QueryValueProps, RadioButtonProps, RadioGroupProps, RadioType, ResultProps, SelectDirection, SelectOptionProps, SelectPosition, SelectProps, SelectToggleProps, SelectValue, SelectVariant, SingleQueryProps, StatusProps, StatusVariant, SwitchProps, TableColumnType, TableProps, TableRefProps, TableRow, TableTRProps, TabsItemProps, TabsProps, TextAreaEvent, TextAreaProps, TextAreaVariant, UploadProgressProps, UploadProps, UploadResultMessageProps };