react-asc 25.0.5 → 25.0.6

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 (47) hide show
  1. package/components/Alert/Alert.d.ts +4 -2
  2. package/components/AppBar/AppBar.d.ts +4 -2
  3. package/components/AppBar/AppBarTitle.d.ts +2 -1
  4. package/components/AutoComplete/AutoComplete.d.ts +1 -1
  5. package/components/Breadcrumb/Breadcrumb.d.ts +2 -1
  6. package/components/Button/ButtonContext.d.ts +1 -1
  7. package/components/Chip/Chip.d.ts +1 -1
  8. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +1 -1
  9. package/components/ExpansionPanel/ExpansionPanel.d.ts +2 -1
  10. package/components/ExpansionPanel/ExpansionPanelContent.d.ts +1 -1
  11. package/components/ExpansionPanel/ExpansionPanelHeader.d.ts +2 -1
  12. package/components/Form/Form.d.ts +2 -2
  13. package/components/Form/FormError.d.ts +1 -1
  14. package/components/Form/FormGroup.d.ts +1 -1
  15. package/components/Form/FormInput/FormInput.d.ts +2 -2
  16. package/components/Form/form.interfaces.d.ts +1 -1
  17. package/components/Form/form.models.d.ts +2 -2
  18. package/components/Icon/Icon.d.ts +3 -2
  19. package/components/List/ListItem.d.ts +1 -1
  20. package/components/List/ListItemText.d.ts +2 -1
  21. package/components/List/list.models.d.ts +2 -2
  22. package/components/Menu/Menu.d.ts +4 -3
  23. package/components/Menu/MenuBody.d.ts +4 -3
  24. package/components/Menu/MenuContext.d.ts +1 -1
  25. package/components/Menu/MenuItem.d.ts +1 -1
  26. package/components/Menu/MenuToggle.d.ts +1 -1
  27. package/components/Modal/GlobalModal.d.ts +3 -3
  28. package/components/Modal/Modal.d.ts +2 -2
  29. package/components/Modal/ModalBody.d.ts +1 -1
  30. package/components/Modal/modal.interfaces.d.ts +2 -2
  31. package/components/Modal/modal.service.d.ts +4 -4
  32. package/components/Select/Select.d.ts +1 -1
  33. package/components/Sidebar/Sidebar.d.ts +1 -1
  34. package/components/Snackbar/Snackbar.d.ts +2 -1
  35. package/components/SpeedDial/SpeedDialIcon.d.ts +2 -1
  36. package/components/Stepper/Step/Step.d.ts +2 -1
  37. package/components/Stepper/StepPanel/StepPanel.d.ts +1 -1
  38. package/components/Stepper/Stepper.d.ts +2 -2
  39. package/components/Table/Table.d.ts +1 -1
  40. package/components/Table/TableContext.d.ts +1 -1
  41. package/components/Tabs/Tab.d.ts +2 -1
  42. package/components/Tabs/TabContext.d.ts +1 -1
  43. package/components/Tabs/Tabs.d.ts +2 -2
  44. package/hooks/useDebounce.d.ts +1 -1
  45. package/index.es.js +4 -7
  46. package/index.js +4 -7
  47. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  import { VARIANT } from '../component.enums';
3
- import { COLOR, SIZE } from '../component.enums';
4
+ import type { SIZE } from '../component.enums';
5
+ import { COLOR } from '../component.enums';
4
6
  export interface IAlertProps extends React.ComponentProps<'div'> {
5
7
  children?: ReactNode;
6
8
  className?: string;
@@ -1,5 +1,7 @@
1
- import React, { ReactNode } from 'react';
2
- import { COLOR, SIZE } from '../component.enums';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ import type { SIZE } from '../component.enums';
4
+ import { COLOR } from '../component.enums';
3
5
  export interface IAppBarProps extends React.ComponentProps<'nav'> {
4
6
  children?: ReactNode;
5
7
  className?: string;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IAppBarTitleProps extends React.ComponentProps<'div'> {
3
4
  children?: ReactNode;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ISelectOption } from '../component.interfaces';
2
+ import type { ISelectOption } from '../component.interfaces';
3
3
  export interface IAutoCompleteProps {
4
4
  id?: string;
5
5
  name?: string;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IBreadcrumbProps extends React.ComponentProps<'nav'> {
3
4
  children?: ReactNode;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IButtonContext {
4
4
  color: COLOR | null;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IChipProps extends React.ComponentProps<'div'> {
4
4
  color?: COLOR;
5
5
  shadow?: boolean;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  interface IConditionalWrapperProps {
3
3
  condition: boolean;
4
4
  wrapper: (children: React.ReactNode) => JSX.Element;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IExpansionPanelProps {
3
4
  header: ReactNode;
4
5
  children: ReactNode;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface IExpansionPanelContentProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IExpansionPanelHeaderProps {
3
4
  onClick?: (event: React.MouseEvent) => void;
4
5
  children?: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import React, { Component } from 'react';
2
- import { IControls, IFormValues } from './form.interfaces';
3
- import { FormControl } from './form.models';
2
+ import type { IControls, IFormValues } from './form.interfaces';
3
+ import type { FormControl } from './form.models';
4
4
  export interface IFormProps {
5
5
  controls: IControls;
6
6
  validateOnBlur?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { IFormInputError } from './form.interfaces';
2
+ import type { IFormInputError } from './form.interfaces';
3
3
  interface IFormErrorProps {
4
4
  className?: string;
5
5
  errors?: IFormInputError[];
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IFormGroupProps {
3
3
  children?: ReactNode;
4
4
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { IFormInputOptions, IFormTextAreaOptions, IFormSelectOptions, IFormAutoCompleteOptions } from '../form.interfaces';
3
- import { IFormControlType } from '../form.types';
2
+ import type { IFormInputOptions, IFormTextAreaOptions, IFormSelectOptions, IFormAutoCompleteOptions } from '../form.interfaces';
3
+ import type { IFormControlType } from '../form.types';
4
4
  export interface IFormInputEvent {
5
5
  value: any;
6
6
  type?: string;
@@ -1,4 +1,4 @@
1
- import { FormControl } from './form.models';
1
+ import type { FormControl } from './form.models';
2
2
  export interface IControls {
3
3
  [key: string]: FormControl;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { IFormControlConfig, IFormInputError } from './form.interfaces';
2
- import { IFormControlType } from './form.types';
1
+ import type { IFormControlConfig, IFormInputError } from './form.interfaces';
2
+ import type { IFormControlType } from './form.types';
3
3
  export declare class FormControl {
4
4
  value: any;
5
5
  validators: string[];
@@ -1,5 +1,6 @@
1
- import React, { ComponentProps } from 'react';
2
- import { COLOR } from '../component.enums';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
3
+ import type { COLOR } from '../component.enums';
3
4
  export interface IIconProps extends ComponentProps<'div'> {
4
5
  iconColor?: COLOR;
5
6
  children?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COLOR } from '../component.enums';
2
+ import type { COLOR } from '../component.enums';
3
3
  export interface IListItemProps extends React.ComponentProps<'li'> {
4
4
  color?: COLOR;
5
5
  active?: boolean;
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  interface IListItemTextProps extends React.ComponentProps<'div'> {
3
4
  primary: ReactNode;
4
5
  secondary?: ReactNode;
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { IListItemProps } from './ListItem';
1
+ import type { ReactElement } from 'react';
2
+ import type { IListItemProps } from './ListItem';
3
3
  export declare class ListItemModel {
4
4
  constructor(dto: ReactElement<IListItemProps>);
5
5
  key: unknown;
@@ -1,6 +1,7 @@
1
- import React, { ReactElement } from 'react';
2
- import { MenuPosition } from './menu.types';
3
- import { IListItemProps } from '../List';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
3
+ import type { MenuPosition } from './menu.types';
4
+ import type { IListItemProps } from '../List';
4
5
  export interface IMenuProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
5
6
  toggle?: ReactElement;
6
7
  open?: boolean;
@@ -1,6 +1,7 @@
1
- import React, { ReactElement } from 'react';
2
- import { MenuPosition } from './menu.types';
3
- import { IListItemProps } from '../List';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
3
+ import type { MenuPosition } from './menu.types';
4
+ import type { IListItemProps } from '../List';
4
5
  export interface IMenuBodyProps {
5
6
  children?: ReactElement<IListItemProps> | ReactElement<IListItemProps>[];
6
7
  className?: string;
@@ -1,4 +1,4 @@
1
- import { Context, Dispatch } from 'react';
1
+ import type { Context, Dispatch } from 'react';
2
2
  export interface IMenuContext {
3
3
  isShow: boolean;
4
4
  setIsShow: Dispatch<boolean>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { IListItemProps } from '../List';
2
+ import type { IListItemProps } from '../List';
3
3
  export declare const MenuItem: (props: IListItemProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IMenuToggleProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,8 +1,8 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  import { SIZE } from '../component.enums';
3
- import { IControls, IFormValues } from '../Form';
3
+ import type { IControls, IFormValues } from '../Form';
4
4
  import { MODALTYPE } from './modal.enum';
5
- import { IModalButton } from './modal.interfaces';
5
+ import type { IModalButton } from './modal.interfaces';
6
6
  interface IModalProps {
7
7
  title?: string;
8
8
  description?: string | ReactElement;
@@ -1,5 +1,5 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- import { SIZE } from '../component.enums';
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { SIZE } from '../component.enums';
3
3
  export interface IModalProps {
4
4
  target?: HTMLElement;
5
5
  className?: string;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  interface IModalBodyProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { COLOR, VARIANT } from '../component.enums';
2
- import { MODALBUTTONTYPE } from './modal.enum';
1
+ import type { COLOR, VARIANT } from '../component.enums';
2
+ import type { MODALBUTTONTYPE } from './modal.enum';
3
3
  export interface IModalButton {
4
4
  label: string;
5
5
  variant?: VARIANT;
@@ -1,7 +1,7 @@
1
- import { IControls } from '../Form';
2
- import { ReactElement } from 'react';
3
- import { IModalButton } from './modal.interfaces';
4
- import { SIZE } from '../component.enums';
1
+ import type { IControls } from '../Form';
2
+ import type { ReactElement } from 'react';
3
+ import type { IModalButton } from './modal.interfaces';
4
+ import type { SIZE } from '../component.enums';
5
5
  export interface IModalService {
6
6
  show(title: string, description: string | ReactElement, options?: IModalOptions): Promise<void>;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ISelectOption } from '../component.interfaces';
2
+ import type { ISelectOption } from '../component.interfaces';
3
3
  export interface ISelectProps {
4
4
  id?: string;
5
5
  name?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ISidebarItem } from './sidebar.interfaces';
2
+ import type { ISidebarItem } from './sidebar.interfaces';
3
3
  interface ISidebarProps extends React.ComponentProps<'nav'> {
4
4
  items: ISidebarItem[];
5
5
  currentUrl: string;
@@ -1,4 +1,5 @@
1
- import React, { ComponentProps } from 'react';
1
+ import type { ComponentProps } from 'react';
2
+ import React from 'react';
2
3
  import { COLOR } from '../component.enums';
3
4
  export interface ISnackbarProps extends ComponentProps<'div'> {
4
5
  color?: COLOR;
@@ -1,4 +1,5 @@
1
- import React, { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
+ import React from 'react';
2
3
  export interface ISpeedDialIconProps extends React.DetailedHTMLProps<React.HtmlHTMLAttributes<HTMLDivElement>, HTMLDivElement> {
3
4
  openIcon?: ReactElement;
4
5
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface IStepProps {
3
4
  value: string;
4
5
  index?: number;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  export interface IStepPanelProps {
3
3
  children?: ReactNode;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { IStepProps } from './Step';
1
+ import type { ReactElement } from 'react';
2
+ import type { IStepProps } from './Step';
3
3
  export interface IStepperProps {
4
4
  children?: ReactElement<IStepProps> | ReactElement<IStepProps>[];
5
5
  isLinear?: boolean;
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  export interface ITableProps {
3
3
  children?: ReactElement | ReactElement[];
4
4
  className?: string;
@@ -1,4 +1,4 @@
1
- import { Context } from 'react';
1
+ import type { Context } from 'react';
2
2
  export interface ITableContext {
3
3
  variant: 'head' | 'body';
4
4
  }
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  export interface ITabProps {
3
4
  label: ReactNode;
4
5
  value: string;
@@ -1,4 +1,4 @@
1
- import { Context, Dispatch } from 'react';
1
+ import type { Context, Dispatch } from 'react';
2
2
  export interface ITabsContext {
3
3
  fixed?: boolean;
4
4
  selectedValue?: string;
@@ -1,6 +1,6 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  import { COLOR } from '../component.enums';
3
- import { ITabProps } from './Tab';
3
+ import type { ITabProps } from './Tab';
4
4
  export interface ITabsProps {
5
5
  color?: COLOR;
6
6
  indicatorColor?: COLOR;
@@ -1,2 +1,2 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  export declare function useDebounce(callback: () => void, timeout: number, deps: React.DependencyList): void;
package/index.es.js CHANGED
@@ -235,12 +235,9 @@ function useDebounce(callback, timeout, deps) {
235
235
  }
236
236
 
237
237
  const useConstructor = (callBack) => {
238
- const [hasBeenCalled, setHasBeenCalled] = useState(false);
239
- if (hasBeenCalled) {
240
- return;
241
- }
242
- callBack();
243
- setHasBeenCalled(true);
238
+ useEffect(() => {
239
+ callBack();
240
+ }, []);
244
241
  };
245
242
 
246
243
  function useCssClasses(cssClasses) {
@@ -879,7 +876,7 @@ const CssTransition = (props) => {
879
876
  };
880
877
  useEffect(() => {
881
878
  if (isShow !== undefined && (isShow === true || isShow === false)) {
882
- renderAnimation(isShow);
879
+ void renderAnimation(isShow);
883
880
  }
884
881
  }, [isShow]);
885
882
  const getCssClasses = () => {
package/index.js CHANGED
@@ -244,12 +244,9 @@ function useDebounce(callback, timeout, deps) {
244
244
  }
245
245
 
246
246
  const useConstructor = (callBack) => {
247
- const [hasBeenCalled, setHasBeenCalled] = React.useState(false);
248
- if (hasBeenCalled) {
249
- return;
250
- }
251
- callBack();
252
- setHasBeenCalled(true);
247
+ React.useEffect(() => {
248
+ callBack();
249
+ }, []);
253
250
  };
254
251
 
255
252
  function useCssClasses(cssClasses) {
@@ -888,7 +885,7 @@ const CssTransition = (props) => {
888
885
  };
889
886
  React.useEffect(() => {
890
887
  if (isShow !== undefined && (isShow === true || isShow === false)) {
891
- renderAnimation(isShow);
888
+ void renderAnimation(isShow);
892
889
  }
893
890
  }, [isShow]);
894
891
  const getCssClasses = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.0.5",
3
+ "version": "25.0.6",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",