Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 1 #2

Open
wants to merge 7 commits into
base: step-0
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="de" dir="ltr">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
Expand All @@ -9,6 +9,10 @@
type="module"
src="/node_modules/@public-ui/components/dist/kolibri/kolibri.esm.js"
></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@vscode/codicons@0.0.33/dist/codicon.min.css"
/>
</head>
<body>
<div id="root"></div>
Expand Down
25 changes: 21 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from "react";
import "./App.css";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import { KolKolibri } from "@public-ui/react";
import { KolButton, KolKolibri } from "@public-ui/react";

function App() {
const [count, setCount] = useState(0);
Expand All @@ -22,9 +22,26 @@ function App() {
</div>
<h1>Vite + React + KoliBri</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<div className="flex place-center gap-4">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<KolButton
_label={`count is ${count}`}
_on={{
onClick: () => setCount((count) => count + 1),
}}
/>
<KolButton
_hideLabel
_label={`count is ${count}`}
_icons="codicon codicon-thumbsup"
_on={{
onClick: () => setCount((count) => count + 1),
}}
_variant="danger"
/>
</div>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
Expand Down
22 changes: 11 additions & 11 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// import { register } from "@public-ui/components";
// import { DEFAULT } from "@public-ui/theme-default";
import { register } from "@public-ui/components";
import { DEFAULT } from "@public-ui/theme-default";
import React from "react";
import ReactDOM from "react-dom/client";
import "uno.css";
import App from "./App.tsx";
import "./index.css";

// register(DEFAULT, [])
// .then(() => {
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// })
// .catch(console.warn);
register(DEFAULT, [])
.then(() => {
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
})
.catch(console.warn);