Skip to content
Merged
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
5 changes: 4 additions & 1 deletion src/apps/Office/OfficeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function OfficeFrame({
const [templatesOpen, setTemplatesOpen] = useState(false);
const importRef = useRef<HTMLInputElement>(null);
return (
<section className="office" aria-label={`${kind} document`}>
<section
className={`office office--${kind}`}
aria-label={`${kind} document`}
>
<header className="office__toolbar">
<strong>{doc.title}</strong>
<span role="status">{doc.dirty ? "Unsaved changes" : "Saved"}</span>
Expand Down
37 changes: 21 additions & 16 deletions src/apps/Office/Sheets.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "./SheetsDesign.css";
import { ChartsPanel } from "./charts/ChartsPanel";
import { TablePanel } from "./sheets/TablePanel";
import { visibleRows } from "./sheets/tableData";
Expand Down Expand Up @@ -260,22 +261,26 @@ export function Sheets(props: AppProps) {
</>
}
>
<button
onClick={() => {
setChartsOpen((open) => !open);
setDataOpen(false);
}}
>
Charts
</button>
<button
onClick={() => {
setDataOpen((open) => !open);
setChartsOpen(false);
}}
>
Sort and filter
</button>
<div className="office__toolbar" aria-label="Data tools">
<button
aria-pressed={chartsOpen}
onClick={() => {
setChartsOpen((open) => !open);
setDataOpen(false);
}}
>
Charts
</button>
<button
aria-pressed={dataOpen}
onClick={() => {
setDataOpen((open) => !open);
setChartsOpen(false);
}}
>
Sort and filter
</button>
</div>
{Boolean(sheet.table?.filters.length) && (
<div className="office__toolbar">
<strong>Filters active</strong>
Expand Down
71 changes: 71 additions & 0 deletions src/apps/Office/SheetsDesign.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.office--sheets {
--editor-color: #2cab82;
}

.office--sheets .office__toolbar {
background: var(--color-surface);
padding: 10px 12px;
gap: 8px;
}

.office--sheets > header.office__toolbar {
border-top: 3px solid var(--editor-color);
background: linear-gradient(
110deg,
color-mix(in srgb, var(--editor-color) 15%, var(--color-surface)),
var(--color-surface)
);
}

.office--sheets
:is(.office__toolbar, .sheets__tabs)
:is(button, select, input) {
padding: 7px 10px;
border: 1px solid var(--color-border);
border-radius: 7px;
background: var(--color-bg);
color: var(--color-text);
}

.office--sheets button:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 2px;
}

.office--sheets .sheets__tabs {
padding: 10px;
gap: 8px;
background: var(--color-surface);
}

.office--sheets .sheets__tabs [aria-current="true"] {
outline: none;
box-shadow: inset 0 -3px var(--color-accent);
background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface));
}

.office--sheets .sheets__formula-label input {
background: var(--color-surface);
border-color: color-mix(
in srgb,
var(--color-accent) 45%,
var(--color-border)
);
}

.office--sheets .sheets__column-headers :is(button, span),
.office--sheets .sheets__row-header {
background: #eaf4ef;
color: #214333;
border-color: #c5d9ce;
font-weight: 600;
}

.office--sheets .office__toolbar button[aria-pressed="true"] {
border-color: var(--color-accent);
background: color-mix(in srgb, var(--color-accent) 16%, var(--color-surface));
}

.office--sheets .sheets__dimensions input {
width: 84px;
}
4 changes: 3 additions & 1 deletion src/apps/Office/sheets/SheetGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ export function SheetGrid({
textAlign: cell?.style?.align ?? "left",
whiteSpace: cell?.style?.wrap ? "pre-wrap" : "nowrap",
border: cell?.style?.border ? "1px solid #444" : undefined,
outline: selected ? "2px solid #2563eb" : undefined,
outline: selected
? "2px solid var(--color-accent)"
: undefined,
outlineOffset: -2,
};
if (editing === key)
Expand Down
Loading