@jupyterlab/ui-components 4.1.0-alpha.1 → 4.1.0-alpha.3

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.
Files changed (39) hide show
  1. package/lib/components/form.js +5 -1
  2. package/lib/components/form.js.map +1 -1
  3. package/lib/components/htmlselect.js +5 -7
  4. package/lib/components/htmlselect.js.map +1 -1
  5. package/lib/components/index.d.ts +1 -0
  6. package/lib/components/index.js +1 -0
  7. package/lib/components/index.js.map +1 -1
  8. package/lib/components/table.d.ts +47 -0
  9. package/lib/components/table.js +56 -0
  10. package/lib/components/table.js.map +1 -0
  11. package/lib/components/windowedlist.d.ts +40 -4
  12. package/lib/components/windowedlist.js +97 -25
  13. package/lib/components/windowedlist.js.map +1 -1
  14. package/lib/hoverbox.js +2 -1
  15. package/lib/hoverbox.js.map +1 -1
  16. package/lib/icon/iconimports.d.ts +2 -0
  17. package/lib/icon/iconimports.js +4 -0
  18. package/lib/icon/iconimports.js.map +1 -1
  19. package/lib/icon/labicon.js +2 -3
  20. package/lib/icon/labicon.js.map +1 -1
  21. package/lib/icon/widgets/tabbarsvg.js +1 -2
  22. package/lib/icon/widgets/tabbarsvg.js.map +1 -1
  23. package/package.json +11 -11
  24. package/src/components/form.tsx +12 -8
  25. package/src/components/index.ts +1 -0
  26. package/src/components/table.tsx +151 -0
  27. package/src/components/windowedlist.ts +110 -25
  28. package/src/hoverbox.ts +2 -1
  29. package/src/icon/iconimports.ts +4 -0
  30. package/style/base.css +1 -0
  31. package/style/deprecated.css +10 -0
  32. package/style/hoverbox.css +1 -2
  33. package/style/icons/history.svg +3 -0
  34. package/style/icons/lock.svg +3 -0
  35. package/style/rjsfTemplates.css +7 -3
  36. package/style/spinner.css +1 -2
  37. package/style/styling.css +1 -2
  38. package/style/table.css +107 -0
  39. package/style/toolbar.css +10 -3
@@ -0,0 +1,151 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ import React, { ReactElement, ReactNode, useState } from 'react';
7
+ import { caretDownIcon, caretUpIcon } from '../icon';
8
+
9
+ export const TABLE_CLASS = 'jp-sortable-table';
10
+
11
+ /**
12
+ * A namespace for Table.
13
+ */
14
+ export namespace Table {
15
+ /**
16
+ * The state which will be restored from layout tracker.
17
+ */
18
+ export interface ISortState {
19
+ sortKey?: string | null;
20
+ sortDirection: -1 | 1;
21
+ }
22
+ /**
23
+ * The initialization options for the table.
24
+ */
25
+ export interface IOptions<T> extends Partial<ISortState> {
26
+ rows: IRow<T>[];
27
+ columns: IColumn<T>[];
28
+ onRowClick?: React.MouseEventHandler<HTMLTableRowElement>;
29
+ blankIndicator: () => ReactNode;
30
+ }
31
+ /**
32
+ * Table row with data to display.
33
+ */
34
+ export interface IRow<T> {
35
+ data: T;
36
+ key: string;
37
+ }
38
+ /**
39
+ * Column definition.
40
+ */
41
+ export interface IColumn<T> {
42
+ id: string;
43
+ label: string;
44
+ renderCell(data: T): ReactNode;
45
+ sort(a: T, b: T): number | undefined;
46
+ isAvailable?(): boolean;
47
+ isHidden?: boolean;
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Sortable table component for small datasets.
53
+ *
54
+ * For large datasets use `DataGrid` from `@lumino/datagrid`.
55
+ */
56
+ export function Table<T>(props: Table.IOptions<T>) {
57
+ const [sortState, setSortState] = useState<Table.ISortState>({
58
+ sortKey: props.sortKey,
59
+ sortDirection: props.sortDirection || 1
60
+ });
61
+
62
+ const sort = (key: string) => {
63
+ if (key === sortState.sortKey) {
64
+ setSortState({
65
+ sortKey: key,
66
+ sortDirection: (sortState.sortDirection * -1) as -1 | 1
67
+ });
68
+ } else {
69
+ setSortState({ sortKey: key, sortDirection: 1 });
70
+ }
71
+ };
72
+
73
+ let rows = props.rows;
74
+ const sortedColumn = props.columns.filter(
75
+ column => column.id === sortState.sortKey
76
+ )[0];
77
+
78
+ if (sortedColumn) {
79
+ const sorter = sortedColumn.sort.bind(sortedColumn);
80
+ rows = props.rows.sort(
81
+ (a, b) => sorter(a.data, b.data) * sortState.sortDirection
82
+ );
83
+ }
84
+
85
+ const visibleColumns = props.columns.filter(
86
+ column =>
87
+ (column.isAvailable ? column.isAvailable() : true) && !column.isHidden
88
+ );
89
+
90
+ const elements = rows.map(row => {
91
+ const cells = visibleColumns.map(column => (
92
+ <td key={column.id + '-' + row.key}>{column.renderCell(row.data)}</td>
93
+ ));
94
+
95
+ return (
96
+ <tr
97
+ key={row.key}
98
+ data-key={row.key}
99
+ onClick={props.onRowClick}
100
+ className={'jp-sortable-table-tr'}
101
+ >
102
+ {cells}
103
+ </tr>
104
+ );
105
+ });
106
+
107
+ const columnsHeaders = visibleColumns.map(column => (
108
+ <SortableTH
109
+ label={column.label}
110
+ id={column.id}
111
+ state={sortState}
112
+ key={column.id}
113
+ onSort={() => {
114
+ sort(column.id);
115
+ }}
116
+ />
117
+ ));
118
+
119
+ return (
120
+ <table className={TABLE_CLASS}>
121
+ <thead>
122
+ <tr className={'jp-sortable-table-tr'}>{columnsHeaders}</tr>
123
+ </thead>
124
+ <tbody>{elements}</tbody>
125
+ </table>
126
+ );
127
+ }
128
+
129
+ function SortableTH(props: {
130
+ id: string;
131
+ label: string;
132
+ state: Table.ISortState;
133
+ onSort: () => void;
134
+ }): ReactElement {
135
+ const isSortKey = props.id === props.state.sortKey;
136
+ const sortIcon =
137
+ !isSortKey || props.state.sortDirection === 1 ? caretUpIcon : caretDownIcon;
138
+ return (
139
+ <th
140
+ key={props.id}
141
+ onClick={() => props.onSort()}
142
+ className={isSortKey ? 'jp-sorted-header' : undefined}
143
+ data-id={props.id}
144
+ >
145
+ <div className="jp-sortable-table-th-wrapper">
146
+ <label>{props.label}</label>
147
+ <sortIcon.react tag="span" className="jp-sort-icon" />
148
+ </div>
149
+ </th>
150
+ );
151
+ }
@@ -16,6 +16,7 @@ import { ArrayExt } from '@lumino/algorithm';
16
16
  import { PromiseDelegate } from '@lumino/coreutils';
17
17
  import { IDisposable } from '@lumino/disposable';
18
18
  import { Message, MessageLoop } from '@lumino/messaging';
19
+ import { Throttler } from '@lumino/polling';
19
20
  import { ISignal, Signal } from '@lumino/signaling';
20
21
  import { PanelLayout, Widget } from '@lumino/widgets';
21
22
 
@@ -89,6 +90,32 @@ export abstract class WindowedListModel implements WindowedList.IModel {
89
90
  */
90
91
  abstract widgetRenderer: (index: number) => Widget;
91
92
 
93
+ /**
94
+ * The overlap threshold used to decide whether to scroll down to an item
95
+ * below the viewport (smart mode). If the item overlap with the viewport
96
+ * is greater or equal this threshold the item is considered sufficiently
97
+ * visible and will not be scrolled to. The value is the number of pixels
98
+ * in overlap if greater than one, or otherwise a fraction of item height.
99
+ * By default the item is scrolled to if not full visible in the viewport.
100
+ */
101
+ readonly scrollDownThreshold: number = 1;
102
+
103
+ /**
104
+ * The underlap threshold used to decide whether to scroll up to an item
105
+ * above the viewport (smart mode). If the item part outside the viewport
106
+ * (underlap) is greater than this threshold then the item is considered
107
+ * not sufficiently visible and will be scrolled to.
108
+ * The value is the number of pixels in underlap if greater than one, or
109
+ * otherwise a fraction of the item height.
110
+ * By default the item is scrolled to if not full visible in the viewport.
111
+ */
112
+ readonly scrollUpThreshold: number = 0;
113
+
114
+ /**
115
+ * Top padding of the the outer window node.
116
+ */
117
+ paddingTop: number = 0;
118
+
92
119
  /**
93
120
  * List widget height
94
121
  */
@@ -265,29 +292,41 @@ export abstract class WindowedListModel implements WindowedList.IModel {
265
292
  /**
266
293
  * Get the scroll offset to display an item in the viewport.
267
294
  *
268
- * By default, the list will scroll as little as possible to ensure the item is visible. You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are:
295
+ * By default, the list will scroll as little as possible to ensure the item is fully visible. You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are:
269
296
  *
270
- * auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.)
271
- * smart - If the item is already visible (including the margin), don't scroll at all. If it is less than one viewport away, scroll so that it becomes visible (including the margin). If it is more than one viewport away, scroll so that it is centered within the list.
297
+ * auto (default) - Automatically align with the top or bottom minimising the amount scrolled; if item is smaller than the viewport and fully visible, do not scroll at all.
298
+ * smart - If the item is significantly visible, don't scroll at all (regardless of whether it fits in the viewport). If it is less than one viewport away or exceeds viewport in height, scroll so that it becomes visible. If it is more than one viewport away and fits the viewport, scroll so that it is centered within the viewport.
272
299
  * center - Center align the item within the list.
273
300
  * end - Align the item to the end of the list
274
301
  * start - Align the item to the beginning of the list
275
302
  *
303
+ * An item is considered significantly visible if:
304
+ * - it overlaps with the viewport by the amount specified by `scrollDownThreshold` when below the viewport
305
+ * - it exceeds the viewport by the amount less than specified by `scrollUpThreshold` when above the viewport.
306
+ *
276
307
  * @param index Item index
277
308
  * @param align Where to align the item in the viewport
278
- * @param margin In 'smart' mode the viewport proportion to add
309
+ * @param margin The proportion of viewport to add when aligning with the top/bottom of the list.
279
310
  * @returns The needed scroll offset
280
311
  */
281
312
  getOffsetForIndexAndAlignment(
282
313
  index: number,
283
314
  align: WindowedList.ScrollToAlign = 'auto',
284
- margin: number = 0.25
315
+ margin: number = 0
285
316
  ): number {
286
- const boundedMargin =
287
- align === 'smart' ? Math.min(Math.max(0.0, margin), 1.0) : 0.0;
317
+ const boundedMargin = Math.min(Math.max(0.0, margin), 1.0);
288
318
  const size = this._height;
289
319
  const itemMetadata = this._getItemMetadata(index);
290
320
 
321
+ const scrollDownThreshold =
322
+ this.scrollDownThreshold <= 1
323
+ ? itemMetadata.size * this.scrollDownThreshold
324
+ : this.scrollDownThreshold;
325
+ const scrollUpThreshold =
326
+ this.scrollUpThreshold <= 1
327
+ ? itemMetadata.size * this.scrollUpThreshold
328
+ : this.scrollUpThreshold;
329
+
291
330
  // Get estimated total size after ItemMetadata is computed,
292
331
  // To ensure it reflects actual measurements instead of just estimates.
293
332
  const estimatedTotalSize = this.getEstimatedTotalSize();
@@ -300,37 +339,62 @@ export abstract class WindowedListModel implements WindowedList.IModel {
300
339
  0,
301
340
  itemMetadata.offset - size + itemMetadata.size
302
341
  );
303
-
342
+ const currentOffset = this._scrollOffset;
343
+
344
+ const itemTop = itemMetadata.offset;
345
+ const itemBottom = itemMetadata.offset + itemMetadata.size;
346
+ const bottomEdge = currentOffset - this.paddingTop + size;
347
+ const topEdge = currentOffset - this.paddingTop;
348
+ const crossingBottomEdge = bottomEdge > itemTop && bottomEdge < itemBottom;
349
+ const crossingTopEdge = topEdge > itemTop && topEdge < itemBottom;
304
350
  if (align === 'smart') {
351
+ const edgeLessThanOneViewportAway =
352
+ currentOffset >= bottomOffset - size &&
353
+ currentOffset <= topOffset + size;
354
+
355
+ const visiblePartBottom = bottomEdge - itemTop;
356
+ const hiddenPartTop = topEdge - itemTop;
357
+
305
358
  if (
306
- this._scrollOffset >= bottomOffset - size &&
307
- this._scrollOffset <= topOffset + size
359
+ (crossingBottomEdge && visiblePartBottom >= scrollDownThreshold) ||
360
+ (crossingTopEdge && hiddenPartTop < scrollUpThreshold)
308
361
  ) {
362
+ return this._scrollOffset;
363
+ } else if (edgeLessThanOneViewportAway) {
364
+ // Possibly less than one viewport away, scroll so that it becomes visible (including the margin)
309
365
  align = 'auto';
310
366
  } else {
311
- align = 'center';
367
+ // More than one viewport away, scroll so that it is centered within the list,
368
+ // unless the widget is larger than the viewport, in which case only scroll to
369
+ // align with the top or bottom edge (automatically)
370
+ if (itemMetadata.size > size) {
371
+ align = 'auto';
372
+ } else {
373
+ align = 'center';
374
+ }
375
+ }
376
+ }
377
+
378
+ if (align === 'auto') {
379
+ if (bottomEdge > itemBottom && topEdge < itemTop) {
380
+ // No need to change the position, return the current offset.
381
+ return this._scrollOffset;
382
+ } else if (crossingBottomEdge || bottomEdge <= itemBottom) {
383
+ align = 'end';
384
+ } else {
385
+ align = 'start';
312
386
  }
313
387
  }
314
388
 
315
389
  switch (align) {
316
390
  case 'start':
317
- return topOffset;
391
+ // Align to the top edge.
392
+ return Math.max(0, topOffset - boundedMargin * size) + this.paddingTop;
318
393
  case 'end':
319
- return bottomOffset;
394
+ // Align to the bottom edge.
395
+ return bottomOffset + boundedMargin * size + this.paddingTop;
320
396
  case 'center':
321
397
  return Math.round(bottomOffset + (topOffset - bottomOffset) / 2);
322
- case 'auto':
323
- default:
324
- if (
325
- this._scrollOffset >= bottomOffset &&
326
- this._scrollOffset <= itemMetadata.offset
327
- ) {
328
- return this._scrollOffset;
329
- } else if (this._scrollOffset < bottomOffset) {
330
- return bottomOffset + boundedMargin * size;
331
- } else {
332
- return Math.max(0, topOffset - boundedMargin * size);
333
- }
334
398
  }
335
399
  }
336
400
 
@@ -688,6 +752,7 @@ export class WindowedList<
688
752
  this._scrollToItem = null;
689
753
  this._scrollRepaint = null;
690
754
  this._scrollUpdateWasRequested = false;
755
+ this._updater = new Throttler(() => this.update(), 50);
691
756
  this._resizeObserver = null;
692
757
 
693
758
  this._viewModel.stateChanged.connect(this.onStateChanged, this);
@@ -727,6 +792,14 @@ export class WindowedList<
727
792
  return this._viewModel;
728
793
  }
729
794
 
795
+ /**
796
+ * Dispose the windowed list.
797
+ */
798
+ dispose(): void {
799
+ this._updater.dispose();
800
+ super.dispose();
801
+ }
802
+
730
803
  /**
731
804
  * Callback on event.
732
805
  *
@@ -832,6 +905,8 @@ export class WindowedList<
832
905
  this._applyNoWindowingStyles();
833
906
  }
834
907
  this.viewModel.height = this.node.getBoundingClientRect().height;
908
+ const style = window.getComputedStyle(this.node);
909
+ this.viewModel.paddingTop = parseFloat(style.paddingTop);
835
910
  }
836
911
 
837
912
  /**
@@ -880,8 +955,12 @@ export class WindowedList<
880
955
  * A message handler invoked on an `'resize-request'` message.
881
956
  */
882
957
  protected onResize(msg: Widget.ResizeMessage): void {
958
+ const previousHeight = this.viewModel.height;
883
959
  this.viewModel.height =
884
960
  msg.height >= 0 ? msg.height : this.node.getBoundingClientRect().height;
961
+ if (this.viewModel.height !== previousHeight) {
962
+ void this._updater.invoke();
963
+ }
885
964
  super.onResize(msg);
886
965
  }
887
966
 
@@ -1114,6 +1193,7 @@ export class WindowedList<
1114
1193
  private _scrollRepaint: number | null;
1115
1194
  private _scrollToItem: [number, WindowedList.ScrollToAlign] | null;
1116
1195
  private _scrollUpdateWasRequested: boolean;
1196
+ private _updater: Throttler;
1117
1197
  }
1118
1198
 
1119
1199
  /**
@@ -1331,6 +1411,11 @@ export namespace WindowedList {
1331
1411
  */
1332
1412
  height: number;
1333
1413
 
1414
+ /**
1415
+ * Top padding of the the outer window node.
1416
+ */
1417
+ paddingTop?: number;
1418
+
1334
1419
  /**
1335
1420
  * Items list to be rendered
1336
1421
  */
package/src/hoverbox.ts CHANGED
@@ -230,9 +230,10 @@ export namespace HoverBox {
230
230
  let rect = node.getBoundingClientRect();
231
231
 
232
232
  // Move left to fit in the window.
233
- const right = rect.right;
233
+ let right = rect.right;
234
234
  if (right > window.innerWidth) {
235
235
  left -= right - window.innerWidth;
236
+ right = window.innerWidth;
236
237
  node.style.left = `${Math.ceil(left)}px`;
237
238
  }
238
239
 
@@ -53,6 +53,7 @@ import filterListSvgstr from '../../style/icons/toolbar/filter-list.svg';
53
53
  import filterSvgstr from '../../style/icons/search/filter.svg';
54
54
  import folderFavoriteSvgstr from '../../style/icons/filetype/folder-favorite.svg';
55
55
  import folderSvgstr from '../../style/icons/filetype/folder.svg';
56
+ import historySvgstr from '../../style/icons/history.svg';
56
57
  import homeSvgstr from '../../style/icons/filetype/home.svg';
57
58
  import html5Svgstr from '../../style/icons/filetype/html5.svg';
58
59
  import imageSvgstr from '../../style/icons/filetype/image.svg';
@@ -70,6 +71,7 @@ import launcherSvgstr from '../../style/icons/filetype/launcher.svg';
70
71
  import lineFormSvgstr from '../../style/icons/statusbar/line-form.svg';
71
72
  import linkSvgstr from '../../style/icons/toolbar/link.svg';
72
73
  import listSvgstr from '../../style/icons/statusbar/list.svg';
74
+ import lockSvgstr from '../../style/icons/lock.svg';
73
75
  import markdownSvgstr from '../../style/icons/filetype/markdown.svg';
74
76
  import mermaidSvgstr from '../../style/icons/filetype/mermaid.svg';
75
77
  import moveDownSvgstr from '../../style/icons/toolbar/move-down.svg';
@@ -157,6 +159,7 @@ export const filterIcon = new LabIcon({ name: 'ui-components:filter', svgstr: fi
157
159
  export const filterListIcon = new LabIcon({ name: 'ui-components:filter-list', svgstr: filterListSvgstr });
158
160
  export const folderFavoriteIcon = new LabIcon({ name: 'ui-components:folder-favorite', svgstr: folderFavoriteSvgstr });
159
161
  export const folderIcon = new LabIcon({ name: 'ui-components:folder', svgstr: folderSvgstr });
162
+ export const historyIcon = new LabIcon({ name: 'ui-components:history', svgstr: historySvgstr });
160
163
  export const homeIcon = new LabIcon({ name: 'ui-components:home', svgstr: homeSvgstr });
161
164
  export const html5Icon = new LabIcon({ name: 'ui-components:html5', svgstr: html5Svgstr });
162
165
  export const imageIcon = new LabIcon({ name: 'ui-components:image', svgstr: imageSvgstr });
@@ -174,6 +177,7 @@ export const launcherIcon = new LabIcon({ name: 'ui-components:launcher', svgstr
174
177
  export const lineFormIcon = new LabIcon({ name: 'ui-components:line-form', svgstr: lineFormSvgstr });
175
178
  export const linkIcon = new LabIcon({ name: 'ui-components:link', svgstr: linkSvgstr });
176
179
  export const listIcon = new LabIcon({ name: 'ui-components:list', svgstr: listSvgstr });
180
+ export const lockIcon = new LabIcon({ name: 'ui-components:lock', svgstr: lockSvgstr });
177
181
  export const markdownIcon = new LabIcon({ name: 'ui-components:markdown', svgstr: markdownSvgstr });
178
182
  export const mermaidIcon = new LabIcon({ name: 'ui-components:mermaid', svgstr: mermaidSvgstr });
179
183
  export const moveDownIcon = new LabIcon({ name: 'ui-components:move-down', svgstr: moveDownSvgstr });
package/style/base.css CHANGED
@@ -18,6 +18,7 @@
18
18
  @import './spinner.css';
19
19
  @import './styling.css';
20
20
  @import './switch.css';
21
+ @import './table.css';
21
22
  @import './toolbar.css';
22
23
  @import './windowedlist.css';
23
24
 
@@ -57,6 +57,7 @@
57
57
  --jp-icon-filter: url('icons/search/filter.svg');
58
58
  --jp-icon-folder-favorite: url('icons/filetype/folder-favorite.svg');
59
59
  --jp-icon-folder: url('icons/filetype/folder.svg');
60
+ --jp-icon-history: url('icons/history.svg');
60
61
  --jp-icon-home: url('icons/filetype/home.svg');
61
62
  --jp-icon-html5: url('icons/filetype/html5.svg');
62
63
  --jp-icon-image: url('icons/filetype/image.svg');
@@ -74,6 +75,7 @@
74
75
  --jp-icon-line-form: url('icons/statusbar/line-form.svg');
75
76
  --jp-icon-link: url('icons/toolbar/link.svg');
76
77
  --jp-icon-list: url('icons/statusbar/list.svg');
78
+ --jp-icon-lock: url('icons/lock.svg');
77
79
  --jp-icon-markdown: url('icons/filetype/markdown.svg');
78
80
  --jp-icon-mermaid: url('icons/filetype/mermaid.svg');
79
81
  --jp-icon-move-down: url('icons/toolbar/move-down.svg');
@@ -298,6 +300,10 @@
298
300
  background-image: var(--jp-icon-folder);
299
301
  }
300
302
 
303
+ .jp-HistoryIcon {
304
+ background-image: var(--jp-icon-history);
305
+ }
306
+
301
307
  .jp-HomeIcon {
302
308
  background-image: var(--jp-icon-home);
303
309
  }
@@ -366,6 +372,10 @@
366
372
  background-image: var(--jp-icon-list);
367
373
  }
368
374
 
375
+ .jp-LockIcon {
376
+ background-image: var(--jp-icon-lock);
377
+ }
378
+
369
379
  .jp-MarkdownIcon {
370
380
  background-image: var(--jp-icon-markdown);
371
381
  }
@@ -1,6 +1,5 @@
1
1
  /*-----------------------------------------------------------------------------
2
- | Copyright (c) 2014-2016, Jupyter Development Team.
3
- |
2
+ | Copyright (c) Jupyter Development Team.
4
3
  | Distributed under the terms of the Modified BSD License.
5
4
  |----------------------------------------------------------------------------*/
6
5
 
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">
2
+ <g class="jp-icon3" fill="#616161"><path d="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3" /></g>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 23">
2
+ <path class="jp-icon4" fill="#333333" d="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z" />
3
+ </svg>
@@ -12,9 +12,9 @@
12
12
 
13
13
  /* stylelint-disable selector-max-type */
14
14
 
15
- .jp-FormGroup-content fieldset .jp-inputFieldWrapper input,
16
- .jp-FormGroup-content fieldset .jp-inputFieldWrapper select,
17
- .jp-FormGroup-content fieldset .jp-inputFieldWrapper textarea {
15
+ .jp-FormGroup-content fieldset .jp-inputFieldWrapper > input,
16
+ .jp-FormGroup-content fieldset .jp-inputFieldWrapper > select,
17
+ .jp-FormGroup-content fieldset .jp-inputFieldWrapper > textarea {
18
18
  font-size: var(--jp-content-font-size2);
19
19
  border-color: var(--jp-input-border-color);
20
20
  border-style: solid;
@@ -26,6 +26,10 @@
26
26
  height: inherit;
27
27
  }
28
28
 
29
+ .jp-FormGroup-content .jp-inputFieldWrapper > select > option {
30
+ background-color: var(--jp-layout-color1);
31
+ }
32
+
29
33
  .jp-FormGroup-content fieldset input[type='checkbox'] {
30
34
  position: relative;
31
35
  top: 2px;
package/style/spinner.css CHANGED
@@ -1,6 +1,5 @@
1
1
  /*-----------------------------------------------------------------------------
2
- | Copyright (c) 2017, Jupyter Development Team.
3
- |
2
+ | Copyright (c) Jupyter Development Team.
4
3
  | Distributed under the terms of the Modified BSD License.
5
4
  |----------------------------------------------------------------------------*/
6
5
 
package/style/styling.css CHANGED
@@ -1,6 +1,5 @@
1
1
  /*-----------------------------------------------------------------------------
2
- | Copyright (c) 2014-2017, Jupyter Development Team.
3
- |
2
+ | Copyright (c) Jupyter Development Team.
4
3
  | Distributed under the terms of the Modified BSD License.
5
4
  |----------------------------------------------------------------------------*/
6
5
 
@@ -0,0 +1,107 @@
1
+ /*-----------------------------------------------------------------------------
2
+ | Copyright (c) Jupyter Development Team.
3
+ | Distributed under the terms of the Modified BSD License.
4
+ |----------------------------------------------------------------------------*/
5
+
6
+ .jp-sortable-table {
7
+ color: var(--jp-ui-font-color1);
8
+ background: var(--jp-layout-color1);
9
+ font-size: var(--jp-ui-font-size1);
10
+ border-spacing: 0;
11
+
12
+ /* required to preserve borders of `<th>` when using position:sticky */
13
+ border-collapse: separate;
14
+ width: 100%;
15
+ overflow-wrap: break-word;
16
+ }
17
+
18
+ .jp-sortable-table > thead {
19
+ box-shadow: var(--jp-toolbar-box-shadow);
20
+
21
+ /* move to a new stacking context to exclude from `mix-blend-mode` */
22
+ z-index: 1;
23
+ }
24
+
25
+ .jp-sortable-table > tbody {
26
+ overflow-y: auto;
27
+ overflow-x: hidden;
28
+ }
29
+
30
+ .jp-sortable-table-tr > th,
31
+ .jp-sortable-table-tr > td {
32
+ position: relative;
33
+ padding: 4px 12px 2px;
34
+ height: 18px;
35
+ }
36
+
37
+ .jp-sortable-table-tr > td::before,
38
+ .jp-sortable-table-tr > th::before {
39
+ border-left: var(--jp-border-width) solid var(--jp-border-color3);
40
+
41
+ /* border is implemented via pseudo-element to enable selective blending */
42
+ content: '';
43
+ display: block;
44
+ position: absolute;
45
+ top: 0;
46
+ bottom: 0;
47
+ left: 0;
48
+
49
+ /* this serves to boost border color when background changes on hover */
50
+ mix-blend-mode: multiply;
51
+ }
52
+
53
+ .jp-sortable-table-tr > th {
54
+ font-weight: 500;
55
+ text-align: left;
56
+ border-width: var(--jp-border-width) 0;
57
+ margin-top: calc(var(--jp-border-width) * -1);
58
+ border-style: solid;
59
+ border-color: var(--jp-border-color1);
60
+ background: var(--jp-layout-color1);
61
+ position: sticky;
62
+ top: 0;
63
+ z-index: 2;
64
+ white-space: nowrap;
65
+ user-select: none;
66
+ }
67
+
68
+ .jp-sortable-table-tr > th:not(:first-child) {
69
+ border-left-color: var(--jp-border-color2);
70
+ }
71
+
72
+ .jp-sortable-table-tr > th:hover {
73
+ background: var(--jp-layout-color2);
74
+ }
75
+
76
+ .jp-sortable-table-tr:hover {
77
+ background: var(--jp-layout-color2);
78
+ }
79
+
80
+ .jp-sortable-table-th-wrapper {
81
+ flex-direction: row;
82
+ display: flex;
83
+ }
84
+
85
+ .jp-sortable-table-th-wrapper > label {
86
+ flex: 1;
87
+ text-overflow: ellipsis;
88
+ }
89
+
90
+ .jp-sort-icon {
91
+ flex: 0;
92
+ height: var(--jp-ui-font-size1);
93
+ width: var(--jp-ui-font-size1);
94
+ }
95
+
96
+ .jp-sort-icon > svg {
97
+ display: inline;
98
+ height: auto;
99
+ }
100
+
101
+ .jp-sortable-table-tr > th:not(.jp-sorted-header) .jp-sort-icon {
102
+ opacity: 0;
103
+ }
104
+
105
+ .jp-sortable-table-tr > th:not(.jp-sorted-header):hover .jp-sort-icon {
106
+ opacity: 0.5;
107
+ }
package/style/toolbar.css CHANGED
@@ -1,6 +1,5 @@
1
1
  /*-----------------------------------------------------------------------------
2
- | Copyright (c) 2014-2016, Jupyter Development Team.
3
- |
2
+ | Copyright (c) Jupyter Development Team.
4
3
  | Distributed under the terms of the Modified BSD License.
5
4
  |----------------------------------------------------------------------------*/
6
5
 
@@ -64,7 +63,8 @@ div.jp-ToolbarButton {
64
63
  margin: 0;
65
64
  }
66
65
 
67
- button.jp-ToolbarButtonComponent {
66
+ button.jp-ToolbarButtonComponent,
67
+ .jp-ToolbarLabelComponent {
68
68
  background: var(--jp-layout-color1);
69
69
  border: none;
70
70
  box-sizing: border-box;
@@ -101,6 +101,13 @@ button.jp-ToolbarButtonComponent .jp-ToolbarButtonComponent-label {
101
101
  font-family: var(--jp-ui-font-family);
102
102
  }
103
103
 
104
+ .jp-ToolbarLabelComponent {
105
+ background-color: var(--jp-brand-color1);
106
+ color: var(--jp-ui-inverse-font-color1);
107
+ font-size: var(--jp-ui-font-size0);
108
+ user-select: none;
109
+ }
110
+
104
111
  #jp-main-dock-panel[data-mode='single-document']
105
112
  .jp-MainAreaWidget
106
113
  > .jp-Toolbar.jp-Toolbar-micro {