-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev-server): add a components page
- Loading branch information
Showing
3 changed files
with
57 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
import { StrictMode } from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import { | ||
createBrowserRouter, | ||
RouterProvider, | ||
} from "react-router-dom"; | ||
import { Index } from './dev-server/index'; | ||
import './dev-server.css' | ||
import '@inkdropapp/css/reset.css' | ||
import '@inkdropapp/css/tokens.css' | ||
import '@inkdropapp/base-ui-theme/styles/theme.css' | ||
import { ColorTokensPage } from './dev-server/color-tokens'; | ||
import { VariablesPage } from './dev-server/variables'; | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
import { Index } from "./dev-server/index"; | ||
import "./dev-server.css"; | ||
import "@inkdropapp/css/reset.css"; | ||
import "@inkdropapp/css/tokens.css"; | ||
import "@inkdropapp/base-ui-theme/styles/theme.css"; | ||
import { ColorTokensPage } from "./dev-server/color-tokens"; | ||
import { VariablesPage } from "./dev-server/variables"; | ||
import { ComponentsPage } from "./dev-server/components"; | ||
|
||
const cssFiles = [ | ||
'/Users/nora/Developments/inkdrop/plugins/solarized-light-ui/styles/tokens.css', | ||
'/Users/nora/Developments/inkdrop/plugins/solarized-light-ui/styles/theme.css' | ||
] | ||
"/Users/nora/Developments/inkdrop/plugins/solarized-light-ui/styles/tokens.css", | ||
"/Users/nora/Developments/inkdrop/plugins/solarized-light-ui/styles/theme.css", | ||
]; | ||
|
||
cssFiles.forEach((file) => { | ||
import( /* @vite-ignore */ file) | ||
}) | ||
import(/* @vite-ignore */ file); | ||
}); | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Index />, | ||
children: [ | ||
{ path: '', element: <VariablesPage /> }, | ||
{ path: 'tokens', element: <ColorTokensPage /> } | ||
] | ||
{ path: "", element: <VariablesPage /> }, | ||
{ path: "tokens", element: <ColorTokensPage /> }, | ||
{ path: "components", element: <ComponentsPage /> }, | ||
], | ||
}, | ||
]); | ||
|
||
createRoot(document.getElementById('root')!).render( | ||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<RouterProvider router={router} /> | ||
</StrictMode>, | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { getCSSVariables } from "./get-css-variables"; | ||
|
||
export const ComponentsPage = () => { | ||
return ( | ||
<> | ||
<h2>Components</h2> | ||
<div className="component-list"> | ||
<div className="component-item"> | ||
<h3>Button</h3> | ||
<div> | ||
<button className="ui button">Button</button> | ||
<button className="ui basic button">Basic Button</button> | ||
<button className="ui primary button">Primary Button</button> | ||
<button className="ui negative button">Negative Button</button> | ||
</div> | ||
</div> | ||
<div className="component-item"> | ||
<h3>Button</h3> | ||
<div> | ||
<button className="ui button">Button</button> | ||
<button className="ui basic button">Basic Button</button> | ||
<button className="ui primary button">Primary Button</button> | ||
<button className="ui negative button">Negative Button</button> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters