@popmenu/common-ui 0.127.0 → 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/Avatar/AvatarProps.d.ts +2 -2
- package/build/cjs/components/Button/Button.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/Chip/Chip.d.ts +1 -1
- package/build/cjs/components/Chip/ChipProps.d.ts +2 -2
- package/build/cjs/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
- package/build/cjs/components/Divider/DividerProps.d.ts +1 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/context.d.ts +0 -1
- package/build/cjs/components/Icon/IconStyles.d.ts +1 -1
- package/build/cjs/components/IconButton/IconButtonProps.d.ts +1 -1
- package/build/cjs/components/Link/LinkStyles.d.ts +1 -1
- package/build/cjs/components/NumberField/NumberField.d.ts +0 -1
- package/build/cjs/components/NumberField/NumberFieldStyles.d.ts +1 -1
- package/build/cjs/components/SplitInput/SplitInputStyles.d.ts +1 -1
- package/build/cjs/components/Tooltip/TooltipProps.d.ts +1 -1
- package/build/cjs/components/Typography/Typography.d.ts +1 -1
- package/build/cjs/components/Typography/TypographyProps.d.ts +3 -3
- package/build/cjs/components/Typography/TypographyStyles.d.ts +1 -1
- package/build/cjs/hooks/useTabs/useTabsResult.d.ts +3 -3
- package/build/cjs/index.js +412 -437
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/types/index.d.ts +2 -2
- package/build/esm/components/Avatar/Avatar.js +9 -10
- package/build/esm/components/Avatar/Avatar.js.map +1 -1
- package/build/esm/components/Avatar/AvatarProps.d.ts +2 -2
- package/build/esm/components/Avatar/avatar.styles.js +11 -11
- package/build/esm/components/Avatar/avatar.styles.js.map +1 -1
- package/build/esm/components/Avatar/util/useImageProps.js +9 -8
- package/build/esm/components/Avatar/util/useImageProps.js.map +1 -1
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js +2 -3
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js.map +1 -1
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js +5 -5
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js.map +1 -1
- package/build/esm/components/Button/Button.d.ts +1 -1
- package/build/esm/components/Button/Button.js +7 -8
- 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 +3 -6
- package/build/esm/components/Button/ButtonStyles.js.map +1 -1
- package/build/esm/components/Checkbox/Checkbox.js +5 -5
- package/build/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/build/esm/components/Chip/Chip.d.ts +1 -1
- package/build/esm/components/Chip/Chip.js +7 -8
- package/build/esm/components/Chip/Chip.js.map +1 -1
- package/build/esm/components/Chip/ChipProps.d.ts +2 -2
- package/build/esm/components/Chip/ChipStyles.js +19 -19
- package/build/esm/components/Chip/ChipStyles.js.map +1 -1
- package/build/esm/components/CollapsibleText/CollapsibleText.js +19 -20
- package/build/esm/components/CollapsibleText/CollapsibleText.js.map +1 -1
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js +5 -6
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js.map +1 -1
- package/build/esm/components/Divider/Divider.js +11 -15
- package/build/esm/components/Divider/Divider.js.map +1 -1
- package/build/esm/components/Divider/DividerProps.d.ts +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +26 -26
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js +6 -6
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +11 -15
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +2 -2
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +49 -52
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +3 -3
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +3 -3
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/context.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/context.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/context.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/theme.js +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/theme.js.map +1 -1
- package/build/esm/components/Icon/Icon.js +12 -8
- package/build/esm/components/Icon/Icon.js.map +1 -1
- package/build/esm/components/Icon/IconStyles.d.ts +1 -1
- package/build/esm/components/Icon/IconStyles.js +7 -9
- package/build/esm/components/Icon/IconStyles.js.map +1 -1
- package/build/esm/components/IconButton/IconButton.js +2 -3
- package/build/esm/components/IconButton/IconButton.js.map +1 -1
- package/build/esm/components/IconButton/IconButtonProps.d.ts +1 -1
- package/build/esm/components/Link/Link.js +4 -5
- package/build/esm/components/Link/Link.js.map +1 -1
- package/build/esm/components/Link/LinkStyles.d.ts +1 -1
- package/build/esm/components/Link/LinkStyles.js +8 -8
- package/build/esm/components/Link/LinkStyles.js.map +1 -1
- package/build/esm/components/NumberField/NumberField.d.ts +0 -1
- package/build/esm/components/NumberField/NumberField.js +14 -9
- package/build/esm/components/NumberField/NumberField.js.map +1 -1
- package/build/esm/components/NumberField/NumberFieldStyles.d.ts +1 -1
- package/build/esm/components/NumberField/NumberFieldStyles.js +4 -4
- package/build/esm/components/NumberField/NumberFieldStyles.js.map +1 -1
- package/build/esm/components/Paper/Paper.js +12 -16
- package/build/esm/components/Paper/Paper.js.map +1 -1
- package/build/esm/components/PaperContent/PaperContent.js +2 -2
- package/build/esm/components/PaperContent/PaperContent.js.map +1 -1
- package/build/esm/components/Radio/Radio.js +5 -5
- package/build/esm/components/Radio/Radio.js.map +1 -1
- package/build/esm/components/SplitInput/SplitInput.js +4 -6
- package/build/esm/components/SplitInput/SplitInput.js.map +1 -1
- package/build/esm/components/SplitInput/SplitInputStyles.d.ts +1 -1
- package/build/esm/components/SplitInput/SplitInputStyles.js +4 -4
- package/build/esm/components/SplitInput/SplitInputStyles.js.map +1 -1
- package/build/esm/components/Switch/Switch.js +6 -6
- package/build/esm/components/Switch/Switch.js.map +1 -1
- package/build/esm/components/Switch/switch.styles.js +2 -2
- package/build/esm/components/Switch/switch.styles.js.map +1 -1
- package/build/esm/components/TabPanel/TabPanel.js +2 -2
- package/build/esm/components/TabPanel/TabPanel.js.map +1 -1
- package/build/esm/components/ToggleButton/ToggleButton.js +5 -6
- package/build/esm/components/ToggleButton/ToggleButton.js.map +1 -1
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js +4 -4
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js.map +1 -1
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js +6 -7
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js +2 -2
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js.map +1 -1
- package/build/esm/components/Tooltip/Tooltip.js +3 -4
- package/build/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -1
- package/build/esm/components/Tooltip/TooltipStyles.js +5 -8
- package/build/esm/components/Tooltip/TooltipStyles.js.map +1 -1
- package/build/esm/components/Typography/Typography.d.ts +1 -1
- package/build/esm/components/Typography/Typography.js +4 -6
- package/build/esm/components/Typography/Typography.js.map +1 -1
- package/build/esm/components/Typography/TypographyProps.d.ts +3 -3
- package/build/esm/components/Typography/TypographyStyles.d.ts +1 -1
- package/build/esm/components/Typography/TypographyStyles.js +29 -47
- package/build/esm/components/Typography/TypographyStyles.js.map +1 -1
- package/build/esm/hooks/useCollapsibleText.js +7 -7
- package/build/esm/hooks/useCollapsibleText.js.map +1 -1
- package/build/esm/hooks/useTabs/useTabs.js +15 -15
- package/build/esm/hooks/useTabs/useTabs.js.map +1 -1
- package/build/esm/hooks/useTabs/useTabsResult.d.ts +3 -3
- package/build/esm/types/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonStyles.js","sources":["../../../../src/components/Button/ButtonStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ButtonProps } from './ButtonProps'\n\nexport const useButtonStyles = makeStyles<Theme, ButtonProps>(() => ({\n root: {\n minWidth: 'unset',\n },\n label: {\n textTransform: ({ textTransform }) => textTransform,\n },\n}))\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ButtonStyles.js","sources":["../../../../src/components/Button/ButtonStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ButtonProps } from './ButtonProps'\n\nexport const useButtonStyles = makeStyles<Theme, ButtonProps>(() => ({\n root: {\n minWidth: 'unset',\n },\n label: {\n textTransform: ({ textTransform }) => textTransform,\n },\n}))\n"],"names":[],"mappings":";;MAGa,eAAe,GAAG,UAAU,CAAqB,OAAO;AACnE,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,EAAE,OAAO;AAClB,KAAA;AACD,IAAA,KAAK,EAAE;QACL,aAAa,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,aAAa;AACpD,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import React, { forwardRef } from 'react';
|
|
3
2
|
import { Checkbox as Checkbox$1, FormControlLabel } from '@material-ui/core';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const Checkbox = forwardRef((props, ref) => {
|
|
5
|
+
const { disabled, LabelProps, ...muiProps } = props;
|
|
6
|
+
const label = LabelProps?.label || props.label;
|
|
7
|
+
const control = React.createElement(Checkbox$1, { disabled: label ? undefined : disabled, ...muiProps });
|
|
8
|
+
return label ? (React.createElement(FormControlLabel, { disabled: disabled, inputRef: ref, control: control, ...LabelProps, label: label })) : (control);
|
|
9
9
|
});
|
|
10
10
|
Checkbox.displayName = 'Checkbox';
|
|
11
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { FormControlLabel, Checkbox as MuiCheckbox } from '@material-ui/core'\nimport { CheckboxProps } from './CheckboxProps'\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {\n const {
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { FormControlLabel, Checkbox as MuiCheckbox } from '@material-ui/core'\nimport { CheckboxProps } from './CheckboxProps'\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {\n const { disabled, LabelProps, ...muiProps } = props\n const label = LabelProps?.label || props.label\n const control = <MuiCheckbox disabled={label ? undefined : disabled} {...muiProps} />\n return label ? (\n <FormControlLabel disabled={disabled} inputRef={ref} control={control} {...LabelProps} label={label} />\n ) : (\n control\n )\n})\n\nCheckbox.displayName = 'Checkbox'\n"],"names":["MuiCheckbox"],"mappings":";;;AAKa,MAAA,QAAQ,GAAG,UAAU,CAAkC,CAAC,KAAK,EAAE,GAAG,KAAI;IACjF,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK;IACnD,MAAM,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK;AAC9C,IAAA,MAAM,OAAO,GAAG,KAAA,CAAA,aAAA,CAACA,UAAW,EAAC,EAAA,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,EAAM,GAAA,QAAQ,GAAI;AACrF,IAAA,OAAO,KAAK,IACV,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAA,GAAM,UAAU,EAAE,KAAK,EAAE,KAAK,EAAI,CAAA,KAEvG,OAAO,CACR;AACH,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChipProps } from './ChipProps';
|
|
3
3
|
export declare const Chip: {
|
|
4
|
-
<C extends React.ElementType
|
|
4
|
+
<C extends React.ElementType = "div">(props: ChipProps<C>): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import { Chip as Chip$1 } from '@material-ui/core';
|
|
3
2
|
import { Warning, CheckCircle, Info, Error, XCircle } from '@popmenu/web-icons';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { useChipStyles } from './ChipStyles.js';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
const IconDictionary = {
|
|
8
7
|
error: Error,
|
|
9
8
|
info: Info,
|
|
10
9
|
success: CheckCircle,
|
|
11
10
|
warning: Warning,
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return React.createElement(Chip$1,
|
|
12
|
+
const Chip = (props) => {
|
|
13
|
+
const { severity, ...restProps } = props;
|
|
14
|
+
const classes = useChipStyles(props);
|
|
15
|
+
const icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
|
|
16
|
+
const deleteIcon = React.createElement(XCircle);
|
|
17
|
+
return React.createElement(Chip$1, { classes: classes, icon: icon, deleteIcon: deleteIcon, ...restProps });
|
|
19
18
|
};
|
|
20
19
|
Chip.displayName = 'Chip';
|
|
21
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Chip as MuiChip } from '@material-ui/core'\nimport { CheckCircle, Error as ErrorIcon, Info, Warning, XCircle } from '@popmenu/web-icons'\nimport React from 'react'\nimport { ChipProps, DefaultChipComponent } from './ChipProps'\nimport { useChipStyles } from './ChipStyles'\n\nconst IconDictionary = {\n error: ErrorIcon,\n info: Info,\n success: CheckCircle,\n warning: Warning,\n}\n\nexport const Chip = <C extends React.ElementType = DefaultChipComponent>(props: ChipProps<C>) => {\n const { severity, ...restProps } = props\n const classes = useChipStyles(props)\n const icon = severity ? React.createElement(IconDictionary[severity]) : undefined\n const deleteIcon = React.createElement(XCircle)\n return <MuiChip classes={classes} icon={icon} deleteIcon={deleteIcon} {...restProps} />\n}\n\nChip.displayName = 'Chip'\n"],"names":["ErrorIcon","MuiChip"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Chip as MuiChip } from '@material-ui/core'\nimport { CheckCircle, Error as ErrorIcon, Info, Warning, XCircle } from '@popmenu/web-icons'\nimport React from 'react'\nimport { ChipProps, DefaultChipComponent } from './ChipProps'\nimport { useChipStyles } from './ChipStyles'\n\nconst IconDictionary = {\n error: ErrorIcon,\n info: Info,\n success: CheckCircle,\n warning: Warning,\n}\n\nexport const Chip = <C extends React.ElementType = DefaultChipComponent>(props: ChipProps<C>) => {\n const { severity, ...restProps } = props\n const classes = useChipStyles(props)\n const icon = severity ? React.createElement(IconDictionary[severity]) : undefined\n const deleteIcon = React.createElement(XCircle)\n return <MuiChip classes={classes} icon={icon} deleteIcon={deleteIcon} {...restProps} />\n}\n\nChip.displayName = 'Chip'\n"],"names":["ErrorIcon","MuiChip"],"mappings":";;;;;AAMA,MAAM,cAAc,GAAG;AACrB,IAAA,KAAK,EAAEA,KAAS;AAChB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,OAAO,EAAE,OAAO;CACjB;AAEY,MAAA,IAAI,GAAG,CAAqD,KAAmB,KAAI;IAC9F,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AACxC,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS;IACjF,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC;AAC/C,IAAA,OAAO,oBAACC,MAAO,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAM,GAAA,SAAS,GAAI;AACzF;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChipTypeMap, ChipProps as MuiChipProps } from '@material-ui/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type DefaultChipComponent = ChipTypeMap['defaultComponent'];
|
|
4
|
+
export type ChipProps<C extends React.ElementType = DefaultChipComponent> = MuiChipProps<C, {
|
|
5
5
|
component?: C;
|
|
6
6
|
}> & {
|
|
7
7
|
severity?: 'success' | 'info' | 'warning' | 'error';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const getBackground = (theme) => (props) => {
|
|
4
|
+
const { variant, severity } = props;
|
|
5
|
+
let background = theme.palette.grey[100];
|
|
6
|
+
const backgrounds = {
|
|
7
7
|
outlined: 'none',
|
|
8
8
|
error: 'error.main',
|
|
9
9
|
warning: 'warning.main',
|
|
@@ -14,17 +14,17 @@ var getBackground = function (theme) { return function (props) {
|
|
|
14
14
|
background = backgrounds[variant];
|
|
15
15
|
}
|
|
16
16
|
else if (severity) {
|
|
17
|
-
|
|
17
|
+
const [color, colorVariant] = backgrounds[severity].split('.');
|
|
18
18
|
// @ts-expect-error - todo.
|
|
19
19
|
background = theme.palette[color][colorVariant];
|
|
20
20
|
}
|
|
21
21
|
return background;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
};
|
|
23
|
+
const getColor = (theme) => (props) => {
|
|
24
|
+
const { variant, severity } = props;
|
|
25
|
+
let textColor;
|
|
26
26
|
if (variant === 'outlined' && severity) {
|
|
27
|
-
|
|
27
|
+
const textColors = {
|
|
28
28
|
error: theme.palette.error.main,
|
|
29
29
|
info: theme.palette.info.main,
|
|
30
30
|
warning: theme.palette.warning.dark,
|
|
@@ -36,7 +36,7 @@ var getColor = function (theme) { return function (props) {
|
|
|
36
36
|
textColor = theme.palette.grey[700];
|
|
37
37
|
}
|
|
38
38
|
else if ((variant === 'default' || variant === undefined) && severity) {
|
|
39
|
-
|
|
39
|
+
const textColors = {
|
|
40
40
|
error: theme.palette.common.white,
|
|
41
41
|
info: theme.palette.secondary.main,
|
|
42
42
|
warning: theme.palette.secondary.main,
|
|
@@ -45,12 +45,12 @@ var getColor = function (theme) { return function (props) {
|
|
|
45
45
|
textColor = textColors[severity];
|
|
46
46
|
}
|
|
47
47
|
return textColor;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
};
|
|
49
|
+
const getBorder = (theme) => (props) => {
|
|
50
|
+
const { variant, severity } = props;
|
|
51
|
+
let borderColor;
|
|
52
52
|
if (variant === 'outlined' && severity) {
|
|
53
|
-
|
|
53
|
+
const borderColors = {
|
|
54
54
|
error: theme.palette.error.main,
|
|
55
55
|
info: theme.palette.info.main,
|
|
56
56
|
warning: theme.palette.warning.dark,
|
|
@@ -59,10 +59,10 @@ var getBorder = function (theme) { return function (props) {
|
|
|
59
59
|
borderColor = borderColors[severity];
|
|
60
60
|
}
|
|
61
61
|
return borderColor;
|
|
62
|
-
};
|
|
62
|
+
};
|
|
63
63
|
// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
|
|
64
64
|
// any component-specific props
|
|
65
|
-
|
|
65
|
+
const useChipStyles = makeStyles((theme) => ({
|
|
66
66
|
root: {
|
|
67
67
|
background: getBackground(theme),
|
|
68
68
|
color: getColor(theme),
|
|
@@ -77,7 +77,7 @@ var useChipStyles = makeStyles(function (theme) { return ({
|
|
|
77
77
|
deleteIcon: {
|
|
78
78
|
color: theme.palette.grey[500],
|
|
79
79
|
},
|
|
80
|
-
})
|
|
80
|
+
}));
|
|
81
81
|
|
|
82
82
|
export { useChipStyles };
|
|
83
83
|
//# sourceMappingURL=ChipStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipStyles.js","sources":["../../../../src/components/Chip/ChipStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ChipProps } from './ChipProps'\n\nconst getBackground = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let background = theme.palette.grey[100]\n const backgrounds = {\n outlined: 'none',\n error: 'error.main',\n warning: 'warning.main',\n info: 'info.light',\n success: 'success.light',\n }\n if (variant === 'outlined') {\n background = backgrounds[variant]\n } else if (severity) {\n const [color, colorVariant] = backgrounds[severity].split('.')\n // @ts-expect-error - todo.\n background = theme.palette[color][colorVariant]\n }\n return background\n}\n\nconst getColor = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let textColor\n if (variant === 'outlined' && severity) {\n const textColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n textColor = textColors[severity]\n } else if (variant === 'outlined' && !severity) {\n textColor = theme.palette.grey[700]\n } else if ((variant === 'default' || variant === undefined) && severity) {\n const textColors = {\n error: theme.palette.common.white,\n info: theme.palette.secondary.main,\n warning: theme.palette.secondary.main,\n success: theme.palette.secondary.main,\n }\n textColor = textColors[severity]\n }\n return textColor\n}\n\nconst getBorder = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let borderColor\n if (variant === 'outlined' && severity) {\n const borderColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n borderColor = borderColors[severity]\n }\n return borderColor\n}\n\n// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on\n// any component-specific props\nexport const useChipStyles = makeStyles<Theme, ChipProps<any>>((theme) => ({\n root: {\n background: getBackground(theme),\n color: getColor(theme),\n borderColor: getBorder(theme),\n borderRadius: theme.spacing(0.5),\n },\n icon: {\n color: 'inherit',\n height: theme.spacing(2),\n width: theme.spacing(2),\n },\n deleteIcon: {\n color: theme.palette.grey[500],\n },\n}))\n"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"ChipStyles.js","sources":["../../../../src/components/Chip/ChipStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ChipProps } from './ChipProps'\n\nconst getBackground = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let background = theme.palette.grey[100]\n const backgrounds = {\n outlined: 'none',\n error: 'error.main',\n warning: 'warning.main',\n info: 'info.light',\n success: 'success.light',\n }\n if (variant === 'outlined') {\n background = backgrounds[variant]\n } else if (severity) {\n const [color, colorVariant] = backgrounds[severity].split('.')\n // @ts-expect-error - todo.\n background = theme.palette[color][colorVariant]\n }\n return background\n}\n\nconst getColor = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let textColor\n if (variant === 'outlined' && severity) {\n const textColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n textColor = textColors[severity]\n } else if (variant === 'outlined' && !severity) {\n textColor = theme.palette.grey[700]\n } else if ((variant === 'default' || variant === undefined) && severity) {\n const textColors = {\n error: theme.palette.common.white,\n info: theme.palette.secondary.main,\n warning: theme.palette.secondary.main,\n success: theme.palette.secondary.main,\n }\n textColor = textColors[severity]\n }\n return textColor\n}\n\nconst getBorder = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let borderColor\n if (variant === 'outlined' && severity) {\n const borderColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n borderColor = borderColors[severity]\n }\n return borderColor\n}\n\n// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on\n// any component-specific props\nexport const useChipStyles = makeStyles<Theme, ChipProps<any>>((theme) => ({\n root: {\n background: getBackground(theme),\n color: getColor(theme),\n borderColor: getBorder(theme),\n borderRadius: theme.spacing(0.5),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OAAO,CAAC,OAAO,CAAC,IAAI;SACpC;AACD,QAAA,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC;;AAEtC,IAAA,OAAO,WAAW;AACpB,CAAC;AAED;AACA;AACa,MAAA,aAAa,GAAG,UAAU,CAAwB,CAAC,KAAK,MAAM;AACzE,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC;AAChC,QAAA,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;AACtB,QAAA,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;AAC7B,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AACjC,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,KAAA;AACD,IAAA,UAAU,EAAE;QACV,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AAC/B,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
1
|
import { useTheme, Box, Collapse } from '@material-ui/core';
|
|
3
2
|
import React, { useState, useRef, useEffect } from 'react';
|
|
4
3
|
import { Typography } from '../Typography/Typography.js';
|
|
5
4
|
import { useCollapsibleTextStyles } from './CollapsibleTextStyles.js';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
useEffect(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const CollapsibleText = (props) => {
|
|
7
|
+
const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props;
|
|
8
|
+
const collapseState = useState(false);
|
|
9
|
+
const typographyRef = useRef(null);
|
|
10
|
+
const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant });
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState;
|
|
13
|
+
const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
|
|
14
|
+
const collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
|
|
15
|
+
const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
16
|
+
const collapsedSizePx = collapsedSizeRem * documentFontSize;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const typographyNode = typographyRef.current;
|
|
19
|
+
const observer = new ResizeObserver((entries) => {
|
|
20
|
+
const typographyEntry = entries.find((entry) => entry.target === typographyNode);
|
|
22
21
|
if (typographyEntry) {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const typographyEntryHeight = typographyEntry.contentRect.height;
|
|
23
|
+
const isCollapsible = typographyEntryHeight > collapsedSizePx;
|
|
25
24
|
setCollapsible(isCollapsible);
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
observer.observe(typographyNode);
|
|
29
|
-
return
|
|
28
|
+
return () => {
|
|
30
29
|
observer.unobserve(typographyNode);
|
|
31
30
|
};
|
|
32
31
|
}, []);
|
|
33
|
-
return (React.createElement(Box,
|
|
32
|
+
return (React.createElement(Box, { position: "relative", overflow: "hidden", ...restProps },
|
|
34
33
|
React.createElement(Collapse, { in: open, collapsedSize: collapsedSizePx + 'px' },
|
|
35
34
|
React.createElement(Typography, { TypographyRef: typographyRef, variant: typographyVariant }, text)),
|
|
36
35
|
collapsible && !open && React.createElement(Box, { className: classes.overlay })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleText.js","sources":["../../../../src/components/CollapsibleText/CollapsibleText.tsx"],"sourcesContent":["import { Box, Collapse, useTheme } from '@material-ui/core'\nimport React, { FC, useEffect, useRef, useState } from 'react'\nimport { Typography } from '../Typography'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\nimport { useCollapsibleTextStyles } from './CollapsibleTextStyles'\n\nexport const CollapsibleText: FC<CollapsibleTextProps> = (props) => {\n const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props\n const collapseState = useState<boolean | undefined>(false)\n const typographyRef = useRef<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>(null)\n const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant })\n const theme = useTheme()\n const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState\n const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight as string)\n const collapsedSizeRem = previewLines * typographyEntryLineHeightRem\n const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize)\n const collapsedSizePx = collapsedSizeRem * documentFontSize\n\n useEffect(() => {\n const typographyNode = typographyRef.current as Element\n const observer = new ResizeObserver((entries) => {\n const typographyEntry = entries.find((entry) => entry.target === typographyNode)\n if (typographyEntry) {\n const typographyEntryHeight = typographyEntry.contentRect.height\n const isCollapsible = typographyEntryHeight > collapsedSizePx\n setCollapsible(isCollapsible)\n }\n })\n observer.observe(typographyNode)\n return () => {\n observer.unobserve(typographyNode)\n }\n }, [])\n\n return (\n <Box position=\"relative\" overflow=\"hidden\" {...restProps}>\n <Collapse in={open} collapsedSize={collapsedSizePx + 'px'}>\n <Typography TypographyRef={typographyRef} variant={typographyVariant}>\n {text}\n </Typography>\n </Collapse>\n {collapsible && !open && <Box className={classes.overlay} />}\n </Box>\n )\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollapsibleText.js","sources":["../../../../src/components/CollapsibleText/CollapsibleText.tsx"],"sourcesContent":["import { Box, Collapse, useTheme } from '@material-ui/core'\nimport React, { FC, useEffect, useRef, useState } from 'react'\nimport { Typography } from '../Typography'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\nimport { useCollapsibleTextStyles } from './CollapsibleTextStyles'\n\nexport const CollapsibleText: FC<CollapsibleTextProps> = (props) => {\n const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props\n const collapseState = useState<boolean | undefined>(false)\n const typographyRef = useRef<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>(null)\n const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant })\n const theme = useTheme()\n const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState\n const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight as string)\n const collapsedSizeRem = previewLines * typographyEntryLineHeightRem\n const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize)\n const collapsedSizePx = collapsedSizeRem * documentFontSize\n\n useEffect(() => {\n const typographyNode = typographyRef.current as Element\n const observer = new ResizeObserver((entries) => {\n const typographyEntry = entries.find((entry) => entry.target === typographyNode)\n if (typographyEntry) {\n const typographyEntryHeight = typographyEntry.contentRect.height\n const isCollapsible = typographyEntryHeight > collapsedSizePx\n setCollapsible(isCollapsible)\n }\n })\n observer.observe(typographyNode)\n return () => {\n observer.unobserve(typographyNode)\n }\n }, [])\n\n return (\n <Box position=\"relative\" overflow=\"hidden\" {...restProps}>\n <Collapse in={open} collapsedSize={collapsedSizePx + 'px'}>\n <Typography TypographyRef={typographyRef} variant={typographyVariant}>\n {text}\n </Typography>\n </Collapse>\n {collapsible && !open && <Box className={classes.overlay} />}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;;AAMa,MAAA,eAAe,GAA6B,CAAC,KAAK,KAAI;IACjE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,GAAG,CAAC,EAAE,iBAAiB,GAAG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAClH,IAAA,MAAM,aAAa,GAAG,QAAQ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AAC;AAEN,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,QAAQ,EAAA,GAAK,SAAS,EAAA;QACtD,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,GAAG,IAAI,EAAA;AACvD,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAA,EACjE,IAAI,CACM,CACJ;AACV,QAAA,WAAW,IAAI,CAAC,IAAI,IAAI,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,EAAI,CAAA,CACxD;AAEV;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CollapsibleTextProps } from './CollapsibleTextProps';
|
|
2
2
|
export declare const useCollapsibleTextStyles: (props: CollapsibleTextProps & {
|
|
3
|
-
fadeStop?: string | number
|
|
4
|
-
typographyVariant:
|
|
3
|
+
fadeStop?: string | number;
|
|
4
|
+
typographyVariant: "body1" | "body2";
|
|
5
5
|
}) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var typography = _a.typography;
|
|
3
|
+
const getFadeStop = ({ typography }, typographyVariant) => {
|
|
5
4
|
// @ts-expect-error - todo.
|
|
6
5
|
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
7
6
|
? // @ts-expect-error - todo.
|
|
8
|
-
typography[typographyVariant].lineHeight
|
|
7
|
+
`${typography[typographyVariant].lineHeight}rem`
|
|
9
8
|
: // @ts-expect-error - todo.
|
|
10
9
|
typography[typographyVariant].lineHeight;
|
|
11
10
|
};
|
|
12
|
-
|
|
11
|
+
const useCollapsibleTextStyles = makeStyles((theme) => ({
|
|
13
12
|
overlay: {
|
|
14
13
|
position: 'absolute',
|
|
15
14
|
top: 0,
|
|
16
15
|
left: 0,
|
|
17
16
|
height: '100%',
|
|
18
17
|
width: '100%',
|
|
19
|
-
background:
|
|
18
|
+
background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,
|
|
20
19
|
},
|
|
21
|
-
})
|
|
20
|
+
}));
|
|
22
21
|
|
|
23
22
|
export { useCollapsibleTextStyles };
|
|
24
23
|
//# sourceMappingURL=CollapsibleTextStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleTextStyles.js","sources":["../../../../src/components/CollapsibleText/CollapsibleTextStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\n\nconst getFadeStop = ({ typography }: Theme, typographyVariant: string) => {\n // @ts-expect-error - todo.\n return !isNaN(Number(typography[typographyVariant].lineHeight))\n ? // @ts-expect-error - todo.\n `${typography[typographyVariant].lineHeight}rem`\n : // @ts-expect-error - todo.\n typography[typographyVariant].lineHeight\n}\n\nexport const useCollapsibleTextStyles = makeStyles<\n Theme,\n CollapsibleTextProps & { fadeStop?: string | number; typographyVariant: 'body1' | 'body2' }\n>((theme) => ({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,\n },\n}))\n"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"CollapsibleTextStyles.js","sources":["../../../../src/components/CollapsibleText/CollapsibleTextStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\n\nconst getFadeStop = ({ typography }: Theme, typographyVariant: string) => {\n // @ts-expect-error - todo.\n return !isNaN(Number(typography[typographyVariant].lineHeight))\n ? // @ts-expect-error - todo.\n `${typography[typographyVariant].lineHeight}rem`\n : // @ts-expect-error - todo.\n typography[typographyVariant].lineHeight\n}\n\nexport const useCollapsibleTextStyles = makeStyles<\n Theme,\n CollapsibleTextProps & { fadeStop?: string | number; typographyVariant: 'body1' | 'body2' }\n>((theme) => ({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,\n },\n}))\n"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAG,CAAC,EAAE,UAAU,EAAS,EAAE,iBAAyB,KAAI;;AAEvE,IAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC;AAC5D;AACE,YAAA,CAAA,EAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAK,GAAA;AAClD;AACE,YAAA,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU;AAC9C,CAAC;AAEY,MAAA,wBAAwB,GAAG,UAAU,CAGhD,CAAC,KAAK,MAAM;AACZ,IAAA,OAAO,EAAE;AACP,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,GAAG,EAAE,CAAC;AACN,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,UAAU,EAAE,CAAC,KAAK,KAAK,CAAA,qCAAA,EAAwC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAG,CAAA,CAAA;AAC9G,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from 'tslib';
|
|
2
1
|
import { makeStyles, Box } from '@material-ui/core';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import React from 'react';
|
|
@@ -13,15 +12,14 @@ var SemanticColors;
|
|
|
13
12
|
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
14
13
|
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
15
14
|
})(SemanticColors || (SemanticColors = {}));
|
|
16
|
-
|
|
15
|
+
const useStyles = makeStyles((theme) => ({
|
|
17
16
|
dividerRoot: {
|
|
18
17
|
gap: theme.spacing(2),
|
|
19
18
|
},
|
|
20
19
|
textRoot: {
|
|
21
|
-
color:
|
|
22
|
-
var textColor = _a.textColor;
|
|
20
|
+
color: ({ textColor }) => {
|
|
23
21
|
if (textColor && Object.values(SemanticColors).includes(textColor)) {
|
|
24
|
-
|
|
22
|
+
const [semanticColor, shade] = textColor.split('.');
|
|
25
23
|
// @ts-expect-error - todo.
|
|
26
24
|
return theme.palette[semanticColor][shade];
|
|
27
25
|
}
|
|
@@ -32,13 +30,12 @@ var useStyles = makeStyles(function (theme) { return ({
|
|
|
32
30
|
return 'black';
|
|
33
31
|
}
|
|
34
32
|
},
|
|
35
|
-
textTransform:
|
|
33
|
+
textTransform: (props) => props.textTransform,
|
|
36
34
|
},
|
|
37
35
|
dividerLine: {
|
|
38
|
-
backgroundColor:
|
|
39
|
-
var dividerColor = _a.dividerColor;
|
|
36
|
+
backgroundColor: ({ dividerColor }) => {
|
|
40
37
|
if (dividerColor && Object.values(SemanticColors).includes(dividerColor)) {
|
|
41
|
-
|
|
38
|
+
const [semanticColor, shade] = dividerColor.split('.');
|
|
42
39
|
// @ts-expect-error - todo.
|
|
43
40
|
return theme.palette[semanticColor][shade];
|
|
44
41
|
}
|
|
@@ -50,15 +47,14 @@ var useStyles = makeStyles(function (theme) { return ({
|
|
|
50
47
|
}
|
|
51
48
|
},
|
|
52
49
|
},
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
50
|
+
}));
|
|
51
|
+
const Divider = ({ TypographyProps, className, dividerColor, text, textColor, textTransform = 'lowercase', }) => {
|
|
52
|
+
const classes = useStyles({ dividerColor, textColor, textTransform });
|
|
53
|
+
const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
58
54
|
return (React.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
|
|
59
55
|
React.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
|
|
60
56
|
text && (React.createElement(React.Fragment, null,
|
|
61
|
-
React.createElement(Typography,
|
|
57
|
+
React.createElement(Typography, { className: classes.textRoot, ...TypographyProps }, text),
|
|
62
58
|
React.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
|
|
63
59
|
};
|
|
64
60
|
Divider.displayName = 'Divider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import { Box, makeStyles, Theme } from '@material-ui/core'\nimport classNames from 'classnames'\nimport React, { FC } from 'react'\nimport { Typography } from '../Typography'\nimport { DividerProps } from './DividerProps'\n\nenum SemanticColors {\n PRIMARY_MAIN = 'primary.main',\n PRIMARY_DARK = 'primary.dark',\n PRIMARY_LIGHT = 'primary.light',\n SECONDARY_MAIN = 'secondary.main',\n SECONDARY_DARK = 'secondary.dark',\n SECONDARY_LIGHT = 'secondary.light',\n}\n\ntype StyleProps = Pick<DividerProps, 'dividerColor' | 'textColor' | 'textTransform'>\n\nconst useStyles = makeStyles<Theme, StyleProps>((theme) => ({\n dividerRoot: {\n gap: theme.spacing(2),\n },\n textRoot: {\n color: ({ textColor }) => {\n if (textColor && Object.values<string>(SemanticColors).includes(textColor)) {\n const [semanticColor, shade] = textColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (textColor) {\n return textColor\n } else {\n return 'black'\n }\n },\n textTransform: (props) => props.textTransform,\n },\n dividerLine: {\n backgroundColor: ({ dividerColor }) => {\n if (dividerColor && Object.values<string>(SemanticColors).includes(dividerColor)) {\n const [semanticColor, shade] = dividerColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (dividerColor) {\n return dividerColor\n } else {\n return theme.palette.grey[500]\n }\n },\n },\n}))\n\nexport const Divider: FC<DividerProps> = ({\n TypographyProps,\n className,\n dividerColor,\n text,\n textColor,\n textTransform = 'lowercase',\n}) => {\n const classes = useStyles({ dividerColor, textColor, textTransform })\n const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset'\n\n return (\n <Box className={classNames([classes.dividerRoot, className])} display=\"flex\" alignItems=\"center\">\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n {text && (\n <>\n <Typography className={classes.textRoot} {...TypographyProps}>\n {text}\n </Typography>\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n </>\n )}\n </Box>\n )\n}\n\nDivider.displayName = 'Divider'\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import { Box, makeStyles, Theme } from '@material-ui/core'\nimport classNames from 'classnames'\nimport React, { FC } from 'react'\nimport { Typography } from '../Typography'\nimport { DividerProps } from './DividerProps'\n\nenum SemanticColors {\n PRIMARY_MAIN = 'primary.main',\n PRIMARY_DARK = 'primary.dark',\n PRIMARY_LIGHT = 'primary.light',\n SECONDARY_MAIN = 'secondary.main',\n SECONDARY_DARK = 'secondary.dark',\n SECONDARY_LIGHT = 'secondary.light',\n}\n\ntype StyleProps = Pick<DividerProps, 'dividerColor' | 'textColor' | 'textTransform'>\n\nconst useStyles = makeStyles<Theme, StyleProps>((theme) => ({\n dividerRoot: {\n gap: theme.spacing(2),\n },\n textRoot: {\n color: ({ textColor }) => {\n if (textColor && Object.values<string>(SemanticColors).includes(textColor)) {\n const [semanticColor, shade] = textColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (textColor) {\n return textColor\n } else {\n return 'black'\n }\n },\n textTransform: (props) => props.textTransform,\n },\n dividerLine: {\n backgroundColor: ({ dividerColor }) => {\n if (dividerColor && Object.values<string>(SemanticColors).includes(dividerColor)) {\n const [semanticColor, shade] = dividerColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (dividerColor) {\n return dividerColor\n } else {\n return theme.palette.grey[500]\n }\n },\n },\n}))\n\nexport const Divider: FC<DividerProps> = ({\n TypographyProps,\n className,\n dividerColor,\n text,\n textColor,\n textTransform = 'lowercase',\n}) => {\n const classes = useStyles({ dividerColor, textColor, textTransform })\n const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset'\n\n return (\n <Box className={classNames([classes.dividerRoot, className])} display=\"flex\" alignItems=\"center\">\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n {text && (\n <>\n <Typography className={classes.textRoot} {...TypographyProps}>\n {text}\n </Typography>\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n </>\n )}\n </Box>\n )\n}\n\nDivider.displayName = 'Divider'\n"],"names":[],"mappings":";;;;;AAMA,IAAK,cAOJ;AAPD,CAAA,UAAK,cAAc,EAAA;AACjB,IAAA,cAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,cAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,cAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAPI,cAAc,KAAd,cAAc,GAOlB,EAAA,CAAA,CAAA;AAID,MAAM,SAAS,GAAG,UAAU,CAAoB,CAAC,KAAK,MAAM;AA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OAAO,GAAG,SAAS,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AACrE,IAAA,MAAM,YAAY,GAAG,aAAa,KAAK,WAAW,GAAG,QAAQ,GAAG,OAAO;IAEvE,QACE,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,EAAE,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAA;QAC9F,KAAC,CAAA,aAAA,CAAA,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAC,KAAK,EAAC,SAAS,EAAE,YAAY,EAAI,CAAA;AACxG,QAAA,IAAI,KACH,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;YACE,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAM,GAAA,eAAe,EACzD,EAAA,IAAI,CACM;AACb,YAAA,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAC,KAAK,EAAC,SAAS,EAAE,YAAY,EAAA,CAAI,CACxG,CACJ,CACG;AAEV;AAEA,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypographyProps } from '../Typography';
|
|
2
|
-
|
|
2
|
+
type Colors = 'primary.main' | 'primary.dark' | 'primary.light' | 'secondary.main' | 'secondary.dark' | 'secondary.light';
|
|
3
3
|
export interface DividerProps {
|
|
4
4
|
/** Sets the styles for a divider. */
|
|
5
5
|
className?: string;
|
package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js
CHANGED
|
@@ -2,25 +2,25 @@ import React from 'react';
|
|
|
2
2
|
import { useFollowerAuthenticationDialogContext } from './context.js';
|
|
3
3
|
import { makeStyles, Button, Box, Divider } from '@material-ui/core';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const useStyles = makeStyles(() => ({
|
|
6
6
|
main: {
|
|
7
7
|
width: '100%',
|
|
8
8
|
display: 'flex',
|
|
9
9
|
flexDirection: 'column',
|
|
10
10
|
gridGap: 16,
|
|
11
11
|
},
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
}));
|
|
13
|
+
const FollowerAuthenticationAltActions = () => {
|
|
14
|
+
const { state, messages, logos, loading, onActionButtonClick } = useFollowerAuthenticationDialogContext();
|
|
15
|
+
const classes = useStyles();
|
|
16
16
|
switch (state.value) {
|
|
17
17
|
case 'initial':
|
|
18
18
|
return (React.createElement(Box, { className: classes.main },
|
|
19
19
|
React.createElement(Divider, null),
|
|
20
|
-
React.createElement(Button, { variant: "outlined", startIcon: logos.facebook, onClick:
|
|
20
|
+
React.createElement(Button, { variant: "outlined", startIcon: logos.facebook, onClick: () => {
|
|
21
21
|
onActionButtonClick('sign-in-with-facebook');
|
|
22
22
|
} }, messages.continueWithFacebookButtonLabel),
|
|
23
|
-
React.createElement(Button, { variant: "outlined", startIcon: logos.google, onClick:
|
|
23
|
+
React.createElement(Button, { variant: "outlined", startIcon: logos.google, onClick: () => {
|
|
24
24
|
onActionButtonClick('sign-in-with-google');
|
|
25
25
|
} }, messages.continueWithGoogleButtonLabel)));
|
|
26
26
|
case 'signUp':
|
|
@@ -28,53 +28,53 @@ var FollowerAuthenticationAltActions = function () {
|
|
|
28
28
|
case 'emailFound':
|
|
29
29
|
return (React.createElement(Box, { className: classes.main },
|
|
30
30
|
React.createElement(Divider, null),
|
|
31
|
-
React.createElement(Button, { variant: "outlined", onClick:
|
|
31
|
+
React.createElement(Button, { variant: "outlined", onClick: () => {
|
|
32
32
|
onActionButtonClick('sign-in-with-password');
|
|
33
33
|
} }, messages.signInWithPassword)));
|
|
34
34
|
case 'emailAuthCode':
|
|
35
35
|
return (React.createElement(Box, { className: classes.main },
|
|
36
|
-
React.createElement(Button, { disabled: loading, variant: "outlined", onClick:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
React.createElement(Button, { disabled: loading, variant: "outlined", onClick: () => {
|
|
37
|
+
const form = document.querySelector('#follower-authentication-form');
|
|
38
|
+
const formData = new FormData(form);
|
|
39
|
+
const values = Object.fromEntries(formData.entries());
|
|
40
40
|
onActionButtonClick('request-auth-code-email', values);
|
|
41
41
|
} }, messages.resendAuthCode)));
|
|
42
42
|
case 'indirectUserFound':
|
|
43
43
|
return (React.createElement(Box, { className: classes.main },
|
|
44
44
|
React.createElement(Divider, null),
|
|
45
|
-
React.createElement(Button, { variant: "outlined", onClick:
|
|
45
|
+
React.createElement(Button, { variant: "outlined", onClick: () => {
|
|
46
46
|
onActionButtonClick('use-different-account');
|
|
47
47
|
} }, messages.indirectUserFoundCtaButtonLabelAlt)));
|
|
48
48
|
case 'emailPasswordSignIn':
|
|
49
49
|
return (React.createElement(Box, { className: classes.main },
|
|
50
50
|
React.createElement(Divider, null),
|
|
51
|
-
React.createElement(Button, { variant: "outlined", onClick:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
React.createElement(Button, { variant: "outlined", onClick: () => {
|
|
52
|
+
const form = document.querySelector('#follower-authentication-form');
|
|
53
|
+
const formData = new FormData(form);
|
|
54
|
+
const values = Object.fromEntries(formData.entries());
|
|
55
55
|
onActionButtonClick('request-auth-code-email', values);
|
|
56
56
|
} }, messages.emailFoundCtaButtonLabel)));
|
|
57
57
|
case 'phoneFound':
|
|
58
58
|
return null;
|
|
59
59
|
case 'phoneAuthCode':
|
|
60
60
|
return (React.createElement(Box, { className: classes.main },
|
|
61
|
-
React.createElement(Button, { disabled: loading, variant: "outlined", onClick:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
React.createElement(Button, { disabled: loading, variant: "outlined", onClick: () => {
|
|
62
|
+
const form = document.querySelector('#follower-authentication-form');
|
|
63
|
+
const formData = new FormData(form);
|
|
64
|
+
const values = Object.fromEntries(formData.entries());
|
|
65
65
|
onActionButtonClick('request-auth-code-sms', values);
|
|
66
66
|
} }, messages.resendAuthCode)));
|
|
67
67
|
case 'phonePasswordSignIn':
|
|
68
68
|
return (React.createElement(Box, { className: classes.main },
|
|
69
69
|
React.createElement(Divider, null),
|
|
70
|
-
React.createElement(Button, { variant: "outlined", onClick:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
React.createElement(Button, { variant: "outlined", onClick: () => {
|
|
71
|
+
const form = document.querySelector('#follower-authentication-form');
|
|
72
|
+
const formData = new FormData(form);
|
|
73
|
+
const values = Object.fromEntries(formData.entries());
|
|
74
74
|
onActionButtonClick('request-auth-code-sms', values);
|
|
75
75
|
} }, messages.phoneFoundCtaButtonLabel)));
|
|
76
76
|
case 'welcome':
|
|
77
|
-
return (React.createElement(Button, { onClick:
|
|
77
|
+
return (React.createElement(Button, { onClick: () => {
|
|
78
78
|
onActionButtonClick('close');
|
|
79
79
|
} }, messages.done));
|
|
80
80
|
default:
|