Skip to content

Commit

Permalink
WIP: integration of intelligence design system
Browse files Browse the repository at this point in the history
  • Loading branch information
nboyse committed Feb 17, 2025
1 parent 443dbff commit 80d4c5c
Show file tree
Hide file tree
Showing 15 changed files with 758 additions and 305 deletions.
15 changes: 12 additions & 3 deletions django_app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"src/js/document-upload.js",
"src/js/documents.js",
"src/js/main.js",
"src/js/posthog.js"
"src/js/posthog.js",
"src/js/react/Body.jsx",
"src/js/react/TopNav.jsx"
],
"staticFiles": [
{
Expand Down Expand Up @@ -42,17 +44,23 @@
}
],
"scripts": {
"build": "npx parcel build --no-cache",
"build": "npx parcel build --no-cache --no-source-maps",
"watch": "npx parcel watch",
"test": "cd tests-web-components && npx playwright test"
},
"author": "",
"dependencies": {
"@mdi/js": "^7.4.47",
"@parcel/config-default": "^2.13.1",
"@parcel/transformer-typescript-tsc": "^2.13.1",
"@ukic/canary-react": "^2.0.0-canary.33",
"@ukic/fonts": "^2.6.5",
"@ukic/react": "^2.34.0",
"@ukic/web-components": "^2.34.0",
"govuk-frontend": "^5.2.0",
"i.ai-design-system": "^0.4.8",
"posthog-js": "^1.143.0"
"posthog-js": "^1.143.0",
"react": "^18.3.1"
},
"devDependencies": {
"@parcel/transformer-sass": "^2.12.0",
Expand All @@ -64,6 +72,7 @@
"parcel-reporter-static-files-copy": "^1.5.3",
"postcss": "^8.4.39",
"postcss-url": "^10.1.3",
"process": "^0.11.10",
"url": "^0.11.3"
}
}
2 changes: 2 additions & 0 deletions django_app/frontend/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ import "../../node_modules/i.ai-design-system/dist/iai-design-system.js";
});
});
})();

console.log("hello!")
17 changes: 17 additions & 0 deletions django_app/frontend/src/js/react/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Body from "./Body"; // Your main component
import Chat from "./Chat"; // New component for /chat route

function App() {
return (
<Router>
<Routes>
<Route path="/" element={<Body />} />
<Route path="/chat" element={<Chat />} />
</Routes>
</Router>
);
}

export default App;
99 changes: 99 additions & 0 deletions django_app/frontend/src/js/react/Body.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import React, { FC } from 'react';
import ReactDOM from "react-dom/client";
import {
IcClassificationBanner,
IcNavigationButton,
IcSectionContainer,
IcTopNavigation,
SlottedSVG,
IcHero,
IcButton,
IcDivider
} from '@ukic/react';

import { IcCardHorizontal } from '@ukic/canary-react';

import { mdiAccount } from '@mdi/js';

import "@ukic/fonts/dist/fonts.css";
import "@ukic/react/dist/core/core.css";
import "@ukic/react/dist/core/normalize.css";

const Body = () => {
return (
<>
<IcClassificationBanner />
<IcTopNavigation
appTitle="Redbox"
status="beta"
version=""
>
<IcNavigationButton label="Profile" slot="buttons">
<SlottedSVG
slot="icon"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="24"
height="24"
path={mdiAccount}
/>
</IcNavigationButton>
</IcTopNavigation>

<IcHero
heading="Get AI-powered insights from your Official documents"
subheading="Ask questions, create summaries, or chat with AI about single or multiple documents to support your work."
>
<IcButton variant="primary" slot="interaction">
Sign in
</IcButton>
</IcHero>

<br />
<IcSectionContainer
style={{ display: 'flex' }}
gap="large"
aligned="center"
>
<IcCardHorizontal
heading="Upload"
message="Upload all common document types to your Redbox - it's that simple"
style={{ margin: '10px' }}
/>
<IcCardHorizontal
heading="Chat"
message="Ask questions about your documents and uncover insights through Redbox's AI. Get instant summaries of individual documents or combine multiple documents to discover connections across your content."
style={{ margin: '10px' }}
/>
<IcCardHorizontal
heading="Secure"
message="Redbox is built in our secure and private cloud, which enables you to upload documents up to and including Official classification in your Redbox."
style={{ margin: '10px' }}
/>
<IcCardHorizontal
heading="new card"
message="Redbox is built in our secure and private cloud, which enables you to upload documents up to and including Official classification in your Redbox."
style={{ margin: '10px' }}
/>
</IcSectionContainer>

<IcSectionContainer>
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds" style={{ borderBottom: "1px solid black" }}>
<h1 className="govuk-heading-m govuk-!-margin-top-5 govuk-!-padding-top-5">Frequently Asked Questions</h1>
</div>
<IcDivider slot="primary-navigation"></IcDivider>
</div>
<div className="govuk-accordion" data-module="govuk-accordion" id="faq">
{/* Accordion content here */}
</div>
</IcSectionContainer>
</>
);
};

const rootElement = document.getElementById("root");
if (rootElement) {
const root = ReactDOM.createRoot(rootElement);
root.render(<Body />);
}
156 changes: 156 additions & 0 deletions django_app/frontend/src/js/react/Chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// import React, { FC } from 'react';
// import {
// IcClassificationBanner,
// IcFooter,
// IcFooterLink,
// IcNavigationButton,
// IcNavigationItem,
// IcSideNavigation,
// IcDivider,
// IcTopNavigation,
// IcTypography,
// SlottedSVG,
// IcPageHeader,
// IcCheckbox,
// IcSectionContainer,
// IcAlert,
// IcButton,
// IcTextField
// } from '@ukic/react';

// import type { IcAlignment } from '@ukic/web-components';

// import { mdiAccount, mdiChat, mdiFileDocument, mdiPencil } from '@mdi/js';

// import "@ukic/fonts/dist/fonts.css";
// import "@ukic/react/dist/core/core.css";
// import "@ukic/react/dist/core/normalize.css";


// const Chat = () => {
// return (
// <>
// <body>
// <IcClassificationBanner />
// <IcTopNavigation
// appTitle="Redbox"
// status="beta"
// version=""
// >
// <IcNavigationButton label="Document" slot="buttons">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiFileDocument}
// />
// </IcNavigationButton>
// <IcNavigationButton label="Chat" slot="buttons">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiChat}
// />
// </IcNavigationButton>
// <IcNavigationButton label="Profile" slot="buttons">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiAccount}
// />
// </IcNavigationButton>
// </IcTopNavigation>
// <IcSectionContainer style={{paddingLeft: "400px",}}>
// <IcTypography variant="h2" style={{ paddingTop: "100px"}} aligned="center">How can Redbox help you today?</IcTypography>
// <IcTypography variant="p" style={{paddingTop: "20px"}} aligned="center">Select an option or type any question below.</IcTypography>
// <br></br>
// <IcAlert
// variant="warning"
// message="Redbox can make mistakes. You must check for accuracy before using the output"
// />
// <br></br>
// <IcAlert
// variant="warning"
// message="You can use up to, and including, official sensitive documents."
// />
// <IcButton variant="secondary" style={{paddingTop: "50px", paddingRight: "20px"}}>Draft a meeting agenda</IcButton>
// <IcButton variant="secondary" style={{paddingTop: "50px", paddingRight: "20px"}}>Set my work objectives</IcButton>
// <IcButton variant="secondary" style={{paddingTop: "50px",}}>Describe the role of a Parlimentary Secretary</IcButton>
// <div style={{display: "flex"}}>
// <IcTextField
// placeholder="Please enter…"
// helperText="Need help? View Advanced Prompt FAQ."
// onIcChange={(ev) => console.log(ev.detail.value)}
// style={{ paddingTop: "100px", width: "350px"}}
// rows="6"
// resize="true"
// />
// <IcButton variant="primary" style={{ paddingTop: "128px"}}>Send</IcButton>
// </div>
// </IcSectionContainer>
// <IcSideNavigation appTitle="Redbox" status="Beta" expanded='true'>
// <IcPageHeader heading="Redbox"></IcPageHeader>
// <IcNavigationItem slot="primary-navigation" href="#" label="New chat">
// </IcNavigationItem>
// <IcDivider slot="primary-navigation"></IcDivider>
// <IcNavigationItem slot="primary-navigation" href="#" label="Recent chats">
// </IcNavigationItem>

// <IcDivider slot="primary-navigation"></IcDivider>
// <IcNavigationItem slot="primary-navigation" href="#" label="Today">
// </IcNavigationItem>
// <IcNavigationItem slot="primary-navigation" href="#" label="New chat">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiPencil}
// alignment="right"
// />
// </IcNavigationItem>
// <IcDivider slot="primary-navigation"></IcDivider>
// <IcNavigationItem slot="primary-navigation" href="#" label="Previous 30 days">
// </IcNavigationItem>
// <IcNavigationItem slot="primary-navigation" href="#" label="Report analysis">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiPencil}
// alignment="right"
// />
// </IcNavigationItem>
// <IcNavigationItem slot="primary-navigation" href="#" label="Export opportunity">
// <SlottedSVG
// slot="icon"
// xmlns="http://www.w3.org/2000/svg"
// viewBox="0 0 24 24"
// width="24"
// height="24"
// path={mdiPencil}
// alignment="right"
// />
// </IcNavigationItem>
// <IcNavigationItem slot="primary-navigation" href="#" label="Documents to use">
// </IcNavigationItem>
// <IcDivider slot="primary-navigation"></IcDivider>

// </IcSideNavigation>
// </body>
// </>
// );
// };

// export default Chat;
Loading

0 comments on commit 80d4c5c

Please sign in to comment.