Skip to content

Commit

Permalink
Merge pull request #5952 from matuzalemsteles/fix-types-2
Browse files Browse the repository at this point in the history
fix: exports the missing types
  • Loading branch information
matuzalemsteles authored Feb 27, 2025
2 parents 2865051 + 4942022 commit bc01610
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ module.exports = {
},
'./packages/clay-multi-select/src/': {
branches: 52,
functions: 54,
functions: 52,
lines: 62,
statements: 62,
},
Expand Down
7 changes: 7 additions & 0 deletions packages/clay-alert/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ const useAutoClose = (autoClose?: boolean | number, onClose = () => {}) => {
};
};

export type DisplayType =
| 'danger'
| 'info'
| 'secondary'
| 'success'
| 'warning';

interface IClayAlertProps
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'> {
/**
Expand Down
9 changes: 3 additions & 6 deletions packages/clay-drop-down/src/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ import Menu from './Menu';
import Search from './Search';
import Section from './Section';

import type {
AlignPoints,
IPortalBaseProps,
InternalDispatch,
} from '@clayui/shared';
import type {AlignPoints, InternalDispatch} from '@clayui/shared';

const {Collection} = __NOT_PUBLIC_COLLECTION;

Expand Down Expand Up @@ -108,7 +104,8 @@ interface IProps<T>
/**
* Prop to pass DOM element attributes to DropDown.Menu.
*/
menuElementAttrs?: React.HTMLAttributes<HTMLDivElement> & IPortalBaseProps;
menuElementAttrs?: React.HTMLAttributes<HTMLDivElement> &
Pick<React.ComponentProps<typeof Menu>, 'containerProps'>;

/**
* Adds utility class name `dropdown-menu-height-${height}`
Expand Down
11 changes: 11 additions & 0 deletions packages/clay-multi-select/src/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,3 +538,14 @@ export const MultiSelect = React.forwardRef(function MultiSelectInner<
</Container>
);
}) as Component;

/**
* Utility used for filtering an array of items based off the locator which
* is set to `label` by default.
* @deprecated since v3.95.2 - it is no longer necessary...
*/
export const itemLabelFilter = (
items: Array<Item>,
_value: string,
_locator = 'label'
) => items;
6 changes: 5 additions & 1 deletion packages/clay-multi-select/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import {Item} from '@clayui/autocomplete';

import {MultiSelect} from './MultiSelect';
import {MultiSelect, itemLabelFilter} from './MultiSelect';

import type {IProps} from './MultiSelect';

export {itemLabelFilter};
export type {IProps};
export default Object.assign(MultiSelect, {Item});
2 changes: 1 addition & 1 deletion packages/clay-navigation-bar/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import warning from 'warning';
import {Item} from './Item';
import {NavigationBarContext} from './context';

interface IProps
export interface IProps
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'aria-current'> {
/**
* Flag to define if the item represents the current page. Disable this
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-panel/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {Group} from './Group';
import {Header} from './Header';
import {Title} from './Title';

interface IProps extends React.HTMLAttributes<HTMLDivElement> {
export interface IProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Flag to indicate that Panel is collapsable.
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/clay-popover/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@

import {Popover} from './Popover';

import type {ALIGN_POSITIONS} from './Popover';

export {Popover};
export type {ALIGN_POSITIONS};
export default Popover;
21 changes: 21 additions & 0 deletions packages/clay-sticker/src/Sticker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@
import classNames from 'classnames';
import React from 'react';

export type DisplayType =
| 'danger'
| 'dark'
| 'info'
| 'light'
| 'primary'
| 'secondary'
| 'success'
| 'unstyled'
| 'warning'
| 'outline-0'
| 'outline-1'
| 'outline-2'
| 'outline-3'
| 'outline-4'
| 'outline-5'
| 'outline-6'
| 'outline-7'
| 'outline-8'
| 'outline-9';

interface IClayStickerProps extends React.HTMLAttributes<HTMLSpanElement> {
/**
* Determines the color of the sticker.
Expand Down
4 changes: 3 additions & 1 deletion packages/clay-sticker/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import Sticker from './Sticker';

import type {DisplayType} from './Sticker';

type IClayStickerProps = React.ComponentProps<typeof Sticker>;

export type {IClayStickerProps};
export type {DisplayType, IClayStickerProps};
export default Sticker;
2 changes: 1 addition & 1 deletion packages/clay-tabs/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TabPane from './TabPane';

export type DisplayType = null | 'basic' | 'underline';

interface IProps extends React.HTMLAttributes<HTMLUListElement> {
export interface IProps extends React.HTMLAttributes<HTMLUListElement> {
/**
* Flag to indicate the navigation behavior in the tab.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-upper-toolbar/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ClayLayout from '@clayui/layout';
import classNames from 'classnames';
import React from 'react';

interface IInputProps extends React.ComponentProps<typeof ClayInput> {}
export interface IInputProps extends React.ComponentProps<typeof ClayInput> {}

export const Input = ({className, ...otherProps}: IInputProps) => (
<Item expand>
Expand Down

0 comments on commit bc01610

Please sign in to comment.