Skip to content

Commit 4347c57

Browse files
committed
chore(propsof): move PropsOf before custom types for better discoverability
1 parent 1edc6ea commit 4347c57

File tree

19 files changed

+31
-36
lines changed

19 files changed

+31
-36
lines changed

apps/website/src/components/highlight/highlight.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import {
55
useSignal,
66
useVisibleTask$,
77
} from '@builder.io/qwik';
8-
import { OmitSignalClass } from '@qwik-ui/utils';
98
import { CodeCopy } from '../code-copy/code-copy';
109

11-
export type HighlightProps = OmitSignalClass<PropsOf<'div'>> & {
10+
export type HighlightProps = PropsOf<'div'> & {
1211
code: string;
1312
copyCodeClass?: ClassList;
1413
language?: 'tsx' | 'html' | 'css';

apps/website/src/routes/docs/headless/modal/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ The current solution across framework ecosystems, is to open the Modal eagerly o
261261
type: `Qwik`,
262262
description:
263263
'A way to configure the modal with all native attributes the HTMLDialog defines.',
264-
info: `PropsOf<'dialog']`,
264+
info: `PropsOf<'dialog'>`,
265265
},
266266
{
267267
name: 'onHide()$',

packages/kit-headless/src/components/accordion/accordion-item.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { accordionItemContextId } from './accordion-context-id';
1111

1212
import { type AccordionItemContext } from './accordion-context.type';
1313

14-
export type AccordionItemProps = {
14+
export type AccordionItemProps = PropsOf<'div'> & {
1515
defaultValue?: boolean;
16-
} & PropsOf<'div'>;
16+
};
1717

1818
export const AccordionItem = component$(
1919
({ defaultValue = false, id, ...props }: AccordionItemProps) => {

packages/kit-headless/src/components/accordion/accordion-root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import {
1212
import { accordionRootContextId } from './accordion-context-id';
1313
import { type AccordionRootContext } from './accordion-context.type';
1414

15-
export type AccordionRootProps = {
15+
export type AccordionRootProps = PropsOf<'div'> & {
1616
behavior?: 'single' | 'multi';
1717
animated?: boolean;
1818
enhance?: boolean;
1919
collapsible?: boolean;
2020
onSelectedIndexChange$?: (index: number) => void;
2121
onFocusIndexChange$?: (index: number) => void;
22-
} & PropsOf<'div'>;
22+
};
2323

2424
export const AccordionRoot = component$(
2525
({

packages/kit-headless/src/components/accordion/accordion-trigger.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const accordionPreventedKeys = [
2323
KeyCode.ArrowUp,
2424
];
2525

26-
export type AccordionTriggerProps = {
26+
export type AccordionTriggerProps = PropsOf<'button'> & {
2727
disabled?: boolean;
28-
} & PropsOf<'button'>;
28+
};
2929

3030
export const AccordionTrigger = component$(
3131
({ disabled, ...props }: AccordionTriggerProps) => {

packages/kit-headless/src/components/combobox/combobox-icon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { component$, PropsOf, Slot } from '@builder.io/qwik';
22
import { JSX } from '@builder.io/qwik/jsx-runtime';
33
import { VisuallyHidden } from '../../utils/visually-hidden';
44

5-
type ComboboxIcon = {
5+
type ComboboxIcon = PropsOf<'svg'> & {
66
svg?: JSX.Element;
7-
} & PropsOf<'svg'>;
7+
};
88

99
export const ComboboxIcon = component$<ComboboxIcon>(({ svg, ...iconProps }) => {
1010
if (svg) {

packages/kit-headless/src/components/combobox/combobox-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {
1616
getPrevEnabledOptionIndex,
1717
} from './utils';
1818

19-
export type ComboboxInputProps = {
19+
export type ComboboxInputProps = PropsOf<'input'> & {
2020
disableOnBlur?: boolean;
21-
} & PropsOf<'input'>;
21+
};
2222

2323
export const ComboboxInput = component$(
2424
<O extends Option = Option>({

packages/kit-headless/src/components/combobox/combobox-listbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import type { ComboboxContext, Option } from './combobox-context.type';
77
import { ResolvedOption } from './combobox';
88
import { VisuallyHidden } from '../../utils/visually-hidden';
99

10-
export type ComboboxListboxProps<O extends Option = Option> = {
10+
export type ComboboxListboxProps<O extends Option = Option> = PropsOf<'ul'> & {
1111
optionRenderer$?: QRL<
1212
(resolved: ResolvedOption<O>, filteredIndex: number) => JSX.Element
1313
>;
14-
} & PropsOf<'ul'>;
14+
};
1515

1616
export const ComboboxListbox = component$(
1717
<O extends Option = Option>({ optionRenderer$, ...props }: ComboboxListboxProps<O>) => {

packages/kit-headless/src/components/combobox/combobox-option.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import ComboboxContextId from './combobox-context-id';
1111

1212
import { ResolvedOption } from './combobox';
1313

14-
export type ComboboxOptionProps = {
14+
export type ComboboxOptionProps = PropsOf<'li'> & {
1515
index: number;
1616
resolved: ResolvedOption;
17-
} & PropsOf<'li'>;
17+
};
1818

1919
export const ComboboxOption = component$(
2020
// remove non-li props from props

packages/kit-headless/src/components/combobox/combobox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type ResolvedOption<
2828
lcLabel?: string;
2929
};
3030

31-
export type ComboboxProps<O extends Option = Option> = {
31+
export type ComboboxProps<O extends Option = Option> = PropsOf<'div'> & {
3232
// user's source of truth
3333
options: O[];
3434
filter$?: QRL<
@@ -48,7 +48,7 @@ export type ComboboxProps<O extends Option = Option> = {
4848
'bind:isInputFocusedSig'?: Signal<boolean | undefined>;
4949
'bind:inputValueSig'?: Signal<string>;
5050
'bind:highlightedIndexSig'?: Signal<number>;
51-
} & PropsOf<'div'>;
51+
};
5252

5353
export const Combobox = component$(
5454
<O extends Option = Option>(props: ComboboxProps<O>) => {

0 commit comments

Comments
 (0)