From 34ff87d504836ff71b3bb2d466842c00ee3c5ec2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 8 Nov 2025 01:59:02 +0000 Subject: chore: format code --- packages/ui/src/components/checkbox.tsx | 13 ++----------- packages/ui/src/components/dialog.tsx | 6 +----- packages/ui/src/components/diff-changes.tsx | 6 +----- packages/ui/src/components/diff.tsx | 22 +++------------------- packages/ui/src/components/icon-button.tsx | 6 +----- packages/ui/src/components/input.tsx | 7 +------ packages/ui/src/components/list.tsx | 8 +------- packages/ui/src/components/message-part.tsx | 21 ++++----------------- packages/ui/src/components/progress-circle.tsx | 16 ++-------------- packages/ui/src/components/select-dialog.tsx | 22 ++++++++++------------ packages/ui/src/components/select.tsx | 4 +--- packages/ui/src/components/typewriter.tsx | 6 +----- packages/ui/src/demo.tsx | 24 +++++------------------- packages/ui/src/hooks/use-filtered-list.tsx | 8 ++------ packages/ui/src/styles/base.css | 4 ++-- packages/ui/src/styles/theme.css | 9 +++------ 16 files changed, 40 insertions(+), 142 deletions(-) (limited to 'packages/ui/src') diff --git a/packages/ui/src/components/checkbox.tsx b/packages/ui/src/components/checkbox.tsx index ac9abfdab..2009a430b 100644 --- a/packages/ui/src/components/checkbox.tsx +++ b/packages/ui/src/components/checkbox.tsx @@ -9,14 +9,7 @@ export interface CheckboxProps extends ParentProps local.children) return ( @@ -42,9 +35,7 @@ export function Checkbox(props: CheckboxProps) { - - {local.description} - + {local.description} diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index fdbb9022d..ce7a4b3ac 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -38,11 +38,7 @@ export function DialogRoot(props: DialogProps) { return ( - + {props.trigger} diff --git a/packages/ui/src/components/diff-changes.tsx b/packages/ui/src/components/diff-changes.tsx index 3095ddbdb..a8ab737f7 100644 --- a/packages/ui/src/components/diff-changes.tsx +++ b/packages/ui/src/components/diff-changes.tsx @@ -93,11 +93,7 @@ export function DiffChanges(props: { return ( 0 : true}> -
+
diff --git a/packages/ui/src/components/diff.tsx b/packages/ui/src/components/diff.tsx index 21ff980c1..a53d5b3f3 100644 --- a/packages/ui/src/components/diff.tsx +++ b/packages/ui/src/components/diff.tsx @@ -23,13 +23,7 @@ export type DiffProps = FileDiffOptions & { export function Diff(props: DiffProps) { let container!: HTMLDivElement - const [local, others] = splitProps(props, [ - "before", - "after", - "class", - "classList", - "annotations", - ]) + const [local, others] = splitProps(props, ["before", "after", "class", "classList", "annotations"]) // const lineAnnotations: DiffLineAnnotation[] = [ // { @@ -226,13 +220,7 @@ registerCustomTheme("OpenCode", () => { }, }, { - scope: [ - "constant", - "entity.name.constant", - "variable.other.constant", - "variable.language", - "entity", - ], + scope: ["constant", "entity.name.constant", "variable.other.constant", "variable.language", "entity"], settings: { foreground: "var(--syntax-constant)", }, @@ -320,11 +308,7 @@ registerCustomTheme("OpenCode", () => { }, }, { - scope: [ - "support.type.object.module", - "variable.other.object", - "support.type.property-name.css", - ], + scope: ["support.type.object.module", "variable.other.object", "support.type.property-name.css"], settings: { foreground: "var(--syntax-object)", }, diff --git a/packages/ui/src/components/icon-button.tsx b/packages/ui/src/components/icon-button.tsx index fccdebd04..79a7cb9c9 100644 --- a/packages/ui/src/components/icon-button.tsx +++ b/packages/ui/src/components/icon-button.tsx @@ -22,11 +22,7 @@ export function IconButton(props: ComponentProps<"button"> & IconButtonProps) { [split.class ?? ""]: !!split.class, }} > - + ) } diff --git a/packages/ui/src/components/input.tsx b/packages/ui/src/components/input.tsx index 7688d9fc5..9557e90f3 100644 --- a/packages/ui/src/components/input.tsx +++ b/packages/ui/src/components/input.tsx @@ -21,12 +21,7 @@ export function Input(props: InputProps) { "onKeyDown", ]) return ( - + {local.label} diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx index 766979ae6..aaba61fdf 100644 --- a/packages/ui/src/components/list.tsx +++ b/packages/ui/src/components/list.tsx @@ -62,13 +62,7 @@ export function List(props: ListProps) { }) return ( - + {(item) => ( @@ -93,12 +88,7 @@ export function Part(props: MessagePartProps) { const component = createMemo(() => PART_MAPPING[props.part.type]) return ( - + ) } @@ -226,10 +216,7 @@ ToolRegistry.register({ name: "list", render(props) { return ( - +
{props.output}
diff --git a/packages/ui/src/components/progress-circle.tsx b/packages/ui/src/components/progress-circle.tsx index a659c0f2e..f2e497fe5 100644 --- a/packages/ui/src/components/progress-circle.tsx +++ b/packages/ui/src/components/progress-circle.tsx @@ -7,13 +7,7 @@ export interface ProgressCircleProps extends Pick, "class" } export function ProgressCircle(props: ProgressCircleProps) { - const [split, rest] = splitProps(props, [ - "percentage", - "size", - "strokeWidth", - "class", - "classList", - ]) + const [split, rest] = splitProps(props, ["percentage", "size", "strokeWidth", "class", "classList"]) const size = () => split.size || 16 const strokeWidth = () => split.strokeWidth || 3 @@ -42,13 +36,7 @@ export function ProgressCircle(props: ProgressCircleProps) { [split.class ?? ""]: !!split.class, }} > - + (props: SelectDialogProps) { mouseActive: false, }) - const { filter, grouped, flat, reset, clear, active, setActive, onKeyDown, onInput } = - useFilteredList({ - items: others.items, - key: others.key, - filterKeys: others.filterKeys, - current: others.current, - groupBy: others.groupBy, - sortBy: others.sortBy, - sortGroupsBy: others.sortGroupsBy, - }) + const { filter, grouped, flat, reset, clear, active, setActive, onKeyDown, onInput } = useFilteredList({ + items: others.items, + key: others.key, + filterKeys: others.filterKeys, + current: others.current, + groupBy: others.groupBy, + sortBy: others.sortBy, + sortGroupsBy: others.sortGroupsBy, + }) createEffect(() => { filter() @@ -118,8 +117,7 @@ export function SelectDialog(props: SelectDialogProps) { fallback={
- {props.emptyMessage ?? "No search results"} for{" "} - "{filter()}" + {props.emptyMessage ?? "No search results"} for "{filter()}"
} diff --git a/packages/ui/src/components/select.tsx b/packages/ui/src/components/select.tsx index 305e8a4f8..dea6743ee 100644 --- a/packages/ui/src/components/select.tsx +++ b/packages/ui/src/components/select.tsx @@ -49,9 +49,7 @@ export function Select(props: SelectProps & ButtonProps) { {...itemProps} > - {props.label - ? props.label(itemProps.item.rawValue) - : (itemProps.item.rawValue as string)} + {props.label ? props.label(itemProps.item.rawValue) : (itemProps.item.rawValue as string)} diff --git a/packages/ui/src/components/typewriter.tsx b/packages/ui/src/components/typewriter.tsx index 9adb267ad..2f6ecb016 100644 --- a/packages/ui/src/components/typewriter.tsx +++ b/packages/ui/src/components/typewriter.tsx @@ -2,11 +2,7 @@ import { createEffect, Show, type ValidComponent } from "solid-js" import { createStore } from "solid-js/store" import { Dynamic } from "solid-js/web" -export const Typewriter = (props: { - text?: string - class?: string - as?: T -}) => { +export const Typewriter = (props: { text?: string; class?: string; as?: T }) => { const [store, setStore] = createStore({ typing: false, displayed: "", diff --git a/packages/ui/src/demo.tsx b/packages/ui/src/demo.tsx index 6d60c25ae..96579c999 100644 --- a/packages/ui/src/demo.tsx +++ b/packages/ui/src/demo.tsx @@ -141,9 +141,7 @@ const Demo: Component = () => { - setInputValue(e.currentTarget.value) - } + onInput={(e: InputEvent & { currentTarget: HTMLInputElement }) => setInputValue(e.currentTarget.value)} /> @@ -160,15 +158,8 @@ const Demo: Component = () => { checked={checked()} onChange={setChecked} /> - - + + { Example Dialog - - This is an example dialog with a title and description. - + This is an example dialog with a title and description.
{
-

- Kobalte is a UI toolkit for building accessible web apps and design systems with - SolidJS. -

+

Kobalte is a UI toolkit for building accessible web apps and design systems with SolidJS.

diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index ca9bc5388..e0cb6e7aa 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -11,10 +11,7 @@ export interface FilteredListProps { current?: T groupBy?: (x: T) => string sortBy?: (a: T, b: T) => number - sortGroupsBy?: ( - a: { category: string; items: T[] }, - b: { category: string; items: T[] }, - ) => number + sortGroupsBy?: (a: { category: string; items: T[] }, b: { category: string; items: T[] }) => number onSelect?: (value: T | undefined) => void } @@ -25,8 +22,7 @@ export function useFilteredList(props: FilteredListProps) { () => store.filter, async (filter) => { const needle = filter?.toLowerCase() - const all = - (typeof props.items === "function" ? await props.items(needle) : props.items) || [] + const all = (typeof props.items === "function" ? await props.items(needle) : props.items) || [] const result = pipe( all, (x) => { diff --git a/packages/ui/src/styles/base.css b/packages/ui/src/styles/base.css index 02b473238..b80398e1d 100644 --- a/packages/ui/src/styles/base.css +++ b/packages/ui/src/styles/base.css @@ -269,8 +269,8 @@ textarea, crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194) */ -@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or - (contain-intrinsic-size: 1px) /* Safari 17+ */ { +@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) + /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); } diff --git a/packages/ui/src/styles/theme.css b/packages/ui/src/styles/theme.css index 431d811da..2f05aad56 100644 --- a/packages/ui/src/styles/theme.css +++ b/packages/ui/src/styles/theme.css @@ -50,11 +50,9 @@ --radius-4xl: 2rem; --shadow-xs: - 0 1px 2px -1px rgba(19, 16, 16, 0.04), 0 1px 2px 0 rgba(19, 16, 16, 0.06), - 0 1px 3px 0 rgba(19, 16, 16, 0.08); + 0 1px 2px -1px rgba(19, 16, 16, 0.04), 0 1px 2px 0 rgba(19, 16, 16, 0.06), 0 1px 3px 0 rgba(19, 16, 16, 0.08); --shadow-md: - 0 6px 8px -4px rgba(19, 16, 16, 0.12), 0 4px 3px -2px rgba(19, 16, 16, 0.12), - 0 1px 2px -1px rgba(19, 16, 16, 0.12); + 0 6px 8px -4px rgba(19, 16, 16, 0.12), 0 4px 3px -2px rgba(19, 16, 16, 0.12), 0 1px 2px -1px rgba(19, 16, 16, 0.12); --shadow-xs-border: 0 0 0 1px var(--border-base, rgba(11, 6, 0, 0.2)), 0 1px 2px -1px rgba(19, 16, 16, 0.04), 0 1px 2px 0 rgba(19, 16, 16, 0.06), 0 1px 3px 0 rgba(19, 16, 16, 0.08); @@ -64,8 +62,7 @@ 0 1px 2px 0 rgba(19, 16, 16, 0.08), 0 1px 3px 0 rgba(19, 16, 16, 0.12); --shadow-xs-border-focus: 0 0 0 1px var(--border-base, rgba(11, 6, 0, 0.2)), 0 1px 2px -1px rgba(19, 16, 16, 0.25), - 0 1px 2px 0 rgba(19, 16, 16, 0.08), 0 1px 3px 0 rgba(19, 16, 16, 0.12), - 0 0 0 2px var(--background-weak, #f1f0f0), + 0 1px 2px 0 rgba(19, 16, 16, 0.08), 0 1px 3px 0 rgba(19, 16, 16, 0.12), 0 0 0 2px var(--background-weak, #f1f0f0), 0 0 0 3px var(--border-selected, rgba(0, 74, 255, 0.99)); --text-mix-blend-mode: multiply; -- cgit v1.2.3