@popmenu/admin-ui 0.33.0 → 0.36.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/List/List.d.ts +3 -0
- package/build/components/List/ListProps.d.ts +4 -0
- package/build/components/List/index.d.ts +2 -0
- package/build/components/List/styles.d.ts +2 -0
- package/build/components/PageSectionHead/PageSectionHead.d.ts +2 -0
- package/build/components/PageSectionHead/index.d.ts +1 -0
- package/build/components/PageSectionTitle/PageSectionTitle.d.ts +3 -2
- package/build/components/StandardListItem/StandardListItem.d.ts +9 -0
- package/build/components/StandardListItem/StandardListItemProps.d.ts +25 -0
- package/build/components/StandardListItem/index.d.ts +2 -0
- package/build/components/index.d.ts +3 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/useDialog.d.ts +12 -0
- package/build/index.es.js +143 -15
- package/build/index.es.js.map +1 -1
- package/build/index.js +145 -13
- package/build/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageSectionHead } from './PageSectionHead';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TypographyProps } from '@popmenu/common-ui';
|
|
3
|
+
export declare const PageSectionTitle: (props: TypographyProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StandardListItemProps } from './StandardListItemProps';
|
|
3
|
+
/**
|
|
4
|
+
* TODO
|
|
5
|
+
* - clean props util
|
|
6
|
+
* - Avatar size and shape
|
|
7
|
+
*/
|
|
8
|
+
export declare const StandardListItem: (props: StandardListItemProps) => JSX.Element;
|
|
9
|
+
export declare const Test: () => JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC, MouseEvent as ReactMouseEvent, SVGProps } from 'react';
|
|
2
|
+
import { ListItemProps } from '@material-ui/core';
|
|
3
|
+
export interface StandardListItemProps extends Omit<ListItemProps, 'onClick'> {
|
|
4
|
+
title: string;
|
|
5
|
+
itemId?: string | number;
|
|
6
|
+
meta?: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
image?: {
|
|
9
|
+
src?: string;
|
|
10
|
+
alt?: string;
|
|
11
|
+
Icon?: FC<SVGProps<SVGSVGElement>>;
|
|
12
|
+
shape?: 'circle' | 'square';
|
|
13
|
+
};
|
|
14
|
+
status?: {
|
|
15
|
+
text: string;
|
|
16
|
+
severity?: string;
|
|
17
|
+
Icon?: FC<SVGProps<SVGSVGElement>>;
|
|
18
|
+
};
|
|
19
|
+
secondaryAction?: {
|
|
20
|
+
Icon: FC<SVGProps<SVGSVGElement>>;
|
|
21
|
+
'aria-label': string;
|
|
22
|
+
onClick: (event: ReactMouseEvent<HTMLButtonElement, MouseEvent>, listItem: StandardListItemProps) => void;
|
|
23
|
+
};
|
|
24
|
+
onClick?: (event: ReactMouseEvent<HTMLButtonElement | HTMLLIElement, MouseEvent>, listItem: StandardListItemProps) => void;
|
|
25
|
+
}
|
|
@@ -17,6 +17,9 @@ export { Page } from './Page';
|
|
|
17
17
|
export { PageBody } from './PageBody';
|
|
18
18
|
export { PageSection } from './PageSection';
|
|
19
19
|
export { PageSections } from './PageSections';
|
|
20
|
+
export { PageSectionHead } from './PageSectionHead';
|
|
20
21
|
export { PageSectionTitle } from './PageSectionTitle';
|
|
21
22
|
export { SettingsIndexCardGroup } from './SettingsIndexCardGroup';
|
|
22
23
|
export { SettingsIndexCard, SettingsIndexCardProps } from './SettingsIndexCard';
|
|
24
|
+
export { List, ListProps } from './List';
|
|
25
|
+
export { StandardListItem, StandardListItemProps } from './StandardListItem';
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useDialog: () => ({
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
} | {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
} | {
|
|
8
|
+
open: boolean;
|
|
9
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
})[];
|
package/build/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { createElement, forwardRef, createContext, useState, useContext } from 'react';
|
|
3
3
|
import CommonAlert from '@material-ui/lab/Alert';
|
|
4
|
-
import { makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, ButtonBase } from '@material-ui/core';
|
|
4
|
+
import { makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, ButtonBase, List as List$1, ListItem, ListItemAvatar, ListItemText, Chip, ListItemSecondaryAction, IconButton as IconButton$1 } from '@material-ui/core';
|
|
5
5
|
import '@material-ui/core/AppBar';
|
|
6
6
|
import MuiAvatar from '@material-ui/core/Avatar';
|
|
7
7
|
import { makeStyles as makeStyles$1, useTheme, lighten } from '@material-ui/core/styles';
|
|
@@ -32,6 +32,7 @@ import '@material-ui/core/InputAdornment';
|
|
|
32
32
|
import '@material-ui/core/LinearProgress';
|
|
33
33
|
import '@material-ui/core/List';
|
|
34
34
|
import '@material-ui/core/ListItem';
|
|
35
|
+
import '@material-ui/core/ListItemAvatar';
|
|
35
36
|
import '@material-ui/core/ListItemIcon';
|
|
36
37
|
import '@material-ui/core/ListItemSecondaryAction';
|
|
37
38
|
import '@material-ui/core/ListItemText';
|
|
@@ -229,7 +230,7 @@ var useIconStyles = makeStyles(function (_a) {
|
|
|
229
230
|
};
|
|
230
231
|
});
|
|
231
232
|
|
|
232
|
-
var classnames = {exports: {}};
|
|
233
|
+
var classnames$1 = {exports: {}};
|
|
233
234
|
|
|
234
235
|
/*!
|
|
235
236
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -285,9 +286,9 @@ var classnames = {exports: {}};
|
|
|
285
286
|
window.classNames = classNames;
|
|
286
287
|
}
|
|
287
288
|
}());
|
|
288
|
-
}(classnames));
|
|
289
|
+
}(classnames$1));
|
|
289
290
|
|
|
290
|
-
var classNames = classnames.exports;
|
|
291
|
+
var classNames$1 = classnames$1.exports;
|
|
291
292
|
|
|
292
293
|
var iconStaticClassName = 'pop-icon';
|
|
293
294
|
var Icon = function (props) {
|
|
@@ -298,7 +299,7 @@ var Icon = function (props) {
|
|
|
298
299
|
isValid = false;
|
|
299
300
|
}
|
|
300
301
|
return isValid
|
|
301
|
-
? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
302
|
+
? createElement(icon, __assign({ className: classNames$1([classes.root, iconStaticClassName, className]) }, restProps))
|
|
302
303
|
: null;
|
|
303
304
|
};
|
|
304
305
|
Icon.defaultProps = {
|
|
@@ -409,7 +410,7 @@ var Button$1 = forwardRef(function (props, ref) {
|
|
|
409
410
|
startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
|
|
410
411
|
disabled: true,
|
|
411
412
|
};
|
|
412
|
-
return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
|
|
413
|
+
return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames$1([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
|
|
413
414
|
});
|
|
414
415
|
Button$1.displayName = 'Button';
|
|
415
416
|
|
|
@@ -590,7 +591,7 @@ Link.defaultProps = {
|
|
|
590
591
|
};
|
|
591
592
|
Link.displayName = 'Link';
|
|
592
593
|
|
|
593
|
-
var useStyles$
|
|
594
|
+
var useStyles$4 = makeStyles(function (_a) {
|
|
594
595
|
var spacing = _a.spacing;
|
|
595
596
|
return ({
|
|
596
597
|
root: {
|
|
@@ -604,7 +605,7 @@ var useStyles$2 = makeStyles(function (_a) {
|
|
|
604
605
|
});
|
|
605
606
|
var Paper = forwardRef(function (props, ref) {
|
|
606
607
|
var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
|
|
607
|
-
var classes = useStyles$
|
|
608
|
+
var classes = useStyles$4(props);
|
|
608
609
|
return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
|
|
609
610
|
});
|
|
610
611
|
Paper.displayName = 'Paper';
|
|
@@ -1291,14 +1292,14 @@ var StepperActionsPreviousButton = function (props) {
|
|
|
1291
1292
|
return displayPreviousButton ? (React__default.createElement(Button, __assign$1({ variant: "tertiary", disabled: stepCursor === 1 }, augmentedPreviousButtonProps), previousButtonText || 'previous')) : null;
|
|
1292
1293
|
};
|
|
1293
1294
|
|
|
1294
|
-
var useStyles$
|
|
1295
|
+
var useStyles$3 = makeStyles$1({
|
|
1295
1296
|
root: {
|
|
1296
1297
|
fontStyle: 'italic',
|
|
1297
1298
|
},
|
|
1298
1299
|
});
|
|
1299
1300
|
var StepperActionsStatusText = function (props) {
|
|
1300
1301
|
var statusText = props.statusText;
|
|
1301
|
-
var classes = useStyles$
|
|
1302
|
+
var classes = useStyles$3(props);
|
|
1302
1303
|
return statusText ? (React__default.createElement(Typography, { classes: { root: classes.root }, variant: "body2" }, statusText)) : null;
|
|
1303
1304
|
};
|
|
1304
1305
|
|
|
@@ -1584,7 +1585,7 @@ Toast.defaultProps = {
|
|
|
1584
1585
|
};
|
|
1585
1586
|
Toast.displayName = 'Toast';
|
|
1586
1587
|
|
|
1587
|
-
var useStyles = makeStyles(function (_a) {
|
|
1588
|
+
var useStyles$2 = makeStyles(function (_a) {
|
|
1588
1589
|
var palette = _a.palette;
|
|
1589
1590
|
return ({
|
|
1590
1591
|
root: {
|
|
@@ -1593,7 +1594,7 @@ var useStyles = makeStyles(function (_a) {
|
|
|
1593
1594
|
});
|
|
1594
1595
|
});
|
|
1595
1596
|
var DialogActions = function (props) {
|
|
1596
|
-
var classes = useStyles(props);
|
|
1597
|
+
var classes = useStyles$2(props);
|
|
1597
1598
|
return React__default.createElement(CommonDialogActions, __assign$1({ classes: classes }, props));
|
|
1598
1599
|
};
|
|
1599
1600
|
|
|
@@ -1629,10 +1630,14 @@ var PageSections = function (props) {
|
|
|
1629
1630
|
return (React__default.createElement(Box, __assign$1({ display: "flex", flexDirection: "column", gridGap: 16 }, restProps), children));
|
|
1630
1631
|
};
|
|
1631
1632
|
|
|
1633
|
+
var PageSectionHead = function (props) {
|
|
1634
|
+
var children = props.children, restProps = __rest$1(props, ["children"]);
|
|
1635
|
+
return (React__default.createElement(Box, __assign$1({ display: "flex", justifyContent: "space-between", mb: 1.5 }, restProps), children));
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1632
1638
|
var PageSectionTitle = function (props) {
|
|
1633
1639
|
var children = props.children, restProps = __rest$1(props, ["children"]);
|
|
1634
|
-
return (React__default.createElement(
|
|
1635
|
-
React__default.createElement(Typography, { gutterBottom: true, variant: "h5" }, children)));
|
|
1640
|
+
return (React__default.createElement(Typography, __assign$1({ gutterBottom: true, variant: "h5" }, restProps), children));
|
|
1636
1641
|
};
|
|
1637
1642
|
|
|
1638
1643
|
var SettingsIndexCardGroup = function (props) {
|
|
@@ -1672,6 +1677,120 @@ var SettingsIndexCard = forwardRef(function (props, ref) {
|
|
|
1672
1677
|
});
|
|
1673
1678
|
SettingsIndexCard.displayName = 'SettingsIndexCard';
|
|
1674
1679
|
|
|
1680
|
+
var classnames = {exports: {}};
|
|
1681
|
+
|
|
1682
|
+
/*!
|
|
1683
|
+
Copyright (c) 2018 Jed Watson.
|
|
1684
|
+
Licensed under the MIT License (MIT), see
|
|
1685
|
+
http://jedwatson.github.io/classnames
|
|
1686
|
+
*/
|
|
1687
|
+
|
|
1688
|
+
(function (module) {
|
|
1689
|
+
/* global define */
|
|
1690
|
+
|
|
1691
|
+
(function () {
|
|
1692
|
+
|
|
1693
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1694
|
+
|
|
1695
|
+
function classNames() {
|
|
1696
|
+
var classes = [];
|
|
1697
|
+
|
|
1698
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1699
|
+
var arg = arguments[i];
|
|
1700
|
+
if (!arg) continue;
|
|
1701
|
+
|
|
1702
|
+
var argType = typeof arg;
|
|
1703
|
+
|
|
1704
|
+
if (argType === 'string' || argType === 'number') {
|
|
1705
|
+
classes.push(arg);
|
|
1706
|
+
} else if (Array.isArray(arg)) {
|
|
1707
|
+
if (arg.length) {
|
|
1708
|
+
var inner = classNames.apply(null, arg);
|
|
1709
|
+
if (inner) {
|
|
1710
|
+
classes.push(inner);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
} else if (argType === 'object') {
|
|
1714
|
+
if (arg.toString === Object.prototype.toString) {
|
|
1715
|
+
for (var key in arg) {
|
|
1716
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1717
|
+
classes.push(key);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
} else {
|
|
1721
|
+
classes.push(arg.toString());
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
return classes.join(' ');
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
if (module.exports) {
|
|
1730
|
+
classNames.default = classNames;
|
|
1731
|
+
module.exports = classNames;
|
|
1732
|
+
} else {
|
|
1733
|
+
window.classNames = classNames;
|
|
1734
|
+
}
|
|
1735
|
+
}());
|
|
1736
|
+
}(classnames));
|
|
1737
|
+
|
|
1738
|
+
var classNames = classnames.exports;
|
|
1739
|
+
|
|
1740
|
+
var useStyles$1 = makeStyles(function (theme) { return ({
|
|
1741
|
+
root: {
|
|
1742
|
+
'&$uncontained > li > *:first-child': {
|
|
1743
|
+
background: theme.palette.background.paper,
|
|
1744
|
+
borderRadius: theme.spacing(1),
|
|
1745
|
+
},
|
|
1746
|
+
'& > li > *:first-child': {
|
|
1747
|
+
borderBottom: "1px solid " + theme.palette.grey[300],
|
|
1748
|
+
},
|
|
1749
|
+
'& > li:last-child > *:first-child': {
|
|
1750
|
+
borderBottom: 'none',
|
|
1751
|
+
},
|
|
1752
|
+
},
|
|
1753
|
+
uncontained: {
|
|
1754
|
+
display: 'flex',
|
|
1755
|
+
flexDirection: 'column',
|
|
1756
|
+
gap: 16,
|
|
1757
|
+
},
|
|
1758
|
+
}); });
|
|
1759
|
+
|
|
1760
|
+
var List = function (props) {
|
|
1761
|
+
var _a;
|
|
1762
|
+
var children = props.children, uncontained = props.uncontained, className = props.className, restProps = __rest$1(props, ["children", "uncontained", "className"]);
|
|
1763
|
+
var classes = useStyles$1(props);
|
|
1764
|
+
return (React__default.createElement(List$1, __assign$1({ classes: classes, className: classNames((_a = {}, _a[classes.uncontained] = uncontained, _a), className) }, restProps), children));
|
|
1765
|
+
};
|
|
1766
|
+
|
|
1767
|
+
var useStyles = makeStyles(function (theme) { return ({
|
|
1768
|
+
chipRoot: {
|
|
1769
|
+
marginRight: theme.spacing(4),
|
|
1770
|
+
cursor: 'pointer',
|
|
1771
|
+
},
|
|
1772
|
+
}); });
|
|
1773
|
+
/**
|
|
1774
|
+
* TODO
|
|
1775
|
+
* - clean props util
|
|
1776
|
+
* - Avatar size and shape
|
|
1777
|
+
*/
|
|
1778
|
+
var StandardListItem = function (props) {
|
|
1779
|
+
props.itemId; var title = props.title, meta = props.meta, body = props.body, image = props.image, status = props.status, secondaryAction = props.secondaryAction, onClick = props.onClick, restProps = __rest$1(props, ["itemId", "title", "meta", "body", "image", "status", "secondaryAction", "onClick"]);
|
|
1780
|
+
var classes = useStyles(props);
|
|
1781
|
+
return (React__default.createElement(ListItem, __assign$1({ button: Boolean(onClick), onClick: function (e) { return onClick && onClick(e, props); } }, restProps),
|
|
1782
|
+
image && (React__default.createElement(ListItemAvatar, null,
|
|
1783
|
+
React__default.createElement(Avatar, { src: image.src, alt: image.alt }, image.Icon && React__default.createElement(Icon, { icon: image.Icon })))),
|
|
1784
|
+
React__default.createElement(ListItemText, { disableTypography: true },
|
|
1785
|
+
React__default.createElement(Typography, { variant: "h6" }, title),
|
|
1786
|
+
meta && (React__default.createElement(Typography, { variant: "body2", color: "secondary.light" }, meta)),
|
|
1787
|
+
body && (React__default.createElement(Typography, { variant: "body2", color: "grey.700" }, body))),
|
|
1788
|
+
status && (React__default.createElement(Chip, { classes: { root: classes.chipRoot }, icon: status.Icon && React__default.createElement(Icon, { icon: status.Icon }), label: status.text })),
|
|
1789
|
+
secondaryAction && (React__default.createElement(ListItemSecondaryAction, null,
|
|
1790
|
+
React__default.createElement(IconButton$1, { style: { color: 'black' }, "aria-label": secondaryAction['aria-label'], onClick: function (e) { return secondaryAction.onClick(e, props); } },
|
|
1791
|
+
React__default.createElement(Icon, { icon: secondaryAction.Icon }))))));
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1675
1794
|
var useFullScreenStepperContext = function () { return useContext(FullScreenStepperContext); };
|
|
1676
1795
|
|
|
1677
1796
|
/**
|
|
@@ -1719,6 +1838,15 @@ var useSelectableCard = function (config) {
|
|
|
1719
1838
|
return { card: { onClick: onClick, selection: selection }, selection: selection, setSelection: setSelection };
|
|
1720
1839
|
};
|
|
1721
1840
|
|
|
1841
|
+
var useDialog = function () {
|
|
1842
|
+
var _a = useState(false), open = _a[0], setOpen = _a[1];
|
|
1843
|
+
var toggle = function () { return setOpen(function (current) { return !current; }); };
|
|
1844
|
+
var close = function () { return setOpen(false); };
|
|
1845
|
+
var triggerProps = { onClick: toggle };
|
|
1846
|
+
var dialogProps = { open: open, onClose: close };
|
|
1847
|
+
return [triggerProps, dialogProps, { open: open, setOpen: setOpen, toggle: toggle, close: close }];
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1722
1850
|
var fonts = ['"Poppins"', '"sans-serif"'];
|
|
1723
1851
|
var adminThemeTypography = {
|
|
1724
1852
|
htmlFontSize: 16,
|
|
@@ -1943,5 +2071,5 @@ var adminLight = createTheme(adminLightOptions);
|
|
|
1943
2071
|
var adminDarkOptions = __assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Dark', palette: __assign$1(__assign$1({}, basePalette), adminDarkPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography }, adminDarkPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps);
|
|
1944
2072
|
var adminDark = createTheme(adminDarkOptions);
|
|
1945
2073
|
|
|
1946
|
-
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, DialogActions, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, Page, PageBody, PageSection, PageSectionTitle, PageSections, SelectableCard, SettingsIndexCard, SettingsIndexCardGroup, Toast, adminDark, adminDarkOptions, adminLight, adminLightOptions, useFullScreenStepperContext, useSelectableCard };
|
|
2074
|
+
export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, DialogActions, FeatureIntro, FullScreenStepper, FullScreenStepperContent, FullScreenStepperContext, List, Page, PageBody, PageSection, PageSectionHead, PageSectionTitle, PageSections, SelectableCard, SettingsIndexCard, SettingsIndexCardGroup, StandardListItem, Toast, adminDark, adminDarkOptions, adminLight, adminLightOptions, useDialog, useFullScreenStepperContext, useSelectableCard };
|
|
1947
2075
|
//# sourceMappingURL=index.es.js.map
|