Skip to content

Commit 20a2331

Browse files
authored
enable Oxfmt TW classes sort, bump dependencies (#2144)
1 parent 77ea66f commit 20a2331

62 files changed

Lines changed: 308 additions & 271 deletions

Some content is hidden

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

.oxfmtrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"README.md",
1818
"next-env.d.ts"
1919
],
20+
"experimentalTailwindcss": {
21+
"functions": ["tw"]
22+
},
2023
"experimentalSortImports": {
2124
"groups": [
2225
["side-effect"],

bun.lock

Lines changed: 79 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/styleguide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function createTextComponent(
5656
id={id}
5757
numberOfLines={numberOfLines}
5858
style={[
59-
tw`font-sans font-normal my-0 text-black dark:text-white`,
59+
tw`font-sans my-0 font-normal text-black dark:text-white`,
6060
elementStyle as StyleProp<Style>,
6161
textStyle,
6262
style,

components/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function Button({
2424
}: Props) {
2525
const isLink = !!href;
2626
const buttonStyle = [
27-
tw`justify-center items-center rounded outline-offset-1 cursor-pointer select-none bg-primary-darker dark:bg-primary-dark`,
27+
tw`cursor-pointer select-none items-center justify-center rounded bg-primary-darker outline-offset-1 dark:bg-primary-dark`,
2828
style,
2929
] as ViewStyle[];
3030

@@ -39,7 +39,7 @@ export function Button({
3939
<A
4040
href={href}
4141
role="button"
42-
style={[tw`rounded font-sans no-underline`, containerStyle]}
42+
style={[tw`font-sans rounded no-underline`, containerStyle]}
4343
{...(openInNewTab ? { target: '_blank' } : {})}
4444
{...(href?.startsWith('#') ? { target: '_self' } : {})}
4545
{...rest}>

components/CheckBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function CheckBox({ style, value }: Props) {
1313
return (
1414
<View
1515
style={[
16-
tw`size-[18px] items-center justify-center border-2 rounded-sm mr-2`,
16+
tw`mr-2 size-[18px] items-center justify-center rounded-sm border-2`,
1717
value
1818
? tw`border-primary-dark bg-primary-dark`
1919
: tw`border-palette-gray4 bg-white dark:border-default dark:bg-dark`,

components/CompatibilityTags.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export default function CompatibilityTags({ library }: Props) {
2929
{library.dev ? (
3030
<Tag
3131
label="Development Tool"
32-
tagStyle={tw`bg-[#ece3fc] border-[#d9c8fa] dark:bg-[#261a3d] dark:border-[#3d2861]`}
32+
tagStyle={tw`border-[#d9c8fa] bg-[#ece3fc] dark:border-[#3d2861] dark:bg-[#261a3d]`}
3333
icon={null}
3434
/>
3535
) : null}
3636
{library.template ? (
3737
<Tag
3838
label="Template"
39-
tagStyle={tw`bg-[#fce1f5] border-[#f5c6e8] dark:bg-[#37172e] dark:border-[#52213e]`}
39+
tagStyle={tw`border-[#f5c6e8] bg-[#fce1f5] dark:border-[#52213e] dark:bg-[#37172e]`}
4040
icon={null}
4141
/>
4242
) : null}
@@ -46,7 +46,7 @@ export default function CompatibilityTags({ library }: Props) {
4646
<Tag
4747
label={platform}
4848
key={`${platform}-platform`}
49-
tagStyle={tw`bg-palette-gray1 border-palette-gray2 dark:bg-dark dark:border-default`}
49+
tagStyle={tw`border-palette-gray2 bg-palette-gray1 dark:border-default dark:bg-dark`}
5050
/>
5151
) : null
5252
)}
@@ -55,7 +55,7 @@ export default function CompatibilityTags({ library }: Props) {
5555
side="bottom"
5656
trigger={
5757
<View
58-
style={tw`items-center justify-center cursor-pointer rounded-full`}
58+
style={tw`cursor-pointer items-center justify-center rounded-full`}
5959
role="button"
6060
aria-label="Additional information">
6161
<Info style={tw`text-icon`} />
@@ -74,7 +74,7 @@ export default function CompatibilityTags({ library }: Props) {
7474
<br />
7575
<A
7676
href={`https://www.npmjs.com/package/${library.vegaos}`}
77-
style={tw`text-xs text-white font-light`}>
77+
style={tw`text-xs font-light text-white`}>
7878
(via dedicated support package)
7979
</A>
8080
</li>

components/ContentContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { View, type ViewProps } from 'react-native';
44
import tw from '~/util/tailwind';
55

66
export default function ContentContainer({ children, style }: PropsWithChildren<ViewProps>) {
7-
return <View style={[tw`w-full mx-auto max-w-layout flex-1`, style]}>{children}</View>;
7+
return <View style={[tw`mx-auto w-full max-w-layout flex-1`, style]}>{children}</View>;
88
}

components/Explore/ExploreSection.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ export default function ExploreSection({
4141

4242
return (
4343
<>
44-
<H3 style={tw`flex gap-3 pt-3 pb-2 px-2 items-center`} id={hashLink}>
45-
{icon && createElement(icon, { style: tw`size-7.5 text-icon mt-px` })}
44+
<H3 style={tw`flex items-center gap-3 px-2 pb-2 pt-3`} id={hashLink}>
45+
{icon && createElement(icon, { style: tw`size-7.5 mt-px text-icon` })}
4646
<A
4747
href={`#${hashLink}`}
4848
target="_self"
49-
style={tw`no-underline text-icon`}
49+
style={tw`text-icon no-underline`}
5050
hoverStyle={tw`text-palette-gray4 dark:text-palette-gray5`}>
5151
{title}
5252
</A>
5353
</H3>
54-
<View style={tw`pt-3 flex-1 flex-row flex-wrap`}>
54+
<View style={tw`flex-1 flex-row flex-wrap pt-3`}>
5555
{renderLibs(data.filter(filter), count)}
5656
</View>
57-
<P style={tw`px-6 pt-2 pb-6 text-sm font-light text-secondary`}>
57+
<P style={tw`px-6 pb-6 pt-2 text-sm font-light text-secondary`}>
5858
Want to see more? Check out other{' '}
5959
<A href={urlWithQuery('/packages', { ...queryParams, ...DEFAULT_PARAMS })} target="_self">
6060
{title} libraries

components/Filters/FilterButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function FilterButton({ isFilterVisible, query, onPress, onClearAllPress,
4646
onPress={onPress}
4747
containerStyle={tw`h-full flex-grow`}
4848
style={[
49-
tw`h-full px-2 bg-accented`,
49+
tw`h-full bg-accented px-2`,
5050
isFilterVisible && tw`bg-primary-dark`,
5151
isFilterCount && tw`rounded-r-none`,
5252
]}>
@@ -58,14 +58,14 @@ export function FilterButton({ isFilterVisible, query, onPress, onClearAllPress,
5858
height={12}
5959
/>
6060
</View>
61-
<P style={tw`text-sm ml-1.5 text-white select-none`}>
61+
<P style={tw`ml-1.5 select-none text-sm text-white`}>
6262
Filters{isFilterCount ? `: ${filterCount}` : ''}
6363
</P>
6464
</View>
6565
</Button>
6666
{filterCount > 0 && (
6767
<View
68-
style={tw`h-full justify-center items-center rounded-r border-l border-palette-gray6 bg-accented dark:border-dark`}>
68+
style={tw`h-full items-center justify-center rounded-r border-l border-palette-gray6 bg-accented dark:border-dark`}>
6969
<ClearButton onPress={onClearAllPress} />
7070
</View>
7171
)}

components/Filters/FiltersSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function FiltersSection({ title, children, rightSlot }: Props) {
1313
const { isSmallScreen } = useLayout();
1414

1515
return (
16-
<View style={[tw`px-4 py-2 max-w-layout`, isSmallScreen && tw`max-w-full`]}>
16+
<View style={[tw`max-w-layout px-4 py-2`, isSmallScreen && tw`max-w-full`]}>
1717
<Headline style={[tw`mb-2 font-semibold text-secondary`, rightSlot && tw`mb-1`]}>
1818
{title}
1919
{rightSlot}

0 commit comments

Comments
 (0)