From 1ff3486779a9e8ef31dd8aab0ac43c8066d85dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matuzal=C3=A9m=20Teles?= Date: Wed, 26 Feb 2025 14:39:47 -0600 Subject: [PATCH 1/4] fix: exports the missing types --- packages/clay-multi-select/src/MultiSelect.tsx | 11 +++++++++++ packages/clay-multi-select/src/index.tsx | 5 ++++- packages/clay-navigation-bar/src/index.tsx | 2 +- packages/clay-panel/src/index.tsx | 2 +- packages/clay-popover/src/index.tsx | 2 ++ packages/clay-tabs/src/index.tsx | 2 +- packages/clay-upper-toolbar/src/index.tsx | 2 +- 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/clay-multi-select/src/MultiSelect.tsx b/packages/clay-multi-select/src/MultiSelect.tsx index 4b6a5cd2c0..babaf8ee24 100644 --- a/packages/clay-multi-select/src/MultiSelect.tsx +++ b/packages/clay-multi-select/src/MultiSelect.tsx @@ -538,3 +538,14 @@ export const MultiSelect = React.forwardRef(function MultiSelectInner< ); }) 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, + _value: string, + _locator = 'label' +) => items; diff --git a/packages/clay-multi-select/src/index.tsx b/packages/clay-multi-select/src/index.tsx index 324f09a363..331100049c 100644 --- a/packages/clay-multi-select/src/index.tsx +++ b/packages/clay-multi-select/src/index.tsx @@ -5,6 +5,9 @@ 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}); diff --git a/packages/clay-navigation-bar/src/index.tsx b/packages/clay-navigation-bar/src/index.tsx index 039cafaa41..5f8639d8e1 100644 --- a/packages/clay-navigation-bar/src/index.tsx +++ b/packages/clay-navigation-bar/src/index.tsx @@ -16,7 +16,7 @@ import warning from 'warning'; import {Item} from './Item'; import {NavigationBarContext} from './context'; -interface IProps +export interface IProps extends Omit, 'aria-current'> { /** * Flag to define if the item represents the current page. Disable this diff --git a/packages/clay-panel/src/index.tsx b/packages/clay-panel/src/index.tsx index 07f81bf075..57a130f11d 100644 --- a/packages/clay-panel/src/index.tsx +++ b/packages/clay-panel/src/index.tsx @@ -22,7 +22,7 @@ import {Group} from './Group'; import {Header} from './Header'; import {Title} from './Title'; -interface IProps extends React.HTMLAttributes { +export interface IProps extends React.HTMLAttributes { /** * Flag to indicate that Panel is collapsable. */ diff --git a/packages/clay-popover/src/index.tsx b/packages/clay-popover/src/index.tsx index 0401a56047..73059a3c36 100644 --- a/packages/clay-popover/src/index.tsx +++ b/packages/clay-popover/src/index.tsx @@ -4,6 +4,8 @@ */ import {Popover} from './Popover'; +import type {ALIGN_POSITIONS} from './Popover'; export {Popover}; +export type {ALIGN_POSITIONS}; export default Popover; diff --git a/packages/clay-tabs/src/index.tsx b/packages/clay-tabs/src/index.tsx index ca8db3d09d..d574378747 100644 --- a/packages/clay-tabs/src/index.tsx +++ b/packages/clay-tabs/src/index.tsx @@ -13,7 +13,7 @@ import TabPane from './TabPane'; export type DisplayType = null | 'basic' | 'underline'; -interface IProps extends React.HTMLAttributes { +export interface IProps extends React.HTMLAttributes { /** * Flag to indicate the navigation behavior in the tab. * diff --git a/packages/clay-upper-toolbar/src/index.tsx b/packages/clay-upper-toolbar/src/index.tsx index 657e1f6153..32bd506a32 100644 --- a/packages/clay-upper-toolbar/src/index.tsx +++ b/packages/clay-upper-toolbar/src/index.tsx @@ -8,7 +8,7 @@ import ClayLayout from '@clayui/layout'; import classNames from 'classnames'; import React from 'react'; -interface IInputProps extends React.ComponentProps {} +export interface IInputProps extends React.ComponentProps {} export const Input = ({className, ...otherProps}: IInputProps) => ( From c5073416dcb706e25772076a0558e4181b2beff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matuzal=C3=A9m=20Teles?= Date: Wed, 26 Feb 2025 15:11:37 -0600 Subject: [PATCH 2/4] fix: exports displayType types --- packages/clay-alert/src/index.tsx | 7 +++++++ packages/clay-multi-select/src/index.tsx | 1 + packages/clay-popover/src/index.tsx | 1 + packages/clay-sticker/src/Sticker.tsx | 21 +++++++++++++++++++++ packages/clay-sticker/src/index.tsx | 4 +++- 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/clay-alert/src/index.tsx b/packages/clay-alert/src/index.tsx index 9a1b237b68..b864fde7e9 100644 --- a/packages/clay-alert/src/index.tsx +++ b/packages/clay-alert/src/index.tsx @@ -55,6 +55,13 @@ const useAutoClose = (autoClose?: boolean | number, onClose = () => {}) => { }; }; +export type DisplayType = + | 'danger' + | 'info' + | 'secondary' + | 'success' + | 'warning'; + interface IClayAlertProps extends Omit, 'role'> { /** diff --git a/packages/clay-multi-select/src/index.tsx b/packages/clay-multi-select/src/index.tsx index 331100049c..df69c4eb9c 100644 --- a/packages/clay-multi-select/src/index.tsx +++ b/packages/clay-multi-select/src/index.tsx @@ -6,6 +6,7 @@ import {Item} from '@clayui/autocomplete'; import {MultiSelect, itemLabelFilter} from './MultiSelect'; + import type {IProps} from './MultiSelect'; export {itemLabelFilter}; diff --git a/packages/clay-popover/src/index.tsx b/packages/clay-popover/src/index.tsx index 73059a3c36..57f1a0f5da 100644 --- a/packages/clay-popover/src/index.tsx +++ b/packages/clay-popover/src/index.tsx @@ -4,6 +4,7 @@ */ import {Popover} from './Popover'; + import type {ALIGN_POSITIONS} from './Popover'; export {Popover}; diff --git a/packages/clay-sticker/src/Sticker.tsx b/packages/clay-sticker/src/Sticker.tsx index 7a5b7a6b8c..ab027c747c 100644 --- a/packages/clay-sticker/src/Sticker.tsx +++ b/packages/clay-sticker/src/Sticker.tsx @@ -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 { /** * Determines the color of the sticker. diff --git a/packages/clay-sticker/src/index.tsx b/packages/clay-sticker/src/index.tsx index 444d2bb772..47bd720673 100644 --- a/packages/clay-sticker/src/index.tsx +++ b/packages/clay-sticker/src/index.tsx @@ -5,7 +5,9 @@ import Sticker from './Sticker'; +import type {DisplayType} from './Sticker'; + type IClayStickerProps = React.ComponentProps; -export type {IClayStickerProps}; +export type {DisplayType, IClayStickerProps}; export default Sticker; From 55f23020b482738d8fb4ee3c75501347b26b54e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matuzal=C3=A9m=20Teles?= Date: Wed, 26 Feb 2025 15:24:17 -0600 Subject: [PATCH 3/4] chore: update multi select threshold --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index a019bda98a..694a9a924e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -141,7 +141,7 @@ module.exports = { }, './packages/clay-multi-select/src/': { branches: 52, - functions: 54, + functions: 52, lines: 62, statements: 62, }, From 494202250dcf20b12f59d65e33bd0f85cae8243c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matuzal=C3=A9m=20Teles?= Date: Thu, 27 Feb 2025 14:58:35 -0600 Subject: [PATCH 4/4] fix(@clayui/drop-down): fixes `menuElementAttrs` type bug --- packages/clay-drop-down/src/DropDown.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/clay-drop-down/src/DropDown.tsx b/packages/clay-drop-down/src/DropDown.tsx index 74f0f73a83..1f670d5eb9 100644 --- a/packages/clay-drop-down/src/DropDown.tsx +++ b/packages/clay-drop-down/src/DropDown.tsx @@ -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; @@ -108,7 +104,8 @@ interface IProps /** * Prop to pass DOM element attributes to DropDown.Menu. */ - menuElementAttrs?: React.HTMLAttributes & IPortalBaseProps; + menuElementAttrs?: React.HTMLAttributes & + Pick, 'containerProps'>; /** * Adds utility class name `dropdown-menu-height-${height}`