@popmenu/common-ui 0.27.0 → 0.29.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,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" | "noWrap" | "gutterBottom" | "paragraph" | "weight" | "align" | "display" | "variant" | "variantMapping"> & React.RefAttributes<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>>;
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 interface TypographyProps extends MuiTypographyProps {
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';
@@ -0,0 +1,3 @@
1
+ import { ElementType } from 'react';
2
+ import { BaseTypographyVariants, CustomTypographyVariants } from './TypographyProps';
3
+ export declare const variantMap: Record<BaseTypographyVariants | CustomTypographyVariants, ElementType>;
@@ -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,57 +89,57 @@ function __rest(s, e) {
89
89
  return t;
90
90
  }
91
91
 
92
- var _path$3f;
92
+ var _path$2g;
93
93
 
94
- function _extends$3v() { _extends$3v = 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$3v.apply(this, arguments); }
94
+ function _extends$3t() { _extends$3t = 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$3t.apply(this, arguments); }
95
95
 
96
96
  function SvgMinusCircle(props) {
97
- return /*#__PURE__*/React.createElement("svg", _extends$3v({
97
+ return /*#__PURE__*/React.createElement("svg", _extends$3t({
98
98
  viewBox: "0 0 16 16",
99
+ fill: "none",
99
100
  strokeLinecap: "round",
100
101
  strokeLinejoin: "round",
101
- stroke: "currentColor",
102
102
  width: "1em",
103
- height: "1em",
104
- fill: "none"
105
- }, props), _path$3f || (_path$3f = /*#__PURE__*/React.createElement("path", {
106
- d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
103
+ height: "1em"
104
+ }, props), _path$2g || (_path$2g = /*#__PURE__*/React.createElement("path", {
105
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334",
106
+ stroke: "currentColor"
107
107
  })));
108
108
  }
109
109
 
110
- var _path$37;
110
+ var _path$28;
111
111
 
112
- function _extends$3n() { _extends$3n = 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$3n.apply(this, arguments); }
112
+ function _extends$3l() { _extends$3l = 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$3l.apply(this, arguments); }
113
113
 
114
114
  function SvgPlusCircle(props) {
115
- return /*#__PURE__*/React.createElement("svg", _extends$3n({
115
+ return /*#__PURE__*/React.createElement("svg", _extends$3l({
116
116
  viewBox: "0 0 16 16",
117
+ fill: "none",
117
118
  strokeLinecap: "round",
118
119
  strokeLinejoin: "round",
119
- stroke: "currentColor",
120
120
  width: "1em",
121
- height: "1em",
122
- fill: "none"
123
- }, props), _path$37 || (_path$37 = /*#__PURE__*/React.createElement("path", {
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"
121
+ height: "1em"
122
+ }, props), _path$28 || (_path$28 = /*#__PURE__*/React.createElement("path", {
123
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334",
124
+ stroke: "currentColor"
125
125
  })));
126
126
  }
127
127
 
128
- var _path$2P;
128
+ var _path$1W;
129
129
 
130
- function _extends$33() { _extends$33 = 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$33.apply(this, arguments); }
130
+ function _extends$31() { _extends$31 = 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$31.apply(this, arguments); }
131
131
 
132
132
  function SvgUser(props) {
133
- return /*#__PURE__*/React.createElement("svg", _extends$33({
133
+ return /*#__PURE__*/React.createElement("svg", _extends$31({
134
134
  viewBox: "0 0 16 16",
135
+ fill: "none",
135
136
  strokeLinecap: "round",
136
137
  strokeLinejoin: "round",
137
- stroke: "currentColor",
138
138
  width: "1em",
139
- height: "1em",
140
- fill: "none"
141
- }, props), _path$2P || (_path$2P = /*#__PURE__*/React.createElement("path", {
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"
139
+ height: "1em"
140
+ }, props), _path$1W || (_path$1W = /*#__PURE__*/React.createElement("path", {
141
+ 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",
142
+ stroke: "currentColor"
143
143
  })));
144
144
  }
145
145
 
@@ -370,29 +370,109 @@ var Checkbox = forwardRef(function (props, ref) {
370
370
  });
371
371
  Checkbox.displayName = 'Checkbox';
372
372
 
373
- var useTypographyStyles = makeStyles$1(function () { return ({
374
- root: function (_a) {
375
- var _b;
376
- var weight = _a.weight;
377
- return (__assign((_b = {}, _b["& ." + iconStaticClassName] = {
378
- position: 'relative',
379
- top: '0.125em',
380
- padding: '0 0.125em',
381
- boxSizing: 'content-box',
382
- }, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 })));
383
- },
384
- caption: {
385
- display: 'inline',
386
- },
387
- overline: {
388
- display: 'inline',
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"]);
394
- var classes = useTypographyStyles(props);
395
- return React__default.createElement(Typography$1, __assign({ ref: ref, classes: classes }, restProps));
471
+ props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
472
+ var validatedVariant = Object.keys(variantMap).includes(variant) ? variant : 'body1';
473
+ var classes = useTypographyStyles(__assign(__assign({}, props), { variant: validatedVariant }));
474
+ var component = variantMap[validatedVariant];
475
+ return React__default.createElement(Typography$1, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" }));
396
476
  });
397
477
  Typography.displayName = 'Typography';
398
478