Browse Source

refactored all refs JLIcon => LabIcon; still need to move jlicon.tsx

telamonian 5 years ago
parent
commit
43c0959a4f

+ 10 - 10
buildutils/src/ensure-package.ts

@@ -21,13 +21,13 @@ const HEADER_TEMPLATE = `
 `;
 
 const ICON_IMPORTS_TEMPLATE = `
-import { JLIcon } from './jlicon';
+import { LabIcon } from './labicon';
 
 // icon svg import statements
 {{svgImportStatements}}
 
-// JLIcon instance construction
-{{jliconConstructions}}
+// LabIcon instance construction
+{{labiconConstructions}}
 `;
 
 const ICON_CSS_CLASSES_TEMPLATE = `
@@ -365,7 +365,7 @@ export async function ensureUiComponents(
 
   // build the per-icon import code
   let _svgImportStatements: string[] = [];
-  let _jliconConstructions: string[] = [];
+  let _labiconConstructions: string[] = [];
   svgPaths.forEach(svgPath => {
     const svgName = utils.stem(svgPath);
     const svgImportPath = path
@@ -379,26 +379,26 @@ export async function ensureUiComponents(
 
     if (dorequire) {
       // load the icon svg using `require`
-      _jliconConstructions.push(
-        `export const ${iconRef} = new JLIcon({ name: '${iconName}', svgstr: require('${svgImportPath}').default });`
+      _labiconConstructions.push(
+        `export const ${iconRef} = new LabIcon({ name: '${iconName}', svgstr: require('${svgImportPath}').default });`
       );
     } else {
       // load the icon svg using `import`
       _svgImportStatements.push(`import ${svgstrRef} from '${svgImportPath}';`);
 
-      _jliconConstructions.push(
-        `export const ${iconRef} = new JLIcon({ name: '${iconName}', svgstr: ${svgstrRef} });`
+      _labiconConstructions.push(
+        `export const ${iconRef} = new LabIcon({ name: '${iconName}', svgstr: ${svgstrRef} });`
       );
     }
   });
   const svgImportStatements = _svgImportStatements.join('\n');
-  const jliconConstructions = _jliconConstructions.join('\n');
+  const labiconConstructions = _labiconConstructions.join('\n');
 
   // generate the actual contents of the iconImports file
   const iconImportsPath = path.join(iconSrcDir, 'iconimports.ts');
   const iconImportsContents = utils.fromTemplate(
     HEADER_TEMPLATE + ICON_IMPORTS_TEMPLATE,
-    { funcName, svgImportStatements, jliconConstructions }
+    { funcName, svgImportStatements, labiconConstructions }
   );
   messages.push(...ensureFile(iconImportsPath, iconImportsContents, false));
 

+ 3 - 3
packages/application/src/mimerenderers.ts

@@ -13,7 +13,7 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
 
 import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
 
-import { JLIcon } from '@jupyterlab/ui-components';
+import { LabIcon } from '@jupyterlab/ui-components';
 
 import { Token } from '@lumino/coreutils';
 
@@ -126,8 +126,8 @@ export function createRendermimePlugin(
       if (item.fileTypes) {
         item.fileTypes.forEach(ft => {
           if (ft.icon) {
-            // upconvert the contents of the icon field to a proper JLIcon
-            ft = { ...ft, icon: JLIcon.resolve(ft.icon) };
+            // upconvert the contents of the icon field to a proper LabIcon
+            ft = { ...ft, icon: LabIcon.resolve(ft.icon) };
           }
 
           app.docRegistry.addFileType(ft as DocumentRegistry.IFileType);

+ 3 - 3
packages/apputils/src/toolbar.tsx

@@ -7,7 +7,7 @@ import {
   circleEmptyIcon,
   circleIcon,
   classes,
-  JLIcon,
+  LabIcon,
   refreshIcon,
   stopIcon
 } from '@jupyterlab/ui-components';
@@ -450,7 +450,7 @@ export namespace ToolbarButtonComponent {
     label?: string;
     iconClass?: string;
     iconLabel?: string;
-    icon?: JLIcon;
+    icon?: LabIcon;
     tooltip?: string;
     onClick?: () => void;
     enabled?: boolean;
@@ -494,7 +494,7 @@ export function ToolbarButtonComponent(props: ToolbarButtonComponent.IProps) {
       );
     } else if (props.iconClass) {
       return (
-        <JLIcon.getReact
+        <LabIcon.getReact
           name={classes(props.iconClass, 'jp-Icon', 'jp-Icon-16')}
           className="jp-ToolbarButtonComponent-icon"
           tag="span"

+ 2 - 2
packages/docregistry/src/registry.ts

@@ -38,7 +38,7 @@ import {
   fileIcon,
   folderIcon,
   imageIcon,
-  JLIcon,
+  LabIcon,
   jsonIcon,
   markdownIcon,
   notebookIcon,
@@ -1180,7 +1180,7 @@ export namespace DocumentRegistry {
      * of an existing icon, or an object with {name, svgstr} fields, where
      * svgstr is a string containing the raw contents of an svg file.
      */
-    readonly icon?: JLIcon;
+    readonly icon?: LabIcon;
 
     /**
      * The icon class name for the file type.

+ 2 - 2
packages/filebrowser/src/listing.ts

@@ -27,7 +27,7 @@ import {
   fileIcon,
   iconStyle,
   IIconStyle,
-  JLIcon
+  LabIcon
 } from '@jupyterlab/ui-components';
 
 import {
@@ -2128,7 +2128,7 @@ namespace Private {
         ...propsStyle
       });
     } else {
-      JLIcon.remove(container);
+      LabIcon.remove(container);
       container.className = HEADER_ITEM_ICON_CLASS;
     }
   }

+ 3 - 3
packages/launcher/src/index.tsx

@@ -7,7 +7,7 @@ import {
   VDomRenderer
 } from '@jupyterlab/apputils';
 
-import { JLIcon } from '@jupyterlab/ui-components';
+import { LabIcon } from '@jupyterlab/ui-components';
 
 import {
   ArrayExt,
@@ -199,7 +199,7 @@ export class Launcher extends VDomRenderer<LauncherModel> {
         section = (
           <div className="jp-Launcher-section" key={cat}>
             <div className="jp-Launcher-sectionHeader">
-              <JLIcon.getReact
+              <LabIcon.getReact
                 name={iconClass}
                 justify="center"
                 kind="launcherSection"
@@ -420,7 +420,7 @@ function Card(
             </div>
           )
         ) : (
-          <JLIcon.getReact
+          <LabIcon.getReact
             name={commands.iconClass(command, args)}
             justify="center"
             kind="launcherCard"

+ 1 - 1
packages/rendermime-interfaces/src/index.ts

@@ -145,7 +145,7 @@ export namespace IRenderMime {
     }
 
     /**
-     * A type that can be resolved to a JLIcon instance.
+     * A type that can be resolved to a LabIcon instance.
      */
     export type IResolvable = string | (IIcon & Partial<IRenderer>);
   }

+ 3 - 3
packages/running/src/index.tsx

@@ -13,7 +13,7 @@ import {
   ToolbarButtonComponent,
   UseSignal
 } from '@jupyterlab/apputils';
-import { closeIcon, JLIcon, refreshIcon } from '@jupyterlab/ui-components';
+import { closeIcon, LabIcon, refreshIcon } from '@jupyterlab/ui-components';
 
 /**
  * The class name added to a running widget.
@@ -268,8 +268,8 @@ export namespace IRunningSessions {
     open: () => void;
     // called when the shutdown button is pressed on a particular item
     shutdown: () => void;
-    // JLIcon to use as the icon
-    icon: () => JLIcon;
+    // LabIcon to use as the icon
+    icon: () => LabIcon;
     // called to determine the label for each item
     label: () => string;
     // called to determine the `title` attribute for each item, which is revealed on hover

+ 2 - 2
packages/settingeditor/src/pluginlist.tsx

@@ -5,7 +5,7 @@
 
 import { ISettingRegistry } from '@jupyterlab/settingregistry';
 
-import { JLIcon, settingsIcon } from '@jupyterlab/ui-components';
+import { LabIcon, settingsIcon } from '@jupyterlab/ui-components';
 
 import { Message } from '@lumino/messaging';
 
@@ -269,7 +269,7 @@ namespace Private {
           key={id}
           title={itemTitle}
         >
-          <JLIcon.getReact
+          <LabIcon.getReact
             name={iconClass}
             fallback={settingsIcon}
             title={iconTitle}

+ 5 - 5
packages/ui-components-extension/src/index.ts

@@ -6,19 +6,19 @@ import {
   JupyterFrontEndPlugin
 } from '@jupyterlab/application';
 
-import { IJLIconManager } from '@jupyterlab/ui-components';
+import { ILabIconManager } from '@jupyterlab/ui-components';
 
 /**
  * Placeholder for future extension that will provide an icon manager class
  * to assist with overriding/replacing particular sets of icons
  */
-const jliconManager: JupyterFrontEndPlugin<IJLIconManager> = {
-  id: '@jupyterlab/ui-components-extension:jlicon-manager',
-  provides: IJLIconManager,
+const labiconManager: JupyterFrontEndPlugin<ILabIconManager> = {
+  id: '@jupyterlab/ui-components-extension:labicon-manager',
+  provides: ILabIconManager,
   autoStart: true,
   activate: (app: JupyterFrontEnd) => {
     return Object.create(null);
   }
 };
 
-export default jliconManager;
+export default labiconManager;

+ 3 - 3
packages/ui-components/src/components/htmlselect.tsx

@@ -3,7 +3,7 @@
 
 import * as React from 'react';
 
-import { caretDownEmptyIcon, JLIcon } from '../icon';
+import { caretDownEmptyIcon, LabIcon } from '../icon';
 import { DEFAULT_STYLE_CLASS, IElementRefProps } from './interface';
 import { classes } from '../utils';
 
@@ -36,9 +36,9 @@ export interface IHTMLSelectProps
     React.SelectHTMLAttributes<HTMLSelectElement> {
   defaultStyle?: boolean;
 
-  iconProps?: JLIcon.IProps;
+  iconProps?: LabIcon.IProps;
 
-  icon?: JLIcon;
+  icon?: LabIcon;
 
   options?: Array<string | number | IOptionProps>;
 }

+ 66 - 66
packages/ui-components/src/icon/iconimports.ts

@@ -5,7 +5,7 @@
 
 /* This file was auto-generated by ensureUiComponents() in @jupyterlab/buildutils */
 
-import { JLIcon } from './jlicon';
+import { LabIcon } from './labicon';
 
 // icon svg import statements
 import caretDownEmptyThinSvgstr from '../../style/icons/arrow/caret-down-empty-thin.svg';
@@ -73,68 +73,68 @@ import searchSvgstr from '../../style/icons/toolbar/search.svg';
 import stopSvgstr from '../../style/icons/toolbar/stop.svg';
 import undoSvgstr from '../../style/icons/toolbar/undo.svg';
 
-// JLIcon instance construction
-export const caretDownEmptyThinIcon = new JLIcon({ name: 'ui-components:caret-down-empty-thin', svgstr: caretDownEmptyThinSvgstr });
-export const caretDownEmptyIcon = new JLIcon({ name: 'ui-components:caret-down-empty', svgstr: caretDownEmptySvgstr });
-export const caretDownIcon = new JLIcon({ name: 'ui-components:caret-down', svgstr: caretDownSvgstr });
-export const caretLeftIcon = new JLIcon({ name: 'ui-components:caret-left', svgstr: caretLeftSvgstr });
-export const caretRightIcon = new JLIcon({ name: 'ui-components:caret-right', svgstr: caretRightSvgstr });
-export const caretUpEmptyThinIcon = new JLIcon({ name: 'ui-components:caret-up-empty-thin', svgstr: caretUpEmptyThinSvgstr });
-export const caretUpIcon = new JLIcon({ name: 'ui-components:caret-up', svgstr: caretUpSvgstr });
-export const consoleIcon = new JLIcon({ name: 'ui-components:console', svgstr: consoleSvgstr });
-export const fileIcon = new JLIcon({ name: 'ui-components:file', svgstr: fileSvgstr });
-export const folderIcon = new JLIcon({ name: 'ui-components:folder', svgstr: folderSvgstr });
-export const html5Icon = new JLIcon({ name: 'ui-components:html5', svgstr: html5Svgstr });
-export const imageIcon = new JLIcon({ name: 'ui-components:image', svgstr: imageSvgstr });
-export const inspectorIcon = new JLIcon({ name: 'ui-components:inspector', svgstr: inspectorSvgstr });
-export const jsonIcon = new JLIcon({ name: 'ui-components:json', svgstr: jsonSvgstr });
-export const keyboardIcon = new JLIcon({ name: 'ui-components:keyboard', svgstr: keyboardSvgstr });
-export const launcherIcon = new JLIcon({ name: 'ui-components:launcher', svgstr: launcherSvgstr });
-export const markdownIcon = new JLIcon({ name: 'ui-components:markdown', svgstr: markdownSvgstr });
-export const notebookIcon = new JLIcon({ name: 'ui-components:notebook', svgstr: notebookSvgstr });
-export const pythonIcon = new JLIcon({ name: 'ui-components:python', svgstr: pythonSvgstr });
-export const rKernelIcon = new JLIcon({ name: 'ui-components:r-kernel', svgstr: rKernelSvgstr });
-export const reactIcon = new JLIcon({ name: 'ui-components:react', svgstr: reactSvgstr });
-export const settingsIcon = new JLIcon({ name: 'ui-components:settings', svgstr: settingsSvgstr });
-export const spreadsheetIcon = new JLIcon({ name: 'ui-components:spreadsheet', svgstr: spreadsheetSvgstr });
-export const textEditorIcon = new JLIcon({ name: 'ui-components:text-editor', svgstr: textEditorSvgstr });
-export const vegaIcon = new JLIcon({ name: 'ui-components:vega', svgstr: vegaSvgstr });
-export const yamlIcon = new JLIcon({ name: 'ui-components:yaml', svgstr: yamlSvgstr });
-export const jupyterFaviconIcon = new JLIcon({ name: 'ui-components:jupyter-favicon', svgstr: jupyterFaviconSvgstr });
-export const jupyterIcon = new JLIcon({ name: 'ui-components:jupyter', svgstr: jupyterSvgstr });
-export const jupyterlabWordmarkIcon = new JLIcon({ name: 'ui-components:jupyterlab-wordmark', svgstr: jupyterlabWordmarkSvgstr });
-export const caseSensitiveIcon = new JLIcon({ name: 'ui-components:case-sensitive', svgstr: caseSensitiveSvgstr });
-export const regexIcon = new JLIcon({ name: 'ui-components:regex', svgstr: regexSvgstr });
-export const buildIcon = new JLIcon({ name: 'ui-components:build', svgstr: buildSvgstr });
-export const extensionIcon = new JLIcon({ name: 'ui-components:extension', svgstr: extensionSvgstr });
-export const paletteIcon = new JLIcon({ name: 'ui-components:palette', svgstr: paletteSvgstr });
-export const runningIcon = new JLIcon({ name: 'ui-components:running', svgstr: runningSvgstr });
-export const tabIcon = new JLIcon({ name: 'ui-components:tab', svgstr: tabSvgstr });
-export const kernelIcon = new JLIcon({ name: 'ui-components:kernel', svgstr: kernelSvgstr });
-export const lineFormIcon = new JLIcon({ name: 'ui-components:line-form', svgstr: lineFormSvgstr });
-export const listIcon = new JLIcon({ name: 'ui-components:list', svgstr: listSvgstr });
-export const notTrustedIcon = new JLIcon({ name: 'ui-components:not-trusted', svgstr: notTrustedSvgstr });
-export const terminalIcon = new JLIcon({ name: 'ui-components:terminal', svgstr: terminalSvgstr });
-export const trustedIcon = new JLIcon({ name: 'ui-components:trusted', svgstr: trustedSvgstr });
-export const addIcon = new JLIcon({ name: 'ui-components:add', svgstr: addSvgstr });
-export const bugIcon = new JLIcon({ name: 'ui-components:bug', svgstr: bugSvgstr });
-export const checkIcon = new JLIcon({ name: 'ui-components:check', svgstr: checkSvgstr });
-export const circleEmptyIcon = new JLIcon({ name: 'ui-components:circle-empty', svgstr: circleEmptySvgstr });
-export const circleIcon = new JLIcon({ name: 'ui-components:circle', svgstr: circleSvgstr });
-export const closeIcon = new JLIcon({ name: 'ui-components:close', svgstr: closeSvgstr });
-export const copyIcon = new JLIcon({ name: 'ui-components:copy', svgstr: copySvgstr });
-export const cutIcon = new JLIcon({ name: 'ui-components:cut', svgstr: cutSvgstr });
-export const downloadIcon = new JLIcon({ name: 'ui-components:download', svgstr: downloadSvgstr });
-export const editIcon = new JLIcon({ name: 'ui-components:edit', svgstr: editSvgstr });
-export const ellipsesIcon = new JLIcon({ name: 'ui-components:ellipses', svgstr: ellipsesSvgstr });
-export const fileUploadIcon = new JLIcon({ name: 'ui-components:file-upload', svgstr: fileUploadSvgstr });
-export const filterListIcon = new JLIcon({ name: 'ui-components:filter-list', svgstr: filterListSvgstr });
-export const linkIcon = new JLIcon({ name: 'ui-components:link', svgstr: linkSvgstr });
-export const newFolderIcon = new JLIcon({ name: 'ui-components:new-folder', svgstr: newFolderSvgstr });
-export const pasteIcon = new JLIcon({ name: 'ui-components:paste', svgstr: pasteSvgstr });
-export const refreshIcon = new JLIcon({ name: 'ui-components:refresh', svgstr: refreshSvgstr });
-export const runIcon = new JLIcon({ name: 'ui-components:run', svgstr: runSvgstr });
-export const saveIcon = new JLIcon({ name: 'ui-components:save', svgstr: saveSvgstr });
-export const searchIcon = new JLIcon({ name: 'ui-components:search', svgstr: searchSvgstr });
-export const stopIcon = new JLIcon({ name: 'ui-components:stop', svgstr: stopSvgstr });
-export const undoIcon = new JLIcon({ name: 'ui-components:undo', svgstr: undoSvgstr });
+// LabIcon instance construction
+export const caretDownEmptyThinIcon = new LabIcon({ name: 'ui-components:caret-down-empty-thin', svgstr: caretDownEmptyThinSvgstr });
+export const caretDownEmptyIcon = new LabIcon({ name: 'ui-components:caret-down-empty', svgstr: caretDownEmptySvgstr });
+export const caretDownIcon = new LabIcon({ name: 'ui-components:caret-down', svgstr: caretDownSvgstr });
+export const caretLeftIcon = new LabIcon({ name: 'ui-components:caret-left', svgstr: caretLeftSvgstr });
+export const caretRightIcon = new LabIcon({ name: 'ui-components:caret-right', svgstr: caretRightSvgstr });
+export const caretUpEmptyThinIcon = new LabIcon({ name: 'ui-components:caret-up-empty-thin', svgstr: caretUpEmptyThinSvgstr });
+export const caretUpIcon = new LabIcon({ name: 'ui-components:caret-up', svgstr: caretUpSvgstr });
+export const consoleIcon = new LabIcon({ name: 'ui-components:console', svgstr: consoleSvgstr });
+export const fileIcon = new LabIcon({ name: 'ui-components:file', svgstr: fileSvgstr });
+export const folderIcon = new LabIcon({ name: 'ui-components:folder', svgstr: folderSvgstr });
+export const html5Icon = new LabIcon({ name: 'ui-components:html5', svgstr: html5Svgstr });
+export const imageIcon = new LabIcon({ name: 'ui-components:image', svgstr: imageSvgstr });
+export const inspectorIcon = new LabIcon({ name: 'ui-components:inspector', svgstr: inspectorSvgstr });
+export const jsonIcon = new LabIcon({ name: 'ui-components:json', svgstr: jsonSvgstr });
+export const keyboardIcon = new LabIcon({ name: 'ui-components:keyboard', svgstr: keyboardSvgstr });
+export const launcherIcon = new LabIcon({ name: 'ui-components:launcher', svgstr: launcherSvgstr });
+export const markdownIcon = new LabIcon({ name: 'ui-components:markdown', svgstr: markdownSvgstr });
+export const notebookIcon = new LabIcon({ name: 'ui-components:notebook', svgstr: notebookSvgstr });
+export const pythonIcon = new LabIcon({ name: 'ui-components:python', svgstr: pythonSvgstr });
+export const rKernelIcon = new LabIcon({ name: 'ui-components:r-kernel', svgstr: rKernelSvgstr });
+export const reactIcon = new LabIcon({ name: 'ui-components:react', svgstr: reactSvgstr });
+export const settingsIcon = new LabIcon({ name: 'ui-components:settings', svgstr: settingsSvgstr });
+export const spreadsheetIcon = new LabIcon({ name: 'ui-components:spreadsheet', svgstr: spreadsheetSvgstr });
+export const textEditorIcon = new LabIcon({ name: 'ui-components:text-editor', svgstr: textEditorSvgstr });
+export const vegaIcon = new LabIcon({ name: 'ui-components:vega', svgstr: vegaSvgstr });
+export const yamlIcon = new LabIcon({ name: 'ui-components:yaml', svgstr: yamlSvgstr });
+export const jupyterFaviconIcon = new LabIcon({ name: 'ui-components:jupyter-favicon', svgstr: jupyterFaviconSvgstr });
+export const jupyterIcon = new LabIcon({ name: 'ui-components:jupyter', svgstr: jupyterSvgstr });
+export const jupyterlabWordmarkIcon = new LabIcon({ name: 'ui-components:jupyterlab-wordmark', svgstr: jupyterlabWordmarkSvgstr });
+export const caseSensitiveIcon = new LabIcon({ name: 'ui-components:case-sensitive', svgstr: caseSensitiveSvgstr });
+export const regexIcon = new LabIcon({ name: 'ui-components:regex', svgstr: regexSvgstr });
+export const buildIcon = new LabIcon({ name: 'ui-components:build', svgstr: buildSvgstr });
+export const extensionIcon = new LabIcon({ name: 'ui-components:extension', svgstr: extensionSvgstr });
+export const paletteIcon = new LabIcon({ name: 'ui-components:palette', svgstr: paletteSvgstr });
+export const runningIcon = new LabIcon({ name: 'ui-components:running', svgstr: runningSvgstr });
+export const tabIcon = new LabIcon({ name: 'ui-components:tab', svgstr: tabSvgstr });
+export const kernelIcon = new LabIcon({ name: 'ui-components:kernel', svgstr: kernelSvgstr });
+export const lineFormIcon = new LabIcon({ name: 'ui-components:line-form', svgstr: lineFormSvgstr });
+export const listIcon = new LabIcon({ name: 'ui-components:list', svgstr: listSvgstr });
+export const notTrustedIcon = new LabIcon({ name: 'ui-components:not-trusted', svgstr: notTrustedSvgstr });
+export const terminalIcon = new LabIcon({ name: 'ui-components:terminal', svgstr: terminalSvgstr });
+export const trustedIcon = new LabIcon({ name: 'ui-components:trusted', svgstr: trustedSvgstr });
+export const addIcon = new LabIcon({ name: 'ui-components:add', svgstr: addSvgstr });
+export const bugIcon = new LabIcon({ name: 'ui-components:bug', svgstr: bugSvgstr });
+export const checkIcon = new LabIcon({ name: 'ui-components:check', svgstr: checkSvgstr });
+export const circleEmptyIcon = new LabIcon({ name: 'ui-components:circle-empty', svgstr: circleEmptySvgstr });
+export const circleIcon = new LabIcon({ name: 'ui-components:circle', svgstr: circleSvgstr });
+export const closeIcon = new LabIcon({ name: 'ui-components:close', svgstr: closeSvgstr });
+export const copyIcon = new LabIcon({ name: 'ui-components:copy', svgstr: copySvgstr });
+export const cutIcon = new LabIcon({ name: 'ui-components:cut', svgstr: cutSvgstr });
+export const downloadIcon = new LabIcon({ name: 'ui-components:download', svgstr: downloadSvgstr });
+export const editIcon = new LabIcon({ name: 'ui-components:edit', svgstr: editSvgstr });
+export const ellipsesIcon = new LabIcon({ name: 'ui-components:ellipses', svgstr: ellipsesSvgstr });
+export const fileUploadIcon = new LabIcon({ name: 'ui-components:file-upload', svgstr: fileUploadSvgstr });
+export const filterListIcon = new LabIcon({ name: 'ui-components:filter-list', svgstr: filterListSvgstr });
+export const linkIcon = new LabIcon({ name: 'ui-components:link', svgstr: linkSvgstr });
+export const newFolderIcon = new LabIcon({ name: 'ui-components:new-folder', svgstr: newFolderSvgstr });
+export const pasteIcon = new LabIcon({ name: 'ui-components:paste', svgstr: pasteSvgstr });
+export const refreshIcon = new LabIcon({ name: 'ui-components:refresh', svgstr: refreshSvgstr });
+export const runIcon = new LabIcon({ name: 'ui-components:run', svgstr: runSvgstr });
+export const saveIcon = new LabIcon({ name: 'ui-components:save', svgstr: saveSvgstr });
+export const searchIcon = new LabIcon({ name: 'ui-components:search', svgstr: searchSvgstr });
+export const stopIcon = new LabIcon({ name: 'ui-components:stop', svgstr: stopSvgstr });
+export const undoIcon = new LabIcon({ name: 'ui-components:undo', svgstr: undoSvgstr });

+ 1 - 1
packages/ui-components/src/icon/index.ts

@@ -2,5 +2,5 @@
 // Distributed under the terms of the Modified BSD License.
 
 export * from './iconimports';
-export * from './jlicon';
+export * from './labicon';
 export * from './tabbarsvg';

+ 61 - 61
packages/ui-components/src/icon/jlicon.tsx

@@ -16,30 +16,30 @@ import badSvgstr from '../../style/debug/bad.svg';
 import blankSvgstr from '../../style/debug/blank.svg';
 import refreshSvgstr from '../../style/icons/toolbar/refresh.svg';
 
-export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
+export class LabIcon implements LabIcon.ILabIcon, LabIcon.IRenderer {
   /***********
    * statics *
    ***********/
 
   /**
-   * Get any existing JLIcon instance by name.
+   * Get any existing LabIcon instance by name.
    *
-   * @param name - name of the JLIcon instance to fetch
+   * @param name - name of the LabIcon instance to fetch
    *
-   * @param fallback - optional default JLIcon instance to use if
+   * @param fallback - optional default LabIcon instance to use if
    * name is not found
    *
-   * @returns A JLIcon instance
+   * @returns A LabIcon instance
    */
-  private static _get(name: string, fallback?: JLIcon): JLIcon | undefined {
+  private static _get(name: string, fallback?: LabIcon): LabIcon | undefined {
     for (let className of name.split(/\s+/)) {
-      if (JLIcon._instances.has(className)) {
-        return JLIcon._instances.get(className);
+      if (LabIcon._instances.has(className)) {
+        return LabIcon._instances.get(className);
       }
     }
 
     // lookup failed
-    if (JLIcon._debug) {
+    if (LabIcon._debug) {
       // fail noisily
       console.error(`Invalid icon name: ${name}`);
       return badIcon;
@@ -50,18 +50,18 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
   }
 
   /**
-   * Get any existing JLIcon instance by name, construct a DOM element
+   * Get any existing LabIcon instance by name, construct a DOM element
    * from it, then return said element.
    *
-   * @param name - name of the JLIcon instance to fetch
+   * @param name - name of the LabIcon instance to fetch
    *
    * @param fallback - if left undefined, use automatic fallback to
    * icons-as-css-background behavior: elem will be constructed using
    * a blank icon with `elem.className = classes(name, props.className)`,
    * where elem is the return value. Otherwise, fallback can be used to
-   * define the default JLIcon instance, returned whenever lookup fails
+   * define the default LabIcon instance, returned whenever lookup fails
    *
-   * @param props - passed directly to JLIcon.element
+   * @param props - passed directly to LabIcon.element
    *
    * @returns an SVGElement
    */
@@ -69,8 +69,8 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     name,
     fallback,
     ...props
-  }: { name: string; fallback?: JLIcon } & JLIcon.IProps) {
-    let icon = JLIcon._get(name, fallback);
+  }: { name: string; fallback?: LabIcon } & LabIcon.IProps) {
+    let icon = LabIcon._get(name, fallback);
     if (!icon) {
       icon = blankIcon;
       props.className = classesDedupe(name, props.className);
@@ -80,19 +80,19 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
   }
 
   /**
-   * Get any existing JLIcon instance by name, construct a React element
+   * Get any existing LabIcon instance by name, construct a React element
    * from it, then return said element.
    *
-   * @param name - name of the JLIcon instance to fetch
+   * @param name - name of the LabIcon instance to fetch
    *
    * @param fallback - if left undefined, use automatic fallback to
    * icons-as-css-background behavior: elem will be constructed using
    * a blank icon with `elem.className = classes(name, props.className)`,
    * where elem is the return value. Otherwise, fallback can be used to
-   * define the default JLIcon instance, used to construct the return
+   * define the default LabIcon instance, used to construct the return
    * elem whenever lookup fails
    *
-   * @param props - passed directly to JLIcon.react
+   * @param props - passed directly to LabIcon.react
    *
    * @returns a React element
    */
@@ -100,8 +100,8 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     name,
     fallback,
     ...props
-  }: { name: string; fallback?: JLIcon } & JLIcon.IReactProps) {
-    let icon = JLIcon._get(name, fallback);
+  }: { name: string; fallback?: LabIcon } & LabIcon.IReactProps) {
+    let icon = LabIcon._get(name, fallback);
     if (!icon) {
       icon = blankIcon;
       props.className = classesDedupe(name, props.className);
@@ -127,41 +127,41 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
 
   /**
    * Resolve an icon name or a {name, svgstr} pair into an
-   * actual JLIcon.
+   * actual LabIcon.
    *
    * @param icon - either a string with the name of an existing icon
    * or an object with {name: string, svgstr: string} fields.
    *
-   * @returns a JLIcon instance, or null if an icon name was passed in
+   * @returns a LabIcon instance, or null if an icon name was passed in
    * and lookup fails.
    */
-  static resolve(icon: JLIcon.IResolvable): JLIcon {
-    if (icon instanceof JLIcon) {
-      // icon already is a JLIcon; nothing to do here
+  static resolve(icon: LabIcon.IResolvable): LabIcon {
+    if (icon instanceof LabIcon) {
+      // icon already is a LabIcon; nothing to do here
       return icon;
     }
 
     if (typeof icon === 'string') {
       // do a dynamic lookup of existing icon by name
-      const resolved = JLIcon._get(icon);
+      const resolved = LabIcon._get(icon);
       if (resolved) {
         return resolved;
       }
 
       // no matching icon currently registered, create a new loading icon
       // TODO: find better icon (maybe animate?) for loading icon
-      return new JLIcon({ name: icon, svgstr: refreshSvgstr, _loading: true });
+      return new LabIcon({ name: icon, svgstr: refreshSvgstr, _loading: true });
     }
 
-    // icon was provided as a non-JLIcon {name, svgstr} pair, communicating
+    // icon was provided as a non-LabIcon {name, svgstr} pair, communicating
     // an intention to create a new icon
-    return new JLIcon(icon);
+    return new LabIcon(icon);
   }
 
   /**
    * Resolve a {name, svgstr} pair into an actual svg node.
    */
-  static resolveSvg({ name, svgstr }: JLIcon.IJLIcon): HTMLElement | null {
+  static resolveSvg({ name, svgstr }: LabIcon.ILabIcon): HTMLElement | null {
     const svgDoc = new DOMParser().parseFromString(svgstr, 'image/svg+xml');
 
     const svgError = svgDoc.querySelector('parsererror');
@@ -169,8 +169,8 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     // structure of error element varies by browser, search at top level
     if (svgError) {
       // parse failed, svgElement will be an error box
-      const errmsg = `SVG HTML was malformed for JLIcon instance.\nname: ${name}, svgstr: ${svgstr}`;
-      if (JLIcon._debug) {
+      const errmsg = `SVG HTML was malformed for LabIcon instance.\nname: ${name}, svgstr: ${svgstr}`;
+      if (LabIcon._debug) {
         // fail noisily, render the error box
         console.error(errmsg);
         return svgError as HTMLElement;
@@ -191,11 +191,11 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
    * @param debug - optional boolean to force debug on or off
    */
   static toggleDebug(debug?: boolean) {
-    JLIcon._debug = debug ?? !JLIcon._debug;
+    LabIcon._debug = debug ?? !LabIcon._debug;
   }
 
   private static _debug: boolean = false;
-  private static _instances = new Map<string, JLIcon>();
+  private static _instances = new Map<string, LabIcon>();
 
   /***********
    * members *
@@ -206,13 +206,13 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     svgstr,
     render,
     unrender,
-    rendererClass = JLIcon.ElementRenderer,
+    rendererClass = LabIcon.ElementRenderer,
     _loading = false
-  }: JLIcon.IOptions & { _loading?: boolean }) {
+  }: LabIcon.IOptions & { _loading?: boolean }) {
     if (!(name && svgstr)) {
       // sanity check failed
       console.error(
-        `When defining a new JLIcon, name and svgstr must both be non-empty strings. name: ${name}, svgstr: ${svgstr}`
+        `When defining a new LabIcon, name and svgstr must both be non-empty strings. name: ${name}, svgstr: ${svgstr}`
       );
       return badIcon;
     }
@@ -221,9 +221,9 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     this._loading = _loading;
 
     // check to see if this is a redefinition of an existing icon
-    if (JLIcon._instances.has(name)) {
+    if (LabIcon._instances.has(name)) {
       // fetch the existing icon, replace its svg, then return it
-      const icon = JLIcon._instances.get(name)!;
+      const icon = LabIcon._instances.get(name)!;
       if (this._loading) {
         // replace the placeholder svg in icon
         icon.svgstr = svgstr;
@@ -255,8 +255,8 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
       this.render = renderer.render.bind(this);
       this.unrender = renderer.unrender.bind(this);
     }
-    JLIcon._instances.set(this.name, this);
-    JLIcon._instances.set(this._className, this);
+    LabIcon._instances.set(this.name, this);
+    LabIcon._instances.set(this._className, this);
   }
 
   /**
@@ -291,7 +291,7 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     title,
     tag = 'div',
     ...propsStyle
-  }: JLIcon.IProps = {}): HTMLElement {
+  }: LabIcon.IProps = {}): HTMLElement {
     // check if icon element is already set
     const maybeSvgElement = container?.firstChild as HTMLElement;
     if (maybeSvgElement?.dataset?.iconId === this._uuid) {
@@ -398,7 +398,7 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
           title,
           tag = 'div',
           ...propsStyle
-        }: JLIcon.IProps = {},
+        }: LabIcon.IProps = {},
         ref: React.RefObject<SVGElement>
       ) => {
         // set up component state via useState hook
@@ -456,7 +456,7 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
       }
     );
 
-    component.displayName = `JLIcon_${this.name}`;
+    component.displayName = `LabIcon_${this.name}`;
     return component;
   }
 
@@ -464,7 +464,7 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
     title,
     uuid
   }: { title?: string; uuid?: string } = {}): HTMLElement | null {
-    const svgElement = JLIcon.resolveSvg(this);
+    const svgElement = LabIcon.resolveSvg(this);
 
     if (!svgElement) {
       // bail on null svg element
@@ -511,9 +511,9 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
    * to the icon container's classes, while the style itself will be
    * applied to any svg elements within the container.
    */
-  readonly react: JLIcon.IReact;
+  readonly react: LabIcon.IReact;
 
-  readonly render: (container: HTMLElement, props?: JLIcon.IProps) => void;
+  readonly render: (container: HTMLElement, props?: LabIcon.IProps) => void;
   readonly unrender: (container: HTMLElement) => void;
 
   protected _className: string;
@@ -528,9 +528,9 @@ export class JLIcon implements JLIcon.IJLIcon, JLIcon.IRenderer {
 }
 
 /**
- * A namespace for JLIcon statics.
+ * A namespace for LabIcon statics.
  */
-export namespace JLIcon {
+export namespace LabIcon {
   /**************
    * interfaces *
    **************/
@@ -569,13 +569,13 @@ export namespace JLIcon {
   }
 
   /**
-   * The IJLIcon interface. Outside of this interface the actual
-   * implementation of JLIcon may vary
+   * The ILabIcon interface. Outside of this interface the actual
+   * implementation of LabIcon may vary
    */
-  export interface IJLIcon extends IIcon, IRenderer {}
+  export interface ILabIcon extends IIcon, IRenderer {}
 
   /**
-   * Interface defining the parameters to be passed to the JLIcon
+   * Interface defining the parameters to be passed to the LabIcon
    * constructor
    */
   export interface IOptions extends IIcon, Partial<IRenderer> {
@@ -583,7 +583,7 @@ export namespace JLIcon {
   }
 
   /**
-   * The input props for creating a new JLIcon
+   * The input props for creating a new LabIcon
    */
   export interface IProps extends IIconStyle {
     /**
@@ -621,19 +621,19 @@ export namespace JLIcon {
    *********/
 
   /**
-   * A type that can be resolved to a JLIcon instance.
+   * A type that can be resolved to a LabIcon instance.
    */
   export type IResolvable = string | (IIcon & Partial<IRenderer>);
 
   /**
    * The properties that can be passed into the React component stored in
-   * the .react field of a JLIcon.
+   * the .react field of a LabIcon.
    */
   export type IReactProps = IProps & React.RefAttributes<SVGElement>;
 
   /**
    * The complete type of the React component stored in the .react
-   * field of a JLIcon.
+   * field of a LabIcon.
    */
   export type IReact = React.ForwardRefExoticComponent<IReactProps>;
 
@@ -646,7 +646,7 @@ export namespace JLIcon {
    */
   export class Renderer implements IRenderer {
     constructor(
-      protected _icon: JLIcon,
+      protected _icon: LabIcon,
       protected _rendererOptions: IRendererOptions = {}
     ) {}
 
@@ -727,11 +727,11 @@ namespace Private {
 }
 
 // need to be at the bottom since constructor depends on Private
-export const badIcon = new JLIcon({
+export const badIcon = new LabIcon({
   name: 'ui-components:bad',
   svgstr: badSvgstr
 });
-export const blankIcon = new JLIcon({
+export const blankIcon = new LabIcon({
   name: 'ui-components:blank',
   svgstr: blankSvgstr
 });

+ 4 - 4
packages/ui-components/src/tokens.ts

@@ -7,11 +7,11 @@ import { Token } from '@lumino/coreutils';
  * Placeholder for future icon manager class to assist with
  * overriding/replacing particular sets of icons
  */
-export interface IJLIconManager {}
+export interface ILabIconManager {}
 
 /**
- * The IJLIconManager token.
+ * The ILabIconManager token.
  */
-export const IJLIconManager = new Token<IJLIconManager>(
-  '@jupyterlab/ui-components:IJLIconManager'
+export const ILabIconManager = new Token<ILabIconManager>(
+  '@jupyterlab/ui-components:ILabIconManager'
 );

+ 1 - 1
packages/ui-components/stories/labicon.stories.tsx

@@ -11,7 +11,7 @@ import '@jupyterlab/application/style/index.css';
 import '@jupyterlab/theme-light-extension/style/index.css';
 
 export default {
-  // component: JLIcon,
+  // component: LabIcon,
   title: 'LabIcon'
 };