@popmenu/common-ui 0.27.0 → 0.28.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.
- package/build/components/Typography/Typography.d.ts +1 -1
- package/build/components/Typography/TypographyProps.d.ts +6 -1
- package/build/components/Typography/index.d.ts +1 -1
- package/build/components/Typography/variantMap.d.ts +3 -0
- package/build/components/index.d.ts +1 -1
- package/build/index.es.js +111 -32
- package/build/index.es.js.map +1 -1
- package/build/index.js +111 -32
- package/build/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypographyProps } from './TypographyProps';
|
|
3
|
-
export declare const Typography: React.ForwardRefExoticComponent<Pick<TypographyProps, "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" | "
|
|
3
|
+
export declare const Typography: React.ForwardRefExoticComponent<Pick<TypographyProps, "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" | "variant" | "noWrap" | "gutterBottom" | "paragraph" | "align" | "display" | "variantMapping" | "weight"> & React.RefAttributes<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { TypographyProps as MuiTypographyProps } from '@material-ui/core';
|
|
2
|
-
export
|
|
2
|
+
export declare type BaseTypographyVariants = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'subtitle1' | 'subtitle2' | 'caption' | 'overline';
|
|
3
|
+
export declare type CustomTypographyVariants = 'h7';
|
|
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
|
+
export interface TypographyProps extends Omit<MuiTypographyProps, 'variant' | 'color'> {
|
|
6
|
+
variant?: BaseTypographyVariants | CustomTypographyVariants;
|
|
7
|
+
color?: ThemeColors;
|
|
3
8
|
weight?: 'regular' | 'semi-bold' | 'bold';
|
|
4
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Typography as default } from './Typography';
|
|
2
|
-
export { TypographyProps } from './TypographyProps';
|
|
2
|
+
export { TypographyProps, ThemeColors } from './TypographyProps';
|
|
@@ -71,5 +71,5 @@ export { default as ToggleButton, ToggleButtonProps } from './ToggleButton';
|
|
|
71
71
|
export { default as ToggleButtonGroup, ToggleButtonGroupProps } from './ToggleButtonGroup';
|
|
72
72
|
export { default as Toolbar, ToolbarProps } from './Toolbar';
|
|
73
73
|
export { default as Tooltip, TooltipProps } from './Tooltip';
|
|
74
|
-
export { default as Typography, TypographyProps } from './Typography';
|
|
74
|
+
export { default as Typography, TypographyProps, ThemeColors } from './Typography';
|
|
75
75
|
export { NumberField, NumberFieldProps } from './NumberField';
|
package/build/index.es.js
CHANGED
|
@@ -89,12 +89,12 @@ function __rest(s, e) {
|
|
|
89
89
|
return t;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
var _path$
|
|
92
|
+
var _path$3g;
|
|
93
93
|
|
|
94
|
-
function _extends$
|
|
94
|
+
function _extends$3x() { _extends$3x = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3x.apply(this, arguments); }
|
|
95
95
|
|
|
96
96
|
function SvgMinusCircle(props) {
|
|
97
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
97
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3x({
|
|
98
98
|
viewBox: "0 0 16 16",
|
|
99
99
|
strokeLinecap: "round",
|
|
100
100
|
strokeLinejoin: "round",
|
|
@@ -102,17 +102,17 @@ function SvgMinusCircle(props) {
|
|
|
102
102
|
width: "1em",
|
|
103
103
|
height: "1em",
|
|
104
104
|
fill: "none"
|
|
105
|
-
}, props), _path$
|
|
105
|
+
}, props), _path$3g || (_path$3g = /*#__PURE__*/React.createElement("path", {
|
|
106
106
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
|
|
107
107
|
})));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
var _path$
|
|
110
|
+
var _path$38;
|
|
111
111
|
|
|
112
|
-
function _extends$
|
|
112
|
+
function _extends$3p() { _extends$3p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3p.apply(this, arguments); }
|
|
113
113
|
|
|
114
114
|
function SvgPlusCircle(props) {
|
|
115
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
115
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3p({
|
|
116
116
|
viewBox: "0 0 16 16",
|
|
117
117
|
strokeLinecap: "round",
|
|
118
118
|
strokeLinejoin: "round",
|
|
@@ -120,17 +120,17 @@ function SvgPlusCircle(props) {
|
|
|
120
120
|
width: "1em",
|
|
121
121
|
height: "1em",
|
|
122
122
|
fill: "none"
|
|
123
|
-
}, props), _path$
|
|
123
|
+
}, props), _path$38 || (_path$38 = /*#__PURE__*/React.createElement("path", {
|
|
124
124
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334"
|
|
125
125
|
})));
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
var _path$
|
|
128
|
+
var _path$2Q;
|
|
129
129
|
|
|
130
|
-
function _extends$
|
|
130
|
+
function _extends$35() { _extends$35 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$35.apply(this, arguments); }
|
|
131
131
|
|
|
132
132
|
function SvgUser(props) {
|
|
133
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
133
|
+
return /*#__PURE__*/React.createElement("svg", _extends$35({
|
|
134
134
|
viewBox: "0 0 16 16",
|
|
135
135
|
strokeLinecap: "round",
|
|
136
136
|
strokeLinejoin: "round",
|
|
@@ -138,7 +138,7 @@ function SvgUser(props) {
|
|
|
138
138
|
width: "1em",
|
|
139
139
|
height: "1em",
|
|
140
140
|
fill: "none"
|
|
141
|
-
}, props), _path$
|
|
141
|
+
}, props), _path$2Q || (_path$2Q = /*#__PURE__*/React.createElement("path", {
|
|
142
142
|
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z"
|
|
143
143
|
})));
|
|
144
144
|
}
|
|
@@ -370,29 +370,108 @@ var Checkbox = forwardRef(function (props, ref) {
|
|
|
370
370
|
});
|
|
371
371
|
Checkbox.displayName = 'Checkbox';
|
|
372
372
|
|
|
373
|
-
var
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
|
|
373
|
+
var weights = {
|
|
374
|
+
regular: 400,
|
|
375
|
+
'semi-bold': 600,
|
|
376
|
+
bold: 700,
|
|
377
|
+
};
|
|
378
|
+
var getColor = function (theme, props) {
|
|
379
|
+
var color = props.color;
|
|
380
|
+
if (color === undefined) {
|
|
381
|
+
return undefined;
|
|
382
|
+
}
|
|
383
|
+
if (['white', 'black'].includes(color)) {
|
|
384
|
+
return theme.palette.common[color];
|
|
385
|
+
}
|
|
386
|
+
if (color.match(/^grey\.\d{3}/)) {
|
|
387
|
+
var scale = color.split('.')[1];
|
|
388
|
+
return theme.palette.grey[scale] || theme.palette.grey[900];
|
|
389
|
+
}
|
|
390
|
+
if ([
|
|
391
|
+
'primary.light',
|
|
392
|
+
'primary.dark',
|
|
393
|
+
'secondary.light',
|
|
394
|
+
'secondary',
|
|
395
|
+
'secondary.dark',
|
|
396
|
+
'info.light',
|
|
397
|
+
'info.dark',
|
|
398
|
+
'success.light',
|
|
399
|
+
'success.dark',
|
|
400
|
+
'error.light',
|
|
401
|
+
'error.dark',
|
|
402
|
+
'warning.light',
|
|
403
|
+
'warning.dark',
|
|
404
|
+
].includes(color)) {
|
|
405
|
+
var _a = color.split('.'), paletteKey = _a[0], variant = _a[1];
|
|
406
|
+
return theme.palette[paletteKey][variant];
|
|
407
|
+
}
|
|
408
|
+
if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) {
|
|
409
|
+
return theme.palette[color].main;
|
|
410
|
+
}
|
|
411
|
+
if (['textPrimary', 'textSecondary'].includes(color)) {
|
|
412
|
+
return theme.palette.text[color.slice(4).toLowerCase()];
|
|
413
|
+
}
|
|
414
|
+
return undefined;
|
|
415
|
+
};
|
|
416
|
+
var useTypographyStyles = makeStyles$1(function (theme) {
|
|
417
|
+
var _a;
|
|
418
|
+
return ({
|
|
419
|
+
root: (_a = {},
|
|
420
|
+
_a["& ." + iconStaticClassName] = {
|
|
421
|
+
position: 'relative',
|
|
422
|
+
top: '0.125em',
|
|
423
|
+
padding: '0 0.125em',
|
|
424
|
+
boxSizing: 'content-box',
|
|
425
|
+
},
|
|
426
|
+
_a.fontFamily = theme.typography.fontFamily,
|
|
427
|
+
_a.fontWeight = function (_a) {
|
|
428
|
+
var variant = _a.variant, weight = _a.weight;
|
|
429
|
+
return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight);
|
|
430
|
+
},
|
|
431
|
+
_a.fontSize = function (_a) {
|
|
432
|
+
var variant = _a.variant;
|
|
433
|
+
return theme.typography[variant || 'body1'].fontSize;
|
|
434
|
+
},
|
|
435
|
+
_a.lineHeight = function (_a) {
|
|
436
|
+
var variant = _a.variant;
|
|
437
|
+
return theme.typography[variant || 'body1'].lineHeight;
|
|
438
|
+
},
|
|
439
|
+
_a.textTransform = function (_a) {
|
|
440
|
+
var variant = _a.variant;
|
|
441
|
+
return theme.typography[variant || 'body1'].textTransform;
|
|
442
|
+
},
|
|
443
|
+
_a.color = function (props) { return getColor(theme, props); },
|
|
444
|
+
_a),
|
|
445
|
+
caption: {
|
|
446
|
+
display: 'inline',
|
|
447
|
+
},
|
|
448
|
+
overline: {
|
|
449
|
+
display: 'inline',
|
|
450
|
+
},
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
var variantMap = {
|
|
455
|
+
h1: 'h1',
|
|
456
|
+
h2: 'h2',
|
|
457
|
+
h3: 'h3',
|
|
458
|
+
h4: 'h4',
|
|
459
|
+
h5: 'h5',
|
|
460
|
+
h6: 'h6',
|
|
461
|
+
h7: 'h6',
|
|
462
|
+
body1: 'p',
|
|
463
|
+
body2: 'p',
|
|
464
|
+
subtitle1: 'h6',
|
|
465
|
+
subtitle2: 'h6',
|
|
466
|
+
caption: 'span',
|
|
467
|
+
overline: 'span',
|
|
468
|
+
};
|
|
391
469
|
|
|
392
470
|
var Typography = forwardRef(function (props, ref) {
|
|
393
|
-
props.weight; var restProps = __rest(props, ["weight"]);
|
|
471
|
+
props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
|
|
394
472
|
var classes = useTypographyStyles(props);
|
|
395
|
-
|
|
473
|
+
var component = variantMap[variant];
|
|
474
|
+
return React__default.createElement(Typography$1, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" }));
|
|
396
475
|
});
|
|
397
476
|
Typography.displayName = 'Typography';
|
|
398
477
|
|