Skip to content

Commit

Permalink
more tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jul 22, 2024
1 parent 18a2383 commit 52325d0
Show file tree
Hide file tree
Showing 115 changed files with 236 additions and 342 deletions.
10 changes: 2 additions & 8 deletions packages/bits-ui/src/lib/bits/accordion/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import type {
EventCallback,
OnChangeFn,
PrimitiveButtonAttributes,
PrimitiveDivAttributes,
WithChild,
Without,
} from "$lib/internal/index.js";
import type { EventCallback, OnChangeFn, WithChild, Without } from "$lib/internal/index.js";
import type { PrimitiveButtonAttributes, PrimitiveDivAttributes } from "$lib/shared/attributes.js";
import type { Orientation } from "$lib/shared/index.js";

export type BaseAccordionRootPropsWithoutHTML = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<DismissableLayer {...mergedProps} enabled={present.current}>
<TextSelectionLayer {...mergedProps} enabled={present.current}>
{#if child}
{@render child?.({
{@render child({
props: mergeProps(mergedProps, focusScopeProps, {
hidden: !present.current,
}),
Expand Down
3 changes: 2 additions & 1 deletion packages/bits-ui/src/lib/bits/aspect-ratio/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PrimitiveDivAttributes, WithChild, Without } from "$lib/internal/index.js";
import type { WithChild, Without } from "$lib/internal/index.js";
import type { PrimitiveDivAttributes } from "$lib/shared/attributes.js";

export type AspectRatioPropsWithoutHTML = WithChild<{
ratio?: number;
Expand Down
6 changes: 2 additions & 4 deletions packages/bits-ui/src/lib/bits/avatar/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { OnChangeFn, WithChild, Without } from "$lib/internal/index.js";
import type {
OnChangeFn,
PrimitiveDivAttributes,
PrimitiveImgAttributes,
PrimitiveSpanAttributes,
WithChild,
Without,
} from "$lib/internal/index.js";
} from "$lib/shared/attributes.js";

export type AvatarImageLoadingStatus = "loading" | "loaded" | "error";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</script>

{#if child}
{@render child?.({
{@render child({
props: mergedProps,
...cellState.snippetProps,
})}
Expand Down
8 changes: 3 additions & 5 deletions packages/bits-ui/src/lib/bits/calendar/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { DateValue } from "@internationalized/date";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/types.js";
import type { DateMatcher, Month, WeekStartsOn } from "$lib/shared/date/types.js";
import type {
OnChangeFn,
PrimitiveButtonAttributes,
PrimitiveDivAttributes,
PrimitiveHeaderAttributes,
Expand All @@ -10,10 +11,7 @@ import type {
PrimitiveThAttributes,
PrimitiveTheadAttrbutes,
PrimitiveTrAttributes,
WithChild,
Without,
} from "$lib/internal/types.js";
import type { DateMatcher, Month, WeekStartsOn } from "$lib/shared/date/types.js";
} from "$lib/shared/attributes.js";

export type CalendarRootSnippetProps = {
months: Month<DateValue>[];
Expand Down
8 changes: 2 additions & 6 deletions packages/bits-ui/src/lib/bits/checkbox/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type {
OnChangeFn,
PrimitiveButtonAttributes,
WithChild,
Without,
} from "$lib/internal/index.js";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/index.js";
import type { PrimitiveButtonAttributes } from "$lib/shared/attributes.js";

export type CheckboxRootSnippetProps = { checked: boolean | "indeterminate" };

Expand Down
9 changes: 2 additions & 7 deletions packages/bits-ui/src/lib/bits/collapsible/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type {
OnChangeFn,
PrimitiveButtonAttributes,
PrimitiveDivAttributes,
WithChild,
Without,
} from "$lib/internal/index.js";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/index.js";
import type { PrimitiveButtonAttributes, PrimitiveDivAttributes } from "$lib/shared/attributes.js";

export type CollapsibleRootPropsWithoutHTML = WithChild<{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
},
})}
{#if child}
{@render child?.({ props: finalProps })}
{@render child({ props: finalProps })}
{:else}
<div {...finalProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
7 changes: 2 additions & 5 deletions packages/bits-ui/src/lib/bits/combobox/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { OnChangeFn, WithChild, WithChildren, Without } from "$lib/internal/types.js";
import type {
OnChangeFn,
PrimitiveButtonAttributes,
PrimitiveDivAttributes,
PrimitiveInputAttributes,
WithChild,
WithChildren,
Without,
} from "$lib/internal/types.js";
} from "$lib/shared/attributes.js";
import type { PortalProps } from "../utilities/portal/types.js";
import type { PopperLayerProps } from "../utilities/popper-layer/types.js";
import type { ArrowProps, ArrowPropsWithoutHTML } from "../utilities/arrow/types.js";
Expand Down
3 changes: 2 additions & 1 deletion packages/bits-ui/src/lib/bits/context-menu/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { MenuContentProps, MenuContentPropsWithoutHTML } from "../menu/types.js";
import type { PrimitiveDivAttributes, WithChild, Without } from "$lib/internal/types.js";
import type { WithChild, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes } from "$lib/shared/attributes.js";

export type ContextMenuContentPropsWithoutHTML = MenuContentPropsWithoutHTML;

Expand Down
9 changes: 2 additions & 7 deletions packages/bits-ui/src/lib/bits/date-field/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import type { DateValue } from "@internationalized/date";
import type { SegmentPart } from "$lib/shared/index.js";
import type { Snippet } from "svelte";
import type {
OnChangeFn,
PrimitiveDivAttributes,
PrimitiveSpanAttributes,
WithChild,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes, PrimitiveSpanAttributes } from "$lib/shared/attributes.js";
import type { EditableSegmentPart } from "$lib/shared/date/field/types.js";
import type { DateMatcher, Granularity } from "$lib/shared/date/types.js";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps, ...calendarState.snippetProps })}
{@render child({ props: mergedProps, ...calendarState.snippetProps })}
{:else}
<div {...mergedProps}>
{@render children?.(calendarState.snippetProps)}
Expand Down
9 changes: 2 additions & 7 deletions packages/bits-ui/src/lib/bits/date-picker/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type { DateValue } from "@internationalized/date";
import type {
OnChangeFn,
PrimitiveDivAttributes,
WithChild,
WithChildren,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, WithChildren, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes } from "$lib/shared/attributes.js";
import type { EditableSegmentPart } from "$lib/shared/date/field/types.js";
import type { DateMatcher, Granularity, WeekStartsOn } from "$lib/shared/date/types.js";
import type { CalendarRootSnippetProps } from "$lib/types.js";
Expand Down
9 changes: 2 additions & 7 deletions packages/bits-ui/src/lib/bits/date-range-field/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type { DateValue } from "@internationalized/date";
import type {
OnChangeFn,
PrimitiveDivAttributes,
PrimitiveSpanAttributes,
WithChild,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes, PrimitiveSpanAttributes } from "$lib/shared/attributes.js";
import type { DateMatcher, Granularity } from "$lib/shared/date/types.js";
import type { DateRange, EditableSegmentPart, SegmentPart } from "$lib/shared/index.js";
import type { DateFieldSegmentProps, DateFieldSegmentPropsWithoutHTML } from "$lib/types.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps, ...rangeCalendarState.snippetProps })}
{@render child({ props: mergedProps, ...rangeCalendarState.snippetProps })}
{:else}
<div {...mergedProps}>
{@render children?.(rangeCalendarState.snippetProps)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@

<FloatingLayer.Root>
{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
8 changes: 2 additions & 6 deletions packages/bits-ui/src/lib/bits/date-range-picker/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import type { DateValue } from "@internationalized/date";
import type {
OnChangeFn,
PrimitiveDivAttributes,
WithChild,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes } from "$lib/shared/attributes.js";
import type { EditableSegmentPart } from "$lib/shared/date/field/types.js";
import type { DateMatcher, Granularity, WeekStartsOn } from "$lib/shared/date/types.js";
import type { DateRange } from "$lib/shared/index.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<button {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
>
<TextSelectionLayer {...mergedProps} enabled={present.current}>
{#if child}
{@render child?.({
{@render child({
props: mergeProps(mergedProps, focusScopeProps, {
hidden: !present.current,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PresenceLayer {id} present={overlayState.root.open.current || forceMount}>
{#snippet presence({ present })}
{#if child}
{@render child?.({ props: mergeProps(mergedProps, { hidden: !present.current }) })}
{@render child({ props: mergeProps(mergedProps, { hidden: !present.current }) })}
{:else}
<div {...mergeProps(mergedProps, { hidden: !present.current })}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<button {...mergedProps}>
{@render children?.()}
Expand Down
10 changes: 2 additions & 8 deletions packages/bits-ui/src/lib/bits/dialog/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ import type { DismissableLayerProps } from "../utilities/dismissable-layer/types
import type { PresenceLayerProps } from "../utilities/presence-layer/types.js";
import type { FocusScopeProps } from "../utilities/focus-scope/types.js";
import type { TextSelectionLayerProps } from "../utilities/text-selection-layer/types.js";
import type {
OnChangeFn,
PrimitiveButtonAttributes,
PrimitiveDivAttributes,
WithChild,
WithChildren,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, WithChildren, Without } from "$lib/internal/types.js";
import type { PrimitiveDivAttributes, PrimitiveButtonAttributes } from "$lib/shared/attributes.js";
import type { PortalProps } from "$lib/bits/utilities/portal/index.js";

export type DialogRootPropsWithoutHTML = WithChildren<{
Expand Down
3 changes: 2 additions & 1 deletion packages/bits-ui/src/lib/bits/label/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PrimitiveLabelAttributes, WithChild, Without } from "$lib/internal/types.js";
import type { WithChild, Without } from "$lib/internal/types.js";
import type { PrimitiveLabelAttributes } from "$lib/shared/attributes.js";

export type LabelRootPropsWithoutHTML = WithChild<{
for?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
})}
{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps} bind:this={ref}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<FloatingLayer.Anchor {id}>
{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<a {...mergedProps}>
{@render children?.()}
Expand Down
11 changes: 2 additions & 9 deletions packages/bits-ui/src/lib/bits/link-preview/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import type {
OnChangeFn,
PrimitiveAnchorAttributes,
PrimitiveDivAttributes,
PrimitiveElementAttributes,
WithChild,
WithChildren,
Without,
} from "$lib/internal/types.js";
import type { OnChangeFn, WithChild, WithChildren, Without } from "$lib/internal/types.js";
import type { PrimitiveAnchorAttributes, PrimitiveDivAttributes } from "$lib/shared/attributes.js";
import type { ArrowProps, ArrowPropsWithoutHTML } from "../utilities/arrow/types.js";
import type { DismissableLayerProps } from "../utilities/dismissable-layer/types.js";
import type { EscapeLayerProps } from "../utilities/escape-layer/types.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps, selected: itemState.isSelected })}
{@render child({ props: mergedProps, selected: itemState.isSelected })}
{:else}
<div {...mergedProps}>
{#if children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</script>

{#if child}
{@render child?.({ props: mergedProps })}
{@render child({ props: mergedProps })}
{:else}
<div {...mergedProps}>
{@render children?.()}
Expand Down
Loading

0 comments on commit 52325d0

Please sign in to comment.