Skip to content

Commit ff5e736

Browse files
authored
fix(components): export compound component props (DS-5287) (#424)
1 parent 071934e commit ff5e736

37 files changed

Lines changed: 463 additions & 57 deletions

File tree

packages/components/src/components/Accordion/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ export * from './Accordion';
22
export * from './components/AccordionGroup';
33
export * from './AccordionStateContext';
44
export * from './types';
5+
export type { AccordionSummaryProps } from './components/AccordionSummary';
6+
export type { AccordionDetailsProps } from './components/AccordionDetails';

packages/components/src/components/Autocomplete/types.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
import type { DataAttributeProps } from '@koobiq/react-core';
1010
import type { AriaComboBoxProps } from '@koobiq/react-primitives';
1111

12+
import type { ItemProps, SectionProps } from '../Collections';
1213
import type { DropdownFooterProps } from '../DropdownFooter';
1314
import {
1415
formFieldControlGroupPropVariant,
@@ -27,7 +28,8 @@ import type {
2728
FormFieldProps,
2829
} from '../FormField';
2930
import type { IconButtonProps } from '../IconButton';
30-
import type { ListInnerProps } from '../List';
31+
import type { ListInnerProps, ListItemTextProps } from '../List';
32+
import type { ListItemAddonProps } from '../List/components';
3133
import type { PopoverProps } from '../Popover';
3234

3335
export const autocompletePropLabelPlacement = formFieldPropLabelPlacement;
@@ -39,6 +41,12 @@ export type AutocompletePropLabelAlign = FormFieldPropLabelAlign;
3941
export const autocompletePropVariant = formFieldControlGroupPropVariant;
4042
export type AutocompleteInputPropVariant = FormFieldControlGroupPropVariant;
4143

44+
export type AutocompleteItemProps<T extends object = object> = ItemProps<T>;
45+
export type AutocompleteSectionProps<T extends object = object> =
46+
SectionProps<T>;
47+
export type AutocompleteItemTextProps = ListItemTextProps;
48+
export type AutocompleteItemAddonProps = ListItemAddonProps;
49+
4250
export type AutocompleteProps<T extends object = object> = {
4351
/** Additional CSS-classes. */
4452
className?: string;

packages/components/src/components/ContentPanel/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ import type {
88
import type { DataAttributeProps } from '@koobiq/react-core';
99
import type { TransitionProps } from 'react-transition-group/Transition';
1010

11-
import type { DialogProps } from '../Dialog';
11+
import type {
12+
DialogBodyProps,
13+
DialogFooterProps,
14+
DialogHeaderProps,
15+
DialogProps,
16+
} from '../Dialog';
17+
18+
export type ContentPanelHeaderProps = DialogHeaderProps;
19+
export type ContentPanelBodyProps = DialogBodyProps;
20+
export type ContentPanelFooterProps = DialogFooterProps;
1221

1322
export type ContentPanelSize = number | `${number}` | `${number}%`;
1423

packages/components/src/components/Form/components/FormCaption/FormCaption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ export const FormCaption = polymorphicForwardRef<'div', FormCaptionBaseProps>(
3131
)
3232
);
3333

34-
export type FormCationProps<As extends ElementType = 'div'> =
34+
export type FormCaptionProps<As extends ElementType = 'div'> =
3535
ComponentPropsWithRef<typeof FormCaption<As>>;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
export * from './Form';
22
export * from './FormContext';
33
export * from './types';
4+
export type {
5+
FormGroupProps,
6+
FormCaptionProps,
7+
FormActionsProps,
8+
} from './components';

packages/components/src/components/List/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ import type {
1010
import type { ExtendableProps } from '@koobiq/react-core';
1111
import type { AriaListBoxProps } from '@koobiq/react-primitives';
1212

13+
import type { DividerProps, ItemProps, SectionProps } from '../Collections';
1314
import type { TypographyProps } from '../Typography';
1415

16+
import type { ListItemAddonProps as ListItemAddonBaseProps } from './components';
17+
18+
export type ListItemProps<T> = ItemProps<T>;
19+
export type ListSectionProps<T> = SectionProps<T>;
20+
export type ListDividerProps = DividerProps;
21+
export type ListItemAddonProps = ListItemAddonBaseProps;
22+
1523
export type ListProps<T> = ExtendableProps<
1624
{
1725
/** Additional CSS-classes. */

packages/components/src/components/Menu/types.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {
2+
ComponentProps,
23
ComponentPropsWithRef,
34
ComponentRef,
45
ElementType,
@@ -9,12 +10,28 @@ import type {
910
ReactNode,
1011
} from 'react';
1112

12-
import type { ExtendableProps } from '@koobiq/react-core';
13+
import type { ExtendableProps, Pressable } from '@koobiq/react-core';
1314
import type { ButtonOptions, AriaMenuProps } from '@koobiq/react-primitives';
1415

16+
import type {
17+
DividerProps,
18+
HeaderProps,
19+
ItemProps,
20+
SectionProps,
21+
} from '../Collections';
1522
import type { DropdownFooterProps } from '../DropdownFooter';
23+
import type { ListItemTextProps } from '../List';
24+
import type { ListItemAddonProps } from '../List/components';
1625
import type { PopoverProps, PopoverPropPlacement } from '../Popover';
1726

27+
export type MenuItemProps<T> = ItemProps<T>;
28+
export type MenuSectionProps<T> = SectionProps<T>;
29+
export type MenuHeaderProps = HeaderProps;
30+
export type MenuDividerProps = DividerProps;
31+
export type MenuItemTextProps = ListItemTextProps;
32+
export type MenuItemAddonProps = ListItemAddonProps;
33+
export type MenuControlProps = ComponentProps<typeof Pressable>;
34+
1835
export type MenuPropControl = (
1936
props: Omit<ButtonOptions, 'elementType'> & {
2037
ref?: Ref<HTMLButtonElement>;

packages/components/src/components/Modal/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ import type {
99
import type { ButtonOptions } from '@koobiq/react-primitives';
1010

1111
import type { BackdropProps } from '../Backdrop';
12-
import type { DialogProps } from '../Dialog';
12+
import type {
13+
DialogBodyProps,
14+
DialogFooterProps,
15+
DialogHeaderProps,
16+
DialogProps,
17+
} from '../Dialog';
18+
19+
export type ModalHeaderProps = DialogHeaderProps;
20+
export type ModalBodyProps = DialogBodyProps;
21+
export type ModalFooterProps = DialogFooterProps;
1322

1423
export const modalPropSize = ['small', 'medium', 'large'] as const;
1524

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
export * from './Navbar';
22
export * from './types';
3+
export type {
4+
NavbarHeaderProps,
5+
NavbarBodyProps,
6+
NavbarFooterProps,
7+
NavbarItemProps,
8+
NavbarAppItemProps,
9+
} from './components';

packages/components/src/components/Popover/types.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ import type {
1414
} from '@koobiq/react-primitives';
1515
import type { TransitionProps } from 'react-transition-group/Transition';
1616

17-
import type { DialogProps } from '../Dialog';
17+
import type {
18+
DialogBodyProps,
19+
DialogFooterProps,
20+
DialogHeaderProps,
21+
DialogProps,
22+
} from '../Dialog';
23+
24+
export type PopoverHeaderProps = DialogHeaderProps;
25+
export type PopoverBodyProps = DialogBodyProps;
26+
export type PopoverFooterProps = DialogFooterProps;
1827

1928
export type PopoverPropContent =
2029
| ReactNode

0 commit comments

Comments
 (0)