@epam/ai-dial-ui-kit 0.13.0-dev.9 → 0.14.0-dev.1
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 +45 -0
- package/dist/CHANGELOG.md +48 -1
- package/dist/{JsonEditor-CRSkEnWP.cjs → JsonEditor-pyqbLZZf.cjs} +1 -1
- package/dist/{JsonEditor-Djt1V27V.js → JsonEditor-v9m_npfK.js} +1 -1
- package/dist/MarkdownEditor-5UpxUtXf.js +75 -0
- package/dist/{MarkdownEditor-BbGX2uA9.cjs → MarkdownEditor-9aPIyyuu.cjs} +1 -1
- package/dist/MarkdownEditor-BjqdSHPU.cjs +1 -0
- package/dist/{MarkdownEditor-DtKScLM2.js → MarkdownEditor-CWZVSR--.js} +1 -1
- package/dist/components-manifest.json +3420 -391
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +201 -148
- package/dist/{index-JVDPW40K.js → index-DKDaSZqV.js} +24490 -21241
- package/dist/index-xlqMH2Q1.cjs +71 -0
- package/dist/index.css +6 -2
- package/dist/mcp-server.cjs +29 -9
- package/dist/migration-guides/0.13.0/caption-semi-text-lead-rename.md +82 -0
- package/dist/migration-guides/0.13.0/field-label-props-unification.md +94 -0
- package/dist/migration-guides/0.13.0/focus-border-token-rename.md +106 -0
- package/dist/migration-guides/0.13.0/progress-bar-2-0-rewrite.md +103 -0
- package/dist/migration-guides/0.13.0/spinner-dial-prefix-removal.md +69 -0
- package/dist/migration-guides/0.13.0/typography-heading-scale-shift.md +93 -0
- package/dist/migration-guides/README.md +6 -0
- package/dist/src/components/Accordion/Accordion.d.ts +1 -0
- package/dist/src/components/Analytics/Bar/Bar.d.ts +12 -7
- package/dist/src/components/Analytics/BarGroup/BarGroup.d.ts +23 -16
- package/dist/src/components/Analytics/Card/Card.d.ts +14 -3
- package/dist/src/components/Analytics/ErrorTag/ErrorTag.d.ts +1 -0
- package/dist/src/components/Analytics/Histogram/Histogram.d.ts +9 -6
- package/dist/src/components/Analytics/Histogram/utils.d.ts +10 -0
- package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +1 -0
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/src/components/Breadcrumb/BreadcrumbItem.d.ts +3 -0
- package/dist/src/components/Button/Button.d.ts +1 -0
- package/dist/src/components/Button/ButtonWrappers.d.ts +1 -15
- package/dist/src/components/ButtonDropdown/ButtonDropdown.d.ts +1 -0
- package/dist/src/components/CaptionText/CaptionText.d.ts +1 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/src/components/CloseButton/CloseButton.d.ts +1 -0
- package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +1 -0
- package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +1 -0
- package/dist/src/components/DraggableItem/DraggableItem.d.ts +1 -0
- package/dist/src/components/DropdownIcon/DropdownIcon.d.ts +1 -0
- package/dist/src/components/EllipsisTooltip/EllipsisTooltip.d.ts +1 -0
- package/dist/src/components/FabButton/FabButton.d.ts +8 -3
- package/dist/src/components/FileIcon/FileIcon.d.ts +1 -0
- package/dist/src/components/FileManager/FileManager.d.ts +3 -0
- package/dist/src/components/FileManager/FileManagerProvider.d.ts +1 -0
- package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +3 -0
- package/dist/src/components/FileManager/components/FoldersTree/FoldersTree.d.ts +3 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-context.d.ts +2 -0
- package/dist/src/components/FileManager/hooks/use-file-manager-tabs.d.ts +3 -0
- package/dist/src/components/FileName/FileName.d.ts +1 -0
- package/dist/src/components/FolderName/FolderName.d.ts +1 -0
- package/dist/src/components/FormItem/FormItem.d.ts +1 -0
- package/dist/src/components/FormPopup/FormPopup.d.ts +1 -0
- package/dist/src/components/Grid/Grid.d.ts +1 -0
- package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +1 -0
- package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +1 -0
- package/dist/src/components/Icon/Icon.d.ts +1 -0
- package/dist/src/components/IconButton/IconButton.d.ts +5 -0
- package/dist/src/components/IconButton/IconButtonWrappers.d.ts +1 -0
- package/dist/src/components/Input/Input.d.ts +1 -0
- package/dist/src/components/InputPopup/InputPopup.d.ts +1 -0
- package/dist/src/components/JsonEditor/JsonEditor.d.ts +1 -0
- package/dist/src/components/Label/Label.d.ts +1 -0
- package/dist/src/components/LabelledText/LabelledText.d.ts +1 -0
- package/dist/src/components/LoadFileArea/LoadFileArea.d.ts +1 -0
- package/dist/src/components/LoadFileArea/LoadFileAreaField.d.ts +1 -0
- package/dist/src/components/Loader/Loader.d.ts +1 -0
- package/dist/src/components/MarkdownEditor/MarkdownEditor.d.ts +1 -0
- package/dist/src/components/New/Accordion/Accordion.d.ts +71 -0
- package/dist/src/components/New/Button/Button.d.ts +66 -0
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +94 -0
- package/dist/src/components/New/Button/__tests__/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Button/constants.d.ts +2 -0
- package/dist/src/components/New/Button/utils.d.ts +2 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +24 -0
- package/dist/src/components/New/ButtonDropdown/constants.d.ts +1 -0
- package/dist/src/components/New/Calendar/Calendar.d.ts +55 -0
- package/dist/src/components/New/Calendar/constants.d.ts +17 -0
- package/dist/src/components/New/Calendar/utils.d.ts +25 -0
- package/dist/src/components/New/Calendar/utils.spec.d.ts +1 -0
- package/dist/src/components/New/CaptionText/CaptionText.d.ts +21 -0
- package/dist/src/components/New/CardShell/CardShell.d.ts +14 -0
- package/dist/src/components/New/CloseButton/CloseButton.d.ts +33 -0
- package/dist/src/components/New/ConfirmationPopup/ConfirmationPopup.d.ts +55 -0
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +14 -0
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +87 -0
- package/dist/src/components/New/Dropdown/DropdownSubMenuItem.d.ts +8 -0
- package/dist/src/components/New/Dropdown/constants.d.ts +9 -0
- package/dist/src/components/New/FileDropzone/FileDropzone.d.ts +81 -0
- package/dist/src/components/New/FolderPath/FolderPath.d.ts +32 -0
- package/dist/src/components/New/Highlight/Highlight.d.ts +19 -0
- package/dist/src/components/New/IconButton/IconButton.d.ts +48 -0
- package/dist/src/components/New/IconButton/IconButtonWrappers.d.ts +71 -0
- package/dist/src/components/New/InfoButton/InfoButton.d.ts +26 -0
- package/dist/src/components/New/InfoButton/InfoButton.stories.d.ts +6 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +51 -0
- package/dist/src/components/New/Input/Button/InputButton.d.ts +25 -0
- package/dist/src/components/New/Input/Button/constants.d.ts +1 -0
- package/dist/src/components/New/Input/Input.d.ts +67 -0
- package/dist/src/components/New/Input/utils.d.ts +2 -0
- package/dist/src/components/New/Label/Label.d.ts +33 -0
- package/dist/src/components/New/MarkdownEditor/MarkdownEditor.d.ts +33 -0
- package/dist/src/components/New/MarkdownEditor/constants.d.ts +20 -0
- package/dist/src/components/New/Notification/Notification.d.ts +7 -0
- package/dist/src/components/New/Notification/constants.d.ts +12 -1
- package/dist/src/components/New/NumberInput/NumberInput.d.ts +36 -0
- package/dist/src/components/New/PasswordInput/PasswordInput.d.ts +33 -0
- package/dist/src/components/New/Popup/Popup.d.ts +72 -0
- package/dist/src/components/New/Popup/constants.d.ts +10 -0
- package/dist/src/components/New/Search/Search.d.ts +42 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +17 -0
- package/dist/src/components/New/Select/Select.d.ts +110 -0
- package/dist/src/components/New/Select/SelectSubMenuItem.d.ts +8 -0
- package/dist/src/components/New/Select/constants.d.ts +32 -0
- package/dist/src/components/New/Switch/Switch.d.ts +38 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +63 -0
- package/dist/src/components/New/Tag/Tag.d.ts +45 -0
- package/dist/src/components/New/TagInput/TagInput.d.ts +72 -0
- package/dist/src/components/New/TagInput/utils.d.ts +21 -0
- package/dist/src/components/New/TagInput/utils.spec.d.ts +1 -0
- package/dist/src/components/New/Textarea/Textarea.d.ts +39 -0
- package/dist/src/components/New/constants/overlay.d.ts +24 -0
- package/dist/src/components/NoDataContent/NoDataContent.d.ts +1 -0
- package/dist/src/components/Notification/Notification.d.ts +1 -0
- package/dist/src/components/NumberInput/NumberInput.d.ts +1 -0
- package/dist/src/components/Pagination/Pagination.d.ts +3 -0
- package/dist/src/components/PasswordInput/PasswordInput.d.ts +1 -0
- package/dist/src/components/Popup/Popup.d.ts +2 -1
- package/dist/src/components/ProgressBar/ProgressBar.d.ts +51 -10
- package/dist/src/components/RadioButton/RadioButton.d.ts +1 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +1 -0
- package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +1 -0
- package/dist/src/components/RemoveButton/RemoveButton.d.ts +1 -0
- package/dist/src/components/ResizableContainer/ConditionalResizableContainer.d.ts +1 -0
- package/dist/src/components/ResizableContainer/ResizableContainer.d.ts +1 -0
- package/dist/src/components/SchemaRenderer/SchemaRenderer.d.ts +1 -0
- package/dist/src/components/SchemaRenderer/components/SchemaKeyValueEditor.d.ts +9 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +6 -1
- package/dist/src/components/SchemaRenderer/utils.d.ts +1 -0
- package/dist/src/components/Search/Search.d.ts +1 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +1 -0
- package/dist/src/components/Select/Select.d.ts +1 -0
- package/dist/src/components/SelectField/SelectField.d.ts +1 -0
- package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +1 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts +19 -18
- package/dist/src/components/Skeleton/utils.d.ts +2 -2
- package/dist/src/components/Slider/Slider.d.ts +1 -0
- package/dist/src/components/Spinner/Spinner.d.ts +5 -2
- package/dist/src/components/Steps/Steps.d.ts +1 -0
- package/dist/src/components/Switch/Switch.d.ts +1 -0
- package/dist/src/components/Tabs/Tabs.d.ts +1 -0
- package/dist/src/components/Tag/Tag.d.ts +1 -0
- package/dist/src/components/TagInput/TagInput.d.ts +1 -0
- package/dist/src/components/Textarea/Textarea.d.ts +1 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/src/components/Tooltip/TooltipContainer.d.ts +1 -0
- package/dist/src/components/Tooltip/TooltipContent.d.ts +1 -0
- package/dist/src/components/Tooltip/TooltipTrigger.d.ts +1 -0
- package/dist/src/index.d.ts +89 -13
- package/dist/src/mcp/types.d.ts +12 -0
- package/dist/src/models/dropdown.d.ts +27 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/calendar.d.ts +6 -0
- package/dist/src/types/skeleton.d.ts +3 -3
- package/dist/src/utils/__tests__/accessible-name.spec.d.ts +1 -0
- package/dist/src/utils/__tests__/file-accept.spec.d.ts +1 -0
- package/dist/src/utils/accessible-name.d.ts +19 -0
- package/dist/src/utils/file-accept.d.ts +16 -0
- package/dist/src/utils/sub-menu-floating.d.ts +15 -2
- package/package.json +4 -2
- package/dist/index-CmA_N28F.cjs +0 -71
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, DetailedHTMLProps, FC, ReactNode } from 'react';
|
|
2
|
+
import { ButtonAppearance, ButtonVariant } from '../../../types/button';
|
|
3
|
+
import { DialTooltipProps } from '../../Tooltip/Tooltip';
|
|
4
|
+
import { ElementSize } from '../../../types/size';
|
|
5
|
+
type TooltipProps = Omit<DialTooltipProps, 'children'>;
|
|
6
|
+
export interface IconButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ElementSize;
|
|
9
|
+
appearance?: ButtonAppearance;
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
tooltipProps?: TooltipProps;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A Icon Button component with flexible icon and text positioning
|
|
15
|
+
* aliases: IconicButton|SymbolButton
|
|
16
|
+
* Design system 2.0
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <DialIconButton
|
|
21
|
+
* onClick={handleClick}
|
|
22
|
+
* icon={<Icon />}
|
|
23
|
+
* className="custom-button"
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <IconButton
|
|
30
|
+
* aria-label="Custom Label"
|
|
31
|
+
* onClick={handleClick}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* inherits all properties from the `ButtonHTMLAttributes<HTMLButtonElement>`
|
|
36
|
+
*
|
|
37
|
+
* The button is icon-only, so it needs an accessible name: pass `aria-label`,
|
|
38
|
+
* or a string `tooltipProps.tooltip`, which is used as the label when no
|
|
39
|
+
* `aria-label` is given.
|
|
40
|
+
*
|
|
41
|
+
* @param [variant] - Defines the visual style of the button
|
|
42
|
+
* @param [appearance=ButtonAppearance.Solid] - Defines the type of the button
|
|
43
|
+
* @param [size=ElementSize.Standard] - Defines the size of the button
|
|
44
|
+
* @param [tooltip] - The content of the icon button tooltip
|
|
45
|
+
* @param icon - Icon display
|
|
46
|
+
*/
|
|
47
|
+
export declare const IconButton: FC<IconButtonProps>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IconButtonProps } from './IconButton';
|
|
3
|
+
type ButtonVariantProps = Omit<IconButtonProps, 'variant'>;
|
|
4
|
+
type ButtonAppearanceProps = Omit<IconButtonProps, 'appearance'>;
|
|
5
|
+
/**
|
|
6
|
+
* A Primary Icon Button component with predefined primary variant
|
|
7
|
+
* Design system 2.0
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <PrimaryIconButton
|
|
11
|
+
* icon={<Icon />}
|
|
12
|
+
* onClick={handleClick}
|
|
13
|
+
* className="custom-button"
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Inherits all properties from the `IconButtonProps`
|
|
18
|
+
*/
|
|
19
|
+
export declare const PrimaryIconButton: FC<ButtonVariantProps>;
|
|
20
|
+
/** A Neutral Icon Button component with predefined neutral variant
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <NeutralIconButton
|
|
24
|
+
* icon={<Icon />}
|
|
25
|
+
* onClick={handleClick}
|
|
26
|
+
* className="custom-button"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Inherits all properties from the `IconButtonProps`
|
|
31
|
+
*/
|
|
32
|
+
export declare const NeutralIconButton: FC<ButtonVariantProps>;
|
|
33
|
+
/** A Danger Icon Button component with predefined danger variant
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <DangerIconButton
|
|
37
|
+
* icon={<Icon />}
|
|
38
|
+
* onClick={handleClick}
|
|
39
|
+
* className="custom-button"
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Inherits all properties from the `IconButtonProps`
|
|
44
|
+
*/
|
|
45
|
+
export declare const DangerIconButton: FC<ButtonVariantProps>;
|
|
46
|
+
/** A Ghost Icon Button component with predefined ghost appearance
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <GhostIconButton
|
|
50
|
+
* icon={<Icon />}
|
|
51
|
+
* onClick={handleClick}
|
|
52
|
+
* className="custom-button"
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* Inherits all properties from the `IconButtonProps`
|
|
57
|
+
*/
|
|
58
|
+
export declare const GhostIconButton: FC<ButtonAppearanceProps>;
|
|
59
|
+
/** A Outlined Icon Button component with predefined outlined appearance
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <StaticIconButton
|
|
63
|
+
* icon={<Icon />}
|
|
64
|
+
* onClick={handleClick}
|
|
65
|
+
* className="custom-button"
|
|
66
|
+
* />
|
|
67
|
+
* ```
|
|
68
|
+
* Inherits all properties from the `IconButtonProps`
|
|
69
|
+
*/
|
|
70
|
+
export declare const StaticIconButton: FC<ButtonAppearanceProps>;
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface InfoButtonProps {
|
|
3
|
+
caption?: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* An Info button component with a customizable icon and accessible label.
|
|
9
|
+
* Design system 2.0
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <InfoButton
|
|
14
|
+
* caption="Info"
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The button is icon-only, so it needs an accessible name. `caption` is used as
|
|
19
|
+
* the name because a tooltip alone never reaches assistive tech — pass a short
|
|
20
|
+
* `aria-label` when the caption is a long sentence.
|
|
21
|
+
*
|
|
22
|
+
* @param [caption] - Text shown in the tooltip, and the fallback accessible name
|
|
23
|
+
* @param [onClick] - Click handler for the info button
|
|
24
|
+
* @param [aria-label] - Accessible name; takes precedence over `caption`
|
|
25
|
+
*/
|
|
26
|
+
export declare const InfoButton: FC<InfoButtonProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/react';
|
|
2
|
+
import { ButtonHTMLAttributes, FC } from 'react';
|
|
3
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
4
|
+
import { ElementSize } from '../../../types/size';
|
|
5
|
+
export interface InlineSelectTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/** Currently selected option's label, shown before the chevron. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Size of the trigger button. */
|
|
9
|
+
size?: ElementSize;
|
|
10
|
+
/** Whether the inline select is open or not. */
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const InlineSelectTrigger: FC<InlineSelectTriggerProps>;
|
|
14
|
+
export interface InlineSelectProps {
|
|
15
|
+
/** Options rendered in the dropdown; each item's `label` is shown on the trigger when selected. */
|
|
16
|
+
items: DropdownItem[];
|
|
17
|
+
/** Controlled key of the selected item. */
|
|
18
|
+
selectedKey?: string;
|
|
19
|
+
/** Initial selected key in uncontrolled mode. Defaults to the first item's key. */
|
|
20
|
+
defaultSelectedKey?: string;
|
|
21
|
+
/** Fired when an item is selected. */
|
|
22
|
+
onSelect?: (item: DropdownItem) => void;
|
|
23
|
+
/** Size of the trigger button. */
|
|
24
|
+
size?: ElementSize;
|
|
25
|
+
/** Disables the trigger and prevents opening the dropdown. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Floating UI placement for the dropdown overlay. */
|
|
28
|
+
placement?: Placement;
|
|
29
|
+
/** Whether the dropdown overlay should match the trigger's width. */
|
|
30
|
+
matchReferenceWidth?: boolean;
|
|
31
|
+
/** Additional CSS classes applied to the dropdown overlay. */
|
|
32
|
+
listClassName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Accessible name for the trigger. Without it the control announces only its
|
|
35
|
+
* current value ("Option A"), never what is being selected.
|
|
36
|
+
*/
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An inline select control combining `InlineSelectTrigger` with `Dropdown`.
|
|
41
|
+
* Design system 2.0
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <InlineSelect
|
|
46
|
+
* items={[{ key: 'a', label: 'Option A' }, { key: 'b', label: 'Option B' }]}
|
|
47
|
+
* onSelect={(item) => console.log(item.key)}
|
|
48
|
+
* />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const InlineSelect: FC<InlineSelectProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ElementSize } from '../../../../types/size';
|
|
3
|
+
export interface InputButtonProps {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
size?: ElementSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* An Input button component with a customizable icon and accessible label.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <InputButton
|
|
16
|
+
* icon={<IconInfoCircle size={16} />}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param [icon] - Icon to display inside the input button
|
|
21
|
+
* @param [onClick] - Click handler for the info button
|
|
22
|
+
* @param [disabled] - Whether the button is disabled
|
|
23
|
+
* @param [size] - Size of the input button, which adjusts the icon size and padding. Uses the {@link ElementSize} enum.
|
|
24
|
+
*/
|
|
25
|
+
export declare const InputButton: FC<InputButtonProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const inputButtonClassName = "bg-control-neutral-active flex items-center justify-center enabled:text-secondary enabled:hover:text-control-blue-hover enabled:active:bg-control-accent-alpha-active enabled:hover:bg-control-accent-alpha-hover enabled:active:text-control-blue-active";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FC, InputHTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ElementSize } from '../../../types/size';
|
|
3
|
+
import { LabelProps } from '../Label/Label';
|
|
4
|
+
import { InputButtonProps } from './Button/InputButton';
|
|
5
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
|
|
6
|
+
labelProps?: LabelProps;
|
|
7
|
+
inputButtonProps?: InputButtonProps;
|
|
8
|
+
size?: ElementSize;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
caption?: string;
|
|
12
|
+
tooltipText?: string;
|
|
13
|
+
iconBefore?: ReactNode;
|
|
14
|
+
iconAfter?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Content rendered inside the field, between `iconBefore` and the input, for
|
|
17
|
+
* values a plain `<input>` cannot hold — the tags of a multi-select, a value
|
|
18
|
+
* with its own markup. When the slot stands in for the value, give the input
|
|
19
|
+
* itself a zero width through `className` so it keeps taking focus without
|
|
20
|
+
* competing for space.
|
|
21
|
+
*/
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
prefix?: string;
|
|
24
|
+
postfix?: string;
|
|
25
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
26
|
+
/**
|
|
27
|
+
* Ref to the field wrapper — the bordered box holding the icons, the content
|
|
28
|
+
* slot and the input. Use it to measure the space `children` has to fit into;
|
|
29
|
+
* the input itself only ever reports its own share of the row.
|
|
30
|
+
*/
|
|
31
|
+
wrapperRef?: Ref<HTMLDivElement>;
|
|
32
|
+
onChange?: (value?: string) => void;
|
|
33
|
+
containerClassName?: string;
|
|
34
|
+
wrapperClassName?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A flexible input component with icon support and various styling options
|
|
38
|
+
* aliases: TextField|FormInput
|
|
39
|
+
* Design system 2.0
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Input
|
|
44
|
+
* id="search"
|
|
45
|
+
* placeholder="Search..."
|
|
46
|
+
* iconBefore={<SearchIcon />}
|
|
47
|
+
* iconAfter={<ClearIcon />}
|
|
48
|
+
* onChange={(value) => console.log(value)}
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @param [size=ElementSize.Standard] - The size of the input, which can be 'small', 'standard', or 'large'.
|
|
53
|
+
* @param [invalid] - Whether the input has validation errors (applies error styling)
|
|
54
|
+
* @param [iconAfter] - Icon or element to display after the input
|
|
55
|
+
* @param [iconBefore] - Icon or element to display before the input
|
|
56
|
+
* @param [children] - Content rendered inside the field before the input, for values a plain `<input>` cannot hold (e.g. multi-select tags)
|
|
57
|
+
* @param [textBeforeInput] - Text to display before the input
|
|
58
|
+
* @param [suffix] - Text to display inside the input on the right
|
|
59
|
+
* @param [containerClassName] - Additional CSS classes to apply to the container div
|
|
60
|
+
* @param [wrapperClassName] - Additional CSS classes to apply to the input wrapper div
|
|
61
|
+
* @param [className] - Additional CSS classes to apply to the input element
|
|
62
|
+
* @param [inputRef] - Ref to access the underlying input element
|
|
63
|
+
* @param [error] - Error message to display below the input (also adds error styling)
|
|
64
|
+
* @param [caption] - Helper text to display below the input
|
|
65
|
+
* @param [onChange] - Callback function called when the input value changes
|
|
66
|
+
*/
|
|
67
|
+
export declare const Input: FC<InputProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC, LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ElementSize } from '../../../types/size';
|
|
3
|
+
type NativeLabelProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, 'children' | 'defaultValue' | 'onChange'>;
|
|
4
|
+
export interface LabelProps extends NativeLabelProps {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
caption?: string;
|
|
8
|
+
size?: ElementSize;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A label component
|
|
12
|
+
* aliases: FormLabel|RequiredIndicator
|
|
13
|
+
* Design system 2.0
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Basic label
|
|
18
|
+
* <Label htmlFor="email-input" label="Email Address" />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Pass `htmlFor` with the id of the control this labels — without it the label
|
|
22
|
+
* names nothing. The `caption` info button renders as a sibling of the `<label>`
|
|
23
|
+
* rather than inside it: a button nested in a label forwards its clicks to the
|
|
24
|
+
* labelled control and leaks its own text into that control's accessible name.
|
|
25
|
+
*
|
|
26
|
+
* @param [label] - The label text to display for the label
|
|
27
|
+
* @param [required=false] - Whether the field is required. Renders a visual `*`
|
|
28
|
+
* plus visually hidden text so the requirement is announced too.
|
|
29
|
+
* @param [caption] - Explanatory text, exposed through an info button next to the label
|
|
30
|
+
* @param [size] - The size of the label, which can be 'small', 'medium', or 'large'.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Label: FC<LabelProps>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PreviewType } from '@uiw/react-md-editor';
|
|
3
|
+
import { EditorThemes } from '../../../types/editor';
|
|
4
|
+
export interface MarkdownEditorProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
height?: number;
|
|
8
|
+
theme?: EditorThemes;
|
|
9
|
+
className?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/** Initial edit/live/preview mode; the toolbar lets the user switch it afterwards. */
|
|
12
|
+
defaultPreview?: PreviewType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The 2.0 Markdown editor: a formatting toolbar (bold/italic/strikethrough,
|
|
16
|
+
* Design system 2.0
|
|
17
|
+
* text style, lists, quote/link/code, table) plus an edit/live/preview mode
|
|
18
|
+
* switcher and fullscreen, built on top of `@uiw/react-md-editor`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <MarkdownEditor value={value} onChange={setValue} height={400} />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param [value] - The current markdown content
|
|
26
|
+
* @param [onChange] - Callback fired when the editor content changes
|
|
27
|
+
* @param [height=300] - Height of the editor in pixels
|
|
28
|
+
* @param [theme='light'] - Theme for the editor ('light' or 'dark')
|
|
29
|
+
* @param [className] - Additional CSS classes for the container
|
|
30
|
+
* @param [placeholder] - Placeholder text shown when the editor is empty
|
|
31
|
+
* @param [defaultPreview='edit'] - Initial edit/live/preview mode
|
|
32
|
+
*/
|
|
33
|
+
export declare const MarkdownEditor: FC<MarkdownEditorProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ICommand } from '@uiw/react-md-editor';
|
|
2
|
+
import { DIAL_ICON_SIZE } from '../../../constants/icon';
|
|
3
|
+
/** 16px inside the 24px round toolbar buttons, matching the other 2.0
|
|
4
|
+
* components that pair `ElementSize.Small` controls with `DIAL_ICON_SIZE.SM`.
|
|
5
|
+
* Keep this in sync with the `svg { size-[16px] }` rule in
|
|
6
|
+
* `src/styles/markdown-editor.scss`, which wins over these width/height
|
|
7
|
+
* attributes. */
|
|
8
|
+
export declare const MARKDOWN_TOOLBAR_ICON_SIZE = DIAL_ICON_SIZE.SM;
|
|
9
|
+
/**
|
|
10
|
+
* Left-hand formatting toolbar, built on top of `@uiw/react-md-editor`'s
|
|
11
|
+
* built-in commands (which insert/toggle markdown syntax in the underlying
|
|
12
|
+
* textarea) with icons and grouping matching the design.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getMarkdownFormattingCommands: () => ICommand[];
|
|
15
|
+
/**
|
|
16
|
+
* Right-hand toolbar: the built-in edit/live/preview mode switcher, each
|
|
17
|
+
* with a distinct icon so the three states stay distinguishable even before
|
|
18
|
+
* the active one is highlighted, followed by fullscreen.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getMarkdownExtraCommands: () => ICommand[];
|
|
@@ -14,10 +14,17 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
14
14
|
/**
|
|
15
15
|
* A contextual feedback component for displaying important messages.
|
|
16
16
|
* aliases: Notification
|
|
17
|
+
* Design system 2.0
|
|
17
18
|
*
|
|
18
19
|
* Renders a colored container with an icon, message text, and an optional
|
|
19
20
|
* close button.
|
|
20
21
|
*
|
|
22
|
+
* The container is a live region whose politeness follows the variant: `error`
|
|
23
|
+
* and `warning` use `role="alert"` (assertive, interrupts the screen reader),
|
|
24
|
+
* every other variant uses `role="status"` (polite, queues). Pass an explicit
|
|
25
|
+
* `role` to override — including for a notification that is static page content
|
|
26
|
+
* rather than an update.
|
|
27
|
+
*
|
|
21
28
|
* @example
|
|
22
29
|
* ```tsx
|
|
23
30
|
* <Notification
|
|
@@ -5,4 +5,15 @@ export declare const variantIcons: (props: {
|
|
|
5
5
|
stroke: number;
|
|
6
6
|
}) => Record<NotificationVariant, ReactNode>;
|
|
7
7
|
export declare const notificationVariantClassNameMap: Record<NotificationVariant, string>;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Live-region role per variant.
|
|
10
|
+
*
|
|
11
|
+
* `role="alert"` is implicitly `aria-live="assertive"`: it interrupts whatever a
|
|
12
|
+
* screen reader is currently saying. That is right for a problem the user must
|
|
13
|
+
* deal with, and wrong for routine feedback — an assertive info or success
|
|
14
|
+
* message cuts the user off mid-sentence, and a section message rendered with
|
|
15
|
+
* the page announces itself on mount even though nothing changed.
|
|
16
|
+
* `role="status"` is polite and queues instead.
|
|
17
|
+
*/
|
|
18
|
+
export declare const notificationVariantRoleMap: Record<NotificationVariant, 'alert' | 'status'>;
|
|
19
|
+
export declare const alertBaseClassName = "items-center justify-between rounded-xl relative gap-3 p-3 border flex border-transparent";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputProps } from '../Input/Input';
|
|
3
|
+
export interface NumberInputProps extends Omit<InputProps, 'onChange' | 'type'> {
|
|
4
|
+
/** When true, restricts input to integer values only — blocks decimal points, minus, plus, and scientific notation (e/E) */
|
|
5
|
+
integer?: boolean;
|
|
6
|
+
onChange?: (value?: number | string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A number field, built on {@link Input}.
|
|
10
|
+
* aliases: NumericField|NumberField
|
|
11
|
+
* Design system 2.0
|
|
12
|
+
*
|
|
13
|
+
* `type` is owned by this component; every other {@link Input} prop is passed
|
|
14
|
+
* through, so it shares the 2.0 field styling, sizes, label, caption and error
|
|
15
|
+
* states.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <NumberInput
|
|
20
|
+
* id="age"
|
|
21
|
+
* placeholder="Enter your age"
|
|
22
|
+
* value={25}
|
|
23
|
+
* onChange={(value) => setAge(value)}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param [integer] - When true, restricts input to integer values only — blocks decimal points, minus, plus, and scientific notation (e/E)
|
|
28
|
+
* @param [min] - Minimum allowed value
|
|
29
|
+
* @param [max] - Maximum allowed value
|
|
30
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px
|
|
31
|
+
* @param [onKeyDown] - Called after the numeric key guard has run, unless the key was blocked
|
|
32
|
+
* @param [onPaste] - Called after pasted text has been sanitized in `integer` mode
|
|
33
|
+
* @param onChange - Callback function called when the input value changes.
|
|
34
|
+
* Returns either a number (for most values) or a string (for decimal values < 1 with leading zeros)
|
|
35
|
+
*/
|
|
36
|
+
export declare const NumberInput: FC<NumberInputProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputProps } from '../Input/Input';
|
|
3
|
+
export interface PasswordInputProps extends Omit<InputProps, 'type' | 'iconAfter'> {
|
|
4
|
+
/** Accessible name of the reveal toggle while the value is masked. */
|
|
5
|
+
showPasswordLabel?: string;
|
|
6
|
+
/** Accessible name of the reveal toggle while the value is visible. */
|
|
7
|
+
hidePasswordLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A password field with a reveal toggle, built on {@link Input}.
|
|
11
|
+
* aliases: SecureInput|ToggleablePassword
|
|
12
|
+
* Design system 2.0
|
|
13
|
+
*
|
|
14
|
+
* The toggle is a real `<button>`, so it is reachable by keyboard and announces
|
|
15
|
+
* both its purpose and its state. `type` and `iconAfter` are owned by this
|
|
16
|
+
* component; every other {@link Input} prop is passed through.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <PasswordInput
|
|
21
|
+
* id="password"
|
|
22
|
+
* labelProps={{ label: 'Password', required: true }}
|
|
23
|
+
* value={password}
|
|
24
|
+
* onChange={setPassword}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @param [showPasswordLabel="Show password"] - Accessible name of the toggle while the value is masked
|
|
29
|
+
* @param [hidePasswordLabel="Hide password"] - Accessible name of the toggle while the value is visible
|
|
30
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px
|
|
31
|
+
* @param [disabled=false] - Disables the field and its reveal toggle
|
|
32
|
+
*/
|
|
33
|
+
export declare const PasswordInput: FC<PasswordInputProps>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { FC, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { PopupSize } from '../../../types/popup';
|
|
3
|
+
export interface PopupProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
header?: ReactNode;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
portalId?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
overlayClassName?: string;
|
|
10
|
+
titleClassName?: string;
|
|
11
|
+
headerClassName?: string;
|
|
12
|
+
/** Additional CSS classes applied to the scrollable body wrapper around `children`. */
|
|
13
|
+
bodyClassName?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
footer?: ReactNode;
|
|
16
|
+
onClose?: (e?: MouseEvent<HTMLButtonElement> | null) => void;
|
|
17
|
+
size?: PopupSize;
|
|
18
|
+
hideClose?: boolean;
|
|
19
|
+
closeAriaLabel?: string;
|
|
20
|
+
closeOnOutsideClick?: boolean;
|
|
21
|
+
preventKeyboardOnOpen?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* An accessible modal dialog using Floating UI.
|
|
25
|
+
* aliases: Modal|Dialog
|
|
26
|
+
* Design system 2.0
|
|
27
|
+
*
|
|
28
|
+
* Renders in a portal with a scrim overlay, focus management, a header with the
|
|
29
|
+
* title and close control, a scrollable body and an optional footer. Sections
|
|
30
|
+
* are separated by spacing rather than rules; add your own through
|
|
31
|
+
* `headerClassName` or the footer node if a surface needs them.
|
|
32
|
+
*
|
|
33
|
+
* A string `header` names the dialog automatically. A `header` node cannot —
|
|
34
|
+
* pass `ariaLabel` in that case, or the dialog opens unnamed.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Popup
|
|
39
|
+
* open
|
|
40
|
+
* header="Title"
|
|
41
|
+
* size={PopupSize.Md}
|
|
42
|
+
* footer={
|
|
43
|
+
* <div className="flex justify-end gap-2 px-6 py-4">
|
|
44
|
+
* <NeutralButton label="Cancel" />
|
|
45
|
+
* <PrimaryButton label="Confirm" />
|
|
46
|
+
* </div>
|
|
47
|
+
* }
|
|
48
|
+
* onClose={() => setOpen(false)}
|
|
49
|
+
* >
|
|
50
|
+
* <div className="px-6 py-4">Dialog content goes here…</div>
|
|
51
|
+
* </Popup>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @param [open=false] - Controls visibility of the popup
|
|
55
|
+
* @param [header] - Optional title rendered in the header
|
|
56
|
+
* @param [ariaLabel] - Accessible name for the dialog; needed when `header` is not a string
|
|
57
|
+
* @param [portalId] - Optional portal container id
|
|
58
|
+
* @param [className] - Additional CSS classes applied to the popup container
|
|
59
|
+
* @param [overlayClassName] - Additional CSS classes applied to the overlay
|
|
60
|
+
* @param [titleClassName] - Additional CSS classes applied to the title element
|
|
61
|
+
* @param [headerClassName] - Additional CSS classes applied to the popup header container
|
|
62
|
+
* @param [bodyClassName] - Additional CSS classes applied to the scrollable body wrapper around `children`
|
|
63
|
+
* @param [children] - Body content
|
|
64
|
+
* @param [footer] - Footer area for actions
|
|
65
|
+
* @param [onClose] - Callback fired when the popup requests to close
|
|
66
|
+
* @param [size=PopupSize.Md] - Sets the max-width of the popup
|
|
67
|
+
* @param [hideClose=false] - Whether the close button is hidden in the header
|
|
68
|
+
* @param [closeAriaLabel="Close dialog"] - Accessible name of the close button
|
|
69
|
+
* @param [closeOnOutsideClick=true] - Whether the popup closes when clicking outside
|
|
70
|
+
* @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile. Redundant since the default focuses the dialog container, which never raises the keyboard; kept for compatibility
|
|
71
|
+
*/
|
|
72
|
+
export declare const Popup: FC<PopupProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PopupSize } from '../../../types/popup';
|
|
2
|
+
export declare const popupOverlayBaseClassName = "z-[52] flex items-center justify-center bg-backdrop md:p-4 gap-5 p-6";
|
|
3
|
+
export declare const popupBaseClassName = "relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto";
|
|
4
|
+
export declare const popupHeaderClassName = "flex flex-row items-center justify-between px-6 py-4";
|
|
5
|
+
export declare const popupTitleClassName = "flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary";
|
|
6
|
+
/**
|
|
7
|
+
* Max widths per size. Full width below the `md` breakpoint, where the popup
|
|
8
|
+
* fills the screen.
|
|
9
|
+
*/
|
|
10
|
+
export declare const popupSizeClassMap: Record<PopupSize, string>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputProps } from '../Input/Input';
|
|
3
|
+
export interface SearchProps extends Omit<InputProps, 'type' | 'iconBefore' | 'iconAfter' | 'inputButtonProps' | 'prefix' | 'postfix' | 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Drops the field's border and background so the input sits flush in a
|
|
6
|
+
* toolbar or panel header. The border is kept transparent rather than removed,
|
|
7
|
+
* so toggling this never shifts the layout by a pixel.
|
|
8
|
+
*/
|
|
9
|
+
withoutBorder?: boolean;
|
|
10
|
+
/** Accessible name of the clear button. */
|
|
11
|
+
clearLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A search field with a leading magnifier and a clear button, built on {@link Input}.
|
|
15
|
+
* aliases: SearchField|QueryInput|SearchBox
|
|
16
|
+
* Design system 2.0
|
|
17
|
+
*
|
|
18
|
+
* Fully controlled: it renders exactly the `value` it is given and reports every
|
|
19
|
+
* edit through `onChange`, which receives `undefined` for an empty field. The
|
|
20
|
+
* clear button appears only while there is something to clear, and returns focus
|
|
21
|
+
* to the input once pressed so keyboard users are not dropped to the page body.
|
|
22
|
+
*
|
|
23
|
+
* `type` and both icon slots are owned by this component; every other
|
|
24
|
+
* {@link Input} prop is passed through.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Search
|
|
29
|
+
* id="search"
|
|
30
|
+
* value={query}
|
|
31
|
+
* placeholder="Search"
|
|
32
|
+
* onChange={setQuery}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px
|
|
37
|
+
* @param [placeholder="Search..."] - Placeholder shown while the field is empty
|
|
38
|
+
* @param [withoutBorder=false] - Renders the field without its border and background
|
|
39
|
+
* @param [clearLabel="Clear search"] - Accessible name of the clear button
|
|
40
|
+
* @param [disabled=false] - Disables the field and hides the clear button
|
|
41
|
+
*/
|
|
42
|
+
export declare const Search: FC<SearchProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, MouseEvent } from 'react';
|
|
2
|
+
import { SelectOption } from '../../../models/select';
|
|
3
|
+
export interface MultiSelectTagsProps {
|
|
4
|
+
options: SelectOption[];
|
|
5
|
+
selectedValues: string[];
|
|
6
|
+
handleRemoveTag?: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The selected values of a multi-select, rendered as removable tags inside the
|
|
10
|
+
* Design system 2.0
|
|
11
|
+
* field.
|
|
12
|
+
*
|
|
13
|
+
* @param options - All available options, used to resolve labels and icons
|
|
14
|
+
* @param selectedValues - Values currently selected
|
|
15
|
+
* @param [handleRemoveTag] - Called with the value whose tag was removed; when omitted the tags are not removable
|
|
16
|
+
*/
|
|
17
|
+
export declare const MultiSelectTags: FC<MultiSelectTagsProps>;
|