@jupyterlab/ui-components 4.0.0-alpha.34 → 4.0.0-alpha.36
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.
- package/lib/components/collapser.js +26 -10
- package/lib/components/collapser.js.map +1 -1
- package/lib/components/form.js +1 -1
- package/lib/components/form.js.map +1 -1
- package/lib/components/menu.d.ts +0 -7
- package/lib/components/menu.js +0 -9
- package/lib/components/menu.js.map +1 -1
- package/lib/components/vdom.d.ts +1 -1
- package/lib/components/windowedlist.d.ts +1 -1
- package/lib/components/windowedlist.js +3 -2
- package/lib/components/windowedlist.js.map +1 -1
- package/lib/hoverbox.d.ts +1 -1
- package/lib/icon/iconimports.d.ts +2 -0
- package/lib/icon/iconimports.js +4 -0
- package/lib/icon/iconimports.js.map +1 -1
- package/lib/icon/labicon.js +49 -48
- package/lib/icon/labicon.js.map +1 -1
- package/lib/icon/widgets/tabbarsvg.js +2 -1
- package/lib/icon/widgets/tabbarsvg.js.map +1 -1
- package/lib/style/icon.d.ts +0 -8
- package/lib/style/icon.js +1 -9
- package/lib/style/icon.js.map +1 -1
- package/package.json +20 -19
- package/src/FormRendererRegistry.tsx +60 -0
- package/src/components/accordiontoolbar.ts +252 -0
- package/src/components/button.tsx +45 -0
- package/src/components/collapser.ts +201 -0
- package/src/components/form.tsx +678 -0
- package/src/components/htmlselect.tsx +99 -0
- package/src/components/iframe.ts +153 -0
- package/src/components/index.ts +20 -0
- package/src/components/inputgroup.tsx +51 -0
- package/src/components/interface.ts +9 -0
- package/src/components/menu.ts +432 -0
- package/src/components/panelwithtoolbar.ts +41 -0
- package/src/components/search.tsx +216 -0
- package/src/components/sidepanel.ts +168 -0
- package/src/components/spinner.ts +31 -0
- package/src/components/styling.ts +114 -0
- package/src/components/switch.ts +103 -0
- package/src/components/toolbar.tsx +1119 -0
- package/src/components/vdom.ts +324 -0
- package/src/components/windowedlist.ts +1422 -0
- package/src/hoverbox.ts +401 -0
- package/src/icon/iconimports.ts +210 -0
- package/src/icon/index.ts +6 -0
- package/src/icon/labicon.tsx +955 -0
- package/src/icon/widgets/commandpalettesvg.ts +78 -0
- package/src/icon/widgets/index.ts +6 -0
- package/src/icon/widgets/menusvg.ts +218 -0
- package/src/icon/widgets/tabbarsvg.ts +122 -0
- package/src/index.ts +13 -0
- package/src/style/icon.ts +554 -0
- package/src/style/index.ts +4 -0
- package/src/svg.d.ts +58 -0
- package/src/tokens.ts +68 -0
- package/src/utils.ts +90 -0
- package/style/collapse.css +20 -6
- package/style/deprecated.css +10 -0
- package/style/icons/search/filter-dot.svg +8 -0
- package/style/icons/search/filter.svg +5 -0
- package/style/icons.css +4 -0
- package/style/rjsfTemplates.css +18 -13
package/src/utils.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
|
|
4
|
+
import { Text } from '@jupyterlab/coreutils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Inner works of class combining functions
|
|
8
|
+
*/
|
|
9
|
+
function _classes(
|
|
10
|
+
classes: (string | false | undefined | null | { [className: string]: any })[]
|
|
11
|
+
): string[] {
|
|
12
|
+
return classes
|
|
13
|
+
.map(c =>
|
|
14
|
+
c && typeof c === 'object'
|
|
15
|
+
? Object.keys(c).map(key => !!c[key] && key)
|
|
16
|
+
: typeof c === 'string'
|
|
17
|
+
? c.split(/\s+/)
|
|
18
|
+
: []
|
|
19
|
+
)
|
|
20
|
+
.reduce((flattened, c) => flattened.concat(c), [] as string[])
|
|
21
|
+
.filter(c => !!c) as string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Combines classNames.
|
|
26
|
+
*
|
|
27
|
+
* @param classes - A list of classNames
|
|
28
|
+
*
|
|
29
|
+
* @returns A single string with the combined className
|
|
30
|
+
*/
|
|
31
|
+
export function classes(
|
|
32
|
+
...classes: (
|
|
33
|
+
| string
|
|
34
|
+
| false
|
|
35
|
+
| undefined
|
|
36
|
+
| null
|
|
37
|
+
| { [className: string]: any }
|
|
38
|
+
)[]
|
|
39
|
+
): string {
|
|
40
|
+
return _classes(classes).join(' ');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Combines classNames. Removes all duplicates
|
|
45
|
+
*
|
|
46
|
+
* @param classes - A list of classNames
|
|
47
|
+
*
|
|
48
|
+
* @returns A single string with the combined className
|
|
49
|
+
*/
|
|
50
|
+
export function classesDedupe(
|
|
51
|
+
...classes: (
|
|
52
|
+
| string
|
|
53
|
+
| false
|
|
54
|
+
| undefined
|
|
55
|
+
| null
|
|
56
|
+
| { [className: string]: any }
|
|
57
|
+
)[]
|
|
58
|
+
): string {
|
|
59
|
+
return [...new Set(_classes(classes))].join(' ');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Translates the attributes of a DOM element into attributes that can
|
|
64
|
+
* be understood by React. Currently not comprehensive, we will add special
|
|
65
|
+
* cases as they become relevant.
|
|
66
|
+
*
|
|
67
|
+
* @param elem - A DOM element
|
|
68
|
+
*
|
|
69
|
+
* @param ignore - An optional list of attribute names to ignore
|
|
70
|
+
*
|
|
71
|
+
* @returns An object with key:value pairs that are the React-friendly
|
|
72
|
+
* translation of elem's attributes
|
|
73
|
+
*/
|
|
74
|
+
export function getReactAttrs(
|
|
75
|
+
elem: Element,
|
|
76
|
+
{ ignore = [] }: { ignore?: string[] } = {}
|
|
77
|
+
): { [key: string]: string | null } {
|
|
78
|
+
return elem
|
|
79
|
+
.getAttributeNames()
|
|
80
|
+
.reduce<{ [key: string]: string | null }>((d, name) => {
|
|
81
|
+
if (name === 'style' || ignore.includes(name)) {
|
|
82
|
+
void 0;
|
|
83
|
+
} else if (name.startsWith('data')) {
|
|
84
|
+
d[name] = elem.getAttribute(name);
|
|
85
|
+
} else {
|
|
86
|
+
d[Text.camelCase(name)] = elem.getAttribute(name);
|
|
87
|
+
}
|
|
88
|
+
return d;
|
|
89
|
+
}, {});
|
|
90
|
+
}
|
package/style/collapse.css
CHANGED
|
@@ -7,19 +7,33 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
align-items: stretch;
|
|
10
|
-
border-top: 1px solid var(--jp-border-color2);
|
|
11
|
-
border-bottom: 1px solid var(--jp-border-color2);
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
.jp-Collapse-header {
|
|
15
13
|
padding: 1px 12px;
|
|
16
|
-
color: var(--jp-ui-font-color1);
|
|
17
14
|
background-color: var(--jp-layout-color1);
|
|
18
|
-
|
|
15
|
+
border-bottom: solid var(--jp-border-width) var(--jp-border-color2);
|
|
16
|
+
color: var(--jp-ui-font-color1);
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
font-size: var(--jp-ui-font-size0);
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
user-select: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.jp-Collapser-icon {
|
|
27
|
+
height: 16px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.jp-Collapse-header-collapsed .jp-Collapser-icon {
|
|
31
|
+
transform: rotate(-90deg);
|
|
32
|
+
margin: auto 0;
|
|
19
33
|
}
|
|
20
34
|
|
|
21
|
-
.jp-
|
|
22
|
-
|
|
35
|
+
.jp-Collapser-title {
|
|
36
|
+
line-height: 25px;
|
|
23
37
|
}
|
|
24
38
|
|
|
25
39
|
.jp-Collapse-contents {
|
package/style/deprecated.css
CHANGED
|
@@ -50,7 +50,9 @@
|
|
|
50
50
|
--jp-icon-fast-forward: url('icons/toolbar/fast-forward.svg');
|
|
51
51
|
--jp-icon-file-upload: url('icons/toolbar/file-upload.svg');
|
|
52
52
|
--jp-icon-file: url('icons/filetype/file.svg');
|
|
53
|
+
--jp-icon-filter-dot: url('icons/search/filter-dot.svg');
|
|
53
54
|
--jp-icon-filter-list: url('icons/toolbar/filter-list.svg');
|
|
55
|
+
--jp-icon-filter: url('icons/search/filter.svg');
|
|
54
56
|
--jp-icon-folder-favorite: url('icons/filetype/folder-favorite.svg');
|
|
55
57
|
--jp-icon-folder: url('icons/filetype/folder.svg');
|
|
56
58
|
--jp-icon-home: url('icons/filetype/home.svg');
|
|
@@ -265,6 +267,14 @@
|
|
|
265
267
|
background-image: var(--jp-icon-file-upload);
|
|
266
268
|
}
|
|
267
269
|
|
|
270
|
+
.jp-FilterDotIcon {
|
|
271
|
+
background-image: var(--jp-icon-filter-dot);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.jp-FilterIcon {
|
|
275
|
+
background-image: var(--jp-icon-filter);
|
|
276
|
+
}
|
|
277
|
+
|
|
268
278
|
.jp-FilterListIcon {
|
|
269
279
|
background-image: var(--jp-icon-filter-list);
|
|
270
280
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">
|
|
2
|
+
<g class="jp-icon3" fill="#FFF">
|
|
3
|
+
<path d="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z" />
|
|
4
|
+
</g>
|
|
5
|
+
<g class="jp-icon-dot" fill="#FFF">
|
|
6
|
+
<circle cx="18" cy="17" r="3"></circle>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24">
|
|
2
|
+
<g class="jp-icon3" fill="#FFF">
|
|
3
|
+
<path d="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z" />
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
package/style/icons.css
CHANGED
package/style/rjsfTemplates.css
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
.jp-FormGroup-content fieldset {
|
|
7
7
|
border: none;
|
|
8
8
|
padding: 0;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
width: 100%;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
.jp-FormGroup-content fieldset .jp-inputFieldWrapper input,
|
|
@@ -32,10 +34,6 @@
|
|
|
32
34
|
cursor: pointer;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
.jp-FormGroup-content .form-group.small-field:hover {
|
|
36
|
-
background: var(--jp-border-color3);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
37
|
.jp-FormGroup-content .checkbox label {
|
|
40
38
|
cursor: pointer;
|
|
41
39
|
font-size: var(--jp-content-font-size1);
|
|
@@ -50,13 +48,19 @@
|
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
/** copy of `input.jp-mod-styled:focus` style */
|
|
53
|
-
.jp-FormGroup-content fieldset input:focus
|
|
51
|
+
.jp-FormGroup-content fieldset input:focus,
|
|
52
|
+
.jp-FormGroup-content fieldset select:focus {
|
|
54
53
|
-moz-outline-radius: unset;
|
|
55
54
|
outline: var(--jp-border-width) solid var(--md-blue-500);
|
|
56
55
|
outline-offset: -1px;
|
|
57
56
|
box-shadow: inset 0 0 4px var(--md-blue-300);
|
|
58
57
|
}
|
|
59
58
|
|
|
59
|
+
.jp-FormGroup-content fieldset input:hover:not(:focus),
|
|
60
|
+
.jp-FormGroup-content fieldset select:hover:not(:focus) {
|
|
61
|
+
background-color: var(--jp-border-color2);
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
.jp-FormGroup-content .checkbox .field-description {
|
|
61
65
|
/* Disable default description field for checkbox:
|
|
62
66
|
because other widgets do not have description fields,
|
|
@@ -79,6 +83,7 @@
|
|
|
79
83
|
|
|
80
84
|
.jp-FormGroup-content .jp-modifiedIndicator.jp-errorIndicator {
|
|
81
85
|
background-color: var(--jp-error-color0);
|
|
86
|
+
margin-right: 0.5em;
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
/* RJSF ARRAY style */
|
|
@@ -188,7 +193,7 @@ button.jp-ArrayOperationsButton.jp-mod-styled:disabled {
|
|
|
188
193
|
|
|
189
194
|
.jp-FormGroup-contentCompact .form-group {
|
|
190
195
|
display: flex;
|
|
191
|
-
padding:
|
|
196
|
+
padding: 0.5em 0.2em 0.5em 0;
|
|
192
197
|
}
|
|
193
198
|
|
|
194
199
|
.jp-FormGroup-contentCompact
|
|
@@ -196,16 +201,10 @@ button.jp-ArrayOperationsButton.jp-mod-styled:disabled {
|
|
|
196
201
|
.jp-FormGroup-description {
|
|
197
202
|
font-size: var(--jp-ui-font-size1);
|
|
198
203
|
color: var(--jp-ui-font-color2);
|
|
199
|
-
padding-left: 3px;
|
|
200
204
|
}
|
|
201
205
|
|
|
202
206
|
.jp-FormGroup-contentCompact .jp-FormGroup-fieldLabel {
|
|
203
|
-
|
|
204
|
-
font-weight: normal;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.jp-FormGroup-contentCompact .jp-inputFieldWrapper {
|
|
208
|
-
padding-left: 5px;
|
|
207
|
+
padding-bottom: 0.3em;
|
|
209
208
|
}
|
|
210
209
|
|
|
211
210
|
.jp-FormGroup-contentCompact .jp-inputFieldWrapper .form-control {
|
|
@@ -224,3 +223,9 @@ button.jp-ArrayOperationsButton.jp-mod-styled:disabled {
|
|
|
224
223
|
padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
|
|
225
224
|
margin-top: 2px;
|
|
226
225
|
}
|
|
226
|
+
|
|
227
|
+
.jp-FormGroup-contentCompact ul.error-detail {
|
|
228
|
+
margin-block-start: 0.5em;
|
|
229
|
+
margin-block-end: 0.5em;
|
|
230
|
+
padding-inline-start: 1em;
|
|
231
|
+
}
|