@popmenu/common-ui 0.127.0 → 0.127.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/build/cjs/components/Avatar/AvatarProps.d.ts +2 -2
  2. package/build/cjs/components/Button/Button.d.ts +1 -1
  3. package/build/cjs/components/Button/ButtonProps.d.ts +1 -1
  4. package/build/cjs/components/Button/ButtonStyles.d.ts +1 -1
  5. package/build/cjs/components/Chip/Chip.d.ts +1 -1
  6. package/build/cjs/components/Chip/ChipProps.d.ts +2 -2
  7. package/build/cjs/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
  8. package/build/cjs/components/Divider/DividerProps.d.ts +1 -1
  9. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
  10. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
  11. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
  12. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
  13. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
  14. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
  15. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
  16. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
  17. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
  18. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
  19. package/build/cjs/components/FollowerAuthenticationDialog/context.d.ts +0 -1
  20. package/build/cjs/components/Icon/IconStyles.d.ts +1 -1
  21. package/build/cjs/components/IconButton/IconButtonProps.d.ts +1 -1
  22. package/build/cjs/components/Link/LinkStyles.d.ts +1 -1
  23. package/build/cjs/components/NumberField/NumberField.d.ts +0 -1
  24. package/build/cjs/components/NumberField/NumberFieldStyles.d.ts +1 -1
  25. package/build/cjs/components/SplitInput/SplitInputStyles.d.ts +1 -1
  26. package/build/cjs/components/Tooltip/TooltipProps.d.ts +1 -1
  27. package/build/cjs/components/Typography/Typography.d.ts +1 -1
  28. package/build/cjs/components/Typography/TypographyProps.d.ts +3 -3
  29. package/build/cjs/components/Typography/TypographyStyles.d.ts +1 -1
  30. package/build/cjs/hooks/useTabs/useTabsResult.d.ts +3 -3
  31. package/build/cjs/index.js +412 -437
  32. package/build/cjs/index.js.map +1 -1
  33. package/build/cjs/types/index.d.ts +2 -2
  34. package/build/esm/components/Avatar/Avatar.js +9 -10
  35. package/build/esm/components/Avatar/Avatar.js.map +1 -1
  36. package/build/esm/components/Avatar/AvatarProps.d.ts +2 -2
  37. package/build/esm/components/Avatar/avatar.styles.js +11 -11
  38. package/build/esm/components/Avatar/avatar.styles.js.map +1 -1
  39. package/build/esm/components/Avatar/util/useImageProps.js +9 -8
  40. package/build/esm/components/Avatar/util/useImageProps.js.map +1 -1
  41. package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js +2 -3
  42. package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js.map +1 -1
  43. package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js +5 -5
  44. package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js.map +1 -1
  45. package/build/esm/components/Button/Button.d.ts +1 -1
  46. package/build/esm/components/Button/Button.js +7 -8
  47. package/build/esm/components/Button/Button.js.map +1 -1
  48. package/build/esm/components/Button/ButtonProps.d.ts +1 -1
  49. package/build/esm/components/Button/ButtonStyles.d.ts +1 -1
  50. package/build/esm/components/Button/ButtonStyles.js +3 -6
  51. package/build/esm/components/Button/ButtonStyles.js.map +1 -1
  52. package/build/esm/components/Checkbox/Checkbox.js +5 -5
  53. package/build/esm/components/Checkbox/Checkbox.js.map +1 -1
  54. package/build/esm/components/Chip/Chip.d.ts +1 -1
  55. package/build/esm/components/Chip/Chip.js +7 -8
  56. package/build/esm/components/Chip/Chip.js.map +1 -1
  57. package/build/esm/components/Chip/ChipProps.d.ts +2 -2
  58. package/build/esm/components/Chip/ChipStyles.js +19 -19
  59. package/build/esm/components/Chip/ChipStyles.js.map +1 -1
  60. package/build/esm/components/CollapsibleText/CollapsibleText.js +19 -20
  61. package/build/esm/components/CollapsibleText/CollapsibleText.js.map +1 -1
  62. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
  63. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js +5 -6
  64. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js.map +1 -1
  65. package/build/esm/components/Divider/Divider.js +11 -15
  66. package/build/esm/components/Divider/Divider.js.map +1 -1
  67. package/build/esm/components/Divider/DividerProps.d.ts +1 -1
  68. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
  69. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +26 -26
  70. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -1
  71. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
  72. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js +1 -1
  73. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js.map +1 -1
  74. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
  75. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js +6 -6
  76. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js.map +1 -1
  77. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +4 -4
  78. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -1
  79. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
  80. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +11 -15
  81. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
  82. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
  83. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
  84. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +2 -2
  85. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -1
  86. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
  87. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +49 -52
  88. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
  89. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
  90. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +4 -4
  91. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -1
  92. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
  93. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +3 -3
  94. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -1
  95. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
  96. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +3 -3
  97. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
  98. package/build/esm/components/FollowerAuthenticationDialog/context.d.ts +0 -1
  99. package/build/esm/components/FollowerAuthenticationDialog/context.js +4 -4
  100. package/build/esm/components/FollowerAuthenticationDialog/context.js.map +1 -1
  101. package/build/esm/components/FollowerAuthenticationDialog/theme.js +1 -1
  102. package/build/esm/components/FollowerAuthenticationDialog/theme.js.map +1 -1
  103. package/build/esm/components/Icon/Icon.js +12 -8
  104. package/build/esm/components/Icon/Icon.js.map +1 -1
  105. package/build/esm/components/Icon/IconStyles.d.ts +1 -1
  106. package/build/esm/components/Icon/IconStyles.js +7 -9
  107. package/build/esm/components/Icon/IconStyles.js.map +1 -1
  108. package/build/esm/components/IconButton/IconButton.js +2 -3
  109. package/build/esm/components/IconButton/IconButton.js.map +1 -1
  110. package/build/esm/components/IconButton/IconButtonProps.d.ts +1 -1
  111. package/build/esm/components/Link/Link.js +4 -5
  112. package/build/esm/components/Link/Link.js.map +1 -1
  113. package/build/esm/components/Link/LinkStyles.d.ts +1 -1
  114. package/build/esm/components/Link/LinkStyles.js +8 -8
  115. package/build/esm/components/Link/LinkStyles.js.map +1 -1
  116. package/build/esm/components/NumberField/NumberField.d.ts +0 -1
  117. package/build/esm/components/NumberField/NumberField.js +14 -9
  118. package/build/esm/components/NumberField/NumberField.js.map +1 -1
  119. package/build/esm/components/NumberField/NumberFieldStyles.d.ts +1 -1
  120. package/build/esm/components/NumberField/NumberFieldStyles.js +4 -4
  121. package/build/esm/components/NumberField/NumberFieldStyles.js.map +1 -1
  122. package/build/esm/components/Paper/Paper.js +12 -16
  123. package/build/esm/components/Paper/Paper.js.map +1 -1
  124. package/build/esm/components/PaperContent/PaperContent.js +2 -2
  125. package/build/esm/components/PaperContent/PaperContent.js.map +1 -1
  126. package/build/esm/components/Radio/Radio.js +5 -5
  127. package/build/esm/components/Radio/Radio.js.map +1 -1
  128. package/build/esm/components/SplitInput/SplitInput.js +4 -6
  129. package/build/esm/components/SplitInput/SplitInput.js.map +1 -1
  130. package/build/esm/components/SplitInput/SplitInputStyles.d.ts +1 -1
  131. package/build/esm/components/SplitInput/SplitInputStyles.js +4 -4
  132. package/build/esm/components/SplitInput/SplitInputStyles.js.map +1 -1
  133. package/build/esm/components/Switch/Switch.js +6 -6
  134. package/build/esm/components/Switch/Switch.js.map +1 -1
  135. package/build/esm/components/Switch/switch.styles.js +2 -2
  136. package/build/esm/components/Switch/switch.styles.js.map +1 -1
  137. package/build/esm/components/TabPanel/TabPanel.js +2 -2
  138. package/build/esm/components/TabPanel/TabPanel.js.map +1 -1
  139. package/build/esm/components/ToggleButton/ToggleButton.js +5 -6
  140. package/build/esm/components/ToggleButton/ToggleButton.js.map +1 -1
  141. package/build/esm/components/ToggleButton/ToggleButtonStyles.js +4 -4
  142. package/build/esm/components/ToggleButton/ToggleButtonStyles.js.map +1 -1
  143. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js +6 -7
  144. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
  145. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js +2 -2
  146. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js.map +1 -1
  147. package/build/esm/components/Tooltip/Tooltip.js +3 -4
  148. package/build/esm/components/Tooltip/Tooltip.js.map +1 -1
  149. package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -1
  150. package/build/esm/components/Tooltip/TooltipStyles.js +5 -8
  151. package/build/esm/components/Tooltip/TooltipStyles.js.map +1 -1
  152. package/build/esm/components/Typography/Typography.d.ts +1 -1
  153. package/build/esm/components/Typography/Typography.js +4 -6
  154. package/build/esm/components/Typography/Typography.js.map +1 -1
  155. package/build/esm/components/Typography/TypographyProps.d.ts +3 -3
  156. package/build/esm/components/Typography/TypographyStyles.d.ts +1 -1
  157. package/build/esm/components/Typography/TypographyStyles.js +29 -47
  158. package/build/esm/components/Typography/TypographyStyles.js.map +1 -1
  159. package/build/esm/hooks/useCollapsibleText.js +7 -7
  160. package/build/esm/hooks/useCollapsibleText.js.map +1 -1
  161. package/build/esm/hooks/useTabs/useTabs.js +15 -15
  162. package/build/esm/hooks/useTabs/useTabs.js.map +1 -1
  163. package/build/esm/hooks/useTabs/useTabsResult.d.ts +3 -3
  164. package/build/esm/types/index.d.ts +2 -2
  165. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonStyles.js","sources":["../../../../src/components/Button/ButtonStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ButtonProps } from './ButtonProps'\n\nexport const useButtonStyles = makeStyles<Theme, ButtonProps>(() => ({\n root: {\n minWidth: 'unset',\n },\n label: {\n textTransform: ({ textTransform }) => textTransform,\n },\n}))\n"],"names":[],"mappings":";;IAGa,eAAe,GAAG,UAAU,CAAqB,YAAA,EAAM,QAAC;AACnE,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,EAAE,OAAO;AAClB,KAAA;AACD,IAAA,KAAK,EAAE;QACL,aAAa,EAAE,UAAC,EAAiB,EAAA;AAAf,YAAA,IAAA,aAAa,GAAA,EAAA,CAAA,aAAA;AAAO,YAAA,OAAA,aAAa;SAAA;AACpD,KAAA;CACF,EAAC,EAAA;;;;"}
1
+ {"version":3,"file":"ButtonStyles.js","sources":["../../../../src/components/Button/ButtonStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ButtonProps } from './ButtonProps'\n\nexport const useButtonStyles = makeStyles<Theme, ButtonProps>(() => ({\n root: {\n minWidth: 'unset',\n },\n label: {\n textTransform: ({ textTransform }) => textTransform,\n },\n}))\n"],"names":[],"mappings":";;MAGa,eAAe,GAAG,UAAU,CAAqB,OAAO;AACnE,IAAA,IAAI,EAAE;AACJ,QAAA,QAAQ,EAAE,OAAO;AAClB,KAAA;AACD,IAAA,KAAK,EAAE;QACL,aAAa,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,aAAa;AACpD,KAAA;AACF,CAAA,CAAC;;;;"}
@@ -1,11 +1,11 @@
1
- import { __rest, __assign } from 'tslib';
2
1
  import React, { forwardRef } from 'react';
3
2
  import { Checkbox as Checkbox$1, FormControlLabel } from '@material-ui/core';
4
3
 
5
- var Checkbox = forwardRef(function (props, ref) {
6
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
7
- var control = React.createElement(Checkbox$1, __assign({ disabled: label ? undefined : disabled }, muiProps));
8
- return label ? (React.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
4
+ const Checkbox = forwardRef((props, ref) => {
5
+ const { disabled, LabelProps, ...muiProps } = props;
6
+ const label = LabelProps?.label || props.label;
7
+ const control = React.createElement(Checkbox$1, { disabled: label ? undefined : disabled, ...muiProps });
8
+ return label ? (React.createElement(FormControlLabel, { disabled: disabled, inputRef: ref, control: control, ...LabelProps, label: label })) : (control);
9
9
  });
10
10
  Checkbox.displayName = 'Checkbox';
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { FormControlLabel, Checkbox as MuiCheckbox } from '@material-ui/core'\nimport { CheckboxProps } from './CheckboxProps'\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {\n const { label, disabled, LabelProps, ...muiProps } = props\n const control = <MuiCheckbox disabled={label ? undefined : disabled} {...muiProps} />\n return label ? (\n <FormControlLabel disabled={disabled} inputRef={ref} control={control} label={label} {...LabelProps} />\n ) : (\n control\n )\n})\n\nCheckbox.displayName = 'Checkbox'\n"],"names":["MuiCheckbox"],"mappings":";;;;IAKa,QAAQ,GAAG,UAAU,CAAkC,UAAC,KAAK,EAAE,GAAG,EAAA;IACrE,IAAA,KAAK,GAAwC,KAAK,CAAA,KAA7C,EAAE,QAAQ,GAA8B,KAAK,CAAnC,QAAA,EAAE,UAAU,GAAkB,KAAK,WAAvB,EAAK,QAAQ,UAAK,KAAK,EAApD,CAA4C,OAAA,EAAA,UAAA,EAAA,YAAA,CAAA,CAAF;AAChD,IAAA,IAAM,OAAO,GAAG,KAAA,CAAA,aAAA,CAACA,UAAW,EAAC,QAAA,CAAA,EAAA,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,EAAM,EAAA,QAAQ,EAAI;AACrF,IAAA,OAAO,KAAK,IACV,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAC,QAAA,CAAA,EAAA,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAM,EAAA,UAAU,CAAI,CAAA,KAEvG,OAAO,CACR;AACH,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\n\nimport { FormControlLabel, Checkbox as MuiCheckbox } from '@material-ui/core'\nimport { CheckboxProps } from './CheckboxProps'\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {\n const { disabled, LabelProps, ...muiProps } = props\n const label = LabelProps?.label || props.label\n const control = <MuiCheckbox disabled={label ? undefined : disabled} {...muiProps} />\n return label ? (\n <FormControlLabel disabled={disabled} inputRef={ref} control={control} {...LabelProps} label={label} />\n ) : (\n control\n )\n})\n\nCheckbox.displayName = 'Checkbox'\n"],"names":["MuiCheckbox"],"mappings":";;;AAKa,MAAA,QAAQ,GAAG,UAAU,CAAkC,CAAC,KAAK,EAAE,GAAG,KAAI;IACjF,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK;IACnD,MAAM,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK;AAC9C,IAAA,MAAM,OAAO,GAAG,KAAA,CAAA,aAAA,CAACA,UAAW,EAAC,EAAA,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,EAAM,GAAA,QAAQ,GAAI;AACrF,IAAA,OAAO,KAAK,IACV,KAAC,CAAA,aAAA,CAAA,gBAAgB,EAAC,EAAA,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAA,GAAM,UAAU,EAAE,KAAK,EAAE,KAAK,EAAI,CAAA,KAEvG,OAAO,CACR;AACH,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ChipProps } from './ChipProps';
3
3
  export declare const Chip: {
4
- <C extends React.ElementType<any> = "div">(props: ChipProps<C>): JSX.Element;
4
+ <C extends React.ElementType = "div">(props: ChipProps<C>): JSX.Element;
5
5
  displayName: string;
6
6
  };
@@ -1,21 +1,20 @@
1
- import { __rest, __assign } from 'tslib';
2
1
  import { Chip as Chip$1 } from '@material-ui/core';
3
2
  import { Warning, CheckCircle, Info, Error, XCircle } from '@popmenu/web-icons';
4
3
  import React from 'react';
5
4
  import { useChipStyles } from './ChipStyles.js';
6
5
 
7
- var IconDictionary = {
6
+ const IconDictionary = {
8
7
  error: Error,
9
8
  info: Info,
10
9
  success: CheckCircle,
11
10
  warning: Warning,
12
11
  };
13
- var Chip = function (props) {
14
- var severity = props.severity, restProps = __rest(props, ["severity"]);
15
- var classes = useChipStyles(props);
16
- var icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
17
- var deleteIcon = React.createElement(XCircle);
18
- return React.createElement(Chip$1, __assign({ classes: classes, icon: icon, deleteIcon: deleteIcon }, restProps));
12
+ const Chip = (props) => {
13
+ const { severity, ...restProps } = props;
14
+ const classes = useChipStyles(props);
15
+ const icon = severity ? React.createElement(IconDictionary[severity]) : undefined;
16
+ const deleteIcon = React.createElement(XCircle);
17
+ return React.createElement(Chip$1, { classes: classes, icon: icon, deleteIcon: deleteIcon, ...restProps });
19
18
  };
20
19
  Chip.displayName = 'Chip';
21
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Chip as MuiChip } from '@material-ui/core'\nimport { CheckCircle, Error as ErrorIcon, Info, Warning, XCircle } from '@popmenu/web-icons'\nimport React from 'react'\nimport { ChipProps, DefaultChipComponent } from './ChipProps'\nimport { useChipStyles } from './ChipStyles'\n\nconst IconDictionary = {\n error: ErrorIcon,\n info: Info,\n success: CheckCircle,\n warning: Warning,\n}\n\nexport const Chip = <C extends React.ElementType = DefaultChipComponent>(props: ChipProps<C>) => {\n const { severity, ...restProps } = props\n const classes = useChipStyles(props)\n const icon = severity ? React.createElement(IconDictionary[severity]) : undefined\n const deleteIcon = React.createElement(XCircle)\n return <MuiChip classes={classes} icon={icon} deleteIcon={deleteIcon} {...restProps} />\n}\n\nChip.displayName = 'Chip'\n"],"names":["ErrorIcon","MuiChip"],"mappings":";;;;;;AAMA,IAAM,cAAc,GAAG;AACrB,IAAA,KAAK,EAAEA,KAAS;AAChB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,OAAO,EAAE,OAAO;CACjB;AAEM,IAAM,IAAI,GAAG,UAAqD,KAAmB,EAAA;IAClF,IAAA,QAAQ,GAAmB,KAAK,CAAxB,QAAA,EAAK,SAAS,GAAA,MAAA,CAAK,KAAK,EAAlC,CAA0B,UAAA,CAAA,CAAF;AAC9B,IAAA,IAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC;AACpC,IAAA,IAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS;IACjF,IAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC;AAC/C,IAAA,OAAO,oBAACC,MAAO,EAAA,QAAA,CAAA,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAM,EAAA,SAAS,EAAI;AACzF;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Chip as MuiChip } from '@material-ui/core'\nimport { CheckCircle, Error as ErrorIcon, Info, Warning, XCircle } from '@popmenu/web-icons'\nimport React from 'react'\nimport { ChipProps, DefaultChipComponent } from './ChipProps'\nimport { useChipStyles } from './ChipStyles'\n\nconst IconDictionary = {\n error: ErrorIcon,\n info: Info,\n success: CheckCircle,\n warning: Warning,\n}\n\nexport const Chip = <C extends React.ElementType = DefaultChipComponent>(props: ChipProps<C>) => {\n const { severity, ...restProps } = props\n const classes = useChipStyles(props)\n const icon = severity ? React.createElement(IconDictionary[severity]) : undefined\n const deleteIcon = React.createElement(XCircle)\n return <MuiChip classes={classes} icon={icon} deleteIcon={deleteIcon} {...restProps} />\n}\n\nChip.displayName = 'Chip'\n"],"names":["ErrorIcon","MuiChip"],"mappings":";;;;;AAMA,MAAM,cAAc,GAAG;AACrB,IAAA,KAAK,EAAEA,KAAS;AAChB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,OAAO,EAAE,OAAO;CACjB;AAEY,MAAA,IAAI,GAAG,CAAqD,KAAmB,KAAI;IAC9F,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AACxC,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS;IACjF,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC;AAC/C,IAAA,OAAO,oBAACC,MAAO,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAM,GAAA,SAAS,GAAI;AACzF;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { ChipTypeMap, ChipProps as MuiChipProps } from '@material-ui/core';
2
2
  import React from 'react';
3
- export declare type DefaultChipComponent = ChipTypeMap['defaultComponent'];
4
- export declare type ChipProps<C extends React.ElementType = DefaultChipComponent> = MuiChipProps<C, {
3
+ export type DefaultChipComponent = ChipTypeMap['defaultComponent'];
4
+ export type ChipProps<C extends React.ElementType = DefaultChipComponent> = MuiChipProps<C, {
5
5
  component?: C;
6
6
  }> & {
7
7
  severity?: 'success' | 'info' | 'warning' | 'error';
@@ -1,9 +1,9 @@
1
1
  import { makeStyles } from '@material-ui/core';
2
2
 
3
- var getBackground = function (theme) { return function (props) {
4
- var variant = props.variant, severity = props.severity;
5
- var background = theme.palette.grey[100];
6
- var backgrounds = {
3
+ const getBackground = (theme) => (props) => {
4
+ const { variant, severity } = props;
5
+ let background = theme.palette.grey[100];
6
+ const backgrounds = {
7
7
  outlined: 'none',
8
8
  error: 'error.main',
9
9
  warning: 'warning.main',
@@ -14,17 +14,17 @@ var getBackground = function (theme) { return function (props) {
14
14
  background = backgrounds[variant];
15
15
  }
16
16
  else if (severity) {
17
- var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1];
17
+ const [color, colorVariant] = backgrounds[severity].split('.');
18
18
  // @ts-expect-error - todo.
19
19
  background = theme.palette[color][colorVariant];
20
20
  }
21
21
  return background;
22
- }; };
23
- var getColor = function (theme) { return function (props) {
24
- var variant = props.variant, severity = props.severity;
25
- var textColor;
22
+ };
23
+ const getColor = (theme) => (props) => {
24
+ const { variant, severity } = props;
25
+ let textColor;
26
26
  if (variant === 'outlined' && severity) {
27
- var textColors = {
27
+ const textColors = {
28
28
  error: theme.palette.error.main,
29
29
  info: theme.palette.info.main,
30
30
  warning: theme.palette.warning.dark,
@@ -36,7 +36,7 @@ var getColor = function (theme) { return function (props) {
36
36
  textColor = theme.palette.grey[700];
37
37
  }
38
38
  else if ((variant === 'default' || variant === undefined) && severity) {
39
- var textColors = {
39
+ const textColors = {
40
40
  error: theme.palette.common.white,
41
41
  info: theme.palette.secondary.main,
42
42
  warning: theme.palette.secondary.main,
@@ -45,12 +45,12 @@ var getColor = function (theme) { return function (props) {
45
45
  textColor = textColors[severity];
46
46
  }
47
47
  return textColor;
48
- }; };
49
- var getBorder = function (theme) { return function (props) {
50
- var variant = props.variant, severity = props.severity;
51
- var borderColor;
48
+ };
49
+ const getBorder = (theme) => (props) => {
50
+ const { variant, severity } = props;
51
+ let borderColor;
52
52
  if (variant === 'outlined' && severity) {
53
- var borderColors = {
53
+ const borderColors = {
54
54
  error: theme.palette.error.main,
55
55
  info: theme.palette.info.main,
56
56
  warning: theme.palette.warning.dark,
@@ -59,10 +59,10 @@ var getBorder = function (theme) { return function (props) {
59
59
  borderColor = borderColors[severity];
60
60
  }
61
61
  return borderColor;
62
- }; };
62
+ };
63
63
  // using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
64
64
  // any component-specific props
65
- var useChipStyles = makeStyles(function (theme) { return ({
65
+ const useChipStyles = makeStyles((theme) => ({
66
66
  root: {
67
67
  background: getBackground(theme),
68
68
  color: getColor(theme),
@@ -77,7 +77,7 @@ var useChipStyles = makeStyles(function (theme) { return ({
77
77
  deleteIcon: {
78
78
  color: theme.palette.grey[500],
79
79
  },
80
- }); });
80
+ }));
81
81
 
82
82
  export { useChipStyles };
83
83
  //# sourceMappingURL=ChipStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipStyles.js","sources":["../../../../src/components/Chip/ChipStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ChipProps } from './ChipProps'\n\nconst getBackground = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let background = theme.palette.grey[100]\n const backgrounds = {\n outlined: 'none',\n error: 'error.main',\n warning: 'warning.main',\n info: 'info.light',\n success: 'success.light',\n }\n if (variant === 'outlined') {\n background = backgrounds[variant]\n } else if (severity) {\n const [color, colorVariant] = backgrounds[severity].split('.')\n // @ts-expect-error - todo.\n background = theme.palette[color][colorVariant]\n }\n return background\n}\n\nconst getColor = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let textColor\n if (variant === 'outlined' && severity) {\n const textColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n textColor = textColors[severity]\n } else if (variant === 'outlined' && !severity) {\n textColor = theme.palette.grey[700]\n } else if ((variant === 'default' || variant === undefined) && severity) {\n const textColors = {\n error: theme.palette.common.white,\n info: theme.palette.secondary.main,\n warning: theme.palette.secondary.main,\n success: theme.palette.secondary.main,\n }\n textColor = textColors[severity]\n }\n return textColor\n}\n\nconst getBorder = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let borderColor\n if (variant === 'outlined' && severity) {\n const borderColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n borderColor = borderColors[severity]\n }\n return borderColor\n}\n\n// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on\n// any component-specific props\nexport const useChipStyles = makeStyles<Theme, ChipProps<any>>((theme) => ({\n root: {\n background: getBackground(theme),\n color: getColor(theme),\n borderColor: getBorder(theme),\n borderRadius: theme.spacing(0.5),\n },\n icon: {\n color: 'inherit',\n height: theme.spacing(2),\n width: theme.spacing(2),\n },\n deleteIcon: {\n color: theme.palette.grey[500],\n },\n}))\n"],"names":[],"mappings":";;AAGA,IAAM,aAAa,GAAG,UAAC,KAAY,EAAK,EAAA,OAAA,UAAC,KAAgB,EAAA;IAC/C,IAAA,OAAO,GAAe,KAAK,CAAA,OAApB,EAAE,QAAQ,GAAK,KAAK,CAAA,QAAV;IACzB,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AACxC,IAAA,IAAM,WAAW,GAAG;AAClB,QAAA,QAAQ,EAAE,MAAM;AAChB,QAAA,KAAK,EAAE,YAAY;AACnB,QAAA,OAAO,EAAE,cAAc;AACvB,QAAA,IAAI,EAAE,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,CAAC;AACtB,QAAA,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;AAC7B,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AACjC,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,KAAA;AACD,IAAA,UAAU,EAAE;QACV,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AAC/B,KAAA;CACF,EAAC,EAAA;;;;"}
1
+ {"version":3,"file":"ChipStyles.js","sources":["../../../../src/components/Chip/ChipStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { ChipProps } from './ChipProps'\n\nconst getBackground = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let background = theme.palette.grey[100]\n const backgrounds = {\n outlined: 'none',\n error: 'error.main',\n warning: 'warning.main',\n info: 'info.light',\n success: 'success.light',\n }\n if (variant === 'outlined') {\n background = backgrounds[variant]\n } else if (severity) {\n const [color, colorVariant] = backgrounds[severity].split('.')\n // @ts-expect-error - todo.\n background = theme.palette[color][colorVariant]\n }\n return background\n}\n\nconst getColor = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let textColor\n if (variant === 'outlined' && severity) {\n const textColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n textColor = textColors[severity]\n } else if (variant === 'outlined' && !severity) {\n textColor = theme.palette.grey[700]\n } else if ((variant === 'default' || variant === undefined) && severity) {\n const textColors = {\n error: theme.palette.common.white,\n info: theme.palette.secondary.main,\n warning: theme.palette.secondary.main,\n success: theme.palette.secondary.main,\n }\n textColor = textColors[severity]\n }\n return textColor\n}\n\nconst getBorder = (theme: Theme) => (props: ChipProps) => {\n const { variant, severity } = props\n let borderColor\n if (variant === 'outlined' && severity) {\n const borderColors = {\n error: theme.palette.error.main,\n info: theme.palette.info.main,\n warning: theme.palette.warning.dark,\n success: theme.palette.success.dark,\n }\n borderColor = borderColors[severity]\n }\n return borderColor\n}\n\n// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on\n// any component-specific props\nexport const useChipStyles = makeStyles<Theme, ChipProps<any>>((theme) => ({\n root: {\n background: getBackground(theme),\n color: getColor(theme),\n borderColor: getBorder(theme),\n borderRadius: theme.spacing(0.5),\n },\n icon: {\n color: 'inherit',\n height: theme.spacing(2),\n width: theme.spacing(2),\n },\n deleteIcon: {\n color: theme.palette.grey[500],\n },\n}))\n"],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAG,CAAC,KAAY,KAAK,CAAC,KAAgB,KAAI;AAC3D,IAAA,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK;IACnC,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AACxC,IAAA,MAAM,WAAW,GAAG;AAClB,QAAA,QAAQ,EAAE,MAAM;AAChB,QAAA,KAAK,EAAE,YAAY;AACnB,QAAA,OAAO,EAAE,cAAc;AACvB,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,OAAO,EAAE,eAAe;KACzB;AACD,IAAA,IAAI,OAAO,KAAK,UAAU,EAAE;AAC1B,QAAA,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC;;SAC5B,IAAI,QAAQ,EAAE;AACnB,QAAA,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;;QAE9D,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC;;AAEjD,IAAA,OAAO,UAAU;AACnB,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,KAAY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GAAG,KAAK;AACnC,IAAA,IAAI,WAAW;AACf,IAAA,IAAI,OAAO,KAAK,UAAU,IAAI,QAAQ,EAAE;AACtC,QAAA,MAAM,YAAY,GAAG;AACnB,YAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;AAC/B,YAAA,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AAC7B,YAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;AACnC,YAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;SACpC;AACD,QAAA,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC;;AAEtC,IAAA,OAAO,WAAW;AACpB,CAAC;AAED;AACA;AACa,MAAA,aAAa,GAAG,UAAU,CAAwB,CAAC,KAAK,MAAM;AACzE,IAAA,IAAI,EAAE;AACJ,QAAA,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC;AAChC,QAAA,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;AACtB,QAAA,WAAW,EAAE,SAAS,CAAC,KAAK,CAAC;AAC7B,QAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;AACjC,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,QAAA,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,KAAA;AACD,IAAA,UAAU,EAAE;QACV,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AAC/B,KAAA;AACF,CAAA,CAAC;;;;"}
@@ -1,36 +1,35 @@
1
- import { __rest, __assign } from 'tslib';
2
1
  import { useTheme, Box, Collapse } from '@material-ui/core';
3
2
  import React, { useState, useRef, useEffect } from 'react';
4
3
  import { Typography } from '../Typography/Typography.js';
5
4
  import { useCollapsibleTextStyles } from './CollapsibleTextStyles.js';
6
5
 
7
- var CollapsibleText = function (props) {
8
- 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 = __rest(props, ["text", "open", "previewLines", "typographyVariant", "collapseState"]);
9
- var collapseState = useState(false);
10
- var typographyRef = useRef(null);
11
- var classes = useCollapsibleTextStyles(__assign(__assign({}, props), { previewLines: previewLines, typographyVariant: typographyVariant }));
12
- var theme = useTheme();
13
- var _c = props.collapseState ? props.collapseState : collapseState, collapsible = _c[0], setCollapsible = _c[1];
14
- var typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
15
- var collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
16
- var documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
17
- var collapsedSizePx = collapsedSizeRem * documentFontSize;
18
- useEffect(function () {
19
- var typographyNode = typographyRef.current;
20
- var observer = new ResizeObserver(function (entries) {
21
- var typographyEntry = entries.find(function (entry) { return entry.target === typographyNode; });
6
+ const CollapsibleText = (props) => {
7
+ const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props;
8
+ const collapseState = useState(false);
9
+ const typographyRef = useRef(null);
10
+ const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant });
11
+ const theme = useTheme();
12
+ const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState;
13
+ const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight);
14
+ const collapsedSizeRem = previewLines * typographyEntryLineHeightRem;
15
+ const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
16
+ const collapsedSizePx = collapsedSizeRem * documentFontSize;
17
+ useEffect(() => {
18
+ const typographyNode = typographyRef.current;
19
+ const observer = new ResizeObserver((entries) => {
20
+ const typographyEntry = entries.find((entry) => entry.target === typographyNode);
22
21
  if (typographyEntry) {
23
- var typographyEntryHeight = typographyEntry.contentRect.height;
24
- var isCollapsible = typographyEntryHeight > collapsedSizePx;
22
+ const typographyEntryHeight = typographyEntry.contentRect.height;
23
+ const isCollapsible = typographyEntryHeight > collapsedSizePx;
25
24
  setCollapsible(isCollapsible);
26
25
  }
27
26
  });
28
27
  observer.observe(typographyNode);
29
- return function () {
28
+ return () => {
30
29
  observer.unobserve(typographyNode);
31
30
  };
32
31
  }, []);
33
- return (React.createElement(Box, __assign({ position: "relative", overflow: "hidden" }, restProps),
32
+ return (React.createElement(Box, { position: "relative", overflow: "hidden", ...restProps },
34
33
  React.createElement(Collapse, { in: open, collapsedSize: collapsedSizePx + 'px' },
35
34
  React.createElement(Typography, { TypographyRef: typographyRef, variant: typographyVariant }, text)),
36
35
  collapsible && !open && React.createElement(Box, { className: classes.overlay })));
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleText.js","sources":["../../../../src/components/CollapsibleText/CollapsibleText.tsx"],"sourcesContent":["import { Box, Collapse, useTheme } from '@material-ui/core'\nimport React, { FC, useEffect, useRef, useState } from 'react'\nimport { Typography } from '../Typography'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\nimport { useCollapsibleTextStyles } from './CollapsibleTextStyles'\n\nexport const CollapsibleText: FC<CollapsibleTextProps> = (props) => {\n const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props\n const collapseState = useState<boolean | undefined>(false)\n const typographyRef = useRef<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>(null)\n const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant })\n const theme = useTheme()\n const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState\n const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight as string)\n const collapsedSizeRem = previewLines * typographyEntryLineHeightRem\n const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize)\n const collapsedSizePx = collapsedSizeRem * documentFontSize\n\n useEffect(() => {\n const typographyNode = typographyRef.current as Element\n const observer = new ResizeObserver((entries) => {\n const typographyEntry = entries.find((entry) => entry.target === typographyNode)\n if (typographyEntry) {\n const typographyEntryHeight = typographyEntry.contentRect.height\n const isCollapsible = typographyEntryHeight > collapsedSizePx\n setCollapsible(isCollapsible)\n }\n })\n observer.observe(typographyNode)\n return () => {\n observer.unobserve(typographyNode)\n }\n }, [])\n\n return (\n <Box position=\"relative\" overflow=\"hidden\" {...restProps}>\n <Collapse in={open} collapsedSize={collapsedSizePx + 'px'}>\n <Typography TypographyRef={typographyRef} variant={typographyVariant}>\n {text}\n </Typography>\n </Collapse>\n {collapsible && !open && <Box className={classes.overlay} />}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;;;AAMO,IAAM,eAAe,GAA6B,UAAC,KAAK,EAAA;AACrD,IAAA,IAAA,IAAI,GAAiG,KAAK,CAAtG,IAAA,CAAA,CAAE,IAAI,GAA2F,KAAK,CAAhG,IAAA,CAAA,CAAE,KAAyF,KAAK,CAAA,YAA9E,EAAhB,YAAY,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,GAAA,EAAA,CAAA,CAAE,EAAuE,GAAA,KAAK,kBAAjD,CAA3B,CAAA,iBAAiB,mBAAG,OAAO,GAAA,EAAA,EAA4C,KAAK,CAAA,aAAxB,MAAK,SAAS,GAAA,MAAA,CAAK,KAAK,EAA5G,CAAA,MAAA,EAAA,MAAA,EAAA,cAAA,EAAA,mBAAA,EAAA,eAAA,CAAoG;AAC1G,IAAA,IAAM,aAAa,GAAG,QAAQ,CAAsB,KAAK,CAAC;AAC1D,IAAA,IAAM,aAAa,GAAG,MAAM,CAA8D,IAAI,CAAC;AAC/F,IAAA,IAAM,OAAO,GAAG,wBAAwB,CAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EAAM,KAAK,CAAA,EAAA,EAAE,YAAY,EAAA,YAAA,EAAE,iBAAiB,EAAA,iBAAA,EAAA,CAAA,CAAG;AACvF,IAAA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CAAA;QACtD,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,GAAG,IAAI,EAAA;AACvD,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAA,EACjE,IAAI,CACM,CACJ;AACV,QAAA,WAAW,IAAI,CAAC,IAAI,IAAI,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,EAAI,CAAA,CACxD;AAEV;;;;"}
1
+ {"version":3,"file":"CollapsibleText.js","sources":["../../../../src/components/CollapsibleText/CollapsibleText.tsx"],"sourcesContent":["import { Box, Collapse, useTheme } from '@material-ui/core'\nimport React, { FC, useEffect, useRef, useState } from 'react'\nimport { Typography } from '../Typography'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\nimport { useCollapsibleTextStyles } from './CollapsibleTextStyles'\n\nexport const CollapsibleText: FC<CollapsibleTextProps> = (props) => {\n const { text, open, previewLines = 2, typographyVariant = 'body1', collapseState: _exclude, ...restProps } = props\n const collapseState = useState<boolean | undefined>(false)\n const typographyRef = useRef<HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement>(null)\n const classes = useCollapsibleTextStyles({ ...props, previewLines, typographyVariant })\n const theme = useTheme()\n const [collapsible, setCollapsible] = props.collapseState ? props.collapseState : collapseState\n const typographyEntryLineHeightRem = parseFloat(theme.typography[typographyVariant].lineHeight as string)\n const collapsedSizeRem = previewLines * typographyEntryLineHeightRem\n const documentFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize)\n const collapsedSizePx = collapsedSizeRem * documentFontSize\n\n useEffect(() => {\n const typographyNode = typographyRef.current as Element\n const observer = new ResizeObserver((entries) => {\n const typographyEntry = entries.find((entry) => entry.target === typographyNode)\n if (typographyEntry) {\n const typographyEntryHeight = typographyEntry.contentRect.height\n const isCollapsible = typographyEntryHeight > collapsedSizePx\n setCollapsible(isCollapsible)\n }\n })\n observer.observe(typographyNode)\n return () => {\n observer.unobserve(typographyNode)\n }\n }, [])\n\n return (\n <Box position=\"relative\" overflow=\"hidden\" {...restProps}>\n <Collapse in={open} collapsedSize={collapsedSizePx + 'px'}>\n <Typography TypographyRef={typographyRef} variant={typographyVariant}>\n {text}\n </Typography>\n </Collapse>\n {collapsible && !open && <Box className={classes.overlay} />}\n </Box>\n )\n}\n"],"names":[],"mappings":";;;;;AAMa,MAAA,eAAe,GAA6B,CAAC,KAAK,KAAI;IACjE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,GAAG,CAAC,EAAE,iBAAiB,GAAG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAClH,IAAA,MAAM,aAAa,GAAG,QAAQ,CAAsB,KAAK,CAAC;AAC1D,IAAA,MAAM,aAAa,GAAG,MAAM,CAA8D,IAAI,CAAC;AAC/F,IAAA,MAAM,OAAO,GAAG,wBAAwB,CAAC,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;AACvF,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,GAAG,aAAa;AAC/F,IAAA,MAAM,4BAA4B,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAoB,CAAC;AACzG,IAAA,MAAM,gBAAgB,GAAG,YAAY,GAAG,4BAA4B;AACpE,IAAA,MAAM,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC;AACxF,IAAA,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB;IAE3D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,aAAa,CAAC,OAAkB;QACvD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,KAAI;AAC9C,YAAA,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC;YAChF,IAAI,eAAe,EAAE;AACnB,gBAAA,MAAM,qBAAqB,GAAG,eAAe,CAAC,WAAW,CAAC,MAAM;AAChE,gBAAA,MAAM,aAAa,GAAG,qBAAqB,GAAG,eAAe;gBAC7D,cAAc,CAAC,aAAa,CAAC;;AAEjC,SAAC,CAAC;AACF,QAAA,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC;AAChC,QAAA,OAAO,MAAK;AACV,YAAA,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC;AACpC,SAAC;KACF,EAAE,EAAE,CAAC;AAEN,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,QAAQ,EAAA,GAAK,SAAS,EAAA;QACtD,KAAC,CAAA,aAAA,CAAA,QAAQ,EAAC,EAAA,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,eAAe,GAAG,IAAI,EAAA;AACvD,YAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAA,EACjE,IAAI,CACM,CACJ;AACV,QAAA,WAAW,IAAI,CAAC,IAAI,IAAI,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,EAAI,CAAA,CACxD;AAEV;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { CollapsibleTextProps } from './CollapsibleTextProps';
2
2
  export declare const useCollapsibleTextStyles: (props: CollapsibleTextProps & {
3
- fadeStop?: string | number | undefined;
4
- typographyVariant: 'body1' | 'body2';
3
+ fadeStop?: string | number;
4
+ typographyVariant: "body1" | "body2";
5
5
  }) => import("@material-ui/styles").ClassNameMap<string>;
@@ -1,24 +1,23 @@
1
1
  import { makeStyles } from '@material-ui/core';
2
2
 
3
- var getFadeStop = function (_a, typographyVariant) {
4
- var typography = _a.typography;
3
+ const getFadeStop = ({ typography }, typographyVariant) => {
5
4
  // @ts-expect-error - todo.
6
5
  return !isNaN(Number(typography[typographyVariant].lineHeight))
7
6
  ? // @ts-expect-error - todo.
8
- typography[typographyVariant].lineHeight + "rem"
7
+ `${typography[typographyVariant].lineHeight}rem`
9
8
  : // @ts-expect-error - todo.
10
9
  typography[typographyVariant].lineHeight;
11
10
  };
12
- var useCollapsibleTextStyles = makeStyles(function (theme) { return ({
11
+ const useCollapsibleTextStyles = makeStyles((theme) => ({
13
12
  overlay: {
14
13
  position: 'absolute',
15
14
  top: 0,
16
15
  left: 0,
17
16
  height: '100%',
18
17
  width: '100%',
19
- background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
18
+ background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,
20
19
  },
21
- }); });
20
+ }));
22
21
 
23
22
  export { useCollapsibleTextStyles };
24
23
  //# sourceMappingURL=CollapsibleTextStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleTextStyles.js","sources":["../../../../src/components/CollapsibleText/CollapsibleTextStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\n\nconst getFadeStop = ({ typography }: Theme, typographyVariant: string) => {\n // @ts-expect-error - todo.\n return !isNaN(Number(typography[typographyVariant].lineHeight))\n ? // @ts-expect-error - todo.\n `${typography[typographyVariant].lineHeight}rem`\n : // @ts-expect-error - todo.\n typography[typographyVariant].lineHeight\n}\n\nexport const useCollapsibleTextStyles = makeStyles<\n Theme,\n CollapsibleTextProps & { fadeStop?: string | number; typographyVariant: 'body1' | 'body2' }\n>((theme) => ({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,\n },\n}))\n"],"names":[],"mappings":";;AAGA,IAAM,WAAW,GAAG,UAAC,EAAqB,EAAE,iBAAyB,EAAA;AAA9C,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA;;AAE/B,IAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC;AAC5D;AACK,YAAA,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,GAAK;AAClD;AACE,YAAA,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU;AAC9C,CAAC;AAEY,IAAA,wBAAwB,GAAG,UAAU,CAGhD,UAAC,KAAK,EAAK,EAAA,QAAC;AACZ,IAAA,OAAO,EAAE;AACP,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,GAAG,EAAE,CAAC;AACN,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,UAAU,EAAE,UAAC,KAAK,EAAK,EAAA,OAAA,0CAAwC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAA,GAAG,GAAA;AAC9G,KAAA;CACF,EAAC,EAAA;;;;"}
1
+ {"version":3,"file":"CollapsibleTextStyles.js","sources":["../../../../src/components/CollapsibleText/CollapsibleTextStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { CollapsibleTextProps } from './CollapsibleTextProps'\n\nconst getFadeStop = ({ typography }: Theme, typographyVariant: string) => {\n // @ts-expect-error - todo.\n return !isNaN(Number(typography[typographyVariant].lineHeight))\n ? // @ts-expect-error - todo.\n `${typography[typographyVariant].lineHeight}rem`\n : // @ts-expect-error - todo.\n typography[typographyVariant].lineHeight\n}\n\nexport const useCollapsibleTextStyles = makeStyles<\n Theme,\n CollapsibleTextProps & { fadeStop?: string | number; typographyVariant: 'body1' | 'body2' }\n>((theme) => ({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n background: (props) => `linear-gradient(to top, white, #FFF0 ${getFadeStop(theme, props.typographyVariant)})`,\n },\n}))\n"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAG,CAAC,EAAE,UAAU,EAAS,EAAE,iBAAyB,KAAI;;AAEvE,IAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC;AAC5D;AACE,YAAA,CAAA,EAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAK,GAAA;AAClD;AACE,YAAA,UAAU,CAAC,iBAAiB,CAAC,CAAC,UAAU;AAC9C,CAAC;AAEY,MAAA,wBAAwB,GAAG,UAAU,CAGhD,CAAC,KAAK,MAAM;AACZ,IAAA,OAAO,EAAE;AACP,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,GAAG,EAAE,CAAC;AACN,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,UAAU,EAAE,CAAC,KAAK,KAAK,CAAA,qCAAA,EAAwC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAG,CAAA,CAAA;AAC9G,KAAA;AACF,CAAA,CAAC;;;;"}
@@ -1,4 +1,3 @@
1
- import { __assign } from 'tslib';
2
1
  import { makeStyles, Box } from '@material-ui/core';
3
2
  import classNames from 'classnames';
4
3
  import React from 'react';
@@ -13,15 +12,14 @@ var SemanticColors;
13
12
  SemanticColors["SECONDARY_DARK"] = "secondary.dark";
14
13
  SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
15
14
  })(SemanticColors || (SemanticColors = {}));
16
- var useStyles = makeStyles(function (theme) { return ({
15
+ const useStyles = makeStyles((theme) => ({
17
16
  dividerRoot: {
18
17
  gap: theme.spacing(2),
19
18
  },
20
19
  textRoot: {
21
- color: function (_a) {
22
- var textColor = _a.textColor;
20
+ color: ({ textColor }) => {
23
21
  if (textColor && Object.values(SemanticColors).includes(textColor)) {
24
- var _b = textColor.split('.'), semanticColor = _b[0], shade = _b[1];
22
+ const [semanticColor, shade] = textColor.split('.');
25
23
  // @ts-expect-error - todo.
26
24
  return theme.palette[semanticColor][shade];
27
25
  }
@@ -32,13 +30,12 @@ var useStyles = makeStyles(function (theme) { return ({
32
30
  return 'black';
33
31
  }
34
32
  },
35
- textTransform: function (props) { return props.textTransform; },
33
+ textTransform: (props) => props.textTransform,
36
34
  },
37
35
  dividerLine: {
38
- backgroundColor: function (_a) {
39
- var dividerColor = _a.dividerColor;
36
+ backgroundColor: ({ dividerColor }) => {
40
37
  if (dividerColor && Object.values(SemanticColors).includes(dividerColor)) {
41
- var _b = dividerColor.split('.'), semanticColor = _b[0], shade = _b[1];
38
+ const [semanticColor, shade] = dividerColor.split('.');
42
39
  // @ts-expect-error - todo.
43
40
  return theme.palette[semanticColor][shade];
44
41
  }
@@ -50,15 +47,14 @@ var useStyles = makeStyles(function (theme) { return ({
50
47
  }
51
48
  },
52
49
  },
53
- }); });
54
- var Divider = function (_a) {
55
- var TypographyProps = _a.TypographyProps, className = _a.className, dividerColor = _a.dividerColor, text = _a.text, textColor = _a.textColor, _b = _a.textTransform, textTransform = _b === void 0 ? 'lowercase' : _b;
56
- var classes = useStyles({ dividerColor: dividerColor, textColor: textColor, textTransform: textTransform });
57
- var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
50
+ }));
51
+ const Divider = ({ TypographyProps, className, dividerColor, text, textColor, textTransform = 'lowercase', }) => {
52
+ const classes = useStyles({ dividerColor, textColor, textTransform });
53
+ const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
58
54
  return (React.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
59
55
  React.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
60
56
  text && (React.createElement(React.Fragment, null,
61
- React.createElement(Typography, __assign({ className: classes.textRoot }, TypographyProps), text),
57
+ React.createElement(Typography, { className: classes.textRoot, ...TypographyProps }, text),
62
58
  React.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
63
59
  };
64
60
  Divider.displayName = 'Divider';
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.js","sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import { Box, makeStyles, Theme } from '@material-ui/core'\nimport classNames from 'classnames'\nimport React, { FC } from 'react'\nimport { Typography } from '../Typography'\nimport { DividerProps } from './DividerProps'\n\nenum SemanticColors {\n PRIMARY_MAIN = 'primary.main',\n PRIMARY_DARK = 'primary.dark',\n PRIMARY_LIGHT = 'primary.light',\n SECONDARY_MAIN = 'secondary.main',\n SECONDARY_DARK = 'secondary.dark',\n SECONDARY_LIGHT = 'secondary.light',\n}\n\ntype StyleProps = Pick<DividerProps, 'dividerColor' | 'textColor' | 'textTransform'>\n\nconst useStyles = makeStyles<Theme, StyleProps>((theme) => ({\n dividerRoot: {\n gap: theme.spacing(2),\n },\n textRoot: {\n color: ({ textColor }) => {\n if (textColor && Object.values<string>(SemanticColors).includes(textColor)) {\n const [semanticColor, shade] = textColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (textColor) {\n return textColor\n } else {\n return 'black'\n }\n },\n textTransform: (props) => props.textTransform,\n },\n dividerLine: {\n backgroundColor: ({ dividerColor }) => {\n if (dividerColor && Object.values<string>(SemanticColors).includes(dividerColor)) {\n const [semanticColor, shade] = dividerColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (dividerColor) {\n return dividerColor\n } else {\n return theme.palette.grey[500]\n }\n },\n },\n}))\n\nexport const Divider: FC<DividerProps> = ({\n TypographyProps,\n className,\n dividerColor,\n text,\n textColor,\n textTransform = 'lowercase',\n}) => {\n const classes = useStyles({ dividerColor, textColor, textTransform })\n const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset'\n\n return (\n <Box className={classNames([classes.dividerRoot, className])} display=\"flex\" alignItems=\"center\">\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n {text && (\n <>\n <Typography className={classes.textRoot} {...TypographyProps}>\n {text}\n </Typography>\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n </>\n )}\n </Box>\n )\n}\n\nDivider.displayName = 'Divider'\n"],"names":[],"mappings":";;;;;;AAMA,IAAK,cAOJ;AAPD,CAAA,UAAK,cAAc,EAAA;AACjB,IAAA,cAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,cAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC7B,IAAA,cAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAPI,cAAc,KAAd,cAAc,GAOlB,EAAA,CAAA,CAAA;AAID,IAAM,SAAS,GAAG,UAAU,CAAoB,UAAC,KAAK,EAAA,EAAK,QAAC;AAC1D,IAAA,WAAW,EAAE;AACX,QAAA,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACtB,KAAA;AACD,IAAA,QAAQ,EAAE;QACR,KAAK,EAAE,UAAC,EAAa,EAAA;AAAX,YAAA,IAAA,SAAS,GAAA,EAAA,CAAA,SAAA;AACjB,YAAA,IAAI,SAAS,IAAI,MAAM,CAAC,MAAM,CAAS,cAAc,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AACpE,gBAAA,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A,EAAA;AAE3B,IAAA,IAAM,OAAO,GAAG,SAAS,CAAC,EAAE,YAAY,EAAA,YAAA,EAAE,SAAS,WAAA,EAAE,aAAa,EAAA,aAAA,EAAE,CAAC;AACrE,IAAA,IAAM,YAAY,GAAG,aAAa,KAAK,WAAW,GAAG,QAAQ,GAAG,OAAO;IAEvE,QACE,oBAAC,GAAG,EAAA,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,EAAE,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAA;QAC9F,KAAC,CAAA,aAAA,CAAA,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAC,KAAK,EAAC,SAAS,EAAE,YAAY,EAAI,CAAA;AACxG,QAAA,IAAI,KACH,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;YACE,KAAC,CAAA,aAAA,CAAA,UAAU,EAAC,QAAA,CAAA,EAAA,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAM,EAAA,eAAe,CACzD,EAAA,IAAI,CACM;AACb,YAAA,KAAA,CAAA,aAAA,CAAC,GAAG,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAC,KAAK,EAAC,SAAS,EAAE,YAAY,EAAA,CAAI,CACxG,CACJ,CACG;AAEV;AAEA,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
1
+ {"version":3,"file":"Divider.js","sources":["../../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import { Box, makeStyles, Theme } from '@material-ui/core'\nimport classNames from 'classnames'\nimport React, { FC } from 'react'\nimport { Typography } from '../Typography'\nimport { DividerProps } from './DividerProps'\n\nenum SemanticColors {\n PRIMARY_MAIN = 'primary.main',\n PRIMARY_DARK = 'primary.dark',\n PRIMARY_LIGHT = 'primary.light',\n SECONDARY_MAIN = 'secondary.main',\n SECONDARY_DARK = 'secondary.dark',\n SECONDARY_LIGHT = 'secondary.light',\n}\n\ntype StyleProps = Pick<DividerProps, 'dividerColor' | 'textColor' | 'textTransform'>\n\nconst useStyles = makeStyles<Theme, StyleProps>((theme) => ({\n dividerRoot: {\n gap: theme.spacing(2),\n },\n textRoot: {\n color: ({ textColor }) => {\n if (textColor && Object.values<string>(SemanticColors).includes(textColor)) {\n const [semanticColor, shade] = textColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (textColor) {\n return textColor\n } else {\n return 'black'\n }\n },\n textTransform: (props) => props.textTransform,\n },\n dividerLine: {\n backgroundColor: ({ dividerColor }) => {\n if (dividerColor && Object.values<string>(SemanticColors).includes(dividerColor)) {\n const [semanticColor, shade] = dividerColor.split('.')\n // @ts-expect-error - todo.\n return theme.palette[semanticColor][shade]\n } else if (dividerColor) {\n return dividerColor\n } else {\n return theme.palette.grey[500]\n }\n },\n },\n}))\n\nexport const Divider: FC<DividerProps> = ({\n TypographyProps,\n className,\n dividerColor,\n text,\n textColor,\n textTransform = 'lowercase',\n}) => {\n const classes = useStyles({ dividerColor, textColor, textTransform })\n const casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset'\n\n return (\n <Box className={classNames([classes.dividerRoot, className])} display=\"flex\" alignItems=\"center\">\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n {text && (\n <>\n <Typography className={classes.textRoot} {...TypographyProps}>\n {text}\n </Typography>\n <Box className={classes.dividerLine} display=\"flex\" flexGrow={1} height=\"1px\" marginTop={casingOffset} />\n </>\n )}\n </Box>\n )\n}\n\nDivider.displayName = 'Divider'\n"],"names":[],"mappings":";;;;;AAMA,IAAK,cAOJ;AAPD,CAAA,UAAK,cAAc,EAAA;AACjB,IAAA,cAAA,CAAA,cAAA,CAAA,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K,EAAC,SAAS,EAAE,YAAY,EAAA,CAAI,CACxG,CACJ,CACG;AAEV;AAEA,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { TypographyProps } from '../Typography';
2
- declare type Colors = 'primary.main' | 'primary.dark' | 'primary.light' | 'secondary.main' | 'secondary.dark' | 'secondary.light';
2
+ type Colors = 'primary.main' | 'primary.dark' | 'primary.light' | 'secondary.main' | 'secondary.dark' | 'secondary.light';
3
3
  export interface DividerProps {
4
4
  /** Sets the styles for a divider. */
5
5
  className?: string;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const FollowerAuthenticationAltActions: () => JSX.Element | null;
@@ -2,25 +2,25 @@ import React from 'react';
2
2
  import { useFollowerAuthenticationDialogContext } from './context.js';
3
3
  import { makeStyles, Button, Box, Divider } from '@material-ui/core';
4
4
 
5
- var useStyles = makeStyles(function () { return ({
5
+ const useStyles = makeStyles(() => ({
6
6
  main: {
7
7
  width: '100%',
8
8
  display: 'flex',
9
9
  flexDirection: 'column',
10
10
  gridGap: 16,
11
11
  },
12
- }); });
13
- var FollowerAuthenticationAltActions = function () {
14
- var _a = useFollowerAuthenticationDialogContext(), state = _a.state, messages = _a.messages, logos = _a.logos, loading = _a.loading, onActionButtonClick = _a.onActionButtonClick;
15
- var classes = useStyles();
12
+ }));
13
+ const FollowerAuthenticationAltActions = () => {
14
+ const { state, messages, logos, loading, onActionButtonClick } = useFollowerAuthenticationDialogContext();
15
+ const classes = useStyles();
16
16
  switch (state.value) {
17
17
  case 'initial':
18
18
  return (React.createElement(Box, { className: classes.main },
19
19
  React.createElement(Divider, null),
20
- React.createElement(Button, { variant: "outlined", startIcon: logos.facebook, onClick: function () {
20
+ React.createElement(Button, { variant: "outlined", startIcon: logos.facebook, onClick: () => {
21
21
  onActionButtonClick('sign-in-with-facebook');
22
22
  } }, messages.continueWithFacebookButtonLabel),
23
- React.createElement(Button, { variant: "outlined", startIcon: logos.google, onClick: function () {
23
+ React.createElement(Button, { variant: "outlined", startIcon: logos.google, onClick: () => {
24
24
  onActionButtonClick('sign-in-with-google');
25
25
  } }, messages.continueWithGoogleButtonLabel)));
26
26
  case 'signUp':
@@ -28,53 +28,53 @@ var FollowerAuthenticationAltActions = function () {
28
28
  case 'emailFound':
29
29
  return (React.createElement(Box, { className: classes.main },
30
30
  React.createElement(Divider, null),
31
- React.createElement(Button, { variant: "outlined", onClick: function () {
31
+ React.createElement(Button, { variant: "outlined", onClick: () => {
32
32
  onActionButtonClick('sign-in-with-password');
33
33
  } }, messages.signInWithPassword)));
34
34
  case 'emailAuthCode':
35
35
  return (React.createElement(Box, { className: classes.main },
36
- React.createElement(Button, { disabled: loading, variant: "outlined", onClick: function () {
37
- var form = document.querySelector('#follower-authentication-form');
38
- var formData = new FormData(form);
39
- var values = Object.fromEntries(formData.entries());
36
+ React.createElement(Button, { disabled: loading, variant: "outlined", onClick: () => {
37
+ const form = document.querySelector('#follower-authentication-form');
38
+ const formData = new FormData(form);
39
+ const values = Object.fromEntries(formData.entries());
40
40
  onActionButtonClick('request-auth-code-email', values);
41
41
  } }, messages.resendAuthCode)));
42
42
  case 'indirectUserFound':
43
43
  return (React.createElement(Box, { className: classes.main },
44
44
  React.createElement(Divider, null),
45
- React.createElement(Button, { variant: "outlined", onClick: function () {
45
+ React.createElement(Button, { variant: "outlined", onClick: () => {
46
46
  onActionButtonClick('use-different-account');
47
47
  } }, messages.indirectUserFoundCtaButtonLabelAlt)));
48
48
  case 'emailPasswordSignIn':
49
49
  return (React.createElement(Box, { className: classes.main },
50
50
  React.createElement(Divider, null),
51
- React.createElement(Button, { variant: "outlined", onClick: function () {
52
- var form = document.querySelector('#follower-authentication-form');
53
- var formData = new FormData(form);
54
- var values = Object.fromEntries(formData.entries());
51
+ React.createElement(Button, { variant: "outlined", onClick: () => {
52
+ const form = document.querySelector('#follower-authentication-form');
53
+ const formData = new FormData(form);
54
+ const values = Object.fromEntries(formData.entries());
55
55
  onActionButtonClick('request-auth-code-email', values);
56
56
  } }, messages.emailFoundCtaButtonLabel)));
57
57
  case 'phoneFound':
58
58
  return null;
59
59
  case 'phoneAuthCode':
60
60
  return (React.createElement(Box, { className: classes.main },
61
- React.createElement(Button, { disabled: loading, variant: "outlined", onClick: function () {
62
- var form = document.querySelector('#follower-authentication-form');
63
- var formData = new FormData(form);
64
- var values = Object.fromEntries(formData.entries());
61
+ React.createElement(Button, { disabled: loading, variant: "outlined", onClick: () => {
62
+ const form = document.querySelector('#follower-authentication-form');
63
+ const formData = new FormData(form);
64
+ const values = Object.fromEntries(formData.entries());
65
65
  onActionButtonClick('request-auth-code-sms', values);
66
66
  } }, messages.resendAuthCode)));
67
67
  case 'phonePasswordSignIn':
68
68
  return (React.createElement(Box, { className: classes.main },
69
69
  React.createElement(Divider, null),
70
- React.createElement(Button, { variant: "outlined", onClick: function () {
71
- var form = document.querySelector('#follower-authentication-form');
72
- var formData = new FormData(form);
73
- var values = Object.fromEntries(formData.entries());
70
+ React.createElement(Button, { variant: "outlined", onClick: () => {
71
+ const form = document.querySelector('#follower-authentication-form');
72
+ const formData = new FormData(form);
73
+ const values = Object.fromEntries(formData.entries());
74
74
  onActionButtonClick('request-auth-code-sms', values);
75
75
  } }, messages.phoneFoundCtaButtonLabel)));
76
76
  case 'welcome':
77
- return (React.createElement(Button, { onClick: function () {
77
+ return (React.createElement(Button, { onClick: () => {
78
78
  onActionButtonClick('close');
79
79
  } }, messages.done));
80
80
  default: