@epam/ai-dial-ui-kit 0.15.0-dev.4 → 0.15.0-dev.42
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/README.md +191 -0
- package/dist/CHANGELOG.md +75 -0
- package/dist/DateCellRenderer-ChqbDlQ2.cjs +1 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-Cl_mNbi1.cjs} +31 -31
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/JsonEditor-CpSpVa0v.cjs +1 -0
- package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-CPzMv3lE.cjs} +1 -1
- package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-NYMcKLJy.cjs} +1 -1
- package/dist/MarkdownEditorContainer-DVPRplYf.cjs +1 -0
- package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
- package/dist/components/Button/constants.js +9 -8
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +16 -14
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/FileManager/FileManager.js +373 -372
- package/dist/components/FileManager/FileManagerProvider.js +266 -264
- package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/Accordion/Accordion.js +87 -71
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +206 -0
- package/dist/components/New/AutocompleteTagInput/utils.js +11 -0
- package/dist/components/New/Avatar/Avatar.js +70 -0
- package/dist/components/New/Badge/Badge.js +45 -0
- package/dist/components/New/BottomSheet/BottomSheet.js +128 -0
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/Button/Button.js +32 -32
- package/dist/components/New/Button/ButtonWrappers.js +93 -37
- package/dist/components/New/Button/constants.js +3 -0
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
- package/dist/components/New/Calendar/Calendar.js +301 -265
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +5 -3
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +38 -37
- package/dist/components/New/ConfirmationPopup/constants.js +8 -11
- package/dist/components/New/Dropdown/Dropdown.js +112 -105
- package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
- package/dist/components/New/Dropdown/constants.js +22 -17
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
- package/dist/components/New/EntityIdentity/EntityIdentity.js +135 -0
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FileIcon/FileIcon.js +55 -0
- package/dist/components/New/FileIcon/constants.js +134 -0
- package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
- package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
- package/dist/components/New/FileName/FileName.js +78 -0
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderName/FolderName.js +16 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
- package/dist/components/New/Notification/Notification.js +33 -29
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +46 -44
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- package/dist/components/New/Search/Search.js +29 -27
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/CollapsedSelectTags.js +127 -0
- package/dist/components/New/Select/MultiSelectTags.js +18 -15
- package/dist/components/New/Select/Select.js +219 -197
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
- package/dist/components/New/SideDrawer/SideDrawer.js +148 -0
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +125 -61
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +48 -44
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- package/dist/components/New/Tooltip/constants.js +1 -1
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components/New/constants/overlay.js +17 -9
- package/dist/components/Popup/constants.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -33
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/types.js +19 -8
- package/dist/components/SchemaRenderer/utils.js +122 -95
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +1653 -71
- package/dist/constants/public-class-names.js +210 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +346 -299
- package/dist/editor-Bc9xzKuR.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-Cy9WobJf.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +1 -0
- package/dist/migration-guides/0.15.0/legacy-theme-variable-fallbacks-removal.md +69 -0
- package/dist/migration-guides/README.md +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
- package/dist/src/components/FileManager/FileManager.d.ts +2 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +97 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.d.ts +17 -0
- package/dist/src/components/New/AutocompleteTagInput/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
- package/dist/src/components/New/Badge/Badge.d.ts +47 -0
- package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +84 -0
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
- package/dist/src/components/New/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/New/Calendar/Calendar.d.ts +7 -1
- package/dist/src/components/New/Calendar/constants.d.ts +1 -1
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +0 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
- package/dist/src/components/New/EntityIdentity/EntityIdentity.d.ts +85 -0
- package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
- package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
- package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
- package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
- package/dist/src/components/New/FileName/FileName.d.ts +79 -0
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
- package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
- package/dist/src/components/New/Notification/Notification.d.ts +18 -0
- package/dist/src/components/New/Popup/constants.d.ts +1 -1
- package/dist/src/components/New/Select/CollapsedSelectTags.d.ts +22 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +5 -0
- package/dist/src/components/New/Select/Select.d.ts +9 -0
- package/dist/src/components/New/Select/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
- package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +100 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/components/New/constants/overlay.d.ts +13 -0
- package/dist/src/components/Popup/constants.d.ts +1 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
- package/dist/src/constants/public-class-names.d.ts +201 -0
- package/dist/src/index.d.ts +36 -1
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/avatar.d.ts +7 -0
- package/dist/src/types/badge.d.ts +16 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/entity-type.d.ts +9 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
- package/dist/src/utils/avatar.d.ts +12 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/types/accordion.js +4 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +5 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/entity-type.js +4 -0
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-C-dMqEFy.cjs +3 -0
- package/dist/utils/avatar.js +22 -0
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +99 -54
- package/package.json +4 -7
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.cjs +0 -1
- package/dist/JsonEditor-qv1Z0dLX.cjs +0 -1
- package/dist/MarkdownEditorContainer-Bzcnoemw.cjs +0 -1
- package/dist/lazy-tfN4sKhq.cjs +0 -1
- package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -6,7 +6,6 @@ export declare const loaderContainerClassName = "px-6 py-4 h-[120px]";
|
|
|
6
6
|
export declare const defaultCancelLabel = "Cancel";
|
|
7
7
|
export declare const defaultConfirmLabel = "Ok";
|
|
8
8
|
export declare const variantConfig: Record<ConfirmationPopupVariant, {
|
|
9
|
-
container?: string;
|
|
10
9
|
confirm: {
|
|
11
10
|
variant: ButtonVariant;
|
|
12
11
|
appearance: ButtonAppearance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/react';
|
|
2
|
-
import { FC, MouseEvent, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { CSSProperties, FC, MouseEvent, ReactNode, RefObject } from 'react';
|
|
3
3
|
import { DropdownTrigger } from '../../../types/dropdown';
|
|
4
4
|
import { DropdownItem } from '../../../models/dropdown';
|
|
5
5
|
export interface DropdownProps {
|
|
@@ -25,6 +25,13 @@ export interface DropdownProps {
|
|
|
25
25
|
overlayContentClassName?: string;
|
|
26
26
|
separatorClassName?: string;
|
|
27
27
|
listClassName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Inline style for the floating overlay. The overlay renders in a portal, so
|
|
30
|
+
* this is the only way to hand it CSS custom properties from a caller's own
|
|
31
|
+
* scope — e.g. theme variables that its rows and header read. Positioning
|
|
32
|
+
* stays the dropdown's own: `floatingStyles` is applied on top of it.
|
|
33
|
+
*/
|
|
34
|
+
listStyle?: CSSProperties;
|
|
28
35
|
outsidePressIgnoreRef?: RefObject<HTMLElement | null>;
|
|
29
36
|
outsideClosable?: boolean;
|
|
30
37
|
anchorToMouse?: boolean;
|
|
@@ -97,6 +104,7 @@ export interface DropdownProps {
|
|
|
97
104
|
* @param [overlayContentClassName] - Additional CSS classes applied to the overlay content
|
|
98
105
|
* @param [separatorClassName] - Additional CSS classes applied to the separators between items
|
|
99
106
|
* @param [listClassName] - Additional CSS classes applied to the floating overlay
|
|
107
|
+
* @param [listStyle] - Inline style applied to the floating overlay, under the dropdown's own positioning styles
|
|
100
108
|
* @param [outsidePressIgnoreRef] - Ref to an element that should not trigger outside press behavior
|
|
101
109
|
* @param [outsideClosable=true] - Whether clicks outside the overlay should close it
|
|
102
110
|
* @param [anchorToMouse=false] - Whether to anchor the dropdown to the mouse position
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const dropdownBaseClassName: string;
|
|
2
2
|
export declare const dropdownListBaseClassName: string;
|
|
3
3
|
export declare const dropdownSubMenuClassName: string;
|
|
4
|
+
export declare const dropdownSubMenuListClassName: string;
|
|
5
|
+
/** The top-level item list: rows 2px apart, inset from the panel edge. */
|
|
6
|
+
export declare const dropdownItemListClassName: string;
|
|
4
7
|
/**
|
|
5
8
|
* The row's own styling lives in {@link MenuItem}, which renders every item of
|
|
6
9
|
* the menu. This alias is what a fully custom overlay row can lean on to match
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { EntityType } from '../../../types/entity-type';
|
|
3
|
+
/** Identity fields of the entity rendered by `EntityIdentity`. */
|
|
4
|
+
export interface EntityIdentityItem {
|
|
5
|
+
/** Entity category; picks the colour of the type label and the featured chip. */
|
|
6
|
+
type: EntityType;
|
|
7
|
+
/** Display name. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Version shown next to the name. */
|
|
10
|
+
version?: string;
|
|
11
|
+
/** Icon URL. The initials of `name` show while it is missing or fails to load. */
|
|
12
|
+
iconUrl?: string;
|
|
13
|
+
/** Whether the entity is marked as featured. */
|
|
14
|
+
isFeatured?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** User-visible strings of `EntityIdentity`. */
|
|
17
|
+
export interface EntityIdentityLabels {
|
|
18
|
+
/** Type label text, rendered uppercase. Defaults to the English name of `item.type`. */
|
|
19
|
+
type?: string;
|
|
20
|
+
/** Featured chip text. Defaults to `'Featured'`. */
|
|
21
|
+
featured?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Props for `EntityIdentity`. */
|
|
24
|
+
export interface EntityIdentityProps {
|
|
25
|
+
/** The entity to display. */
|
|
26
|
+
item: EntityIdentityItem;
|
|
27
|
+
/** User-visible strings; pass translated ones in a localised app. */
|
|
28
|
+
labels?: EntityIdentityLabels;
|
|
29
|
+
/** Whether to show `item.version` next to the name. */
|
|
30
|
+
showVersion?: boolean;
|
|
31
|
+
/** Whether to show the featured chip when `item.isFeatured` is true. */
|
|
32
|
+
hasFeaturedTag?: boolean;
|
|
33
|
+
/** Width and height of the icon in px. */
|
|
34
|
+
iconSize?: number;
|
|
35
|
+
/** Heading level of the name, 1–6. */
|
|
36
|
+
headingLevel?: number;
|
|
37
|
+
/** Search query; the matching part of the name is highlighted. */
|
|
38
|
+
query?: string;
|
|
39
|
+
/** Content pinned to the bottom of the text column, aligned with the bottom of the icon. */
|
|
40
|
+
footer?: ReactNode;
|
|
41
|
+
/** Badge rendered before the featured chip, in the top-end corner. */
|
|
42
|
+
statusBadge?: ReactNode;
|
|
43
|
+
/** Additional CSS classes for the root. */
|
|
44
|
+
className?: string;
|
|
45
|
+
/** Type-scale class for the name. Defaults to `'dial-h3-text'`. */
|
|
46
|
+
nameClassName?: string;
|
|
47
|
+
/** Type-scale class for the type label. Defaults to `'dial-caption-lead-semi-text'`. */
|
|
48
|
+
typeClassName?: string;
|
|
49
|
+
/** Type-scale class for the version. Defaults to `'dial-tiny-text'`. */
|
|
50
|
+
versionClassName?: string;
|
|
51
|
+
/** Additional CSS classes for the icon, e.g. to change its corner radius. */
|
|
52
|
+
iconClassName?: string;
|
|
53
|
+
/** Additional CSS classes for the featured chip. */
|
|
54
|
+
featuredChipClassName?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The identity block of a DIAL entity: its icon, a coloured type label, the
|
|
58
|
+
* name and the version, with an optional featured chip.
|
|
59
|
+
* aliases: EntityHeader|ModelHeader|AppIdentity
|
|
60
|
+
* Design system 2.0
|
|
61
|
+
*
|
|
62
|
+
* The type label is plain uppercase text coloured by `item.type`. The icon is
|
|
63
|
+
* a square `Avatar`, so a missing or broken image falls back to the initials of
|
|
64
|
+
* the name. The icon is decorative: the name next to it already names the
|
|
65
|
+
* entity.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <EntityIdentity
|
|
70
|
+
* item={{ type: EntityType.Model, name: 'GPT-4o', version: '2024-11-20' }}
|
|
71
|
+
* labels={{ type: t('Model') }}
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @param item - The entity to display
|
|
76
|
+
* @param [labels] - User-visible strings
|
|
77
|
+
* @param [showVersion=true] - Whether to show the version
|
|
78
|
+
* @param [hasFeaturedTag=true] - Whether to show the featured chip for a featured entity
|
|
79
|
+
* @param [iconSize=48] - Icon size in px
|
|
80
|
+
* @param [headingLevel=3] - Heading level of the name
|
|
81
|
+
* @param [query] - Search query highlighted in the name
|
|
82
|
+
* @param [footer] - Content pinned to the bottom of the text column
|
|
83
|
+
* @param [statusBadge] - Badge in the top-end corner
|
|
84
|
+
*/
|
|
85
|
+
export declare const EntityIdentity: FC<EntityIdentityProps>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialItemType } from '../../../types/item';
|
|
3
|
+
/** Props for `FileIcon`. */
|
|
4
|
+
export interface FileIconProps {
|
|
5
|
+
/** Whether the item is a file or a folder. */
|
|
6
|
+
type: DialItemType;
|
|
7
|
+
/** Item name; a file's extension is read from it unless `fileExtension` is set. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Extension to pick the glyph by, overriding the one in `name`. With or without a leading dot. */
|
|
10
|
+
fileExtension?: string;
|
|
11
|
+
/** Draws the shared badge in the bottom-left corner. */
|
|
12
|
+
shared?: boolean;
|
|
13
|
+
/** Replaces the glyph with a spinner. */
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
/** Glyph size in px. Defaults to `DIAL_ICON_SIZE.MD` (20). */
|
|
16
|
+
size?: number;
|
|
17
|
+
/** Additional CSS classes for the root element. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Hides the icon from assistive technology when the row already names the item. */
|
|
20
|
+
decorative?: boolean;
|
|
21
|
+
/** Accessible name. Defaults to "PDF file", "File" or "Folder", with ", shared" appended when shared. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Accessible name of the spinner shown while `loading`. */
|
|
24
|
+
loadingLabel?: string;
|
|
25
|
+
/** Additional CSS classes for the shared badge. */
|
|
26
|
+
sharedIndicatorClassName?: string;
|
|
27
|
+
/** Tooltip shown over the shared badge. */
|
|
28
|
+
sharedIndicatorTooltip?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The icon of a file or folder row in a file manager: a file-type glyph picked
|
|
32
|
+
* by extension, or a folder, with an optional shared badge and loading state.
|
|
33
|
+
* aliases: FileTypeIcon|EntityIcon
|
|
34
|
+
* Design system 2.0
|
|
35
|
+
*
|
|
36
|
+
* The root is a `role="img"` whose name says what the item is, and that it is
|
|
37
|
+
* shared — the badge itself is drawn inside the image, so its tooltip is a
|
|
38
|
+
* pointer-only hint and never the only place the state is conveyed. While
|
|
39
|
+
* `loading`, the root drops the role and holds a `Spinner`, which announces
|
|
40
|
+
* itself as a status. Pass `decorative` when the row already names the item.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <FileIcon name="report.pdf" type={DialItemType.File} shared />
|
|
45
|
+
* <FileIcon name="Projects" type={DialItemType.Folder} loading />
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param type - Whether the item is a file or a folder
|
|
49
|
+
* @param name - Item name; a file's extension is read from it
|
|
50
|
+
* @param [fileExtension] - Extension overriding the one in `name`
|
|
51
|
+
* @param [shared=false] - Draws the shared badge
|
|
52
|
+
* @param [loading=false] - Replaces the glyph with a spinner
|
|
53
|
+
* @param [size=DIAL_ICON_SIZE.MD] - Glyph size in px
|
|
54
|
+
* @param [className] - Additional CSS classes for the root element
|
|
55
|
+
* @param [decorative=false] - Hides the icon from assistive technology
|
|
56
|
+
* @param [label] - Accessible name, overriding the generated one
|
|
57
|
+
* @param [loadingLabel='Loading'] - Accessible name of the spinner
|
|
58
|
+
* @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
|
|
59
|
+
* @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
|
|
60
|
+
*/
|
|
61
|
+
export declare const FileIcon: FC<FileIconProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The kinds of file the 2.0 glyph distinguishes. */
|
|
2
|
+
export declare enum FileGlyphKind {
|
|
3
|
+
Images = "images",
|
|
4
|
+
Video = "video",
|
|
5
|
+
Audio = "audio",
|
|
6
|
+
Code = "code",
|
|
7
|
+
Text = "text",
|
|
8
|
+
Pdf = "pdf",
|
|
9
|
+
Spreadsheet = "spreadsheet",
|
|
10
|
+
Presentation = "presentation",
|
|
11
|
+
Archive = "archive",
|
|
12
|
+
Dial = "dial",
|
|
13
|
+
Other = "other"
|
|
14
|
+
}
|
|
15
|
+
/** The glyph kind for a lower-case extension; anything unknown is `Other`. */
|
|
16
|
+
export declare const getFileGlyphKind: (extension: string) => FileGlyphKind;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FileGlyphKind } from '../constants';
|
|
3
|
+
interface FileGlyphProps {
|
|
4
|
+
size: number;
|
|
5
|
+
kind: FileGlyphKind;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The 2.0 file glyph: a gradient sheet with the line work of its kind.
|
|
9
|
+
* Design system 2.0
|
|
10
|
+
*
|
|
11
|
+
* Inlined for the same reasons as `FolderGlyph`: a per-instance gradient `id`
|
|
12
|
+
* from `useId`, and theme tokens in place of fixed hex values.
|
|
13
|
+
*
|
|
14
|
+
* @param size - Width and height in px
|
|
15
|
+
* @param kind - Which art to draw
|
|
16
|
+
*/
|
|
17
|
+
export declare const FileGlyph: FC<FileGlyphProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface FolderGlyphProps {
|
|
3
|
+
size: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The 2.0 folder glyph: a blue back tab over a grey-to-blue gradient body.
|
|
7
|
+
* Design system 2.0
|
|
8
|
+
*
|
|
9
|
+
* Inlined rather than imported as an SVG asset for two reasons: the gradient
|
|
10
|
+
* `id` comes from `useId`, so a list of folders does not repeat one document-
|
|
11
|
+
* wide id (a hidden first copy would otherwise blank every other gradient);
|
|
12
|
+
* and the colours resolve from theme tokens instead of fixed hex values.
|
|
13
|
+
*
|
|
14
|
+
* @param size - Width and height in px
|
|
15
|
+
*/
|
|
16
|
+
export declare const FolderGlyph: FC<FolderGlyphProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { DialItemType } from '../../../types/item';
|
|
3
|
+
/** Props for `FileName`. */
|
|
4
|
+
export interface FileNameProps {
|
|
5
|
+
/** Full item name, with or without an extension. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Whether the item is a file or a folder. Defaults to a file. */
|
|
8
|
+
type?: DialItemType;
|
|
9
|
+
/** Extension to pick the icon by, overriding the one in `name`. */
|
|
10
|
+
fileExtension?: string;
|
|
11
|
+
/** Draws the shared badge on the icon. */
|
|
12
|
+
shared?: boolean;
|
|
13
|
+
/** Replaces the icon with a spinner, which announces itself as a status. */
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
/** Accessible name of the spinner shown while `loading`. */
|
|
16
|
+
loadingLabel?: string;
|
|
17
|
+
/** Icon size in px. Defaults to the `FileIcon` size (20). */
|
|
18
|
+
iconSize?: number;
|
|
19
|
+
/** Metadata under the name (size, date); switches the text to two lines. */
|
|
20
|
+
details?: ReactNode;
|
|
21
|
+
/** Mutes the name, marking it as containing invalid characters. */
|
|
22
|
+
isInvalidName?: boolean;
|
|
23
|
+
/** Additional CSS classes for the root element. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Additional CSS classes for the name text. */
|
|
26
|
+
nameClassName?: string;
|
|
27
|
+
/** Additional CSS classes for the shared badge. */
|
|
28
|
+
sharedIndicatorClassName?: string;
|
|
29
|
+
/** Tooltip shown over the shared badge. */
|
|
30
|
+
sharedIndicatorTooltip?: ReactNode;
|
|
31
|
+
/** Screen-reader text announcing the shared state. */
|
|
32
|
+
sharedLabel?: string;
|
|
33
|
+
/** Suppresses the full-name tooltip even while the name is truncated. */
|
|
34
|
+
hideTooltip?: boolean;
|
|
35
|
+
/** Shown instead of the full name while it is truncated. */
|
|
36
|
+
tooltipContent?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A file or folder name with its type icon, truncated with a tooltip when it
|
|
40
|
+
* does not fit.
|
|
41
|
+
* aliases: FileDisplay|NameDisplay
|
|
42
|
+
* Design system 2.0
|
|
43
|
+
*
|
|
44
|
+
* The visible name already says what the item is, so the icon is decorative;
|
|
45
|
+
* the shared state, which only the badge shows, is announced by a
|
|
46
|
+
* visually-hidden `sharedLabel` after the name instead.
|
|
47
|
+
*
|
|
48
|
+
* While `loading` the icon is swapped for a `Spinner`, which is left in the
|
|
49
|
+
* accessibility tree so the busy state is announced.
|
|
50
|
+
*
|
|
51
|
+
* With `details` the text switches to two lines — the name, then the metadata.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <FileName name="Document.pdf" shared />
|
|
56
|
+
* <FileName
|
|
57
|
+
* name="Document.pdf"
|
|
58
|
+
* details={<span className="dial-tiny-text text-secondary">24 KB · Jul 20</span>}
|
|
59
|
+
* />
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param name - Full item name, with or without an extension
|
|
63
|
+
* @param [type=DialItemType.File] - Whether the item is a file or a folder
|
|
64
|
+
* @param [fileExtension] - Extension overriding the one in `name`
|
|
65
|
+
* @param [shared=false] - Draws the shared badge on the icon
|
|
66
|
+
* @param [loading=false] - Replaces the icon with a spinner
|
|
67
|
+
* @param [loadingLabel='Loading'] - Accessible name of the spinner
|
|
68
|
+
* @param [iconSize] - Icon size in px
|
|
69
|
+
* @param [details] - Metadata under the name
|
|
70
|
+
* @param [isInvalidName=false] - Mutes the name, marking it as invalid
|
|
71
|
+
* @param [className] - Additional CSS classes for the root element
|
|
72
|
+
* @param [nameClassName] - Additional CSS classes for the name text
|
|
73
|
+
* @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
|
|
74
|
+
* @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
|
|
75
|
+
* @param [sharedLabel='Shared'] - Screen-reader text announcing the shared state
|
|
76
|
+
* @param [hideTooltip=false] - Suppresses the full-name tooltip
|
|
77
|
+
* @param [tooltipContent] - Shown instead of the full name while truncated
|
|
78
|
+
*/
|
|
79
|
+
export declare const FileName: FC<FileNameProps>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FilterChipItem<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface FilterChipsProps<T extends string = string> {
|
|
8
|
+
items: FilterChipItem<T>[];
|
|
9
|
+
value: T;
|
|
10
|
+
onChange: (value: T) => void;
|
|
11
|
+
stretch?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
chipClassName?: string;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
'aria-labelledby'?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A row of filter chips that picks one value out of a few.
|
|
19
|
+
* aliases: FilterChipRow|ChipTabs|TagTabs|FilterTabs
|
|
20
|
+
* Design system 2.0
|
|
21
|
+
*
|
|
22
|
+
* The chip-shaped sibling of the kit's other single-select rows, and the one to
|
|
23
|
+
* reach for when the options label a *subset of a list* — "All", "Shared",
|
|
24
|
+
* "Mine" above a history panel. `Tabs` underlines the active option and reads
|
|
25
|
+
* as navigation between panels; `SegmentedControl` sinks equal segments into a
|
|
26
|
+
* track and reads as a view switch. This one draws `TagAppearance.Selectable`
|
|
27
|
+
* chips: no fill until selected, and a semibold label once it is. Selecting a
|
|
28
|
+
* chip therefore widens it by the difference between the regular and semibold
|
|
29
|
+
* label — give the row `stretch`, or the chips a width, if that shift matters.
|
|
30
|
+
*
|
|
31
|
+
* Each chip is a toggle button carrying its state on `aria-pressed`, wrapped in
|
|
32
|
+
* a named `role="group"` — the pattern `Tag` is built for. That makes every
|
|
33
|
+
* chip its own tab stop, which is what a filter row wants: unlike a
|
|
34
|
+
* `radiogroup`, arrowing onto a chip never changes the filter by accident.
|
|
35
|
+
* Name the group through `aria-label` or `aria-labelledby`, or the chips are
|
|
36
|
+
* announced as a handful of unrelated toggles.
|
|
37
|
+
*
|
|
38
|
+
* There is no disabled chip. An option the user must not pick is left out of
|
|
39
|
+
* `items` — a chip that renders but cannot be activated is a label and nothing
|
|
40
|
+
* else, and `Tag` drops its button role when disabled, so it would not even
|
|
41
|
+
* announce as unavailable.
|
|
42
|
+
*
|
|
43
|
+
* Labels are the caller's to translate — the component ships no English
|
|
44
|
+
* defaults.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <FilterChips
|
|
49
|
+
* aria-label={t('Filter chats')}
|
|
50
|
+
* value={tab}
|
|
51
|
+
* onChange={setTab}
|
|
52
|
+
* items={[
|
|
53
|
+
* { value: 'all', label: t('All') },
|
|
54
|
+
* { value: 'mine', label: t('My chats') },
|
|
55
|
+
* { value: 'shared', label: t('Shared') },
|
|
56
|
+
* ]}
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param items - Chips to render, in order; each needs a unique `value` and a `label`
|
|
61
|
+
* @param value - The `value` of the selected chip
|
|
62
|
+
* @param onChange - Called with the `value` of the chip the user picked. A click on the already-selected chip fires it again, so a row that clears back to a default handles that itself
|
|
63
|
+
* @param [stretch=false] - Grows the chips to share the row width equally instead of hugging their labels
|
|
64
|
+
* @param [className] - Additional classes for the row, e.g. its padding or `flex-wrap`
|
|
65
|
+
* @param [chipClassName] - Additional classes for every chip. A panel too narrow for the chips' default padding can tighten it here
|
|
66
|
+
* @param [aria-label] - Names the row as a whole
|
|
67
|
+
* @param [aria-labelledby] - Names the row from an existing element, e.g. a visible heading
|
|
68
|
+
*/
|
|
69
|
+
export declare const FilterChips: <T extends string = string>({ items, value, onChange, stretch, className, chipClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: FilterChipsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chip row itself. It does not wrap by default: a filter row is usually one
|
|
3
|
+
* line of a narrow panel, and a caller that wants it to wrap passes
|
|
4
|
+
* `flex-wrap` through `className`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const containerClassName = "flex flex-nowrap items-center gap-1";
|
|
7
|
+
/**
|
|
8
|
+
* `stretch` layout: the chips share the row width equally but never shrink
|
|
9
|
+
* below their label, so a row too narrow for all of them overflows rather than
|
|
10
|
+
* truncating every chip. `Tag` is already `rounded-full` and `inline-flex`, so
|
|
11
|
+
* only the growth and the centring are added here.
|
|
12
|
+
*/
|
|
13
|
+
export declare const chipStretchClassName = "min-w-max flex-1 justify-center";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FileNameProps } from '../FileName/FileName';
|
|
3
|
+
/** Props for `FolderName`. */
|
|
4
|
+
export type FolderNameProps = Omit<FileNameProps, 'type' | 'fileExtension'>;
|
|
5
|
+
/**
|
|
6
|
+
* A folder name with the folder icon, truncated with a tooltip when it does
|
|
7
|
+
* not fit.
|
|
8
|
+
* aliases: FolderDisplay|DirectoryName
|
|
9
|
+
* Design system 2.0
|
|
10
|
+
*
|
|
11
|
+
* A `FileName` fixed to `DialItemType.Folder`, so it shares every behaviour of
|
|
12
|
+
* it — decorative icon, visually-hidden shared label, `details` line and the
|
|
13
|
+
* `loading` spinner. Its root carries `dial-kit-folder-name` on top of
|
|
14
|
+
* `dial-kit-file-name`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <FolderName name="Organization" shared />
|
|
19
|
+
* <FolderName name="Uploads" loading />
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param name - Folder name
|
|
23
|
+
* @param [shared=false] - Draws the shared badge on the icon
|
|
24
|
+
* @param [loading=false] - Replaces the icon with a spinner
|
|
25
|
+
* @param [loadingLabel='Loading'] - Accessible name of the spinner
|
|
26
|
+
* @param [iconSize] - Icon size in px
|
|
27
|
+
* @param [details] - Metadata under the name
|
|
28
|
+
* @param [isInvalidName=false] - Mutes the name, marking it as invalid
|
|
29
|
+
* @param [className] - Additional CSS classes for the root element
|
|
30
|
+
* @param [nameClassName] - Additional CSS classes for the name text
|
|
31
|
+
* @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
|
|
32
|
+
* @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
|
|
33
|
+
* @param [sharedLabel='Shared'] - Screen-reader text announcing the shared state
|
|
34
|
+
* @param [hideTooltip=false] - Suppresses the full-name tooltip
|
|
35
|
+
* @param [tooltipContent] - Shown instead of the full name while truncated
|
|
36
|
+
*/
|
|
37
|
+
export declare const FolderName: FC<FolderNameProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Placement } from '@floating-ui/react';
|
|
2
|
-
import { ButtonHTMLAttributes, FC } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, CSSProperties, FC } from 'react';
|
|
3
3
|
import { DropdownItem } from '../../../models/dropdown';
|
|
4
4
|
import { ElementSize } from '../../../types/size';
|
|
5
5
|
export interface InlineSelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -9,6 +9,8 @@ export interface InlineSelectTriggerProps extends ButtonHTMLAttributes<HTMLButto
|
|
|
9
9
|
size?: ElementSize;
|
|
10
10
|
/** Whether the inline select is open or not. */
|
|
11
11
|
isOpen?: boolean;
|
|
12
|
+
/** Additional CSS classes applied to the label, e.g. its type scale or colour. */
|
|
13
|
+
labelClassName?: string;
|
|
12
14
|
}
|
|
13
15
|
export declare const InlineSelectTrigger: FC<InlineSelectTriggerProps>;
|
|
14
16
|
export interface InlineSelectProps {
|
|
@@ -30,11 +32,24 @@ export interface InlineSelectProps {
|
|
|
30
32
|
matchReferenceWidth?: boolean;
|
|
31
33
|
/** Additional CSS classes applied to the dropdown overlay. */
|
|
32
34
|
listClassName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Inline style for the dropdown overlay. The overlay renders in a portal, so
|
|
37
|
+
* this is how custom properties reach its rows.
|
|
38
|
+
*/
|
|
39
|
+
listStyle?: CSSProperties;
|
|
33
40
|
/**
|
|
34
41
|
* Accessible name for the trigger. Without it the control announces only its
|
|
35
42
|
* current value ("Option A"), never what is being selected.
|
|
36
43
|
*/
|
|
37
44
|
ariaLabel?: string;
|
|
45
|
+
/** Additional CSS classes applied to the trigger button, merged after its own. */
|
|
46
|
+
triggerClassName?: string;
|
|
47
|
+
/** Additional CSS classes applied to the trigger's label. */
|
|
48
|
+
triggerLabelClassName?: string;
|
|
49
|
+
/** Controlled open state of the dropdown. Pair it with `onOpenChange`. */
|
|
50
|
+
open?: boolean;
|
|
51
|
+
/** Fired when the dropdown opens or closes. Receives the new open state. */
|
|
52
|
+
onOpenChange?: (open: boolean) => void;
|
|
38
53
|
}
|
|
39
54
|
/**
|
|
40
55
|
* An inline select control combining `InlineSelectTrigger` with `Dropdown`.
|
|
@@ -10,9 +10,10 @@ export declare const INTERACTIVE_TOOLTIP_GAP = 8;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const INTERACTIVE_TOOLTIP_HOVER_OPEN_DELAY = 400;
|
|
12
12
|
/**
|
|
13
|
-
* The panel sits
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* The panel sits one step of the overlay ladder (`z-interactive-tooltip`, see
|
|
14
|
+
* `zIndex` in `tailwind.config.js`) above the surface it is anchored to — a
|
|
15
|
+
* dropdown or select overlay, both `z-floating` — since it can be opened from
|
|
16
|
+
* a row inside one of them.
|
|
16
17
|
*
|
|
17
18
|
* By style this is a neutral floating panel rather than the coloured
|
|
18
19
|
* `Notification` banner: it shares the raised-card shape a dropdown or the
|
|
@@ -23,4 +24,4 @@ export declare const INTERACTIVE_TOOLTIP_HOVER_OPEN_DELAY = 400;
|
|
|
23
24
|
* Padding and width are the panel's own, sized for a block of copy and
|
|
24
25
|
* controls rather than a menu row.
|
|
25
26
|
*/
|
|
26
|
-
export declare const interactiveTooltipClassName = "z-
|
|
27
|
+
export declare const interactiveTooltipClassName = "z-interactive-tooltip max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md";
|
|
@@ -5,6 +5,7 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
5
5
|
type?: NotificationType;
|
|
6
6
|
title?: ReactNode;
|
|
7
7
|
message: ReactNode;
|
|
8
|
+
action?: ReactNode;
|
|
8
9
|
closable?: boolean;
|
|
9
10
|
iconSize?: number;
|
|
10
11
|
iconStroke?: number;
|
|
@@ -57,12 +58,29 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
57
58
|
* title="Title"
|
|
58
59
|
* message="Description text example"
|
|
59
60
|
* />
|
|
61
|
+
*
|
|
62
|
+
* <Notification
|
|
63
|
+
* variant={NotificationVariant.Error}
|
|
64
|
+
* type={NotificationType.SectionMessage}
|
|
65
|
+
* title="Couldn't finish this response"
|
|
66
|
+
* message="Something went wrong. Try again in a moment."
|
|
67
|
+
* action={
|
|
68
|
+
* <Button
|
|
69
|
+
* variant={ButtonVariant.Neutral}
|
|
70
|
+
* appearance={ButtonAppearance.Outlined}
|
|
71
|
+
* size={ElementSize.Small}
|
|
72
|
+
* label="Try again"
|
|
73
|
+
* onClick={handleRetry}
|
|
74
|
+
* />
|
|
75
|
+
* }
|
|
76
|
+
* />
|
|
60
77
|
* ```
|
|
61
78
|
*
|
|
62
79
|
* @param [variant=NotificationVariant.Info] - Defines the visual style and icon of the alert
|
|
63
80
|
* @param [type=NotificationType.Toast] - Defines the type of notification, either a toast or a section message
|
|
64
81
|
* @param [title] - Optional heading displayed above the message in semibold
|
|
65
82
|
* @param message - Message text to display inside the alert
|
|
83
|
+
* @param [action] - Optional control (typically a small `Button`) rendered at the inline end, after the text and before the close button; the caller supplies its accessible name
|
|
66
84
|
* @param [className] - Additional CSS classes applied to the alert container
|
|
67
85
|
* @param [textClassName] - Additional CSS classes applied to the message text
|
|
68
86
|
* @param [closable=false] - Whether the alert has a close button
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PopupSize } from '../../../types/popup';
|
|
2
|
-
export declare const popupOverlayBaseClassName = "z-
|
|
2
|
+
export declare const popupOverlayBaseClassName = "z-popup flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6";
|
|
3
3
|
export declare const popupBaseClassName = "relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto";
|
|
4
4
|
export declare const popupHeaderClassName = "flex flex-row items-center justify-between px-6 py-4";
|
|
5
5
|
export declare const popupTitleClassName = "flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, MouseEvent } from 'react';
|
|
2
|
+
import { SelectOption } from '../../../models/select';
|
|
3
|
+
export interface CollapsedSelectTagsProps {
|
|
4
|
+
options: SelectOption[];
|
|
5
|
+
selectedValues: string[];
|
|
6
|
+
handleRemoveTag: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The selected tags of a multi-select on a single row. The tags that do not fit
|
|
10
|
+
* the width of the field collapse into a `+N` counter whose hover panel lists
|
|
11
|
+
* them, each still removable.
|
|
12
|
+
* Design system 2.0
|
|
13
|
+
*
|
|
14
|
+
* The count follows the width the field has, not the number of tags: every tag
|
|
15
|
+
* is measured in a hidden copy of the row, so the tags that stay visible are
|
|
16
|
+
* the ones that fit beside the counter, and the count follows a resize.
|
|
17
|
+
*
|
|
18
|
+
* @param options - All available options, used to resolve labels and icons
|
|
19
|
+
* @param selectedValues - Values currently selected
|
|
20
|
+
* @param handleRemoveTag - Called with the value whose tag was removed
|
|
21
|
+
*/
|
|
22
|
+
export declare const CollapsedSelectTags: FC<CollapsedSelectTagsProps>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { FC, MouseEvent } from 'react';
|
|
2
2
|
import { SelectOption } from '../../../models/select';
|
|
3
|
+
/** Geometry shared by every tag of a multi-select field, and its `+N` counter. */
|
|
4
|
+
export declare const selectTagClassName = "h-[24px] max-w-full rounded-md border border-secondary bg-layer-sunken px-2";
|
|
3
5
|
export interface MultiSelectTagsProps {
|
|
4
6
|
options: SelectOption[];
|
|
5
7
|
selectedValues: string[];
|
|
6
8
|
handleRemoveTag?: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void;
|
|
9
|
+
/** Additional classes for every tag. */
|
|
10
|
+
tagClassName?: string;
|
|
7
11
|
}
|
|
8
12
|
/**
|
|
9
13
|
* The selected values of a multi-select, rendered as removable tags inside the
|
|
@@ -13,5 +17,6 @@ export interface MultiSelectTagsProps {
|
|
|
13
17
|
* @param options - All available options, used to resolve labels and icons
|
|
14
18
|
* @param selectedValues - Values currently selected
|
|
15
19
|
* @param [handleRemoveTag] - Called with the value whose tag was removed; when omitted the tags are not removable
|
|
20
|
+
* @param [tagClassName] - Additional classes for every tag
|
|
16
21
|
*/
|
|
17
22
|
export declare const MultiSelectTags: FC<MultiSelectTagsProps>;
|
|
@@ -22,6 +22,14 @@ export interface SelectProps {
|
|
|
22
22
|
searchPlaceholder?: string;
|
|
23
23
|
selectAll?: boolean;
|
|
24
24
|
selectAllLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Keeps a multi-select's tags on one row, folding the ones that do not fit
|
|
27
|
+
* into a `+N` counter whose hover panel lists them (as `TagInput` does with
|
|
28
|
+
* the same prop). Without it the tags wrap and the field grows.
|
|
29
|
+
* Ignored with `customMultiSelectTagsRenderer`, and on a mobile screen, where
|
|
30
|
+
* the hover panel is unavailable and the tags wrap instead.
|
|
31
|
+
*/
|
|
32
|
+
collapseTagOverflow?: boolean;
|
|
25
33
|
/**
|
|
26
34
|
* How the chosen option is marked in single mode. The design tints the row
|
|
27
35
|
* (`Tint`, the default); `Check` puts a trailing check on it instead, the
|
|
@@ -98,6 +106,7 @@ export interface SelectProps {
|
|
|
98
106
|
* @param [searchPlaceholder] - Placeholder for the overlay search input.
|
|
99
107
|
* @param [selectAll=false] - Show a "Select All" checkbox in multiple mode.
|
|
100
108
|
* @param [selectAllLabel="Select all"] - Label for the "Select All" checkbox.
|
|
109
|
+
* @param [collapseTagOverflow=false] - Keep a multi-select's tags on one row, folding those that do not fit into a `+N` counter by the width available; the hover panel lists them and removes them.
|
|
101
110
|
* @param [selectedOptionMark=MenuItemMark.Tint] - How the chosen option is marked in single mode.
|
|
102
111
|
* @param [emptyStateTitle="No options available"] - Title text when there are no options.
|
|
103
112
|
* @param [emptyStateDescription] - Description text when there are no options.
|
|
@@ -20,9 +20,10 @@ export declare const selectListWidthClassName = "!max-w-[var(--reference-width)]
|
|
|
20
20
|
* 344px — not the panel around them, so the search row and Select All stay
|
|
21
21
|
* put while the list moves under them. The panel keeps its own cap on the
|
|
22
22
|
* available viewport height, which takes over on a screen too short for this
|
|
23
|
-
* one.
|
|
23
|
+
* one. `py-1` matches the Dropdown menu's list inset, so the first and last
|
|
24
|
+
* rows (and their focus ring) do not sit flush against the panel edge.
|
|
24
25
|
*/
|
|
25
|
-
export declare const selectOptionsScrollClassName
|
|
26
|
+
export declare const selectOptionsScrollClassName: string;
|
|
26
27
|
export declare const selectSubMenuGap = 4;
|
|
27
28
|
export declare const selectSubMenuClassName: string;
|
|
28
29
|
/** Marks an option that opens a nested list. Matches the dropdown's caret. */
|