Skip to content

Commit 96939d3

Browse files
Tailwind 4 (#2910)
* First pass * Still a few issues to sort * Neater focus * Style fixes * Headless ui upgrade * Initial table fixes * Table, focus and token fixes * Switch metrics cursor colour * Table and card fixes * Visual regression script Visual regression script Update generate-visual-baseline.sh Setting up tests Fix cmd Test improvements Add regression e2e test Fix / remove vis regression tests Update generate-visual-baseline.sh Simplify scripts Simplify regression readme * Mini table and command menu fixes * E2E fixes * Merge fixes * Fix scrolling table * Add missing license header * Update ip-pool-item.tsx * Fix serial console overflow * design-system 4.0 canary excluding asciidoc from ui import --------- Co-authored-by: David Crespo <[email protected]>
1 parent 1bc5187 commit 96939d3

File tree

148 files changed

+3856
-2805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3856
-2805
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ test-results/
3131
ci-e2e-traces/
3232
playwright-report/
3333
.vercel
34+
35+
# Visual regression snapshots
36+
test/e2e/**/*-snapshots/
37+
test/e2e/**/*.png
38+
39+
# LLMs
40+
CLAUDE.md

app/components/AccordionItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const AccordionItem = ({ children, isOpen, label, value }: AccordionItemP
2929
return (
3030
<Accordion.Item value={value}>
3131
<Accordion.Header className="max-w-lg">
32-
<Accordion.Trigger className="group flex w-full items-center justify-between border-t py-2 text-sans-xl border-secondary [&>svg]:data-[state=open]:rotate-90">
32+
<Accordion.Trigger className="text-sans-xl border-secondary group flex w-full items-center justify-between border-t py-2 [&>svg]:data-[state=open]:rotate-90">
3333
<div className="text-raise">{label}</div>
34-
<DirectionRightIcon className="transition-all text-default" />
34+
<DirectionRightIcon className="text-default transition-all" />
3535
</Accordion.Trigger>
3636
</Accordion.Header>
3737
<Accordion.Content

app/components/AttachFloatingIpModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function FloatingIpLabel({ fip }: { fip: FloatingIp }) {
4848
{fip.description && (
4949
<>
5050
<Slash />
51-
<div className="grow overflow-hidden overflow-ellipsis whitespace-pre text-left">
51+
<div className="grow overflow-hidden text-left text-ellipsis whitespace-pre">
5252
{fip.description}
5353
</div>
5454
</>

app/components/CapacityBar.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export const CapacityBar = <T extends number | bigint>({
3434
const unitElt = includeUnit ? <>&nbsp;{unit}</> : null
3535

3636
return (
37-
<div className="w-full min-w-min rounded-lg border border-default lg+:max-w-[50%]">
37+
<div className="border-default 1000:max-w-1/2 w-full min-w-min rounded-lg border">
3838
<div className="flex justify-between p-3">
3939
<TitleCell icon={icon} title={title} unit={unit} />
4040
<PctCell pct={pct} />
4141
</div>
42-
<div className="p-3 pb-4 pt-1">
42+
<div className="p-3 pt-1 pb-4">
4343
<Bar pct={pct} />
4444
</div>
45-
<div className="flex justify-between border-t border-secondary">
45+
<div className="border-secondary flex justify-between border-t">
4646
<ValueCell label={provisionedLabel} value={provisioned} unit={unitElt} />
4747
<ValueCell label={capacityLabel} value={capacity} unit={unitElt} />
4848
</div>
@@ -55,9 +55,9 @@ function TitleCell({ icon, title, unit }: TitleCellProps) {
5555
return (
5656
<div>
5757
<div className="flex grow items-center">
58-
<span className="mr-2 flex h-4 w-4 items-center text-accent">{icon}</span>
59-
<span className="!normal-case text-mono-sm text-default">{title}</span>
60-
<span className="ml-1 !normal-case text-mono-sm text-tertiary">({unit})</span>
58+
<span className="text-accent mr-2 flex h-4 w-4 items-center">{icon}</span>
59+
<span className="text-mono-sm text-default normal-case!">{title}</span>
60+
<span className="text-mono-sm text-tertiary ml-1 normal-case!">({unit})</span>
6161
</div>
6262
</div>
6363
)
@@ -67,8 +67,8 @@ function PctCell({ pct }: { pct: number }) {
6767
// NaN happens when both top and bottom are 0
6868
if (Number.isNaN(pct)) {
6969
return (
70-
<div className="flex -translate-y-0.5 items-baseline text-tertiary">
71-
<div className="font-light text-sans-2xl text-raise"></div>
70+
<div className="text-tertiary flex -translate-y-0.5 items-baseline">
71+
<div className="text-sans-2xl text-raise font-light"></div>
7272
<div className="text-sans-xl">%</div>
7373
</div>
7474
)
@@ -77,7 +77,7 @@ function PctCell({ pct }: { pct: number }) {
7777
const [wholeNumber, decimal] = splitDecimal(pct)
7878
return (
7979
<div className="flex -translate-y-0.5 items-baseline">
80-
<div className="font-light text-sans-2xl text-raise">{wholeNumber}</div>
80+
<div className="text-sans-2xl text-raise font-light">{wholeNumber}</div>
8181
<div className="text-sans-xl text-tertiary">{decimal}%</div>
8282
</div>
8383
)
@@ -87,10 +87,10 @@ function Bar({ pct }: { pct: number }) {
8787
return (
8888
<div className="flex w-full gap-0.5">
8989
<div
90-
className="h-3 rounded-l border bg-accent-secondary border-accent-secondary"
90+
className="bg-accent-secondary border-accent-secondary h-3 rounded-l border"
9191
style={{ width: `${pct.toFixed(2)}%` }}
9292
></div>
93-
<div className="h-3 grow rounded-r border bg-info-secondary border-info-secondary"></div>
93+
<div className="bg-info-secondary border-info-secondary h-3 grow rounded-r border"></div>
9494
</div>
9595
)
9696
}
@@ -103,9 +103,9 @@ type ValueCellProps = {
103103

104104
function ValueCell({ label, value, unit }: ValueCellProps) {
105105
return (
106-
<div className="p-3 text-mono-sm">
107-
<div className="mb-px text-tertiary">{label}</div>
108-
<div className="!normal-case text-default">
106+
<div className="text-mono-sm p-3">
107+
<div className="text-tertiary mb-px">{label}</div>
108+
<div className="text-default normal-case!">
109109
<BigNum num={value} />
110110
{unit}
111111
</div>

app/components/CapacityBars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const CapacityBars = ({
2323
allocatedLabel: string
2424
}) => {
2525
return (
26-
<div className="mb-12 flex min-w-min flex-col gap-3 lg+:flex-row">
26+
<div className="1000:flex-row mb-12 flex min-w-min flex-col gap-3">
2727
<CapacityBar
2828
icon={<Cpu16Icon />}
2929
title="CPU"

app/components/CopyCode.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function CopyCodeModal({
4646
return (
4747
<Modal isOpen={isOpen} onDismiss={onDismiss} title={modalTitle} width="free">
4848
<Modal.Section>
49-
<pre className="w-full rounded border px-4 py-3 !normal-case !tracking-normal text-mono-md bg-default border-secondary">
49+
<pre className="text-mono-md bg-default border-secondary w-full rounded border px-4 py-3 tracking-normal! normal-case!">
5050
{children}
5151
</pre>
5252
</Modal.Section>
@@ -71,7 +71,7 @@ export function CopyCodeModal({
7171
animate={{ opacity: 1, y: '-50%', x: '-50%' }}
7272
initial={{ opacity: 0, y: 'calc(-50% - 25px)', x: '-50%' }}
7373
transition={{ type: 'spring', duration: 0.3, bounce: 0 }}
74-
className="absolute left-1/2 top-1/2 flex items-center"
74+
className="absolute top-1/2 left-1/2 flex items-center"
7575
>
7676
<Success12Icon className="text-accent" />
7777
</m.span>
@@ -108,7 +108,7 @@ export function EquivalentCliCommand({ project, instance }: EquivProps) {
108108
isOpen={isOpen}
109109
onDismiss={() => setIsOpen(false)}
110110
>
111-
<span className="mr-2 select-none text-tertiary">$</span>
111+
<span className="text-tertiary mr-2 select-none">$</span>
112112
{cmdParts.join(' \\\n ')}
113113
</CopyCodeModal>
114114
</>

app/components/DocsPopover.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ type DocsPopoverLinkProps = {
2222
export const DocsPopoverLink = ({ href, linkText }: DocsPopoverLinkProps) => (
2323
<a
2424
href={href}
25-
className="group block px-4 children:last:border-0"
25+
className="group block px-4 last:*:border-0"
2626
target="_blank"
2727
rel="noreferrer"
2828
>
29-
<div className="mx-2 border-b py-1.5 border-secondary">
30-
<div className="relative -ml-2 inline-block rounded py-1 pl-2 pr-7 text-sans-md text-raise group-hover:bg-tertiary">
31-
<span className="inline-block max-w-[300px] truncate align-middle">{linkText}</span>
32-
<OpenLink12Icon className="absolute top-1.5 ml-2 translate-y-[1px] text-secondary" />
29+
<div className="border-secondary mx-2 border-b py-1.5">
30+
<div className="text-sans-md text-raise group-hover:bg-tertiary relative -ml-2 inline-block rounded py-1 pr-7 pl-2">
31+
<span className="inline-block max-w-300 truncate align-middle">{linkText}</span>
32+
<OpenLink12Icon className="text-secondary absolute top-1.5 ml-2 translate-y-px" />
3333
</div>
3434
</div>
3535
</a>
@@ -47,25 +47,25 @@ export const DocsPopover = ({ heading, icon, summary, links }: DocsPopoverProps)
4747
const title = `Learn about ${heading}`
4848
return (
4949
<Popover>
50-
<PopoverButton title={title}>
50+
<PopoverButton title={title} className="headless-hide-focus rounded">
5151
<div className={cn(buttonStyle({ size: 'sm', variant: 'ghost' }), 'w-8')}>
5252
<Info16Icon aria-hidden className="shrink-0" />
5353
</div>
5454
</PopoverButton>
5555
<PopoverPanel
5656
// popover-panel needed for enter animation
57-
className="popover-panel z-10 w-96 rounded-lg border bg-raise border-secondary elevation-2"
57+
className="popover-panel bg-raise border-secondary elevation-2 z-10 w-96 rounded-lg border"
5858
anchor={{ to: 'bottom end', gap: 12 }}
5959
>
6060
<div className="px-4">
61-
<h2 className="mt-4 flex items-center gap-1 text-sans-md">
62-
<div className="mr-1 flex items-center text-accent-secondary">{icon}</div>
61+
<h2 className="text-sans-md mt-4 flex items-center gap-1">
62+
<div className="text-accent-secondary mr-1 flex items-center">{icon}</div>
6363
{title}
6464
</h2>
65-
<p className="mb-3 mt-2 text-sans-md text-default">{summary}</p>
65+
<p className="text-sans-md text-default mt-2 mb-3">{summary}</p>
6666
</div>
67-
<div className="border-t pb-1 border-secondary">
68-
<h3 className="mb-1 mt-3 px-4 text-mono-sm text-tertiary">Guides</h3>
67+
<div className="border-secondary border-t pb-1">
68+
<h3 className="text-mono-sm text-tertiary mt-3 mb-1 px-4">Guides</h3>
6969
{links.map((link) => (
7070
<DocsPopoverLink key={link.href} {...link} />
7171
))}

app/components/ErrorBoundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ErrorPage, NotFound } from './ErrorPage'
1919
const IdpMisconfig = () => (
2020
<Message
2121
variant="notice"
22-
className="!mt-6"
22+
className="mt-6!"
2323
showIcon={false}
2424
content={
2525
<p>

app/components/ErrorPage.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Button } from '~/ui/lib/Button'
1717
const GradientBackground = () => (
1818
<div
1919
// negative z-index avoids covering MSW warning banner
20-
className="fixed bottom-0 left-0 right-0 top-0 -z-10"
20+
className="fixed top-0 right-0 bottom-0 left-0 -z-10"
2121
style={{
2222
background:
2323
'radial-gradient(200% 100% at 50% 100%, var(--surface-default) 0%, #161B1D 100%)',
@@ -34,17 +34,17 @@ export function ErrorPage({ children }: Props) {
3434
<div className="relative flex w-full justify-between">
3535
<Link
3636
to="/"
37-
className="flex items-center p-6 text-mono-sm text-default hover:text-raise"
37+
className="text-mono-sm text-default hover:text-raise flex items-center p-6"
3838
>
39-
<PrevArrow12Icon title="Select" className="mr-2 text-secondary" />
39+
<PrevArrow12Icon title="Select" className="text-secondary mr-2" />
4040
Back to console
4141
</Link>
42-
<SignOutButton className="mr-6 mt-4" />
42+
<SignOutButton className="mt-4 mr-6" />
4343
</div>
44-
<div className="absolute left-1/2 top-1/2 flex w-96 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center space-y-4 rounded-lg border p-8 !bg-raise border-secondary elevation-3">
44+
<div className="bg-raise! border-secondary elevation-3 absolute top-1/2 left-1/2 flex w-96 -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center space-y-4 rounded-lg border p-8">
4545
<div className="my-2 flex h-12 w-12 items-center justify-center">
46-
<div className="absolute h-12 w-12 rounded-full opacity-20 bg-destructive motion-safe:animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]" />
47-
<Error12Icon className="relative h-8 w-8 text-error" />
46+
<div className="bg-destructive absolute h-12 w-12 rounded-full opacity-20 motion-safe:animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]" />
47+
<Error12Icon className="text-error relative h-8 w-8" />
4848
</div>
4949

5050
<div className="space-y-2 text-center">{children}</div>

app/components/ExternalIps.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ export function ExternalIps({ project, instance }: PP.Instance) {
4444

4545
return (
4646
<div className="flex max-w-full items-center">
47-
{intersperse(links, <Slash className="ml-0.5 mr-1.5" />)}
47+
{intersperse(links, <Slash className="mr-1.5 ml-0.5" />)}
4848
{/* if there are more than 2 ips, add a link to the instance networking page */}
4949
{overflowCount > 0 && (
5050
<>
51-
<Slash className="ml-0.5 mr-1.5" />
51+
<Slash className="mr-1.5 ml-0.5" />
5252
<Link
5353
to={pb.instanceNetworking({ project, instance })}
54-
className="hover:link-with-underline -m-2 self-center p-2 text-tertiary"
54+
className="hover:link-with-underline text-tertiary -m-2 self-center p-2"
5555
>
5656
5757
</Link>

0 commit comments

Comments
 (0)