uikit-react-public 0.25.3 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Badge/Badge.d.ts +3 -1
- package/dist/components/Dropdown/Dropdown.context.d.ts +2 -0
- package/dist/components/Dropdown/DropdownContent.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -2
- package/dist/components/MenuNew/Menu.d.ts +3 -1
- package/dist/components/MenuNew/MenuHead.d.ts +9 -0
- package/dist/components/MenuNew/index.d.ts +1 -1
- package/dist/index.js +3975 -3771
- package/lib/components/Badge/Badge.stories.tsx +2 -0
- package/lib/components/Badge/Badge.tsx +12 -0
- package/lib/components/Badge/__tests__/Badge.test.tsx +19 -0
- package/lib/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap +42 -0
- package/lib/components/Dropdown/Dropdown.context.tsx +9 -1
- package/lib/components/Dropdown/Dropdown.tsx +10 -2
- package/lib/components/Dropdown/DropdownContent.tsx +178 -18
- package/lib/components/Dropdown/DropdownTrigger.tsx +3 -2
- package/lib/components/Dropdown/__tests__/Dropdown.test.tsx +1 -1
- package/lib/components/DropdownMenu/DropdownMenu.tsx +41 -3
- package/lib/components/DropdownMenu/__tests__/DropdownMenu.test.tsx +49 -0
- package/lib/components/MenuNew/Menu.tsx +8 -2
- package/lib/components/MenuNew/MenuAccordion/MenuAccordion.tsx +1 -0
- package/lib/components/MenuNew/MenuHead.tsx +76 -0
- package/lib/components/MenuNew/MenuHeading.tsx +1 -0
- package/lib/components/MenuNew/PrimaryMenuItem.tsx +1 -0
- package/lib/components/MenuNew/SecondaryMenuItem.tsx +5 -1
- package/lib/components/MenuNew/__tests__/Menu.test.tsx +25 -0
- package/lib/components/MenuNew/index.ts +1 -0
- package/lib/hooks/useMediaQuery.ts +2 -0
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SpecificIconProps } from '../Icon/Icon';
|
|
2
2
|
import { ThemeType } from '../../theme';
|
|
3
|
-
export type BadgeVariant = 'neutral' | 'neutral-subtle' | 'critical' | 'critical-subtle' | 'caution' | 'caution-subtle' | 'success' | 'success-subtle' | 'warning' | 'warning-subtle' | 'disabled';
|
|
3
|
+
export type BadgeVariant = 'info' | 'info-subtle' | 'neutral' | 'neutral-subtle' | 'critical' | 'critical-subtle' | 'caution' | 'caution-subtle' | 'success' | 'success-subtle' | 'warning' | 'warning-subtle' | 'disabled';
|
|
4
4
|
export declare const VARIANT_ICON_MAP: {
|
|
5
|
+
info: import('react').FC<SpecificIconProps>;
|
|
6
|
+
'info-subtle': import('react').FC<SpecificIconProps>;
|
|
5
7
|
neutral: import('react').FC<SpecificIconProps>;
|
|
6
8
|
'neutral-subtle': import('react').FC<SpecificIconProps>;
|
|
7
9
|
critical: import('react').FC<SpecificIconProps>;
|
|
@@ -5,8 +5,10 @@ interface DropdownContextType {
|
|
|
5
5
|
toggle: () => void;
|
|
6
6
|
triggerRef: React.RefObject<HTMLElement | null>;
|
|
7
7
|
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
8
|
+
contentId: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const useDropdownContext: () => DropdownContextType;
|
|
11
|
+
export declare const useDropdownContextOptional: () => DropdownContextType | undefined;
|
|
10
12
|
interface DropdownProviderProps {
|
|
11
13
|
defaultOpen?: boolean;
|
|
12
14
|
children: React.ReactNode;
|
|
@@ -4,5 +4,5 @@ export interface DropdownContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
testId?: string;
|
|
5
5
|
align?: 'left' | 'right';
|
|
6
6
|
}
|
|
7
|
-
declare const _default: import('react').MemoExoticComponent<({ testId, align, className, children, ...props }: DropdownContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
declare const _default: import('react').MemoExoticComponent<({ testId, align, className, children, id, ...props }: DropdownContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
8
|
export default _default;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { DropdownProps } from '../Dropdown';
|
|
3
3
|
export declare const NAME = "ucl-uikit-dropdown-menu";
|
|
4
|
+
export interface DropdownMenuChildrenApi {
|
|
5
|
+
close: () => void;
|
|
6
|
+
}
|
|
7
|
+
type DropdownMenuChildren = ReactNode | ((api: DropdownMenuChildrenApi) => ReactNode);
|
|
4
8
|
export interface DropdownMenuProps extends Omit<DropdownProps, 'children'>, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
5
|
-
|
|
9
|
+
align?: 'left' | 'right';
|
|
10
|
+
children: DropdownMenuChildren;
|
|
6
11
|
label?: string;
|
|
7
12
|
triggerAriaLabelCollapsed?: string;
|
|
8
13
|
triggerAriaLabelExpanded?: string;
|
|
@@ -10,5 +15,5 @@ export interface DropdownMenuProps extends Omit<DropdownProps, 'children'>, Omit
|
|
|
10
15
|
triggerClassName?: string;
|
|
11
16
|
contentClassName?: string;
|
|
12
17
|
}
|
|
13
|
-
declare const DropdownMenu: ({ children, label, triggerAriaLabelCollapsed, triggerAriaLabelExpanded, dropdownClassName, triggerClassName, contentClassName, className, ...props }: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const DropdownMenu: ({ align, children, label, triggerAriaLabelCollapsed, triggerAriaLabelExpanded, dropdownClassName, triggerClassName, contentClassName, className, ...props }: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
19
|
export default DropdownMenu;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, NamedExoticComponent } from 'react';
|
|
2
2
|
import { default as MenuBaseItem, MenuBaseItemProps } from './MenuBaseItem';
|
|
3
3
|
import { default as MenuDivider, MenuDividerProps } from './MenuDivider';
|
|
4
|
+
import { default as MenuHead, MenuHeadProps } from './MenuHead';
|
|
4
5
|
import { default as MenuHeading, MenuHeadingProps } from './MenuHeading';
|
|
5
6
|
import { default as MenuSection, MenuSectionProps } from './MenuSection';
|
|
6
7
|
import { default as MenuAccordion, MenuAccordionItemProps, MenuAccordionProps } from './MenuAccordion';
|
|
@@ -12,9 +13,10 @@ export interface MenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
13
|
testId?: string;
|
|
13
14
|
border?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export type { MenuDividerProps, MenuHeadingProps, MenuSectionProps, MenuAccordionProps, MenuAccordionItemProps, MenuBaseItemProps, PrimaryMenuItemProps, SecondaryMenuItemProps, ActionMenuButtonProps, };
|
|
16
|
+
export type { MenuDividerProps, MenuHeadProps, MenuHeadingProps, MenuSectionProps, MenuAccordionProps, MenuAccordionItemProps, MenuBaseItemProps, PrimaryMenuItemProps, SecondaryMenuItemProps, ActionMenuButtonProps, };
|
|
16
17
|
interface MenuComponent extends NamedExoticComponent<MenuProps> {
|
|
17
18
|
Section: typeof MenuSection;
|
|
19
|
+
Head: typeof MenuHead;
|
|
18
20
|
Heading: typeof MenuHeading;
|
|
19
21
|
Accordion: typeof MenuAccordion;
|
|
20
22
|
Divider: typeof MenuDivider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export declare const NAME = "ucl-uikit-menu__head";
|
|
3
|
+
export interface MenuHeadProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
testId?: string;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
closeButtonAriaLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const MenuHead: ({ testId, onClose, closeButtonAriaLabel, className, ...props }: MenuHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MenuHead;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Menu';
|
|
2
|
-
export type { MenuProps, MenuDividerProps, MenuHeadingProps, MenuSectionProps, MenuAccordionProps, MenuBaseItemProps, PrimaryMenuItemProps, SecondaryMenuItemProps, ActionMenuButtonProps, } from './Menu';
|
|
2
|
+
export type { MenuProps, MenuDividerProps, MenuHeadProps, MenuHeadingProps, MenuSectionProps, MenuAccordionProps, MenuBaseItemProps, PrimaryMenuItemProps, SecondaryMenuItemProps, ActionMenuButtonProps, } from './Menu';
|