@epam/ai-dial-ui-kit 0.16.0-dev.67 → 0.16.0-dev.69
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/CHANGELOG.md +7 -0
- package/dist/{DateCellRenderer-DMq0adkA.cjs → DateCellRenderer-VFKHZI-J.cjs} +23 -23
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +65 -61
- package/dist/components/New/Breadcrumbs/constants.js +40 -21
- package/dist/components/New/Grid/Grid.js +201 -182
- package/dist/components/New/Grid/components/GridEmptyState.js +13 -0
- package/dist/components/New/Select/Select.js +112 -109
- package/dist/components-manifest.json +57 -13
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/migration-guides/0.16.0/grid-empty-state-pattern.md +100 -0
- package/dist/migration-guides/README.md +1 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +8 -5
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +17 -10
- package/dist/src/components/New/Grid/Grid.d.ts +42 -7
- package/dist/src/components/New/Grid/components/GridEmptyState.d.ts +21 -0
- package/dist/src/components/New/NoDataContent/NoDataContent.d.ts +8 -0
- package/dist/src/components/New/Select/Select.d.ts +6 -0
- package/dist/src/components/New/constants/icon.d.ts +2 -2
- package/dist/src/types/breadcrumbs.d.ts +6 -0
- package/dist/types/breadcrumbs.js +1 -1
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ import { BreadcrumbsSize } from '../../../types/breadcrumbs';
|
|
|
3
3
|
/**
|
|
4
4
|
* The `<nav>`. It clips rather than wraps: a breadcrumb that reflows onto a
|
|
5
5
|
* second line moves the content below it, so the trail truncates its segments
|
|
6
|
-
* instead (see `segmentWidthClassName`).
|
|
6
|
+
* instead (see `segmentWidthClassName`). The tiny trail does not clip at all,
|
|
7
|
+
* so a segment's focus ring stays whole; its segments truncate on their own.
|
|
7
8
|
*/
|
|
8
|
-
export declare const navClassName
|
|
9
|
+
export declare const navClassName: Record<BreadcrumbsSize, string>;
|
|
9
10
|
/** The `<ol>` holding the segments and their separators. */
|
|
10
11
|
export declare const listClassName = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap";
|
|
11
12
|
/** One `<li>`: the segment and the separator that follows it. */
|
|
@@ -21,20 +22,25 @@ export declare const sizeClassName: Record<BreadcrumbsSize, string>;
|
|
|
21
22
|
* variant that does not exist.
|
|
22
23
|
*/
|
|
23
24
|
export declare const currentSizeClassName: Record<BreadcrumbsSize, string>;
|
|
25
|
+
type SegmentPosition = 'first' | 'middle' | 'last';
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* what is left, since it names where the user actually is.
|
|
27
|
+
* The tiny trail caps nothing, so a trail that fits is never truncated. Its
|
|
28
|
+
* middle segments shrink a thousand times faster than the current page, down
|
|
29
|
+
* to a letter and their chevron; only then does the current page give way.
|
|
29
30
|
*/
|
|
30
|
-
export declare const segmentWidthClassName: Record<
|
|
31
|
+
export declare const segmentWidthClassName: Record<BreadcrumbsSize, Record<SegmentPosition, string>>;
|
|
32
|
+
/**
|
|
33
|
+
* The focus ring's shape, shared by the segments and the ellipsis button. The
|
|
34
|
+
* tiny trail draws the design's 1px offset around a 4px radius.
|
|
35
|
+
*/
|
|
36
|
+
export declare const focusRingClassName: Record<BreadcrumbsSize, string>;
|
|
31
37
|
/** The box that draws a segment, around its icon and its label. */
|
|
32
|
-
export declare const segmentClassName = "flex min-w-0 flex-1 items-center gap-1
|
|
38
|
+
export declare const segmentClassName = "flex min-w-0 flex-1 items-center gap-1 transition-colors";
|
|
33
39
|
/**
|
|
34
40
|
* A segment the user can follow. Secondary until hovered, then accent — the
|
|
35
41
|
* same pairing the kit's other inline links use.
|
|
36
42
|
*/
|
|
37
|
-
export declare const linkSegmentClassName = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-
|
|
43
|
+
export declare const linkSegmentClassName = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-focus";
|
|
38
44
|
/**
|
|
39
45
|
* The last segment: where the user is. Semibold and primary, and never a
|
|
40
46
|
* link — a control that navigates to the page it is on has nothing to do.
|
|
@@ -49,7 +55,7 @@ export declare const separatorClassName = "inline-flex flex-none items-center le
|
|
|
49
55
|
* glyph to the 24×24 of WCAG 2.5.8; the enhanced 44×44 target would overhang
|
|
50
56
|
* the segments on either side of it (see the README exception table).
|
|
51
57
|
*/
|
|
52
|
-
export declare const overflowButtonClassName = "dial-kit-minimum-target flex shrink-0 items-center
|
|
58
|
+
export declare const overflowButtonClassName = "dial-kit-minimum-target flex shrink-0 items-center text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-focus";
|
|
53
59
|
/**
|
|
54
60
|
* Smallest trail the collapse can produce: the root, the ellipsis and the
|
|
55
61
|
* current page. Below that there is nothing left to hide behind the ellipsis.
|
|
@@ -58,3 +64,4 @@ export declare const MIN_VISIBLE_ITEMS = 3;
|
|
|
58
64
|
/** Segments shown before the trail collapses. */
|
|
59
65
|
export declare const DEFAULT_MAX_VISIBLE_ITEMS = 4;
|
|
60
66
|
export declare const defaultSeparator: ReactNode;
|
|
67
|
+
export {};
|
|
@@ -34,12 +34,26 @@ export interface GridProps<T extends object = Record<string, unknown>> {
|
|
|
34
34
|
alternateOddRowColors?: boolean;
|
|
35
35
|
/** Placeholder of the column filter inputs. */
|
|
36
36
|
filterPlaceholder?: string;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Illustration of both empty states. Defaults to the shared placeholder-list
|
|
39
|
+
* card of `NoDataContent`; leave it unset so every empty list looks the same.
|
|
40
|
+
*/
|
|
38
41
|
emptyStateIcon?: ReactNode;
|
|
39
|
-
/** Headline
|
|
42
|
+
/** Headline when there are no rows, as "No [entities] yet". */
|
|
40
43
|
emptyStateTitle?: string;
|
|
41
|
-
/** Secondary line
|
|
44
|
+
/** Secondary line when there are no rows, as "[Entities] will appear here once [condition]." */
|
|
42
45
|
emptyStateDescription?: string;
|
|
46
|
+
/** Way forward when there are no rows, such as a create button. */
|
|
47
|
+
emptyStateAction?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Announces the no-rows message. Turn it on when the host filters `rowData`
|
|
50
|
+
* itself, so the grid is empty because of a search. Defaults to `false`.
|
|
51
|
+
*/
|
|
52
|
+
emptyStateLive?: boolean;
|
|
53
|
+
/** Headline when the column filters leave no rows, as "No [entities] found". */
|
|
54
|
+
filteredEmptyStateTitle?: string;
|
|
55
|
+
/** Secondary line when the column filters leave no rows. */
|
|
56
|
+
filteredEmptyStateDescription?: string;
|
|
43
57
|
/** Shows the loading overlay. Defaults to `false`. */
|
|
44
58
|
loading?: boolean;
|
|
45
59
|
/** Draws a border around the grid. Defaults to `true`. */
|
|
@@ -75,6 +89,13 @@ export interface GridProps<T extends object = Record<string, unknown>> {
|
|
|
75
89
|
* columns sized to the available width, a row context menu, truncation
|
|
76
90
|
* tooltips, and an empty state.
|
|
77
91
|
*
|
|
92
|
+
* The empty state follows the Patterns 2.0 empty-state behaviour and has two
|
|
93
|
+
* forms. A grid with no rows says "No [entities] yet" and can offer an action;
|
|
94
|
+
* a grid whose column filters leave nothing says "No [entities] found" and is
|
|
95
|
+
* announced, since the user has just changed a filter. A host that filters
|
|
96
|
+
* `rowData` itself passes the "found" copy as `emptyStateTitle` and sets
|
|
97
|
+
* `emptyStateLive`.
|
|
98
|
+
*
|
|
78
99
|
* The selection column renders the 2.0 `Checkbox` and `Radio` instead of
|
|
79
100
|
* ag-Grid's own inputs, so selection looks and behaves like every other control
|
|
80
101
|
* in the kit and the select-all reaches the `mixed` state when the selection is
|
|
@@ -107,6 +128,16 @@ export interface GridProps<T extends object = Record<string, unknown>> {
|
|
|
107
128
|
* getContextMenuItems={(row) => [{ key: 'edit', label: 'Edit' }]}
|
|
108
129
|
* />
|
|
109
130
|
*
|
|
131
|
+
* // An empty grid with a way forward
|
|
132
|
+
* <Grid<Product>
|
|
133
|
+
* columnDefs={columns}
|
|
134
|
+
* rowData={[]}
|
|
135
|
+
* emptyStateTitle="No products yet"
|
|
136
|
+
* emptyStateDescription="Products will appear here once you add one."
|
|
137
|
+
* emptyStateAction={<OutlinedButton label="Add product" onClick={addProduct} />}
|
|
138
|
+
* filteredEmptyStateTitle="No products found"
|
|
139
|
+
* />
|
|
140
|
+
*
|
|
110
141
|
* // Dark native controls, including the date-filter calendar
|
|
111
142
|
* <Grid<Product> columnDefs={columns} rowData={products} colorScheme={GridColorScheme.Dark} />
|
|
112
143
|
* ```
|
|
@@ -125,9 +156,13 @@ export interface GridProps<T extends object = Record<string, unknown>> {
|
|
|
125
156
|
* @param [getRowId] - Extracts the unique id of a row. Defaults to its `id` field.
|
|
126
157
|
* @param [alternateOddRowColors=false] - Tints odd rows.
|
|
127
158
|
* @param [filterPlaceholder='Enter value'] - Placeholder of the column filter inputs.
|
|
128
|
-
* @param [emptyStateIcon] - Illustration of
|
|
129
|
-
* @param [emptyStateTitle='No
|
|
130
|
-
* @param [emptyStateDescription] - Secondary line
|
|
159
|
+
* @param [emptyStateIcon] - Illustration of both empty states. Defaults to the shared placeholder-list card.
|
|
160
|
+
* @param [emptyStateTitle='No items yet'] - Headline when there are no rows.
|
|
161
|
+
* @param [emptyStateDescription='Items will appear here once they are added.'] - Secondary line when there are no rows.
|
|
162
|
+
* @param [emptyStateAction] - Way forward when there are no rows.
|
|
163
|
+
* @param [emptyStateLive=false] - Announce the no-rows message; for a host that filters `rowData` itself.
|
|
164
|
+
* @param [filteredEmptyStateTitle='No items found'] - Headline when the column filters leave no rows.
|
|
165
|
+
* @param [filteredEmptyStateDescription='Try a different search term or check your filters.'] - Secondary line when the column filters leave no rows.
|
|
131
166
|
* @param [loading=false] - Shows the loading overlay.
|
|
132
167
|
* @param [wrapperBorder=true] - Draws a border around the grid.
|
|
133
168
|
* @param [withoutHeaderBorders=false] - Hides the vertical borders between header cells.
|
|
@@ -138,4 +173,4 @@ export interface GridProps<T extends object = Record<string, unknown>> {
|
|
|
138
173
|
* @param [colorScheme='light'] - AG Grid color scheme. `dark` paints native controls dark.
|
|
139
174
|
* @param [appearance='default'] - Visual treatment; `chat` draws the borderless "Chat table".
|
|
140
175
|
*/
|
|
141
|
-
export declare const Grid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, className, ariaLabel, wrapCustomCellRenderers, disabledRowIds, selectedRowIds, onSelectionChange, onGridApiChange, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, loading, wrapperBorder, withoutHeaderBorders, allowDisabledContextMenu, selectionMode, selectRowLabel, selectAllLabel, colorScheme, appearance, }: GridProps<T>) => import('react/jsx-runtime').JSX.Element;
|
|
176
|
+
export declare const Grid: <T extends object>({ columnDefs, rowData, additionalGridOptions, getContextMenuItems, className, ariaLabel, wrapCustomCellRenderers, disabledRowIds, selectedRowIds, onSelectionChange, onGridApiChange, getRowId, alternateOddRowColors, filterPlaceholder, emptyStateIcon, emptyStateTitle, emptyStateDescription, emptyStateAction, emptyStateLive, filteredEmptyStateTitle, filteredEmptyStateDescription, loading, wrapperBorder, withoutHeaderBorders, allowDisabledContextMenu, selectionMode, selectRowLabel, selectAllLabel, colorScheme, appearance, }: GridProps<T>) => import('react/jsx-runtime').JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IOverlayParams, OverlaySelectorFunc } from 'ag-grid-community';
|
|
2
|
+
import { NoDataContentProps } from '../../NoDataContent/NoDataContent';
|
|
3
|
+
/** What the grid shows for each of its two empty states. */
|
|
4
|
+
export interface GridEmptyStateParams {
|
|
5
|
+
/** The grid has no rows at all. */
|
|
6
|
+
empty: NoDataContentProps;
|
|
7
|
+
/** The grid has rows, but its column filters leave none of them. */
|
|
8
|
+
filtered: NoDataContentProps;
|
|
9
|
+
}
|
|
10
|
+
export type GridEmptyStateProps = IOverlayParams & GridEmptyStateParams;
|
|
11
|
+
/**
|
|
12
|
+
* The grid's no-rows and no-matching-rows overlays, both drawn with
|
|
13
|
+
* {@link NoDataContent} so an empty grid looks like every other empty list.
|
|
14
|
+
*/
|
|
15
|
+
export declare const GridEmptyState: ({ overlayType, empty, filtered, }: GridEmptyStateProps) => import('react/jsx-runtime').JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Hands the two empty overlays to {@link GridEmptyState} and leaves the rest —
|
|
18
|
+
* loading, exporting — to ag-Grid. The selector is read once, so what the
|
|
19
|
+
* overlay shows travels in `overlayComponentParams`, which ag-Grid refreshes.
|
|
20
|
+
*/
|
|
21
|
+
export declare const selectGridEmptyStateOverlay: OverlaySelectorFunc;
|
|
@@ -29,6 +29,14 @@ export interface NoDataContentProps {
|
|
|
29
29
|
* secondary line and an optional action. The icon is decorative, so it is
|
|
30
30
|
* hidden from assistive tech and the text carries the message on its own.
|
|
31
31
|
*
|
|
32
|
+
* Copy follows the Patterns 2.0 empty-state behaviour:
|
|
33
|
+
* - default: "No [entities] yet" / "[Entities] will appear here once [condition]."
|
|
34
|
+
* - Shared with me: "No [entities] yet" / "[Entities] other people share with you will show up here."
|
|
35
|
+
* - after a search or filter: "No [entities] found" / "Try a different search
|
|
36
|
+
* term or check your filters." — drop the part the list does not have — with `live`.
|
|
37
|
+
*
|
|
38
|
+
* Leave `icon` unset in a list, so every empty list shows the same card.
|
|
39
|
+
*
|
|
32
40
|
* @example
|
|
33
41
|
* ```tsx
|
|
34
42
|
* <NoDataContent
|
|
@@ -41,6 +41,10 @@ export interface SelectProps {
|
|
|
41
41
|
emptyStateTitle?: string;
|
|
42
42
|
emptyStateDescription?: string;
|
|
43
43
|
emptyStateIcon?: ReactNode;
|
|
44
|
+
/** Title when the search leaves no options, as "No [entities] found". Falls back to `emptyStateTitle`. */
|
|
45
|
+
filteredEmptyStateTitle?: string;
|
|
46
|
+
/** Description when the search leaves no options. Falls back to `emptyStateDescription`. */
|
|
47
|
+
filteredEmptyStateDescription?: string;
|
|
44
48
|
disabled?: boolean;
|
|
45
49
|
className?: string;
|
|
46
50
|
fieldClassName?: string;
|
|
@@ -113,6 +117,8 @@ export interface SelectProps {
|
|
|
113
117
|
* @param [emptyStateTitle="No options available"] - Title text when there are no options.
|
|
114
118
|
* @param [emptyStateDescription] - Description text when there are no options.
|
|
115
119
|
* @param [emptyStateIcon] - Icon to display when there are no options.
|
|
120
|
+
* @param [filteredEmptyStateTitle] - Title when the search leaves no options, as "No [entities] found". Falls back to `emptyStateTitle`; the message is announced.
|
|
121
|
+
* @param [filteredEmptyStateDescription] - Description when the search leaves no options, as "Try a different search term". Falls back to `emptyStateDescription`.
|
|
116
122
|
* @param [invalid] - Whether the select is in an invalid state, affecting styling.
|
|
117
123
|
* @param [disabled=false] - Disable the control.
|
|
118
124
|
* @param [className] - Additional CSS classes for the outer container.
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* icon, a menu item, a segmented-control segment — can match the ones the
|
|
14
14
|
* components draw themselves.
|
|
15
15
|
*
|
|
16
|
-
* Two deliberate departures inside the library:
|
|
17
|
-
* (`NoDataContent
|
|
16
|
+
* Two deliberate departures inside the library: an icon passed as an
|
|
17
|
+
* empty-state illustration (`NoDataContent`'s `icon`) uses a much lighter stroke,
|
|
18
18
|
* since a 1.5px line reads as a drawing at 16px and as a fence at 100px; and
|
|
19
19
|
* the checkbox glyph uses a heavier one, because it is a control mark sized to
|
|
20
20
|
* a 14px box rather than an icon from the set.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export declare enum BreadcrumbsSize {
|
|
2
2
|
/** 14px `dial-small-text`, with a `dial-small-semi-text` current page. */
|
|
3
3
|
Small = "small",
|
|
4
|
+
/**
|
|
5
|
+
* 12px `dial-tiny-text`, with a `dial-tiny-semi-text` current page: a 16px
|
|
6
|
+
* trail for a dense header. It never clips, so a focus ring stays whole, and
|
|
7
|
+
* nothing is capped: the middle truncates first, the current page last.
|
|
8
|
+
*/
|
|
9
|
+
Tiny = "tiny",
|
|
4
10
|
/**
|
|
5
11
|
* 18px `dial-h2-text`, for a trail that doubles as the page heading. The
|
|
6
12
|
* token is semibold, so every segment is — including the current page.
|