UNPKG

18 kBJavaScriptView Raw
1/*
2 * Copyright 2015 Palantir Technologies, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { Alignment } from "./alignment";
17import { Elevation } from "./elevation";
18import { Intent } from "./intent";
19import { Position } from "./position";
20var NS = "bp5";
21if (typeof BLUEPRINT_NAMESPACE !== "undefined") {
22 NS = BLUEPRINT_NAMESPACE;
23}
24else if (typeof REACT_APP_BLUEPRINT_NAMESPACE !== "undefined") {
25 NS = REACT_APP_BLUEPRINT_NAMESPACE;
26}
27// modifiers
28export var ACTIVE = "".concat(NS, "-active");
29export var ALIGN_LEFT = "".concat(NS, "-align-left");
30export var ALIGN_RIGHT = "".concat(NS, "-align-right");
31export var COMPACT = "".concat(NS, "-compact");
32export var DARK = "".concat(NS, "-dark");
33export var DISABLED = "".concat(NS, "-disabled");
34export var FILL = "".concat(NS, "-fill");
35export var FIXED = "".concat(NS, "-fixed");
36export var FIXED_TOP = "".concat(NS, "-fixed-top");
37export var INLINE = "".concat(NS, "-inline");
38export var INTERACTIVE = "".concat(NS, "-interactive");
39export var LARGE = "".concat(NS, "-large");
40export var LOADING = "".concat(NS, "-loading");
41export var MINIMAL = "".concat(NS, "-minimal");
42export var OUTLINED = "".concat(NS, "-outlined");
43export var PADDED = "".concat(NS, "-padded");
44export var MULTILINE = "".concat(NS, "-multiline");
45export var READ_ONLY = "".concat(NS, "-read-only");
46export var ROUND = "".concat(NS, "-round");
47export var SELECTED = "".concat(NS, "-selected");
48export var SMALL = "".concat(NS, "-small");
49export var VERTICAL = "".concat(NS, "-vertical");
50export var POSITION_TOP = positionClass(Position.TOP);
51export var POSITION_BOTTOM = positionClass(Position.BOTTOM);
52export var POSITION_LEFT = positionClass(Position.LEFT);
53export var POSITION_RIGHT = positionClass(Position.RIGHT);
54export var ELEVATION_0 = elevationClass(Elevation.ZERO);
55export var ELEVATION_1 = elevationClass(Elevation.ONE);
56export var ELEVATION_2 = elevationClass(Elevation.TWO);
57export var ELEVATION_3 = elevationClass(Elevation.THREE);
58export var ELEVATION_4 = elevationClass(Elevation.FOUR);
59export var INTENT_PRIMARY = intentClass(Intent.PRIMARY);
60export var INTENT_SUCCESS = intentClass(Intent.SUCCESS);
61export var INTENT_WARNING = intentClass(Intent.WARNING);
62export var INTENT_DANGER = intentClass(Intent.DANGER);
63export var FOCUS_DISABLED = "".concat(NS, "-focus-disabled");
64export var FOCUS_STYLE_MANAGER_IGNORE = "".concat(NS, "-focus-style-manager-ignore");
65// text utilities
66export var UI_TEXT = "".concat(NS, "-ui-text");
67export var RUNNING_TEXT = "".concat(NS, "-running-text");
68export var MONOSPACE_TEXT = "".concat(NS, "-monospace-text");
69export var TEXT_LARGE = "".concat(NS, "-text-large");
70export var TEXT_SMALL = "".concat(NS, "-text-small");
71export var TEXT_MUTED = "".concat(NS, "-text-muted");
72export var TEXT_DISABLED = "".concat(NS, "-text-disabled");
73export var TEXT_OVERFLOW_ELLIPSIS = "".concat(NS, "-text-overflow-ellipsis");
74// textual elements
75export var BLOCKQUOTE = "".concat(NS, "-blockquote");
76export var CODE = "".concat(NS, "-code");
77export var CODE_BLOCK = "".concat(NS, "-code-block");
78export var HEADING = "".concat(NS, "-heading");
79export var LIST = "".concat(NS, "-list");
80export var LIST_UNSTYLED = "".concat(NS, "-list-unstyled");
81export var RTL = "".concat(NS, "-rtl");
82// components
83export var ALERT = "".concat(NS, "-alert");
84export var ALERT_BODY = "".concat(ALERT, "-body");
85export var ALERT_CONTENTS = "".concat(ALERT, "-contents");
86export var ALERT_FOOTER = "".concat(ALERT, "-footer");
87export var BREADCRUMB = "".concat(NS, "-breadcrumb");
88export var BREADCRUMB_CURRENT = "".concat(BREADCRUMB, "-current");
89export var BREADCRUMBS = "".concat(BREADCRUMB, "s");
90export var BREADCRUMBS_COLLAPSED = "".concat(BREADCRUMB, "s-collapsed");
91export var BUTTON = "".concat(NS, "-button");
92export var BUTTON_GROUP = "".concat(BUTTON, "-group");
93export var BUTTON_SPINNER = "".concat(BUTTON, "-spinner");
94export var BUTTON_TEXT = "".concat(BUTTON, "-text");
95export var CALLOUT = "".concat(NS, "-callout");
96export var CALLOUT_HAS_BODY_CONTENT = "".concat(CALLOUT, "-has-body-content");
97export var CALLOUT_ICON = "".concat(CALLOUT, "-icon");
98export var CARD = "".concat(NS, "-card");
99export var CARD_LIST = "".concat(NS, "-card-list");
100export var CARD_LIST_BORDERED = "".concat(CARD_LIST, "-bordered");
101export var COLLAPSE = "".concat(NS, "-collapse");
102export var COLLAPSE_BODY = "".concat(COLLAPSE, "-body");
103export var CONTEXT_MENU = "".concat(NS, "-context-menu");
104export var CONTEXT_MENU_VIRTUAL_TARGET = "".concat(CONTEXT_MENU, "-virtual-target");
105export var CONTEXT_MENU_POPOVER = "".concat(CONTEXT_MENU, "-popover");
106export var CONTEXT_MENU_BACKDROP = "".concat(CONTEXT_MENU, "-backdrop");
107export var CONTROL_GROUP = "".concat(NS, "-control-group");
108export var DIALOG = "".concat(NS, "-dialog");
109export var DIALOG_CONTAINER = "".concat(DIALOG, "-container");
110export var DIALOG_HEADER = "".concat(DIALOG, "-header");
111export var DIALOG_BODY = "".concat(DIALOG, "-body");
112export var DIALOG_BODY_SCROLL_CONTAINER = "".concat(DIALOG, "-body-scroll-container");
113export var DIALOG_CLOSE_BUTTON = "".concat(DIALOG, "-close-button");
114export var DIALOG_FOOTER = "".concat(DIALOG, "-footer");
115export var DIALOG_FOOTER_FIXED = "".concat(DIALOG, "-footer-fixed");
116export var DIALOG_FOOTER_MAIN_SECTION = "".concat(DIALOG, "-footer-main-section");
117export var DIALOG_FOOTER_ACTIONS = "".concat(DIALOG, "-footer-actions");
118export var DIALOG_STEP = "".concat(NS, "-dialog-step");
119export var DIALOG_STEP_CONTAINER = "".concat(DIALOG_STEP, "-container");
120export var DIALOG_STEP_TITLE = "".concat(DIALOG_STEP, "-title");
121export var DIALOG_STEP_ICON = "".concat(DIALOG_STEP, "-icon");
122export var DIALOG_STEP_VIEWED = "".concat(DIALOG_STEP, "-viewed");
123export var DIVIDER = "".concat(NS, "-divider");
124export var DRAWER = "".concat(NS, "-drawer");
125export var DRAWER_BODY = "".concat(DRAWER, "-body");
126export var DRAWER_FOOTER = "".concat(DRAWER, "-footer");
127export var DRAWER_HEADER = "".concat(DRAWER, "-header");
128export var EDITABLE_TEXT = "".concat(NS, "-editable-text");
129export var EDITABLE_TEXT_CONTENT = "".concat(EDITABLE_TEXT, "-content");
130export var EDITABLE_TEXT_EDITING = "".concat(EDITABLE_TEXT, "-editing");
131export var EDITABLE_TEXT_INPUT = "".concat(EDITABLE_TEXT, "-input");
132export var EDITABLE_TEXT_PLACEHOLDER = "".concat(EDITABLE_TEXT, "-placeholder");
133export var FLEX_EXPANDER = "".concat(NS, "-flex-expander");
134export var HTML_SELECT = "".concat(NS, "-html-select");
135/** @deprecated use `<HTMLSelect>` component or `Classes.HTML_SELECT` instead */
136export var SELECT = "".concat(NS, "-select");
137export var HTML_TABLE = "".concat(NS, "-html-table");
138export var HTML_TABLE_BORDERED = "".concat(HTML_TABLE, "-bordered");
139export var HTML_TABLE_STRIPED = "".concat(HTML_TABLE, "-striped");
140export var INPUT = "".concat(NS, "-input");
141export var INPUT_GHOST = "".concat(INPUT, "-ghost");
142export var INPUT_GROUP = "".concat(INPUT, "-group");
143export var INPUT_LEFT_CONTAINER = "".concat(INPUT, "-left-container");
144export var INPUT_ACTION = "".concat(INPUT, "-action");
145export var RESIZABLE_INPUT_SPAN = "".concat(NS, "-resizable-input-span");
146export var TEXT_AREA = "".concat(NS, "-text-area");
147export var TEXT_AREA_AUTO_RESIZE = "".concat(TEXT_AREA, "-auto-resize");
148export var CONTROL = "".concat(NS, "-control");
149export var CONTROL_INDICATOR = "".concat(CONTROL, "-indicator");
150export var CONTROL_INDICATOR_CHILD = "".concat(CONTROL_INDICATOR, "-child");
151export var CHECKBOX = "".concat(NS, "-checkbox");
152export var RADIO = "".concat(NS, "-radio");
153export var SWITCH = "".concat(NS, "-switch");
154export var SWITCH_INNER_TEXT = "".concat(SWITCH, "-inner-text");
155export var FILE_INPUT = "".concat(NS, "-file-input");
156export var FILE_INPUT_HAS_SELECTION = "".concat(NS, "-file-input-has-selection");
157export var FILE_UPLOAD_INPUT = "".concat(NS, "-file-upload-input");
158export var FILE_UPLOAD_INPUT_CUSTOM_TEXT = "".concat(NS, "-file-upload-input-custom-text");
159export var KEY = "".concat(NS, "-key");
160export var KEY_COMBO = "".concat(KEY, "-combo");
161export var MODIFIER_KEY = "".concat(NS, "-modifier-key");
162export var HOTKEY = "".concat(NS, "-hotkey");
163export var HOTKEY_LABEL = "".concat(HOTKEY, "-label");
164export var HOTKEY_COLUMN = "".concat(HOTKEY, "-column");
165export var HOTKEY_DIALOG = "".concat(HOTKEY, "-dialog");
166export var LABEL = "".concat(NS, "-label");
167export var FORM_GROUP = "".concat(NS, "-form-group");
168export var FORM_CONTENT = "".concat(NS, "-form-content");
169export var FORM_HELPER_TEXT = "".concat(NS, "-form-helper-text");
170export var FORM_GROUP_SUB_LABEL = "".concat(NS, "-form-group-sub-label");
171export var MENU = "".concat(NS, "-menu");
172export var MENU_ITEM = "".concat(MENU, "-item");
173export var MENU_ITEM_IS_SELECTABLE = "".concat(MENU_ITEM, "-is-selectable");
174export var MENU_ITEM_SELECTED_ICON = "".concat(MENU_ITEM, "-selected-icon");
175export var MENU_ITEM_ICON = "".concat(MENU_ITEM, "-icon");
176export var MENU_ITEM_LABEL = "".concat(MENU_ITEM, "-label");
177export var MENU_SUBMENU = "".concat(NS, "-submenu");
178export var MENU_SUBMENU_ICON = "".concat(MENU_SUBMENU, "-icon");
179export var MENU_DIVIDER = "".concat(MENU, "-divider");
180export var MENU_HEADER = "".concat(MENU, "-header");
181export var MULTISTEP_DIALOG = "".concat(NS, "-multistep-dialog");
182export var MULTISTEP_DIALOG_PANELS = "".concat(MULTISTEP_DIALOG, "-panels");
183export var MULTISTEP_DIALOG_LEFT_PANEL = "".concat(MULTISTEP_DIALOG, "-left-panel");
184export var MULTISTEP_DIALOG_RIGHT_PANEL = "".concat(MULTISTEP_DIALOG, "-right-panel");
185export var MULTISTEP_DIALOG_NAV_TOP = "".concat(MULTISTEP_DIALOG, "-nav-top");
186export var MULTISTEP_DIALOG_NAV_RIGHT = "".concat(MULTISTEP_DIALOG, "-nav-right");
187export var SECTION = "".concat(NS, "-section");
188export var SECTION_COLLAPSED = "".concat(SECTION, "-collapsed");
189export var SECTION_HEADER = "".concat(SECTION, "-header");
190export var SECTION_HEADER_LEFT = "".concat(SECTION_HEADER, "-left");
191export var SECTION_HEADER_TITLE = "".concat(SECTION_HEADER, "-title");
192export var SECTION_HEADER_SUB_TITLE = "".concat(SECTION_HEADER, "-sub-title");
193export var SECTION_HEADER_DIVIDER = "".concat(SECTION_HEADER, "-divider");
194export var SECTION_HEADER_TABS = "".concat(SECTION_HEADER, "-tabs");
195export var SECTION_HEADER_RIGHT = "".concat(SECTION_HEADER, "-right");
196export var SECTION_CARD = "".concat(SECTION, "-card");
197export var NAVBAR = "".concat(NS, "-navbar");
198export var NAVBAR_GROUP = "".concat(NAVBAR, "-group");
199export var NAVBAR_HEADING = "".concat(NAVBAR, "-heading");
200export var NAVBAR_DIVIDER = "".concat(NAVBAR, "-divider");
201export var NON_IDEAL_STATE = "".concat(NS, "-non-ideal-state");
202export var NON_IDEAL_STATE_VISUAL = "".concat(NON_IDEAL_STATE, "-visual");
203export var NON_IDEAL_STATE_TEXT = "".concat(NON_IDEAL_STATE, "-text");
204export var NUMERIC_INPUT = "".concat(NS, "-numeric-input");
205export var OVERFLOW_LIST = "".concat(NS, "-overflow-list");
206export var OVERFLOW_LIST_SPACER = "".concat(OVERFLOW_LIST, "-spacer");
207export var OVERLAY = "".concat(NS, "-overlay");
208export var OVERLAY_BACKDROP = "".concat(OVERLAY, "-backdrop");
209export var OVERLAY_CONTAINER = "".concat(OVERLAY, "-container");
210export var OVERLAY_CONTENT = "".concat(OVERLAY, "-content");
211export var OVERLAY_INLINE = "".concat(OVERLAY, "-inline");
212export var OVERLAY_OPEN = "".concat(OVERLAY, "-open");
213export var OVERLAY_SCROLL_CONTAINER = "".concat(OVERLAY, "-scroll-container");
214export var OVERLAY_START_FOCUS_TRAP = "".concat(OVERLAY, "-start-focus-trap");
215export var OVERLAY_END_FOCUS_TRAP = "".concat(OVERLAY, "-end-focus-trap");
216export var PANEL_STACK = "".concat(NS, "-panel-stack");
217export var PANEL_STACK_HEADER = "".concat(PANEL_STACK, "-header");
218export var PANEL_STACK_HEADER_BACK = "".concat(PANEL_STACK, "-header-back");
219export var PANEL_STACK_VIEW = "".concat(PANEL_STACK, "-view");
220export var PANEL_STACK2 = "".concat(NS, "-panel-stack2");
221export var PANEL_STACK2_HEADER = "".concat(PANEL_STACK, "-header");
222export var PANEL_STACK2_HEADER_BACK = "".concat(PANEL_STACK, "-header-back");
223export var PANEL_STACK2_VIEW = "".concat(PANEL_STACK, "-view");
224export var POPOVER = "".concat(NS, "-popover");
225export var POPOVER_ARROW = "".concat(POPOVER, "-arrow");
226export var POPOVER_BACKDROP = "".concat(POPOVER, "-backdrop");
227export var POPOVER_CAPTURING_DISMISS = "".concat(POPOVER, "-capturing-dismiss");
228export var POPOVER_CONTENT = "".concat(POPOVER, "-content");
229export var POPOVER_CONTENT_PLACEMENT = "".concat(POPOVER, "-placement");
230export var POPOVER_CONTENT_SIZING = "".concat(POPOVER_CONTENT, "-sizing");
231export var POPOVER_DISMISS = "".concat(POPOVER, "-dismiss");
232export var POPOVER_DISMISS_OVERRIDE = "".concat(POPOVER_DISMISS, "-override");
233export var POPOVER_MATCH_TARGET_WIDTH = "".concat(POPOVER, "-match-target-width");
234export var POPOVER_OPEN = "".concat(POPOVER, "-open");
235export var POPOVER_POPPER_ESCAPED = "".concat(POPOVER, "-popper-escaped");
236export var POPOVER_REFERENCE_HIDDEN = "".concat(POPOVER, "-reference-hidden");
237export var POPOVER_TARGET = "".concat(POPOVER, "-target");
238export var POPOVER_TRANSITION_CONTAINER = "".concat(POPOVER, "-transition-container");
239/** @deprecated, no longer used in Blueprint v5.x */
240export var POPOVER_WRAPPER = "".concat(POPOVER, "-wrapper");
241export var PROGRESS_BAR = "".concat(NS, "-progress-bar");
242export var PROGRESS_METER = "".concat(NS, "-progress-meter");
243export var PROGRESS_NO_STRIPES = "".concat(NS, "-no-stripes");
244export var PROGRESS_NO_ANIMATION = "".concat(NS, "-no-animation");
245export var PORTAL = "".concat(NS, "-portal");
246export var SKELETON = "".concat(NS, "-skeleton");
247export var SLIDER = "".concat(NS, "-slider");
248export var SLIDER_AXIS = "".concat(SLIDER, "-axis");
249export var SLIDER_HANDLE = "".concat(SLIDER, "-handle");
250export var SLIDER_LABEL = "".concat(SLIDER, "-label");
251export var SLIDER_TRACK = "".concat(SLIDER, "-track");
252export var SLIDER_PROGRESS = "".concat(SLIDER, "-progress");
253export var START = "".concat(NS, "-start");
254export var END = "".concat(NS, "-end");
255export var SPINNER = "".concat(NS, "-spinner");
256export var SPINNER_ANIMATION = "".concat(SPINNER, "-animation");
257export var SPINNER_HEAD = "".concat(SPINNER, "-head");
258export var SPINNER_NO_SPIN = "".concat(NS, "-no-spin");
259export var SPINNER_TRACK = "".concat(SPINNER, "-track");
260export var TAB = "".concat(NS, "-tab");
261export var TAB_ICON = "".concat(TAB, "-icon");
262export var TAB_TAG = "".concat(TAB, "-tag");
263export var TAB_INDICATOR = "".concat(TAB, "-indicator");
264export var TAB_INDICATOR_WRAPPER = "".concat(TAB_INDICATOR, "-wrapper");
265export var TAB_LIST = "".concat(TAB, "-list");
266export var TAB_PANEL = "".concat(TAB, "-panel");
267export var TABS = "".concat(TAB, "s");
268export var TAG = "".concat(NS, "-tag");
269export var TAG_REMOVE = "".concat(TAG, "-remove");
270export var TAG_INPUT = "".concat(NS, "-tag-input");
271export var TAG_INPUT_ICON = "".concat(TAG_INPUT, "-icon");
272export var TAG_INPUT_VALUES = "".concat(TAG_INPUT, "-values");
273export var TOAST = "".concat(NS, "-toast");
274export var TOAST_CONTAINER = "".concat(TOAST, "-container");
275export var TOAST_MESSAGE = "".concat(TOAST, "-message");
276export var TOOLTIP = "".concat(NS, "-tooltip");
277export var TOOLTIP_INDICATOR = "".concat(TOOLTIP, "-indicator");
278export var TREE = "".concat(NS, "-tree");
279export var TREE_NODE = "".concat(NS, "-tree-node");
280export var TREE_NODE_CARET = "".concat(TREE_NODE, "-caret");
281export var TREE_NODE_CARET_CLOSED = "".concat(TREE_NODE_CARET, "-closed");
282export var TREE_NODE_CARET_NONE = "".concat(TREE_NODE_CARET, "-none");
283export var TREE_NODE_CARET_OPEN = "".concat(TREE_NODE_CARET, "-open");
284export var TREE_NODE_CONTENT = "".concat(TREE_NODE, "-content");
285export var TREE_NODE_EXPANDED = "".concat(TREE_NODE, "-expanded");
286export var TREE_NODE_ICON = "".concat(TREE_NODE, "-icon");
287export var TREE_NODE_LABEL = "".concat(TREE_NODE, "-label");
288export var TREE_NODE_LIST = "".concat(TREE_NODE, "-list");
289export var TREE_NODE_SECONDARY_LABEL = "".concat(TREE_NODE, "-secondary-label");
290export var TREE_NODE_SELECTED = "".concat(TREE_NODE, "-selected");
291export var TREE_ROOT = "".concat(NS, "-tree-root");
292export var ICON = "".concat(NS, "-icon");
293export var ICON_STANDARD = "".concat(ICON, "-standard");
294export var ICON_LARGE = "".concat(ICON, "-large");
295/**
296 * Returns the namespace prefix for all Blueprint CSS classes.
297 * Customize this namespace at build time by defining it with `webpack.DefinePlugin`.
298 */
299export function getClassNamespace() {
300 return NS;
301}
302/** Return CSS class for alignment. */
303export function alignmentClass(alignment) {
304 switch (alignment) {
305 case Alignment.LEFT:
306 return ALIGN_LEFT;
307 case Alignment.RIGHT:
308 return ALIGN_RIGHT;
309 default:
310 return undefined;
311 }
312}
313export function elevationClass(elevation) {
314 if (elevation === undefined) {
315 return undefined;
316 }
317 return "".concat(NS, "-elevation-").concat(elevation);
318}
319export function iconClass(iconName) {
320 if (iconName == null) {
321 return undefined;
322 }
323 return iconName.indexOf("".concat(NS, "-icon-")) === 0 ? iconName : "".concat(NS, "-icon-").concat(iconName);
324}
325export function intentClass(intent) {
326 if (intent == null || intent === Intent.NONE) {
327 return undefined;
328 }
329 return "".concat(NS, "-intent-").concat(intent.toLowerCase());
330}
331export function positionClass(position) {
332 if (position === undefined) {
333 return undefined;
334 }
335 return "".concat(NS, "-position-").concat(position);
336}
337//# sourceMappingURL=classes.js.map
\No newline at end of file