ish-ui 1.0.28 → 1.0.30

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.
@@ -1,3 +1,10 @@
1
1
  import * as React from 'react';
2
- declare const _default: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"preview" | "previewNormal" | "previewHoverIcon" | "previewHoverImage">>;
3
- export default _default;
2
+ interface Props {
3
+ type?: string;
4
+ className?: string;
5
+ thumbnail?: string;
6
+ hovered?: boolean;
7
+ isHeader?: boolean;
8
+ }
9
+ declare const DocumentIconsChooser: ({ type, thumbnail, className, hovered, isHeader }: Props) => React.JSX.Element;
10
+ export default DocumentIconsChooser;
@@ -6,11 +6,10 @@
6
6
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
7
  */
8
8
  import * as React from 'react';
9
- import createStyles from '@mui/styles/createStyles';
10
- import withStyles from '@mui/styles/withStyles';
11
9
  import clsx from 'clsx';
12
10
  import { FileTypeIcon } from './utils';
13
- const styles = theme => createStyles({
11
+ import { makeAppStyles } from '../styles';
12
+ const useStyles = makeAppStyles(theme => ({
14
13
  preview: {
15
14
  backgroundSize: 'cover',
16
15
  width: '36px',
@@ -35,17 +34,17 @@ const styles = theme => createStyles({
35
34
  boxShadow: `0 0 1px 1px ${theme.palette.primary.main}`
36
35
  }
37
36
  }
38
- });
39
- const DocumentIconsChooser = props => {
40
- const { type, thumbnail, classes, hovered = true, isHeader } = props;
37
+ }));
38
+ const DocumentIconsChooser = ({ type, thumbnail, className, hovered = true, isHeader }) => {
39
+ const classes = useStyles();
41
40
  return thumbnail ? (React.createElement("div", { style: {
42
41
  backgroundImage: `url(data:image;base64,${thumbnail})`
43
42
  }, className: clsx(classes.preview, {
44
43
  [classes.previewHoverImage]: hovered,
45
44
  [classes.previewNormal]: isHeader
46
- }) })) : (React.createElement("div", { className: clsx(classes.preview, {
45
+ }, className) })) : (React.createElement("div", { className: clsx(classes.preview, {
47
46
  [classes.previewHoverIcon]: hovered
48
- }) },
47
+ }, className) },
49
48
  React.createElement(FileTypeIcon, { mimeType: type })));
50
49
  };
51
- export default withStyles(styles)(DocumentIconsChooser);
50
+ export default DocumentIconsChooser;
@@ -6,7 +6,10 @@
6
6
  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7
7
  */
8
8
  import React from 'react';
9
+ import { library } from '@fortawesome/fontawesome-svg-core';
10
+ import { faFile, faFileAlt, faFileArchive, faFileExcel, faFileImage, faFilePdf, faFilePowerpoint, faFileWord } from '@fortawesome/free-solid-svg-icons';
9
11
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
12
+ library.add(faFileImage, faFilePdf, faFileExcel, faFileWord, faFilePowerpoint, faFileArchive, faFileAlt, faFile);
10
13
  export const formatDocumentSize = (size) => {
11
14
  if (size < Math.pow(1024, 2)) {
12
15
  return `${Math.round(size / 1024)} kb`;
@@ -302,7 +302,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
302
302
  disableUnderline, classes: {
303
303
  underline: fieldClasses.underline,
304
304
  input: clsx(disabled && classes.readonly, fieldClasses.text),
305
- }, inputProps: Object.assign(Object.assign({}, inputProps), { className: clsx(fieldClasses.text, 'mr-auto'), ref: ref => {
305
+ }, inputProps: Object.assign(Object.assign({}, inputProps), { className: clsx(fieldClasses.text, 'mr-auto', inputProps.className), ref: ref => {
306
306
  inputProps.ref.current = ref;
307
307
  inputNode.current = ref;
308
308
  if (inputRef)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ish-ui",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "UI elements for onCourse and other ish apps",
5
5
  "main": "main.ts",
6
6
  "devDependencies": {