@tanstack/cta-ui-base 0.20.0 → 0.21.0
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/dist/app.d.ts +10 -1
- package/dist/app.js +9 -2
- package/dist/components/cta-sidebar.d.ts +7 -1
- package/dist/components/cta-sidebar.js +7 -2
- package/package.json +1 -1
- package/src/app.tsx +23 -5
- package/src/components/cta-sidebar.tsx +20 -5
- package/src/components/sidebar-items/run-create-app.tsx +1 -0
- package/src/index.ts +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface RootComponentProps {
|
|
2
|
+
slots?: Partial<{
|
|
3
|
+
header: React.ReactNode;
|
|
4
|
+
sidebar: React.ReactNode;
|
|
5
|
+
fileNavigator: React.ReactNode;
|
|
6
|
+
startupDialog: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultSlots: RootComponentProps['slots'];
|
|
10
|
+
export default function RootComponent(props: RootComponentProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/app.js
CHANGED
|
@@ -5,6 +5,13 @@ import { BackgroundAnimation } from './components/background-animation';
|
|
|
5
5
|
import FileNavigator from './components/file-navigator';
|
|
6
6
|
import StartupDialog from './components/startup-dialog';
|
|
7
7
|
import { CTAProvider } from './components/cta-provider';
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export const defaultSlots = {
|
|
9
|
+
header: _jsx(AppHeader, {}),
|
|
10
|
+
sidebar: _jsx(AppSidebar, {}),
|
|
11
|
+
fileNavigator: _jsx(FileNavigator, {}),
|
|
12
|
+
startupDialog: _jsx(StartupDialog, {}),
|
|
13
|
+
};
|
|
14
|
+
export default function RootComponent(props) {
|
|
15
|
+
const slots = Object.assign({}, defaultSlots, props.slots);
|
|
16
|
+
return (_jsx(CTAProvider, { children: _jsxs("main", { className: "min-w-[1280px]", children: [_jsx(BackgroundAnimation, {}), _jsxs("div", { className: "min-h-dvh p-2 sm:p-4 space-y-2 sm:space-y-4 @container", children: [slots.header, _jsxs("div", { className: "flex flex-row", children: [_jsx("div", { className: "w-1/3 @8xl:w-1/4 pr-2", children: slots.sidebar }), _jsx("div", { className: "w-2/3 @8xl:w-3/4 pl-2", children: slots.fileNavigator })] })] }), slots.startupDialog] }) }));
|
|
10
17
|
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface SidebarProps {
|
|
2
|
+
slots?: {
|
|
3
|
+
actions: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export declare const DefaultAppSidebarActions: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function AppSidebar(props: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,8 +8,13 @@ import ModeSelector from './sidebar-items/mode-selector';
|
|
|
8
8
|
import TypescriptSwitch from './sidebar-items/typescript-switch';
|
|
9
9
|
import StarterDialog from './sidebar-items/starter';
|
|
10
10
|
import SidebarGroup from './sidebar-items/sidebar-group';
|
|
11
|
-
export
|
|
11
|
+
export const DefaultAppSidebarActions = () => (_jsxs("div", { className: "mt-5", children: [_jsx(RunAddOns, {}), _jsx(RunCreateApp, {})] }));
|
|
12
|
+
const defaultSlots = {
|
|
13
|
+
actions: _jsx(DefaultAppSidebarActions, {}),
|
|
14
|
+
};
|
|
15
|
+
export function AppSidebar(props) {
|
|
12
16
|
const ready = useReady();
|
|
13
17
|
const mode = useApplicationMode();
|
|
14
|
-
|
|
18
|
+
const slots = Object.assign({}, defaultSlots, props.slots);
|
|
19
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [ready && (_jsxs(_Fragment, { children: [mode === 'setup' && (_jsxs(SidebarGroup, { children: [_jsx(ProjectName, {}), _jsx(ModeSelector, {}), _jsx(TypescriptSwitch, {})] })), _jsx(SidebarGroup, { children: _jsx(SelectedAddOns, {}) }), mode === 'setup' && (_jsx(SidebarGroup, { children: _jsx(StarterDialog, {}) }))] })), slots.actions] }));
|
|
15
20
|
}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -5,23 +5,41 @@ import FileNavigator from './components/file-navigator'
|
|
|
5
5
|
import StartupDialog from './components/startup-dialog'
|
|
6
6
|
import { CTAProvider } from './components/cta-provider'
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export interface RootComponentProps {
|
|
9
|
+
slots?: Partial<{
|
|
10
|
+
header: React.ReactNode
|
|
11
|
+
sidebar: React.ReactNode
|
|
12
|
+
fileNavigator: React.ReactNode
|
|
13
|
+
startupDialog: React.ReactNode
|
|
14
|
+
}>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const defaultSlots: RootComponentProps['slots'] = {
|
|
18
|
+
header: <AppHeader />,
|
|
19
|
+
sidebar: <AppSidebar />,
|
|
20
|
+
fileNavigator: <FileNavigator />,
|
|
21
|
+
startupDialog: <StartupDialog />,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function RootComponent(props: RootComponentProps) {
|
|
25
|
+
const slots = Object.assign({}, defaultSlots, props.slots)
|
|
26
|
+
|
|
9
27
|
return (
|
|
10
28
|
<CTAProvider>
|
|
11
29
|
<main className="min-w-[1280px]">
|
|
12
30
|
<BackgroundAnimation />
|
|
13
31
|
<div className="min-h-dvh p-2 sm:p-4 space-y-2 sm:space-y-4 @container">
|
|
14
|
-
|
|
32
|
+
{slots.header}
|
|
15
33
|
<div className="flex flex-row">
|
|
16
34
|
<div className="w-1/3 @8xl:w-1/4 pr-2">
|
|
17
|
-
|
|
35
|
+
{slots.sidebar}
|
|
18
36
|
</div>
|
|
19
37
|
<div className="w-2/3 @8xl:w-3/4 pl-2">
|
|
20
|
-
|
|
38
|
+
{slots.fileNavigator}
|
|
21
39
|
</div>
|
|
22
40
|
</div>
|
|
23
41
|
</div>
|
|
24
|
-
|
|
42
|
+
{slots.startupDialog}
|
|
25
43
|
</main>
|
|
26
44
|
</CTAProvider>
|
|
27
45
|
)
|
|
@@ -9,9 +9,27 @@ import TypescriptSwitch from './sidebar-items/typescript-switch'
|
|
|
9
9
|
import StarterDialog from './sidebar-items/starter'
|
|
10
10
|
import SidebarGroup from './sidebar-items/sidebar-group'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export interface SidebarProps {
|
|
13
|
+
slots?: {
|
|
14
|
+
actions: React.ReactNode
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const DefaultAppSidebarActions = () => (
|
|
19
|
+
<div className="mt-5">
|
|
20
|
+
<RunAddOns />
|
|
21
|
+
<RunCreateApp />
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const defaultSlots: SidebarProps['slots'] = {
|
|
26
|
+
actions: <DefaultAppSidebarActions />,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function AppSidebar(props: SidebarProps) {
|
|
13
30
|
const ready = useReady()
|
|
14
31
|
const mode = useApplicationMode()
|
|
32
|
+
const slots = Object.assign({}, defaultSlots, props.slots)
|
|
15
33
|
|
|
16
34
|
return (
|
|
17
35
|
<div className="flex flex-col gap-2">
|
|
@@ -34,10 +52,7 @@ export function AppSidebar() {
|
|
|
34
52
|
)}
|
|
35
53
|
</>
|
|
36
54
|
)}
|
|
37
|
-
|
|
38
|
-
<RunAddOns />
|
|
39
|
-
<RunCreateApp />
|
|
40
|
-
</div>
|
|
55
|
+
{slots.actions}
|
|
41
56
|
</div>
|
|
42
57
|
)
|
|
43
58
|
}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import StatusList from '../status-list'
|
|
21
21
|
import { createAppStreaming, shutdown } from '../../lib/api'
|
|
22
22
|
|
|
23
|
+
|
|
23
24
|
export default function RunCreateApp() {
|
|
24
25
|
const [isRunning, setIsRunning] = useState(false)
|
|
25
26
|
const { streamItems, monitorStream, finished } = useStreamingStatus()
|
package/src/index.ts
CHANGED