@datalayer/core 0.0.9 → 0.0.10

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.
@@ -59,13 +59,9 @@ export class JupyterDialog extends ReactWidget {
59
59
  }) }));
60
60
  _renderFooter = (props) => (_jsx(DialogFooter, { ...props, checkbox: this.checkbox, setChecked: this.setChecked }));
61
61
  render() {
62
- return (_jsx(JupyterReactTheme, { children: _jsx(PrimerDialog, { sx: {
63
- color: 'var(--fgColor-default)',
64
- backgroundColor: 'var(--bgColor-default)',
65
- fontFamily: 'var(--fontStack-system)',
66
- fontSize: 'var(--text-body-size-medium)',
67
- lineHeight: 'var(--text-body-lineHeight-medium)',
68
- }, onClose: this.close, footerButtons: this.buttons.map((but, idx) => {
62
+ // TODO title color is enforced for JupyterLab.
63
+ // This may be fixed in the jupyter-react theme (Primer generates h1 for the dialog title).
64
+ return (_jsx(JupyterReactTheme, { children: _jsx(PrimerDialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: this.dialogTitle }), onClose: this.close, renderBody: this._renderBody, renderFooter: this._renderFooter, footerButtons: this.buttons.map((but, idx) => {
69
65
  const footerButton = {
70
66
  buttonType: but.displayType === 'default'
71
67
  ? but.accept
@@ -80,7 +76,7 @@ export class JupyterDialog extends ReactWidget {
80
76
  autoFocus: but.accept,
81
77
  };
82
78
  return footerButton;
83
- }), renderBody: this._renderBody, renderFooter: this._renderFooter, title: this.dialogTitle }) }));
79
+ }) }) }));
84
80
  }
85
81
  /**
86
82
  * Launch the dialog as a modal window.
@@ -84,7 +84,7 @@ export function RuntimeCellVariablesDialog(props) {
84
84
  title += ` with ${kernelName}`;
85
85
  }
86
86
  }
87
- return (_jsx(Dialog, { title: title, onClose: onClose, footerButtons: [
87
+ return (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: title }), onClose: onClose, footerButtons: [
88
88
  {
89
89
  buttonType: 'default',
90
90
  content: trans.__('Cancel'),
@@ -211,7 +211,9 @@ export function RuntimeLauncherDialog(props) {
211
211
  setHasCustomRuntimeName(true);
212
212
  }
213
213
  }, []);
214
- return (_jsx(Dialog, { title: dialogTitle || 'Launch a new Runtime', onClose: () => {
214
+ // TODO title color is enforced for JupyterLab.
215
+ // This may be fixed in the jupyter-react theme (Primer generates h1 for the dialog title).
216
+ return (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: dialogTitle || 'Launch a new Runtime' }), onClose: () => {
215
217
  onSubmit(undefined);
216
218
  }, footerButtons: [
217
219
  {
@@ -116,7 +116,7 @@ export function RuntimeSnapshotMenu(props) {
116
116
  setTakingSnapshot(false);
117
117
  }
118
118
  }, [connection, podName, multiServiceManager]);
119
- return (_jsxs(_Fragment, { children: [_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { leadingVisual: CameraIcon, variant: "invisible", size: "small", disabled: loadingKernelSnapshot || takingKernelSnapshot || disabled, children: children }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { onSelect: onLoadKernelSnapshot, disabled: loadingKernelSnapshot || runtimeSnapshots.length === 0, children: "Load a runtime snapshot\u2026" }), _jsx(ActionList.Item, { onSelect: onTakeKernelSnapshot, disabled: takingKernelSnapshot, children: "Take a runtime snapshot" })] }) })] }), openLoadDialog && (_jsx(Dialog, { title: "Choose a runtime snapshot to load", onClose: () => {
119
+ return (_jsxs(_Fragment, { children: [_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { leadingVisual: CameraIcon, variant: "invisible", size: "small", disabled: loadingKernelSnapshot || takingKernelSnapshot || disabled, children: children }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { onSelect: onLoadKernelSnapshot, disabled: loadingKernelSnapshot || runtimeSnapshots.length === 0, children: "Load a runtime snapshot\u2026" }), _jsx(ActionList.Item, { onSelect: onTakeKernelSnapshot, disabled: takingKernelSnapshot, children: "Take a runtime snapshot" })] }) })] }), openLoadDialog && (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Choose a runtime snapshot to load" }), onClose: () => {
120
120
  setOpenLoadDialog(false);
121
121
  }, footerButtons: [
122
122
  {
@@ -25,7 +25,7 @@ export function SnippetDialog(props) {
25
25
  model.sharedModel.updateSource(size, size, '\n'.repeat(size ? 2 : 0) + selection.code);
26
26
  onClose();
27
27
  }, [model, selection, onClose]);
28
- return (_jsx(Dialog, { title: 'Pick a snippet to inject', onClose: onClose, footerButtons: [
28
+ return (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Pick a snippet to inject" }), onClose: onClose, footerButtons: [
29
29
  {
30
30
  buttonType: 'default',
31
31
  content: trans.__('Cancel'),
@@ -223,7 +223,7 @@ export function ContentsBrowser(props) {
223
223
  }, onContextMenu: onContextMenu }, child.name));
224
224
  }) }), _jsx(ActionMenu, { anchorRef: contextMenuAnchor ?? undefined, open: contextMenuAnchor?.current !== null, onOpenChange: () => {
225
225
  setContextMenuAnchor(null);
226
- }, children: _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { title: "Delete the active item.", onSelect: onSelectDelete, children: "Delete\u2026" }), localContents && (_jsx(ActionList.Item, { title: "Copy the active item to the local drive.", onSelect: onSelectCopyToLocal, children: "Copy to local drive\u2026" }))] }) }) }), openDeleteConfirmation && (_jsx(Dialog, { title: "Confirm deletion", onClose: () => {
226
+ }, children: _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { title: "Delete the active item.", onSelect: onSelectDelete, children: "Delete\u2026" }), localContents && (_jsx(ActionList.Item, { title: "Copy the active item to the local drive.", onSelect: onSelectCopyToLocal, children: "Copy to local drive\u2026" }))] }) }) }), openDeleteConfirmation && (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Confirm deletion" }), onClose: () => {
227
227
  setOpenDeleteConfirmation(false);
228
228
  }, footerButtons: [
229
229
  {
@@ -240,7 +240,7 @@ export function ContentsBrowser(props) {
240
240
  deleteItem();
241
241
  },
242
242
  },
243
- ], children: `Are you sure you want to delete ${selectedItem?.path}?` })), copyToLocalConfirmation && (_jsx(Dialog, { title: "Confirm copy to local", onClose: () => {
243
+ ], children: `Are you sure you want to delete ${selectedItem?.path}?` })), copyToLocalConfirmation && (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Confirm copy to local" }), onClose: () => {
244
244
  setCopyToLocalConfirmation(false);
245
245
  }, footerButtons: [
246
246
  {
@@ -4,8 +4,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { useState } from 'react';
7
- import { Box, Button, PageLayout } from '@primer/react';
7
+ import { Button, PageLayout } from '@primer/react';
8
8
  import { Dialog } from '@primer/react/experimental';
9
+ import { Box } from '@datalayer/primer-addons';
9
10
  const DataTableDetails = (props) => {
10
11
  return (_jsx(PageLayout, { containerWidth: "full", padding: "normal", sx: { overflow: 'visible' }, children: _jsx(PageLayout.Content, {}) }));
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/core",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",