@popmenu/admin-ui
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -10,4 +10,3 @@ export { default as Alert, AlertProps } from './Alert'; | ||
export { default as FullScreenStepperContent } from './FullScreenStepperContent'; | ||
export { default as IconButton, IconButtonProps } from './IconButton'; | ||
export { default as SelectableCard, SelectableCardProps } from './SelectableCard'; | ||
export { default as Toast, ToastProps } from './Toast'; |
import React, { forwardRef, createContext, useState, useContext } from 'react'; | ||
import { Link, IconButton as IconButton$1, Alert as Alert$1, Icon, Button as Button$1, Dialog, Card, CardContent, Box, CardActions, Typography, ButtonGroup as ButtonGroup$1, NewIcon, CardActionArea } from '@popmenu/common-ui'; | ||
import { Link, IconButton, Alert as Alert$1, Icon, Button as Button$1, Dialog, Card, CardContent, Box, CardActions, Typography, ButtonGroup as ButtonGroup$1, CardActionArea } from '@popmenu/common-ui'; | ||
import { makeStyles, useTheme, lighten } from '@material-ui/core/styles'; | ||
import { makeStyles as makeStyles$1, IconButton as IconButton$2 } from '@material-ui/core'; | ||
import { makeStyles as makeStyles$1 } from '@material-ui/core'; | ||
import MuiAlertTitle from '@material-ui/lab/AlertTitle'; | ||
@@ -116,3 +116,3 @@ import Box$1 from '@material-ui/core/Box'; | ||
validLink && React.createElement(Link, __assign({}, validLink)), | ||
React.createElement(IconButton$1, { onClick: onClose, icon: "cancel" }))); | ||
React.createElement(IconButton, { onClick: onClose, icon: "cancel" }))); | ||
return (React.createElement(Alert$1, __assign({ ref: ref, classes: classes, icon: React.createElement(Icon, { size: "medium", name: severity }), action: Action, variant: variant, severity: severity }, muiProps), children)); | ||
@@ -154,3 +154,3 @@ }); | ||
}; | ||
var getBackground$1 = function (palette, props) { | ||
var getBackground = function (palette, props) { | ||
var backgroundColor = 'inherit'; | ||
@@ -172,3 +172,3 @@ if (['info', 'success', 'warning', 'error'].includes(props.variant)) { | ||
}; | ||
var getBackgroundHover$1 = function (palette, props) { | ||
var getBackgroundHover = function (palette, props) { | ||
var backgroundHoverColor = 'inherit'; | ||
@@ -200,4 +200,4 @@ if (['primary', 'info', 'success', 'warning', 'error'].includes(props.variant)) { | ||
color: getColor(palette, props), | ||
background: getBackground$1(palette, props), | ||
backgroundColor: props.variant === 'primary' ? palette.primary.dark : getBackground$1(palette, props), | ||
background: getBackground(palette, props), | ||
backgroundColor: props.variant === 'primary' ? palette.primary.dark : getBackground(palette, props), | ||
borderRadius: spacing(6), | ||
@@ -207,3 +207,3 @@ transition: 'all 200ms ease-in-out', | ||
color: getColorHover(palette, props), | ||
background: getBackgroundHover$1(palette, props), | ||
background: getBackgroundHover(palette, props), | ||
}, | ||
@@ -325,3 +325,3 @@ }); }, | ||
React.createElement(Card, { classes: { root: classes.card }, role: "alertdialog", "aria-modal": "true", "aria-labelledby": labelId, "aria-describedby": descriptionId }, | ||
React.createElement(IconButton$1, { className: classes.cancelIcon, icon: "cancel", size: "small", onClick: onClose }), | ||
React.createElement(IconButton, { className: classes.cancelIcon, icon: "cancel", size: "small", onClick: onClose }), | ||
React.createElement(CardContent, null, | ||
@@ -598,3 +598,3 @@ React.createElement(Box, { display: "flex" }, | ||
stepCount), | ||
React.createElement(IconButton$1, { className: classes.closeButton, icon: "cancel", onClick: onClose }), | ||
React.createElement(IconButton, { className: classes.closeButton, icon: "cancel", onClick: onClose }), | ||
React.createElement(FullScreenStepperProgress, { stepCount: stepCount, stepCursor: stepCursor }))); | ||
@@ -700,54 +700,2 @@ }; | ||
var getBackground = function (palette, props) { | ||
var backgrounds = { | ||
// @ts-expect-error gradient colors are included in the extended palette. | ||
primary: "linear-gradient(97.36deg, " + palette.primary.gradientStart + " 17.03%, " + palette.primary.gradientEnd + " 72.96%)", | ||
secondary: 'white', | ||
tertiary: palette.secondary.main, | ||
}; | ||
return backgrounds[props.variant || 'primary']; | ||
}; | ||
var getBackgroundHover = function (palette, props) { | ||
var backgrounds = { | ||
primary: palette.primary.dark, | ||
secondary: palette.secondary.main, | ||
tertiary: palette.secondary.light, | ||
}; | ||
return backgrounds[props.variant || 'primary']; | ||
}; | ||
var useIconButtonStyles = makeStyles$1(function (_a) { | ||
var palette = _a.palette, spacing = _a.spacing; | ||
return ({ | ||
root: { | ||
background: function (props) { return getBackground(palette, props); }, | ||
backgroundColor: function (props) { return (props.variant === 'primary' ? palette.primary.dark : getBackground(palette, props)); }, | ||
border: function (props) { return (props.variant === 'secondary' ? "1px solid " + palette.secondary.main : 'none'); }, | ||
color: function (props) { return (props.variant === 'secondary' ? palette.secondary.main : 'white'); }, | ||
transition: 'all 200ms ease-in-out', | ||
'&:hover': { | ||
background: function (props) { return getBackgroundHover(palette, props); }, | ||
color: 'white', | ||
}, | ||
fontSize: spacing(2), | ||
}, | ||
disabled: { | ||
'&$root': { | ||
background: palette.action.disabled, | ||
border: 'none', | ||
}, | ||
}, | ||
}); | ||
}); | ||
var IconButton = forwardRef(function (props, ref) { | ||
props.children; var icon = props.icon, muiProps = __rest(props, ["children", "icon"]); | ||
var classes = useIconButtonStyles(props); | ||
return (React.createElement(IconButton$2, __assign({ ref: ref, classes: classes }, muiProps), | ||
React.createElement(NewIcon, { icon: icon }))); | ||
}); | ||
IconButton.displayName = 'IconButton'; | ||
IconButton.defaultProps = { | ||
variant: 'primary', | ||
}; | ||
var useSelectableCardStyles = makeStyles(function (theme) { | ||
@@ -1082,3 +1030,3 @@ var _a = theme.palette, info = _a.info, grey = _a.grey, getContrastText = _a.getContrastText, spacing = theme.spacing; | ||
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, IconButton, SelectableCard, Toast, adminDark, adminLight, useFullScreenStepperContext, useSelectableCard }; | ||
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, SelectableCard, Toast, adminDark, adminLight, useFullScreenStepperContext, useSelectableCard }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -166,3 +166,3 @@ 'use strict'; | ||
}; | ||
var getBackground$1 = function (palette, props) { | ||
var getBackground = function (palette, props) { | ||
var backgroundColor = 'inherit'; | ||
@@ -184,3 +184,3 @@ if (['info', 'success', 'warning', 'error'].includes(props.variant)) { | ||
}; | ||
var getBackgroundHover$1 = function (palette, props) { | ||
var getBackgroundHover = function (palette, props) { | ||
var backgroundHoverColor = 'inherit'; | ||
@@ -212,4 +212,4 @@ if (['primary', 'info', 'success', 'warning', 'error'].includes(props.variant)) { | ||
color: getColor(palette, props), | ||
background: getBackground$1(palette, props), | ||
backgroundColor: props.variant === 'primary' ? palette.primary.dark : getBackground$1(palette, props), | ||
background: getBackground(palette, props), | ||
backgroundColor: props.variant === 'primary' ? palette.primary.dark : getBackground(palette, props), | ||
borderRadius: spacing(6), | ||
@@ -219,3 +219,3 @@ transition: 'all 200ms ease-in-out', | ||
color: getColorHover(palette, props), | ||
background: getBackgroundHover$1(palette, props), | ||
background: getBackgroundHover(palette, props), | ||
}, | ||
@@ -710,54 +710,2 @@ }); }, | ||
var getBackground = function (palette, props) { | ||
var backgrounds = { | ||
// @ts-expect-error gradient colors are included in the extended palette. | ||
primary: "linear-gradient(97.36deg, " + palette.primary.gradientStart + " 17.03%, " + palette.primary.gradientEnd + " 72.96%)", | ||
secondary: 'white', | ||
tertiary: palette.secondary.main, | ||
}; | ||
return backgrounds[props.variant || 'primary']; | ||
}; | ||
var getBackgroundHover = function (palette, props) { | ||
var backgrounds = { | ||
primary: palette.primary.dark, | ||
secondary: palette.secondary.main, | ||
tertiary: palette.secondary.light, | ||
}; | ||
return backgrounds[props.variant || 'primary']; | ||
}; | ||
var useIconButtonStyles = core.makeStyles(function (_a) { | ||
var palette = _a.palette, spacing = _a.spacing; | ||
return ({ | ||
root: { | ||
background: function (props) { return getBackground(palette, props); }, | ||
backgroundColor: function (props) { return (props.variant === 'primary' ? palette.primary.dark : getBackground(palette, props)); }, | ||
border: function (props) { return (props.variant === 'secondary' ? "1px solid " + palette.secondary.main : 'none'); }, | ||
color: function (props) { return (props.variant === 'secondary' ? palette.secondary.main : 'white'); }, | ||
transition: 'all 200ms ease-in-out', | ||
'&:hover': { | ||
background: function (props) { return getBackgroundHover(palette, props); }, | ||
color: 'white', | ||
}, | ||
fontSize: spacing(2), | ||
}, | ||
disabled: { | ||
'&$root': { | ||
background: palette.action.disabled, | ||
border: 'none', | ||
}, | ||
}, | ||
}); | ||
}); | ||
var IconButton = React.forwardRef(function (props, ref) { | ||
props.children; var icon = props.icon, muiProps = __rest(props, ["children", "icon"]); | ||
var classes = useIconButtonStyles(props); | ||
return (React__default['default'].createElement(core.IconButton, __assign({ ref: ref, classes: classes }, muiProps), | ||
React__default['default'].createElement(commonUi.NewIcon, { icon: icon }))); | ||
}); | ||
IconButton.displayName = 'IconButton'; | ||
IconButton.defaultProps = { | ||
variant: 'primary', | ||
}; | ||
var useSelectableCardStyles = styles.makeStyles(function (theme) { | ||
@@ -1102,3 +1050,2 @@ var _a = theme.palette, info = _a.info, grey = _a.grey, getContrastText = _a.getContrastText, spacing = theme.spacing; | ||
exports.FullScreenStepperContext = FullScreenStepperContext; | ||
exports.IconButton = IconButton; | ||
exports.SelectableCard = SelectableCard; | ||
@@ -1105,0 +1052,0 @@ exports.Toast = Toast; |
{ | ||
"name": "@popmenu/admin-ui", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"license": "MIT", | ||
@@ -33,3 +33,3 @@ "author": "Popmenu Design System Team", | ||
}, | ||
"gitHead": "130721079f83dab64348b96f7261047c4a2895b6" | ||
"gitHead": "a8a451274b913da1ecbdb5e165ce4ab03a83c495" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180442
75
2653