@malloy-publisher/sdk 0.0.53 → 0.0.54

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.53",
4
+ "version": "0.0.54",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -1,24 +1,25 @@
1
1
  import { Add, Launch } from "@mui/icons-material";
2
2
  import {
3
3
  Button,
4
- Menu,
5
- MenuItem,
6
- ListItemIcon,
7
- ListItemText,
8
- Typography,
9
4
  Dialog,
10
- DialogTitle,
11
5
  DialogContent,
6
+ DialogTitle,
12
7
  FormControl,
8
+ ListItemIcon,
9
+ ListItemText,
10
+ Menu,
11
+ MenuItem,
12
+ Stack,
13
13
  TextField,
14
+ Typography,
14
15
  } from "@mui/material";
16
+ import React from "react";
17
+ import { useRouterClickHandler } from "./click_helper";
15
18
  import {
16
- NotebookStorageProvider,
17
19
  BrowserNotebookStorage,
18
20
  MutableNotebookList,
21
+ NotebookStorageProvider,
19
22
  } from "./MutableNotebook";
20
- import React from "react";
21
- import { useRouterClickHandler } from "./click_helper";
22
23
 
23
24
  export interface AnalyzePackageButtonProps {
24
25
  projectName: string;
@@ -75,7 +76,15 @@ export function AnalyzePackageButton({
75
76
  aria-haspopup="true"
76
77
  aria-expanded={open ? "true" : undefined}
77
78
  onClick={handleClick}
78
- sx={{ height: "40px" }}
79
+ variant="contained"
80
+ sx={{
81
+ height: "40px",
82
+ px: 2,
83
+ backgroundColor: "#fbbb04",
84
+ "&:hover": {
85
+ backgroundColor: "#eab308",
86
+ },
87
+ }}
79
88
  >
80
89
  Analyze Package
81
90
  </Button>
@@ -84,10 +93,9 @@ export function AnalyzePackageButton({
84
93
  anchorEl={anchorEl}
85
94
  open={open}
86
95
  onClose={handleMenuClose}
87
- slotProps={{
88
- list: {
89
- "aria-labelledby": "basic-button",
90
- },
96
+ MenuListProps={{
97
+ "aria-labelledby": "basic-button",
98
+ sx: { py: 0.5 },
91
99
  }}
92
100
  >
93
101
  <MenuItem
@@ -95,12 +103,18 @@ export function AnalyzePackageButton({
95
103
  setNewDialogOpen(true);
96
104
  handleMenuClose();
97
105
  }}
106
+ sx={{ py: 1, px: 2 }}
98
107
  >
99
108
  <ListItemIcon>
100
109
  <Add fontSize="small" />
101
110
  </ListItemIcon>
102
111
  <ListItemText>
103
- <Typography variant="body2">New Workbook</Typography>
112
+ <Typography variant="body2" fontWeight={500}>
113
+ New Workbook
114
+ </Typography>
115
+ <Typography variant="caption" color="text.secondary">
116
+ Create a new analysis workbook
117
+ </Typography>
104
118
  </ListItemText>
105
119
  </MenuItem>
106
120
  <MenuItem
@@ -108,67 +122,87 @@ export function AnalyzePackageButton({
108
122
  setOpenDialogOpen(true);
109
123
  handleMenuClose();
110
124
  }}
125
+ sx={{ py: 1, px: 2 }}
111
126
  >
112
127
  <ListItemIcon>
113
128
  <Launch fontSize="small" />
114
129
  </ListItemIcon>
115
130
  <ListItemText>
116
- <Typography variant="body2">Open Workbook</Typography>
131
+ <Typography variant="body2" fontWeight={500}>
132
+ Open Workbook
133
+ </Typography>
134
+ <Typography variant="caption" color="text.secondary">
135
+ Open an existing workbook
136
+ </Typography>
117
137
  </ListItemText>
118
138
  </MenuItem>
119
139
  </Menu>
140
+
141
+ {/* Create New Workbook Dialog */}
120
142
  <Dialog
121
143
  open={newDialogOpen}
122
144
  onClose={handleNewDialogClose}
123
- sx={{
124
- "& .MuiDialog-paper": {
125
- width: "100%",
126
- maxWidth: "300px",
127
- },
128
- }}
145
+ maxWidth="sm"
146
+ fullWidth
129
147
  >
130
- <DialogTitle variant="subtitle1" sx={{ fontWeight: "medium" }}>
131
- Create Workbook
148
+ <DialogTitle sx={{ pb: 1, pt: 2, px: 2 }}>
149
+ <Typography variant="h6" fontWeight={600} sx={{ mb: 0.5 }}>
150
+ Create New Workbook
151
+ </Typography>
152
+ <Typography variant="body2" color="text.secondary">
153
+ Start a new analysis workbook to explore your data
154
+ </Typography>
132
155
  </DialogTitle>
133
- <DialogContent>
134
- <FormControl
135
- sx={{
136
- width: "100%",
137
- display: "flex",
138
- alignItems: "center",
139
- gap: 2,
140
- }}
141
- >
142
- <TextField
143
- label="Workbook Name"
144
- value={workbookName}
145
- onChange={(e) => setWorkbookName(e.target.value)}
146
- sx={{
147
- width: "100%",
148
- maxWidth: "400px",
149
- mt: 1,
150
- }}
151
- />
152
- <Button onClick={(event) => createNotebookClick(event)}>
153
- Create
154
- </Button>
155
- </FormControl>
156
+ <DialogContent sx={{ px: 2, pb: 2 }}>
157
+ <Stack spacing={2} sx={{ mt: 1 }}>
158
+ <FormControl fullWidth>
159
+ <TextField
160
+ label="Workbook Name"
161
+ value={workbookName}
162
+ onChange={(e) => setWorkbookName(e.target.value)}
163
+ placeholder="Enter workbook name..."
164
+ fullWidth
165
+ autoFocus
166
+ size="small"
167
+ />
168
+ </FormControl>
169
+ <Stack direction="row" spacing={1} justifyContent="flex-end">
170
+ <Button
171
+ onClick={handleNewDialogClose}
172
+ variant="outlined"
173
+ size="small"
174
+ >
175
+ Cancel
176
+ </Button>
177
+ <Button
178
+ onClick={(event) => createNotebookClick(event)}
179
+ variant="contained"
180
+ disabled={!workbookName.trim()}
181
+ size="small"
182
+ >
183
+ Create Workbook
184
+ </Button>
185
+ </Stack>
186
+ </Stack>
156
187
  </DialogContent>
157
188
  </Dialog>
189
+
190
+ {/* Open Workbook Dialog */}
158
191
  <Dialog
159
192
  open={openDialogOpen}
160
193
  onClose={handleOpenDialogClose}
161
- sx={{
162
- "& .MuiDialog-paper": {
163
- width: "100%",
164
- maxWidth: "300px",
165
- },
166
- }}
194
+ maxWidth="md"
195
+ fullWidth
167
196
  >
168
- <DialogTitle variant="subtitle1" sx={{ fontWeight: "medium" }}>
169
- Open Workbook
197
+ <DialogTitle sx={{ pb: 1, pt: 2, px: 2 }}>
198
+ <Typography variant="h6" fontWeight={600} sx={{ mb: 0.5 }}>
199
+ Open Workbook
200
+ </Typography>
201
+ <Typography variant="body2" color="text.secondary">
202
+ Select an existing workbook to continue your analysis
203
+ </Typography>
170
204
  </DialogTitle>
171
- <DialogContent>
205
+ <DialogContent sx={{ px: 2, pb: 2 }}>
172
206
  <NotebookStorageProvider
173
207
  notebookStorage={new BrowserNotebookStorage()}
174
208
  userContext={{