mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-05 07:24:08 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import classNames from 'classnames';
|
||||
import type { ComponentType, ForwardedRef, HTMLAttributes, ReactNode } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
import classNames from "classnames";
|
||||
import type { ComponentType, ForwardedRef, HTMLAttributes, ReactNode } from "react";
|
||||
import { forwardRef } from "react";
|
||||
|
||||
const gapClasses = {
|
||||
0: 'gap-0',
|
||||
0.5: 'gap-0.5',
|
||||
1: 'gap-1',
|
||||
1.5: 'gap-1.5',
|
||||
2: 'gap-2',
|
||||
3: 'gap-3',
|
||||
4: 'gap-4',
|
||||
5: 'gap-5',
|
||||
6: 'gap-6',
|
||||
0: "gap-0",
|
||||
0.5: "gap-0.5",
|
||||
1: "gap-1",
|
||||
1.5: "gap-1.5",
|
||||
2: "gap-2",
|
||||
3: "gap-3",
|
||||
4: "gap-4",
|
||||
5: "gap-5",
|
||||
6: "gap-6",
|
||||
};
|
||||
|
||||
interface HStackProps extends BaseStackProps {
|
||||
@@ -19,14 +19,14 @@ interface HStackProps extends BaseStackProps {
|
||||
}
|
||||
|
||||
export const HStack = forwardRef(function HStack(
|
||||
{ className, space, children, alignItems = 'center', ...props }: HStackProps,
|
||||
{ className, space, children, alignItems = "center", ...props }: HStackProps,
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
ref: ForwardedRef<any>,
|
||||
) {
|
||||
return (
|
||||
<BaseStack
|
||||
ref={ref}
|
||||
className={classNames(className, 'flex-row', space != null && gapClasses[space])}
|
||||
className={classNames(className, "flex-row", space != null && gapClasses[space])}
|
||||
alignItems={alignItems}
|
||||
{...props}
|
||||
>
|
||||
@@ -47,7 +47,7 @@ export const VStack = forwardRef(function VStack(
|
||||
return (
|
||||
<BaseStack
|
||||
ref={ref}
|
||||
className={classNames(className, 'flex-col', space != null && gapClasses[space])}
|
||||
className={classNames(className, "flex-col", space != null && gapClasses[space])}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
@@ -56,10 +56,10 @@ export const VStack = forwardRef(function VStack(
|
||||
});
|
||||
|
||||
type BaseStackProps = HTMLAttributes<HTMLElement> & {
|
||||
as?: ComponentType | 'ul' | 'label' | 'form' | 'p';
|
||||
as?: ComponentType | "ul" | "label" | "form" | "p";
|
||||
space?: keyof typeof gapClasses;
|
||||
alignItems?: 'start' | 'center' | 'stretch' | 'end';
|
||||
justifyContent?: 'start' | 'center' | 'end' | 'between';
|
||||
alignItems?: "start" | "center" | "stretch" | "end";
|
||||
justifyContent?: "start" | "center" | "end" | "between";
|
||||
wrap?: boolean;
|
||||
};
|
||||
|
||||
@@ -68,22 +68,22 @@ const BaseStack = forwardRef(function BaseStack(
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
ref: ForwardedRef<any>,
|
||||
) {
|
||||
const Component = as ?? 'div';
|
||||
const Component = as ?? "div";
|
||||
return (
|
||||
<Component
|
||||
ref={ref}
|
||||
className={classNames(
|
||||
className,
|
||||
'flex',
|
||||
wrap && 'flex-wrap',
|
||||
alignItems === 'center' && 'items-center',
|
||||
alignItems === 'start' && 'items-start',
|
||||
alignItems === 'stretch' && 'items-stretch',
|
||||
alignItems === 'end' && 'items-end',
|
||||
justifyContent === 'start' && 'justify-start',
|
||||
justifyContent === 'center' && 'justify-center',
|
||||
justifyContent === 'end' && 'justify-end',
|
||||
justifyContent === 'between' && 'justify-between',
|
||||
"flex",
|
||||
wrap && "flex-wrap",
|
||||
alignItems === "center" && "items-center",
|
||||
alignItems === "start" && "items-start",
|
||||
alignItems === "stretch" && "items-stretch",
|
||||
alignItems === "end" && "items-end",
|
||||
justifyContent === "start" && "justify-start",
|
||||
justifyContent === "center" && "justify-center",
|
||||
justifyContent === "end" && "justify-end",
|
||||
justifyContent === "between" && "justify-between",
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user