@popmenu/common-ui 0.121.0 → 0.121.1

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
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ButtonProps } from './ButtonProps';
3
3
  export declare const Button: {
4
- (props: ButtonProps): JSX.Element;
4
+ <C extends React.ElementType<any> = "button">(props: ButtonProps<C>): JSX.Element;
5
5
  displayName: string;
6
6
  };
@@ -1,10 +1,11 @@
1
1
  import { ButtonProps as MuiButtonProps } from '@material-ui/core/Button';
2
- import { RefObject } from 'react';
3
- export interface ButtonProps extends MuiButtonProps {
2
+ import React, { RefObject } from 'react';
3
+ export declare type ButtonProps<C extends React.ElementType = 'button'> = MuiButtonProps<C, {
4
+ component?: C;
5
+ }> & {
4
6
  ButtonRef?: RefObject<HTMLButtonElement>;
5
- component?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
6
7
  /** Sets loading state for Button. */
7
8
  loading?: boolean;
8
9
  /** Sets the text transformation property of a button. */
9
10
  textTransform?: 'uppercase' | 'lowercase' | 'capitalize' | 'none';
10
- }
11
+ };
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ChipProps } from './ChipProps';
3
3
  export declare const Chip: {
4
- (props: ChipProps): JSX.Element;
4
+ <C extends React.ElementType<any> = "div">(props: ChipProps<C>): JSX.Element;
5
5
  displayName: string;
6
6
  };
@@ -1,4 +1,8 @@
1
- import { ChipProps as MuiChipProps } from '@material-ui/core/Chip';
2
- export interface ChipProps extends MuiChipProps {
1
+ import React from 'react';
2
+ import { ChipProps as MuiChipProps, ChipTypeMap } from '@material-ui/core/Chip';
3
+ export declare type DefaultChipComponent = ChipTypeMap['defaultComponent'];
4
+ export declare type ChipProps<C extends React.ElementType = DefaultChipComponent> = MuiChipProps<C, {
5
+ component?: C;
6
+ }> & {
3
7
  severity?: 'success' | 'info' | 'warning' | 'error';
4
- }
8
+ };
@@ -1,2 +1,2 @@
1
1
  import { ChipProps } from './ChipProps';
2
- export declare const useChipStyles: (props: ChipProps) => import("@material-ui/styles").ClassNameMap<string>;
2
+ export declare const useChipStyles: (props: ChipProps<any>) => import("@material-ui/styles").ClassNameMap<string>;
@@ -1,3 +1,11 @@
1
1
  import React from 'react';
2
2
  import { LinkProps } from '@material-ui/core';
3
- export declare const Link: React.ForwardRefExoticComponent<Pick<LinkProps<"a", {}>, "className" | "style" | "classes" | "innerRef" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "noWrap" | "gutterBottom" | "paragraph" | "align" | "display" | "variant" | "variantMapping" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "TypographyClasses" | "underline"> & React.RefAttributes<HTMLAnchorElement>>;
3
+ interface LinkType {
4
+ <C extends React.ElementType = 'a'>(props: LinkProps<C> & {
5
+ component?: C;
6
+ }): React.ReactElement;
7
+ defaultProps?: Partial<LinkProps>;
8
+ displayName?: string;
9
+ }
10
+ export declare const Link: LinkType;
11
+ export {};
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { TypographyProps } from './TypographyProps';
3
3
  export declare const Typography: {
4
- (props: TypographyProps): JSX.Element;
4
+ <C extends React.ElementType<any> = "span">(props: TypographyProps<C>): JSX.Element;
5
5
  displayName: string;
6
6
  defaultProps: {
7
7
  variant: import("@material-ui/core").TypographyVariant;
@@ -1,13 +1,15 @@
1
- import { TypographyProps as MuiTypographyProps } from '@material-ui/core';
1
+ import { TypographyProps as MuiTypographyProps, TypographyTypeMap } from '@material-ui/core';
2
2
  import { Variant } from '@material-ui/core/styles/createTypography';
3
- import { RefObject } from 'react';
3
+ import React, { RefObject } from 'react';
4
4
  export declare type ThemeColors = 'primary.light' | 'primary' | 'primary.dark' | 'secondary.light' | 'secondary' | 'secondary.dark' | 'info.light' | 'info' | 'info.dark' | 'success.light' | 'success' | 'success.dark' | 'error.light' | 'error' | 'error.dark' | 'warning.light' | 'warning' | 'warning.dark' | 'white' | 'black' | 'grey.100' | 'grey.200' | 'grey.300' | 'grey.400' | 'grey.500' | 'grey.600' | 'grey.700' | 'grey.800' | 'grey.900' | 'textPrimary' | 'textSecondary';
5
5
  export declare const defaultTypographyProps: {
6
6
  variant: Variant;
7
7
  };
8
- export interface TypographyProps extends Omit<MuiTypographyProps, 'color' | 'ref'> {
8
+ export declare type DefaultTypographyComponent = TypographyTypeMap['defaultComponent'];
9
+ export declare type TypographyProps<C extends React.ElementType = DefaultTypographyComponent> = Omit<MuiTypographyProps<C, {
10
+ component?: C;
11
+ }>, 'color' | 'ref'> & {
9
12
  TypographyRef?: RefObject<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>;
10
13
  color?: ThemeColors;
11
- component?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
12
14
  weight?: 'regular' | 'medium' | 'semi-bold' | 'bold';
13
- }
15
+ };
package/build/index.es.js CHANGED
@@ -615,6 +615,8 @@ var getBorder = function (theme) { return function (props) {
615
615
  }
616
616
  return borderColor;
617
617
  }; };
618
+ // using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
619
+ // any component-specific props
618
620
  var useChipStyles = makeStyles$1(function (theme) { return ({
619
621
  root: {
620
622
  background: getBackground(theme),
@@ -862,6 +864,7 @@ var useLinkStyles = makeStyles$1(function (theme) { return ({
862
864
  },
863
865
  }); });
864
866
 
867
+ // eslint-disable-next-line react/display-name -- false positive
865
868
  var Link = forwardRef(function (props, ref) {
866
869
  var children = props.children, muiProps = __rest(props, ["children"]);
867
870
  var classes = useLinkStyles(props);