@veevarts/design-system 2.0.0-alpha.61 → 2.0.0-alpha.62
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/index.cjs +6 -6
- package/dist/index.js +4047 -3950
- package/dist/patterns/ActionsMenu/ActionsMenu.d.ts +3 -0
- package/dist/patterns/ActionsMenu/icons.d.ts +2 -0
- package/dist/patterns/ActionsMenu/index.d.ts +2 -0
- package/dist/patterns/ActionsMenu/styles.d.ts +20 -0
- package/dist/patterns/ActionsMenu/types.d.ts +35 -0
- package/dist/patterns/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ActionsMenuSize } from './types';
|
|
2
|
+
export declare const actionsMenuSizeClass: Record<ActionsMenuSize, string>;
|
|
3
|
+
export declare const actionsMenuClass: {
|
|
4
|
+
readonly trigger: "text-default-600";
|
|
5
|
+
/** The menu otherwise grows to its longest line; a description wraps instead. */
|
|
6
|
+
readonly menuWithDescriptions: "max-w-xs";
|
|
7
|
+
/**
|
|
8
|
+
* HeroUI truncates a string description; a reason cut short is no reason.
|
|
9
|
+
*/
|
|
10
|
+
readonly itemDescription: "whitespace-normal text-default-600";
|
|
11
|
+
/**
|
|
12
|
+
* A disabled item with a description. HeroUI dims the whole item, which
|
|
13
|
+
* would take the description to about 2:1, and opacity cannot be undone
|
|
14
|
+
* by a child. So the item stays opaque and the label and icon are dimmed.
|
|
15
|
+
*/
|
|
16
|
+
readonly itemDisabledWithDescription: "opacity-100";
|
|
17
|
+
readonly itemDimmed: "opacity-disabled";
|
|
18
|
+
readonly itemDimmedIcon: "flex shrink-0 opacity-disabled";
|
|
19
|
+
readonly dangerItem: "text-danger";
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MenuAction {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
tone?: 'default' | 'danger';
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Second line under the label, typically why a disabled action is
|
|
10
|
+
* unavailable. react-aria never focuses a disabled item, so the
|
|
11
|
+
* descriptions of disabled actions also describe the trigger
|
|
12
|
+
* (`aria-describedby`), the same convention as `EntityRow`.
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
onAction: () => void;
|
|
16
|
+
/** Defaults to `<data-testid>-<key>`. */
|
|
17
|
+
'data-testid'?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ActionsMenuSize = 'sm' | 'md';
|
|
20
|
+
export interface ActionsMenuProps {
|
|
21
|
+
/** Menu items. An empty array renders no trigger. */
|
|
22
|
+
actions: MenuAction[];
|
|
23
|
+
/**
|
|
24
|
+
* Accessible name of the `⋯` trigger and of the menu. Include the
|
|
25
|
+
* subject: "Actions for Spring Exhibit TBD", not "Actions" — a page with
|
|
26
|
+
* several of these otherwise reads as a column of identical buttons.
|
|
27
|
+
*/
|
|
28
|
+
label: string;
|
|
29
|
+
/** Overrides the default `⋯` glyph. */
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
size?: ActionsMenuSize;
|
|
32
|
+
isDisabled?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
'data-testid'?: string;
|
|
35
|
+
}
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -180,3 +180,5 @@ export { SessionExpiredCard } from './SessionExpiredCard';
|
|
|
180
180
|
export type { SessionExpiredCardProps } from './SessionExpiredCard';
|
|
181
181
|
export { Notice } from './Notice';
|
|
182
182
|
export type { NoticeProps, NoticeTone, NoticeVariant } from './Notice';
|
|
183
|
+
export { ActionsMenu } from './ActionsMenu';
|
|
184
|
+
export type { ActionsMenuProps, ActionsMenuSize, MenuAction } from './ActionsMenu';
|