@popmenu/admin-ui 0.60.0 → 0.62.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.
@@ -30,6 +30,8 @@ export declare namespace FullScreenStepperSubProps {
30
30
  interface Step {
31
31
  /** Group of props for modifying the ActionBar region of FullScreenStepper. */
32
32
  actionBar?: ActionBar;
33
+ /** When false; disables the ActionBar of a step */
34
+ displayActionBar?: boolean;
33
35
  /** The name of a given step. Used to match with a provided content component. */
34
36
  name: string;
35
37
  /** Text displayed as the title of a step. */
@@ -43,6 +45,8 @@ export interface FullScreenStepperProps extends DialogProps {
43
45
  context?: Record<string, unknown>;
44
46
  /** Specifies which step the dialog will initialize at. */
45
47
  defaultStepCursor?: number;
48
+ /** When false; disables the ActionBar across all the FullScreenStepper */
49
+ displayActionBar?: boolean;
46
50
  /** Controls whether or not the "Cancel" button is displayed. */
47
51
  displayCancelButton?: boolean;
48
52
  /** Controls whether or not the "Previous" button is displayed. */
@@ -1,13 +1,22 @@
1
1
  import { FullScreenStepperSubProps } from '../FullScreenStepper/FullScreenStepperProps';
2
2
  import { FullScreenStepperTypes } from '../FullScreenStepper/types';
3
3
  export interface FullScreenStepperActionsProps extends Partial<FullScreenStepperSubProps.ActionBar> {
4
+ /** The callback args for custom actions */
4
5
  callbackArgs: FullScreenStepperTypes.EventCallbackArgs;
6
+ /** When false; hides the "Cancel" button */
5
7
  displayCancelButton: boolean;
8
+ /** When false; hides the "Previous" button */
6
9
  displayPreviousButton: boolean;
10
+ /** The total number of steps */
7
11
  stepCount: FullScreenStepperTypes.StepCount;
12
+ /** The current value of step cursor */
8
13
  stepCursor: FullScreenStepperTypes.StepCursor;
14
+ /** The setter for value of step cursor */
9
15
  setStepCursor: FullScreenStepperTypes.SetStepCursor;
16
+ /** Callback triggered when the "Cancel" button is clicked. */
10
17
  handleCancelClick: () => Promise<void>;
18
+ /** Callback triggered when the "Next" button is clicked. */
11
19
  handleNextClick: () => Promise<void>;
20
+ /** Callback triggered when the "Previous" button is clicked. */
12
21
  handlePreviousClick: () => Promise<void>;
13
22
  }
@@ -1 +1,2 @@
1
1
  export { FullScreenStepperActions as default } from './FullScreenStepperActions';
2
+ export { FullScreenStepperActionsProps } from './FullScreenStepperActionsProps';
@@ -6,6 +6,7 @@ export { default as Button, ButtonProps } from './Button';
6
6
  export { default as ButtonGroup, ButtonGroupProps } from './ButtonGroup';
7
7
  export { default as FeatureIntro, FeatureIntroProps } from './FeatureIntro';
8
8
  export { default as FullScreenStepper, FullScreenStepperProps, FullScreenStepperContext } from './FullScreenStepper';
9
+ export { default as FullScreenStepperActions, FullScreenStepperActionsProps } from './FullScreenStepperActions';
9
10
  export { default as FullScreenStepperContent } from './FullScreenStepperContent';
10
11
  export { default as SelectableCard, SelectableCardProps } from './SelectableCard';
11
12
  export { default as Toast, ToastProps } from './Toast';
@@ -23,3 +24,4 @@ export { SettingsIndexCardGroup } from './SettingsIndexCardGroup';
23
24
  export { SettingsIndexCard, SettingsIndexCardProps } from './SettingsIndexCard';
24
25
  export { List, ListProps } from './List';
25
26
  export { StandardListItem, StandardListItemProps } from './StandardListItem';
27
+ export { Switch, SwitchProps, TextField, TextFieldProps, MenuItem, MenuItemProps, CircularProgress, CircularProgressProps, } from '@material-ui/core';
package/build/index.es.js CHANGED
@@ -2,6 +2,7 @@ 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
4
  import { makeStyles, Typography as Typography$1, Link as Link$1, Paper as Paper$1, Box, useTheme as useTheme$1, ButtonBase, List as List$1, ListItem, ListItemAvatar, ListItemText, Chip, ListItemSecondaryAction, IconButton as IconButton$1 } from '@material-ui/core';
5
+ export { CircularProgress, MenuItem, Switch, TextField } from '@material-ui/core';
5
6
  import '@material-ui/core/AppBar';
6
7
  import MuiAvatar from '@material-ui/core/Avatar';
7
8
  import { makeStyles as makeStyles$1, useTheme, lighten } from '@material-ui/core/styles';
@@ -1542,11 +1543,12 @@ var FullScreenStepperContext = createContext({});
1542
1543
  * - loading?
1543
1544
  */
1544
1545
  var FullScreenStepper = function (props) {
1545
- var children = props.children, _a = props.context, context = _a === void 0 ? {} : _a, _b = props.defaultStepCursor, defaultStepCursor = _b === void 0 ? 1 : _b, _c = props.displayCancelButton, displayCancelButton = _c === void 0 ? true : _c, _d = props.displayPreviousButton, displayPreviousButton = _d === void 0 ? true : _d, _e = props.resetStepCursorOnCancel, resetStepCursorOnCancel = _e === void 0 ? true : _e, _f = props.resetStepCursorOnClose, resetStepCursorOnClose = _f === void 0 ? true : _f, steps = props.steps, onClose = props.onClose, onFinish = props.onFinish, onNext = props.onNext, onCancel = props.onCancel, onPrevious = props.onPrevious, DialogProps = __rest$1(props, ["children", "context", "defaultStepCursor", "displayCancelButton", "displayPreviousButton", "resetStepCursorOnCancel", "resetStepCursorOnClose", "steps", "onClose", "onFinish", "onNext", "onCancel", "onPrevious"]);
1546
- var _g = useState(defaultStepCursor), stepCursor = _g[0], setStepCursor = _g[1];
1546
+ var children = props.children, _a = props.context, context = _a === void 0 ? {} : _a, _b = props.defaultStepCursor, defaultStepCursor = _b === void 0 ? 1 : _b, _c = props.displayActionBar, displayActionBar = _c === void 0 ? true : _c, _d = props.displayCancelButton, displayCancelButton = _d === void 0 ? true : _d, _e = props.displayPreviousButton, displayPreviousButton = _e === void 0 ? true : _e, _f = props.resetStepCursorOnCancel, resetStepCursorOnCancel = _f === void 0 ? true : _f, _g = props.resetStepCursorOnClose, resetStepCursorOnClose = _g === void 0 ? true : _g, steps = props.steps, onClose = props.onClose, onFinish = props.onFinish, onNext = props.onNext, onCancel = props.onCancel, onPrevious = props.onPrevious, DialogProps = __rest$1(props, ["children", "context", "defaultStepCursor", "displayActionBar", "displayCancelButton", "displayPreviousButton", "resetStepCursorOnCancel", "resetStepCursorOnClose", "steps", "onClose", "onFinish", "onNext", "onCancel", "onPrevious"]);
1547
+ var _h = useState(defaultStepCursor), stepCursor = _h[0], setStepCursor = _h[1];
1547
1548
  var stepCount = steps.length;
1548
1549
  var stepIndex = stepCursor - 1;
1549
1550
  var step = steps[stepIndex];
1551
+ var _j = step.displayActionBar, displayStepActionBar = _j === void 0 ? true : _j;
1550
1552
  var isFinalStep = stepCursor / stepCount === 1;
1551
1553
  var callbackArgs = { setStepCursor: setStepCursor, step: step, stepCount: stepCount, stepIndex: stepIndex, steps: steps };
1552
1554
  var mergedContext = __assign$1(__assign$1({}, context), callbackArgs);
@@ -1626,7 +1628,7 @@ var FullScreenStepper = function (props) {
1626
1628
  React__default.createElement(Box$1, { display: "flex", flexDirection: "column", flexGrow: 1 },
1627
1629
  React__default.createElement(FullScreenStepperHeader, { stepCount: stepCount, stepCursor: stepCursor, onClose: handleClose, step: step }),
1628
1630
  React__default.createElement(Box$1, { display: "flex", mx: 6, flexGrow: 1, alignItems: "center", flexDirection: "column" }, content),
1629
- React__default.createElement(FullScreenStepperActions, __assign$1({}, step.actionBar, { callbackArgs: callbackArgs, displayCancelButton: displayCancelButton, displayPreviousButton: displayPreviousButton, stepCount: stepCount, stepCursor: stepCursor, setStepCursor: setStepCursor, handleCancelClick: handleCancelClick, handleNextClick: handleNextClick, handlePreviousClick: handlePreviousClick }))))));
1631
+ displayActionBar && displayStepActionBar && (React__default.createElement(FullScreenStepperActions, __assign$1({}, step.actionBar, { callbackArgs: callbackArgs, displayCancelButton: displayCancelButton, displayPreviousButton: displayPreviousButton, stepCount: stepCount, stepCursor: stepCursor, setStepCursor: setStepCursor, handleCancelClick: handleCancelClick, handleNextClick: handleNextClick, handlePreviousClick: handlePreviousClick })))))));
1630
1632
  };
1631
1633
  FullScreenStepper.displayName = 'FullScreenStepper';
1632
1634
 
@@ -2169,6 +2171,15 @@ var dataVizPalette = {
2169
2171
  },
2170
2172
  };
2171
2173
 
2174
+ var props = {
2175
+ MuiSwitch: {
2176
+ color: 'default',
2177
+ },
2178
+ MuiTextField: {
2179
+ variant: 'outlined',
2180
+ },
2181
+ };
2182
+
2172
2183
  /**
2173
2184
  * These theme properties should be considered legacy. Make efforts to avoid new usage as well as refactor out existing
2174
2185
  * usage.
@@ -2196,36 +2207,48 @@ var adminThemeZIndex = {
2196
2207
  /** The defaults for MuiInputBase and MuiInputLabel can be removed once the BasicForm & 'shared' inputs have either:
2197
2208
  * 1. been refactored to use secondary color.
2198
2209
  * 2. been replaced with new common components.
2210
+ *
2211
+ * props as imported from './props' are part updated design system.
2199
2212
  */
2200
2213
  var adminThemeDefaultProps = {
2201
- props: {
2214
+ props: __assign$1(__assign$1({}, props), {
2215
+ // Legacy below
2202
2216
  MuiCard: {
2203
2217
  elevation: 0,
2204
- },
2205
- MuiTooltip: {
2218
+ }, MuiTooltip: {
2206
2219
  title: '',
2207
2220
  placement: 'right',
2208
- },
2209
- MuiPaper: {
2221
+ }, MuiPaper: {
2210
2222
  elevation: 0,
2211
- },
2212
- MuiAppBar: {
2223
+ }, MuiAppBar: {
2213
2224
  position: 'static',
2214
- },
2215
- MuiInputBase: {
2225
+ }, MuiInputBase: {
2216
2226
  color: 'secondary',
2217
- },
2218
- MuiInputLabel: {
2227
+ }, MuiInputLabel: {
2219
2228
  color: 'secondary',
2229
+ } }),
2230
+ };
2231
+
2232
+ var overrides = {
2233
+ MuiSwitch: {
2234
+ checked: {},
2235
+ track: {},
2236
+ switchBase: {
2237
+ '&$checked': {
2238
+ color: basePalette.success.main,
2239
+ '& + $track': {
2240
+ background: basePalette.success.light,
2241
+ },
2242
+ },
2220
2243
  },
2221
2244
  },
2222
2245
  };
2223
2246
 
2224
- var adminLightOptions = __assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Light', palette: __assign$1(__assign$1(__assign$1({}, basePalette), adminLightPalette), dataVizPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography }, adminLightPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps);
2247
+ var adminLightOptions = __assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Light', palette: __assign$1(__assign$1(__assign$1({}, basePalette), adminLightPalette), dataVizPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography, overrides: overrides }, adminLightPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps);
2225
2248
  var adminLight = createTheme(adminLightOptions);
2226
2249
 
2227
- var adminDarkOptions = __assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Dark', palette: __assign$1(__assign$1(__assign$1({}, basePalette), adminDarkPalette), dataVizPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography }, adminDarkPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps);
2250
+ var adminDarkOptions = __assign$1(__assign$1(__assign$1(__assign$1({ themeName: 'Admin Dark', palette: __assign$1(__assign$1(__assign$1({}, basePalette), adminDarkPalette), dataVizPalette), breakpoints: adminThemeBreakpoints, typography: adminThemeTypography, overrides: overrides }, adminDarkPlaceholder), adminThemeZIndex), adminThemeStatus), adminThemeDefaultProps);
2228
2251
  var adminDark = createTheme(adminDarkOptions);
2229
2252
 
2230
- 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 };
2253
+ export { Alert, AlertDialog, AlertDialogHeader, AlertTitle, Button, ButtonGroup, DialogActions, FeatureIntro, FullScreenStepper, FullScreenStepperActions, FullScreenStepperContent, FullScreenStepperContext, List, Page, PageBody, PageSection, PageSectionHead, PageSectionTitle, PageSections, SelectableCard, SettingsIndexCard, SettingsIndexCardGroup, StandardListItem, Toast, adminDark, adminDarkOptions, adminLight, adminLightOptions, useDialog, useFullScreenStepperContext, useSelectableCard };
2231
2254
  //# sourceMappingURL=index.es.js.map