uikit-react-public 0.30.1 → 0.32.4
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/Heading/Heading.stories.d.ts +5 -7
- package/dist/components/MenuNew/Menu.context.d.ts +9 -0
- package/dist/components/MenuNew/Menu.d.ts +2 -1
- package/dist/components/MenuNew/MenuHeading.d.ts +1 -1
- package/dist/components/MenuNew/MenuItemText.d.ts +2 -1
- package/dist/components/MenuNew/PrimaryMenuItem.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +12 -0
- package/dist/components/Sidebar/Sidebar.stories.d.ts +38 -0
- package/dist/components/Sidebar/__tests__/Sidebar.test.d.ts +1 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.d.ts +9 -5
- package/dist/components/Snackbar/Snackbar.stories.d.ts +3 -1
- package/dist/components/Snackbar/Snackbars.d.ts +19 -0
- package/dist/components/Snackbar/Snackbars.stories.d.ts +52 -0
- package/dist/components/Snackbar/__tests__/Snackbars.test.d.ts +1 -0
- package/dist/components/Snackbar/index.d.ts +2 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/index.js +5979 -5448
- package/lib/components/Dropdown/Dropdown.stories.tsx +69 -74
- package/lib/components/Heading/Documentation.mdx +4 -14
- package/lib/components/Heading/Heading.stories.tsx +16 -30
- package/lib/components/MenuNew/Menu.context.tsx +18 -0
- package/lib/components/MenuNew/Menu.tsx +14 -9
- package/lib/components/MenuNew/MenuDivider.tsx +12 -1
- package/lib/components/MenuNew/MenuHeading.tsx +6 -0
- package/lib/components/MenuNew/MenuItemText.tsx +27 -3
- package/lib/components/MenuNew/MenuSection.tsx +11 -0
- package/lib/components/MenuNew/PrimaryMenuItem.tsx +71 -2
- package/lib/components/Select/Select.types.ts +1 -7
- package/lib/components/Select/__tests__/Select.test.tsx +112 -0
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +5 -0
- package/lib/components/Select/subcomponents/CustomSelect.tsx +75 -3
- package/lib/components/Select/subcomponents/FilterInput.tsx +1 -1
- package/lib/components/Sidebar/Sidebar.stories.tsx +94 -0
- package/lib/components/Sidebar/Sidebar.tsx +208 -0
- package/lib/components/Sidebar/__tests__/Sidebar.test.tsx +96 -0
- package/lib/components/Sidebar/__tests__/__snapshots__/Sidebar.test.tsx.snap +272 -0
- package/lib/components/Sidebar/index.ts +2 -0
- package/lib/components/Snackbar/Snackbar.stories.tsx +22 -0
- package/lib/components/Snackbar/Snackbar.tsx +168 -119
- package/lib/components/Snackbar/Snackbars.stories.tsx +141 -0
- package/lib/components/Snackbar/Snackbars.tsx +377 -0
- package/lib/components/Snackbar/__tests__/Snackbar.test.tsx +222 -10
- package/lib/components/Snackbar/__tests__/Snackbars.test.tsx +377 -0
- package/lib/components/Snackbar/__tests__/__snapshots__/Snackbar.test.tsx.snap +46 -25
- package/lib/components/Snackbar/index.ts +6 -0
- package/lib/components/index.ts +10 -1
- package/package.json +1 -1
|
@@ -10,11 +10,9 @@ declare const meta: {
|
|
|
10
10
|
export default meta;
|
|
11
11
|
type Story = StoryObj<typeof meta>;
|
|
12
12
|
export declare const Default: Story;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const LevelSm: Story;
|
|
18
|
-
export declare const LevelXs: Story;
|
|
13
|
+
export declare const Level1: Story;
|
|
14
|
+
export declare const Level2: Story;
|
|
15
|
+
export declare const Level3: Story;
|
|
16
|
+
export declare const Level4: Story;
|
|
19
17
|
export declare const AsSpan: Story;
|
|
20
|
-
export declare const
|
|
18
|
+
export declare const withMargins: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface MenuContextValue {
|
|
3
|
+
collapsed: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const MenuProvider: ({ collapsed, children, }: MenuContextValue & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
export declare const useMenu: () => MenuContextValue;
|
|
9
|
+
export {};
|
|
@@ -9,9 +9,10 @@ import { default as ActionMenuButton, ActionMenuButtonProps } from './ActionMenu
|
|
|
9
9
|
import { default as PrimaryMenuItem, PrimaryMenuItemProps } from './PrimaryMenuItem';
|
|
10
10
|
import { default as SecondaryMenuItem, SecondaryMenuItemProps } from './SecondaryMenuItem';
|
|
11
11
|
export declare const NAME = "ucl-uikit-menu";
|
|
12
|
-
export interface MenuProps extends HTMLAttributes<
|
|
12
|
+
export interface MenuProps extends HTMLAttributes<HTMLElement> {
|
|
13
13
|
testId?: string;
|
|
14
14
|
border?: boolean;
|
|
15
|
+
collapsed?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export type { MenuDividerProps, MenuHeadProps, MenuHeadingProps, MenuSectionProps, MenuAccordionProps, MenuAccordionItemProps, MenuBaseItemProps, PrimaryMenuItemProps, SecondaryMenuItemProps, ActionMenuButtonProps, };
|
|
17
18
|
interface MenuComponent extends NamedExoticComponent<MenuProps> {
|
|
@@ -3,5 +3,5 @@ export declare const NAME = "ucl-uikit-menu__heading";
|
|
|
3
3
|
export interface MenuHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
testId?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const MenuHeading: ({ testId, className, children, ...props }: MenuHeadingProps) => import("react").JSX.Element;
|
|
6
|
+
declare const MenuHeading: ({ testId, className, children, ...props }: MenuHeadingProps) => import("react").JSX.Element | null;
|
|
7
7
|
export default MenuHeading;
|
|
@@ -3,7 +3,8 @@ export declare const NAME = "ucl-uikit-menu__item-text";
|
|
|
3
3
|
export interface MenuItemTextProps {
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
className?: string;
|
|
6
|
+
visuallyHidden?: boolean;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
}
|
|
8
|
-
declare const MenuItemText: ({ asChild, className, children, }: MenuItemTextProps) => import("react").JSX.Element;
|
|
9
|
+
declare const MenuItemText: ({ asChild, className, visuallyHidden, children, }: MenuItemTextProps) => import("react").JSX.Element;
|
|
9
10
|
export default MenuItemText;
|
|
@@ -5,5 +5,5 @@ export interface PrimaryMenuItemProps extends Omit<MenuBaseItemProps, 'iconPosit
|
|
|
5
5
|
asChild?: boolean;
|
|
6
6
|
trailingContent?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare const PrimaryMenuItem: ({ className, children, asChild, trailingContent, ...props }: PrimaryMenuItemProps) => import("react").JSX.Element;
|
|
8
|
+
declare const PrimaryMenuItem: ({ className, children, asChild, trailingContent, icon: iconProp, active, ...props }: PrimaryMenuItemProps) => import("react").JSX.Element;
|
|
9
9
|
export default PrimaryMenuItem;
|
|
@@ -25,7 +25,7 @@ export type OptionData<T> = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Additional props forwarded to the filter input when `filterable` is true
|
|
27
27
|
*/
|
|
28
|
-
export type FilterInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'disabled' | 'ref' | 'role' | 'aria-autocomplete'
|
|
28
|
+
export type FilterInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'disabled' | 'ref' | 'role' | 'aria-autocomplete'>;
|
|
29
29
|
export type SelectDropdownWidth = 'content' | 'match-select';
|
|
30
30
|
type SelectBaseProps<T = string | number> = Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> & {
|
|
31
31
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export declare const NAME = "ucl-uikit-sidebar";
|
|
3
|
+
export interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
collapsed?: boolean;
|
|
5
|
+
defaultCollapsed?: boolean;
|
|
6
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
7
|
+
testId?: string;
|
|
8
|
+
collapseButtonAriaLabel?: string;
|
|
9
|
+
expandButtonAriaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('react').MemoExoticComponent<({ collapsed, defaultCollapsed, onCollapsedChange, testId, collapseButtonAriaLabel, expandButtonAriaLabel, className, children, ...props }: SidebarProps) => import("react").JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').MemoExoticComponent<({ collapsed, defaultCollapsed, onCollapsedChange, testId, collapseButtonAriaLabel, expandButtonAriaLabel, className, children, ...props }: import('./Sidebar').SidebarProps) => import("react").JSX.Element>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
collapsed: {
|
|
10
|
+
control: "boolean";
|
|
11
|
+
};
|
|
12
|
+
defaultCollapsed: {
|
|
13
|
+
control: "boolean";
|
|
14
|
+
};
|
|
15
|
+
onCollapsedChange: {
|
|
16
|
+
action: string;
|
|
17
|
+
};
|
|
18
|
+
testId: {
|
|
19
|
+
control: {
|
|
20
|
+
type: "text";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
className: {
|
|
24
|
+
control: false;
|
|
25
|
+
};
|
|
26
|
+
children: {
|
|
27
|
+
control: false;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
args: {
|
|
31
|
+
defaultCollapsed: false;
|
|
32
|
+
};
|
|
33
|
+
tags: string[];
|
|
34
|
+
};
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
export declare const Default: Story;
|
|
38
|
+
export declare const Collapsed: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { MarginProps } from '../common/marginsStyle';
|
|
3
3
|
export declare const NAME = "ucl-uikit-snackbar";
|
|
4
|
-
export interface SnackbarBaseProps extends
|
|
5
|
-
action
|
|
4
|
+
export interface SnackbarBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
action?: 'close' | 'undo';
|
|
6
|
+
actionDisabled?: boolean;
|
|
7
|
+
closeButtonAriaLabel?: string;
|
|
6
8
|
onClose?: () => void;
|
|
7
9
|
onUndo?: () => void;
|
|
10
|
+
size?: 'small' | 'large';
|
|
8
11
|
testId?: string;
|
|
12
|
+
variant?: 'default' | 'error' | 'success';
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
14
|
}
|
|
10
15
|
export type SnackbarProps = SnackbarBaseProps & MarginProps;
|
|
11
|
-
|
|
12
|
-
declare const _default: import('react').NamedExoticComponent<SnackbarBaseProps & MarginProps & import('react').RefAttributes<HTMLOutputElement>>;
|
|
16
|
+
declare const _default: import('react').MemoExoticComponent<({ action, actionDisabled, closeButtonAriaLabel, onClose, onUndo, children, size, testId, className, variant, ref, ...props }: SnackbarProps) => import("react").JSX.Element>;
|
|
13
17
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import('react').
|
|
4
|
+
component: import('react').MemoExoticComponent<({ action, actionDisabled, closeButtonAriaLabel, onClose, onUndo, children, size, testId, className, variant, ref, ...props }: import('./Snackbar').SnackbarProps) => import("react").JSX.Element>;
|
|
5
5
|
args: {
|
|
6
6
|
children: string;
|
|
7
7
|
action: undefined;
|
|
@@ -15,6 +15,8 @@ type Story = StoryObj<typeof meta>;
|
|
|
15
15
|
export declare const Default: Story;
|
|
16
16
|
export declare const Close: Story;
|
|
17
17
|
export declare const Undo: Story;
|
|
18
|
+
export declare const Error: Story;
|
|
19
|
+
export declare const Success: Story;
|
|
18
20
|
export declare const LongText: Story;
|
|
19
21
|
export declare const WithCustomPosition: Story & {
|
|
20
22
|
argTypes: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { SnackbarProps } from './Snackbar';
|
|
3
|
+
export declare const NAME = "ucl-uikit-snackbars";
|
|
4
|
+
export type SnackbarsPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
5
|
+
export interface SnackbarsItem extends SnackbarProps {
|
|
6
|
+
id: string;
|
|
7
|
+
duration?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SnackbarsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
10
|
+
items: SnackbarsItem[];
|
|
11
|
+
onDismiss: (id: string) => void;
|
|
12
|
+
duration?: number;
|
|
13
|
+
transitionDuration?: number;
|
|
14
|
+
maxVisible?: number;
|
|
15
|
+
placement?: SnackbarsPlacement;
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import('react').MemoExoticComponent<({ items, onDismiss, duration, transitionDuration, maxVisible, placement, testId, className, ...props }: SnackbarsProps) => import("react").JSX.Element>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').MemoExoticComponent<({ items, onDismiss, duration, transitionDuration, maxVisible, placement, testId, className, ...props }: import('./Snackbars').SnackbarsProps) => import("react").JSX.Element>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
items: {
|
|
15
|
+
control: false;
|
|
16
|
+
};
|
|
17
|
+
onDismiss: {
|
|
18
|
+
control: false;
|
|
19
|
+
};
|
|
20
|
+
duration: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "number";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
transitionDuration: {
|
|
26
|
+
control: {
|
|
27
|
+
type: "number";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
maxVisible: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "number";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
placement: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "select";
|
|
38
|
+
};
|
|
39
|
+
options: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
args: {
|
|
43
|
+
duration: number;
|
|
44
|
+
transitionDuration: number;
|
|
45
|
+
maxVisible: number;
|
|
46
|
+
placement: "bottom-right";
|
|
47
|
+
};
|
|
48
|
+
tags: string[];
|
|
49
|
+
};
|
|
50
|
+
export default meta;
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
export declare const Interactive: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,7 +17,8 @@ export type { BlanketProps } from './Blanket';
|
|
|
17
17
|
export { default as Overlay } from './Overlay';
|
|
18
18
|
export type { OverlayProps } from './Overlay';
|
|
19
19
|
export { default as Snackbar } from './Snackbar';
|
|
20
|
-
export
|
|
20
|
+
export { Snackbars } from './Snackbar';
|
|
21
|
+
export type { SnackbarProps, SnackbarsItem, SnackbarsPlacement, SnackbarsProps, } from './Snackbar';
|
|
21
22
|
export { default as Avatar } from './Avatar';
|
|
22
23
|
export type { AvatarProps } from './Avatar';
|
|
23
24
|
export { default as Badge } from './Badge';
|
|
@@ -120,6 +121,8 @@ export { default as DropdownMenu } from './DropdownMenu';
|
|
|
120
121
|
export type { DropdownMenuProps } from './DropdownMenu';
|
|
121
122
|
export { default as DrawerMenu } from './DrawerMenu';
|
|
122
123
|
export type { DrawerMenuProps } from './DrawerMenu';
|
|
124
|
+
export { default as Sidebar } from './Sidebar';
|
|
125
|
+
export type { SidebarProps } from './Sidebar';
|
|
123
126
|
export { default as DropdownUserMenu } from './DropdownUserMenu';
|
|
124
127
|
export type { DropdownUserMenuProps } from './DropdownUserMenu';
|
|
125
128
|
export { default as Layout } from './Layout';
|