@popmenu/admin-ui 0.126.4 → 0.127.1
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/cjs/components/Alert/index.d.ts +2 -2
- package/build/cjs/components/AlertDialog/AlertDialog.d.ts +1 -1
- package/build/cjs/components/AlertDialog/index.d.ts +2 -2
- package/build/cjs/components/AlertDialogHeader/index.d.ts +1 -1
- package/build/cjs/components/AlertTitle/index.d.ts +1 -1
- package/build/cjs/components/Button/ButtonProps.d.ts +1 -1
- package/build/cjs/components/Button/ButtonStyles.d.ts +1 -1
- package/build/cjs/components/Button/index.d.ts +2 -2
- package/build/cjs/components/Button/util/deriveButtonProps.d.ts +1 -1
- package/build/cjs/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/build/cjs/components/ButtonGroup/index.d.ts +2 -2
- package/build/cjs/components/Dialog/index.d.ts +2 -1
- package/build/cjs/components/DialogActions/index.d.ts +1 -1
- package/build/cjs/components/DialogContent/index.d.ts +2 -1
- package/build/cjs/components/DialogTitle/index.d.ts +2 -1
- package/build/cjs/components/FeatureIntro/FeatureIntroProps.d.ts +0 -1
- package/build/cjs/components/FeatureIntro/index.d.ts +2 -2
- package/build/cjs/components/FullScreenStepper/FullScreenStepperContext.d.ts +0 -1
- package/build/cjs/components/FullScreenStepper/FullScreenStepperProps.d.ts +10 -11
- package/build/cjs/components/FullScreenStepper/index.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperActions/index.d.ts +2 -2
- package/build/cjs/components/FullScreenStepperActions/util/StepperActionsCancelButton.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperActions/util/StepperActionsNextButton.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperActions/util/StepperActionsPreviousButton.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperActions/util/augmentButtonProps.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperContent/index.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperHeader/index.d.ts +1 -1
- package/build/cjs/components/FullScreenStepperProgress/index.d.ts +1 -1
- package/build/cjs/components/List/List.d.ts +0 -1
- package/build/cjs/components/List/index.d.ts +1 -1
- package/build/cjs/components/PageSectionTitle/PageSectionTitle.d.ts +0 -1
- package/build/cjs/components/SelectableCard/index.d.ts +2 -2
- package/build/cjs/components/SettingsIndexCard/SettingsIndexCardProps.d.ts +1 -1
- package/build/cjs/components/SettingsIndexCard/SettingsIndexCardStyles.d.ts +1 -1
- package/build/cjs/components/SettingsIndexCard/index.d.ts +1 -1
- package/build/cjs/components/SettingsIndexCardGroup/SettingsIndexCardGroup.d.ts +0 -1
- package/build/cjs/components/StandardListItem/StandardListItem.d.ts +0 -1
- package/build/cjs/components/StandardListItem/index.d.ts +1 -1
- package/build/cjs/components/Toast/index.d.ts +2 -2
- package/build/cjs/components/index.d.ts +27 -26
- package/build/cjs/hooks/useDialog.d.ts +0 -1
- package/build/cjs/hooks/useFullScreenStepperContext.d.ts +1 -1
- package/build/cjs/index.js +431 -459
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/theme/adminDarkTheme.d.ts +1 -1
- package/build/esm/components/Alert/Alert.js +14 -15
- package/build/esm/components/Alert/Alert.js.map +1 -1
- package/build/esm/components/Alert/AlertStyles.js +5 -8
- package/build/esm/components/Alert/AlertStyles.js.map +1 -1
- package/build/esm/components/Alert/index.d.ts +2 -2
- package/build/esm/components/AlertDialog/AlertDialog.d.ts +1 -1
- package/build/esm/components/AlertDialog/AlertDialog.js +6 -7
- package/build/esm/components/AlertDialog/AlertDialog.js.map +1 -1
- package/build/esm/components/AlertDialog/AlertDialogStyles.js +3 -3
- package/build/esm/components/AlertDialog/AlertDialogStyles.js.map +1 -1
- package/build/esm/components/AlertDialog/index.d.ts +2 -2
- package/build/esm/components/AlertDialogHeader/AlertDialogHeader.js +3 -4
- package/build/esm/components/AlertDialogHeader/AlertDialogHeader.js.map +1 -1
- package/build/esm/components/AlertDialogHeader/index.d.ts +1 -1
- package/build/esm/components/AlertTitle/AlertTitle.js +3 -4
- package/build/esm/components/AlertTitle/AlertTitle.js.map +1 -1
- package/build/esm/components/AlertTitle/index.d.ts +1 -1
- package/build/esm/components/Button/Button.js +12 -7
- package/build/esm/components/Button/Button.js.map +1 -1
- package/build/esm/components/Button/ButtonProps.d.ts +1 -1
- package/build/esm/components/Button/ButtonStyles.d.ts +1 -1
- package/build/esm/components/Button/ButtonStyles.js +52 -53
- package/build/esm/components/Button/ButtonStyles.js.map +1 -1
- package/build/esm/components/Button/index.d.ts +2 -2
- package/build/esm/components/Button/util/deriveButtonProps.d.ts +1 -1
- package/build/esm/components/Button/util/deriveButtonProps.js +3 -3
- package/build/esm/components/Button/util/deriveButtonProps.js.map +1 -1
- package/build/esm/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/build/esm/components/ButtonGroup/ButtonGroup.js +16 -13
- package/build/esm/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/build/esm/components/ButtonGroup/ButtonGroupStyles.js +5 -5
- package/build/esm/components/ButtonGroup/ButtonGroupStyles.js.map +1 -1
- package/build/esm/components/ButtonGroup/index.d.ts +2 -2
- package/build/esm/components/Dialog/index.d.ts +2 -1
- package/build/esm/components/DialogActions/DialogActions.js +8 -12
- package/build/esm/components/DialogActions/DialogActions.js.map +1 -1
- package/build/esm/components/DialogActions/index.d.ts +1 -1
- package/build/esm/components/DialogContent/index.d.ts +2 -1
- package/build/esm/components/DialogTitle/index.d.ts +2 -1
- package/build/esm/components/FeatureIntro/FeatureIntro.js +9 -10
- package/build/esm/components/FeatureIntro/FeatureIntro.js.map +1 -1
- package/build/esm/components/FeatureIntro/FeatureIntroProps.d.ts +0 -1
- package/build/esm/components/FeatureIntro/FeatureIntroStyles.js +12 -15
- package/build/esm/components/FeatureIntro/FeatureIntroStyles.js.map +1 -1
- package/build/esm/components/FeatureIntro/index.d.ts +2 -2
- package/build/esm/components/FullScreenStepper/FullScreenStepper.js +43 -74
- package/build/esm/components/FullScreenStepper/FullScreenStepper.js.map +1 -1
- package/build/esm/components/FullScreenStepper/FullScreenStepperContext.d.ts +0 -1
- package/build/esm/components/FullScreenStepper/FullScreenStepperContext.js +1 -1
- package/build/esm/components/FullScreenStepper/FullScreenStepperContext.js.map +1 -1
- package/build/esm/components/FullScreenStepper/FullScreenStepperProps.d.ts +10 -11
- package/build/esm/components/FullScreenStepper/index.d.ts +1 -1
- package/build/esm/components/FullScreenStepperActions/FullScreenStepperActions.js +6 -7
- package/build/esm/components/FullScreenStepperActions/FullScreenStepperActions.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/FullScreenStepperActionsStyles.js +4 -4
- package/build/esm/components/FullScreenStepperActions/FullScreenStepperActionsStyles.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/index.d.ts +2 -2
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsCancelButton.d.ts +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsCancelButton.js +4 -5
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsCancelButton.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsNextButton.d.ts +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsNextButton.js +8 -9
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsNextButton.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsPreviousButton.d.ts +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsPreviousButton.js +4 -5
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsPreviousButton.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsStatusText.js +4 -4
- package/build/esm/components/FullScreenStepperActions/util/StepperActionsStatusText.js.map +1 -1
- package/build/esm/components/FullScreenStepperActions/util/augmentButtonProps.d.ts +1 -1
- package/build/esm/components/FullScreenStepperActions/util/augmentButtonProps.js +11 -24
- package/build/esm/components/FullScreenStepperActions/util/augmentButtonProps.js.map +1 -1
- package/build/esm/components/FullScreenStepperContent/FullScreenStepperContent.js +3 -4
- package/build/esm/components/FullScreenStepperContent/FullScreenStepperContent.js.map +1 -1
- package/build/esm/components/FullScreenStepperContent/index.d.ts +1 -1
- package/build/esm/components/FullScreenStepperHeader/FullScreenStepperHeader.js +3 -3
- package/build/esm/components/FullScreenStepperHeader/FullScreenStepperHeader.js.map +1 -1
- package/build/esm/components/FullScreenStepperHeader/FullScreenStepperHeaderStyles.js +18 -21
- package/build/esm/components/FullScreenStepperHeader/FullScreenStepperHeaderStyles.js.map +1 -1
- package/build/esm/components/FullScreenStepperHeader/index.d.ts +1 -1
- package/build/esm/components/FullScreenStepperProgress/FullScreenStepperProgress.js +2 -2
- package/build/esm/components/FullScreenStepperProgress/FullScreenStepperProgress.js.map +1 -1
- package/build/esm/components/FullScreenStepperProgress/FullScreenStepperProgressStyles.js +9 -9
- package/build/esm/components/FullScreenStepperProgress/FullScreenStepperProgressStyles.js.map +1 -1
- package/build/esm/components/FullScreenStepperProgress/index.d.ts +1 -1
- package/build/esm/components/List/List.d.ts +0 -1
- package/build/esm/components/List/List.js +4 -6
- package/build/esm/components/List/List.js.map +1 -1
- package/build/esm/components/List/index.d.ts +1 -1
- package/build/esm/components/List/styles.js +3 -3
- package/build/esm/components/List/styles.js.map +1 -1
- package/build/esm/components/Page/Page.js +3 -4
- package/build/esm/components/Page/Page.js.map +1 -1
- package/build/esm/components/PageBody/PageBody.js +3 -4
- package/build/esm/components/PageBody/PageBody.js.map +1 -1
- package/build/esm/components/PageSection/PageSection.js +4 -5
- package/build/esm/components/PageSection/PageSection.js.map +1 -1
- package/build/esm/components/PageSection/PageSectionStyles.js +8 -14
- package/build/esm/components/PageSection/PageSectionStyles.js.map +1 -1
- package/build/esm/components/PageSectionHead/PageSectionHead.js +4 -5
- package/build/esm/components/PageSectionHead/PageSectionHead.js.map +1 -1
- package/build/esm/components/PageSectionTitle/PageSectionTitle.d.ts +0 -1
- package/build/esm/components/PageSectionTitle/PageSectionTitle.js +4 -5
- package/build/esm/components/PageSectionTitle/PageSectionTitle.js.map +1 -1
- package/build/esm/components/PageSectionTitle/styles.js +2 -2
- package/build/esm/components/PageSectionTitle/styles.js.map +1 -1
- package/build/esm/components/PageSections/PageSections.js +3 -4
- package/build/esm/components/PageSections/PageSections.js.map +1 -1
- package/build/esm/components/SelectableCard/SelectableCard.js +7 -8
- package/build/esm/components/SelectableCard/SelectableCard.js.map +1 -1
- package/build/esm/components/SelectableCard/SelectableCardStyles.js +8 -20
- package/build/esm/components/SelectableCard/SelectableCardStyles.js.map +1 -1
- package/build/esm/components/SelectableCard/index.d.ts +2 -2
- package/build/esm/components/SettingsIndexCard/SettingsIndexCard.js +6 -7
- package/build/esm/components/SettingsIndexCard/SettingsIndexCard.js.map +1 -1
- package/build/esm/components/SettingsIndexCard/SettingsIndexCardProps.d.ts +1 -1
- package/build/esm/components/SettingsIndexCard/SettingsIndexCardStyles.d.ts +1 -1
- package/build/esm/components/SettingsIndexCard/SettingsIndexCardStyles.js +3 -3
- package/build/esm/components/SettingsIndexCard/SettingsIndexCardStyles.js.map +1 -1
- package/build/esm/components/SettingsIndexCard/index.d.ts +1 -1
- package/build/esm/components/SettingsIndexCardGroup/SettingsIndexCardGroup.d.ts +0 -1
- package/build/esm/components/SettingsIndexCardGroup/SettingsIndexCardGroup.js +3 -4
- package/build/esm/components/SettingsIndexCardGroup/SettingsIndexCardGroup.js.map +1 -1
- package/build/esm/components/StandardListItem/StandardListItem.d.ts +0 -1
- package/build/esm/components/StandardListItem/StandardListItem.js +7 -8
- package/build/esm/components/StandardListItem/StandardListItem.js.map +1 -1
- package/build/esm/components/StandardListItem/index.d.ts +1 -1
- package/build/esm/components/Toast/Toast.js +4 -6
- package/build/esm/components/Toast/Toast.js.map +1 -1
- package/build/esm/components/Toast/ToastStyles.js +2 -2
- package/build/esm/components/Toast/ToastStyles.js.map +1 -1
- package/build/esm/components/Toast/index.d.ts +2 -2
- package/build/esm/components/index.d.ts +27 -26
- package/build/esm/hooks/useDialog.d.ts +0 -1
- package/build/esm/hooks/useDialog.js +7 -7
- package/build/esm/hooks/useDialog.js.map +1 -1
- package/build/esm/hooks/useFullScreenStepperContext.d.ts +1 -1
- package/build/esm/hooks/useFullScreenStepperContext.js +1 -1
- package/build/esm/hooks/useFullScreenStepperContext.js.map +1 -1
- package/build/esm/hooks/useSelectableCard.js +11 -13
- package/build/esm/hooks/useSelectableCard.js.map +1 -1
- package/build/esm/theme/adminDarkTheme.d.ts +1 -1
- package/build/esm/theme/adminDarkTheme.js +19 -5
- package/build/esm/theme/adminDarkTheme.js.map +1 -1
- package/build/esm/theme/adminLightTheme.js +19 -5
- package/build/esm/theme/adminLightTheme.js.map +1 -1
- package/build/esm/theme/breakpoints.js +1 -1
- package/build/esm/theme/breakpoints.js.map +1 -1
- package/build/esm/theme/customThemeProperties.js +20 -14
- package/build/esm/theme/customThemeProperties.js.map +1 -1
- package/build/esm/theme/overrides.js +1 -1
- package/build/esm/theme/overrides.js.map +1 -1
- package/build/esm/theme/palette.js +4 -4
- package/build/esm/theme/palette.js.map +1 -1
- package/build/esm/theme/props.js +1 -1
- package/build/esm/theme/props.js.map +1 -1
- package/build/esm/theme/typography.js +2 -2
- package/build/esm/theme/typography.js.map +1 -1
- package/package.json +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableCard.js","sources":["../../../../src/components/SelectableCard/SelectableCard.tsx"],"sourcesContent":["import React, { FC } from 'react'\n\nimport { Card, CardActionArea, CardContent, Icon } from '@popmenu/common-ui'\nimport { CheckCircle, Circle } from '@popmenu/web-icons'\nimport { useSelectableCardStyles } from './SelectableCardStyles'\nimport { SelectableCardProps } from './SelectableCardProps'\n\nexport const SelectableCard: FC<SelectableCardProps> = (props) => {\n const {\n children,\n selected: selectedProp,\n selection = [],\n onClick,\n value,\n labelId,\n CardActionAreaProps,\n ...muiProps\n } = props\n const selected = typeof selectedProp === 'boolean' ? selectedProp : selection.includes(value)\n const classes = useSelectableCardStyles({ ...props, selected })\n\n const handleClick = () => {\n onClick(value)\n }\n\n return (\n <Card classes={{ root: classes.root }} {...muiProps}>\n <CardActionArea\n onClick={handleClick}\n classes={{ focusHighlight: classes.focusHighlight }}\n role=\"checkbox\"\n aria-checked={selected}\n aria-labelledby={labelId}\n {...CardActionAreaProps}\n >\n <Icon className={classes.icon} icon={selected ? CheckCircle : Circle} size=\"medium\" />\n <CardContent classes={{ root: classes.cardContent }}>{children}</CardContent>\n </CardActionArea>\n </Card>\n )\n}\n\nSelectableCard.displayName = 'SelectableCard'\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectableCard.js","sources":["../../../../src/components/SelectableCard/SelectableCard.tsx"],"sourcesContent":["import React, { FC } from 'react'\n\nimport { Card, CardActionArea, CardContent, Icon } from '@popmenu/common-ui'\nimport { CheckCircle, Circle } from '@popmenu/web-icons'\nimport { useSelectableCardStyles } from './SelectableCardStyles'\nimport { SelectableCardProps } from './SelectableCardProps'\n\nexport const SelectableCard: FC<SelectableCardProps> = (props) => {\n const {\n children,\n selected: selectedProp,\n selection = [],\n onClick,\n value,\n labelId,\n CardActionAreaProps,\n ...muiProps\n } = props\n const selected = typeof selectedProp === 'boolean' ? selectedProp : selection.includes(value)\n const classes = useSelectableCardStyles({ ...props, selected })\n\n const handleClick = () => {\n onClick(value)\n }\n\n return (\n <Card classes={{ root: classes.root }} {...muiProps}>\n <CardActionArea\n onClick={handleClick}\n classes={{ focusHighlight: classes.focusHighlight }}\n role=\"checkbox\"\n aria-checked={selected}\n aria-labelledby={labelId}\n {...CardActionAreaProps}\n >\n <Icon className={classes.icon} icon={selected ? CheckCircle : Circle} size=\"medium\" />\n <CardContent classes={{ root: classes.cardContent }}>{children}</CardContent>\n </CardActionArea>\n </Card>\n )\n}\n\nSelectableCard.displayName = 'SelectableCard'\n"],"names":[],"mappings":";;;;;AAOa,MAAA,cAAc,GAA4B,CAAC,KAAK,KAAI;IAC/D,MAAM,EACJ,QAAQ,EACR,QAAQ,EAAE,YAAY,EACtB,SAAS,GAA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4
|
+
const { palette: { info, grey, getContrastText }, spacing, } = theme;
|
|
5
|
+
const selectedBackgroundColor = lighten(theme.palette.info.light, 0.9);
|
|
6
|
+
const backgroundColor = theme.palette.surface.light;
|
|
7
7
|
return {
|
|
8
8
|
root: {
|
|
9
9
|
position: 'relative',
|
|
10
|
-
border:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
backgroundColor: function (_a) {
|
|
15
|
-
var selected = _a.selected;
|
|
16
|
-
return (selected ? selectedBackgroundColor : backgroundColor);
|
|
17
|
-
},
|
|
18
|
-
color: function (_a) {
|
|
19
|
-
var selected = _a.selected;
|
|
20
|
-
return (selected ? getContrastText(selectedBackgroundColor) : getContrastText(backgroundColor));
|
|
21
|
-
},
|
|
10
|
+
border: ({ selected }) => (selected ? `1px solid ${info.light}` : `1px solid ${grey[700]}`),
|
|
11
|
+
backgroundColor: ({ selected }) => (selected ? selectedBackgroundColor : backgroundColor),
|
|
12
|
+
color: ({ selected }) => (selected ? getContrastText(selectedBackgroundColor) : getContrastText(backgroundColor)),
|
|
22
13
|
transition: 'none',
|
|
23
14
|
},
|
|
24
15
|
cardContent: {
|
|
@@ -32,10 +23,7 @@ var useSelectableCardStyles = makeStyles(function (theme) {
|
|
|
32
23
|
position: 'absolute',
|
|
33
24
|
top: spacing(2),
|
|
34
25
|
left: spacing(2),
|
|
35
|
-
color:
|
|
36
|
-
var selected = _a.selected;
|
|
37
|
-
return (selected ? info.main : grey[700]);
|
|
38
|
-
},
|
|
26
|
+
color: ({ selected }) => (selected ? info.main : grey[700]),
|
|
39
27
|
},
|
|
40
28
|
focusHighlight: {
|
|
41
29
|
backgroundColor: 'inherit',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableCardStyles.js","sources":["../../../../src/components/SelectableCard/SelectableCardStyles.ts"],"sourcesContent":["import { lighten, makeStyles, Theme } from '@material-ui/core'\n\nimport { SelectableCardProps } from './SelectableCardProps'\n\nexport const useSelectableCardStyles = makeStyles<Theme, SelectableCardProps>((theme) => {\n const {\n palette: { info, grey, getContrastText },\n spacing,\n } = theme\n const selectedBackgroundColor = lighten(theme.palette.info.light, 0.9)\n const backgroundColor = theme.palette.surface.light\n return {\n root: {\n position: 'relative',\n border: ({ selected }) => (selected ? `1px solid ${info.light}` : `1px solid ${grey[700]}`),\n backgroundColor: ({ selected }) => (selected ? selectedBackgroundColor : backgroundColor),\n color: ({ selected }) => (selected ? getContrastText(selectedBackgroundColor) : getContrastText(backgroundColor)),\n transition: 'none',\n },\n cardContent: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: spacing(2.5),\n },\n icon: {\n position: 'absolute',\n top: spacing(2),\n left: spacing(2),\n color: ({ selected }) => (selected ? info.main : grey[700]),\n },\n focusHighlight: {\n backgroundColor: 'inherit',\n },\n }\n})\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"SelectableCardStyles.js","sources":["../../../../src/components/SelectableCard/SelectableCardStyles.ts"],"sourcesContent":["import { lighten, makeStyles, Theme } from '@material-ui/core'\n\nimport { SelectableCardProps } from './SelectableCardProps'\n\nexport const useSelectableCardStyles = makeStyles<Theme, SelectableCardProps>((theme) => {\n const {\n palette: { info, grey, getContrastText },\n spacing,\n } = theme\n const selectedBackgroundColor = lighten(theme.palette.info.light, 0.9)\n const backgroundColor = theme.palette.surface.light\n return {\n root: {\n position: 'relative',\n border: ({ selected }) => (selected ? `1px solid ${info.light}` : `1px solid ${grey[700]}`),\n backgroundColor: ({ selected }) => (selected ? selectedBackgroundColor : backgroundColor),\n color: ({ selected }) => (selected ? getContrastText(selectedBackgroundColor) : getContrastText(backgroundColor)),\n transition: 'none',\n },\n cardContent: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: spacing(2.5),\n },\n icon: {\n position: 'absolute',\n top: spacing(2),\n left: spacing(2),\n color: ({ selected }) => (selected ? info.main : grey[700]),\n },\n foc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,CAAC,CAAC;YAChB,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5D,SAAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,eAAe,EAAE,SAAS;AAC3B,SAAA;KACF;AACH,CAAC;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SelectableCard
|
|
2
|
-
export { SelectableCardProps } from './SelectableCardProps';
|
|
1
|
+
export { SelectableCard } from './SelectableCard';
|
|
2
|
+
export type { SelectableCardProps } from './SelectableCardProps';
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import React, { forwardRef } from 'react';
|
|
3
2
|
import { ButtonBase, Card, CardContent, Box, Icon, Typography } from '@popmenu/common-ui';
|
|
4
3
|
import { Help } from '@popmenu/web-icons';
|
|
5
4
|
import { useSettingsIndexCardStyles } from './SettingsIndexCardStyles.js';
|
|
6
5
|
|
|
7
6
|
// eslint-disable-next-line react/display-name -- false positive
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return (React.createElement(ButtonBase,
|
|
7
|
+
const SettingsIndexCard = forwardRef((props, ref) => {
|
|
8
|
+
const { title, description, Icon: Icon$1, onClick, statusLabel, ...restProps } = props;
|
|
9
|
+
const classes = useSettingsIndexCardStyles(props);
|
|
10
|
+
const showStatusLabel = statusLabel?.text && statusLabel?.color;
|
|
11
|
+
return (React.createElement(ButtonBase, { onClick: onClick, ref: ref, ...restProps },
|
|
13
12
|
React.createElement(Card, { classes: { root: classes.cardRoot } },
|
|
14
13
|
React.createElement(CardContent, { classes: { root: classes.cardContentRoot } },
|
|
15
14
|
React.createElement(Box, { fontSize: "32px", display: "flex", justifyContent: 'space-between', alignItems: "center", paddingBottom: 2 },
|
|
16
15
|
React.createElement(Icon, { icon: Icon$1 || Help, size: "inherit" }),
|
|
17
|
-
showStatusLabel && (React.createElement(Typography, { weight: "semi-bold", variant: "body2", color: statusLabel
|
|
16
|
+
showStatusLabel && (React.createElement(Typography, { weight: "semi-bold", variant: "body2", color: statusLabel?.color }, statusLabel?.text))),
|
|
18
17
|
React.createElement(Typography, { align: "left", variant: "h6", gutterBottom: true }, title),
|
|
19
18
|
description && (React.createElement(Typography, { align: "left", variant: "body2", color: "grey.700" }, description))))));
|
|
20
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsIndexCard.js","sources":["../../../../src/components/SettingsIndexCard/SettingsIndexCard.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { ButtonBase, Card, CardContent, Typography } from '@popmenu/common-ui'\nimport { SettingsIndexCardProps } from './SettingsIndexCardProps'\nimport { Icon as CommonIcon, Box } from '@popmenu/common-ui'\nimport { Help } from '@popmenu/web-icons'\nimport { useSettingsIndexCardStyles } from './SettingsIndexCardStyles'\n\ninterface SettingsIndexCardType {\n <C extends React.ElementType = 'a'>(props: SettingsIndexCardProps<C> & { component?: C }): React.ReactElement\n defaultProps?: Partial<SettingsIndexCardProps>\n displayName?: string\n}\n\n// eslint-disable-next-line react/display-name -- false positive\nexport const SettingsIndexCard = forwardRef<HTMLButtonElement, SettingsIndexCardProps>((props, ref) => {\n const { title, description, Icon, onClick, statusLabel, ...restProps } = props\n const classes = useSettingsIndexCardStyles(props)\n const showStatusLabel = statusLabel?.text && statusLabel?.color\n return (\n <ButtonBase onClick={onClick} ref={ref} {...restProps}>\n <Card classes={{ root: classes.cardRoot }}>\n <CardContent classes={{ root: classes.cardContentRoot }}>\n <Box fontSize=\"32px\" display=\"flex\" justifyContent={'space-between'} alignItems=\"center\" paddingBottom={2}>\n <CommonIcon icon={Icon || Help} size=\"inherit\" />\n {showStatusLabel && (\n <Typography weight=\"semi-bold\" variant=\"body2\" color={statusLabel?.color}>\n {statusLabel?.text}\n </Typography>\n )}\n </Box>\n <Typography align=\"left\" variant=\"h6\" gutterBottom>\n {title}\n </Typography>\n {description && (\n <Typography align=\"left\" variant=\"body2\" color=\"grey.700\">\n {description}\n </Typography>\n )}\n </CardContent>\n </Card>\n </ButtonBase>\n )\n}) as SettingsIndexCardType\n\nSettingsIndexCard.displayName = 'SettingsIndexCard'\n"],"names":["Icon","CommonIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsIndexCard.js","sources":["../../../../src/components/SettingsIndexCard/SettingsIndexCard.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { ButtonBase, Card, CardContent, Typography } from '@popmenu/common-ui'\nimport { SettingsIndexCardProps } from './SettingsIndexCardProps'\nimport { Icon as CommonIcon, Box } from '@popmenu/common-ui'\nimport { Help } from '@popmenu/web-icons'\nimport { useSettingsIndexCardStyles } from './SettingsIndexCardStyles'\n\ninterface SettingsIndexCardType {\n <C extends React.ElementType = 'a'>(props: SettingsIndexCardProps<C> & { component?: C }): React.ReactElement\n defaultProps?: Partial<SettingsIndexCardProps>\n displayName?: string\n}\n\n// eslint-disable-next-line react/display-name -- false positive\nexport const SettingsIndexCard = forwardRef<HTMLButtonElement, SettingsIndexCardProps>((props, ref) => {\n const { title, description, Icon, onClick, statusLabel, ...restProps } = props\n const classes = useSettingsIndexCardStyles(props)\n const showStatusLabel = statusLabel?.text && statusLabel?.color\n return (\n <ButtonBase onClick={onClick} ref={ref} {...restProps}>\n <Card classes={{ root: classes.cardRoot }}>\n <CardContent classes={{ root: classes.cardContentRoot }}>\n <Box fontSize=\"32px\" display=\"flex\" justifyContent={'space-between'} alignItems=\"center\" paddingBottom={2}>\n <CommonIcon icon={Icon || Help} size=\"inherit\" />\n {showStatusLabel && (\n <Typography weight=\"semi-bold\" variant=\"body2\" color={statusLabel?.color}>\n {statusLabel?.text}\n </Typography>\n )}\n </Box>\n <Typography align=\"left\" variant=\"h6\" gutterBottom>\n {title}\n </Typography>\n {description && (\n <Typography align=\"left\" variant=\"body2\" color=\"grey.700\">\n {description}\n </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E,IAAI,CACP,CACd,CACG;AACN,gBAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,IAAI,EAAC,YAAY,EAAA,IAAA,EAAA,EAC/C,KAAK,CACK;gBACZ,WAAW,KACV,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,UAAU,EAAA,EACtD,WAAW,CACD,CACd,CACW,CACT,CACI;AAEjB,CAAC;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ButtonBaseProps } from '@material-ui/core';
|
|
2
2
|
import { ThemeColors } from '@popmenu/common-ui';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export
|
|
4
|
+
export type SettingsIndexCardProps<C extends React.ElementType = 'button'> = ButtonBaseProps<C, {
|
|
5
5
|
component?: C;
|
|
6
6
|
}> & {
|
|
7
7
|
/** The icon from @popmenu/web-icons to be rendered */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SettingsIndexCardProps } from './SettingsIndexCardProps';
|
|
2
|
-
export declare const useSettingsIndexCardStyles: (props: SettingsIndexCardProps
|
|
2
|
+
export declare const useSettingsIndexCardStyles: (props: SettingsIndexCardProps) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const useSettingsIndexCardStyles = makeStyles((theme) => ({
|
|
4
4
|
cardRoot: {
|
|
5
|
-
border:
|
|
5
|
+
border: `1px solid ${theme.palette.grey[300]}`,
|
|
6
6
|
alignSelf: 'stretch',
|
|
7
7
|
flexGrow: 1,
|
|
8
8
|
'&:hover': {
|
|
@@ -15,7 +15,7 @@ var useSettingsIndexCardStyles = makeStyles(function (theme) { return ({
|
|
|
15
15
|
paddingBottom: theme.spacing(4),
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
-
})
|
|
18
|
+
}));
|
|
19
19
|
|
|
20
20
|
export { useSettingsIndexCardStyles };
|
|
21
21
|
//# sourceMappingURL=SettingsIndexCardStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsIndexCardStyles.js","sources":["../../../../src/components/SettingsIndexCard/SettingsIndexCardStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nimport { SettingsIndexCardProps } from './SettingsIndexCardProps'\n\nexport const useSettingsIndexCardStyles = makeStyles<Theme, SettingsIndexCardProps>((theme) => ({\n cardRoot: {\n border: `1px solid ${theme.palette.grey[300]}`,\n alignSelf: 'stretch',\n flexGrow: 1,\n '&:hover': {\n backgroundColor: '#52B7FF1A',\n },\n },\n cardContentRoot: {\n padding: theme.spacing(4),\n '&:last-child': {\n paddingBottom: theme.spacing(4),\n },\n },\n}))\n"],"names":[],"mappings":";;AAIa,
|
|
1
|
+
{"version":3,"file":"SettingsIndexCardStyles.js","sources":["../../../../src/components/SettingsIndexCard/SettingsIndexCardStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nimport { SettingsIndexCardProps } from './SettingsIndexCardProps'\n\nexport const useSettingsIndexCardStyles = makeStyles<Theme, SettingsIndexCardProps>((theme) => ({\n cardRoot: {\n border: `1px solid ${theme.palette.grey[300]}`,\n alignSelf: 'stretch',\n flexGrow: 1,\n '&:hover': {\n backgroundColor: '#52B7FF1A',\n },\n },\n cardContentRoot: {\n padding: theme.spacing(4),\n '&:last-child': {\n paddingBottom: theme.spacing(4),\n },\n },\n}))\n"],"names":[],"mappings":";;AAIa,MAAA,0BAA0B,GAAG,UAAU,CAAgC,CAAC,KAAK,MAAM;AAC9F,IAAA,QAAQ,EAAE;QACR,MAAM,EAAE,CAAa,UAAA,EAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,CAAA;AAC9C,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,SAAS,EAAE;AACT,YAAA,eAAe,EAAE,WAAW;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACzB,QAAA,cAAc,EAAE;AACd,YAAA,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAChC,SAAA;AACF,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SettingsIndexCard } from './SettingsIndexCard';
|
|
2
|
-
export { SettingsIndexCardProps } from './SettingsIndexCardProps';
|
|
2
|
+
export type { SettingsIndexCardProps } from './SettingsIndexCardProps';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Box } from '@popmenu/common-ui';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return (React.createElement(Box,
|
|
4
|
+
const SettingsIndexCardGroup = (props) => {
|
|
5
|
+
const { children, ...restProps } = props;
|
|
6
|
+
return (React.createElement(Box, { display: "grid", gridGap: 16, gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", ...restProps }, children));
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
export { SettingsIndexCardGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsIndexCardGroup.js","sources":["../../../../src/components/SettingsIndexCardGroup/SettingsIndexCardGroup.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, BoxProps } from '@popmenu/common-ui'\n\nexport const SettingsIndexCardGroup = (props: BoxProps) => {\n const { children, ...restProps } = props\n return (\n <Box display=\"grid\" gridGap={16} gridTemplateColumns=\"repeat(auto-fill, minmax(250px, 1fr))\" {...restProps}>\n {children}\n </Box>\n )\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsIndexCardGroup.js","sources":["../../../../src/components/SettingsIndexCardGroup/SettingsIndexCardGroup.tsx"],"sourcesContent":["import React from 'react'\nimport { Box, BoxProps } from '@popmenu/common-ui'\n\nexport const SettingsIndexCardGroup = (props: BoxProps) => {\n const { children, ...restProps } = props\n return (\n <Box display=\"grid\" gridGap={16} gridTemplateColumns=\"repeat(auto-fill, minmax(250px, 1fr))\" {...restProps}>\n {children}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;AAGa,MAAA,sBAAsB,GAAG,CAAC,KAAe,KAAI;IACxD,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;IACxC,QACE,oBAAC,GAAG,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,EAAE,EAAE,mBAAmB,EAAC,uCAAuC,EAAA,GAAK,SAAS,EACvG,EAAA,QAAQ,CACL;AAEV;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { makeStyles, ListItem, ListItemAvatar, ListItemText, Chip, ListItemSecondaryAction, IconButton } from '@material-ui/core';
|
|
4
3
|
import { Avatar, Icon, Typography } from '@popmenu/common-ui';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
const useStyles = makeStyles((theme) => ({
|
|
7
6
|
chipRoot: {
|
|
8
7
|
marginRight: theme.spacing(4),
|
|
9
8
|
cursor: 'pointer',
|
|
@@ -14,16 +13,16 @@ var useStyles = makeStyles(function (theme) { return ({
|
|
|
14
13
|
listItemText: {
|
|
15
14
|
marginRight: '32px',
|
|
16
15
|
},
|
|
17
|
-
})
|
|
16
|
+
}));
|
|
18
17
|
/**
|
|
19
18
|
* TODO
|
|
20
19
|
* - clean props util
|
|
21
20
|
* - Avatar size and shape
|
|
22
21
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return (React.createElement(ListItem,
|
|
22
|
+
const StandardListItem = (props) => {
|
|
23
|
+
const { itemId, title, meta, body, image, status, secondaryAction, onClick, ...restProps } = props;
|
|
24
|
+
const classes = useStyles(props);
|
|
25
|
+
return (React.createElement(ListItem, { button: Boolean(onClick), onClick: (e) => onClick && onClick(e, props), ...restProps },
|
|
27
26
|
image && (React.createElement(ListItemAvatar, null,
|
|
28
27
|
React.createElement(Avatar, { src: image.src, alt: image.alt }, image.Icon && React.createElement(Icon, { icon: image.Icon })))),
|
|
29
28
|
React.createElement(ListItemText, { disableTypography: true, className: classes.listItemText },
|
|
@@ -32,7 +31,7 @@ var StandardListItem = function (props) {
|
|
|
32
31
|
body && (React.createElement(Typography, { variant: "body2", color: "grey.700", className: classes.body }, body))),
|
|
33
32
|
status && (React.createElement(Chip, { classes: { root: classes.chipRoot }, icon: status.Icon && React.createElement(Icon, { icon: status.Icon }), label: status.text })),
|
|
34
33
|
secondaryAction && (React.createElement(ListItemSecondaryAction, null,
|
|
35
|
-
React.createElement(IconButton, { style: { color: 'black' }, "aria-label": secondaryAction['aria-label'], onClick:
|
|
34
|
+
React.createElement(IconButton, { style: { color: 'black' }, "aria-label": secondaryAction['aria-label'], onClick: (e) => secondaryAction.onClick(e, props) },
|
|
36
35
|
React.createElement(Icon, { icon: secondaryAction.Icon }))))));
|
|
37
36
|
};
|
|
38
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardListItem.js","sources":["../../../../src/components/StandardListItem/StandardListItem.tsx"],"sourcesContent":["import React from 'react'\nimport {\n Chip,\n IconButton,\n ListItem as MuiListItem,\n ListItemAvatar,\n ListItemSecondaryAction,\n ListItemText,\n makeStyles,\n} from '@material-ui/core'\nimport { Avatar, Icon, Typography } from '@popmenu/common-ui'\nimport { StandardListItemProps } from './StandardListItemProps'\n\nconst useStyles = makeStyles((theme) => ({\n chipRoot: {\n marginRight: theme.spacing(4),\n cursor: 'pointer',\n },\n body: {\n paddingTop: '4px',\n },\n listItemText: {\n marginRight: '32px',\n },\n}))\n\n/**\n * TODO\n * - clean props util\n * - Avatar size and shape\n */\n\nexport const StandardListItem = (props: StandardListItemProps) => {\n const { itemId, title, meta, body, image, status, secondaryAction, onClick, ...restProps } = props\n const classes = useStyles(props)\n return (\n <MuiListItem button={Boolean(onClick) as any} onClick={(e) => onClick && onClick(e, props)} {...restProps}>\n {image && (\n <ListItemAvatar>\n <Avatar src={image.src} alt={image.alt}>\n {image.Icon && <Icon icon={image.Icon} />}\n </Avatar>\n </ListItemAvatar>\n )}\n <ListItemText disableTypography className={classes.listItemText}>\n <Typography variant=\"h6\">{title}</Typography>\n {meta && (\n <Typography variant=\"body2\" color=\"secondary.light\">\n {meta}\n </Typography>\n )}\n {body && (\n <Typography variant=\"body2\" color=\"grey.700\" className={classes.body}>\n {body}\n </Typography>\n )}\n </ListItemText>\n {status && (\n <Chip\n classes={{ root: classes.chipRoot }}\n icon={status.Icon && <Icon icon={status.Icon} />}\n label={status.text}\n />\n )}\n {secondaryAction && (\n <ListItemSecondaryAction>\n <IconButton\n style={{ color: 'black' }}\n aria-label={secondaryAction['aria-label']}\n onClick={(e) => secondaryAction.onClick(e, props)}\n >\n <Icon icon={secondaryAction.Icon} />\n </IconButton>\n </ListItemSecondaryAction>\n )}\n </MuiListItem>\n )\n}\n\nexport const Test = () => <MuiListItem button={undefined} />\n"],"names":["MuiListItem"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StandardListItem.js","sources":["../../../../src/components/StandardListItem/StandardListItem.tsx"],"sourcesContent":["import React from 'react'\nimport {\n Chip,\n IconButton,\n ListItem as MuiListItem,\n ListItemAvatar,\n ListItemSecondaryAction,\n ListItemText,\n makeStyles,\n} from '@material-ui/core'\nimport { Avatar, Icon, Typography } from '@popmenu/common-ui'\nimport { StandardListItemProps } from './StandardListItemProps'\n\nconst useStyles = makeStyles((theme) => ({\n chipRoot: {\n marginRight: theme.spacing(4),\n cursor: 'pointer',\n },\n body: {\n paddingTop: '4px',\n },\n listItemText: {\n marginRight: '32px',\n },\n}))\n\n/**\n * TODO\n * - clean props util\n * - Avatar size and shape\n */\n\nexport const StandardListItem = (props: StandardListItemProps) => {\n const { itemId, title, meta, body, image, status, secondaryAction, onClick, ...restProps } = props\n const classes = useStyles(props)\n return (\n <MuiListItem button={Boolean(onClick) as any} onClick={(e) => onClick && onClick(e, props)} {...restProps}>\n {image && (\n <ListItemAvatar>\n <Avatar src={image.src} alt={image.alt}>\n {image.Icon && <Icon icon={image.Icon} />}\n </Avatar>\n </ListItemAvatar>\n )}\n <ListItemText disableTypography className={classes.listItemText}>\n <Typography variant=\"h6\">{title}</Typography>\n {meta && (\n <Typography variant=\"body2\" color=\"secondary.light\">\n {meta}\n </Typography>\n )}\n {body && (\n <Typography variant=\"body2\" color=\"grey.700\" className={classes.body}>\n {body}\n </Typography>\n )}\n </ListItemText>\n {status && (\n <Chip\n classes={{ root: classes.chipRoot }}\n icon={status.Icon && <Icon icon={status.Icon} />}\n label={status.text}\n />\n )}\n {secondaryAction && (\n <ListItemSecondaryAction>\n <IconButton\n style={{ color: 'black' }}\n aria-label={secondaryAction['aria-label']}\n onClick={(e) => secondaryAction.onClick(e, props)}\n >\n <Icon icon={secondaryAction.Icon} />\n </IconButton>\n </ListItemSecondaryAction>\n )}\n </MuiListItem>\n )\n}\n\nexport const Test = () => <MuiListItem button={undefined} />\n"],"names":["MuiListItem"],"mappings":";;;;AAaA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACvC,IAAA,QAAQ,EAAE;AACR,QAAA,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7B,QAAA,MAAM,EAAE,SAAS;AAClB,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,KAAK;AAClB,KAAA;AACD,IAAA,YAAY,EAAE;AACZ,QAAA,WAAW,EAAE,MAAM;AACpB,KAAA;AAC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AAS,EAAE,OAAO,CAAC,IAAI,EACjE,EAAA,IAAI,CACM,CACd,CACY;AACd,QAAA,MAAM,KACL,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EACH,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,EACnC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,KAAC,CAAA,aAAA,CAAA,IAAI,EAAC,EAAA,IAAI,EAAE,MAAM,CAAC,IAAI,EAAA,CAAI,EAChD,KAAK,EAAE,MAAM,CAAC,IAAI,GAClB,CACH;QACA,eAAe,KACd,KAAA,CAAA,aAAA,CAAC,uBAAuB,EAAA,IAAA;AACtB,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,YAAA,EACb,eAAe,CAAC,YAAY,CAAC,EACzC,OAAO,EAAE,CAAC,CAAC,KAAK,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,EAAA;AAEjD,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAA,CAAI,CACzB,CACW,CAC3B,CACW;AAElB;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { StandardListItem } from './StandardListItem';
|
|
2
|
-
export { StandardListItemProps } from './StandardListItemProps';
|
|
2
|
+
export type { StandardListItemProps } from './StandardListItemProps';
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import { Snackbar } from '@material-ui/core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { Alert } from '../Alert/Alert.js';
|
|
5
4
|
import { useToastStyles } from './ToastStyles.js';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
React.createElement(Alert, __assign({ className: classes.root, action: null, severity: severity }, AlertProps), children)));
|
|
6
|
+
const Toast = ({ AlertProps = {}, autoHideDuration = 5000, children, severity, ...muiProps }) => {
|
|
7
|
+
const classes = useToastStyles();
|
|
8
|
+
return (React.createElement(Snackbar, { ClickAwayListenerProps: { mouseEvent: false }, autoHideDuration: autoHideDuration, ...muiProps },
|
|
9
|
+
React.createElement(Alert, { className: classes.root, action: null, severity: severity, ...AlertProps }, children)));
|
|
12
10
|
};
|
|
13
11
|
Toast.displayName = 'Toast';
|
|
14
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { Snackbar as MuiSnackbar } from '@material-ui/core'\nimport React, { FC } from 'react'\n\nimport Alert from '../Alert'\nimport { ToastProps } from './ToastProps'\nimport { useToastStyles } from './ToastStyles'\n\nexport const Toast: FC<ToastProps> = ({\n AlertProps = {},\n autoHideDuration = 5000,\n children,\n severity,\n ...muiProps\n}) => {\n const classes = useToastStyles()\n return (\n <MuiSnackbar ClickAwayListenerProps={{ mouseEvent: false }} autoHideDuration={autoHideDuration} {...muiProps}>\n <Alert className={classes.root} action={null} severity={severity} {...AlertProps}>\n {children}\n </Alert>\n </MuiSnackbar>\n )\n}\n\nToast.displayName = 'Toast'\n"],"names":["MuiSnackbar"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { Snackbar as MuiSnackbar } from '@material-ui/core'\nimport React, { FC } from 'react'\n\nimport { Alert } from '../Alert'\nimport { ToastProps } from './ToastProps'\nimport { useToastStyles } from './ToastStyles'\n\nexport const Toast: FC<ToastProps> = ({\n AlertProps = {},\n autoHideDuration = 5000,\n children,\n severity,\n ...muiProps\n}) => {\n const classes = useToastStyles()\n return (\n <MuiSnackbar ClickAwayListenerProps={{ mouseEvent: false }} autoHideDuration={autoHideDuration} {...muiProps}>\n <Alert className={classes.root} action={null} severity={severity} {...AlertProps}>\n {children}\n </Alert>\n </MuiSnackbar>\n )\n}\n\nToast.displayName = 'Toast'\n"],"names":["MuiSnackbar"],"mappings":";;;;;MAOa,KAAK,GAAmB,CAAC,EACpC,UAAU,GAAG,EAAE,EACf,gBAAgB,GAAG,IAAI,EACvB,QAAQ,EACR,QAAQ,EACR,GAAG,QAAQ,EACZ,KAAI;AACH,IAAA,MAAM,OAAO,GAAG,cAAc,EAAE;AAChC,IAAA,QACE,KAAC,CAAA,aAAA,CAAAA,QAAW,EAAC,EAAA,sBAAsB,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,gBAAgB,KAAM,QAAQ,EAAA;QAC1G,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAM,GAAA,UAAU,IAC7E,QAAQ,CACH,CACI;AAElB;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const useToastStyles = makeStyles((theme) => ({
|
|
4
4
|
root: {
|
|
5
5
|
boxSizing: 'border-box',
|
|
6
6
|
padding: theme.spacing(0, 1.5),
|
|
@@ -10,7 +10,7 @@ var useToastStyles = makeStyles(function (theme) { return ({
|
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
-
})
|
|
13
|
+
}));
|
|
14
14
|
|
|
15
15
|
export { useToastStyles };
|
|
16
16
|
//# sourceMappingURL=ToastStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastStyles.js","sources":["../../../../src/components/Toast/ToastStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nexport const useToastStyles = makeStyles<Theme>((theme) => ({\n root: {\n boxSizing: 'border-box',\n padding: theme.spacing(0, 1.5),\n /** TODO: design to define responsive width value. */\n width: '350px',\n '& > div:first-child': {\n alignItems: 'center',\n },\n },\n}))\n"],"names":[],"mappings":";;AAEa,
|
|
1
|
+
{"version":3,"file":"ToastStyles.js","sources":["../../../../src/components/Toast/ToastStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nexport const useToastStyles = makeStyles<Theme>((theme) => ({\n root: {\n boxSizing: 'border-box',\n padding: theme.spacing(0, 1.5),\n /** TODO: design to define responsive width value. */\n width: '350px',\n '& > div:first-child': {\n alignItems: 'center',\n },\n },\n}))\n"],"names":[],"mappings":";;AAEa,MAAA,cAAc,GAAG,UAAU,CAAQ,CAAC,KAAK,MAAM;AAC1D,IAAA,IAAI,EAAE;AACJ,QAAA,SAAS,EAAE,YAAY;QACvB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC;;AAE9B,QAAA,KAAK,EAAE,OAAO;AACd,QAAA,qBAAqB,EAAE;AACrB,YAAA,UAAU,EAAE,QAAQ;AACrB,SAAA;AACF,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Toast
|
|
2
|
-
export { ToastProps } from './ToastProps';
|
|
1
|
+
export { Toast } from './Toast';
|
|
2
|
+
export type { ToastProps } from './ToastProps';
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
1
|
+
export * from './Alert';
|
|
2
|
+
export * from './AlertDialog';
|
|
3
|
+
export * from './AlertDialogHeader';
|
|
4
|
+
export * from './AlertTitle';
|
|
5
|
+
export * from './Button';
|
|
6
|
+
export * from './ButtonGroup';
|
|
7
|
+
export * from './Dialog';
|
|
8
|
+
export * from './DialogActions';
|
|
9
|
+
export * from './DialogContent';
|
|
10
|
+
export * from './DialogTitle';
|
|
11
|
+
export * from './FeatureIntro';
|
|
12
12
|
export * from './FullScreenStepper';
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export { CircularProgress,
|
|
13
|
+
export * from './FullScreenStepperActions';
|
|
14
|
+
export * from './FullScreenStepperContent';
|
|
15
|
+
export * from './List';
|
|
16
|
+
export * from './Page';
|
|
17
|
+
export * from './PageBody';
|
|
18
|
+
export * from './PageSection';
|
|
19
|
+
export * from './PageSectionHead';
|
|
20
|
+
export * from './PageSections';
|
|
21
|
+
export * from './PageSectionTitle';
|
|
22
|
+
export * from './SelectableCard';
|
|
23
|
+
export * from './SettingsIndexCard';
|
|
24
|
+
export * from './SettingsIndexCardGroup';
|
|
25
|
+
export * from './StandardListItem';
|
|
26
|
+
export * from './Toast';
|
|
27
|
+
export { CircularProgress, MenuItem, Switch, TextField } from '@material-ui/core';
|
|
28
|
+
export type { CircularProgressProps, MenuItemProps, SwitchProps, TextFieldProps } from '@material-ui/core';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return [triggerProps, dialogProps, { open
|
|
3
|
+
const useDialog = () => {
|
|
4
|
+
const [open, setOpen] = useState(false);
|
|
5
|
+
const toggle = () => setOpen((current) => !current);
|
|
6
|
+
const close = () => setOpen(false);
|
|
7
|
+
const triggerProps = { onClick: toggle };
|
|
8
|
+
const dialogProps = { open, onClose: close };
|
|
9
|
+
return [triggerProps, dialogProps, { open, setOpen, toggle, close }];
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export { useDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDialog.js","sources":["../../../src/hooks/useDialog.ts"],"sourcesContent":["import { useState } from 'react'\n\nexport const useDialog = () => {\n const [open, setOpen] = useState(false)\n const toggle = () => setOpen((current) => !current)\n const close = () => setOpen(false)\n const triggerProps = { onClick: toggle }\n const dialogProps = { open, onClose: close }\n return [triggerProps, dialogProps, { open, setOpen, toggle, close }]\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useDialog.js","sources":["../../../src/hooks/useDialog.ts"],"sourcesContent":["import { useState } from 'react'\n\nexport const useDialog = () => {\n const [open, setOpen] = useState(false)\n const toggle = () => setOpen((current) => !current)\n const close = () => setOpen(false)\n const triggerProps = { onClick: toggle }\n const dialogProps = { open, onClose: close }\n return [triggerProps, dialogProps, { open, setOpen, toggle, close }]\n}\n"],"names":[],"mappings":";;AAEO,MAAM,SAAS,GAAG,MAAK;IAC5B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AACvC,IAAA,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;AAClC,IAAA,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE;IACxC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;AAC5C,IAAA,OAAO,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACtE;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FullScreenStepperContextValue } from '../components/FullScreenStepper';
|
|
1
|
+
import { FullScreenStepperContextValue } from '../components/FullScreenStepper/FullScreenStepperContext';
|
|
2
2
|
export declare const useFullScreenStepperContext: () => FullScreenStepperContextValue;
|
|
@@ -2,7 +2,7 @@ import { useContext } from 'react';
|
|
|
2
2
|
import '../components/FullScreenStepper/FullScreenStepper.js';
|
|
3
3
|
import { FullScreenStepperContext } from '../components/FullScreenStepper/FullScreenStepperContext.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const useFullScreenStepperContext = () => useContext(FullScreenStepperContext);
|
|
6
6
|
|
|
7
7
|
export { useFullScreenStepperContext };
|
|
8
8
|
//# sourceMappingURL=useFullScreenStepperContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFullScreenStepperContext.js","sources":["../../../src/hooks/useFullScreenStepperContext.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { FullScreenStepperContext
|
|
1
|
+
{"version":3,"file":"useFullScreenStepperContext.js","sources":["../../../src/hooks/useFullScreenStepperContext.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { FullScreenStepperContext } from '../components/FullScreenStepper'\nimport { FullScreenStepperContextValue } from '../components/FullScreenStepper/FullScreenStepperContext'\n\nexport const useFullScreenStepperContext = (): FullScreenStepperContextValue => useContext(FullScreenStepperContext)\n"],"names":[],"mappings":";;;;AAIa,MAAA,2BAA2B,GAAG,MAAqC,UAAU,CAAC,wBAAwB;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __spreadArray } from 'tslib';
|
|
2
1
|
import { useState } from 'react';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -10,26 +9,25 @@ import { useState } from 'react';
|
|
|
10
9
|
* @param {number} [config.maxSelectionCount] - A number to determine the maximum amount of cards to be selected.
|
|
11
10
|
* @returns {HookResult} An object with click handler and current state. Spread into a SelectableCard to use.
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var handleSingleSelectionMode = function (value) {
|
|
12
|
+
const useSelectableCard = (config = {}) => {
|
|
13
|
+
const { defaultSelected = [], selectionMode = 'single', maxSelectionCount } = config;
|
|
14
|
+
const initialState = Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected];
|
|
15
|
+
const [selection, setSelection] = useState(initialState);
|
|
16
|
+
let onClick;
|
|
17
|
+
const handleSingleSelectionMode = (value) => {
|
|
20
18
|
setSelection([value]);
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const handleMultiSelectionMode = (value) => {
|
|
21
|
+
let newSelection = [...selection];
|
|
24
22
|
if (!selection.includes(value)) {
|
|
25
23
|
if (selection.length === maxSelectionCount) {
|
|
26
24
|
newSelection.shift();
|
|
27
25
|
}
|
|
28
|
-
newSelection =
|
|
26
|
+
newSelection = [...newSelection, value];
|
|
29
27
|
setSelection(newSelection);
|
|
30
28
|
}
|
|
31
29
|
else {
|
|
32
|
-
newSelection = newSelection.filter(
|
|
30
|
+
newSelection = newSelection.filter((selected) => selected !== value);
|
|
33
31
|
setSelection(newSelection);
|
|
34
32
|
}
|
|
35
33
|
};
|
|
@@ -43,7 +41,7 @@ var useSelectableCard = function (config) {
|
|
|
43
41
|
default:
|
|
44
42
|
onClick = handleSingleSelectionMode;
|
|
45
43
|
}
|
|
46
|
-
return { card: { onClick
|
|
44
|
+
return { card: { onClick, selection }, selection, setSelection };
|
|
47
45
|
};
|
|
48
46
|
|
|
49
47
|
export { useSelectableCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectableCard.js","sources":["../../../src/hooks/useSelectableCard.ts"],"sourcesContent":["import { useState } from 'react'\n\ninterface Config {\n defaultSelected?: Array<string>\n selectionMode?: 'single' | 'multi'\n maxSelectionCount?: number\n}\ninterface Result {\n card: {\n onClick: (value: string) => void\n selection: Array<string>\n }\n selection: Array<string>\n setSelection: (selection: Array<string>) => void\n}\n\n/**\n * Manages state for SelectableCards.\n * @param {Config} config - Configures the hook behavior.\n * @param {string|string[]} [config.defaultSelected = []] - Initializes state with the provided value.\n * @param {string} [config.selectionMode = 'single'] - Determines selection behavior. 'single' provides radio style\n * selection. 'multi' provides checkbox style selection.\n * @param {number} [config.maxSelectionCount] - A number to determine the maximum amount of cards to be selected.\n * @returns {HookResult} An object with click handler and current state. Spread into a SelectableCard to use.\n */\n\nexport const useSelectableCard: (config?: Config) => Result = (config = {}) => {\n const { defaultSelected = [], selectionMode = 'single', maxSelectionCount } = config\n const initialState = Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected]\n const [selection, setSelection] = useState(initialState)\n let onClick\n const handleSingleSelectionMode = (value: string) => {\n setSelection([value])\n }\n const handleMultiSelectionMode = (value: string) => {\n let newSelection = [...selection]\n if (!selection.includes(value)) {\n if (selection.length === maxSelectionCount) {\n newSelection.shift()\n }\n newSelection = [...newSelection, value]\n setSelection(newSelection)\n } else {\n newSelection = newSelection.filter((selected) => selected !== value)\n setSelection(newSelection)\n }\n }\n switch (selectionMode) {\n case 'single':\n onClick = handleSingleSelectionMode\n break\n case 'multi':\n onClick = handleMultiSelectionMode\n break\n default:\n onClick = handleSingleSelectionMode\n }\n return { card: { onClick, selection }, selection, setSelection }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSelectableCard.js","sources":["../../../src/hooks/useSelectableCard.ts"],"sourcesContent":["import { useState } from 'react'\n\ninterface Config {\n defaultSelected?: Array<string>\n selectionMode?: 'single' | 'multi'\n maxSelectionCount?: number\n}\ninterface Result {\n card: {\n onClick: (value: string) => void\n selection: Array<string>\n }\n selection: Array<string>\n setSelection: (selection: Array<string>) => void\n}\n\n/**\n * Manages state for SelectableCards.\n * @param {Config} config - Configures the hook behavior.\n * @param {string|string[]} [config.defaultSelected = []] - Initializes state with the provided value.\n * @param {string} [config.selectionMode = 'single'] - Determines selection behavior. 'single' provides radio style\n * selection. 'multi' provides checkbox style selection.\n * @param {number} [config.maxSelectionCount] - A number to determine the maximum amount of cards to be selected.\n * @returns {HookResult} An object with click handler and current state. Spread into a SelectableCard to use.\n */\n\nexport const useSelectableCard: (config?: Config) => Result = (config = {}) => {\n const { defaultSelected = [], selectionMode = 'single', maxSelectionCount } = config\n const initialState = Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected]\n const [selection, setSelection] = useState(initialState)\n let onClick\n const handleSingleSelectionMode = (value: string) => {\n setSelection([value])\n }\n const handleMultiSelectionMode = (value: string) => {\n let newSelection = [...selection]\n if (!selection.includes(value)) {\n if (selection.length === maxSelectionCount) {\n newSelection.shift()\n }\n newSelection = [...newSelection, value]\n setSelection(newSelection)\n } else {\n newSelection = newSelection.filter((selected) => selected !== value)\n setSelection(newSelection)\n }\n }\n switch (selectionMode) {\n case 'single':\n onClick = handleSingleSelectionMode\n break\n case 'multi':\n onClick = handleMultiSelectionMode\n break\n default:\n onClick = handleSingleSelectionMode\n }\n return { card: { onClick, selection }, selection, setSelection }\n}\n"],"names":[],"mappings":";;AAgBA;;;;;;;;AAQG;MAEU,iBAAiB,GAAgC,CAAC,MAAM,GAAG,EAAE,KAAI;AAC5E,IAAA,MAAM,EAAE,eAAe,GAAG,EAAE,EAAE,aAAa,GAAG,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM;AACpF,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,GAAG,CAAC,eAAe,CAAC;IACzF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC;AACxD,IAAA,IAAI,OAAO;AACX,IAAA,MAAM,yBAAyB,GAAG,CAAC,KAAa,KAAI;AAClD,QAAA,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC;AACvB,KAAC;AACD,IAAA,MAAM,wBAAwB,GAAG,CAAC,KAAa,KAAI;AACjD,QAAA,IAAI,YAAY,GAAG,CAAC,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC9B,YAAA,IAAI,SAAS,CAAC,MAAM,KAA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