Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 2 additions & 4 deletions apps/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import LoginPage from './features/auth/LoginPage';
import RegisterPage from './features/auth/RegisterPage';

import ExplorePage from './features/explore/ExplorePage';
import CookbookPage from './features/cookbook/CookbookPage';
import RecipeCreatePage from './features/recipes/RecipeCreatePage';

export function App() {
Expand All @@ -15,10 +16,7 @@ export function App() {
<Route element={<AppShell />}>
<Route index element={<ExplorePage />} />

<Route
path="/cookbook"
element={<RouteDestination title="My Cookbook" />}
/>
<Route path="/cookbook" element={<CookbookPage />} />
<Route path="/recipes/new" element={<RecipeCreatePage />} />
<Route
path="/recipes/:id"
Expand Down
39 changes: 39 additions & 0 deletions apps/web/src/components/ui/LinkButton/LinkButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { ReactNode } from 'react';
import { Link, type LinkProps } from 'react-router-dom';

import type { ButtonSize, ButtonVariant } from '../Button/Button';
import '../Button/Button.css';

export type LinkButtonProps = LinkProps & {
children: ReactNode;
variant?: ButtonVariant;
size?: ButtonSize;
wide?: boolean;
};

function LinkButton({
children,
variant = 'primary',
size = 'md',
wide = false,
className = '',
...props
}: LinkButtonProps) {
const classes = [
'button',
`button--${variant}`,
`button--${size}`,
wide && 'button--wide',
className,
]
.filter(Boolean)
.join(' ');

return (
<Link className={classes} {...props}>
{children}
</Link>
);
}

export default LinkButton;
8 changes: 8 additions & 0 deletions apps/web/src/components/ui/Sheet/Sheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
}

.sheet[open] {
display: flex;
flex-direction: column;

animation: sheet-enter var(--duration-normal) var(--ease-standard) both;
}

Expand All @@ -47,6 +50,7 @@

.sheet__handle-area {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;

Expand Down Expand Up @@ -76,6 +80,7 @@

.sheet__header {
display: flex;
flex: 0 0 auto;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-4);
Expand Down Expand Up @@ -119,6 +124,8 @@
========================================================= */

.sheet__body {
flex: 1 1 auto;

min-height: 0;

padding: var(--space-4) var(--space-5)
Expand All @@ -143,6 +150,7 @@

.sheet__footer {
display: flex;
flex: 0 0 auto;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
Expand Down
182 changes: 182 additions & 0 deletions apps/web/src/features/cookbook/CookbookControls.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
@layer components {
.cookbook-controls {
padding: var(--space-3);

background-color: var(--color-surface-raised);

border: var(--border-width-thin) solid var(--color-border-default);
border-radius: var(--radius-lg);
}

/*
* Desktop intentionally follows Explore's toolbar structure:
* one horizontal fieldset with sorting pushed to the right.
*/
.cookbook-controls__desktop {
display: flex;
flex-wrap: nowrap;
align-items: center;
gap: var(--space-3);

min-width: 0;
margin: 0;
padding: 0;

border: 0;
}

.cookbook-controls__desktop-control {
flex: 0 0 auto;

min-width: 0;
}

.cookbook-controls__desktop-control--sort {
margin-inline-start: auto;
}

.cookbook-controls__select {
width: 13.5rem;
min-width: 0;

background-color: var(--color-surface-raised);
border-color: var(--color-border-input);
border-radius: var(--radius-lg);
}

.cookbook-controls__select:hover:not(:disabled) {
background-color: var(--color-surface-hover);
border-color: var(--color-border-input-hover);
}

/*
* Scope is intentionally slightly narrower than Category/Cooking time.
* It remains available, but does not dominate the toolbar.
*/
.cookbook-controls__select--scope {
width: 11.5rem;
}

.cookbook-controls__select--sort {
width: 15.5rem;
}

.cookbook-controls__custom-time-input {
width: 9rem;

background-color: var(--color-surface-raised);
border-color: var(--color-border-input);
border-radius: var(--radius-lg);
}

/*
* Like Explore, mobile/narrow layouts expose only Filter and Sort.
*/
.cookbook-controls__mobile {
display: none;
}

.cookbook-controls__sheet-content {
display: flex;
flex-direction: column;
gap: var(--space-6);
}

.cookbook-controls__filter-group {
display: flex;
flex-direction: column;
gap: var(--space-3);

min-width: 0;
margin: 0;
padding: 0;

border: 0;
}

.cookbook-controls__filter-legend {
margin-block-end: var(--space-1);
padding: 0;

color: var(--color-text-primary);

font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
line-height: var(--line-height-snug);
}

.cookbook-controls__chips {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}

.cookbook-controls__custom-time {
max-width: 22rem;
}

.cookbook-controls__sheet-actions {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--space-3);

width: 100%;
}

.cookbook-controls__sheet-actions--single {
grid-template-columns: minmax(0, 1fr);
}

.cookbook-controls__sheet-action {
width: 100%;
}

/*
* Same visual separator before Sort as Explore.
*
* Cookbook has one additional desktop select, so its desktop toolbar
* switches to the compact version a little earlier than Explore.
*/
@media (min-width: 72.0625rem) {
.cookbook-controls__desktop-control--sort {
position: relative;

padding-inline-start: var(--space-5);
}

.cookbook-controls__desktop-control--sort::before {
content: '';

position: absolute;
top: 15%;
bottom: 15%;
left: 0;

width: var(--border-width-thin);

background-color: var(--color-border-divider);
}
}

@media (max-width: 72rem) {
.cookbook-controls {
padding: var(--space-3);
}

.cookbook-controls__desktop {
display: none;
}

.cookbook-controls__mobile {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--space-3);
}

.cookbook-controls__mobile-button {
width: 100%;
min-width: 0;
min-height: var(--target-size-min);
}
}
}
Loading