@jupyterlab/ui-components 4.0.0-alpha.31 → 4.0.0-alpha.33

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 (53) hide show
  1. package/README.md +4 -4
  2. package/lib/FormRendererRegistry.d.ts +29 -0
  3. package/lib/FormRendererRegistry.js +51 -0
  4. package/lib/FormRendererRegistry.js.map +1 -0
  5. package/lib/components/form.d.ts +107 -0
  6. package/lib/components/form.js +238 -0
  7. package/lib/components/form.js.map +1 -0
  8. package/lib/components/index.d.ts +1 -0
  9. package/lib/components/index.js +1 -0
  10. package/lib/components/index.js.map +1 -1
  11. package/lib/components/menu.js +1 -1
  12. package/lib/components/menu.js.map +1 -1
  13. package/lib/components/styling.d.ts +1 -1
  14. package/lib/components/styling.js +18 -11
  15. package/lib/components/styling.js.map +1 -1
  16. package/lib/components/toolbar.d.ts +3 -3
  17. package/lib/components/toolbar.js +6 -3
  18. package/lib/components/toolbar.js.map +1 -1
  19. package/lib/components/vdom.d.ts +6 -4
  20. package/lib/components/vdom.js +27 -10
  21. package/lib/components/vdom.js.map +1 -1
  22. package/lib/hoverbox.d.ts +8 -0
  23. package/lib/hoverbox.js +39 -22
  24. package/lib/hoverbox.js.map +1 -1
  25. package/lib/icon/iconimports.d.ts +2 -0
  26. package/lib/icon/iconimports.js +4 -0
  27. package/lib/icon/iconimports.js.map +1 -1
  28. package/lib/icon/labicon.js +14 -3
  29. package/lib/icon/labicon.js.map +1 -1
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.js +1 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/style/icon.js +0 -29
  34. package/lib/style/icon.js.map +1 -1
  35. package/lib/tokens.d.ts +45 -0
  36. package/lib/tokens.js +4 -0
  37. package/lib/tokens.js.map +1 -1
  38. package/package.json +12 -17
  39. package/style/base.css +3 -8
  40. package/style/deprecated.css +10 -0
  41. package/style/hoverbox.css +0 -4
  42. package/style/icons/error.svg +4 -0
  43. package/style/icons/search/word.svg +10 -0
  44. package/style/icons.css +12 -9
  45. package/style/rjsfTemplates.css +230 -0
  46. package/style/sidepanel.css +2 -1
  47. package/style/styling.css +13 -2
  48. package/style/switch.css +3 -2
  49. package/style/tabbar.css +1 -0
  50. package/style/toolbar.css +1 -0
  51. package/lib/FormComponentRegistry.d.ts +0 -56
  52. package/lib/FormComponentRegistry.js +0 -44
  53. package/lib/FormComponentRegistry.js.map +0 -1
@@ -0,0 +1,230 @@
1
+ /*-----------------------------------------------------------------------------
2
+ | Copyright (c) Jupyter Development Team.
3
+ | Distributed under the terms of the Modified BSD License.
4
+ |----------------------------------------------------------------------------*/
5
+
6
+ form.rjsf button[type='submit'] {
7
+ display: none;
8
+ }
9
+
10
+ .jp-FormGroup-content fieldset {
11
+ border: none;
12
+ padding: 0;
13
+ }
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 {
18
+ font-size: var(--jp-content-font-size2);
19
+ border-color: var(--jp-input-border-color);
20
+ border-style: solid;
21
+ border-radius: var(--jp-border-radius);
22
+ border-width: 1px;
23
+ padding: 6px 8px;
24
+ background: none;
25
+ color: var(--jp-ui-font-color0);
26
+ height: inherit;
27
+ }
28
+
29
+ .jp-FormGroup-content fieldset input[type='checkbox'] {
30
+ position: relative;
31
+ top: 2px;
32
+ margin-left: 0;
33
+ }
34
+
35
+ .jp-FormGroup-content button.jp-mod-styled {
36
+ cursor: pointer;
37
+ }
38
+
39
+ .jp-FormGroup-content .form-group.small-field:hover {
40
+ background: var(--jp-border-color3);
41
+ }
42
+
43
+ .jp-FormGroup-content .checkbox label {
44
+ cursor: pointer;
45
+ font-size: var(--jp-content-font-size1);
46
+ }
47
+
48
+ .jp-FormGroup-content .jp-root > fieldset > legend {
49
+ display: none;
50
+ }
51
+
52
+ .jp-FormGroup-content .jp-root > fieldset > p {
53
+ display: none;
54
+ }
55
+
56
+ /** copy of `input.jp-mod-styled:focus` style */
57
+ .jp-FormGroup-content fieldset input:focus {
58
+ -moz-outline-radius: unset;
59
+ outline: var(--jp-border-width) solid var(--md-blue-500);
60
+ outline-offset: -1px;
61
+ box-shadow: inset 0 0 4px var(--md-blue-300);
62
+ }
63
+
64
+ .jp-FormGroup-content .checkbox .field-description {
65
+ /* Disable default description field for checkbox:
66
+ because other widgets do not have description fields,
67
+ we add descriptions to each widget on the field level.
68
+ */
69
+ display: none;
70
+ }
71
+
72
+ .jp-FormGroup-content #root__description {
73
+ display: none;
74
+ }
75
+
76
+ .jp-FormGroup-content .jp-modifiedIndicator {
77
+ width: 5px;
78
+ background-color: var(--jp-brand-color2);
79
+ margin-top: 0;
80
+ margin-left: calc(var(--jp-private-settingeditor-modifier-indent) * -1);
81
+ flex-shrink: 0;
82
+ }
83
+
84
+ .jp-FormGroup-content .jp-modifiedIndicator.jp-errorIndicator {
85
+ background-color: var(--jp-error-color0);
86
+ }
87
+
88
+ /* RJSF ARRAY style */
89
+
90
+ .jp-arrayFieldWrapper legend {
91
+ font-size: var(--jp-content-font-size2);
92
+ color: var(--jp-ui-font-color0);
93
+ flex-basis: 100%;
94
+ padding: 4px 0;
95
+ font-weight: var(--jp-content-heading-font-weight);
96
+ border-bottom: 1px solid var(--jp-border-color2);
97
+ }
98
+
99
+ .jp-arrayFieldWrapper .field-description {
100
+ padding: 4px 0;
101
+ white-space: pre-wrap;
102
+ }
103
+
104
+ .jp-arrayFieldWrapper .array-item {
105
+ width: 100%;
106
+ border: 1px solid var(--jp-border-color2);
107
+ border-radius: 4px;
108
+ margin: 4px;
109
+ }
110
+
111
+ .jp-ArrayOperations {
112
+ display: flex;
113
+ margin-left: 8px;
114
+ }
115
+
116
+ .jp-ArrayOperationsButton {
117
+ margin: 2px;
118
+ }
119
+
120
+ .jp-ArrayOperationsButton .jp-icon3[fill] {
121
+ fill: var(--jp-ui-font-color0);
122
+ }
123
+
124
+ button.jp-ArrayOperationsButton.jp-mod-styled:disabled {
125
+ cursor: not-allowed;
126
+ opacity: 0.5;
127
+ }
128
+
129
+ /* RJSF form validation error */
130
+
131
+ .jp-FormGroup-content .validationErrors {
132
+ color: var(--jp-error-color0);
133
+ }
134
+
135
+ /* Hide panel level error as duplicated the field level error */
136
+ .jp-FormGroup-content .panel.errors {
137
+ display: none;
138
+ }
139
+
140
+ /* RJSF normal content (settings-editor) */
141
+
142
+ .jp-FormGroup-contentNormal {
143
+ display: flex;
144
+ align-items: center;
145
+ flex-wrap: wrap;
146
+ }
147
+
148
+ .jp-FormGroup-contentNormal .jp-FormGroup-contentItem {
149
+ margin-left: 7px;
150
+ color: var(--jp-ui-font-color0);
151
+ }
152
+
153
+ .jp-FormGroup-contentNormal .jp-FormGroup-description {
154
+ flex-basis: 100%;
155
+ padding: 4px 7px;
156
+ }
157
+
158
+ .jp-FormGroup-contentNormal .jp-FormGroup-default {
159
+ flex-basis: 100%;
160
+ padding: 4px 7px;
161
+ }
162
+
163
+ .jp-FormGroup-contentNormal .jp-FormGroup-fieldLabel {
164
+ font-size: var(--jp-content-font-size1);
165
+ font-weight: normal;
166
+ min-width: 120px;
167
+ }
168
+
169
+ .jp-FormGroup-contentNormal fieldset:not(:first-child) {
170
+ margin-left: 7px;
171
+ }
172
+
173
+ .jp-FormGroup-contentNormal .field-array-of-string .array-item {
174
+ /* Display `jp-ArrayOperations` buttons side-by-side with content except
175
+ for small screens where flex-wrap will place them one below the other.
176
+ */
177
+ display: flex;
178
+ align-items: center;
179
+ flex-wrap: wrap;
180
+ }
181
+
182
+ .jp-FormGroup-contentNormal .jp-objectFieldWrapper .form-group {
183
+ padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
184
+ margin-top: 2px;
185
+ }
186
+
187
+ /* RJSF compact content (metadata-form) */
188
+
189
+ .jp-FormGroup-content.jp-FormGroup-contentCompact {
190
+ width: 100%;
191
+ }
192
+
193
+ .jp-FormGroup-contentCompact .form-group {
194
+ display: flex;
195
+ padding: 4px 8px 4px 0;
196
+ }
197
+
198
+ .jp-FormGroup-contentCompact
199
+ .jp-FormGroup-compactTitle
200
+ .jp-FormGroup-description {
201
+ font-size: var(--jp-ui-font-size1);
202
+ color: var(--jp-ui-font-color2);
203
+ padding-left: 3px;
204
+ }
205
+
206
+ .jp-FormGroup-contentCompact .jp-FormGroup-fieldLabel {
207
+ font-size: var(--jp-ui-font-size2);
208
+ font-weight: normal;
209
+ }
210
+
211
+ .jp-FormGroup-contentCompact .jp-inputFieldWrapper {
212
+ padding-left: 5px;
213
+ }
214
+
215
+ .jp-FormGroup-contentCompact .jp-inputFieldWrapper .form-control {
216
+ width: 100%;
217
+ box-sizing: border-box;
218
+ }
219
+
220
+ .jp-FormGroup-contentCompact .jp-arrayFieldWrapper .jp-FormGroup-compactTitle {
221
+ padding-bottom: 7px;
222
+ }
223
+
224
+ .jp-FormGroup-contentCompact
225
+ .jp-objectFieldWrapper
226
+ .jp-objectFieldWrapper
227
+ .form-group {
228
+ padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
229
+ margin-top: 2px;
230
+ }
@@ -48,7 +48,8 @@
48
48
  margin: 0;
49
49
  display: flex;
50
50
  align-items: center;
51
- background: var(--jp-toolbar-background);
51
+ background: var(--jp-layout-color1);
52
+ color: var(--jp-ui-font-color1);
52
53
  border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
53
54
  box-shadow: var(--jp-toolbar-box-shadow);
54
55
  font-size: var(--jp-ui-font-size0);
package/style/styling.css CHANGED
@@ -53,11 +53,14 @@ input.jp-mod-styled:focus {
53
53
  flex-direction: column;
54
54
  padding: 1px;
55
55
  background-color: var(--jp-layout-color1);
56
- height: 28px;
57
56
  box-sizing: border-box;
58
57
  margin-bottom: 12px;
59
58
  }
60
59
 
60
+ .jp-select-wrapper:not(.multiple) {
61
+ height: 28px;
62
+ }
63
+
61
64
  .jp-select-wrapper.jp-mod-focused select.jp-mod-styled {
62
65
  border: var(--jp-border-width) solid var(--jp-input-active-border-color);
63
66
  box-shadow: var(--jp-input-box-shadow);
@@ -73,7 +76,6 @@ select.jp-mod-styled:hover {
73
76
 
74
77
  select.jp-mod-styled {
75
78
  flex: 1 1 auto;
76
- height: 32px;
77
79
  width: 100%;
78
80
  font-size: var(--jp-ui-font-size2);
79
81
  background: var(--jp-input-background);
@@ -86,3 +88,12 @@ select.jp-mod-styled {
86
88
  -webkit-appearance: none;
87
89
  -moz-appearance: none;
88
90
  }
91
+
92
+ select.jp-mod-styled:not([multiple]) {
93
+ height: 32px;
94
+ }
95
+
96
+ select.jp-mod-styled[multiple] {
97
+ max-height: 200px;
98
+ overflow-y: auto;
99
+ }
package/style/switch.css CHANGED
@@ -21,11 +21,12 @@
21
21
 
22
22
  .jp-switch-label {
23
23
  margin-right: 5px;
24
+ font-family: var(--jp-ui-font-family);
24
25
  }
25
26
 
26
27
  .jp-switch-track {
27
28
  cursor: pointer;
28
- background-color: var(--jp-switch-color);
29
+ background-color: var(--jp-switch-color, var(--jp-border-color1));
29
30
  -webkit-transition: 0.4s;
30
31
  transition: 0.4s;
31
32
  border-radius: 34px;
@@ -48,7 +49,7 @@
48
49
  }
49
50
 
50
51
  .jp-switch[aria-checked='true'] .jp-switch-track {
51
- background-color: var(--jp-switch-true-position-color);
52
+ background-color: var(--jp-switch-true-position-color, var(--jp-warn-color0));
52
53
  }
53
54
 
54
55
  .jp-switch[aria-checked='true'] .jp-switch-track::before {
package/style/tabbar.css CHANGED
@@ -7,6 +7,7 @@
7
7
  align-items: center;
8
8
  display: flex;
9
9
  padding: 4px;
10
+ padding-bottom: 5px;
10
11
  margin-right: 1px;
11
12
  background-color: var(--jp-layout-color2);
12
13
  }
package/style/toolbar.css CHANGED
@@ -98,6 +98,7 @@ button.jp-ToolbarButtonComponent .jp-ToolbarButtonComponent-label {
98
98
  line-height: 100%;
99
99
  padding-left: 2px;
100
100
  color: var(--jp-ui-font-color1);
101
+ font-family: var(--jp-ui-font-family);
101
102
  }
102
103
 
103
104
  #jp-main-dock-panel[data-mode='single-document']
@@ -1,56 +0,0 @@
1
- import { Token } from '@lumino/coreutils';
2
- import type { Field } from '@rjsf/core';
3
- /**
4
- * A registry for rendering fields used in the FormEditor component.
5
- */
6
- export declare class FormComponentRegistry implements IFormComponentRegistry {
7
- /**
8
- * Adds a renderer for a given id - if the id is already in use, returns false.
9
- * Otherwise, returns true.
10
- * @param id - Unique ID for the given renderer.
11
- * @param renderer - A function that takes props and returns a rendered component
12
- * @returns - Whether the renderer was added successfully. False if the id is already in use.
13
- */
14
- addRenderer(id: string, renderer: Field): boolean;
15
- /**
16
- * Returns all registered renderers in dictionary form.
17
- * @returns - A dictionary that maps an id to a renderer.
18
- */
19
- get renderers(): {
20
- [id: string]: Field;
21
- };
22
- /**
23
- * Returns the renderer for the given id
24
- * @param id - The unique id for the renderer.
25
- * @returns - A function that takes props and returns a rendered component.
26
- */
27
- getRenderer(id: string): Field;
28
- private _renderers;
29
- }
30
- /**
31
- * A registry for rendering fields used in the FormEditor component.
32
- */
33
- export interface IFormComponentRegistry {
34
- /**
35
- * Adds a renderer for a given id - if the id is already in use, returns false.
36
- * Otherwise, returns true.
37
- * @param id - Unique ID for the given renderer.
38
- * @param renderer - A function that takes props and returns a rendered component
39
- * @returns - Whether the renderer was added successfully. False if the id is already in use.
40
- */
41
- addRenderer: (id: string, renderer: Field) => void;
42
- /**
43
- * Returns the renderer for the given id
44
- * @param id - The unique id for the renderer.
45
- * @returns - A function that takes props and returns a rendered component.
46
- */
47
- getRenderer: (id: string) => Field;
48
- /**
49
- * Returns all registered renderers in dictionary form.
50
- * @returns - A dictionary that maps an id to a renderer.
51
- */
52
- renderers: {
53
- [id: string]: Field;
54
- };
55
- }
56
- export declare const IFormComponentRegistry: Token<IFormComponentRegistry>;
@@ -1,44 +0,0 @@
1
- /* -----------------------------------------------------------------------------
2
- | Copyright (c) Jupyter Development Team.
3
- | Distributed under the terms of the Modified BSD License.
4
- |----------------------------------------------------------------------------*/
5
- import { Token } from '@lumino/coreutils';
6
- /**
7
- * A registry for rendering fields used in the FormEditor component.
8
- */
9
- export class FormComponentRegistry {
10
- constructor() {
11
- this._renderers = {};
12
- }
13
- /**
14
- * Adds a renderer for a given id - if the id is already in use, returns false.
15
- * Otherwise, returns true.
16
- * @param id - Unique ID for the given renderer.
17
- * @param renderer - A function that takes props and returns a rendered component
18
- * @returns - Whether the renderer was added successfully. False if the id is already in use.
19
- */
20
- addRenderer(id, renderer) {
21
- if (this._renderers[id]) {
22
- return false;
23
- }
24
- this._renderers[id] = renderer;
25
- return true;
26
- }
27
- /**
28
- * Returns all registered renderers in dictionary form.
29
- * @returns - A dictionary that maps an id to a renderer.
30
- */
31
- get renderers() {
32
- return this._renderers;
33
- }
34
- /**
35
- * Returns the renderer for the given id
36
- * @param id - The unique id for the renderer.
37
- * @returns - A function that takes props and returns a rendered component.
38
- */
39
- getRenderer(id) {
40
- return this._renderers[id];
41
- }
42
- }
43
- export const IFormComponentRegistry = new Token('@jupyterlab/ui-components:ISettingEditorRegistry');
44
- //# sourceMappingURL=FormComponentRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormComponentRegistry.js","sourceRoot":"","sources":["../src/FormComponentRegistry.tsx"],"names":[],"mappings":"AAAA;;;+EAG+E;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAAlC;QAiCU,eAAU,GAA4B,EAAE,CAAC;IACnD,CAAC;IAjCC;;;;;;OAMG;IACH,WAAW,CAAC,EAAU,EAAE,QAAe;QACrC,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,EAAU;QACpB,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CAGF;AA6BD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,KAAK,CAC7C,kDAAkD,CACnD,CAAC"}