How to use the @blueprintjs/core.Position.TOP function in @blueprintjs/core

To help you get started, we’ve selected a few @blueprintjs/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github empiricaly / empirica / imports / core / ui / components / Toasters.jsx View on Github external
// toaster.ts
import { Position, Toaster, Intent } from "@blueprintjs/core";

const toaster = Toaster.create({
  position: Position.TOP
});

export const AlertToaster = {
  show({ message }) {
    toaster.show({ message, iconName: "warning-sign", intent: Intent.DANGER });
  }
};

export const SuccessToaster = {
  show({ message }) {
    toaster.show({ message, iconName: "tick-circle", intent: Intent.SUCCESS });
  }
};
github ia-toki / judgels / judgels-frontends / raphael / src / modules / toast / toastActions.ts View on Github external
message = error.errors['_error'] || error.message;
      } else {
        message = error.message;
      }

      toaster.show({
        icon: 'warning-sign',
        message,
        intent: Intent.DANGER,
      });
    },
  };
}

const injectedToaster = Toaster.create({
  position: Position.TOP,
  className: 'toast',
});

export const toastActions = createToastActions(injectedToaster);
github palantir / blueprint / packages / docs-app / src / examples / select-examples / omnibarExample.tsx View on Github external
<button>
                    {" or press "}
                    
                

                }
                    onItemSelect={this.handleItemSelect}
                    onClose={this.handleClose}
                /&gt;
                
            
        );
    }
</button>
github Datawheel / canon / packages / vizbuilder / src / components / ErrorToaster.jsx View on Github external
import {Position, Toaster} from "@blueprintjs/core";

export const ErrorToaster =
  typeof window !== "undefined"
    ? Toaster.create({
      className: "error-toaster",
      position: Position.TOP
    })
    : null;
github pubpub / pubpub / client / containers / Pub / PubDocument / PubBottom / Discussions / LabelFilter.js View on Github external
type="text"
										value={label.title}
										onChange={handleTitleChange}
									/&gt;
									
													All discussion authors can apply this label.
												
											) : (
												<span>Only managers can apply this label.</span>
											)
										}
										tooltipClassName="bp3-dark"
										position={Position.TOP}
									&gt;
										<button>
									
									</button><button>
								
							);
						})}
				</button>
github palantir / blueprint / packages / docs-app / src / examples / core-examples / toastExample.tsx View on Github external
Label,
    NumericInput,
    Position,
    ProgressBar,
    Switch,
    Toaster,
    ToasterPosition,
} from "@blueprintjs/core";
import { Example, handleBooleanChange, handleStringChange, IExampleProps } from "@blueprintjs/docs-theme";
import { IBlueprintExampleData } from "../../tags/reactExamples";

type IToastDemo = IToastProps &amp; { button: string };

const POSITIONS = [
    Position.TOP_LEFT,
    Position.TOP,
    Position.TOP_RIGHT,
    Position.BOTTOM_LEFT,
    Position.BOTTOM,
    Position.BOTTOM_RIGHT,
];

export class ToastExample extends React.PureComponent, IToasterProps&gt; {
    public state: IToasterProps = {
        autoFocus: false,
        canEscapeKeyClear: true,
        position: Position.TOP,
    };

    private TOAST_BUILDERS: IToastDemo[] = [
        {
            action: {
github jumpinjackie / mapguide-react-layout / src / containers / map-viewer.tsx View on Github external
if (map &amp;&amp; config &amp;&amp; viewer &amp;&amp; invokeCommand) {
            const selectableLayerNames = (map.Layer || [])
                .filter(layer =&gt; layer.Selectable &amp;&amp; selectableLayers[layer.ObjectId] !== false)
                .map(layer =&gt; layer.Name);
            const store = (this.context as any).store;
            const items: any[] = contextmenu != null ? contextmenu.items : [];
            const cmitems = (items || []).map(tb =&gt; mapToolbarReference(tb, store, invokeCommand));
            const childItems = processMenuItems(cmitems);
            let xml;
            if (activeSelectedFeature &amp;&amp; selection &amp;&amp; selection.FeatureSet) {
                xml = getActiveSelectedFeatureXml(selection.FeatureSet, activeSelectedFeature);
            }
            if (config.agentUri) {
                //Praise $DEITY, we can finally return multiple JSX elements in React 16! No more DOM contortions!
                return [
                    ,
github ubyssey / dispatch / dispatch / static / manager / src / js / vendor / dispatch-editor / components / Editor.js View on Github external
if ( !isCollapsed || showLinkPopover ) {

        var selected = getSelected().getRangeAt(0).getBoundingClientRect()
        var container = this.refs.container.getBoundingClientRect()

        var position,
          left = selected.left - container.left,
          center = left + (selected.width / 2),
          third = container.width / 3

        if (center > 2 * third) {
          position = Position.TOP_RIGHT
          left = left - 600 + (selected.width / 2) + 15
        } else if (center > third ) {
          position = Position.TOP
          left = left - 300 + (selected.width / 2)
        } else {
          if (selected.width == 0) {
            left = left - 15
          }
          position = Position.TOP_LEFT
        }

        this.setState({
          showPopover: true,
          popover: {
            top: selected.top - container.top,
            left: left,
            position: position,
            renderContent: showLinkPopover ? this.renderLinkPopover.bind(this) : this.renderPopover.bind(this),
            linkEntity: linkEntity
github poooi / poi / views / components / ship / ship-item.es View on Github external
)
    const ammoTip = (
      <span>
        
        {ship.api_bull} / {$ship.api_bull_max}
        {ammoPercentage &lt; 100 &amp;&amp;
          ` (-${Math.max(
            1,
            Math.floor(($ship.api_bull_max - ship.api_bull) * (ship.api_lv &gt; 99 ? 0.85 : 1)),
          )})`}
      </span>
    )
    return (
      
            <div>{$ship.api_name ? t(`resources:${$ship.api_name}`) : '??'}</div>
            <div>
              Lv. {ship.api_lv || '??'} Next. {(ship.api_exp || [])[1]}
            </div>
          
        }
      &gt;