@ngrr/ds 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Attachment/AttachmentCard/AttachmentCard.d.ts +21 -0
- package/dist/components/atoms/Attachment/AttachmentCard/index.d.ts +2 -0
- package/dist/components/atoms/Attachment/AttachmentChip/AttachmentChip.d.ts +27 -0
- package/dist/components/atoms/Attachment/AttachmentChip/index.d.ts +2 -0
- package/dist/components/atoms/Attachment/AttachmentField/AttachmentField.d.ts +20 -0
- package/dist/components/atoms/Attachment/AttachmentField/index.d.ts +2 -0
- package/dist/components/atoms/Attachment/FileRow/FileRow.d.ts +18 -0
- package/dist/components/atoms/Attachment/FileRow/index.d.ts +2 -0
- package/dist/components/atoms/Attachment/FileThumbnail/FileThumbnail.d.ts +14 -0
- package/dist/components/atoms/Attachment/FileThumbnail/index.d.ts +2 -0
- package/dist/components/atoms/Attachment/index.d.ts +10 -0
- package/dist/components/atoms/Avatar/Avatar.d.ts +74 -0
- package/dist/components/atoms/Avatar/index.d.ts +2 -0
- package/dist/components/atoms/Badge/Badge.d.ts +40 -0
- package/dist/components/atoms/Badge/index.d.ts +2 -0
- package/dist/components/atoms/Button/Button.d.ts +158 -0
- package/dist/components/atoms/Button/ToggleButton.d.ts +17 -0
- package/dist/components/atoms/Button/VerticalButton.d.ts +90 -0
- package/dist/components/atoms/Button/index.d.ts +6 -0
- package/dist/components/atoms/ButtonGroup/ButtonGroup.d.ts +17 -0
- package/dist/components/atoms/ButtonGroup/ButtonGroupVertical.d.ts +17 -0
- package/dist/components/atoms/ButtonGroup/SplitButton/SplitButton.d.ts +37 -0
- package/dist/components/atoms/ButtonGroup/SplitButton/index.d.ts +2 -0
- package/dist/components/atoms/ButtonGroup/index.d.ts +6 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +47 -0
- package/dist/components/atoms/Checkbox/index.d.ts +2 -0
- package/dist/components/atoms/Chip/Chip.d.ts +83 -0
- package/dist/components/atoms/Chip/index.d.ts +2 -0
- package/dist/components/atoms/Combobox/Combobox.d.ts +39 -0
- package/dist/components/atoms/Combobox/index.d.ts +2 -0
- package/dist/components/atoms/CustomViewTab/CustomViewTab.d.ts +31 -0
- package/dist/components/atoms/CustomViewTab/index.d.ts +2 -0
- package/dist/components/atoms/DataListCell/DataListCell.d.ts +21 -0
- package/dist/components/atoms/DataListCell/index.d.ts +2 -0
- package/dist/components/atoms/DataTableCell/DataTableCell.d.ts +17 -0
- package/dist/components/atoms/DataTableCell/index.d.ts +2 -0
- package/dist/components/atoms/DataTableHeaderCell/DataTableHeaderCell.d.ts +32 -0
- package/dist/components/atoms/DataTableHeaderCell/index.d.ts +2 -0
- package/dist/components/atoms/DateTimePicker/DateTimePicker.d.ts +48 -0
- package/dist/components/atoms/DateTimePicker/index.d.ts +2 -0
- package/dist/components/atoms/LoadingBar/LoadingBar.d.ts +20 -0
- package/dist/components/atoms/LoadingBar/index.d.ts +2 -0
- package/dist/components/atoms/MenuCell/MenuCell.d.ts +46 -0
- package/dist/components/atoms/MenuCell/index.d.ts +2 -0
- package/dist/components/atoms/NumberInput/NumberInput.d.ts +41 -0
- package/dist/components/atoms/NumberInput/index.d.ts +2 -0
- package/dist/components/atoms/OTPInput/OTPInput.d.ts +42 -0
- package/dist/components/atoms/OTPInput/index.d.ts +2 -0
- package/dist/components/atoms/Pagination/PageSelector.d.ts +13 -0
- package/dist/components/atoms/Pagination/Pagination.d.ts +30 -0
- package/dist/components/atoms/Pagination/index.d.ts +4 -0
- package/dist/components/atoms/PasswordInput/PasswordInput.d.ts +46 -0
- package/dist/components/atoms/PasswordInput/PasswordRequirement.d.ts +9 -0
- package/dist/components/atoms/PasswordInput/index.d.ts +4 -0
- package/dist/components/atoms/PhoneInput/PhoneInput.d.ts +33 -0
- package/dist/components/atoms/PhoneInput/index.d.ts +2 -0
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +16 -0
- package/dist/components/atoms/ProgressBar/index.d.ts +2 -0
- package/dist/components/atoms/ProgressRing/ProgressRing.d.ts +29 -0
- package/dist/components/atoms/ProgressRing/index.d.ts +2 -0
- package/dist/components/atoms/Radio/Radio.d.ts +46 -0
- package/dist/components/atoms/Radio/index.d.ts +2 -0
- package/dist/components/atoms/SearchBar/SearchBar.d.ts +28 -0
- package/dist/components/atoms/SearchBar/index.d.ts +2 -0
- package/dist/components/atoms/SectionHeader/SectionHeader.d.ts +12 -0
- package/dist/components/atoms/SectionHeader/index.d.ts +2 -0
- package/dist/components/atoms/SegmentControl/SegmentControl.d.ts +22 -0
- package/dist/components/atoms/SegmentControl/SegmentControlSelector.d.ts +19 -0
- package/dist/components/atoms/SegmentControl/index.d.ts +2 -0
- package/dist/components/atoms/Select/Select.d.ts +31 -0
- package/dist/components/atoms/Select/index.d.ts +2 -0
- package/dist/components/atoms/Separator/Separator.d.ts +20 -0
- package/dist/components/atoms/Separator/index.d.ts +2 -0
- package/dist/components/atoms/Shortcut/Shortcut.d.ts +69 -0
- package/dist/components/atoms/Shortcut/index.d.ts +2 -0
- package/dist/components/atoms/SkeletonLoading/SkeletonLoading.d.ts +7 -0
- package/dist/components/atoms/SkeletonLoading/index.d.ts +2 -0
- package/dist/components/atoms/Stat/Stat.d.ts +16 -0
- package/dist/components/atoms/Stat/index.d.ts +2 -0
- package/dist/components/atoms/Switcher/Switcher.d.ts +46 -0
- package/dist/components/atoms/Switcher/index.d.ts +2 -0
- package/dist/components/atoms/Tab/Tab.d.ts +24 -0
- package/dist/components/atoms/Tab/index.d.ts +2 -0
- package/dist/components/atoms/Tag/Tag.d.ts +50 -0
- package/dist/components/atoms/Tag/index.d.ts +2 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts +27 -0
- package/dist/components/atoms/TextArea/index.d.ts +2 -0
- package/dist/components/atoms/TextInput/TextInput.d.ts +41 -0
- package/dist/components/atoms/TextInput/index.d.ts +2 -0
- package/dist/components/atoms/UploadArea/UploadArea.d.ts +20 -0
- package/dist/components/atoms/UploadArea/index.d.ts +2 -0
- package/dist/components/atoms/_dev/PlaceholderIcon.d.ts +12 -0
- package/dist/components/molecules/Accordion/Accordion.d.ts +17 -0
- package/dist/components/molecules/Accordion/index.d.ts +2 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +22 -0
- package/dist/components/molecules/Breadcrumbs/BreadcrumbsController.d.ts +23 -0
- package/dist/components/molecules/Breadcrumbs/index.d.ts +4 -0
- package/dist/components/molecules/BulkActionBar/BulkActionBar.d.ts +34 -0
- package/dist/components/molecules/BulkActionBar/index.d.ts +2 -0
- package/dist/components/molecules/Callout/Callout.d.ts +28 -0
- package/dist/components/molecules/Callout/index.d.ts +2 -0
- package/dist/components/molecules/CheckboxField/CheckboxField.d.ts +26 -0
- package/dist/components/molecules/CheckboxField/index.d.ts +2 -0
- package/dist/components/molecules/ChipField/ChipField.d.ts +27 -0
- package/dist/components/molecules/ChipField/index.d.ts +2 -0
- package/dist/components/molecules/ChoiceList/ChoiceList.d.ts +39 -0
- package/dist/components/molecules/ChoiceList/index.d.ts +2 -0
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +52 -0
- package/dist/components/molecules/EmptyState/index.d.ts +2 -0
- package/dist/components/molecules/HorizontalInput/HorizontalInput.d.ts +22 -0
- package/dist/components/molecules/HorizontalInput/index.d.ts +2 -0
- package/dist/components/molecules/MultiChoice/MultiChoice.d.ts +27 -0
- package/dist/components/molecules/MultiChoice/index.d.ts +2 -0
- package/dist/components/molecules/PopoverWrapper/PopoverWrapper.d.ts +23 -0
- package/dist/components/molecules/PopoverWrapper/index.d.ts +2 -0
- package/dist/components/molecules/RichTextEditor/RichTextEditor.d.ts +35 -0
- package/dist/components/molecules/RichTextEditor/index.d.ts +2 -0
- package/dist/components/molecules/SidebarMenuSelector/SidebarMenuSelector.d.ts +25 -0
- package/dist/components/molecules/SidebarMenuSelector/index.d.ts +2 -0
- package/dist/components/molecules/SingleChoice/SingleChoice.d.ts +28 -0
- package/dist/components/molecules/SingleChoice/index.d.ts +2 -0
- package/dist/components/molecules/Slider/Slider.d.ts +33 -0
- package/dist/components/molecules/Slider/index.d.ts +2 -0
- package/dist/components/molecules/Toast/Toast.d.ts +29 -0
- package/dist/components/molecules/Toast/index.d.ts +2 -0
- package/dist/components/molecules/Toolbar/Toolbar.d.ts +13 -0
- package/dist/components/molecules/Toolbar/index.d.ts +2 -0
- package/dist/components/molecules/Tooltip/Tooltip.d.ts +22 -0
- package/dist/components/molecules/Tooltip/index.d.ts +2 -0
- package/dist/components/organisms/AlertDialog/AlertDialog.d.ts +26 -0
- package/dist/components/organisms/AlertDialog/index.d.ts +2 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts +21 -0
- package/dist/components/organisms/AppShell/index.d.ts +2 -0
- package/dist/components/organisms/Card/Card.d.ts +22 -0
- package/dist/components/organisms/Card/index.d.ts +2 -0
- package/dist/components/organisms/Charts/Charts.d.ts +112 -0
- package/dist/components/organisms/Charts/index.d.ts +2 -0
- package/dist/components/organisms/DataTable/DataTable.d.ts +27 -0
- package/dist/components/organisms/DataTable/index.d.ts +2 -0
- package/dist/components/organisms/Drawer/Drawer.d.ts +43 -0
- package/dist/components/organisms/Drawer/index.d.ts +2 -0
- package/dist/components/organisms/Modal/Modal.d.ts +34 -0
- package/dist/components/organisms/Modal/index.d.ts +2 -0
- package/dist/components/organisms/Navbar/Navbar.d.ts +23 -0
- package/dist/components/organisms/Navbar/index.d.ts +2 -0
- package/dist/components/organisms/PopoverMenu/PopoverMenu.d.ts +33 -0
- package/dist/components/organisms/PopoverMenu/index.d.ts +2 -0
- package/dist/components/organisms/Sidebar/Sidebar.d.ts +39 -0
- package/dist/components/organisms/Sidebar/index.d.ts +2 -0
- package/dist/docs/ThemeToggle.d.ts +4 -0
- package/dist/index.d.ts +151 -0
- package/dist/types/common.d.ts +83 -0
- package/package.json +2 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type AttachmentCardVariant = 'file' | 'picture';
|
|
2
|
+
export type AttachmentCardDescriptionPosition = 'inside' | 'outside';
|
|
3
|
+
export type AttachmentCardAction = 'none' | 'more' | 'remove';
|
|
4
|
+
export interface AttachmentCardProps {
|
|
5
|
+
variant?: AttachmentCardVariant;
|
|
6
|
+
descriptionPosition?: AttachmentCardDescriptionPosition;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
metaData?: string;
|
|
10
|
+
hasMetadata?: boolean;
|
|
11
|
+
showDescription?: boolean;
|
|
12
|
+
imageSrc?: string;
|
|
13
|
+
imageAlt?: string;
|
|
14
|
+
action?: AttachmentCardAction;
|
|
15
|
+
showActionOnHover?: boolean;
|
|
16
|
+
onActionClick?: () => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function AttachmentCard({ variant, descriptionPosition, loading, title, metaData, hasMetadata, showDescription, imageSrc, imageAlt, action, showActionOnHover, onActionClick, className, 'aria-label': ariaLabel, }: AttachmentCardProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default AttachmentCard;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FileThumbnailVariant } from '../FileThumbnail';
|
|
3
|
+
export type AttachmentChipSize = 'md' | 'sm';
|
|
4
|
+
export type AttachmentChipAction = 'none' | 'more' | 'remove';
|
|
5
|
+
export interface AttachmentChipMenuOption {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface AttachmentChipProps {
|
|
12
|
+
fileName: string;
|
|
13
|
+
fileSize: string;
|
|
14
|
+
previewVariant?: FileThumbnailVariant;
|
|
15
|
+
previewSrc?: string;
|
|
16
|
+
size?: AttachmentChipSize;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
action?: AttachmentChipAction;
|
|
20
|
+
menuOptions?: AttachmentChipMenuOption[];
|
|
21
|
+
onMenuSelect?: (optionId: string) => void;
|
|
22
|
+
onRemove?: () => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function AttachmentChip({ fileName, fileSize, previewVariant, previewSrc, size, disabled, loading, action, menuOptions, onMenuSelect, onRemove, className, 'aria-label': ariaLabel, }: AttachmentChipProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default AttachmentChip;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface AttachmentFieldProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
showLabel?: boolean;
|
|
5
|
+
helperText?: string;
|
|
6
|
+
showHelpText?: boolean;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
accept?: string;
|
|
12
|
+
uploadButtonLabel?: string;
|
|
13
|
+
value?: File | null;
|
|
14
|
+
defaultValue?: File | null;
|
|
15
|
+
onChange?: (file: File | null) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function AttachmentField({ id, label, showLabel, helperText, showHelpText, error, errorMessage, disabled, loading, accept, uploadButtonLabel, value, defaultValue, onChange, className, 'aria-label': ariaLabel, }: AttachmentFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default AttachmentField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FileThumbnailVariant } from '../FileThumbnail';
|
|
2
|
+
export type FileRowState = 'default' | 'hover' | 'uploading';
|
|
3
|
+
export interface FileRowProps {
|
|
4
|
+
fileName?: string;
|
|
5
|
+
fileType?: string;
|
|
6
|
+
fileSize?: string;
|
|
7
|
+
previewVariant?: FileThumbnailVariant;
|
|
8
|
+
previewSrc?: string;
|
|
9
|
+
state?: FileRowState;
|
|
10
|
+
uploadProgress?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
onCopyLink?: () => void;
|
|
13
|
+
onDownload?: () => void;
|
|
14
|
+
onCancelUpload?: () => void;
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function FileRow({ fileName, fileType, fileSize, previewVariant, previewSrc, state, uploadProgress, className, onCopyLink, onDownload, onCancelUpload, 'aria-label': ariaLabel, }: FileRowProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default FileRow;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type FileThumbnailVariant = 'file' | 'image';
|
|
3
|
+
export type FileThumbnailSize = 'xxSmall' | 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
|
|
4
|
+
export interface FileThumbnailProps {
|
|
5
|
+
variant?: FileThumbnailVariant;
|
|
6
|
+
size?: FileThumbnailSize;
|
|
7
|
+
imageSrc?: string;
|
|
8
|
+
imageAlt?: string;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
'aria-label'?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function FileThumbnail({ variant, size, imageSrc, imageAlt, icon, className, 'aria-label': ariaLabel, }: FileThumbnailProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FileThumbnail;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { FileThumbnail } from './FileThumbnail';
|
|
2
|
+
export type { FileThumbnailProps, FileThumbnailVariant, FileThumbnailSize } from './FileThumbnail';
|
|
3
|
+
export { AttachmentChip } from './AttachmentChip';
|
|
4
|
+
export type { AttachmentChipProps, AttachmentChipAction, AttachmentChipSize, AttachmentChipMenuOption, } from './AttachmentChip';
|
|
5
|
+
export { AttachmentField } from './AttachmentField';
|
|
6
|
+
export type { AttachmentFieldProps } from './AttachmentField';
|
|
7
|
+
export { AttachmentCard } from './AttachmentCard';
|
|
8
|
+
export type { AttachmentCardProps, AttachmentCardVariant, AttachmentCardDescriptionPosition, AttachmentCardAction, } from './AttachmentCard';
|
|
9
|
+
export { FileRow } from './FileRow';
|
|
10
|
+
export type { FileRowProps, FileRowState } from './FileRow';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
export type AvatarSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
4
|
+
export type AvatarVariant = 'profile' | 'organization';
|
|
5
|
+
export type AvatarFill = 'picture' | 'initials' | 'icon';
|
|
6
|
+
export interface AvatarProps {
|
|
7
|
+
/** Visual size of the avatar. Default: `'md'` (40×40px). */
|
|
8
|
+
size?: AvatarSize;
|
|
9
|
+
/** Shape: circle for a person, rounded square for an org. Default: `'profile'`. */
|
|
10
|
+
variant?: AvatarVariant;
|
|
11
|
+
/** Content fill type. Priority: picture → initials → icon. Default: `'initials'`. */
|
|
12
|
+
fill?: AvatarFill;
|
|
13
|
+
/** Image URL — used when `fill='picture'`. */
|
|
14
|
+
src?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 1–2 character string shown when `fill='initials'`.
|
|
17
|
+
* Will be trimmed to 2 chars and uppercased automatically.
|
|
18
|
+
*/
|
|
19
|
+
initials?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Lucide icon component rendered when `fill='icon'`.
|
|
22
|
+
* Pass the component reference, not JSX: `icon={Star}` not `icon={<Star />}`.
|
|
23
|
+
* Falls back to `User` (profile) or `Building2` (organization) when omitted.
|
|
24
|
+
* Swap the default any time by changing the import at the top of Avatar.tsx.
|
|
25
|
+
*/
|
|
26
|
+
icon?: LucideIcon;
|
|
27
|
+
/** Entity name — sets `aria-label`. Required for meaningful avatars. */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** Alt text for the image when `fill='picture'`. Defaults to `name`. */
|
|
30
|
+
alt?: string;
|
|
31
|
+
/** Additional CSS class names forwarded to the root element. */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Optional inline styles for host contexts (e.g. AvatarGroup stacking order). */
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
export type AvatarGroupSize = 'xxs' | 'xs' | 'sm';
|
|
37
|
+
export interface AvatarItem {
|
|
38
|
+
src?: string;
|
|
39
|
+
initials?: string;
|
|
40
|
+
/** Required — used to build the accessible `aria-label` for the group. */
|
|
41
|
+
name: string;
|
|
42
|
+
variant?: AvatarVariant;
|
|
43
|
+
fill?: AvatarFill;
|
|
44
|
+
}
|
|
45
|
+
export interface AvatarGroupProps {
|
|
46
|
+
/** Size of each avatar in the group. Limited to xxs/xs/sm per design spec. Default: `'sm'`. */
|
|
47
|
+
size?: AvatarGroupSize;
|
|
48
|
+
/** Ordered list of avatar data to render. */
|
|
49
|
+
avatars: AvatarItem[];
|
|
50
|
+
/** Maximum number of avatars to show before the "+N" overflow counter. Default: `5`. */
|
|
51
|
+
maxVisible?: number;
|
|
52
|
+
/** Additional CSS class names forwarded to the group container. */
|
|
53
|
+
className?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Accessible label for the group.
|
|
56
|
+
* Auto-generated from names when omitted: "Ana Costa, João Silva, and 2 others".
|
|
57
|
+
*/
|
|
58
|
+
'aria-label'?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Avatar — visual identity marker for a person or organization.
|
|
62
|
+
*
|
|
63
|
+
* Fill priority: picture → initials → icon.
|
|
64
|
+
* Always provide a `name` prop so screen readers can announce the identity.
|
|
65
|
+
*/
|
|
66
|
+
export declare function Avatar({ size, variant, fill, src, initials, icon, name, alt, className, style, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* AvatarGroup — overlapping stack of avatars with an optional overflow counter.
|
|
69
|
+
*
|
|
70
|
+
* Only supports the three smallest sizes (xxs, xs, sm) per design specification.
|
|
71
|
+
* Provide `aria-label` or ensure each `AvatarItem` has a `name` — the group
|
|
72
|
+
* builds an accessible summary label from names automatically.
|
|
73
|
+
*/
|
|
74
|
+
export declare function AvatarGroup({ size, avatars, maxVisible, className, 'aria-label': ariaLabel, }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type BadgeSize = 'sm' | 'lg' | 'dot';
|
|
2
|
+
export type BadgeVariant = 'highlight-soft' | 'highlight-strong' | 'informative' | 'critical';
|
|
3
|
+
export interface BadgeProps {
|
|
4
|
+
/**
|
|
5
|
+
* Visual size of the badge.
|
|
6
|
+
* - `sm` — 16 × 16 px minimum; shows count text.
|
|
7
|
+
* - `lg` — 24 × 24 px minimum; shows count text.
|
|
8
|
+
* - `dot` — 8 × 8 px circle; no text; use for presence/status signals only.
|
|
9
|
+
* @default 'sm'
|
|
10
|
+
*/
|
|
11
|
+
size?: BadgeSize;
|
|
12
|
+
/**
|
|
13
|
+
* Semantic colour variant.
|
|
14
|
+
* - `highlight-soft` — light teal bg, teal text.
|
|
15
|
+
* - `highlight-strong` — filled teal bg, white text.
|
|
16
|
+
* - `informative` — neutral gray bg, secondary text.
|
|
17
|
+
* - `critical` — filled red bg, white text.
|
|
18
|
+
* @default 'highlight-soft'
|
|
19
|
+
*/
|
|
20
|
+
variant?: BadgeVariant;
|
|
21
|
+
/**
|
|
22
|
+
* Numeric count to display on `sm` and `lg` badges.
|
|
23
|
+
* Values > 99 are automatically rendered as "99+".
|
|
24
|
+
* Ignored when `size='dot'`.
|
|
25
|
+
*/
|
|
26
|
+
count?: number;
|
|
27
|
+
/** Additional CSS class names to merge onto the root element. */
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Accessible label. Badge components are typically decorative — the host
|
|
31
|
+
* element (e.g. the button or avatar the badge overlays) should carry the
|
|
32
|
+
* accessible description. Provide `aria-label` only when the badge is
|
|
33
|
+
* rendered in isolation and needs its own description.
|
|
34
|
+
*
|
|
35
|
+
* Dot badges are `aria-hidden="true"` by default; supplying `aria-label`
|
|
36
|
+
* overrides that and makes them visible to assistive technology.
|
|
37
|
+
*/
|
|
38
|
+
'aria-label'?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function Badge({ size, variant, count, className, 'aria-label': ariaLabel, }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Visual hierarchy variant.
|
|
4
|
+
*
|
|
5
|
+
* - `'primary'` — filled CTA. Highest visual weight. One per view.
|
|
6
|
+
* - `'secondary'` — outlined surface. Supports the primary action.
|
|
7
|
+
* - `'ghost'` — transparent background. Utility / low-emphasis actions.
|
|
8
|
+
* - `'plain'` — text-only, no container. Lowest weight. `sm` size only.
|
|
9
|
+
*
|
|
10
|
+
* Maps to Figma "Variant" property.
|
|
11
|
+
*/
|
|
12
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'plain';
|
|
13
|
+
/**
|
|
14
|
+
* Size of the button.
|
|
15
|
+
*
|
|
16
|
+
* - `'md'` — 32 px tall (`control/button/inset/standard` = 8 px padding).
|
|
17
|
+
* - `'sm'` — 24 px tall (`control/button/inset/small` = 4 px padding).
|
|
18
|
+
*
|
|
19
|
+
* `plain` variant is available in `sm` only.
|
|
20
|
+
*
|
|
21
|
+
* Maps to Figma "Size" property (Medium → `md`, Small → `sm`).
|
|
22
|
+
*/
|
|
23
|
+
export type ButtonSize = 'sm' | 'md';
|
|
24
|
+
export interface ButtonProps {
|
|
25
|
+
/**
|
|
26
|
+
* Visual hierarchy variant.
|
|
27
|
+
* @default 'primary'
|
|
28
|
+
*/
|
|
29
|
+
variant?: ButtonVariant;
|
|
30
|
+
/**
|
|
31
|
+
* Size of the button.
|
|
32
|
+
* Controls padding (`control/button/inset/*`) and border-radius (`control/radius/*`).
|
|
33
|
+
* Height is derived: padding × 2 + 16 px icon/text line-height.
|
|
34
|
+
* @default 'md'
|
|
35
|
+
*/
|
|
36
|
+
size?: ButtonSize;
|
|
37
|
+
/**
|
|
38
|
+
* Prevents all interaction. Maps to the native `disabled` attribute.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Processing state. Replaces the leading icon with a spinner, disables
|
|
44
|
+
* interaction, and sets `aria-busy="true"`.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to render the leading icon slot.
|
|
50
|
+
* Provide `leadingIcon` with the actual icon element.
|
|
51
|
+
* Replaced by the spinner when `loading` is `true`.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
showLeadingIcon?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Icon element rendered in the leading position.
|
|
57
|
+
* Use any 16 × 16 SVG icon component.
|
|
58
|
+
*/
|
|
59
|
+
leadingIcon?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to show the label / `children`.
|
|
62
|
+
* Set to `false` for icon-only buttons — always supply `aria-label`.
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
showLabel?: boolean;
|
|
66
|
+
/** The button label text (or any inline ReactNode). */
|
|
67
|
+
children?: React.ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to render the trailing icon slot.
|
|
70
|
+
* Provide `trailingIcon` with the actual icon element.
|
|
71
|
+
* Hidden when `loading` is `true`.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
showTrailingIcon?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Icon element rendered in the trailing position.
|
|
77
|
+
* Use any 16 × 16 SVG icon component.
|
|
78
|
+
*/
|
|
79
|
+
trailingIcon?: React.ReactNode;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to render an inline keyboard shortcut badge.
|
|
82
|
+
* Also supply `shortcutAriaLabel` (required by `<Shortcut>`).
|
|
83
|
+
* Hidden when `loading` is `true`.
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
shortcut?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Key string displayed inside the shortcut badge.
|
|
89
|
+
* e.g. `'⌘K'`, `'⌘ ⇧ P'`, `'Ctrl K'`.
|
|
90
|
+
* @default '⌘K'
|
|
91
|
+
*/
|
|
92
|
+
shortcutLabel?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Plain-English screen-reader label for the shortcut badge.
|
|
95
|
+
* Required when `shortcut` is `true`. e.g. `'Command K'`.
|
|
96
|
+
*/
|
|
97
|
+
shortcutAriaLabel?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Applies danger/red colour treatment — signals an irreversible or harmful action.
|
|
100
|
+
* Shares the same variants, sizes, and layout as the Main button.
|
|
101
|
+
* Use sparingly; reserve for actions that cannot be undone or carry significant
|
|
102
|
+
* consequences (e.g. "Delete record", "Remove member").
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
destructive?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* HTML `type` attribute on the underlying `<button>`.
|
|
108
|
+
* @default 'button'
|
|
109
|
+
*/
|
|
110
|
+
type?: 'button' | 'submit' | 'reset';
|
|
111
|
+
/** Click handler. Not called when `disabled` or `loading`. */
|
|
112
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
113
|
+
/**
|
|
114
|
+
* Accessible label. Required for icon-only buttons (when `showLabel={false}`).
|
|
115
|
+
*/
|
|
116
|
+
'aria-label'?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Indicates the button opens a popup (menu, listbox, dialog, etc.).
|
|
119
|
+
* Use `"true"` or `"menu"` for dropdown triggers. Omit for regular buttons.
|
|
120
|
+
*/
|
|
121
|
+
'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
122
|
+
/** Additional CSS class names. */
|
|
123
|
+
className?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* **Button** — triggers an action.
|
|
127
|
+
*
|
|
128
|
+
* Implements the DS-Nagarro Main button specification with four variants,
|
|
129
|
+
* two sizes, icon slots, keyboard shortcut badge, and loading state.
|
|
130
|
+
*
|
|
131
|
+
* Styles live in `Button.css` alongside this file. All CSS values reference
|
|
132
|
+
* `tokens.css` via `var()` — adjust a token there to update all states at once.
|
|
133
|
+
*
|
|
134
|
+
* ### Layout
|
|
135
|
+
* Height is controlled by padding alone (no explicit height):
|
|
136
|
+
* - `md` — 8 px padding (all sides) + 16 px content = **32 px**
|
|
137
|
+
* - `sm` — 4 px padding (all sides) + 16 px content = **24 px**
|
|
138
|
+
*
|
|
139
|
+
* ### Usage
|
|
140
|
+
* ```tsx
|
|
141
|
+
* // Primary
|
|
142
|
+
* <Button onClick={save}>Save changes</Button>
|
|
143
|
+
*
|
|
144
|
+
* // Secondary with leading icon
|
|
145
|
+
* <Button variant="secondary" showLeadingIcon leadingIcon={<DownloadIcon />}>
|
|
146
|
+
* Export
|
|
147
|
+
* </Button>
|
|
148
|
+
*
|
|
149
|
+
* // Icon-only — aria-label is required
|
|
150
|
+
* <Button variant="ghost" showLabel={false}
|
|
151
|
+
* showLeadingIcon leadingIcon={<MoreIcon />} aria-label="More options" />
|
|
152
|
+
*
|
|
153
|
+
* // Loading
|
|
154
|
+
* <Button loading>Saving…</Button>
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export declare function Button({ variant, size, disabled, loading, destructive, showLeadingIcon, leadingIcon, showLabel, children, showTrailingIcon, trailingIcon, shortcut, shortcutLabel, shortcutAriaLabel, type, onClick, 'aria-label': ariaLabel, 'aria-haspopup': ariaHasPopup, className, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
158
|
+
export default Button;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { ButtonSize, ButtonVariant } from './Button';
|
|
3
|
+
export type ToggleButtonSize = ButtonSize;
|
|
4
|
+
export type ToggleButtonVariant = Exclude<ButtonVariant, 'plain'>;
|
|
5
|
+
export interface ToggleButtonProps {
|
|
6
|
+
size?: ToggleButtonSize;
|
|
7
|
+
variant?: ToggleButtonVariant;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
'aria-label': string;
|
|
15
|
+
}
|
|
16
|
+
export declare function ToggleButton({ size, variant, selected, disabled, icon, onClick, onSelectedChange, className, 'aria-label': ariaLabel, }: ToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ToggleButton;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Visual hierarchy variant for the Vertical button.
|
|
4
|
+
* `ghost` is the default — matches the typical toolbar context.
|
|
5
|
+
*/
|
|
6
|
+
export type VerticalButtonVariant = 'primary' | 'secondary' | 'ghost';
|
|
7
|
+
/**
|
|
8
|
+
* Size of the Vertical button icon circle.
|
|
9
|
+
* - `'md'` — 32 × 32 px icon area (default)
|
|
10
|
+
* - `'sm'` — 24 × 24 px icon area
|
|
11
|
+
*/
|
|
12
|
+
export type VerticalButtonSize = 'sm' | 'md';
|
|
13
|
+
export interface VerticalButtonProps {
|
|
14
|
+
/**
|
|
15
|
+
* Visual hierarchy variant.
|
|
16
|
+
* @default 'ghost'
|
|
17
|
+
*/
|
|
18
|
+
variant?: VerticalButtonVariant;
|
|
19
|
+
/**
|
|
20
|
+
* Size of the icon circle.
|
|
21
|
+
* @default 'md'
|
|
22
|
+
*/
|
|
23
|
+
size?: VerticalButtonSize;
|
|
24
|
+
/**
|
|
25
|
+
* Prevents all interaction. Maps to the native `disabled` attribute.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Shows a spinner in the icon area and sets `aria-busy`. The icon is
|
|
31
|
+
* hidden while loading is active.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Renders a small notification badge dot on the top-right of the icon area.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
badge?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Controls visibility of the text label below the icon area.
|
|
42
|
+
* Set to `false` to render an icon-only button (supply `aria-label` instead).
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
showLabel?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Icon element rendered inside the icon circle (16 × 16 px).
|
|
48
|
+
*/
|
|
49
|
+
icon?: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Label text displayed below the icon area in micro typography (12 px).
|
|
52
|
+
*/
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Accessible label. Required when `showLabel` is `false` or when
|
|
56
|
+
* `children` is absent.
|
|
57
|
+
*/
|
|
58
|
+
'aria-label'?: string;
|
|
59
|
+
/** Click handler. Not called when `disabled` or `loading`. */
|
|
60
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
61
|
+
/** Additional CSS class names applied to the outer button element. */
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* **VerticalButton** — a stacked icon circle + label button.
|
|
66
|
+
*
|
|
67
|
+
* Implements the DS-Nagarro Vertical button specification (Figma node 107:87).
|
|
68
|
+
*
|
|
69
|
+
* The visual treatment (background fill, shadow, border-radius) applies only
|
|
70
|
+
* to the inner icon circle. The text label sits below it in micro typography
|
|
71
|
+
* with a 4 px gap. Hover and focus states change the circle's appearance only.
|
|
72
|
+
*
|
|
73
|
+
* Common uses: bottom navigation bars, toolbar action groups where a visible
|
|
74
|
+
* label reinforces the icon meaning.
|
|
75
|
+
*
|
|
76
|
+
* ### Usage
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <VerticalButton icon={<HomeIcon />} onClick={() => navigate('/')}>
|
|
79
|
+
* Home
|
|
80
|
+
* </VerticalButton>
|
|
81
|
+
*
|
|
82
|
+
* // Icon-only (no label):
|
|
83
|
+
* <VerticalButton icon={<HomeIcon />} showLabel={false} aria-label="Home" />
|
|
84
|
+
*
|
|
85
|
+
* // With notification badge:
|
|
86
|
+
* <VerticalButton icon={<InboxIcon />} badge>Inbox</VerticalButton>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function VerticalButton({ variant, size, disabled, loading, badge, showLabel, icon, children, 'aria-label': ariaLabel, onClick, className, }: VerticalButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export default VerticalButton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
2
|
+
export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
|
|
3
|
+
export { ToggleButton } from './ToggleButton';
|
|
4
|
+
export type { ToggleButtonProps, ToggleButtonVariant, ToggleButtonSize } from './ToggleButton';
|
|
5
|
+
export { VerticalButton } from './VerticalButton';
|
|
6
|
+
export type { VerticalButtonProps, VerticalButtonVariant, VerticalButtonSize } from './VerticalButton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ButtonGroupSize = 'md' | 'sm';
|
|
3
|
+
export interface ButtonGroupProps {
|
|
4
|
+
size?: ButtonGroupSize;
|
|
5
|
+
/**
|
|
6
|
+
* Adds standard spacing between adjacent buttons.
|
|
7
|
+
* When false, buttons are glued edge-to-edge.
|
|
8
|
+
* Mirrors the Figma variant `Space between=True`.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
spaceBetween?: boolean;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function ButtonGroup({ size, spaceBetween, children, className, 'aria-label': ariaLabel, }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ButtonGroupVerticalSize = 'md' | 'sm';
|
|
3
|
+
export interface ButtonGroupVerticalProps {
|
|
4
|
+
size?: ButtonGroupVerticalSize;
|
|
5
|
+
/**
|
|
6
|
+
* Adds standard spacing between vertically stacked buttons.
|
|
7
|
+
* When false, buttons are glued edge-to-edge.
|
|
8
|
+
* Mirrors the Figma variant `Space between=True`.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
spaceBetween?: boolean;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function ButtonGroupVertical({ size, spaceBetween, children, className, 'aria-label': ariaLabel, }: ButtonGroupVerticalProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default ButtonGroupVertical;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonSize } from '../../Button/Button';
|
|
3
|
+
export type SplitButtonSize = ButtonSize;
|
|
4
|
+
/** Visual hierarchy variant applied to both button segments. */
|
|
5
|
+
export type SplitButtonVariant = 'primary' | 'secondary';
|
|
6
|
+
export interface SplitButtonProps {
|
|
7
|
+
/** 'md' = 32 px (default). 'sm' = 24 px for dense layouts. */
|
|
8
|
+
size?: SplitButtonSize;
|
|
9
|
+
/** Visual hierarchy variant. Applied to both button segments. @default 'secondary' */
|
|
10
|
+
variant?: SplitButtonVariant;
|
|
11
|
+
/** Label text for the main action button. */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/** Optional leading icon for the main action button. */
|
|
14
|
+
leadingIcon?: React.ReactNode;
|
|
15
|
+
/** Disables both button segments. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Loading state on the main button; trigger is also disabled while loading. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Icon displayed in the trigger (dropdown) button.
|
|
21
|
+
* Defaults to a built-in ChevronDown if omitted.
|
|
22
|
+
*/
|
|
23
|
+
triggerIcon?: React.ReactNode;
|
|
24
|
+
/** Click handler for the main action button. */
|
|
25
|
+
onMainClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
/** Click handler for the trigger (dropdown) button. */
|
|
27
|
+
onDropdownClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
28
|
+
/**
|
|
29
|
+
* TODO(DSN-POPOVER): when SplitButton renders a menu directly, wire it through
|
|
30
|
+
* PopoverWrapper anchored positioning (below-first, flip fallback, viewport clamping).
|
|
31
|
+
*/
|
|
32
|
+
/** Accessible label for the trigger button. Defaults to "More options". */
|
|
33
|
+
dropdownAriaLabel?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function SplitButton({ size, variant, children, leadingIcon, disabled, loading, triggerIcon, onMainClick, onDropdownClick, dropdownAriaLabel, className, }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export default SplitButton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ButtonGroup } from './ButtonGroup';
|
|
2
|
+
export type { ButtonGroupProps, ButtonGroupSize } from './ButtonGroup';
|
|
3
|
+
export { ButtonGroupVertical } from './ButtonGroupVertical';
|
|
4
|
+
export type { ButtonGroupVerticalProps, ButtonGroupVerticalSize } from './ButtonGroupVertical';
|
|
5
|
+
export { SplitButton } from './SplitButton';
|
|
6
|
+
export type { SplitButtonProps, SplitButtonSize, SplitButtonVariant } from './SplitButton';
|