@popmenu/common-ui 0.126.0 → 0.126.2
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/Avatar.d.ts +3 -0
- package/build/{components → cjs/components}/Avatar/AvatarProps.d.ts +22 -22
- package/build/{components → cjs/components}/Avatar/avatar.styles.d.ts +2 -2
- package/build/cjs/components/Avatar/index.d.ts +2 -0
- package/build/{components → cjs/components}/Avatar/util/useImageProps.d.ts +10 -10
- package/build/{components → cjs/components}/BrowserSilhouette/BrowserSilhouette.d.ts +2 -2
- package/build/{components → cjs/components}/BrowserSilhouette/browserSilhouette.styles.d.ts +1 -1
- package/build/cjs/components/BrowserSilhouette/index.d.ts +1 -0
- package/build/{components → cjs/components}/Button/Button.d.ts +6 -6
- package/build/{components → cjs/components}/Button/ButtonProps.d.ts +11 -11
- package/build/cjs/components/Button/ButtonStyles.d.ts +2 -0
- package/build/cjs/components/Button/index.d.ts +2 -0
- package/build/cjs/components/Checkbox/Checkbox.d.ts +3 -0
- package/build/{components → cjs/components}/Checkbox/CheckboxProps.d.ts +7 -8
- package/build/cjs/components/Checkbox/index.d.ts +2 -0
- package/build/{components → cjs/components}/Chip/Chip.d.ts +6 -6
- package/build/{components → cjs/components}/Chip/ChipProps.d.ts +8 -8
- package/build/{components → cjs/components}/Chip/ChipStyles.d.ts +2 -2
- package/build/cjs/components/Chip/index.d.ts +2 -0
- package/build/{components → cjs/components}/CollapsibleText/CollapsibleText.d.ts +3 -3
- package/build/{components → cjs/components}/CollapsibleText/CollapsibleTextProps.d.ts +13 -13
- package/build/{components → cjs/components}/CollapsibleText/CollapsibleTextStyles.d.ts +5 -5
- package/build/cjs/components/CollapsibleText/index.d.ts +2 -0
- package/build/{components → cjs/components}/Divider/Divider.d.ts +3 -3
- package/build/{components → cjs/components}/Divider/DividerProps.d.ts +17 -17
- package/build/cjs/components/Divider/index.d.ts +2 -0
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationContent.d.ts +4 -4
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +3 -3
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +29 -29
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +2 -2
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/context.d.ts +4 -4
- package/build/cjs/components/FollowerAuthenticationDialog/index.d.ts +2 -0
- package/build/{components → cjs/components}/FollowerAuthenticationDialog/theme.d.ts +35 -35
- package/build/{components → cjs/components}/Icon/Icon.d.ts +4 -4
- package/build/{components → cjs/components}/Icon/IconProps.d.ts +17 -17
- package/build/{components → cjs/components}/Icon/IconStyles.d.ts +2 -2
- package/build/cjs/components/Icon/index.d.ts +2 -0
- package/build/cjs/components/IconButton/IconButton.d.ts +3 -0
- package/build/{components → cjs/components}/IconButton/IconButtonProps.d.ts +2 -2
- package/build/cjs/components/IconButton/index.d.ts +2 -0
- package/build/{components → cjs/components}/Link/Link.d.ts +11 -11
- package/build/{components → cjs/components}/Link/LinkStyles.d.ts +2 -2
- package/build/cjs/components/Link/index.d.ts +2 -0
- package/build/{components → cjs/components}/NumberField/NumberField.d.ts +3 -3
- package/build/{components → cjs/components}/NumberField/NumberFieldProps.d.ts +12 -12
- package/build/{components → cjs/components}/NumberField/NumberFieldStyles.d.ts +2 -2
- package/build/cjs/components/NumberField/index.d.ts +2 -0
- package/build/cjs/components/Paper/Paper.d.ts +6 -0
- package/build/cjs/components/Paper/index.d.ts +2 -0
- package/build/{components → cjs/components}/PaperContent/PaperContent.d.ts +2 -2
- package/build/cjs/components/PaperContent/index.d.ts +1 -0
- package/build/cjs/components/Radio/Radio.d.ts +3 -0
- package/build/{components → cjs/components}/Radio/RadioProps.d.ts +7 -8
- package/build/cjs/components/Radio/index.d.ts +2 -0
- package/build/{components → cjs/components}/SplitInput/SplitInput.d.ts +3 -3
- package/build/{components → cjs/components}/SplitInput/SplitInputProps.d.ts +20 -20
- package/build/{components → cjs/components}/SplitInput/SplitInputStyles.d.ts +2 -2
- package/build/cjs/components/SplitInput/index.d.ts +2 -0
- package/build/cjs/components/Switch/Switch.d.ts +3 -0
- package/build/{components → cjs/components}/Switch/SwitchProps.d.ts +7 -8
- package/build/cjs/components/Switch/index.d.ts +2 -0
- package/build/{components → cjs/components}/Switch/switch.styles.d.ts +2 -2
- package/build/{components → cjs/components}/TabPanel/TabPanel.d.ts +3 -3
- package/build/{components → cjs/components}/TabPanel/TabPanelProps.d.ts +3 -3
- package/build/cjs/components/TabPanel/index.d.ts +2 -0
- package/build/cjs/components/ToggleButton/ToggleButton.d.ts +3 -0
- package/build/{components → cjs/components}/ToggleButton/ToggleButtonProps.d.ts +4 -4
- package/build/{components → cjs/components}/ToggleButton/ToggleButtonStyles.d.ts +2 -2
- package/build/cjs/components/ToggleButton/index.d.ts +2 -0
- package/build/cjs/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -0
- package/build/{components → cjs/components}/ToggleButtonGroup/ToggleButtonGroupProps.d.ts +6 -6
- package/build/{components → cjs/components}/ToggleButtonGroup/ToggleButtonGroupStyles.d.ts +1 -1
- package/build/cjs/components/ToggleButtonGroup/index.d.ts +2 -0
- package/build/cjs/components/Tooltip/Tooltip.d.ts +3 -0
- package/build/cjs/components/Tooltip/TooltipProps.d.ts +1 -0
- package/build/{components → cjs/components}/Tooltip/TooltipStyles.d.ts +2 -2
- package/build/cjs/components/Tooltip/index.d.ts +2 -0
- package/build/{components → cjs/components}/Typography/Typography.d.ts +9 -9
- package/build/{components → cjs/components}/Typography/TypographyProps.d.ts +14 -15
- package/build/cjs/components/Typography/TypographyStyles.d.ts +10 -0
- package/build/cjs/components/Typography/index.d.ts +2 -0
- package/build/cjs/components/index.d.ts +45 -0
- package/build/{hooks → cjs/hooks}/index.d.ts +2 -2
- package/build/{hooks → cjs/hooks}/useCollapsibleText.d.ts +9 -9
- package/build/{hooks → cjs/hooks}/useTabs/index.d.ts +1 -1
- package/build/{hooks → cjs/hooks}/useTabs/useTabs.d.ts +3 -3
- package/build/{hooks → cjs/hooks}/useTabs/useTabsOptions.d.ts +3 -3
- package/build/{hooks → cjs/hooks}/useTabs/useTabsResult.d.ts +22 -22
- package/build/{index.d.ts → cjs/index.d.ts} +3 -3
- package/build/cjs/index.js +1303 -0
- package/build/cjs/index.js.map +1 -0
- package/build/{types → cjs/types}/index.d.ts +2 -2
- package/build/{util → cjs/util}/colors/alpha.d.ts +1 -1
- package/build/{util → cjs/util}/colors/darken.d.ts +1 -1
- package/build/{util → cjs/util}/colors/decomposeColor.d.ts +1 -1
- package/build/{util → cjs/util}/colors/getLuminance.d.ts +1 -1
- package/build/{util → cjs/util}/colors/hexToRgb.d.ts +1 -1
- package/build/{util → cjs/util}/colors/index.d.ts +8 -8
- package/build/{util → cjs/util}/colors/lighten.d.ts +1 -1
- package/build/{util → cjs/util}/colors/recomposeColor.d.ts +1 -1
- package/build/{util → cjs/util}/colors/rgbToHex.d.ts +1 -1
- package/build/{util → cjs/util}/createTheme.d.ts +1 -1
- package/build/{util → cjs/util}/index.d.ts +4 -4
- package/build/{util → cjs/util}/makeStyles.d.ts +1 -1
- package/build/esm/components/Avatar/Avatar.d.ts +3 -0
- package/build/esm/components/Avatar/Avatar.js +39 -0
- package/build/esm/components/Avatar/Avatar.js.map +1 -0
- package/build/esm/components/Avatar/AvatarProps.d.ts +22 -0
- package/build/esm/components/Avatar/avatar.styles.d.ts +2 -0
- package/build/esm/components/Avatar/avatar.styles.js +41 -0
- package/build/esm/components/Avatar/avatar.styles.js.map +1 -0
- package/build/esm/components/Avatar/index.d.ts +2 -0
- package/build/esm/components/Avatar/util/useImageProps.d.ts +10 -0
- package/build/esm/components/Avatar/util/useImageProps.js +21 -0
- package/build/esm/components/Avatar/util/useImageProps.js.map +1 -0
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.d.ts +2 -0
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js +18 -0
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js.map +1 -0
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.d.ts +1 -0
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js +25 -0
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js.map +1 -0
- package/build/esm/components/BrowserSilhouette/index.d.ts +1 -0
- package/build/esm/components/Button/Button.d.ts +6 -0
- package/build/esm/components/Button/Button.js +21 -0
- package/build/esm/components/Button/Button.js.map +1 -0
- package/build/esm/components/Button/ButtonProps.d.ts +11 -0
- package/build/esm/components/Button/ButtonStyles.d.ts +2 -0
- package/build/esm/components/Button/ButtonStyles.js +16 -0
- package/build/esm/components/Button/ButtonStyles.js.map +1 -0
- package/build/esm/components/Button/index.d.ts +2 -0
- package/build/esm/components/Checkbox/Checkbox.d.ts +3 -0
- package/build/esm/components/Checkbox/Checkbox.js +13 -0
- package/build/esm/components/Checkbox/Checkbox.js.map +1 -0
- package/build/esm/components/Checkbox/CheckboxProps.d.ts +7 -0
- package/build/esm/components/Checkbox/index.d.ts +2 -0
- package/build/esm/components/Chip/Chip.d.ts +6 -0
- package/build/esm/components/Chip/Chip.js +23 -0
- package/build/esm/components/Chip/Chip.js.map +1 -0
- package/build/esm/components/Chip/ChipProps.d.ts +8 -0
- package/build/esm/components/Chip/ChipStyles.d.ts +2 -0
- package/build/esm/components/Chip/ChipStyles.js +83 -0
- package/build/esm/components/Chip/ChipStyles.js.map +1 -0
- package/build/esm/components/Chip/index.d.ts +2 -0
- package/build/esm/components/CollapsibleText/CollapsibleText.d.ts +3 -0
- package/build/esm/components/CollapsibleText/CollapsibleText.js +40 -0
- package/build/esm/components/CollapsibleText/CollapsibleText.js.map +1 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextProps.d.ts +13 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +5 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js +24 -0
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js.map +1 -0
- package/build/esm/components/CollapsibleText/index.d.ts +2 -0
- package/build/esm/components/Divider/Divider.d.ts +3 -0
- package/build/esm/components/Divider/Divider.js +70 -0
- package/build/esm/components/Divider/Divider.js.map +1 -0
- package/build/esm/components/Divider/DividerProps.d.ts +17 -0
- package/build/esm/components/Divider/index.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +86 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js +12 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js +24 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.d.ts +4 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +18 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +3 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +37 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +29 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +13 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +149 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +15 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +15 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +13 -0
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/context.d.ts +4 -0
- package/build/esm/components/FollowerAuthenticationDialog/context.js +14 -0
- package/build/esm/components/FollowerAuthenticationDialog/context.js.map +1 -0
- package/build/esm/components/FollowerAuthenticationDialog/index.d.ts +2 -0
- package/build/esm/components/FollowerAuthenticationDialog/theme.d.ts +35 -0
- package/build/esm/components/FollowerAuthenticationDialog/theme.js +36 -0
- package/build/esm/components/FollowerAuthenticationDialog/theme.js.map +1 -0
- package/build/esm/components/Icon/Icon.d.ts +4 -0
- package/build/esm/components/Icon/Icon.js +29 -0
- package/build/esm/components/Icon/Icon.js.map +1 -0
- package/build/esm/components/Icon/IconProps.d.ts +17 -0
- package/build/esm/components/Icon/IconStyles.d.ts +2 -0
- package/build/esm/components/Icon/IconStyles.js +43 -0
- package/build/esm/components/Icon/IconStyles.js.map +1 -0
- package/build/esm/components/Icon/index.d.ts +2 -0
- package/build/esm/components/IconButton/IconButton.d.ts +3 -0
- package/build/esm/components/IconButton/IconButton.js +14 -0
- package/build/esm/components/IconButton/IconButton.js.map +1 -0
- package/build/esm/components/IconButton/IconButtonProps.d.ts +2 -0
- package/build/esm/components/IconButton/index.d.ts +2 -0
- package/build/esm/components/Link/Link.d.ts +11 -0
- package/build/esm/components/Link/Link.js +18 -0
- package/build/esm/components/Link/Link.js.map +1 -0
- package/build/esm/components/Link/LinkStyles.d.ts +2 -0
- package/build/esm/components/Link/LinkStyles.js +15 -0
- package/build/esm/components/Link/LinkStyles.js.map +1 -0
- package/build/esm/components/Link/index.d.ts +2 -0
- package/build/esm/components/NumberField/NumberField.d.ts +3 -0
- package/build/esm/components/NumberField/NumberField.js +20 -0
- package/build/esm/components/NumberField/NumberField.js.map +1 -0
- package/build/esm/components/NumberField/NumberFieldProps.d.ts +12 -0
- package/build/esm/components/NumberField/NumberFieldStyles.d.ts +2 -0
- package/build/esm/components/NumberField/NumberFieldStyles.js +32 -0
- package/build/esm/components/NumberField/NumberFieldStyles.js.map +1 -0
- package/build/esm/components/NumberField/index.d.ts +2 -0
- package/build/esm/components/Paper/Paper.d.ts +6 -0
- package/build/esm/components/Paper/Paper.js +28 -0
- package/build/esm/components/Paper/Paper.js.map +1 -0
- package/build/esm/components/Paper/index.d.ts +2 -0
- package/build/esm/components/PaperContent/PaperContent.d.ts +2 -0
- package/build/esm/components/PaperContent/PaperContent.js +10 -0
- package/build/esm/components/PaperContent/PaperContent.js.map +1 -0
- package/build/esm/components/PaperContent/index.d.ts +1 -0
- package/build/esm/components/Radio/Radio.d.ts +3 -0
- package/build/esm/components/Radio/Radio.js +13 -0
- package/build/esm/components/Radio/Radio.js.map +1 -0
- package/build/esm/components/Radio/RadioProps.d.ts +7 -0
- package/build/esm/components/Radio/index.d.ts +2 -0
- package/build/esm/components/SplitInput/SplitInput.d.ts +3 -0
- package/build/esm/components/SplitInput/SplitInput.js +21 -0
- package/build/esm/components/SplitInput/SplitInput.js.map +1 -0
- package/build/esm/components/SplitInput/SplitInputProps.d.ts +20 -0
- package/build/esm/components/SplitInput/SplitInputStyles.d.ts +2 -0
- package/build/esm/components/SplitInput/SplitInputStyles.js +29 -0
- package/build/esm/components/SplitInput/SplitInputStyles.js.map +1 -0
- package/build/esm/components/SplitInput/index.d.ts +2 -0
- package/build/esm/components/Switch/Switch.d.ts +3 -0
- package/build/esm/components/Switch/Switch.js +15 -0
- package/build/esm/components/Switch/Switch.js.map +1 -0
- package/build/esm/components/Switch/SwitchProps.d.ts +7 -0
- package/build/esm/components/Switch/index.d.ts +2 -0
- package/build/esm/components/Switch/switch.styles.d.ts +2 -0
- package/build/esm/components/Switch/switch.styles.js +17 -0
- package/build/esm/components/Switch/switch.styles.js.map +1 -0
- package/build/esm/components/TabPanel/TabPanel.d.ts +3 -0
- package/build/esm/components/TabPanel/TabPanel.js +10 -0
- package/build/esm/components/TabPanel/TabPanel.js.map +1 -0
- package/build/esm/components/TabPanel/TabPanelProps.d.ts +3 -0
- package/build/esm/components/TabPanel/index.d.ts +2 -0
- package/build/esm/components/ToggleButton/ToggleButton.d.ts +3 -0
- package/build/esm/components/ToggleButton/ToggleButton.js +20 -0
- package/build/esm/components/ToggleButton/ToggleButton.js.map +1 -0
- package/build/esm/components/ToggleButton/ToggleButtonProps.d.ts +4 -0
- package/build/esm/components/ToggleButton/ToggleButtonStyles.d.ts +2 -0
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js +19 -0
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js.map +1 -0
- package/build/esm/components/ToggleButton/index.d.ts +2 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js +20 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupProps.d.ts +6 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.d.ts +1 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js +12 -0
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js.map +1 -0
- package/build/esm/components/ToggleButtonGroup/index.d.ts +2 -0
- package/build/esm/components/Tooltip/Tooltip.d.ts +3 -0
- package/build/esm/components/Tooltip/Tooltip.js +13 -0
- package/build/esm/components/Tooltip/Tooltip.js.map +1 -0
- package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -0
- package/build/esm/components/Tooltip/TooltipStyles.d.ts +2 -0
- package/build/esm/components/Tooltip/TooltipStyles.js +13 -0
- package/build/esm/components/Tooltip/TooltipStyles.js.map +1 -0
- package/build/esm/components/Tooltip/index.d.ts +2 -0
- package/build/esm/components/Typography/Typography.d.ts +9 -0
- package/build/esm/components/Typography/Typography.js +17 -0
- package/build/esm/components/Typography/Typography.js.map +1 -0
- package/build/esm/components/Typography/TypographyProps.d.ts +14 -0
- package/build/esm/components/Typography/TypographyProps.js +6 -0
- package/build/esm/components/Typography/TypographyProps.js.map +1 -0
- package/build/esm/components/Typography/TypographyStyles.d.ts +10 -0
- package/build/esm/components/Typography/TypographyStyles.js +76 -0
- package/build/esm/components/Typography/TypographyStyles.js.map +1 -0
- package/build/esm/components/Typography/index.d.ts +2 -0
- package/build/esm/components/index.d.ts +45 -0
- package/build/esm/hooks/index.d.ts +2 -0
- package/build/esm/hooks/useCollapsibleText.d.ts +9 -0
- package/build/esm/hooks/useCollapsibleText.js +17 -0
- package/build/esm/hooks/useCollapsibleText.js.map +1 -0
- package/build/esm/hooks/useTabs/index.d.ts +1 -0
- package/build/esm/hooks/useTabs/useTabs.d.ts +3 -0
- package/build/esm/hooks/useTabs/useTabs.js +35 -0
- package/build/esm/hooks/useTabs/useTabs.js.map +1 -0
- package/build/esm/hooks/useTabs/useTabsOptions.d.ts +3 -0
- package/build/esm/hooks/useTabs/useTabsResult.d.ts +22 -0
- package/build/esm/index.d.ts +3 -0
- package/build/esm/index.js +28 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/types/index.d.ts +2 -0
- package/build/esm/util/colors/alpha.d.ts +1 -0
- package/build/esm/util/colors/darken.d.ts +1 -0
- package/build/esm/util/colors/decomposeColor.d.ts +1 -0
- package/build/esm/util/colors/getLuminance.d.ts +1 -0
- package/build/esm/util/colors/hexToRgb.d.ts +1 -0
- package/build/esm/util/colors/index.d.ts +8 -0
- package/build/esm/util/colors/lighten.d.ts +1 -0
- package/build/esm/util/colors/recomposeColor.d.ts +1 -0
- package/build/esm/util/colors/rgbToHex.d.ts +1 -0
- package/build/esm/util/createTheme.d.ts +1 -0
- package/build/esm/util/index.d.ts +4 -0
- package/build/esm/util/makeStyles.d.ts +1 -0
- package/package.json +8 -8
- package/build/components/Accordion/index.d.ts +0 -1
- package/build/components/AccordionActions/index.d.ts +0 -1
- package/build/components/AccordionDetails/index.d.ts +0 -1
- package/build/components/AccordionSummary/index.d.ts +0 -1
- package/build/components/Alert/index.d.ts +0 -1
- package/build/components/AppBar/index.d.ts +0 -1
- package/build/components/Avatar/Avatar.d.ts +0 -3
- package/build/components/Avatar/index.d.ts +0 -2
- package/build/components/Badge/index.d.ts +0 -1
- package/build/components/Box/Box.d.ts +0 -3
- package/build/components/Box/BoxProps.d.ts +0 -5
- package/build/components/Box/BoxStyles.d.ts +0 -1
- package/build/components/Box/index.d.ts +0 -7
- package/build/components/Breadcrumbs/index.d.ts +0 -1
- package/build/components/BrowserSilhouette/index.d.ts +0 -1
- package/build/components/Button/ButtonStyles.d.ts +0 -2
- package/build/components/Button/index.d.ts +0 -2
- package/build/components/ButtonBase/index.d.ts +0 -1
- package/build/components/ButtonGroup/index.d.ts +0 -1
- package/build/components/Card/index.d.ts +0 -1
- package/build/components/CardActionArea/index.d.ts +0 -1
- package/build/components/CardActions/index.d.ts +0 -1
- package/build/components/CardContent/index.d.ts +0 -1
- package/build/components/CardHeader/index.d.ts +0 -1
- package/build/components/CardMedia/index.d.ts +0 -1
- package/build/components/Checkbox/Checkbox.d.ts +0 -3
- package/build/components/Checkbox/index.d.ts +0 -2
- package/build/components/Chip/index.d.ts +0 -2
- package/build/components/CircularProgress/index.d.ts +0 -1
- package/build/components/ClickAwayListener/index.d.ts +0 -1
- package/build/components/CollapsibleText/index.d.ts +0 -2
- package/build/components/Dialog/index.d.ts +0 -1
- package/build/components/DialogActions/index.d.ts +0 -1
- package/build/components/DialogContent/index.d.ts +0 -1
- package/build/components/DialogContentText/index.d.ts +0 -1
- package/build/components/DialogTitle/index.d.ts +0 -1
- package/build/components/Divider/index.d.ts +0 -2
- package/build/components/Drawer/index.d.ts +0 -1
- package/build/components/Fab/index.d.ts +0 -1
- package/build/components/FollowerAuthenticationDialog/index.d.ts +0 -2
- package/build/components/FormControl/index.d.ts +0 -1
- package/build/components/FormControlLabel/index.d.ts +0 -1
- package/build/components/FormLabel/index.d.ts +0 -1
- package/build/components/Grid/index.d.ts +0 -1
- package/build/components/GridList/index.d.ts +0 -1
- package/build/components/Hidden/index.d.ts +0 -1
- package/build/components/Icon/index.d.ts +0 -2
- package/build/components/IconButton/IconButton.d.ts +0 -3
- package/build/components/IconButton/index.d.ts +0 -2
- package/build/components/InputAdornment/index.d.ts +0 -1
- package/build/components/LinearProgress/index.d.ts +0 -1
- package/build/components/Link/index.d.ts +0 -2
- package/build/components/List/index.d.ts +0 -1
- package/build/components/ListItem/index.d.ts +0 -1
- package/build/components/ListItemAvatar/index.d.ts +0 -1
- package/build/components/ListItemIcon/index.d.ts +0 -1
- package/build/components/ListItemSecondaryAction/index.d.ts +0 -1
- package/build/components/ListItemText/index.d.ts +0 -1
- package/build/components/Menu/index.d.ts +0 -1
- package/build/components/MenuItem/index.d.ts +0 -1
- package/build/components/MenuList/index.d.ts +0 -1
- package/build/components/Modal/index.d.ts +0 -1
- package/build/components/NumberField/index.d.ts +0 -2
- package/build/components/Paper/Paper.d.ts +0 -6
- package/build/components/Paper/index.d.ts +0 -1
- package/build/components/PaperContent/index.d.ts +0 -1
- package/build/components/Popover/index.d.ts +0 -1
- package/build/components/Popper/index.d.ts +0 -1
- package/build/components/Radio/Radio.d.ts +0 -3
- package/build/components/Radio/index.d.ts +0 -2
- package/build/components/SplitInput/index.d.ts +0 -2
- package/build/components/Step/index.d.ts +0 -1
- package/build/components/StepButton/index.d.ts +0 -1
- package/build/components/StepConnector/index.d.ts +0 -1
- package/build/components/StepContent/index.d.ts +0 -1
- package/build/components/StepIcon/index.d.ts +0 -1
- package/build/components/StepLabel/index.d.ts +0 -1
- package/build/components/Stepper/index.d.ts +0 -1
- package/build/components/Switch/Switch.d.ts +0 -3
- package/build/components/Switch/index.d.ts +0 -2
- package/build/components/Tab/index.d.ts +0 -1
- package/build/components/TabPanel/index.d.ts +0 -2
- package/build/components/Tabs/index.d.ts +0 -1
- package/build/components/TextField/index.d.ts +0 -1
- package/build/components/ThemeProvider/index.d.ts +0 -1
- package/build/components/ToggleButton/ToggleButton.d.ts +0 -3
- package/build/components/ToggleButton/index.d.ts +0 -2
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -3
- package/build/components/ToggleButtonGroup/index.d.ts +0 -2
- package/build/components/Toolbar/index.d.ts +0 -1
- package/build/components/Tooltip/Tooltip.d.ts +0 -3
- package/build/components/Tooltip/TooltipProps.d.ts +0 -1
- package/build/components/Tooltip/index.d.ts +0 -2
- package/build/components/Typography/TypographyStyles.d.ts +0 -4
- package/build/components/Typography/index.d.ts +0 -2
- package/build/components/index.d.ts +0 -78
- package/build/index.es.js +0 -1479
- package/build/index.es.js.map +0 -1
- package/build/index.js +0 -1971
- package/build/index.js.map +0 -1
- package/build/util/ServerStyleSheets.d.ts +0 -1
|
@@ -0,0 +1,1303 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@material-ui/core');
|
|
4
|
+
var lab = require('@material-ui/lab');
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var webIcons = require('@popmenu/web-icons');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var classNames = require('classnames');
|
|
9
|
+
|
|
10
|
+
var useIconStyles = core.makeStyles(function (_a) {
|
|
11
|
+
var spacing = _a.spacing, palette = _a.palette;
|
|
12
|
+
var getFontSize = function (_a) {
|
|
13
|
+
var size = _a.size;
|
|
14
|
+
var sizes = {
|
|
15
|
+
inherit: 'inherit',
|
|
16
|
+
small: spacing(1.5),
|
|
17
|
+
medium: spacing(2),
|
|
18
|
+
large: spacing(2.5),
|
|
19
|
+
'extra-large': spacing(3),
|
|
20
|
+
};
|
|
21
|
+
return size ? sizes[size] : 'inherit';
|
|
22
|
+
};
|
|
23
|
+
var getColor = function (props) {
|
|
24
|
+
var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
|
|
25
|
+
var value = 'inherit';
|
|
26
|
+
if (props.color) {
|
|
27
|
+
if (semanticColors.includes(props.color.split('.')[0])) {
|
|
28
|
+
var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
29
|
+
// @ts-expect-error - todo.
|
|
30
|
+
value = palette[color][variant];
|
|
31
|
+
}
|
|
32
|
+
else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
|
|
33
|
+
value = props.color;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
root: {
|
|
40
|
+
color: getColor,
|
|
41
|
+
fontSize: getFontSize,
|
|
42
|
+
width: '1em',
|
|
43
|
+
height: '1em',
|
|
44
|
+
strokeWidth: '1.3px',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
var iconStaticClassName = 'pop-icon';
|
|
50
|
+
var Icon = function (props) {
|
|
51
|
+
var icon = props.icon, className = props.className, restProps = tslib.__rest(props, ["icon", "className"]);
|
|
52
|
+
var hasAccessibleAttr = Boolean(restProps['aria-describedby'] || restProps['aria-label']);
|
|
53
|
+
if (!hasAccessibleAttr && restProps['aria-hidden'] === undefined) {
|
|
54
|
+
restProps['aria-hidden'] = true;
|
|
55
|
+
}
|
|
56
|
+
var classes = useIconStyles(props);
|
|
57
|
+
var isValid = true;
|
|
58
|
+
if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
|
|
59
|
+
isValid = false;
|
|
60
|
+
}
|
|
61
|
+
return isValid
|
|
62
|
+
? React.createElement(icon, tslib.__assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
|
|
63
|
+
: null;
|
|
64
|
+
};
|
|
65
|
+
Icon.defaultProps = {
|
|
66
|
+
size: 'inherit',
|
|
67
|
+
color: 'inherit',
|
|
68
|
+
};
|
|
69
|
+
Icon.displayName = 'Icon';
|
|
70
|
+
|
|
71
|
+
var LoadingStatus;
|
|
72
|
+
(function (LoadingStatus) {
|
|
73
|
+
LoadingStatus["ERROR"] = "ERROR";
|
|
74
|
+
LoadingStatus["LOADED"] = "LOADED";
|
|
75
|
+
LoadingStatus["PENDING"] = "PENDING";
|
|
76
|
+
})(LoadingStatus || (LoadingStatus = {}));
|
|
77
|
+
var useImgProps = function (avatarProps) {
|
|
78
|
+
var _a = React.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
|
|
79
|
+
var imgProps = tslib.__assign(tslib.__assign({}, avatarProps.imgProps), { onLoad: function (event) {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
setLoaded(LoadingStatus.LOADED);
|
|
82
|
+
(_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
83
|
+
} });
|
|
84
|
+
return { imgProps: imgProps, loaded: loaded };
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var getAvatarDimensions = function (theme, props) {
|
|
88
|
+
var factors = {
|
|
89
|
+
'extra-small': 3,
|
|
90
|
+
small: 4,
|
|
91
|
+
medium: 5,
|
|
92
|
+
large: 6,
|
|
93
|
+
'extra-large': 12.5,
|
|
94
|
+
};
|
|
95
|
+
var sizeFactor = factors[props.size || 'medium'];
|
|
96
|
+
return theme.spacing(sizeFactor);
|
|
97
|
+
};
|
|
98
|
+
var getAvatarFontSize = function (props) {
|
|
99
|
+
var fontSizes = {
|
|
100
|
+
'extra-small': '0.75rem',
|
|
101
|
+
small: '1rem',
|
|
102
|
+
medium: '1rem',
|
|
103
|
+
large: '1.25rem',
|
|
104
|
+
'extra-large': '3.5rem',
|
|
105
|
+
};
|
|
106
|
+
return fontSizes[props.size];
|
|
107
|
+
};
|
|
108
|
+
var useAvatarStyles = core.makeStyles(function (theme) { return ({
|
|
109
|
+
root: function (props) { return ({
|
|
110
|
+
width: getAvatarDimensions(theme, props),
|
|
111
|
+
height: getAvatarDimensions(theme, props),
|
|
112
|
+
fontSize: getAvatarFontSize(props),
|
|
113
|
+
backgroundColor: props.loaded === LoadingStatus.LOADED ? 'transparent' : props.background,
|
|
114
|
+
color: theme.palette.getContrastText(props.background),
|
|
115
|
+
objectFit: props.fit,
|
|
116
|
+
}); },
|
|
117
|
+
fallback: function (props) { return ({
|
|
118
|
+
fontSize: getAvatarDimensions(theme, props),
|
|
119
|
+
strokeWidth: 1,
|
|
120
|
+
}); },
|
|
121
|
+
}); });
|
|
122
|
+
|
|
123
|
+
var Avatar = React.forwardRef(function (props, ref) {
|
|
124
|
+
var children = props.children, src = props.src, alt = props.alt, fallback = props.fallback, muiProps = tslib.__rest(props, ["children", "src", "alt", "fallback"]);
|
|
125
|
+
var _a = useImgProps(props), imgProps = _a.imgProps, loaded = _a.loaded;
|
|
126
|
+
var classes = useAvatarStyles(tslib.__assign(tslib.__assign({}, props), { loaded: loaded }));
|
|
127
|
+
var displayAltTextFallback = src && alt;
|
|
128
|
+
var displayNoFallback = fallback === 'none';
|
|
129
|
+
var displayCustomFallback = fallback !== 'none' && typeof fallback !== 'undefined';
|
|
130
|
+
var Fallback;
|
|
131
|
+
if (displayAltTextFallback) {
|
|
132
|
+
Fallback = null;
|
|
133
|
+
}
|
|
134
|
+
else if (displayNoFallback) {
|
|
135
|
+
Fallback = ' ';
|
|
136
|
+
}
|
|
137
|
+
else if (displayCustomFallback) {
|
|
138
|
+
Fallback = fallback;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
Fallback = React.createElement(Icon, { icon: webIcons.User, className: classes.fallback });
|
|
142
|
+
}
|
|
143
|
+
return (React.createElement(core.Avatar, tslib.__assign({ ref: ref, classes: { root: classes.root }, src: src, alt: alt }, muiProps, { imgProps: imgProps }), children || Fallback));
|
|
144
|
+
});
|
|
145
|
+
Avatar.defaultProps = {
|
|
146
|
+
size: 'medium',
|
|
147
|
+
fit: 'cover',
|
|
148
|
+
background: '#E0E0E0',
|
|
149
|
+
};
|
|
150
|
+
Avatar.displayName = 'Avatar';
|
|
151
|
+
|
|
152
|
+
var useBrowserSilhouetteStyles = core.makeStyles(function (theme) { return ({
|
|
153
|
+
circle: {
|
|
154
|
+
backgroundColor: theme.palette.grey[300],
|
|
155
|
+
borderRadius: '50%',
|
|
156
|
+
height: theme.spacing(0.65),
|
|
157
|
+
width: theme.spacing(0.65),
|
|
158
|
+
margin: theme.spacing(1) + "px 0 " + theme.spacing(1) + "px " + theme.spacing(1) + "px",
|
|
159
|
+
},
|
|
160
|
+
container: {
|
|
161
|
+
border: "1px solid " + theme.palette.secondary.light,
|
|
162
|
+
borderRadius: theme.spacing(0.5),
|
|
163
|
+
flexGrow: 1,
|
|
164
|
+
},
|
|
165
|
+
titleBar: {
|
|
166
|
+
display: 'flex',
|
|
167
|
+
flexDirection: 'row',
|
|
168
|
+
borderBottom: "1px solid " + theme.palette.secondary.light,
|
|
169
|
+
width: '100%',
|
|
170
|
+
},
|
|
171
|
+
}); });
|
|
172
|
+
|
|
173
|
+
var BrowserSilhouette = function (_a) {
|
|
174
|
+
var children = _a.children;
|
|
175
|
+
var classes = useBrowserSilhouetteStyles();
|
|
176
|
+
return (React.createElement(core.Box, { display: "flex" },
|
|
177
|
+
React.createElement("div", { className: classes.container },
|
|
178
|
+
React.createElement("div", { className: classes.titleBar },
|
|
179
|
+
React.createElement("div", { className: classes.circle }),
|
|
180
|
+
React.createElement("div", { className: classes.circle }),
|
|
181
|
+
React.createElement("div", { className: classes.circle })),
|
|
182
|
+
children)));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var useButtonStyles = core.makeStyles(function () { return ({
|
|
186
|
+
root: {
|
|
187
|
+
minWidth: 'unset',
|
|
188
|
+
},
|
|
189
|
+
label: {
|
|
190
|
+
textTransform: function (_a) {
|
|
191
|
+
var textTransform = _a.textTransform;
|
|
192
|
+
return textTransform;
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
}); });
|
|
196
|
+
|
|
197
|
+
var Button = function (props) {
|
|
198
|
+
props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, ButtonRef = props.ButtonRef, muiProps = tslib.__rest(props, ["textTransform", "loading", "classes", "className", "ButtonRef"]);
|
|
199
|
+
props.classes; var styleProps = tslib.__rest(props, ["classes"]);
|
|
200
|
+
var classes = useButtonStyles(styleProps);
|
|
201
|
+
var typography = core.useTheme().typography;
|
|
202
|
+
var loadingIndicator = {
|
|
203
|
+
startIcon: React.createElement(core.CircularProgress, { color: "inherit", size: typography.button.fontSize }),
|
|
204
|
+
disabled: true,
|
|
205
|
+
};
|
|
206
|
+
return (React.createElement(core.Button, tslib.__assign({ ref: ButtonRef, classes: tslib.__assign(tslib.__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
|
|
207
|
+
};
|
|
208
|
+
Button.displayName = 'Button';
|
|
209
|
+
|
|
210
|
+
var Checkbox = React.forwardRef(function (props, ref) {
|
|
211
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
|
|
212
|
+
var control = React.createElement(core.Checkbox, tslib.__assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
213
|
+
return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
214
|
+
});
|
|
215
|
+
Checkbox.displayName = 'Checkbox';
|
|
216
|
+
|
|
217
|
+
var getBackground = function (theme) { return function (props) {
|
|
218
|
+
var variant = props.variant, severity = props.severity;
|
|
219
|
+
var background = theme.palette.grey[100];
|
|
220
|
+
var backgrounds = {
|
|
221
|
+
outlined: 'none',
|
|
222
|
+
error: 'error.main',
|
|
223
|
+
warning: 'warning.main',
|
|
224
|
+
info: 'info.light',
|
|
225
|
+
success: 'success.light',
|
|
226
|
+
};
|
|
227
|
+
if (variant === 'outlined') {
|
|
228
|
+
background = backgrounds[variant];
|
|
229
|
+
}
|
|
230
|
+
else if (severity) {
|
|
231
|
+
var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
|
|
232
|
+
// @ts-expect-error - todo.
|
|
233
|
+
background = theme.palette[color][colorVariant];
|
|
234
|
+
}
|
|
235
|
+
return background;
|
|
236
|
+
}; };
|
|
237
|
+
var getColor = function (theme) { return function (props) {
|
|
238
|
+
var variant = props.variant, severity = props.severity;
|
|
239
|
+
var textColor;
|
|
240
|
+
if (variant === 'outlined' && severity) {
|
|
241
|
+
var textColors = {
|
|
242
|
+
error: theme.palette.error.main,
|
|
243
|
+
info: theme.palette.info.main,
|
|
244
|
+
warning: theme.palette.warning.dark,
|
|
245
|
+
success: theme.palette.success.dark,
|
|
246
|
+
};
|
|
247
|
+
textColor = textColors[severity];
|
|
248
|
+
}
|
|
249
|
+
else if (variant === 'outlined' && !severity) {
|
|
250
|
+
textColor = theme.palette.grey[700];
|
|
251
|
+
}
|
|
252
|
+
else if ((variant === 'default' || variant === undefined) && severity) {
|
|
253
|
+
var textColors = {
|
|
254
|
+
error: theme.palette.common.white,
|
|
255
|
+
info: theme.palette.secondary.main,
|
|
256
|
+
warning: theme.palette.secondary.main,
|
|
257
|
+
success: theme.palette.secondary.main,
|
|
258
|
+
};
|
|
259
|
+
textColor = textColors[severity];
|
|
260
|
+
}
|
|
261
|
+
return textColor;
|
|
262
|
+
}; };
|
|
263
|
+
var getBorder = function (theme) { return function (props) {
|
|
264
|
+
var variant = props.variant, severity = props.severity;
|
|
265
|
+
var borderColor;
|
|
266
|
+
if (variant === 'outlined' && severity) {
|
|
267
|
+
var borderColors = {
|
|
268
|
+
error: theme.palette.error.main,
|
|
269
|
+
info: theme.palette.info.main,
|
|
270
|
+
warning: theme.palette.warning.dark,
|
|
271
|
+
success: theme.palette.success.dark,
|
|
272
|
+
};
|
|
273
|
+
borderColor = borderColors[severity];
|
|
274
|
+
}
|
|
275
|
+
return borderColor;
|
|
276
|
+
}; };
|
|
277
|
+
// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
|
|
278
|
+
// any component-specific props
|
|
279
|
+
var useChipStyles = core.makeStyles(function (theme) { return ({
|
|
280
|
+
root: {
|
|
281
|
+
background: getBackground(theme),
|
|
282
|
+
color: getColor(theme),
|
|
283
|
+
borderColor: getBorder(theme),
|
|
284
|
+
borderRadius: theme.spacing(0.5),
|
|
285
|
+
},
|
|
286
|
+
icon: {
|
|
287
|
+
color: 'inherit',
|
|
288
|
+
height: theme.spacing(2),
|
|
289
|
+
width: theme.spacing(2),
|
|
290
|
+
},
|
|
291
|
+
deleteIcon: {
|
|
292
|
+
color: theme.palette.grey[500],
|
|
293
|
+
},
|
|
294
|
+
}); });
|
|
295
|
+
|
|
296
|
+
var IconDictionary = {
|
|
297
|
+
error: webIcons.Error,
|
|
298
|
+
info: webIcons.Info,
|
|
299
|
+
success: webIcons.CheckCircle,
|
|
300
|
+
warning: webIcons.Warning,
|
|
301
|
+
};
|
|
302
|
+
var Chip = function (props) {
|
|
303
|
+
var severity = props.severity, restProps = tslib.__rest(props, ["severity"]);
|
|
304
|
+
var classes = useChipStyles(props);
|
|
305
|
+
var icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
|
|
306
|
+
var deleteIcon = React.createElement(webIcons.XCircle);
|
|
307
|
+
return React.createElement(core.Chip, tslib.__assign({ classes: classes, icon: icon, deleteIcon: deleteIcon }, restProps));
|
|
308
|
+
};
|
|
309
|
+
Chip.displayName = 'Chip';
|
|
310
|
+
|
|
311
|
+
var defaultTypographyProps = {
|
|
312
|
+
variant: 'body1',
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
var weights = {
|
|
316
|
+
regular: 400,
|
|
317
|
+
medium: 500,
|
|
318
|
+
'semi-bold': 600,
|
|
319
|
+
bold: 700,
|
|
320
|
+
};
|
|
321
|
+
var getCustomColor = function (theme, color) {
|
|
322
|
+
var isCommonColor = color && ['white', 'black'].includes(color);
|
|
323
|
+
var isGreyColor = color && color.match(/^grey\.\d{3}/);
|
|
324
|
+
var isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
|
|
325
|
+
var isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
|
|
326
|
+
switch (true) {
|
|
327
|
+
case isCommonColor:
|
|
328
|
+
// @ts-expect-error - todo.
|
|
329
|
+
return theme.palette.common[color];
|
|
330
|
+
case Boolean(isGreyColor):
|
|
331
|
+
var scale = color.split('.')[1];
|
|
332
|
+
// @ts-expect-error - todo.
|
|
333
|
+
return theme.palette.grey[scale] || theme.palette.grey[900];
|
|
334
|
+
case Boolean(isSemanticColor):
|
|
335
|
+
var _a = color.split('.'), paletteKey = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
|
|
336
|
+
// @ts-expect-error - todo.
|
|
337
|
+
return theme.palette[paletteKey][variant];
|
|
338
|
+
case isTextColor:
|
|
339
|
+
// @ts-expect-error - todo.
|
|
340
|
+
return theme.palette.text[color.slice(4).toLowerCase()];
|
|
341
|
+
default:
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
var useTypographyStyles = core.makeStyles(function (theme) {
|
|
346
|
+
var _a;
|
|
347
|
+
return ({
|
|
348
|
+
root: (_a = {},
|
|
349
|
+
_a["& ." + iconStaticClassName] = {
|
|
350
|
+
position: 'relative',
|
|
351
|
+
top: '0.125em',
|
|
352
|
+
padding: '0 0.125em',
|
|
353
|
+
boxSizing: 'content-box',
|
|
354
|
+
},
|
|
355
|
+
_a.fontFamily = theme.typography.fontFamily,
|
|
356
|
+
_a.fontWeight = function (_a) {
|
|
357
|
+
var variant = _a.variant, weight = _a.weight;
|
|
358
|
+
return (weight ? weights[weight] : theme.typography[variant].fontWeight);
|
|
359
|
+
},
|
|
360
|
+
_a.fontSize = function (_a) {
|
|
361
|
+
var variant = _a.variant;
|
|
362
|
+
return theme.typography[variant].fontSize;
|
|
363
|
+
},
|
|
364
|
+
_a.lineHeight = function (_a) {
|
|
365
|
+
var variant = _a.variant;
|
|
366
|
+
return theme.typography[variant].lineHeight;
|
|
367
|
+
},
|
|
368
|
+
_a.textTransform = function (_a) {
|
|
369
|
+
var variant = _a.variant;
|
|
370
|
+
return theme.typography[variant].textTransform;
|
|
371
|
+
},
|
|
372
|
+
_a.color = function (_a) {
|
|
373
|
+
var color = _a.color, variant = _a.variant;
|
|
374
|
+
return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
|
|
375
|
+
},
|
|
376
|
+
_a),
|
|
377
|
+
caption: {
|
|
378
|
+
display: 'inline',
|
|
379
|
+
},
|
|
380
|
+
overline: {
|
|
381
|
+
display: 'inline',
|
|
382
|
+
},
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
var Typography = function (props) {
|
|
387
|
+
props.weight; props.color; var TypographyRef = props.TypographyRef, restProps = tslib.__rest(props, ["weight", "color", "TypographyRef"]);
|
|
388
|
+
var classes = useTypographyStyles(tslib.__assign({}, props));
|
|
389
|
+
var variantMapping = { subtitle1: 'p' };
|
|
390
|
+
return React.createElement(core.Typography, tslib.__assign({ classes: classes, variantMapping: variantMapping, ref: TypographyRef }, restProps));
|
|
391
|
+
};
|
|
392
|
+
Typography.displayName = 'Typography';
|
|
393
|
+
Typography.defaultProps = defaultTypographyProps;
|
|
394
|
+
|
|
395
|
+
var getFadeStop = function (_a, typographyVariant) {
|
|
396
|
+
var typography = _a.typography;
|
|
397
|
+
// @ts-expect-error - todo.
|
|
398
|
+
return !isNaN(Number(typography[typographyVariant].lineHeight))
|
|
399
|
+
? // @ts-expect-error - todo.
|
|
400
|
+
typography[typographyVariant].lineHeight + "rem"
|
|
401
|
+
: // @ts-expect-error - todo.
|
|
402
|
+
typography[typographyVariant].lineHeight;
|
|
403
|
+
};
|
|
404
|
+
var useCollapsibleTextStyles = core.makeStyles(function (theme) { return ({
|
|
405
|
+
overlay: {
|
|
406
|
+
position: 'absolute',
|
|
407
|
+
top: 0,
|
|
408
|
+
left: 0,
|
|
409
|
+
height: '100%',
|
|
410
|
+
width: '100%',
|
|
411
|
+
background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
|
|
412
|
+
},
|
|
413
|
+
}); });
|
|
414
|
+
|
|
415
|
+
var CollapsibleText = function (props) {
|
|
416
|
+
var text = props.text, open = props.open, _a = props.previewLines, previewLines = _a === void 0 ? 2 : _a, _b = props.typographyVariant, typographyVariant = _b === void 0 ? 'body1' : _b; props.collapseState; var restProps = tslib.__rest(props, ["text", "open", "previewLines", "typographyVariant", "collapseState"]);
|
|
417
|
+
var collapseState = React.useState(false);
|
|
418
|
+
var typographyRef = React.useRef(null);
|
|
419
|
+
var classes = useCollapsibleTextStyles(tslib.__assign(tslib.__assign({}, props), { previewLines: previewLines, typographyVariant: typographyVariant }));
|
|
420
|
+
var theme = core.useTheme();
|
|
421
|
+
var _c = props.collapseState ? props.collapseState : collapseState, collapsible = _c[0], setCollapsible = _c[1];
|
|
422
|
+
var typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
|
|
423
|
+
var collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
|
|
424
|
+
var documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
425
|
+
var collapsedSizePx = collapsedSizeRem * documentFontSize;
|
|
426
|
+
React.useEffect(function () {
|
|
427
|
+
var typographyNode = typographyRef.current;
|
|
428
|
+
var observer = new ResizeObserver(function (entries) {
|
|
429
|
+
var typographyEntry = entries.find(function (entry) { return entry.target === typographyNode; });
|
|
430
|
+
if (typographyEntry) {
|
|
431
|
+
var typographyEntryHeight = typographyEntry.contentRect.height;
|
|
432
|
+
var isCollapsible = typographyEntryHeight > collapsedSizePx;
|
|
433
|
+
setCollapsible(isCollapsible);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
observer.observe(typographyNode);
|
|
437
|
+
return function () {
|
|
438
|
+
observer.unobserve(typographyNode);
|
|
439
|
+
};
|
|
440
|
+
}, []);
|
|
441
|
+
return (React.createElement(core.Box, tslib.__assign({ position: "relative", overflow: "hidden" }, restProps),
|
|
442
|
+
React.createElement(core.Collapse, { in: open, collapsedSize: collapsedSizePx + 'px' },
|
|
443
|
+
React.createElement(Typography, { TypographyRef: typographyRef, variant: typographyVariant }, text)),
|
|
444
|
+
collapsible && !open && React.createElement(core.Box, { className: classes.overlay })));
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
var SemanticColors;
|
|
448
|
+
(function (SemanticColors) {
|
|
449
|
+
SemanticColors["PRIMARY_MAIN"] = "primary.main";
|
|
450
|
+
SemanticColors["PRIMARY_DARK"] = "primary.dark";
|
|
451
|
+
SemanticColors["PRIMARY_LIGHT"] = "primary.light";
|
|
452
|
+
SemanticColors["SECONDARY_MAIN"] = "secondary.main";
|
|
453
|
+
SemanticColors["SECONDARY_DARK"] = "secondary.dark";
|
|
454
|
+
SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
|
|
455
|
+
})(SemanticColors || (SemanticColors = {}));
|
|
456
|
+
var useStyles$5 = core.makeStyles(function (theme) { return ({
|
|
457
|
+
dividerRoot: {
|
|
458
|
+
gap: theme.spacing(2),
|
|
459
|
+
},
|
|
460
|
+
textRoot: {
|
|
461
|
+
color: function (props) {
|
|
462
|
+
var textColor = props.textColor;
|
|
463
|
+
if (Object.values(SemanticColors).includes(textColor)) {
|
|
464
|
+
var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
465
|
+
// @ts-expect-error - todo.
|
|
466
|
+
return theme.palette[semanticColor][shade];
|
|
467
|
+
}
|
|
468
|
+
else if (textColor) {
|
|
469
|
+
return textColor;
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
return 'black';
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
textTransform: function (props) { return props.textTransform; },
|
|
476
|
+
},
|
|
477
|
+
dividerLine: {
|
|
478
|
+
backgroundColor: function (props) {
|
|
479
|
+
var dividerColor = props.dividerColor;
|
|
480
|
+
if (Object.values(SemanticColors).includes(dividerColor)) {
|
|
481
|
+
var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
|
|
482
|
+
// @ts-expect-error - todo.
|
|
483
|
+
return theme.palette[semanticColor][shade];
|
|
484
|
+
}
|
|
485
|
+
else if (dividerColor) {
|
|
486
|
+
return dividerColor;
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
return theme.palette.grey[500];
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
}); });
|
|
494
|
+
var Divider = function (props) {
|
|
495
|
+
var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
|
|
496
|
+
var classes = useStyles$5(props);
|
|
497
|
+
var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
|
|
498
|
+
return (React.createElement(core.Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
|
|
499
|
+
React.createElement(core.Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
|
|
500
|
+
text && (React.createElement(React.Fragment, null,
|
|
501
|
+
React.createElement(Typography, tslib.__assign({ className: classes.textRoot }, TypographyProps), text),
|
|
502
|
+
React.createElement(core.Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
|
|
503
|
+
};
|
|
504
|
+
Divider.displayName = 'Divider';
|
|
505
|
+
Divider.defaultProps = {
|
|
506
|
+
textTransform: 'lowercase',
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
var useStyles$4 = core.makeStyles(function () { return ({
|
|
510
|
+
root: {
|
|
511
|
+
display: 'flex',
|
|
512
|
+
flexDirection: 'column',
|
|
513
|
+
alignItems: 'center',
|
|
514
|
+
gridGap: 16,
|
|
515
|
+
},
|
|
516
|
+
}); });
|
|
517
|
+
var FollowerAuthenticationContent = function (props) {
|
|
518
|
+
var classes = useStyles$4();
|
|
519
|
+
return React.createElement(core.DialogContent, { classes: classes }, props.children);
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
var FollowerAuthenticationDialogContext = React.createContext(null);
|
|
523
|
+
var FollowerAuthenticationDialogContextProvider = FollowerAuthenticationDialogContext.Provider;
|
|
524
|
+
var useFollowerAuthenticationDialogContext = function () {
|
|
525
|
+
var context = React.useContext(FollowerAuthenticationDialogContext);
|
|
526
|
+
if (!context) {
|
|
527
|
+
throw new Error('useFollowerAuthenticationDialogContext must be called within FollowerAuthenticationDialogContextProvider');
|
|
528
|
+
}
|
|
529
|
+
return context;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
var FollowerAuthenticationGraphic = function () {
|
|
533
|
+
var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, graphics = _a.graphics;
|
|
534
|
+
var graphic = graphics[state.value];
|
|
535
|
+
if (!graphic)
|
|
536
|
+
return null;
|
|
537
|
+
return (React.createElement(core.Box, null,
|
|
538
|
+
React.createElement("img", { src: graphic, alt: messages[state.value + "GraphicAlt"] })));
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
var useStyles$3 = core.makeStyles(function () { return ({
|
|
542
|
+
form: {
|
|
543
|
+
display: 'flex',
|
|
544
|
+
flexDirection: 'column',
|
|
545
|
+
alignItems: 'center',
|
|
546
|
+
width: '100%',
|
|
547
|
+
gridGap: 16,
|
|
548
|
+
},
|
|
549
|
+
}); });
|
|
550
|
+
var northAmericanPhoneRegex = /^(\()?[2-9]{1}\d{2}(\))?[-\s.]?[2-9]{1}\d{2}[-\s.]?\d{4}$/;
|
|
551
|
+
var ukPhoneRegex = /^((\+?44\s?|0044\s?)(\s?\d{3,5}|\(\d{3,5}\))(\s?\d{3,4})(\s?\d{3,4})$|^07\d{9}$)/;
|
|
552
|
+
var validatePhoneNumber = function (phone) {
|
|
553
|
+
if (!phone)
|
|
554
|
+
return false;
|
|
555
|
+
return northAmericanPhoneRegex.test(phone) || ukPhoneRegex.test(phone);
|
|
556
|
+
};
|
|
557
|
+
var FollowerAuthenticationForm = function () {
|
|
558
|
+
var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, locationOptions = _a.locationOptions, onActionButtonClick = _a.onActionButtonClick, loading = _a.loading;
|
|
559
|
+
var classes = useStyles$3();
|
|
560
|
+
// sign-up form state
|
|
561
|
+
var formRef = React.useRef(null);
|
|
562
|
+
var _b = React.useState(false), formValidity = _b[0], setFormValidity = _b[1];
|
|
563
|
+
var _c = React.useState(), showPhoneErrorText = _c[0], setShowPhoneErrorText = _c[1];
|
|
564
|
+
var _d = React.useState(), showEmailErrorText = _d[0], setShowEmailErrorText = _d[1];
|
|
565
|
+
var _e = React.useState(), showLocationErrorText = _e[0], setShowLocationErrorText = _e[1];
|
|
566
|
+
var _f = React.useState(state.context.phone || ''), signUpPhoneValue = _f[0], setSignUpPhoneValue = _f[1];
|
|
567
|
+
var _g = React.useState(state.context.email || ''), signUpEmailValue = _g[0], setSignUpEmailValue = _g[1];
|
|
568
|
+
var checkFieldValidity = function (e) {
|
|
569
|
+
var _a, _b;
|
|
570
|
+
var fieldName = e.target.name;
|
|
571
|
+
var fieldValue = e.target.value;
|
|
572
|
+
switch (fieldName) {
|
|
573
|
+
case 'phone':
|
|
574
|
+
var isPhoneValid = validatePhoneNumber(fieldValue);
|
|
575
|
+
setSignUpPhoneValue(fieldValue);
|
|
576
|
+
setShowPhoneErrorText(!isPhoneValid && fieldValue.length > 0);
|
|
577
|
+
break;
|
|
578
|
+
case 'email':
|
|
579
|
+
var emailField = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.elements.namedItem(fieldName);
|
|
580
|
+
var isEmailValid = (_b = emailField === null || emailField === void 0 ? void 0 : emailField.validity.valid) !== null && _b !== void 0 ? _b : false;
|
|
581
|
+
setSignUpEmailValue(fieldValue);
|
|
582
|
+
setShowEmailErrorText(!isEmailValid && fieldValue.length > 0);
|
|
583
|
+
break;
|
|
584
|
+
case 'location':
|
|
585
|
+
setShowLocationErrorText(!fieldValue);
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
React.useEffect(function () {
|
|
590
|
+
var _a;
|
|
591
|
+
var hasValidPhone = Boolean(signUpPhoneValue) && !showPhoneErrorText;
|
|
592
|
+
var hasValidEmail = Boolean(signUpEmailValue) && !showEmailErrorText;
|
|
593
|
+
var locationField = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.elements.namedItem('location');
|
|
594
|
+
var hasValidLocation = locationField ? Boolean(locationField.value) : true;
|
|
595
|
+
var hasValidContact = hasValidPhone || hasValidEmail;
|
|
596
|
+
setFormValidity(hasValidContact && hasValidLocation);
|
|
597
|
+
}, [signUpPhoneValue, signUpEmailValue, showPhoneErrorText, showEmailErrorText, showLocationErrorText]);
|
|
598
|
+
var handleSubmit = function (e) {
|
|
599
|
+
e.preventDefault();
|
|
600
|
+
var form = e.target;
|
|
601
|
+
var formData = new FormData(form);
|
|
602
|
+
var values = Object.fromEntries(formData.entries());
|
|
603
|
+
onActionButtonClick('submit-form', values);
|
|
604
|
+
};
|
|
605
|
+
var formProps = {
|
|
606
|
+
id: 'follower-authentication-form',
|
|
607
|
+
className: classes.form,
|
|
608
|
+
onSubmit: handleSubmit,
|
|
609
|
+
};
|
|
610
|
+
switch (state.value) {
|
|
611
|
+
case 'initial':
|
|
612
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
613
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.initialInputLabel, key: "identifier-input", id: "identifier-input", name: "identifier" }),
|
|
614
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.initialCtaButtonLabel)));
|
|
615
|
+
case 'signUp':
|
|
616
|
+
return (React.createElement("form", tslib.__assign({ ref: formRef }, formProps, { onInvalid: function (e) {
|
|
617
|
+
e.preventDefault();
|
|
618
|
+
} }),
|
|
619
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.signUpPhoneInputLabel, key: "phone-input", id: "phone-input", name: "phone", onChange: checkFieldValidity, error: showPhoneErrorText, helperText: showPhoneErrorText && messages.signUpPhoneErrorText, inputProps: {
|
|
620
|
+
required: signUpEmailValue ? false : true,
|
|
621
|
+
}, defaultValue: state.context.phone }),
|
|
622
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.signUpNameInputLabel, key: "name-input", id: "name-input", name: "name", inputProps: { required: true } }),
|
|
623
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.signUpEmailInputLabel, key: "email-input", id: "email-input", name: "email", error: showEmailErrorText, helperText: showEmailErrorText && messages.signUpEmailErrorText, onChange: checkFieldValidity, inputProps: {
|
|
624
|
+
required: signUpPhoneValue ? false : true,
|
|
625
|
+
type: 'email',
|
|
626
|
+
}, defaultValue: state.context.email }),
|
|
627
|
+
React.createElement(core.TextField, { disabled: loading, select: true, onChange: checkFieldValidity, label: messages.signUpLocationInputLabel, error: showLocationErrorText, helperText: showLocationErrorText && messages.signUpLocationErrorText, key: "location-input", id: "location-input", inputProps: { required: true }, name: "location" }, locationOptions.map(function (locationOption) { return (React.createElement(core.MenuItem, { "data-cy": 'option', key: locationOption.value, value: locationOption.value }, locationOption.label)); })),
|
|
628
|
+
React.createElement(core.Typography, { style: { alignSelf: 'start' } }, messages.signUpBirthdaySectionLabel),
|
|
629
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.signUpMonthInputLabel, key: "birthday-month-input", id: "birthday-month-input", name: "birthdayMonth" }),
|
|
630
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.signUpDayInputLabel, key: "birthday-date-input", id: "birthday-date-input", name: "birthdayDate" }),
|
|
631
|
+
React.createElement(core.Button, { disabled: loading || !formValidity, type: "submit" }, messages.signUp)));
|
|
632
|
+
case 'emailFound':
|
|
633
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
634
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email }),
|
|
635
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.emailFoundCtaButtonLabel)));
|
|
636
|
+
case 'emailAuthCode':
|
|
637
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
638
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.emailAuthCodeInputLabel, key: "code-input", id: "code-input", name: "code" }),
|
|
639
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
|
|
640
|
+
case 'indirectUserFound': {
|
|
641
|
+
if (state.context.email) {
|
|
642
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
643
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email }),
|
|
644
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.indirectUserFoundCtaButtonLabel)));
|
|
645
|
+
}
|
|
646
|
+
else if (state.context.phone) {
|
|
647
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
648
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
|
|
649
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.indirectUserFoundCtaButtonLabel)));
|
|
650
|
+
}
|
|
651
|
+
else
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
case 'emailPasswordSignIn':
|
|
655
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
656
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.emailFoundInputLabel, key: "email-input", id: "email-input", name: "email", value: state.context.email, InputLabelProps: { shrink: true } }),
|
|
657
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.passwordInputLabel, key: "password-input", id: "password-input", name: "password", inputProps: { type: 'password' } }),
|
|
658
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
|
|
659
|
+
case 'phoneFound':
|
|
660
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
661
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
|
|
662
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.phoneFoundCtaButtonLabel)));
|
|
663
|
+
case 'phoneAuthCode':
|
|
664
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
665
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.phoneAuthCodeInputLabel, key: "code-input", id: "code-input", name: "code", autoComplete: "one-time-code" }),
|
|
666
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
|
|
667
|
+
case 'phonePasswordSignIn':
|
|
668
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
669
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.phoneFoundInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone, InputLabelProps: { shrink: true } }),
|
|
670
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.passwordInputLabel, key: "password-input", id: "password-input", name: "password", inputProps: { type: 'password' } }),
|
|
671
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.signIn)));
|
|
672
|
+
case 'requirePhone':
|
|
673
|
+
return (React.createElement("form", tslib.__assign({}, formProps),
|
|
674
|
+
React.createElement(core.TextField, { disabled: loading, label: messages.requirePhoneInputLabel, key: "phone-input", id: "phone-input", name: "phone", value: state.context.phone }),
|
|
675
|
+
React.createElement(core.Button, { disabled: loading, type: "submit" }, messages.requirePhoneCtaButtonLabel)));
|
|
676
|
+
case 'welcome':
|
|
677
|
+
return null;
|
|
678
|
+
default:
|
|
679
|
+
return null;
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
var useStyles$2 = core.makeStyles(function () { return ({
|
|
684
|
+
main: {
|
|
685
|
+
width: '100%',
|
|
686
|
+
display: 'flex',
|
|
687
|
+
flexDirection: 'column',
|
|
688
|
+
gridGap: 16,
|
|
689
|
+
},
|
|
690
|
+
}); });
|
|
691
|
+
var FollowerAuthenticationAltActions = function () {
|
|
692
|
+
var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, logos = _a.logos, loading = _a.loading, onActionButtonClick = _a.onActionButtonClick;
|
|
693
|
+
var classes = useStyles$2();
|
|
694
|
+
switch (state.value) {
|
|
695
|
+
case 'initial':
|
|
696
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
697
|
+
React.createElement(core.Divider, null),
|
|
698
|
+
React.createElement(core.Button, { variant: "outlined", startIcon: logos.facebook, onClick: function () {
|
|
699
|
+
onActionButtonClick('sign-in-with-facebook');
|
|
700
|
+
} }, messages.continueWithFacebookButtonLabel),
|
|
701
|
+
React.createElement(core.Button, { variant: "outlined", startIcon: logos.google, onClick: function () {
|
|
702
|
+
onActionButtonClick('sign-in-with-google');
|
|
703
|
+
} }, messages.continueWithGoogleButtonLabel)));
|
|
704
|
+
case 'signUp':
|
|
705
|
+
return null;
|
|
706
|
+
case 'emailFound':
|
|
707
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
708
|
+
React.createElement(core.Divider, null),
|
|
709
|
+
React.createElement(core.Button, { variant: "outlined", onClick: function () {
|
|
710
|
+
onActionButtonClick('sign-in-with-password');
|
|
711
|
+
} }, messages.signInWithPassword)));
|
|
712
|
+
case 'emailAuthCode':
|
|
713
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
714
|
+
React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: function () {
|
|
715
|
+
var form = document.querySelector('#follower-authentication-form');
|
|
716
|
+
var formData = new FormData(form);
|
|
717
|
+
var values = Object.fromEntries(formData.entries());
|
|
718
|
+
onActionButtonClick('request-auth-code-email', values);
|
|
719
|
+
} }, messages.resendAuthCode)));
|
|
720
|
+
case 'indirectUserFound':
|
|
721
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
722
|
+
React.createElement(core.Divider, null),
|
|
723
|
+
React.createElement(core.Button, { variant: "outlined", onClick: function () {
|
|
724
|
+
onActionButtonClick('use-different-account');
|
|
725
|
+
} }, messages.indirectUserFoundCtaButtonLabelAlt)));
|
|
726
|
+
case 'emailPasswordSignIn':
|
|
727
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
728
|
+
React.createElement(core.Divider, null),
|
|
729
|
+
React.createElement(core.Button, { variant: "outlined", onClick: function () {
|
|
730
|
+
var form = document.querySelector('#follower-authentication-form');
|
|
731
|
+
var formData = new FormData(form);
|
|
732
|
+
var values = Object.fromEntries(formData.entries());
|
|
733
|
+
onActionButtonClick('request-auth-code-email', values);
|
|
734
|
+
} }, messages.emailFoundCtaButtonLabel)));
|
|
735
|
+
case 'phoneFound':
|
|
736
|
+
return null;
|
|
737
|
+
case 'phoneAuthCode':
|
|
738
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
739
|
+
React.createElement(core.Button, { disabled: loading, variant: "outlined", onClick: function () {
|
|
740
|
+
var form = document.querySelector('#follower-authentication-form');
|
|
741
|
+
var formData = new FormData(form);
|
|
742
|
+
var values = Object.fromEntries(formData.entries());
|
|
743
|
+
onActionButtonClick('request-auth-code-sms', values);
|
|
744
|
+
} }, messages.resendAuthCode)));
|
|
745
|
+
case 'phonePasswordSignIn':
|
|
746
|
+
return (React.createElement(core.Box, { className: classes.main },
|
|
747
|
+
React.createElement(core.Divider, null),
|
|
748
|
+
React.createElement(core.Button, { variant: "outlined", onClick: function () {
|
|
749
|
+
var form = document.querySelector('#follower-authentication-form');
|
|
750
|
+
var formData = new FormData(form);
|
|
751
|
+
var values = Object.fromEntries(formData.entries());
|
|
752
|
+
onActionButtonClick('request-auth-code-sms', values);
|
|
753
|
+
} }, messages.phoneFoundCtaButtonLabel)));
|
|
754
|
+
case 'welcome':
|
|
755
|
+
return (React.createElement(core.Button, { onClick: function () {
|
|
756
|
+
onActionButtonClick('close');
|
|
757
|
+
} }, messages.done));
|
|
758
|
+
default:
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
var FollowerAuthenticationBody = function () {
|
|
764
|
+
return (React.createElement(React.Fragment, null,
|
|
765
|
+
React.createElement(FollowerAuthenticationForm, null),
|
|
766
|
+
React.createElement(FollowerAuthenticationAltActions, null)));
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
var FollowerAuthenticationFooter = function () {
|
|
770
|
+
var _a = useFollowerAuthenticationDialogContext(), messages = _a.messages, logos = _a.logos;
|
|
771
|
+
return (React.createElement(core.Box, { display: "flex", gridGap: 8 },
|
|
772
|
+
React.createElement(core.Typography, { variant: "body2" }, messages.poweredBy),
|
|
773
|
+
logos.popmenu));
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
var FollowerAuthenticationTitle = function () {
|
|
777
|
+
var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages;
|
|
778
|
+
var title = messages[state.value + "Title"];
|
|
779
|
+
return (React.createElement(core.Box, null,
|
|
780
|
+
React.createElement(core.Typography, { variant: "h1", align: "center" }, title)));
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
var FollowerAuthenticationInfo = function () {
|
|
784
|
+
var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages;
|
|
785
|
+
var info = messages[state.value + "Info"];
|
|
786
|
+
if (!info)
|
|
787
|
+
return null;
|
|
788
|
+
return (React.createElement(core.Box, null,
|
|
789
|
+
React.createElement(core.Typography, { align: "center" }, info)));
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
var useStyles$1 = core.makeStyles(function () { return ({
|
|
793
|
+
root: {
|
|
794
|
+
position: 'absolute',
|
|
795
|
+
top: 0,
|
|
796
|
+
right: 0,
|
|
797
|
+
},
|
|
798
|
+
}); });
|
|
799
|
+
var FollowerAuthenticationCloseButton = function () {
|
|
800
|
+
var _a = useFollowerAuthenticationDialogContext(), messages = _a.messages, onActionButtonClick = _a.onActionButtonClick;
|
|
801
|
+
var classes = useStyles$1();
|
|
802
|
+
var handleClose = function () {
|
|
803
|
+
onActionButtonClick('close');
|
|
804
|
+
};
|
|
805
|
+
return (React.createElement(core.IconButton, { classes: classes, "aria-label": messages.closeButtonLabel, onClick: handleClose },
|
|
806
|
+
React.createElement(webIcons.X, null)));
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
var theme = {
|
|
810
|
+
palette: {
|
|
811
|
+
primary: { main: '#2E3042' },
|
|
812
|
+
},
|
|
813
|
+
typography: {
|
|
814
|
+
h1: {
|
|
815
|
+
fontFamily: 'Poppins',
|
|
816
|
+
fontSize: '24px',
|
|
817
|
+
fontWeight: 400,
|
|
818
|
+
lineHeight: '36px',
|
|
819
|
+
},
|
|
820
|
+
},
|
|
821
|
+
props: {
|
|
822
|
+
MuiTextField: {
|
|
823
|
+
variant: 'outlined',
|
|
824
|
+
fullWidth: true,
|
|
825
|
+
},
|
|
826
|
+
MuiButton: {
|
|
827
|
+
variant: 'contained',
|
|
828
|
+
color: 'primary',
|
|
829
|
+
disableElevation: true,
|
|
830
|
+
fullWidth: true,
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
overrides: {
|
|
834
|
+
MuiButton: {
|
|
835
|
+
root: {
|
|
836
|
+
borderRadius: 32,
|
|
837
|
+
textTransform: 'none',
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
},
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
var FollowerAuthenticationDialog = function (props) {
|
|
844
|
+
var open = props.open, restProps = tslib.__rest(props, ["open"]);
|
|
845
|
+
var theme$1 = core.createTheme(theme);
|
|
846
|
+
var fullScreen = core.useMediaQuery(function (_a) {
|
|
847
|
+
var breakpoints = _a.breakpoints;
|
|
848
|
+
return breakpoints.down('sm');
|
|
849
|
+
});
|
|
850
|
+
var handleClose = function () {
|
|
851
|
+
restProps.onActionButtonClick('close');
|
|
852
|
+
};
|
|
853
|
+
return (React.createElement(core.ThemeProvider, { theme: theme$1 },
|
|
854
|
+
React.createElement(FollowerAuthenticationDialogContextProvider, { value: restProps },
|
|
855
|
+
React.createElement(core.Dialog, { open: open, fullScreen: fullScreen, onClose: handleClose },
|
|
856
|
+
React.createElement(FollowerAuthenticationContent, null,
|
|
857
|
+
React.createElement(FollowerAuthenticationCloseButton, null),
|
|
858
|
+
React.createElement(FollowerAuthenticationGraphic, null),
|
|
859
|
+
React.createElement(FollowerAuthenticationTitle, null),
|
|
860
|
+
React.createElement(FollowerAuthenticationInfo, null),
|
|
861
|
+
React.createElement(FollowerAuthenticationBody, null),
|
|
862
|
+
React.createElement(FollowerAuthenticationFooter, null))))));
|
|
863
|
+
};
|
|
864
|
+
|
|
865
|
+
var IconButton = React.forwardRef(function (props, ref) {
|
|
866
|
+
return React.createElement(core.IconButton, tslib.__assign({ ref: ref }, props));
|
|
867
|
+
});
|
|
868
|
+
IconButton.displayName = 'IconButton';
|
|
869
|
+
IconButton.defaultProps = {
|
|
870
|
+
color: 'secondary',
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
var useLinkStyles = core.makeStyles(function (theme) { return ({
|
|
874
|
+
root: function (props) {
|
|
875
|
+
var _a;
|
|
876
|
+
return (tslib.__assign(tslib.__assign({ display: 'flex' }, (props.color === undefined && { color: theme.palette.info.main })), (_a = {}, _a["& ." + iconStaticClassName] = {
|
|
877
|
+
alignSelf: 'center',
|
|
878
|
+
}, _a)));
|
|
879
|
+
},
|
|
880
|
+
}); });
|
|
881
|
+
|
|
882
|
+
// eslint-disable-next-line react/display-name -- false positive
|
|
883
|
+
var Link = React.forwardRef(function (props, ref) {
|
|
884
|
+
var children = props.children, muiProps = tslib.__rest(props, ["children"]);
|
|
885
|
+
var classes = useLinkStyles(props);
|
|
886
|
+
return (React.createElement(core.Link, tslib.__assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
|
|
887
|
+
});
|
|
888
|
+
Link.defaultProps = {
|
|
889
|
+
variant: 'body1',
|
|
890
|
+
};
|
|
891
|
+
Link.displayName = 'Link';
|
|
892
|
+
|
|
893
|
+
var useNumberFieldStyles = core.makeStyles(function () { return ({
|
|
894
|
+
root: {
|
|
895
|
+
height: 56,
|
|
896
|
+
},
|
|
897
|
+
}); });
|
|
898
|
+
var useNumberInputStyles = core.makeStyles(function (theme) { return ({
|
|
899
|
+
root: {
|
|
900
|
+
height: '100%',
|
|
901
|
+
width: 'min-content',
|
|
902
|
+
borderRadius: theme.spacing(1),
|
|
903
|
+
},
|
|
904
|
+
input: {
|
|
905
|
+
'&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
906
|
+
display: 'none',
|
|
907
|
+
},
|
|
908
|
+
'-moz-appearance': 'textfield',
|
|
909
|
+
minWidth: 40,
|
|
910
|
+
padding: 0,
|
|
911
|
+
textAlign: 'center',
|
|
912
|
+
},
|
|
913
|
+
adornedStart: {
|
|
914
|
+
padding: 0,
|
|
915
|
+
},
|
|
916
|
+
adornedEnd: {
|
|
917
|
+
padding: 0,
|
|
918
|
+
},
|
|
919
|
+
}); });
|
|
920
|
+
|
|
921
|
+
var NumberField = function (props) {
|
|
922
|
+
var onIncrement = props.onIncrement, onDecrement = props.onDecrement, _a = props.endAdornmentButtonProps, endAdornmentButtonProps = _a === void 0 ? {} : _a, _b = props.startAdornmentButtonProps, startAdornmentButtonProps = _b === void 0 ? {} : _b, _c = props.InputProps, InputProps = _c === void 0 ? {} : _c, classes = props.classes, restProps = tslib.__rest(props, ["onIncrement", "onDecrement", "endAdornmentButtonProps", "startAdornmentButtonProps", "InputProps", "classes"]);
|
|
923
|
+
var _d = InputProps, inputClassesOverride = _d.classes, restInputProps = tslib.__rest(_d, ["classes"]);
|
|
924
|
+
var fieldClasses = useNumberFieldStyles(props);
|
|
925
|
+
var inputClasses = useNumberInputStyles(props);
|
|
926
|
+
return (React.createElement(core.TextField, tslib.__assign({ classes: tslib.__assign(tslib.__assign({}, fieldClasses), classes), variant: "filled", type: "number", defaultValue: 0, InputProps: tslib.__assign({ classes: tslib.__assign(tslib.__assign({}, inputClasses), inputClassesOverride), disableUnderline: true, endAdornment: (React.createElement(IconButton, tslib.__assign({ style: { fontSize: 20 }, onClick: onIncrement }, endAdornmentButtonProps),
|
|
927
|
+
React.createElement(Icon, { icon: webIcons.PlusCircle }))), startAdornment: (React.createElement(IconButton, tslib.__assign({ style: { fontSize: 20 }, onClick: onDecrement }, startAdornmentButtonProps),
|
|
928
|
+
React.createElement(Icon, { icon: webIcons.MinusCircle }))) }, restInputProps) }, restProps)));
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
var useStyles = core.makeStyles(function (_a) {
|
|
932
|
+
var spacing = _a.spacing;
|
|
933
|
+
return ({
|
|
934
|
+
root: {
|
|
935
|
+
'&:last-child': {
|
|
936
|
+
marginBottom: 0,
|
|
937
|
+
},
|
|
938
|
+
marginBottom: spacing(4),
|
|
939
|
+
padding: spacing(4),
|
|
940
|
+
},
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
var Paper = React.forwardRef(function (props, ref) {
|
|
944
|
+
var legacyStyles = props.legacyStyles, restProps = tslib.__rest(props, ["legacyStyles"]);
|
|
945
|
+
var classes = useStyles(props);
|
|
946
|
+
return React.createElement(core.Paper, tslib.__assign({}, ref, { classes: tslib.__assign({}, (legacyStyles && classes)) }, restProps));
|
|
947
|
+
});
|
|
948
|
+
Paper.displayName = 'Paper';
|
|
949
|
+
Paper.defaultProps = {
|
|
950
|
+
legacyStyles: false,
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
var PaperContent = function (props) {
|
|
954
|
+
var children = props.children;
|
|
955
|
+
return React.createElement(core.Box, { padding: 4 }, children);
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
var Radio = React.forwardRef(function (props, ref) {
|
|
959
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
|
|
960
|
+
var control = React.createElement(core.Radio, tslib.__assign({ disabled: label ? undefined : disabled }, muiProps));
|
|
961
|
+
return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
962
|
+
});
|
|
963
|
+
Radio.displayName = 'Radio';
|
|
964
|
+
|
|
965
|
+
var useSplitInputStyles = core.makeStyles(function () { return ({
|
|
966
|
+
textfield: {
|
|
967
|
+
background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
|
|
968
|
+
borderTopLeftRadius: 4,
|
|
969
|
+
borderBottomLeftRadius: 4,
|
|
970
|
+
'& fieldset': {
|
|
971
|
+
borderRight: 'none',
|
|
972
|
+
borderTopRightRadius: 0,
|
|
973
|
+
borderBottomRightRadius: 0,
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
button: {
|
|
977
|
+
borderTopLeftRadius: 0,
|
|
978
|
+
borderBottomLeftRadius: 0,
|
|
979
|
+
alignSelf: 'stretch',
|
|
980
|
+
},
|
|
981
|
+
input: {
|
|
982
|
+
color: function (props) { return props.inputTextColor || 'inherit'; },
|
|
983
|
+
'&$focused fieldset': {
|
|
984
|
+
top: -4,
|
|
985
|
+
},
|
|
986
|
+
},
|
|
987
|
+
focused: {},
|
|
988
|
+
}); });
|
|
989
|
+
|
|
990
|
+
var SplitInput = function (props) {
|
|
991
|
+
var buttonLabel = props.buttonLabel, TextFieldProps = props.TextFieldProps, ButtonProps = props.ButtonProps, color = props.color, onChange = props.onChange, onClick = props.onClick;
|
|
992
|
+
var classes = useSplitInputStyles(props);
|
|
993
|
+
return (React.createElement(core.Box, { display: "flex" },
|
|
994
|
+
React.createElement(core.TextField, tslib.__assign({ classes: { root: classes.textfield }, InputProps: { classes: { root: classes.input, focused: classes.focused } }, color: color, variant: "outlined", onChange: onChange }, TextFieldProps)),
|
|
995
|
+
React.createElement(Button, tslib.__assign({ classes: { root: classes.button }, disableElevation: true, color: color, variant: "contained", onClick: onClick }, ButtonProps), buttonLabel)));
|
|
996
|
+
};
|
|
997
|
+
SplitInput.displayName = 'SplitInput';
|
|
998
|
+
SplitInput.defaultProps = {
|
|
999
|
+
backgroundTransparency: true,
|
|
1000
|
+
color: 'primary',
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
var useSwitchStyles = core.makeStyles(function (theme) { return ({
|
|
1004
|
+
checked: {
|
|
1005
|
+
'& $thumb': {
|
|
1006
|
+
background: theme.palette.success.main,
|
|
1007
|
+
},
|
|
1008
|
+
'&& + $track': {
|
|
1009
|
+
backgroundColor: theme.palette.success.main,
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
thumb: {},
|
|
1013
|
+
track: {},
|
|
1014
|
+
}); });
|
|
1015
|
+
|
|
1016
|
+
var Switch = React.forwardRef(function (props, ref) {
|
|
1017
|
+
var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = tslib.__rest(props, ["label", "disabled", "LabelProps"]);
|
|
1018
|
+
var classes = useSwitchStyles(props);
|
|
1019
|
+
var control = React.createElement(core.Switch, tslib.__assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
|
|
1020
|
+
return label ? (React.createElement(core.FormControlLabel, tslib.__assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
|
|
1021
|
+
});
|
|
1022
|
+
Switch.displayName = 'Switch';
|
|
1023
|
+
|
|
1024
|
+
var TabPanel = function (props) {
|
|
1025
|
+
var children = props.children, show = props.show;
|
|
1026
|
+
return show ? React.createElement(core.Box, null, children) : null;
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
var useToggleButtonStyles = core.makeStyles(function (theme) { return ({
|
|
1030
|
+
root: {
|
|
1031
|
+
color: theme.palette.text.primary,
|
|
1032
|
+
},
|
|
1033
|
+
selected: {
|
|
1034
|
+
'&&': {
|
|
1035
|
+
'&:hover': {
|
|
1036
|
+
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
|
|
1037
|
+
},
|
|
1038
|
+
backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
|
|
1039
|
+
color: 'white',
|
|
1040
|
+
},
|
|
1041
|
+
},
|
|
1042
|
+
}); });
|
|
1043
|
+
|
|
1044
|
+
var ToggleButton = React.forwardRef(function (props, ref) {
|
|
1045
|
+
var children = props.children, muiProps = tslib.__rest(props, ["children"]);
|
|
1046
|
+
var classes = useToggleButtonStyles(props);
|
|
1047
|
+
return (React.createElement(lab.ToggleButton, tslib.__assign({ ref: ref, classes: {
|
|
1048
|
+
root: classes.root,
|
|
1049
|
+
selected: classes.selected,
|
|
1050
|
+
} }, muiProps), children));
|
|
1051
|
+
});
|
|
1052
|
+
ToggleButton.defaultProps = {
|
|
1053
|
+
color: 'primary',
|
|
1054
|
+
};
|
|
1055
|
+
ToggleButton.displayName = 'ToggleButton';
|
|
1056
|
+
|
|
1057
|
+
var useToggleButtonGroupStyles = core.makeStyles(function (theme) { return ({
|
|
1058
|
+
root: {
|
|
1059
|
+
'&&': {
|
|
1060
|
+
backgroundColor: theme.palette.grey[300],
|
|
1061
|
+
},
|
|
1062
|
+
},
|
|
1063
|
+
}); });
|
|
1064
|
+
|
|
1065
|
+
var ToggleButtonGroup = React.forwardRef(function (props, ref) {
|
|
1066
|
+
var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = tslib.__rest(props, ["children", "color"]);
|
|
1067
|
+
var classes = useToggleButtonGroupStyles(props);
|
|
1068
|
+
var childrenWithProps = React.Children.map(children, function (child) {
|
|
1069
|
+
if (!React.isValidElement(child)) {
|
|
1070
|
+
return null;
|
|
1071
|
+
}
|
|
1072
|
+
return React.cloneElement(child, { color: color });
|
|
1073
|
+
});
|
|
1074
|
+
return (React.createElement(lab.ToggleButtonGroup, tslib.__assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
|
|
1075
|
+
});
|
|
1076
|
+
ToggleButtonGroup.displayName = 'ToggleButtonGroup';
|
|
1077
|
+
|
|
1078
|
+
var useTooltipStyles = core.makeStyles(function (_a) {
|
|
1079
|
+
var typography = _a.typography;
|
|
1080
|
+
return ({
|
|
1081
|
+
tooltip: {
|
|
1082
|
+
fontSize: typography.pxToRem(16),
|
|
1083
|
+
},
|
|
1084
|
+
});
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
var Tooltip = React.forwardRef(function (props, ref) {
|
|
1088
|
+
var classes = useTooltipStyles(props);
|
|
1089
|
+
return React.createElement(core.Tooltip, tslib.__assign({ ref: ref, classes: classes }, props));
|
|
1090
|
+
});
|
|
1091
|
+
Tooltip.displayName = 'Tooltip';
|
|
1092
|
+
|
|
1093
|
+
var useCollapsibleText = function () {
|
|
1094
|
+
var _a = React.useState(false), open = _a[0], setOpen = _a[1];
|
|
1095
|
+
var collapseState = React.useState(false);
|
|
1096
|
+
var toggle = function () { return collapseState[0] && setOpen(!open); };
|
|
1097
|
+
return {
|
|
1098
|
+
collapsibleText: {
|
|
1099
|
+
open: open,
|
|
1100
|
+
collapseState: collapseState,
|
|
1101
|
+
},
|
|
1102
|
+
toggle: toggle,
|
|
1103
|
+
};
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
var useTabs = function (options) {
|
|
1107
|
+
var initialTab = options.initialTab;
|
|
1108
|
+
var genTabId = function (id) { return ("tab-" + id).toLowerCase().replace(/ /g, '-'); };
|
|
1109
|
+
var genPanelId = function (id) { return ("tab-panel-" + id).toLowerCase().replace(/ /g, '-'); };
|
|
1110
|
+
var _a = React.useState(genTabId(initialTab)), activeTab = _a[0], setActiveTab = _a[1];
|
|
1111
|
+
var handleChange = function (_, nextTab) { return setActiveTab(nextTab); };
|
|
1112
|
+
var TabsProps = { onChange: handleChange, value: activeTab };
|
|
1113
|
+
var useTab = function (baseId) {
|
|
1114
|
+
var tabId = genTabId(baseId);
|
|
1115
|
+
var tabPanelId = genPanelId(baseId);
|
|
1116
|
+
var tabProps = {
|
|
1117
|
+
id: tabId,
|
|
1118
|
+
label: baseId,
|
|
1119
|
+
value: tabId,
|
|
1120
|
+
'aria-controls': tabPanelId,
|
|
1121
|
+
};
|
|
1122
|
+
var panelProps = {
|
|
1123
|
+
id: tabPanelId,
|
|
1124
|
+
role: 'tabpanel',
|
|
1125
|
+
show: activeTab === tabId,
|
|
1126
|
+
'aria-labelledby': tabId,
|
|
1127
|
+
};
|
|
1128
|
+
return [tabProps, panelProps];
|
|
1129
|
+
};
|
|
1130
|
+
return {
|
|
1131
|
+
TabsProps: TabsProps,
|
|
1132
|
+
useTab: useTab,
|
|
1133
|
+
setActiveTab: function (tabId) { return setActiveTab(tabId); },
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
Object.defineProperty(exports, "ServerStyleSheets", {
|
|
1138
|
+
enumerable: true,
|
|
1139
|
+
get: function () { return core.ServerStyleSheets; }
|
|
1140
|
+
});
|
|
1141
|
+
Object.defineProperty(exports, "alpha", {
|
|
1142
|
+
enumerable: true,
|
|
1143
|
+
get: function () { return core.alpha; }
|
|
1144
|
+
});
|
|
1145
|
+
Object.defineProperty(exports, "createTheme", {
|
|
1146
|
+
enumerable: true,
|
|
1147
|
+
get: function () { return core.createTheme; }
|
|
1148
|
+
});
|
|
1149
|
+
Object.defineProperty(exports, "darken", {
|
|
1150
|
+
enumerable: true,
|
|
1151
|
+
get: function () { return core.darken; }
|
|
1152
|
+
});
|
|
1153
|
+
Object.defineProperty(exports, "decomposeColor", {
|
|
1154
|
+
enumerable: true,
|
|
1155
|
+
get: function () { return core.decomposeColor; }
|
|
1156
|
+
});
|
|
1157
|
+
Object.defineProperty(exports, "getLuminance", {
|
|
1158
|
+
enumerable: true,
|
|
1159
|
+
get: function () { return core.getLuminance; }
|
|
1160
|
+
});
|
|
1161
|
+
Object.defineProperty(exports, "hexToRgb", {
|
|
1162
|
+
enumerable: true,
|
|
1163
|
+
get: function () { return core.hexToRgb; }
|
|
1164
|
+
});
|
|
1165
|
+
Object.defineProperty(exports, "lighten", {
|
|
1166
|
+
enumerable: true,
|
|
1167
|
+
get: function () { return core.lighten; }
|
|
1168
|
+
});
|
|
1169
|
+
Object.defineProperty(exports, "makeStyles", {
|
|
1170
|
+
enumerable: true,
|
|
1171
|
+
get: function () { return core.makeStyles; }
|
|
1172
|
+
});
|
|
1173
|
+
Object.defineProperty(exports, "recomposeColor", {
|
|
1174
|
+
enumerable: true,
|
|
1175
|
+
get: function () { return core.recomposeColor; }
|
|
1176
|
+
});
|
|
1177
|
+
Object.defineProperty(exports, "rgbToHex", {
|
|
1178
|
+
enumerable: true,
|
|
1179
|
+
get: function () { return core.rgbToHex; }
|
|
1180
|
+
});
|
|
1181
|
+
Object.defineProperty(exports, "Alert", {
|
|
1182
|
+
enumerable: true,
|
|
1183
|
+
get: function () { return lab.Alert; }
|
|
1184
|
+
});
|
|
1185
|
+
Object.defineProperty(exports, "AlertTitle", {
|
|
1186
|
+
enumerable: true,
|
|
1187
|
+
get: function () { return lab.AlertTitle; }
|
|
1188
|
+
});
|
|
1189
|
+
Object.defineProperty(exports, "Autocomplete", {
|
|
1190
|
+
enumerable: true,
|
|
1191
|
+
get: function () { return lab.Autocomplete; }
|
|
1192
|
+
});
|
|
1193
|
+
Object.defineProperty(exports, "AvatarGroup", {
|
|
1194
|
+
enumerable: true,
|
|
1195
|
+
get: function () { return lab.AvatarGroup; }
|
|
1196
|
+
});
|
|
1197
|
+
Object.defineProperty(exports, "Pagination", {
|
|
1198
|
+
enumerable: true,
|
|
1199
|
+
get: function () { return lab.Pagination; }
|
|
1200
|
+
});
|
|
1201
|
+
Object.defineProperty(exports, "PaginationItem", {
|
|
1202
|
+
enumerable: true,
|
|
1203
|
+
get: function () { return lab.PaginationItem; }
|
|
1204
|
+
});
|
|
1205
|
+
Object.defineProperty(exports, "Rating", {
|
|
1206
|
+
enumerable: true,
|
|
1207
|
+
get: function () { return lab.Rating; }
|
|
1208
|
+
});
|
|
1209
|
+
Object.defineProperty(exports, "Skeleton", {
|
|
1210
|
+
enumerable: true,
|
|
1211
|
+
get: function () { return lab.Skeleton; }
|
|
1212
|
+
});
|
|
1213
|
+
Object.defineProperty(exports, "SpeedDial", {
|
|
1214
|
+
enumerable: true,
|
|
1215
|
+
get: function () { return lab.SpeedDial; }
|
|
1216
|
+
});
|
|
1217
|
+
Object.defineProperty(exports, "SpeedDialAction", {
|
|
1218
|
+
enumerable: true,
|
|
1219
|
+
get: function () { return lab.SpeedDialAction; }
|
|
1220
|
+
});
|
|
1221
|
+
Object.defineProperty(exports, "SpeedDialIcon", {
|
|
1222
|
+
enumerable: true,
|
|
1223
|
+
get: function () { return lab.SpeedDialIcon; }
|
|
1224
|
+
});
|
|
1225
|
+
Object.defineProperty(exports, "TabContext", {
|
|
1226
|
+
enumerable: true,
|
|
1227
|
+
get: function () { return lab.TabContext; }
|
|
1228
|
+
});
|
|
1229
|
+
Object.defineProperty(exports, "TabList", {
|
|
1230
|
+
enumerable: true,
|
|
1231
|
+
get: function () { return lab.TabList; }
|
|
1232
|
+
});
|
|
1233
|
+
Object.defineProperty(exports, "Timeline", {
|
|
1234
|
+
enumerable: true,
|
|
1235
|
+
get: function () { return lab.Timeline; }
|
|
1236
|
+
});
|
|
1237
|
+
Object.defineProperty(exports, "TimelineConnector", {
|
|
1238
|
+
enumerable: true,
|
|
1239
|
+
get: function () { return lab.TimelineConnector; }
|
|
1240
|
+
});
|
|
1241
|
+
Object.defineProperty(exports, "TimelineContent", {
|
|
1242
|
+
enumerable: true,
|
|
1243
|
+
get: function () { return lab.TimelineContent; }
|
|
1244
|
+
});
|
|
1245
|
+
Object.defineProperty(exports, "TimelineDot", {
|
|
1246
|
+
enumerable: true,
|
|
1247
|
+
get: function () { return lab.TimelineDot; }
|
|
1248
|
+
});
|
|
1249
|
+
Object.defineProperty(exports, "TimelineItem", {
|
|
1250
|
+
enumerable: true,
|
|
1251
|
+
get: function () { return lab.TimelineItem; }
|
|
1252
|
+
});
|
|
1253
|
+
Object.defineProperty(exports, "TimelineOppositeContent", {
|
|
1254
|
+
enumerable: true,
|
|
1255
|
+
get: function () { return lab.TimelineOppositeContent; }
|
|
1256
|
+
});
|
|
1257
|
+
Object.defineProperty(exports, "TimelineSeparator", {
|
|
1258
|
+
enumerable: true,
|
|
1259
|
+
get: function () { return lab.TimelineSeparator; }
|
|
1260
|
+
});
|
|
1261
|
+
Object.defineProperty(exports, "TreeItem", {
|
|
1262
|
+
enumerable: true,
|
|
1263
|
+
get: function () { return lab.TreeItem; }
|
|
1264
|
+
});
|
|
1265
|
+
Object.defineProperty(exports, "TreeView", {
|
|
1266
|
+
enumerable: true,
|
|
1267
|
+
get: function () { return lab.TreeView; }
|
|
1268
|
+
});
|
|
1269
|
+
Object.defineProperty(exports, "useAutocomplete", {
|
|
1270
|
+
enumerable: true,
|
|
1271
|
+
get: function () { return lab.useAutocomplete; }
|
|
1272
|
+
});
|
|
1273
|
+
exports.Avatar = Avatar;
|
|
1274
|
+
exports.BrowserSilhouette = BrowserSilhouette;
|
|
1275
|
+
exports.Button = Button;
|
|
1276
|
+
exports.Checkbox = Checkbox;
|
|
1277
|
+
exports.Chip = Chip;
|
|
1278
|
+
exports.CollapsibleText = CollapsibleText;
|
|
1279
|
+
exports.Divider = Divider;
|
|
1280
|
+
exports.FollowerAuthenticationDialog = FollowerAuthenticationDialog;
|
|
1281
|
+
exports.Icon = Icon;
|
|
1282
|
+
exports.IconButton = IconButton;
|
|
1283
|
+
exports.Link = Link;
|
|
1284
|
+
exports.NumberField = NumberField;
|
|
1285
|
+
exports.Paper = Paper;
|
|
1286
|
+
exports.PaperContent = PaperContent;
|
|
1287
|
+
exports.Radio = Radio;
|
|
1288
|
+
exports.SplitInput = SplitInput;
|
|
1289
|
+
exports.Switch = Switch;
|
|
1290
|
+
exports.TabPanel = TabPanel;
|
|
1291
|
+
exports.ToggleButton = ToggleButton;
|
|
1292
|
+
exports.ToggleButtonGroup = ToggleButtonGroup;
|
|
1293
|
+
exports.Tooltip = Tooltip;
|
|
1294
|
+
exports.Typography = Typography;
|
|
1295
|
+
exports.useCollapsibleText = useCollapsibleText;
|
|
1296
|
+
exports.useTabs = useTabs;
|
|
1297
|
+
Object.keys(core).forEach(function (k) {
|
|
1298
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1299
|
+
enumerable: true,
|
|
1300
|
+
get: function () { return core[k]; }
|
|
1301
|
+
});
|
|
1302
|
+
});
|
|
1303
|
+
//# sourceMappingURL=index.js.map
|