@epam/ai-dial-ui-kit 0.13.0-dev.40 → 0.13.0-dev.43
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 +3 -0
- package/dist/CHANGELOG.md +8 -0
- package/dist/{JsonEditor-BEJaiIby.js → JsonEditor-4-qZCNDm.js} +1 -1
- package/dist/{JsonEditor-Buuy0b39.cjs → JsonEditor-xygieb6H.cjs} +1 -1
- package/dist/{MarkdownEditor-CyL_NTT9.cjs → MarkdownEditor-C-hCTUCX.cjs} +1 -1
- package/dist/MarkdownEditor-CLQJUjhx.js +75 -0
- package/dist/MarkdownEditor-Ckw8Z46X.cjs +1 -0
- package/dist/{MarkdownEditor-DID4gX3X.js → MarkdownEditor-DQj20dnS.js} +1 -1
- package/dist/components-manifest.json +2602 -407
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +187 -178
- package/dist/{index-B9VwNsnG.cjs → index-Bo9jrbul.cjs} +31 -31
- package/dist/{index-orz_ei2U.js → index-Cs-3n-3R.js} +20588 -19454
- package/dist/index.css +2 -2
- package/dist/mcp-server.cjs +29 -9
- package/dist/src/components/New/CloseButton/CloseButton.d.ts +32 -0
- package/dist/src/components/New/ConfirmationPopup/ConfirmationPopup.d.ts +54 -0
- package/dist/src/components/New/ConfirmationPopup/constants.d.ts +14 -0
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +86 -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/InfoButton/InfoButton.stories.d.ts +0 -5
- package/dist/src/components/New/Input/Input.d.ts +9 -0
- package/dist/src/components/New/MarkdownEditor/MarkdownEditor.d.ts +32 -0
- package/dist/src/components/New/MarkdownEditor/constants.d.ts +15 -0
- package/dist/src/components/New/NumberInput/NumberInput.d.ts +35 -0
- package/dist/src/components/New/PasswordInput/PasswordInput.d.ts +32 -0
- package/dist/src/components/New/Popup/Popup.d.ts +68 -0
- package/dist/src/components/New/Popup/constants.d.ts +10 -0
- package/dist/src/components/New/Select/MultiSelectTags.d.ts +16 -0
- package/dist/src/components/New/Select/Select.d.ts +109 -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/constants/overlay.d.ts +24 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts +18 -18
- package/dist/src/components/Skeleton/utils.d.ts +2 -2
- package/dist/src/index.d.ts +20 -2
- package/dist/src/mcp/types.d.ts +12 -0
- package/dist/src/types/skeleton.d.ts +3 -3
- package/dist/src/utils/sub-menu-floating.d.ts +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/react';
|
|
2
|
+
import { FC, MouseEvent, ReactNode, RefObject } from 'react';
|
|
3
|
+
import { DropdownTrigger } from '../../../types/dropdown';
|
|
4
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
5
|
+
export interface DropdownProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
items?: DropdownItem[];
|
|
8
|
+
onItemClick?: (info: {
|
|
9
|
+
key: string;
|
|
10
|
+
domEvent: MouseEvent;
|
|
11
|
+
}) => void;
|
|
12
|
+
menuHeader?: ReactNode | (() => ReactNode);
|
|
13
|
+
menuFooter?: ReactNode | (() => ReactNode);
|
|
14
|
+
renderOverlay?: () => ReactNode;
|
|
15
|
+
trigger?: DropdownTrigger[];
|
|
16
|
+
placement?: Placement;
|
|
17
|
+
allowedPlacements?: Placement[];
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
defaultOpen?: boolean;
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
closable?: boolean;
|
|
23
|
+
onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
overlayContentClassName?: string;
|
|
26
|
+
separatorClassName?: string;
|
|
27
|
+
listClassName?: string;
|
|
28
|
+
outsidePressIgnoreRef?: RefObject<HTMLElement | null>;
|
|
29
|
+
outsideClosable?: boolean;
|
|
30
|
+
anchorToMouse?: boolean;
|
|
31
|
+
matchReferenceWidth?: boolean;
|
|
32
|
+
maxDropdownHeight?: number | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* Renders the given trigger (`children`) and a floating contextual menu overlay.
|
|
37
|
+
* aliases: ContextMenu|PopupMenu
|
|
38
|
+
*
|
|
39
|
+
* Supports click/hover/contextMenu triggers, controlled/uncontrolled open, and an optional
|
|
40
|
+
* close button inside the overlay. Placement is taken directly from Floating UI; when
|
|
41
|
+
* `placement` is **undefined** (default), automatic placement is handled by `autoPlacement`.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Simple items menu
|
|
46
|
+
* <Dropdown items={[{ key: 'profile', label: 'Profile' }, { key: 'logout', label: 'Logout' }]}>
|
|
47
|
+
* <button type="button" className="px-3 py-2 rounded border">Open</button>
|
|
48
|
+
* </Dropdown>
|
|
49
|
+
*
|
|
50
|
+
* // Hover trigger
|
|
51
|
+
* <Dropdown trigger={[DropdownTrigger.Hover]} placement="bottom-end" items={items}>
|
|
52
|
+
* <button type="button" className="px-3 py-2 rounded border">Hover me</button>
|
|
53
|
+
* </Dropdown>
|
|
54
|
+
*
|
|
55
|
+
* // Custom overlay content
|
|
56
|
+
* <Dropdown closable renderOverlay={() => <div className="p-3">Custom content</div>}>
|
|
57
|
+
* <button type="button" className="px-3 py-2 rounded border">Custom</button>
|
|
58
|
+
* </Dropdown>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param children - Trigger element(s) to anchor and open the menu
|
|
62
|
+
* @param [items] - Menu items to render
|
|
63
|
+
* @param [onItemClick] - Global handler fired when any item is clicked
|
|
64
|
+
* @param [menuHeader] - Content rendered above the items list
|
|
65
|
+
* @param [menuFooter] - Content rendered below the items list
|
|
66
|
+
* @param [renderOverlay] - Render function for fully custom overlay content (ignored when `items` is provided)
|
|
67
|
+
* @param [trigger=[DropdownTrigger.Click]] - Interactions that open the menu
|
|
68
|
+
* @param [placement] - Floating UI placement string; when omitted, auto placement is used
|
|
69
|
+
* @param [allowedPlacements] - Restricts the allowed placements
|
|
70
|
+
* @param [disabled=false] - Disables interaction and prevents opening
|
|
71
|
+
* @param [open] - Controlled open state (when provided, `defaultOpen` is ignored)
|
|
72
|
+
* @param [defaultOpen=false] - Initial open state in uncontrolled mode
|
|
73
|
+
* @param [onOpenChange] - Fired whenever the open state changes
|
|
74
|
+
* @param [closable=false] - Whether the overlay shows an internal close button
|
|
75
|
+
* @param [onClose] - Fired when the close button inside the overlay is clicked
|
|
76
|
+
* @param [className] - Additional CSS classes applied to the trigger wrapper
|
|
77
|
+
* @param [overlayContentClassName] - Additional CSS classes applied to the overlay content
|
|
78
|
+
* @param [separatorClassName] - Additional CSS classes applied to the separators between items
|
|
79
|
+
* @param [listClassName] - Additional CSS classes applied to the floating overlay
|
|
80
|
+
* @param [outsidePressIgnoreRef] - Ref to an element that should not trigger outside press behavior
|
|
81
|
+
* @param [outsideClosable=true] - Whether clicks outside the overlay should close it
|
|
82
|
+
* @param [anchorToMouse=false] - Whether to anchor the dropdown to the mouse position
|
|
83
|
+
* @param [matchReferenceWidth=true] - Whether to match the reference element's width
|
|
84
|
+
* @param [maxDropdownHeight] - Maximum height of the dropdown menu; when omitted, no limit is applied
|
|
85
|
+
*/
|
|
86
|
+
export declare const Dropdown: FC<DropdownProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DropdownItem } from '../../../models/dropdown';
|
|
3
|
+
export interface DropdownSubMenuItemProps {
|
|
4
|
+
item: DropdownItem;
|
|
5
|
+
/** Close the root dropdown when a leaf child is selected. */
|
|
6
|
+
onRootClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DropdownSubMenuItem: FC<DropdownSubMenuItemProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const dropdownBaseClassName: string;
|
|
2
|
+
export declare const dropdownListBaseClassName: string;
|
|
3
|
+
export declare const dropdownSubMenuClassName: string;
|
|
4
|
+
export declare const dropdownItemBaseClassName: string;
|
|
5
|
+
export declare const dropdownItemDisabledClassName: string;
|
|
6
|
+
export declare const dropdownItemDangerClassName = "text-error";
|
|
7
|
+
export declare const dropdownDividerClassName = "my-1 border-t border-secondary";
|
|
8
|
+
export declare const dropdownGap = 4;
|
|
9
|
+
export declare const submenuCaretIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,8 +4,3 @@ declare const meta: Meta<typeof InfoButton>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
-
/**
|
|
8
|
-
* A long caption still works as a tooltip, but a short `aria-label` keeps the
|
|
9
|
-
* announced name scannable.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ExplicitAccessibleName: Story;
|
|
@@ -12,6 +12,14 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
12
12
|
tooltipText?: string;
|
|
13
13
|
iconBefore?: ReactNode;
|
|
14
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;
|
|
15
23
|
prefix?: string;
|
|
16
24
|
postfix?: string;
|
|
17
25
|
inputRef?: Ref<HTMLInputElement>;
|
|
@@ -38,6 +46,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
38
46
|
* @param [invalid] - Whether the input has validation errors (applies error styling)
|
|
39
47
|
* @param [iconAfter] - Icon or element to display after the input
|
|
40
48
|
* @param [iconBefore] - Icon or element to display before the input
|
|
49
|
+
* @param [children] - Content rendered inside the field before the input, for values a plain `<input>` cannot hold (e.g. multi-select tags)
|
|
41
50
|
* @param [textBeforeInput] - Text to display before the input
|
|
42
51
|
* @param [suffix] - Text to display inside the input on the right
|
|
43
52
|
* @param [containerClassName] - Additional CSS classes to apply to the container div
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
* text style, lists, quote/link/code, table) plus an edit/live/preview mode
|
|
17
|
+
* switcher and fullscreen, built on top of `@uiw/react-md-editor`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <MarkdownEditor value={value} onChange={setValue} height={400} />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param [value] - The current markdown content
|
|
25
|
+
* @param [onChange] - Callback fired when the editor content changes
|
|
26
|
+
* @param [height=300] - Height of the editor in pixels
|
|
27
|
+
* @param [theme='light'] - Theme for the editor ('light' or 'dark')
|
|
28
|
+
* @param [className] - Additional CSS classes for the container
|
|
29
|
+
* @param [placeholder] - Placeholder text shown when the editor is empty
|
|
30
|
+
* @param [defaultPreview='edit'] - Initial edit/live/preview mode
|
|
31
|
+
*/
|
|
32
|
+
export declare const MarkdownEditor: FC<MarkdownEditorProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICommand } from '@uiw/react-md-editor';
|
|
2
|
+
import { DIAL_ICON_SIZE } from '../../../constants/icon';
|
|
3
|
+
export declare const MARKDOWN_TOOLBAR_ICON_SIZE = DIAL_ICON_SIZE.MD;
|
|
4
|
+
/**
|
|
5
|
+
* Left-hand formatting toolbar, built on top of `@uiw/react-md-editor`'s
|
|
6
|
+
* built-in commands (which insert/toggle markdown syntax in the underlying
|
|
7
|
+
* textarea) with icons and grouping matching the design.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMarkdownFormattingCommands: () => ICommand[];
|
|
10
|
+
/**
|
|
11
|
+
* Right-hand toolbar: the built-in edit/live/preview mode switcher, each
|
|
12
|
+
* with a distinct icon so the three states stay distinguishable even before
|
|
13
|
+
* the active one is highlighted, followed by fullscreen.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getMarkdownExtraCommands: () => ICommand[];
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
*
|
|
12
|
+
* `type` is owned by this component; every other {@link Input} prop is passed
|
|
13
|
+
* through, so it shares the 2.0 field styling, sizes, label, caption and error
|
|
14
|
+
* states.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <NumberInput
|
|
19
|
+
* id="age"
|
|
20
|
+
* placeholder="Enter your age"
|
|
21
|
+
* value={25}
|
|
22
|
+
* onChange={(value) => setAge(value)}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param [integer] - When true, restricts input to integer values only — blocks decimal points, minus, plus, and scientific notation (e/E)
|
|
27
|
+
* @param [min] - Minimum allowed value
|
|
28
|
+
* @param [max] - Maximum allowed value
|
|
29
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px
|
|
30
|
+
* @param [onKeyDown] - Called after the numeric key guard has run, unless the key was blocked
|
|
31
|
+
* @param [onPaste] - Called after pasted text has been sanitized in `integer` mode
|
|
32
|
+
* @param onChange - Callback function called when the input value changes.
|
|
33
|
+
* Returns either a number (for most values) or a string (for decimal values < 1 with leading zeros)
|
|
34
|
+
*/
|
|
35
|
+
export declare const NumberInput: FC<NumberInputProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
*
|
|
13
|
+
* The toggle is a real `<button>`, so it is reachable by keyboard and announces
|
|
14
|
+
* both its purpose and its state. `type` and `iconAfter` are owned by this
|
|
15
|
+
* component; every other {@link Input} prop is passed through.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <PasswordInput
|
|
20
|
+
* id="password"
|
|
21
|
+
* labelProps={{ label: 'Password', required: true }}
|
|
22
|
+
* value={password}
|
|
23
|
+
* onChange={setPassword}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param [showPasswordLabel="Show password"] - Accessible name of the toggle while the value is masked
|
|
28
|
+
* @param [hidePasswordLabel="Hide password"] - Accessible name of the toggle while the value is visible
|
|
29
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px
|
|
30
|
+
* @param [disabled=false] - Disables the field and its reveal toggle
|
|
31
|
+
*/
|
|
32
|
+
export declare const PasswordInput: FC<PasswordInputProps>;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
children?: ReactNode;
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
onClose?: (e?: MouseEvent<HTMLButtonElement> | null) => void;
|
|
15
|
+
size?: PopupSize;
|
|
16
|
+
hideClose?: boolean;
|
|
17
|
+
closeAriaLabel?: string;
|
|
18
|
+
closeOnOutsideClick?: boolean;
|
|
19
|
+
preventKeyboardOnOpen?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An accessible modal dialog using Floating UI.
|
|
23
|
+
* aliases: Modal|Dialog
|
|
24
|
+
*
|
|
25
|
+
* Renders in a portal with a scrim overlay, focus management, a header with the
|
|
26
|
+
* title and close control, a scrollable body and an optional footer. Sections
|
|
27
|
+
* are separated by spacing rather than rules; add your own through
|
|
28
|
+
* `headerClassName` or the footer node if a surface needs them.
|
|
29
|
+
*
|
|
30
|
+
* A string `header` names the dialog automatically. A `header` node cannot —
|
|
31
|
+
* pass `ariaLabel` in that case, or the dialog opens unnamed.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Popup
|
|
36
|
+
* open
|
|
37
|
+
* header="Title"
|
|
38
|
+
* size={PopupSize.Md}
|
|
39
|
+
* footer={
|
|
40
|
+
* <div className="flex justify-end gap-2 px-6 py-4">
|
|
41
|
+
* <NeutralButton label="Cancel" />
|
|
42
|
+
* <PrimaryButton label="Confirm" />
|
|
43
|
+
* </div>
|
|
44
|
+
* }
|
|
45
|
+
* onClose={() => setOpen(false)}
|
|
46
|
+
* >
|
|
47
|
+
* <div className="px-6 py-4">Dialog content goes here…</div>
|
|
48
|
+
* </Popup>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param [open=false] - Controls visibility of the popup
|
|
52
|
+
* @param [header] - Optional title rendered in the header
|
|
53
|
+
* @param [ariaLabel] - Accessible name for the dialog; needed when `header` is not a string
|
|
54
|
+
* @param [portalId] - Optional portal container id
|
|
55
|
+
* @param [className] - Additional CSS classes applied to the popup container
|
|
56
|
+
* @param [overlayClassName] - Additional CSS classes applied to the overlay
|
|
57
|
+
* @param [titleClassName] - Additional CSS classes applied to the title element
|
|
58
|
+
* @param [headerClassName] - Additional CSS classes applied to the popup header container
|
|
59
|
+
* @param [children] - Body content
|
|
60
|
+
* @param [footer] - Footer area for actions
|
|
61
|
+
* @param [onClose] - Callback fired when the popup requests to close
|
|
62
|
+
* @param [size=PopupSize.Md] - Sets the max-width of the popup
|
|
63
|
+
* @param [hideClose=false] - Whether the close button is hidden in the header
|
|
64
|
+
* @param [closeAriaLabel="Close dialog"] - Accessible name of the close button
|
|
65
|
+
* @param [closeOnOutsideClick=true] - Whether the popup closes when clicking outside
|
|
66
|
+
* @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile
|
|
67
|
+
*/
|
|
68
|
+
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-h2-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,16 @@
|
|
|
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
|
+
* field.
|
|
11
|
+
*
|
|
12
|
+
* @param options - All available options, used to resolve labels and icons
|
|
13
|
+
* @param selectedValues - Values currently selected
|
|
14
|
+
* @param [handleRemoveTag] - Called with the value whose tag was removed; when omitted the tags are not removable
|
|
15
|
+
*/
|
|
16
|
+
export declare const MultiSelectTags: FC<MultiSelectTagsProps>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { FC, MouseEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
import { LabelProps } from '../Label/Label';
|
|
3
|
+
import { SelectOption } from '../../../models/select';
|
|
4
|
+
import { ElementSize } from '../../../types/size';
|
|
5
|
+
export interface SelectProps {
|
|
6
|
+
options: SelectOption[];
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
size?: ElementSize;
|
|
10
|
+
value?: string | string[];
|
|
11
|
+
customSelectedValue?: string;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
defaultValue?: string | string[];
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
labelProps?: LabelProps;
|
|
16
|
+
error?: string;
|
|
17
|
+
caption?: string;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
searchable?: boolean;
|
|
20
|
+
searchSize?: ElementSize;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
selectAll?: boolean;
|
|
23
|
+
selectAllLabel?: string;
|
|
24
|
+
emptyStateTitle?: string;
|
|
25
|
+
emptyStateDescription?: string;
|
|
26
|
+
emptyStateIcon?: ReactNode;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
fieldClassName?: string;
|
|
30
|
+
listClassName?: string;
|
|
31
|
+
closable?: boolean;
|
|
32
|
+
invalid?: boolean;
|
|
33
|
+
header?: ReactNode | (() => ReactNode);
|
|
34
|
+
footer?: ReactNode | (() => ReactNode);
|
|
35
|
+
open?: boolean;
|
|
36
|
+
onOpenChange?: (open: boolean) => void;
|
|
37
|
+
onSearchQueryChange?: (query: string) => void;
|
|
38
|
+
dismissRef?: Ref<unknown>;
|
|
39
|
+
onClose?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
40
|
+
onChange?: (next: string | string[]) => void;
|
|
41
|
+
onFooterClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
42
|
+
customMultiSelectTagsRenderer?: (options: SelectOption[], selectedValues: string[], handleRemoveTag: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, val: string) => void) => ReactNode;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A versatile select supporting single and multiple selections.
|
|
46
|
+
* aliases: OptionPicker|ChoiceSelector
|
|
47
|
+
*
|
|
48
|
+
* The field is an {@link Input}, so it carries the 2.0 field styling, sizes,
|
|
49
|
+
* label, caption and error states, and it exposes the control as a `combobox`
|
|
50
|
+
* whose popup is the option list.
|
|
51
|
+
*
|
|
52
|
+
* Single mode:
|
|
53
|
+
* - The field shows the selected option's leading icon + label.
|
|
54
|
+
* - In the list, the selected option is indicated by a LEFT border, a tinted background
|
|
55
|
+
* and a trailing check icon.
|
|
56
|
+
*
|
|
57
|
+
* Multiple mode uses checkboxes (including Select All with indeterminate state) and
|
|
58
|
+
* renders the selection as removable tags inside the field.
|
|
59
|
+
*
|
|
60
|
+
* The field itself is never typeable: `searchable` puts a search field in the overlay
|
|
61
|
+
* header that filters the options.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Select options={[{ value: 'option-1', label: 'Option 1' }]} />
|
|
66
|
+
* <Select searchable options={[{ value: 'a', label: 'Alpha' }, { value: 'b', label: 'Beta' }]} />
|
|
67
|
+
* <Select multiple selectAll options={[{ value: '1', label: 'One' }, { value: '2', label: 'Two' }]} />
|
|
68
|
+
* <Select labelProps={{ label: 'Operator' }} caption="Pick a comparison" options={options} />
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param options - Array of options to select from.
|
|
72
|
+
* @param [id] - The id of the field, linked to the label.
|
|
73
|
+
* @param [multiple] - Whether multiple selections are allowed.
|
|
74
|
+
* @param [size=ElementSize.Standard] - Field height: standard is 40px, small is 24px.
|
|
75
|
+
* @param [value] - Controlled selected value(s).
|
|
76
|
+
* @param [customSelectedValue] - Custom string to render as the selected value in single mode.
|
|
77
|
+
* @param [prefix] - Prefix for selected value(s).
|
|
78
|
+
* @param [defaultValue] - Uncontrolled initial selected value(s).
|
|
79
|
+
* @param [placeholder="Select..."] - Placeholder text when no selection is made.
|
|
80
|
+
* @param [labelProps] - Props of the {@link Label} rendered above the field.
|
|
81
|
+
* @param [error] - Error message rendered below the field (does not by itself apply error styling, pass `invalid` too).
|
|
82
|
+
* @param [caption] - Helper text rendered below the field when there is no `error`.
|
|
83
|
+
* @param [ariaLabel] - Accessible name for the field; use it when there is no visible label.
|
|
84
|
+
* @param [searchable=false] - Show a search field in the overlay header.
|
|
85
|
+
* @param [searchSize=ElementSize.Standard] - Size of the overlay search input when `searchable` is enabled.
|
|
86
|
+
* @param [searchPlaceholder] - Placeholder for the overlay search input.
|
|
87
|
+
* @param [selectAll=false] - Show a "Select All" checkbox in multiple mode.
|
|
88
|
+
* @param [selectAllLabel="Select all"] - Label for the "Select All" checkbox.
|
|
89
|
+
* @param [emptyStateTitle="No options available"] - Title text when there are no options.
|
|
90
|
+
* @param [emptyStateDescription] - Description text when there are no options.
|
|
91
|
+
* @param [emptyStateIcon] - Icon to display when there are no options.
|
|
92
|
+
* @param [invalid] - Whether the select is in an invalid state, affecting styling.
|
|
93
|
+
* @param [disabled=false] - Disable the control.
|
|
94
|
+
* @param [className] - Additional CSS classes for the outer container.
|
|
95
|
+
* @param [fieldClassName] - Additional CSS classes for the field itself.
|
|
96
|
+
* @param [listClassName] - Additional CSS classes for the list dropdown.
|
|
97
|
+
* @param [closable=false] - Show a close button in the dropdown header.
|
|
98
|
+
* @param [header] - Custom node/function rendered above the options.
|
|
99
|
+
* @param [footer] - Custom node/function rendered below the options.
|
|
100
|
+
* @param [open] - Controlled open state of the dropdown. When provided, makes the dropdown controlled.
|
|
101
|
+
* @param [onOpenChange] - Called when the dropdown open state changes.
|
|
102
|
+
* @param [onClose] - Called when the dropdown close button is clicked.
|
|
103
|
+
* @param [onChange] - Called when the selection changes.
|
|
104
|
+
* @param [onSearchQueryChange] - Called when the overlay search query changes, including the reset to `''` on close. Use it to fetch options for the query.
|
|
105
|
+
* @param [onFooterClick] - Called when the footer element is clicked. When provided, automatically closes the dropdown.
|
|
106
|
+
* @param [dismissRef] - Ref object to expose a `dismiss` method to programmatically close the select.
|
|
107
|
+
* @param [customMultiSelectTagsRenderer] - Renders the selected tags of a multi-select in place of the default ones.
|
|
108
|
+
*/
|
|
109
|
+
export declare const Select: FC<SelectProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SelectOption } from '../../../models/select';
|
|
3
|
+
export interface SelectSubMenuItemProps {
|
|
4
|
+
opt: SelectOption;
|
|
5
|
+
selectedValues: string[];
|
|
6
|
+
onSelect: (value: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const SelectSubMenuItem: FC<SelectSubMenuItemProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const selectOverlayBaseClassName: string;
|
|
2
|
+
export declare const selectOptionBaseClassName: string;
|
|
3
|
+
export declare const selectOptionSelectedClassName = "bg-accent-primary-alpha";
|
|
4
|
+
/**
|
|
5
|
+
* Holds the option list to the width of the field.
|
|
6
|
+
*
|
|
7
|
+
* `Dropdown` only pins the overlay's *min* width to the trigger and lets
|
|
8
|
+
* `max-width` run to the available viewport width — as an inline style, so a
|
|
9
|
+
* single long label stretches the list across the screen and only `!important`
|
|
10
|
+
* can rein it back in. `--reference-width` is the trigger width the dropdown
|
|
11
|
+
* publishes, and it is set whenever `matchReferenceWidth` is left on (the
|
|
12
|
+
* default this component relies on).
|
|
13
|
+
*/
|
|
14
|
+
export declare const selectListWidthClassName = "!max-w-[var(--reference-width)]";
|
|
15
|
+
export declare const selectOptionDisabledClassName = "opacity-75";
|
|
16
|
+
export declare const dropdownMenuMaxHeight = 352;
|
|
17
|
+
export declare const selectSubMenuGap = 4;
|
|
18
|
+
export declare const selectSubMenuClassName: string;
|
|
19
|
+
/** Marks an option that opens a nested list. Matches the dropdown's caret. */
|
|
20
|
+
export declare const selectSubMenuCaretIcon: import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
/** Classes for the chevron rendered as the field's trailing icon. */
|
|
22
|
+
export declare const selectFieldIconClassName = "text-secondary transition-transform";
|
|
23
|
+
/**
|
|
24
|
+
* Number of options below which the overlay's search row stays hidden: a list
|
|
25
|
+
* short enough to scan at a glance does not need to be filtered.
|
|
26
|
+
*/
|
|
27
|
+
export declare const selectSearchThreshold = 8;
|
|
28
|
+
export declare const selectSearchIcon: import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const selectCloseIcon: import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/** Marks the selected option in single mode, alongside its tinted row. */
|
|
31
|
+
export declare const selectOptionCheckIcon: import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const selectEmptyStateIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styling shared by the 2.0 floating surfaces — the dropdown menu and the select
|
|
3
|
+
* option list. They are the same object visually, so they read from one place
|
|
4
|
+
* rather than each keeping its own copy of the tokens.
|
|
5
|
+
*/
|
|
6
|
+
/** The floating panel itself: rounded raised card with a one-unit inset. */
|
|
7
|
+
export declare const overlaySurfaceClassName = "rounded-xl bg-layer-raised p-1 shadow-md";
|
|
8
|
+
/**
|
|
9
|
+
* A nested panel opened from a row of the surface above it. It is the same
|
|
10
|
+
* object as its parent panel, so it reads from `overlaySurfaceClassName` too —
|
|
11
|
+
* only the width behaviour differs, since a submenu is sized by its own content
|
|
12
|
+
* rather than by the trigger further up.
|
|
13
|
+
*/
|
|
14
|
+
export declare const overlaySubMenuClassName: string;
|
|
15
|
+
/**
|
|
16
|
+
* A selectable row inside the panel. Keeps a visible focus ring: these rows are
|
|
17
|
+
* reached by keyboard, and the 1.0 versions suppressed the ring outright.
|
|
18
|
+
*/
|
|
19
|
+
export declare const overlayItemClassName: string;
|
|
20
|
+
/** Tint marking the row that is currently selected. */
|
|
21
|
+
export declare const overlayItemSelectedClassName = "bg-accent-primary-alpha";
|
|
22
|
+
export declare const overlayItemDisabledClassName = "opacity-75";
|
|
23
|
+
/** Distance between the trigger and its panel, and between nested panels. */
|
|
24
|
+
export declare const overlayGap = 4;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
2
|
+
import { SkeletonVariant, SkeletonAvatarSize, SkeletonAvatarShape } from '../../types/skeleton';
|
|
3
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
paragraph?: boolean | {
|
|
6
6
|
rows?: number;
|
|
7
7
|
width?: string | string[];
|
|
8
8
|
};
|
|
9
9
|
avatar?: boolean | {
|
|
10
|
-
size?: number |
|
|
11
|
-
shape?:
|
|
10
|
+
size?: number | SkeletonAvatarSize;
|
|
11
|
+
shape?: SkeletonAvatarShape;
|
|
12
12
|
};
|
|
13
13
|
showTitle?: boolean | {
|
|
14
14
|
width?: string;
|
|
15
15
|
};
|
|
16
16
|
loading?: boolean;
|
|
17
17
|
children?: ReactNode;
|
|
18
|
-
variant?:
|
|
18
|
+
variant?: SkeletonVariant;
|
|
19
19
|
width?: string | number;
|
|
20
20
|
height?: string | number;
|
|
21
21
|
overlay?: ReactNode;
|
|
22
22
|
color?: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Skeleton
|
|
26
26
|
* aliases: PlaceholderUI|ShimmerLoader
|
|
27
27
|
*
|
|
28
28
|
* A placeholder component to show while content is loading.
|
|
@@ -31,16 +31,16 @@ export interface DialSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
31
31
|
* @example
|
|
32
32
|
* ```tsx
|
|
33
33
|
* // Simple skeleton
|
|
34
|
-
* <
|
|
34
|
+
* <Skeleton />
|
|
35
35
|
*
|
|
36
36
|
* // Text skeleton with custom size
|
|
37
|
-
* <
|
|
37
|
+
* <Skeleton variant={SkeletonVariant.Text} width="200px" height="20px" />
|
|
38
38
|
*
|
|
39
39
|
* // Circular avatar skeleton
|
|
40
|
-
* <
|
|
40
|
+
* <Skeleton variant={SkeletonVariant.Circular} width={40} height={40} />
|
|
41
41
|
*
|
|
42
42
|
* // Complex skeleton with avatar, showTitle and paragraph
|
|
43
|
-
* <
|
|
43
|
+
* <Skeleton
|
|
44
44
|
* avatar
|
|
45
45
|
* showTitle
|
|
46
46
|
* paragraph={{ rows: 3 }}
|
|
@@ -48,20 +48,20 @@ export interface DialSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
48
48
|
* />
|
|
49
49
|
*
|
|
50
50
|
* // Conditional loading
|
|
51
|
-
* <
|
|
51
|
+
* <Skeleton loading={isLoading}>
|
|
52
52
|
* <div>Your content here</div>
|
|
53
|
-
* </
|
|
53
|
+
* </Skeleton>
|
|
54
54
|
*
|
|
55
55
|
* // Custom paragraph widths
|
|
56
|
-
* <
|
|
56
|
+
* <Skeleton
|
|
57
57
|
* paragraph={{ rows: 3, width: ['100%', '80%', '60%'] }}
|
|
58
58
|
* />
|
|
59
59
|
*
|
|
60
60
|
* // Avatar with size and shape
|
|
61
|
-
* <
|
|
61
|
+
* <Skeleton
|
|
62
62
|
* avatar={{
|
|
63
|
-
* size:
|
|
64
|
-
* shape:
|
|
63
|
+
* size: SkeletonAvatarSize.Large,
|
|
64
|
+
* shape: SkeletonAvatarShape.Square
|
|
65
65
|
* }}
|
|
66
66
|
* />
|
|
67
67
|
* ```
|
|
@@ -72,11 +72,11 @@ export interface DialSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
72
72
|
* @param [showTitle=true] - Show title placeholder or configure its appearance
|
|
73
73
|
* @param [loading=true] - Display the skeleton when true
|
|
74
74
|
* @param [children] - Content to be displayed when loading is false
|
|
75
|
-
* @param [variant=
|
|
75
|
+
* @param [variant=SkeletonVariant.Default] - Skeleton variant
|
|
76
76
|
* @param [width] - Width of the skeleton
|
|
77
77
|
* @param [height] - Height of the skeleton
|
|
78
78
|
* @param [className] - Additional CSS classes
|
|
79
79
|
* @param [overlay] - Content to overlay on top of the skeleton (e.g., a spinner)
|
|
80
80
|
* @param [color] - Custom background color for the skeleton elements (overrides the default token)
|
|
81
81
|
*/
|
|
82
|
-
export declare const
|
|
82
|
+
export declare const Skeleton: FC<SkeletonProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getAvatarSize: (size?: number |
|
|
1
|
+
import { SkeletonAvatarSize } from '../../types/skeleton';
|
|
2
|
+
export declare const getAvatarSize: (size?: number | SkeletonAvatarSize) => number;
|