@up42/up-components 1.8.1 → 1.8.2

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,17 +1,21 @@
1
1
  import React from 'react';
2
2
  import { TypographyProps as MUITypographyProps } from '@mui/material/Typography';
3
- export declare type TypographyProps<C extends React.ElementType = 'p'> = MUITypographyProps<C, {
4
- component?: C;
5
- innerRef?: TypographyProps['ref'];
6
- }>;
3
+ export declare type TypographyProps = MUITypographyProps & {
4
+ component?: React.ElementType;
5
+ };
7
6
  /**
8
- * Tokens: https://up-components.up42.com/?path=/docs/tokens-typography--docs
7
+ * Douglas `variant` prop migration helper:
8
+ * - `h1` -> `heading`
9
+ * - `h2` -> `headingSmall`
10
+ * - `h3` -> `headingXSmall`
11
+ * - `body1` -> `body`
12
+ * - `caption` ->`note`
13
+ * - `overline` -> `label`
14
+ * - (no variant) -> `body`
15
+ *
9
16
  * Documentation: https://up-components.up42.com/?path=/docs/data-display-typography--docs
10
17
  */
11
- export declare const Typography: React.ForwardRefExoticComponent<Pick<{
12
- component?: React.ElementType<any> | undefined;
13
- innerRef?: TypographyProps['ref'];
14
- } & import("@mui/system").SystemProps<import("@mui/material").Theme> & {
18
+ export declare const Typography: React.ForwardRefExoticComponent<Pick<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
15
19
  align?: "inherit" | "left" | "center" | "right" | "justify" | undefined;
16
20
  children?: React.ReactNode;
17
21
  classes?: Partial<import("@mui/material/Typography").TypographyClasses> | undefined;
@@ -19,6 +23,10 @@ export declare const Typography: React.ForwardRefExoticComponent<Pick<{
19
23
  noWrap?: boolean | undefined;
20
24
  paragraph?: boolean | undefined;
21
25
  sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
22
- variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "body1" | "body2" | "subtitle1" | "subtitle2" | undefined;
23
- variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "body1" | "body2" | "subtitle1" | "subtitle2", string>> | undefined;
24
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<any, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "align" | "component" | "variant" | "innerRef" | ("color" | "fontSize" | "p" | "height" | "width" | "display" | "fontFamily" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "left" | "right" | "top" | "bottom" | "border" | "boxShadow" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, string | number | symbol> & React.RefAttributes<HTMLParagraphElement>>;
26
+ variant?: "body" | "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "heading" | "note" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | "headingSmall" | "headingXSmall" | undefined;
27
+ variantMapping?: Partial<Record<"body" | "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "heading" | "note" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | "headingSmall" | "headingXSmall", string>> | undefined;
28
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
29
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
30
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "align" | "variant" | "variantMapping" | ("color" | "fontSize" | "p" | "height" | "width" | "display" | "fontFamily" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "left" | "right" | "top" | "bottom" | "border" | "boxShadow" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "gutterBottom" | "noWrap" | "paragraph"> & {
31
+ component?: React.ElementType<any> | undefined;
32
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "slot" | "title" | "id" | "lang" | "role" | "tabIndex" | "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" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "align" | "component" | "variant" | "variantMapping" | ("color" | "fontSize" | "p" | "height" | "width" | "display" | "fontFamily" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "left" | "right" | "top" | "bottom" | "border" | "boxShadow" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "gutterBottom" | "noWrap" | "paragraph"> & React.RefAttributes<unknown>>;
@@ -1,2 +1,72 @@
1
+ /// <reference types="react" />
1
2
  import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
- export declare const typographyOverrides: OverridesStyleRules;
3
+ import { TypographyOptions } from '@mui/material/styles/createTypography';
4
+ /**
5
+ * Adds new variants to the Typography component
6
+ * @see https://mui.com/material-ui/customization/typography/#adding-amp-disabling-variants
7
+ */
8
+ declare module '@mui/material/styles' {
9
+ interface TypographyVariants {
10
+ heading: React.CSSProperties;
11
+ headingSmall: React.CSSProperties;
12
+ headingXSmall: React.CSSProperties;
13
+ body: React.CSSProperties;
14
+ label: React.CSSProperties;
15
+ note: React.CSSProperties;
16
+ }
17
+ /** Allow using new properties in `createTheme` */
18
+ interface TypographyVariantsOptions {
19
+ heading?: React.CSSProperties;
20
+ headingSmall?: React.CSSProperties;
21
+ headingXSmall?: React.CSSProperties;
22
+ body?: React.CSSProperties;
23
+ label?: React.CSSProperties;
24
+ note?: React.CSSProperties;
25
+ }
26
+ }
27
+ /**
28
+ * Typography's variant prop options
29
+ * The properties will be merged with the existing variants
30
+ * @see https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Typography/Typography.d.ts#L51
31
+ */
32
+ declare module '@mui/material/Typography' {
33
+ interface TypographyPropsVariantOverrides {
34
+ heading: true;
35
+ headingSmall: true;
36
+ headingXSmall: true;
37
+ body: true;
38
+ label: true;
39
+ note: true;
40
+ }
41
+ }
42
+ export declare const MuiTypography: OverridesStyleRules;
43
+ export declare const typographyTheme: TypographyOptions;
44
+ export declare const typographyOverrides: {
45
+ heading?: import("react").CSSProperties | undefined;
46
+ headingSmall?: import("react").CSSProperties | undefined;
47
+ headingXSmall?: import("react").CSSProperties | undefined;
48
+ body?: import("react").CSSProperties | undefined;
49
+ label?: import("react").CSSProperties | undefined;
50
+ note?: import("react").CSSProperties | undefined;
51
+ button?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
52
+ caption?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
53
+ h1?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
54
+ h2?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
55
+ h3?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
56
+ h4?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
57
+ h5?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
58
+ h6?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
59
+ overline?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
60
+ subtitle1?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
61
+ subtitle2?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
62
+ body1?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
63
+ body2?: import("@mui/material/styles/createTypography").TypographyStyleOptions | undefined;
64
+ allVariants?: import("react").CSSProperties | undefined;
65
+ fontFamily?: import("csstype").Property.FontFamily | undefined;
66
+ fontSize?: number | undefined;
67
+ fontWeightLight?: import("csstype").Property.FontWeight | undefined;
68
+ fontWeightRegular?: import("csstype").Property.FontWeight | undefined;
69
+ fontWeightMedium?: import("csstype").Property.FontWeight | undefined;
70
+ fontWeightBold?: import("csstype").Property.FontWeight | undefined;
71
+ htmlFontSize?: number | undefined;
72
+ };