@epam/ai-dial-ui-kit 0.15.0-dev.3 → 0.15.0-dev.30
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 +185 -0
- package/dist/CHANGELOG.md +48 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-BFEh4rXZ.cjs} +26 -26
- package/dist/DateCellRenderer-J1V3xwF7.cjs +1 -0
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
- package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
- package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
- package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-GvlxX6kx.cjs} +1 -1
- 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/New/Accordion/Accordion.js +87 -71
- 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 +337 -289
- 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 +44 -39
- 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/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/Select.js +120 -109
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -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 +45 -43
- 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 +15 -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 +830 -31
- package/dist/constants/public-class-names.js +198 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +330 -302
- 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-BEsZqouS.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +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/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 +14 -1
- package/dist/src/components/New/Calendar/constants.d.ts +1 -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/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/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -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 +189 -0
- package/dist/src/index.d.ts +22 -1
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/src/utils/timezone.d.ts +24 -0
- package/dist/types/accordion.js +4 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-C0h1Sq5T.cjs +3 -0
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +98 -54
- package/dist/utils/timezone.js +19 -0
- package/package.json +3 -3
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.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
|
@@ -157,6 +157,7 @@ export interface DialFileManagerProps {
|
|
|
157
157
|
renameValidationMessages?: RenameValidationMessages;
|
|
158
158
|
forbiddenSymbolsRegExp?: RegExp;
|
|
159
159
|
forbiddenSymbolsTooltip?: ReactNode;
|
|
160
|
+
skipForbiddenSymbolsCheckForActions?: boolean;
|
|
160
161
|
onCreateFolder?: (file: DialUploadFileItem, folderPath: string, fileId: string) => void | Promise<void>;
|
|
161
162
|
onCreateFolderValidate?: (name: string, parentFolder: DialFile) => string | null;
|
|
162
163
|
folderCreationValidationMessages?: CreateFolderValidationMessages;
|
|
@@ -286,6 +287,7 @@ export interface DialFileManagerProps {
|
|
|
286
287
|
* @param [renameValidationMessages] - Optional custom validation messages for renaming files and folders. Note that you need to add `${NotificationVariant.Warning}__` prefix to the `hiddenItemWarning` message to display it as a warning with the warning icon.
|
|
287
288
|
* @param [forbiddenSymbolsRegExp] - Optional RegExp will be used in the validation for the files and folders names. The "g" and "y" flags are not allowed in this RegExp and will be ignored.
|
|
288
289
|
* @param [forbiddenSymbolsTooltip] - Optional tooltip displayed when a file or folder name contains forbidden characters
|
|
290
|
+
* @param [skipForbiddenSymbolsCheckForActions] - When provided, skips the forbidden-symbols check when building row action menus, so all actions are shown even for items whose names contain forbidden characters.
|
|
289
291
|
*
|
|
290
292
|
* @param [onDownloadFiles] - Callback fired when files are downloaded
|
|
291
293
|
*
|
|
@@ -85,6 +85,7 @@ export interface FileManagerContextValue {
|
|
|
85
85
|
getDisplayName: (item: DialFile) => string;
|
|
86
86
|
forbiddenSymbolsRegExp?: RegExp;
|
|
87
87
|
forbiddenSymbolsTooltip?: ReactNode;
|
|
88
|
+
skipForbiddenSymbolsCheckForActions?: boolean;
|
|
88
89
|
openDeleteConfirmation: (items: DialFile[], parentFolderPath: string) => void;
|
|
89
90
|
closeDeleteConfirmation: () => void;
|
|
90
91
|
confirmDelete: () => void;
|
|
@@ -37,7 +37,8 @@ export interface UseGridContextMenuProps {
|
|
|
37
37
|
isRenameFileAvailable?: boolean;
|
|
38
38
|
isDuplicateFolderAvailable?: boolean;
|
|
39
39
|
forbiddenSymbolsRegExp?: RegExp;
|
|
40
|
+
skipForbiddenSymbolsCheckForActions?: boolean;
|
|
40
41
|
onGridCreateSiblingFolder: (files: DialFile[]) => void;
|
|
41
42
|
onGridCreateChildFolder: (files: DialFile[]) => void;
|
|
42
43
|
}
|
|
43
|
-
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, onInfo, onUnshare, onRemoveAccess, sharedWithMeIds, sharedByMePaths, onManagePermissions, onPreview, onOpenInNewTab, previewExtensions, isRenameFileAvailable, isDuplicateFolderAvailable, forbiddenSymbolsRegExp, onGridCreateSiblingFolder, onGridCreateChildFolder, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
44
|
+
export declare const useGridContextMenu: ({ actionLabels, onDuplicate, onCopy, onMove, onDownload, onRename, onDelete, onInfo, onUnshare, onRemoveAccess, sharedWithMeIds, sharedByMePaths, onManagePermissions, onPreview, onOpenInNewTab, previewExtensions, isRenameFileAvailable, isDuplicateFolderAvailable, forbiddenSymbolsRegExp, skipForbiddenSymbolsCheckForActions, onGridCreateSiblingFolder, onGridCreateChildFolder, }: UseGridContextMenuProps) => (file: DialFile) => DropdownItem[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AccordionCaretPosition } from '../../../types/accordion';
|
|
2
3
|
export interface AccordionProps {
|
|
3
4
|
/** Title rendered in the header. */
|
|
4
5
|
title: ReactNode;
|
|
@@ -24,6 +25,8 @@ export interface AccordionProps {
|
|
|
24
25
|
ariaLabel?: string;
|
|
25
26
|
/** Fired when the header is clicked. Receives the next expanded state. */
|
|
26
27
|
onToggle?: (expanded: boolean) => void;
|
|
28
|
+
/** Where the header draws its caret. Defaults to `AccordionCaretPosition.End`. */
|
|
29
|
+
caretPosition?: AccordionCaretPosition;
|
|
27
30
|
/** Additional CSS classes for the outer container. */
|
|
28
31
|
className?: string;
|
|
29
32
|
/** Additional CSS classes for the header. */
|
|
@@ -41,7 +44,8 @@ export interface AccordionProps {
|
|
|
41
44
|
* expanded, a title, and an optional description stacked beneath it.
|
|
42
45
|
*
|
|
43
46
|
* The revealed content is a labelled `region`, so assistive tech announces it by the
|
|
44
|
-
* header it belongs to.
|
|
47
|
+
* header it belongs to. It stays mounted while collapsed so it can slide open and shut,
|
|
48
|
+
* and is `inert` then, out of both the tab order and the accessibility tree. `nonCollapsible` renders the header as static text instead of
|
|
45
49
|
* a permanently disabled button, which keeps a decorative panel out of the tab order.
|
|
46
50
|
*
|
|
47
51
|
* @example
|
|
@@ -64,6 +68,7 @@ export interface AccordionProps {
|
|
|
64
68
|
* @param [nonCollapsible] - Renders the panel permanently expanded, with a static header.
|
|
65
69
|
* @param [ariaLabel] - Accessible name for the header; needed when `title` carries no text.
|
|
66
70
|
* @param [onToggle] - Fired when the header is clicked. Receives the next expanded state.
|
|
71
|
+
* @param [caretPosition=AccordionCaretPosition.End] - Where the header draws its caret: before or after the title.
|
|
67
72
|
* @param [className] - Additional CSS classes for the outer container.
|
|
68
73
|
* @param [headerClassName] - Additional CSS classes for the header.
|
|
69
74
|
* @param [contentClassName] - Additional CSS classes for the content region.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { FC, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { BreadcrumbsSize } from '../../../types/breadcrumbs';
|
|
3
|
+
/** One step of the trail rendered by {@link Breadcrumbs}. */
|
|
4
|
+
export interface BreadcrumbsItem {
|
|
5
|
+
/**
|
|
6
|
+
* The segment's text. A plain string rather than a node, because it is both
|
|
7
|
+
* what is drawn and what the tooltip shows once the trail truncates it.
|
|
8
|
+
*/
|
|
9
|
+
label: string;
|
|
10
|
+
/** Where the segment navigates. Renders the segment as a link. */
|
|
11
|
+
href?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Fired when the segment is activated. Renders the segment as a button when
|
|
14
|
+
* there is no `href`, and runs before the browser follows one when there is —
|
|
15
|
+
* call `preventDefault()` on the event to keep the user where they are.
|
|
16
|
+
*/
|
|
17
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
18
|
+
/** Leading icon, e.g. a folder glyph on the root. Decorative: pass `aria-hidden`. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface BreadcrumbsProps {
|
|
22
|
+
/** The trail, outermost first. The last entry is the current page. */
|
|
23
|
+
items: BreadcrumbsItem[];
|
|
24
|
+
/**
|
|
25
|
+
* How many segments are drawn before the middle collapses behind an
|
|
26
|
+
* ellipsis menu. Clamped to a floor of three — the root, the ellipsis and
|
|
27
|
+
* the current page.
|
|
28
|
+
*/
|
|
29
|
+
maxVisibleItems?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The trail's type scale: `dial-small-text` by default, or `dial-h2-text`
|
|
32
|
+
* for a trail that doubles as the page heading.
|
|
33
|
+
*/
|
|
34
|
+
size?: BreadcrumbsSize;
|
|
35
|
+
/** Node drawn between two segments. Defaults to a right chevron, mirrored in RTL. */
|
|
36
|
+
separator?: ReactNode;
|
|
37
|
+
/** Accessible name for the `<nav>`. */
|
|
38
|
+
ariaLabel?: string;
|
|
39
|
+
/** Accessible name for the ellipsis button that reveals the collapsed segments. */
|
|
40
|
+
overflowAriaLabel?: string;
|
|
41
|
+
/** Additional CSS classes for the `<nav>`. Must not shrink it to its content. */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Additional CSS classes applied to every segment. */
|
|
44
|
+
itemClassName?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A navigation trail: where the user is, and every level they can step back to.
|
|
48
|
+
* aliases: Breadcrumb|NavigationPath|BreadcrumbTrail
|
|
49
|
+
* Design system 2.0
|
|
50
|
+
*
|
|
51
|
+
* The last item is the current page — drawn semibold and primary, and never a
|
|
52
|
+
* control, since a link to the page you are already on does nothing. Every
|
|
53
|
+
* earlier item with an `href` or an `onClick` is a link; one with neither is
|
|
54
|
+
* drawn as plain text, which is how a read-only location path is built.
|
|
55
|
+
*
|
|
56
|
+
* The trail never wraps. Segments truncate instead, each revealing its full
|
|
57
|
+
* label in a tooltip only once it is actually clipped, and a trail longer than
|
|
58
|
+
* `maxVisibleItems` collapses its middle behind an ellipsis menu — the root and
|
|
59
|
+
* the current page, the two segments that carry the most meaning, always stay
|
|
60
|
+
* on screen.
|
|
61
|
+
*
|
|
62
|
+
* a11y: an `<ol>` inside a named `<nav>`, with `aria-current="page"` on the last
|
|
63
|
+
* segment. Separators are decorative and hidden from assistive tech, so the
|
|
64
|
+
* trail is announced as a list of links rather than a string of chevrons.
|
|
65
|
+
*
|
|
66
|
+
* The trail is drawn at `dial-small-text` by default; `size` switches it to
|
|
67
|
+
* `dial-h2-text` for a trail that doubles as the page heading, where the
|
|
68
|
+
* token's own semibold weight applies to every segment.
|
|
69
|
+
*
|
|
70
|
+
* Labels are the caller's to translate; the two accessible names default to
|
|
71
|
+
* English and take an override.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <Breadcrumbs
|
|
76
|
+
* ariaLabel={t('File path')}
|
|
77
|
+
* items={[
|
|
78
|
+
* { label: t('My files'), onClick: () => open('/') },
|
|
79
|
+
* { label: 'DK Test', onClick: () => open('/DK Test') },
|
|
80
|
+
* { label: 'DK Test with nested' },
|
|
81
|
+
* ]}
|
|
82
|
+
* />
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @param items - The trail, outermost first; the last entry is the current page
|
|
86
|
+
* @param [maxVisibleItems=4] - Segments drawn before the middle collapses behind an ellipsis menu
|
|
87
|
+
* @param [size=BreadcrumbsSize.Small] - The trail's type scale: `dial-small-text` or `dial-h2-text`
|
|
88
|
+
* @param [separator] - Node drawn between two segments; defaults to a right chevron
|
|
89
|
+
* @param [ariaLabel='Breadcrumb'] - Accessible name for the `<nav>`
|
|
90
|
+
* @param [overflowAriaLabel='Show hidden path segments'] - Accessible name for the ellipsis button
|
|
91
|
+
* @param [className] - Additional CSS classes for the `<nav>`
|
|
92
|
+
* @param [itemClassName] - Additional CSS classes applied to every segment
|
|
93
|
+
*/
|
|
94
|
+
export declare const Breadcrumbs: FC<BreadcrumbsProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BreadcrumbsSize } from '../../../types/breadcrumbs';
|
|
3
|
+
/**
|
|
4
|
+
* The `<nav>`. It clips rather than wraps: a breadcrumb that reflows onto a
|
|
5
|
+
* second line moves the content below it, so the trail truncates its segments
|
|
6
|
+
* instead (see `segmentWidthClassName`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const navClassName = "w-full overflow-hidden";
|
|
9
|
+
/** The `<ol>` holding the segments and their separators. */
|
|
10
|
+
export declare const listClassName = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap";
|
|
11
|
+
/** One `<li>`: the segment and the separator that follows it. */
|
|
12
|
+
export declare const itemClassName = "flex min-w-0 items-center gap-2";
|
|
13
|
+
/**
|
|
14
|
+
* The trail's type scale. It sits on the `<li>`, so the segment, the
|
|
15
|
+
* separator and the tooltip trigger inside it all read from one declaration.
|
|
16
|
+
*/
|
|
17
|
+
export declare const sizeClassName: Record<BreadcrumbsSize, string>;
|
|
18
|
+
/**
|
|
19
|
+
* The current page is always semibold. `dial-h2-text` already is, so the
|
|
20
|
+
* heading trail repeats its own token rather than reaching for a semibold
|
|
21
|
+
* variant that does not exist.
|
|
22
|
+
*/
|
|
23
|
+
export declare const currentSizeClassName: Record<BreadcrumbsSize, string>;
|
|
24
|
+
/**
|
|
25
|
+
* How each segment gives up width when the trail does not fit. The root keeps
|
|
26
|
+
* its full label — it is the anchor the user navigates back to — the middle
|
|
27
|
+
* segments truncate first, and the current page keeps the largest share of
|
|
28
|
+
* what is left, since it names where the user actually is.
|
|
29
|
+
*/
|
|
30
|
+
export declare const segmentWidthClassName: Record<'first' | 'middle' | 'last', string>;
|
|
31
|
+
/** 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 rounded-sm transition-colors";
|
|
33
|
+
/**
|
|
34
|
+
* A segment the user can follow. Secondary until hovered, then accent — the
|
|
35
|
+
* same pairing the kit's other inline links use.
|
|
36
|
+
*/
|
|
37
|
+
export declare const linkSegmentClassName = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus";
|
|
38
|
+
/**
|
|
39
|
+
* The last segment: where the user is. Semibold and primary, and never a
|
|
40
|
+
* link — a control that navigates to the page it is on has nothing to do.
|
|
41
|
+
*/
|
|
42
|
+
export declare const currentSegmentClassName = "cursor-default text-primary";
|
|
43
|
+
/** A segment with nowhere to go: rendered, but not a control. */
|
|
44
|
+
export declare const staticSegmentClassName = "cursor-default text-secondary";
|
|
45
|
+
/** The chevron between two segments. */
|
|
46
|
+
export declare const separatorClassName = "inline-flex flex-none items-center leading-none text-secondary";
|
|
47
|
+
/**
|
|
48
|
+
* The collapsed-middle trigger. `dial-kit-minimum-target` lifts the 16px
|
|
49
|
+
* glyph to the 24×24 of WCAG 2.5.8; the enhanced 44×44 target would overhang
|
|
50
|
+
* the segments on either side of it (see the README exception table).
|
|
51
|
+
*/
|
|
52
|
+
export declare const overflowButtonClassName = "dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus";
|
|
53
|
+
/**
|
|
54
|
+
* Smallest trail the collapse can produce: the root, the ellipsis and the
|
|
55
|
+
* current page. Below that there is nothing left to hide behind the ellipsis.
|
|
56
|
+
*/
|
|
57
|
+
export declare const MIN_VISIBLE_ITEMS = 3;
|
|
58
|
+
/** Segments shown before the trail collapses. */
|
|
59
|
+
export declare const DEFAULT_MAX_VISIBLE_ITEMS = 4;
|
|
60
|
+
export declare const defaultSeparator: ReactNode;
|
|
@@ -58,7 +58,10 @@ export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTML
|
|
|
58
58
|
* `<button>`, so the control keeps the link role, middle-click, and
|
|
59
59
|
* "open in new tab". Pair it with `ButtonAppearance.Link` (or `LinkButton`)
|
|
60
60
|
* unless a button-shaped link is intended.
|
|
61
|
-
* @param [tooltipProps] - Props of the 2.0 {@link Tooltip} wrapping the button
|
|
61
|
+
* @param [tooltipProps] - Props of the 2.0 {@link Tooltip} wrapping the button.
|
|
62
|
+
* A disabled button with a visible tooltip is marked `aria-disabled` rather
|
|
63
|
+
* than natively `disabled`, so it stays focusable and hoverable and the
|
|
64
|
+
* tooltip can still explain why it is unavailable; its click does nothing.
|
|
62
65
|
* @param [target] - Anchor target, only meaningful alongside `href`
|
|
63
66
|
* @param [rel] - Anchor `rel`. Defaults to `noopener noreferrer` when
|
|
64
67
|
* `target="_blank"`.
|
|
@@ -43,6 +43,26 @@ export declare const NeutralButton: FC<ButtonVariantProps>;
|
|
|
43
43
|
* Inherits all properties from the `ButtonProps`
|
|
44
44
|
*/
|
|
45
45
|
export declare const DangerButton: FC<ButtonVariantProps>;
|
|
46
|
+
/** A Starter Button component — a conversation starter: an outlined neutral
|
|
47
|
+
* pill whose icons are stroked with the accent gradient
|
|
48
|
+
* Design system 2.0
|
|
49
|
+
*
|
|
50
|
+
* An SVG stroke cannot take a CSS gradient, so the button renders its own
|
|
51
|
+
* `linearGradient` with a per-instance id and hands it to its icons through
|
|
52
|
+
* the `--dial-kit-starter-icon-stroke` custom property. Any icon that strokes
|
|
53
|
+
* with `currentColor`, as Tabler icons do, picks it up.
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <StarterButton
|
|
57
|
+
* label="Summarize this document"
|
|
58
|
+
* iconBefore={<IconSparkles />}
|
|
59
|
+
* onClick={handleClick}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* Inherits all properties from the `ButtonProps`
|
|
64
|
+
*/
|
|
65
|
+
export declare const StarterButton: FC<ButtonVariantProps>;
|
|
46
66
|
/** A Link Button component with predefined link appearance
|
|
47
67
|
* @example
|
|
48
68
|
* ```tsx
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, MouseEventHandler, ReactNode } from 'react';
|
|
1
2
|
import { ButtonAppearance, ButtonVariant } from '../../../types/button';
|
|
3
|
+
/** The tooltip fields that decide whether a disabled button must stay reachable. */
|
|
4
|
+
interface DisabledTooltipFields {
|
|
5
|
+
tooltip?: ReactNode;
|
|
6
|
+
hideTooltip?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** The props a button element takes for its disabled state and its click. */
|
|
9
|
+
type DisabledButtonProps = Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled' | 'aria-disabled' | 'onClick'>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the disabled-state props for a button element: native `disabled`,
|
|
12
|
+
* or — for a disabled button that shows a tooltip — `aria-disabled` with the
|
|
13
|
+
* click swallowed, so the button stays hoverable and focusable.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getDisabledButtonProps: (disabled: boolean | undefined, tooltipProps: DisabledTooltipFields | undefined, onClick: MouseEventHandler<HTMLButtonElement> | undefined) => DisabledButtonProps;
|
|
2
16
|
export declare const getButtonClassNames: (variant?: ButtonVariant, appearance?: ButtonAppearance) => string;
|
|
17
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { DropdownItem } from '../../../models/dropdown';
|
|
3
3
|
import { ButtonProps } from '../Button/Button';
|
|
4
|
+
import { DropdownProps } from '../Dropdown/Dropdown';
|
|
4
5
|
export interface ButtonDropdownProps extends Omit<ButtonProps, 'iconAfter'> {
|
|
5
6
|
items: DropdownItem[];
|
|
7
|
+
/** Menu options forwarded to the underlying `Dropdown`: the panel class and whether the panel matches the button's width. */
|
|
8
|
+
dropdownProps?: Pick<DropdownProps, 'listClassName' | 'matchReferenceWidth'>;
|
|
6
9
|
}
|
|
7
10
|
/**
|
|
8
11
|
* A Button dropdown component based on the Dropdown component
|
|
@@ -20,5 +23,6 @@ export interface ButtonDropdownProps extends Omit<ButtonProps, 'iconAfter'> {
|
|
|
20
23
|
*
|
|
21
24
|
* Inherits all props from Button.
|
|
22
25
|
* @param [items] - DropdownItems with actions
|
|
26
|
+
* @param [dropdownProps] - `listClassName` and `matchReferenceWidth` forwarded to the menu `Dropdown`
|
|
23
27
|
*/
|
|
24
28
|
export declare const ButtonDropdown: FC<ButtonDropdownProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, FocusEventHandler } from 'react';
|
|
2
2
|
import { LabelProps } from '../Label/Label';
|
|
3
3
|
import { CalendarMode } from '../../../types/calendar';
|
|
4
4
|
export type CalendarValue = Date | string | null;
|
|
@@ -6,6 +6,11 @@ export interface CalendarProps {
|
|
|
6
6
|
mode?: CalendarMode;
|
|
7
7
|
value?: CalendarValue;
|
|
8
8
|
onChange?: (value: CalendarValue) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Called when the Calendar's input field loses focus, e.g. for on-blur
|
|
11
|
+
* validation.
|
|
12
|
+
*/
|
|
13
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
9
14
|
labelProps?: LabelProps;
|
|
10
15
|
placeholder?: string;
|
|
11
16
|
disabled?: boolean;
|
|
@@ -17,6 +22,12 @@ export interface CalendarProps {
|
|
|
17
22
|
/** BCP 47 locale tag used to localize month/weekday names and date formatting. */
|
|
18
23
|
locale?: string;
|
|
19
24
|
fieldClassName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Shows the viewer's timezone (e.g. `(GMT+01:00) Europe/Berlin`, computed
|
|
27
|
+
* by `getTimezoneLabel`) at the trailing edge of the `time` field, naming
|
|
28
|
+
* the zone the entered time-of-day refers to.
|
|
29
|
+
*/
|
|
30
|
+
showTimezone?: boolean;
|
|
20
31
|
}
|
|
21
32
|
/**
|
|
22
33
|
* A date/time picker supporting four selection modes.
|
|
@@ -41,6 +52,7 @@ export interface CalendarProps {
|
|
|
41
52
|
* @param [mode=CalendarMode.Date] - Selection mode: date, datetime, time or weekday
|
|
42
53
|
* @param [value] - Controlled value: a `Date` for date/datetime, an `"HH:mm"` string for time, an ISO weekday number (`"1"`=Monday…`"7"`=Sunday) for weekday
|
|
43
54
|
* @param [onChange] - Callback fired with the next value when the selection changes
|
|
55
|
+
* @param [onBlur] - Called when the Calendar's input field loses focus, e.g. for on-blur validation
|
|
44
56
|
* @param [labelProps] - Props of the {@link Label} rendered above the control, including `label`, `required` and `caption`
|
|
45
57
|
* @param [placeholder] - Placeholder shown when there is no value; defaults to a mode-appropriate string ("Select date", "Select date and time", "--:--" or "Select day")
|
|
46
58
|
* @param [disabled=false] - Disables the control
|
|
@@ -51,5 +63,6 @@ export interface CalendarProps {
|
|
|
51
63
|
* @param [maxDate] - Latest selectable date (date/datetime modes)
|
|
52
64
|
* @param [locale="en-GB"] - BCP 47 locale tag used to localize month/weekday names and date formatting
|
|
53
65
|
* @param [fieldClassName] - Additional classes merged onto the trigger field, overriding conflicting defaults
|
|
66
|
+
* @param [showTimezone=false] - Shows the viewer's timezone (e.g. `(GMT+01:00) Europe/Berlin`) at the trailing edge of the `time` field
|
|
54
67
|
*/
|
|
55
68
|
export declare const Calendar: FC<CalendarProps>;
|
|
@@ -4,7 +4,7 @@ export declare const calendarModeDefaultPlaceholder: Record<CalendarMode, string
|
|
|
4
4
|
export declare const calendarFieldBaseClassName = "flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus";
|
|
5
5
|
export declare const calendarFieldDisabledClassName = "!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent";
|
|
6
6
|
export declare const calendarFieldInvalidClassName = "!border-error";
|
|
7
|
-
export declare const calendarPopoverClassName = "z-
|
|
7
|
+
export declare const calendarPopoverClassName = "z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md";
|
|
8
8
|
export declare const calendarDayButtonBaseClassName = "flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus";
|
|
9
9
|
export declare const calendarDaySelectedClassName = "bg-control-accent text-control-permanent";
|
|
10
10
|
export declare const calendarDayTodayClassName = "text-accent dial-small-semi-text";
|
|
@@ -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,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>;
|