Skip to content

Commit 258b778

Browse files
committed
[code-infra] Fix prettier formatting of tailwind classes
Add the source tailwind v4 stylesheet and preserve whitespaces
1 parent c05bff9 commit 258b778

File tree

22 files changed

+79
-78
lines changed

22 files changed

+79
-78
lines changed

docs/src/app/(private)/experiments/context-menu.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ export default function ContextMenuExperiment() {
1818
</p>
1919

2020
<ContextMenu.Root>
21-
<ContextMenu.Trigger className="rounded-lg border-2 border-blue-300 bg-blue-50 p-8">
21+
<ContextMenu.Trigger className="border-blue-300 bg-blue-50 rounded-lg border-2 p-8">
2222
<div className="text-center">
23-
<span className="block font-medium text-blue-700">Outer Context Menu</span>
24-
<span className="block text-sm text-blue-600">Right-click me</span>
23+
<span className="text-blue-700 block font-medium">Outer Context Menu</span>
24+
<span className="text-blue-600 block text-sm">Right-click me</span>
2525

2626
<ContextMenu.Root>
27-
<ContextMenu.Trigger className="mt-4 inline-block rounded border-2 border-red-300 bg-red-50 p-4">
28-
<span className="block font-medium text-red-700">Inner Context Menu</span>
29-
<span className="block text-sm text-red-600">Right-click me too!</span>
27+
<ContextMenu.Trigger className="border-red-300 bg-red-50 mt-4 inline-block rounded border-2 p-4">
28+
<span className="text-red-700 block font-medium">Inner Context Menu</span>
29+
<span className="text-red-600 block text-sm">Right-click me too!</span>
3030
</ContextMenu.Trigger>
3131
<ContextMenu.Portal>
3232
<ContextMenu.Positioner className="outline-none">
@@ -72,19 +72,19 @@ export default function ContextMenuExperiment() {
7272
<p className="text-gray-600">Right-click on either box and explore the submenu options.</p>
7373

7474
<ContextMenu.Root>
75-
<ContextMenu.Trigger className="rounded-lg border-2 border-green-300 bg-green-50 p-8">
75+
<ContextMenu.Trigger className="border-green-300 bg-green-50 rounded-lg border-2 p-8">
7676
<div className="text-center">
77-
<span className="block font-medium text-green-700">
77+
<span className="text-green-700 block font-medium">
7878
Outer Context Menu with Submenu
7979
</span>
80-
<span className="block text-sm text-green-600">Right-click me</span>
80+
<span className="text-green-600 block text-sm">Right-click me</span>
8181

8282
<ContextMenu.Root>
83-
<ContextMenu.Trigger className="mt-4 inline-block rounded border-2 border-purple-300 bg-purple-50 p-4">
84-
<span className="block font-medium text-purple-700">
83+
<ContextMenu.Trigger className="border-purple-300 bg-purple-50 mt-4 inline-block rounded border-2 p-4">
84+
<span className="text-purple-700 block font-medium">
8585
Inner Context Menu with Submenu
8686
</span>
87-
<span className="block text-sm text-purple-600">Right-click me too!</span>
87+
<span className="text-purple-600 block text-sm">Right-click me too!</span>
8888
</ContextMenu.Trigger>
8989
<ContextMenu.Portal>
9090
<ContextMenu.Positioner className="outline-none">
@@ -166,10 +166,10 @@ export default function ContextMenuExperiment() {
166166
</p>
167167

168168
<ContextMenu.Root>
169-
<ContextMenu.Trigger className="rounded-lg border-2 border-orange-300 bg-orange-50 p-8">
169+
<ContextMenu.Trigger className="border-orange-300 bg-orange-50 rounded-lg border-2 p-8">
170170
<div className="text-center">
171-
<span className="block font-medium text-orange-700">Complex Context Menu</span>
172-
<span className="block text-sm text-orange-600">
171+
<span className="text-orange-700 block font-medium">Complex Context Menu</span>
172+
<span className="text-orange-600 block text-sm">
173173
Right-click me, then right-click "Special Item"
174174
</span>
175175
</div>
@@ -229,7 +229,7 @@ export default function ContextMenuExperiment() {
229229
Deep Action 2
230230
</Menu.Item>
231231
<Menu.Separator className="my-1 h-px bg-gray-200" />
232-
<Menu.Item className="cursor-default px-3 py-2 text-sm text-red-600 hover:bg-gray-100">
232+
<Menu.Item className="text-red-600 cursor-default px-3 py-2 text-sm hover:bg-gray-100">
233233
Deep Delete
234234
</Menu.Item>
235235
</Menu.Popup>
@@ -238,7 +238,7 @@ export default function ContextMenuExperiment() {
238238
</Menu.SubmenuRoot>
239239

240240
<ContextMenu.Separator className="my-1 h-px bg-gray-200" />
241-
<ContextMenu.Item className="cursor-default px-3 py-2 text-sm text-red-600 hover:bg-gray-100">
241+
<ContextMenu.Item className="text-red-600 cursor-default px-3 py-2 text-sm hover:bg-gray-100">
242242
Nested Delete
243243
</ContextMenu.Item>
244244
</ContextMenu.Popup>
@@ -247,7 +247,7 @@ export default function ContextMenuExperiment() {
247247
</ContextMenu.Root>
248248

249249
<ContextMenu.Separator className="my-1 h-px bg-gray-200" />
250-
<ContextMenu.Item className="cursor-default px-3 py-2 text-sm text-red-600 hover:bg-gray-100">
250+
<ContextMenu.Item className="text-red-600 cursor-default px-3 py-2 text-sm hover:bg-gray-100">
251251
Delete
252252
</ContextMenu.Item>
253253
</ContextMenu.Popup>
@@ -268,16 +268,16 @@ export default function ContextMenuExperiment() {
268268
</p>
269269

270270
<ContextMenu.Root>
271-
<ContextMenu.Trigger className="rounded-lg border-2 border-cyan-300 bg-cyan-50 p-8">
271+
<ContextMenu.Trigger className="border-cyan-300 bg-cyan-50 rounded-lg border-2 p-8">
272272
<div className="text-center">
273-
<span className="block font-medium text-cyan-700">Outer Context Menu</span>
274-
<span className="block text-sm text-cyan-600">Right-click me</span>
273+
<span className="text-cyan-700 block font-medium">Outer Context Menu</span>
274+
<span className="text-cyan-600 block text-sm">Right-click me</span>
275275

276276
<ContextMenu.Root>
277-
<ContextMenu.Trigger className="mt-4 flex flex-col items-center justify-center rounded-lg border-2 border-cyan-300 bg-cyan-50 p-8">
277+
<ContextMenu.Trigger className="border-cyan-300 bg-cyan-50 mt-4 flex flex-col items-center justify-center rounded-lg border-2 p-8">
278278
<div className="text-center">
279-
<span className="block font-medium text-cyan-700">Inner Context Menu</span>
280-
<span className="block text-sm text-cyan-600">Right-click me</span>
279+
<span className="text-cyan-700 block font-medium">Inner Context Menu</span>
280+
<span className="text-cyan-600 block text-sm">Right-click me</span>
281281

282282
<Popover.Root>
283283
<Popover.Trigger className="mt-2 flex items-center justify-center rounded-md border border-gray-200 bg-gray-50 p-4 text-gray-900 select-none hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-blue-800 active:bg-gray-100 data-[popup-open]:bg-gray-100">
@@ -303,11 +303,11 @@ export default function ContextMenuExperiment() {
303303
</Menu.Root>
304304

305305
<ContextMenu.Root>
306-
<ContextMenu.Trigger className="mt-4 inline-block rounded border-2 border-red-300 bg-red-50 p-4">
307-
<span className="block font-medium text-red-700">
306+
<ContextMenu.Trigger className="border-red-300 bg-red-50 mt-4 inline-block rounded border-2 p-4">
307+
<span className="text-red-700 block font-medium">
308308
Popover Context Menu
309309
</span>
310-
<span className="block text-sm text-red-600">
310+
<span className="text-red-600 block text-sm">
311311
Right-click me!
312312
</span>
313313
</ContextMenu.Trigger>

docs/src/app/(private)/experiments/menu/complex-nesting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default function MenuComplexNestingExperiment() {
115115
<Dialog.Close className="rounded px-4 py-2 text-gray-600 hover:bg-gray-100">
116116
Cancel
117117
</Dialog.Close>
118-
<Dialog.Close className="rounded bg-blue-600 px-4 py-2 hover:bg-blue-700">
118+
<Dialog.Close className="bg-blue-600 hover:bg-blue-700 rounded px-4 py-2">
119119
Save
120120
</Dialog.Close>
121121
</div>

docs/src/app/(public)/(content)/react/components/navigation-menu/demos/hero/tailwind/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function ExampleNavigationMenu() {
1414
</NavigationMenu.Trigger>
1515

1616
<NavigationMenu.Content className={contentClassName}>
17-
<ul className="xs:grid-cols-[12rem_12rem] grid list-none grid-cols-1 gap-0">
17+
<ul className="grid list-none grid-cols-1 gap-0 xs:grid-cols-[12rem_12rem]">
1818
{overviewLinks.map((item) => (
1919
<li key={item.href}>
2020
<Link href={item.href} className={linkCardClassName}>
@@ -67,7 +67,7 @@ export default function ExampleNavigationMenu() {
6767
['--easing' as string]: 'cubic-bezier(0.22, 1, 0.36, 1)',
6868
}}
6969
>
70-
<NavigationMenu.Popup className="data-[ending-style]:easing-[ease] xs:w-[var(--popup-width)] relative h-[var(--popup-height)] w-[var(--popup-width)] origin-[var(--transform-origin)] rounded-lg bg-[canvas] text-gray-900 shadow-lg shadow-gray-200 outline outline-1 outline-gray-200 transition-[opacity,transform,width,height,scale,translate] duration-[var(--duration)] ease-[var(--easing)] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300">
70+
<NavigationMenu.Popup className="data-[ending-style]:easing-[ease] relative h-[var(--popup-height)] w-[var(--popup-width)] origin-[var(--transform-origin)] rounded-lg bg-[canvas] text-gray-900 shadow-lg shadow-gray-200 outline outline-1 outline-gray-200 transition-[opacity,transform,width,height,scale,translate] duration-[var(--duration)] ease-[var(--easing)] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 xs:w-[var(--popup-width)] dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300">
7171
<NavigationMenu.Arrow className="flex transition-[left] duration-[var(--duration)] ease-[var(--easing)] data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180">
7272
<ArrowSvg />
7373
</NavigationMenu.Arrow>

docs/src/app/(public)/(content)/react/components/toast/demos/hero/tailwind/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function ToastButton() {
3030
return (
3131
<button
3232
type="button"
33-
className="focus-visible:outline-blue box-border flex h-10 items-center justify-center rounded-md border border-gray-200 bg-gray-50 px-3.5 py-0 font-medium text-gray-900 outline-0 select-none hover:bg-gray-100 focus-visible:outline-2 focus-visible:-outline-offset-1 active:bg-gray-100"
33+
className="box-border flex h-10 items-center justify-center rounded-md border border-gray-200 bg-gray-50 px-3.5 py-0 font-medium text-gray-900 outline-0 select-none hover:bg-gray-100 focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-blue active:bg-gray-100"
3434
onClick={createToast}
3535
>
3636
Create toast

docs/src/app/(public)/(content)/react/components/toast/demos/position/tailwind/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function ToastButton() {
3030
return (
3131
<button
3232
type="button"
33-
className="focus-visible:outline-blue box-border flex h-10 items-center justify-center rounded-md border border-gray-200 bg-gray-50 px-3.5 py-0 font-medium text-gray-900 outline-0 select-none hover:bg-gray-100 focus-visible:outline-2 focus-visible:-outline-offset-1 active:bg-gray-100"
33+
className="box-border flex h-10 items-center justify-center rounded-md border border-gray-200 bg-gray-50 px-3.5 py-0 font-medium text-gray-900 outline-0 select-none hover:bg-gray-100 focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-blue active:bg-gray-100"
3434
onClick={createToast}
3535
>
3636
Create toast

docs/src/app/(public)/careers/design-engineer/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Homepage() {
1111
<Header />
1212
<div className="ContentLayoutMain">
1313
<h1 className="mb-4 text-3xl font-bold text-balance">Design Engineer</h1>
14-
<p className="text-gray -mt-2 mb-5 text-lg text-pretty">
14+
<p className="-mt-2 mb-5 text-lg text-pretty text-gray">
1515
Help us make Base UI the most intuitive, accessible, and powerful open-source UI library
1616
for React.
1717
</p>

docs/src/components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function Header() {
1717
<NextLink href="/" className="HeaderLogoLink">
1818
<Logo aria-label="Base UI" />
1919
</NextLink>
20-
<div className="max-show-side-nav:hidden flex gap-6">
20+
<div className="flex gap-6 max-show-side-nav:hidden">
2121
<a
2222
className="HeaderLink"
2323
href="https://www.npmjs.com/package/@base-ui-components/react"
@@ -31,7 +31,7 @@ export function Header() {
3131
GitHub
3232
</a>
3333
</div>
34-
<div className="show-side-nav:hidden flex">
34+
<div className="flex show-side-nav:hidden">
3535
<MobileNav.Root>
3636
<MobileNav.Trigger className="HeaderButton">
3737
<span className="flex w-4 flex-col items-center gap-1">

docs/src/components/ReferenceTable/AttributesReferenceTable.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ export async function AttributesReferenceTable({ data, ...props }: AttributesRef
4848
</svg>
4949
</Accordion.Trigger>
5050
<Accordion.Panel>
51-
<Accordion.Content className="text-md flex flex-col gap-3 p-4 text-pretty">
51+
<Accordion.Content className="flex flex-col gap-3 p-4 text-md text-pretty">
5252
<AttributeDescription />
5353
</Accordion.Content>
5454
</Accordion.Panel>
5555
</Accordion.Item>
5656
);
5757
})}
5858
</Accordion.Root>
59-
<Table.Root {...props} className={clsx('xs:block hidden', props.className)}>
59+
<Table.Root {...props} className={clsx('hidden xs:block', props.className)}>
6060
<Table.Head>
6161
<Table.Row>
6262
{/* widths must match the props table grid layout */}
63-
<Table.ColumnHeader className="xs:w-48 w-full sm:w-56 md:w-[calc(5/16.5*100%)]">
63+
<Table.ColumnHeader className="w-full xs:w-48 sm:w-56 md:w-[calc(5/16.5*100%)]">
6464
Attribute
6565
</Table.ColumnHeader>
6666
<Table.ColumnHeader className="xs:w-2/3 md:w-[calc(11.5/16.5*100%)]">
67-
<div className="xs:not-sr-only xs:contents sr-only">Description</div>
67+
<div className="sr-only xs:not-sr-only xs:contents">Description</div>
6868
</Table.ColumnHeader>
6969
{/* A cell to maintain a layout consistent with the props table */}
70-
<Table.ColumnHeader className="max-xs:hidden w-10" aria-hidden role="presentation" />
70+
<Table.ColumnHeader className="w-10 max-xs:hidden" aria-hidden role="presentation" />
7171
</Table.Row>
7272
</Table.Head>
7373
<Table.Body>

docs/src/components/ReferenceTable/CssVariablesReferenceTable.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function CssVariablesReferenceTable({
5151
</svg>
5252
</Accordion.Trigger>
5353
<Accordion.Panel>
54-
<Accordion.Content className="text-md flex flex-col gap-3 p-4 text-pretty">
54+
<Accordion.Content className="flex flex-col gap-3 p-4 text-md text-pretty">
5555
<AttributeDescription />
5656
</Accordion.Content>
5757
</Accordion.Panel>
@@ -60,18 +60,18 @@ export async function CssVariablesReferenceTable({
6060
})}
6161
</Accordion.Root>
6262

63-
<Table.Root {...props} className={clsx('xs:block hidden', props.className)}>
63+
<Table.Root {...props} className={clsx('hidden xs:block', props.className)}>
6464
<Table.Head>
6565
<Table.Row>
6666
{/* widths must match the props table grid layout */}
67-
<Table.ColumnHeader className="xs:w-48 w-full sm:w-56 md:w-[calc(5/16.5*100%)]">
67+
<Table.ColumnHeader className="w-full xs:w-48 sm:w-56 md:w-[calc(5/16.5*100%)]">
6868
CSS Variable
6969
</Table.ColumnHeader>
7070
<Table.ColumnHeader className="xs:w-2/3 md:w-[calc(11.5/16.5*100%)]">
71-
<div className="xs:not-sr-only xs:contents sr-only">Description</div>
71+
<div className="sr-only xs:not-sr-only xs:contents">Description</div>
7272
</Table.ColumnHeader>
7373
{/* A cell to maintain a layout consistent with the props table */}
74-
<Table.ColumnHeader className="max-xs:hidden w-10" aria-hidden role="presentation" />
74+
<Table.ColumnHeader className="w-10 max-xs:hidden" aria-hidden role="presentation" />
7575
</Table.Row>
7676
</Table.Head>
7777
<Table.Body>

docs/src/components/ReferenceTable/PropsReferenceAccordion.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ export async function PropsReferenceAccordion({
176176
className={clsx('min-h-min scroll-mt-12 p-0 md:scroll-mt-0', TRIGGER_GRID_LAYOUT)}
177177
>
178178
<Accordion.Scrollable className="px-3">
179-
<TableCode className="text-navy whitespace-nowrap">
179+
<TableCode className="whitespace-nowrap text-navy">
180180
{name}
181181
{prop.required ? <sup className="top-[-0.3em] text-xs text-red-800">*</sup> : ''}
182182
</TableCode>
183183
</Accordion.Scrollable>
184184
{prop.type && (
185-
<Accordion.Scrollable className="max-xs:hidden flex items-baseline px-3 text-sm leading-none break-keep whitespace-nowrap">
185+
<Accordion.Scrollable className="flex items-baseline px-3 text-sm leading-none break-keep whitespace-nowrap max-xs:hidden">
186186
{hasExpandedType || detailedType ? (
187187
<ReferenceTableTooltip.Root delay={300} hoverable={false}>
188188
<ReferenceTableTooltip.Trigger render={<ShortPropType />} />
@@ -202,7 +202,7 @@ export async function PropsReferenceAccordion({
202202
<PropDefault />
203203
)}
204204
</Accordion.Scrollable>
205-
<div className="max-xs:ml-auto max-xs:mr-3 flex justify-center">
205+
<div className="flex justify-center max-xs:mr-3 max-xs:ml-auto">
206206
<svg
207207
className="AccordionIcon translate-y-px"
208208
width="10"
@@ -218,7 +218,7 @@ export async function PropsReferenceAccordion({
218218
<Accordion.Panel>
219219
<Accordion.Content>
220220
<DescriptionList.Root
221-
className={clsx('max-xs:py-3 text-gray-600', PANEL_GRID_LAYOUT)}
221+
className={clsx('text-gray-600 max-xs:py-3', PANEL_GRID_LAYOUT)}
222222
aria-label="Info"
223223
>
224224
<DescriptionList.Item>

0 commit comments

Comments
 (0)