@popmenu/common-ui 0.7.6 → 0.11.0

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,13 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { CollapsibleTextProps } from './CollapsibleTextProps';
3
3
  export declare const CollapsibleText: FC<CollapsibleTextProps>;
4
- /**
5
- * measure typography to determine if section should be expandable.
6
- * use typography values to determine open/closed height.
7
- * tweak overlay visibility
8
- * externalize toggle button
9
- *
10
- * if it's open (or !in)
11
- * 1. then don't show overlay
12
- * 2.
13
- */
@@ -1,7 +1,12 @@
1
1
  export interface CollapsibleTextProps {
2
- previewLines: number;
3
2
  text: string;
4
- typographyVariant: 'body1' | 'body2';
5
3
  open: boolean;
6
- canCollapse?: (banana: boolean) => void;
4
+ previewLines?: number;
5
+ typographyVariant?: 'body1' | 'body2';
6
+ collapsible: boolean;
7
+ setCollapsible: (collapsible: boolean) => void;
8
+ }
9
+ export interface DefaultCollapsibleTextProps extends CollapsibleTextProps {
10
+ previewLines: number;
11
+ typographyVariant: 'body1' | 'body2';
7
12
  }
@@ -0,0 +1,4 @@
1
+ import { DefaultCollapsibleTextProps } from './CollapsibleTextProps';
2
+ export declare const useCollapsibleTextStyles: (props: DefaultCollapsibleTextProps & {
3
+ fadeStop?: string | number | undefined;
4
+ }) => import("@material-ui/styles").ClassNameMap<string>;
@@ -1,7 +1,9 @@
1
- import { TypographyProps } from '..';
2
- declare type Colors = 'primary.main' | 'primary.dark' | 'primary.light' | 'secondary.main' | 'secondary.dark' | 'secondary.light' | 'info.main' | 'info.dark' | 'info.light' | 'error.main' | 'error.dark' | 'error.light' | 'success.main' | 'success.dark' | 'success.light' | 'warning.main' | 'warning.dark' | 'warning.light';
1
+ import { TypographyProps } from '../Typography';
2
+ declare type Colors = 'primary.main' | 'primary.dark' | 'primary.light' | 'secondary.main' | 'secondary.dark' | 'secondary.light';
3
3
  export interface DividerProps {
4
- /** Sets the color of the divider line */
4
+ /** Sets the styles for a divider. */
5
+ className?: string;
6
+ /** Sets the color of the divider line. */
5
7
  dividerColor?: Colors | string;
6
8
  /** A message shown in the center of the divider */
7
9
  text?: string;
@@ -1,10 +1,4 @@
1
- import React from 'react';
1
+ import { VoidFunctionComponent } from 'react';
2
2
  import { IconProps } from './IconProps';
3
- /**
4
- * Adding new icons.
5
- * 1. If not part of the material-ui library, put the svg file in app/javascript/admin/common/assets/
6
- * 2. Update the iconDictionary at ./iconDictionary
7
- * 3. Add the icon name to Icon.propTypes
8
- */
9
- export declare const IconStaticClassName = "mep-icon-svg";
10
- export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
3
+ export declare const iconStaticClassName = "pop-icon";
4
+ export declare const Icon: VoidFunctionComponent<IconProps>;
@@ -1,11 +1,11 @@
1
- import { IconNames } from './iconDictionary';
1
+ import React from 'react';
2
2
  export interface IconProps {
3
- /** Applies to the html class attribute. */
3
+ /** Sets to the class attribute for the html element */
4
4
  className?: string;
5
- /** Sets the color of an icon */
6
- color?: 'primary.light' | 'primary' | 'primary.dark' | 'secondary.light' | 'secondary' | 'secondary.dark' | 'info' | 'error' | 'warning' | 'success' | 'inherit';
7
- /** Sets which icon to display */
8
- name: IconNames;
9
- /** Sets the size of the icon */
10
- size?: 'small' | 'medium' | 'large';
5
+ /** The icon from @popmenu/web-icons to be rendered */
6
+ icon: string | React.FC<React.SVGProps<SVGSVGElement>>;
7
+ /** Sets the color of the icon */
8
+ color?: 'primary' | 'secondary' | 'primary.light' | 'primary.dark' | 'secondary.light' | 'secondary.dark' | string;
9
+ /** Sets the dimensions of the icon */
10
+ size?: 'small' | 'medium' | 'large' | 'extra-large' | 'inherit';
11
11
  }
@@ -1,3 +1,2 @@
1
- export { Icon as default } from './Icon';
2
- export { iconDictionary, IconNames } from './iconDictionary';
1
+ export { Icon as default, iconStaticClassName } from './Icon';
3
2
  export { IconProps } from './IconProps';
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { IconButtonProps } from './IconButtonProps';
3
- export declare const IconButton: React.ForwardRefExoticComponent<Pick<IconButtonProps, "className" | "style" | "classes" | "innerRef" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "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" | "form" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "icon" | "disableFocusRipple" | "edge" | "size" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps"> & React.RefAttributes<HTMLButtonElement>>;
3
+ export declare const IconButton: React.ForwardRefExoticComponent<Pick<IconButtonProps, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "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" | "form" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "disableFocusRipple" | "edge" | "size" | "action" | "buttonRef" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "onFocusVisible" | "TouchRippleProps" | keyof import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core/IconButton").IconButtonTypeMap<{}, "button">>> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,2 @@
1
1
  import { IconButtonProps as MuiIconButtonProps } from '@material-ui/core/IconButton';
2
- import { IconNames } from '../Icon/iconDictionary';
3
- export interface IconButtonProps extends MuiIconButtonProps {
4
- /** Sets the icon to display. */
5
- icon: IconNames;
6
- }
2
+ export declare type IconButtonProps = MuiIconButtonProps;
@@ -14,15 +14,17 @@ export { default as CardMedia, CardMediaProps } from './CardMedia';
14
14
  export { default as Checkbox, CheckboxProps } from './Checkbox';
15
15
  export { default as Chip, ChipProps } from './Chip';
16
16
  export { default as CircularProgress, CircularProgressProps } from './CircularProgress';
17
+ export { default as CollapsibleText, CollapsibleTextProps } from './CollapsibleText';
17
18
  export { default as Dialog, DialogProps } from './Dialog';
18
19
  export { default as DialogActions, DialogActionsProps } from './DialogActions';
19
20
  export { default as DialogContent, DialogContentProps } from './DialogContent';
20
21
  export { default as DialogTitle, DialogTitleProps } from './DialogTitle';
22
+ export { default as Divider, DividerProps } from './Divider';
21
23
  export { default as Drawer, DrawerProps } from './Drawer';
22
24
  export { default as FormControl, FormControlProps } from './FormControl';
23
25
  export { default as FormControlLabel, FormControlLabelProps } from './FormControlLabel';
24
26
  export { default as Grid, GridProps } from './Grid';
25
- export { default as Icon, IconProps, IconNames, iconDictionary } from './Icon';
27
+ export { default as Icon, IconProps } from './Icon';
26
28
  export { default as IconButton, IconButtonProps } from './IconButton';
27
29
  export { default as InputAdornment, InputAdornmentProps } from './InputAdornment';
28
30
  export { default as LinearProgress, LinearProgressProps } from './LinearProgress';
@@ -0,0 +1 @@
1
+ export { useCollapsibleText } from './useCollapsibleText';
@@ -0,0 +1,10 @@
1
+ interface CollapsibleTextHookResult {
2
+ collapsibleText: {
3
+ open: boolean;
4
+ collapsible: boolean;
5
+ setCollapsible: (collapsible: boolean) => void;
6
+ };
7
+ toggle: () => void;
8
+ }
9
+ export declare const useCollapsibleText: () => CollapsibleTextHookResult;
10
+ export {};
package/build/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './components';
2
+ export * from './hooks';