forked from jupyterlab/jupyterlab
/
deprecated.tsx
52 lines (45 loc) · 1.28 KB
/
deprecated.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/* This file is a workaround for 1.0.x versions of Jlab pulling in 1.1.x
versions of statusbar.
TODO: delete this file in Jlab 2.0
*/
import * as React from 'react';
import { classes, style } from 'typestyle/lib';
import { NestedCSSProperties } from 'typestyle/lib/types';
const icon = (): NestedCSSProperties => {
return {
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
backgroundSize: '18px',
minHeight: '24px',
width: '20px'
};
};
/**
* (DEPRECATED) A namespace for IconItem statics.
*/
export namespace IconItem {
/**
* Props for an IconItem
*/
export interface IProps {
/**
* A CSS class name for the icon.
*/
source: string;
}
}
/**
* (DEPRECATED) A functional tsx component for an icon.
*/
export function IconItem(
props: IconItem.IProps & React.HTMLAttributes<HTMLDivElement>
): React.ReactElement<IconItem.IProps> {
const { source, className, ...rest } = props;
return (
<div className={classes(className, source, style(icon()))} {...rest} />
);
}