Skip to content

Commit

Permalink
chore: bundle global style with react wrapper component
Browse files Browse the repository at this point in the history
  • Loading branch information
g-francesca committed Jul 22, 2024
1 parent ce6c0c5 commit 723547e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/demo-react/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
13 changes: 8 additions & 5 deletions apps/demo-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import './App.css'
import { defineCustomElements, OramaSearchBox } from 'ui-stencil-react'

// import {} from 'ui-stencil-react'
import { defineCustomElements, OramaChatBox } from 'ui-stencil-react'

void defineCustomElements()

Expand All @@ -14,9 +12,14 @@ function App() {
</section>

<section>
<h2>Stencil Components</h2>
<h2>ChatBox</h2>
<div className="component-row">
<OramaSearchBox />
<OramaChatBox
index={{
api_key: 'yl2JSnjLNBV6FVfUWEyadpjFr6KzPiDR',
endpoint: 'https://cloud.orama.run/v1/indexes/recipes-m7w9mm',
}}
/>
</div>
</section>
</main>
Expand Down
12 changes: 9 additions & 3 deletions apps/demo-react/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ section {
margin-bottom: 1rem;
}

main {
width: 90%;
max-width: 1200px;
margin: 0 auto;
}

.component-row {
background-color: #ddd;
padding: 1rem;
border-radius: 1rem;
width: 100%;
max-width: 800px;
margin: 0 auto;
}
6 changes: 4 additions & 2 deletions packages/ui-stencil-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from "./components/stencil-generated";
export { defineCustomElements } from "ui-stencil/loader";
export * from './components/stencil-generated'
export { defineCustomElements } from 'ui-stencil/loader'

import 'ui-stencil/dist/orama-ui/orama-ui.css'
2 changes: 1 addition & 1 deletion packages/ui-stencil/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<link rel="stylesheet" href="/build/orama-ui.css" />
<script type="module" src="/build/orama-ui.esm.js"></script>
<script nomodule src="/bui ld/orama-ui.js"></script>
<script nomodule src="/build/orama-ui.js"></script>
</head>
<body>
<search-box-toggler></search-box-toggler>
Expand Down

0 comments on commit 723547e

Please sign in to comment.