Skip to content
Closed
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
207 changes: 207 additions & 0 deletions frontend/app/COMPONENT_EXAMPLES.md

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions frontend/app/COMPONENT_GUIDE.md

Large diffs are not rendered by default.

635 changes: 635 additions & 0 deletions frontend/app/TAILWIND_GUIDE.md

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions frontend/app/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { store } from "@/shared/stores";

import { AuthProvider } from "@/entities/authentication/ui/useAuth";
import { ConfigProvider } from "@/entities/config/ui/config-provider";
import { ThemeProvider } from "@/entities/theme/ui/theme-provider";

import "@/app/styles/index.css";
import "react-toastify/dist/ReactToastify.css";
Expand All @@ -28,16 +29,18 @@ export function App() {
<ErrorBoundary FallbackComponent={ErrorBoundaryApp}>
<NuqsAdapter>
<Provider store={store}>
<QueryClientProvider client={queryClient}>
<ApolloProvider client={graphqlClient}>
<AuthProvider>
<ConfigProvider>
<RouterProvider router={router} />
</ConfigProvider>
</AuthProvider>
</ApolloProvider>
<TanStackQueryDevtools buttonPosition="bottom-left" />
</QueryClientProvider>
<ThemeProvider>
<QueryClientProvider client={queryClient}>
<ApolloProvider client={graphqlClient}>
<AuthProvider>
<ConfigProvider>
<RouterProvider router={router} />
</ConfigProvider>
</AuthProvider>
</ApolloProvider>
<TanStackQueryDevtools buttonPosition="bottom-left" />
</QueryClientProvider>
</ThemeProvider>
</Provider>
</NuqsAdapter>
</ErrorBoundary>
Expand Down
112 changes: 112 additions & 0 deletions frontend/app/src/app/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
}

@layer base {
html {
background-color: rgb(var(--background));
color: rgb(var(--foreground));
}

button:not(:disabled),
[role="button"]:not(:disabled) {
cursor: pointer;
Expand Down Expand Up @@ -40,8 +45,115 @@ body {
--base-font-size: 14px;
--heading-font-size: 2rem;
--body-font-size: 1rem;

--background: 255 255 255;
--foreground: 11 24 41;
--card: 255 255 255;
--card-foreground: 11 24 41;
--popover: 255 255 255;
--popover-foreground: 11 24 41;
--primary: 11 151 187;
--primary-foreground: 255 255 255;
--secondary: 243 244 246;
--secondary-foreground: 11 24 41;
--muted: 243 244 246;
--muted-foreground: 107 114 128;
--accent: 243 244 246;
--accent-foreground: 11 24 41;
--border: 229 231 235;
--input: 229 231 235;
--ring: 11 151 187;
}

.dark {
--background: 30 41 59;
--foreground: 241 245 249;
--card: 51 65 85;
--card-foreground: 241 245 249;
--popover: 51 65 85;
--popover-foreground: 241 245 249;
--primary: 11 151 187;
--primary-foreground: 255 255 255;
--secondary: 71 85 105;
--secondary-foreground: 241 245 249;
--muted: 71 85 105;
--muted-foreground: 148 163 184;
--accent: 71 85 105;
--accent-foreground: 241 245 249;
--border: 100 116 139;
--input: 100 116 139;
--ring: 11 151 187;
}

code {
font-family: source-code-pro, monospace;
}

/* React DatePicker dark mode styles */
.dark .react-datepicker {
background-color: rgb(51 65 85);
border-color: rgb(71 85 105);
color: rgb(241 245 249);
}

.dark .react-datepicker__header {
background-color: rgb(71 85 105);
border-bottom-color: rgb(100 116 139);
}

.dark .react-datepicker__current-month,
.dark .react-datepicker__day-name,
.dark .react-datepicker-time__header {
color: rgb(241 245 249);
}

.dark .react-datepicker__day {
color: rgb(226 232 240);
}

.dark .react-datepicker__day:hover {
background-color: rgb(100 116 139);
}

.dark .react-datepicker__day--selected,
.dark .react-datepicker__day--keyboard-selected {
background-color: rgb(11 151 187);
color: rgb(255 255 255);
}

.dark .react-datepicker__day--disabled {
color: rgb(100 116 139);
}

.dark .react-datepicker__time-container {
border-left-color: rgb(100 116 139);
}

.dark .react-datepicker__time {
background-color: rgb(51 65 85);
}

.dark .react-datepicker__time-list-item {
color: rgb(226 232 240);
}

.dark .react-datepicker__time-list-item:hover {
background-color: rgb(100 116 139) !important;
}

.dark .react-datepicker__time-list-item--selected {
background-color: rgb(11 151 187) !important;
color: rgb(255 255 255) !important;
}

.dark .react-datepicker__time-list-item--disabled {
color: rgb(100 116 139) !important;
}

.dark .react-datepicker__navigation-icon::before {
border-color: rgb(148 163 184);
}

.dark .react-datepicker__navigation:hover *::before {
border-color: rgb(241 245 249);
}
4 changes: 2 additions & 2 deletions frontend/app/src/assets/icons/tasks-status.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/app/src/entities/authentication/ui/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Login = () => {
<Button
variant="ghost"
onClick={() => setDisplaySSO(!displaySSO)}
className="text-cyan-900 text-sm hover:bg-transparent hover:underline"
className="text-cyan-900 text-sm hover:bg-transparent hover:underline dark:text-cyan-400"
>
Log in with your credentials
</Button>
Expand All @@ -36,7 +36,7 @@ export const Login = () => {
<Button
variant="ghost"
onClick={() => setDisplaySSO(!displaySSO)}
className="text-cyan-900 text-sm hover:bg-transparent hover:underline"
className="text-cyan-900 text-sm hover:bg-transparent hover:underline dark:text-cyan-400"
>
Log in with SSO
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { classNames } from "@/shared/utils/common";

export function BranchDefaultBadge({ className, ...props }: BadgeProps) {
return (
<Badge className={classNames("rounded-full font-normal text-gray-700", className)} {...props}>
<Badge
className={classNames("rounded-full font-normal text-gray-700 dark:text-gray-300", className)}
{...props}
>
default
</Badge>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function BranchListItem({ branch, className, ...props }: BranchListItemPr
className={classNames(
focusVisibleStyle,
"flex flex-wrap items-center gap-6 px-6 py-4",
"border border-transparent not-last:border-b-gray-200",
"border border-transparent not-last:border-b-gray-200 dark:not-last:border-b-slate-600",
"first:rounded-t-lg last:rounded-b-lg",
"hover:bg-neutral-100",
"hover:bg-neutral-100 dark:hover:bg-slate-600",
className
)}
{...props}
Expand All @@ -45,7 +45,7 @@ export function BranchListItem({ branch, className, ...props }: BranchListItemPr
{branch.has_schema_changes && <BranchSchemaChangesBadge />}
</Row>

<p className="truncate text-gray-600 text-xs">{branch.description}</p>
<p className="truncate text-gray-600 text-xs dark:text-gray-400">{branch.description}</p>
</Col>

{branch.sync_with_git && <BranchGitSyncBadge />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface BranchMetadataProps {
export function BranchMetadata({ label, value }: BranchMetadataProps) {
return (
<Col className="shrink-0 gap-0 text-xs">
<span className="font-medium">{label}</span>
<span>{value ?? "-"}</span>
<span className="font-medium text-gray-600 dark:text-gray-400">{label}</span>
<span className="dark:text-gray-300">{value ?? "-"}</span>
</Col>
);
}
2 changes: 1 addition & 1 deletion frontend/app/src/entities/branches/ui/branches-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function BranchesList() {
<ListBox
aria-label="Branches list"
items={branches}
className="m-2 flex flex-col divide-y rounded-lg border border-gray-200"
className="m-2 flex flex-col divide-y rounded-lg border border-gray-200 dark:divide-slate-600 dark:border-slate-600"
>
{(branch) => <BranchListItem branch={branch} />}
</ListBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ArtifactTitleContent = (props: ArtifactEvent) => {
to={getObjectDetailsUrl(ARTIFACT_OBJECT, props.primary_node?.id, [
{ name: QSP.BRANCH, value: props.branch },
])}
className="min-w-0 truncate text-black"
className="min-w-0 truncate text-black dark:text-white"
>
<NodeLabel id={props.primary_node?.id} kind={ARTIFACT_OBJECT} />
</Link>
Expand All @@ -24,7 +24,7 @@ const ArtifactTitleContent = (props: ArtifactEvent) => {
to={getObjectDetailsUrl(ARTIFACT_DEFINITION_OBJECT, props.artifact_definition_id, [
{ name: QSP.BRANCH, value: props.branch },
])}
className="min-w-0 truncate text-black"
className="min-w-0 truncate text-black dark:text-white"
>
<NodeLabel id={props.artifact_definition_id} kind={ARTIFACT_DEFINITION_OBJECT} />
</Link>
Expand All @@ -35,15 +35,15 @@ const ArtifactTitleContent = (props: ArtifactEvent) => {
export const ARTIFACT_EVENTS_MAPPING: Record<string, (props: ArtifactEvent) => ReactNode> = {
"infrahub.artifact.created": (props) => {
return (
<div className="flex min-w-0 items-center gap-1 overflow-hidden text-gray-600">
<div className="flex min-w-0 items-center gap-1 overflow-hidden text-gray-600 dark:text-gray-400">
<span className="whitespace-nowrap">created the artifact</span>
<ArtifactTitleContent {...props} />
</div>
);
},
"infrahub.artifact.updated": (props) => {
return (
<div className="flex min-w-0 items-center gap-1 overflow-hidden text-gray-600">
<div className="flex min-w-0 items-center gap-1 overflow-hidden text-gray-600 dark:text-gray-400">
<span className="whitespace-nowrap">updated the artifact</span>
<ArtifactTitleContent {...props} />
</div>
Expand Down
Loading