Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/docs-main.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import { RouterProvider, createRouter } from '@tanstack/react-router'
import { routeTree } from './docs/routeTree.gen'
import { RouterProvider, createRouter } from '@tanstack/react-router';
import { routeTree } from './docs/routeTree.gen';

const basepath = import.meta.env.MODE === 'github-pages' ? '/sci-comp-ui' : '';

const basepath =
import.meta.env.MODE === 'github-pages' ? '/sci-comp-ui' : ''


const router = createRouter({ routeTree, basepath })
const router = createRouter({ routeTree, basepath });

declare module '@tanstack/react-router' {
interface Register {
router: typeof router
}
interface Register {
router: typeof router;
}
}

import './styles/globals.css'
import './styles/index.css';
import './styles/theme.css';

export default function DocsApp() {
return <RouterProvider router={router} />
return <RouterProvider router={router} />;
}
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './styles/globals.css'

export * from './ui'
export { cn } from './lib/utils'
import './styles/index.css';
import './styles/theme.css';

export * from './ui';
export { cn } from './lib/utils';
44 changes: 22 additions & 22 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { StrictMode } from 'react'
import ReactDOM from 'react-dom/client'
import { StrictMode } from 'react';
import ReactDOM from 'react-dom/client';

// Only import router-related code when building docs
const isDocs = import.meta.env.MODE === 'docs' || import.meta.env.MODE === 'github-pages'
const isDocs = import.meta.env.MODE === 'docs' || import.meta.env.MODE === 'github-pages';

if (isDocs) {
// Docs build - include router
import('./docs-main').then(({ default: DocsApp }) => {
const rootElement = document.getElementById('root')!
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement)
root.render(
<StrictMode>
<DocsApp />
</StrictMode>,
)
}
})
// Docs build - include router
import('./docs-main').then(({ default: DocsApp }) => {
const rootElement = document.getElementById('root')!;
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<StrictMode>
<DocsApp />
</StrictMode>
);
}
});
} else {
// Library build - simple entry point
import('./styles/globals.css')
// For library builds, we just need to ensure styles are loaded
// The actual components are exported from src/index.ts
console.log('SciComp UI Library loaded')
}
// Library build - simple entry point
import('./styles/theme.css');

// For library builds, we just need to ensure styles are loaded
// The actual components are exported from src/index.ts
console.log('SciComp UI Library loaded');
}
138 changes: 0 additions & 138 deletions src/styles/globals.css

This file was deleted.

Loading