@epam/ai-dial-ui-kit 0.15.0-dev.2 → 0.15.0-dev.21

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.
Files changed (148) hide show
  1. package/README.md +185 -0
  2. package/dist/CHANGELOG.md +35 -0
  3. package/dist/DateCellRenderer-CkFOYZGc.cjs +1 -0
  4. package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-ZLb4GAUV.cjs} +26 -26
  5. package/dist/IconButton-CVttu-k-.cjs +1 -0
  6. package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
  7. package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
  8. package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
  9. package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-BA94ffC4.cjs} +1 -1
  10. package/dist/{Switch-CUKClcEz.cjs → Switch-CfxMs3AZ.cjs} +1 -1
  11. package/dist/components/Dropdown/Dropdown.js +70 -65
  12. package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
  13. package/dist/components/Dropdown/constants.js +16 -14
  14. package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
  15. package/dist/components/FileManager/FileManager.js +2 -2
  16. package/dist/components/New/Accordion/Accordion.js +72 -66
  17. package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
  18. package/dist/components/New/Breadcrumbs/constants.js +41 -0
  19. package/dist/components/New/ButtonDropdown/ButtonDropdown.js +7 -6
  20. package/dist/components/New/Calendar/Calendar.js +337 -289
  21. package/dist/components/New/Calendar/constants.js +5 -5
  22. package/dist/components/New/CaptionText/CaptionText.js +18 -15
  23. package/dist/components/New/CardShell/CardShell.js +5 -3
  24. package/dist/components/New/Checkbox/Checkbox.js +67 -56
  25. package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
  26. package/dist/components/New/CloseButton/CloseButton.js +18 -16
  27. package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
  28. package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
  29. package/dist/components/New/Dropdown/Dropdown.js +112 -105
  30. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
  31. package/dist/components/New/Dropdown/constants.js +22 -17
  32. package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
  33. package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
  34. package/dist/components/New/FileIcon/FileIcon.js +55 -0
  35. package/dist/components/New/FileIcon/constants.js +134 -0
  36. package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
  37. package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
  38. package/dist/components/New/FileName/FileName.js +78 -0
  39. package/dist/components/New/FilterChips/FilterChips.js +43 -0
  40. package/dist/components/New/FilterChips/constants.js +5 -0
  41. package/dist/components/New/FolderName/FolderName.js +16 -0
  42. package/dist/components/New/FolderPath/FolderPath.js +29 -28
  43. package/dist/components/New/Highlight/Highlight.js +23 -30
  44. package/dist/components/New/InfoButton/InfoButton.js +13 -11
  45. package/dist/components/New/InlineSelect/InlineSelect.js +43 -41
  46. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
  47. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  48. package/dist/components/New/Label/Label.js +13 -8
  49. package/dist/components/New/MenuItem/MenuItem.js +29 -27
  50. package/dist/components/New/MenuItem/constants.js +9 -8
  51. package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
  52. package/dist/components/New/Notification/Notification.js +33 -29
  53. package/dist/components/New/NumberInput/NumberInput.js +42 -33
  54. package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
  55. package/dist/components/New/Popup/Popup.js +46 -44
  56. package/dist/components/New/Popup/constants.js +3 -3
  57. package/dist/components/New/Radio/Radio.js +75 -64
  58. package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
  59. package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
  60. package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
  61. package/dist/components/New/Search/Search.js +29 -27
  62. package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
  63. package/dist/components/New/Select/Select.js +120 -109
  64. package/dist/components/New/Select/constants.js +23 -20
  65. package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
  66. package/dist/components/New/Switch/Switch.js +69 -58
  67. package/dist/components/New/Tabs/Tabs.js +125 -61
  68. package/dist/components/New/Tag/Tag.js +42 -40
  69. package/dist/components/New/TagInput/TagInput.js +45 -43
  70. package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
  71. package/dist/components/New/Tooltip/TooltipContent.js +11 -9
  72. package/dist/components/New/Tooltip/constants.js +1 -1
  73. package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
  74. package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
  75. package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
  76. package/dist/components/New/TransferQueue/constants.js +24 -0
  77. package/dist/components/New/constants/overlay.js +15 -9
  78. package/dist/components/Popup/constants.js +8 -8
  79. package/dist/components/ProgressBar/ProgressBar.js +45 -33
  80. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
  81. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
  82. package/dist/components/SchemaRenderer/types.js +19 -8
  83. package/dist/components/SchemaRenderer/utils.js +121 -96
  84. package/dist/components/Skeleton/Skeleton.js +25 -19
  85. package/dist/components/Spinner/Spinner.js +7 -5
  86. package/dist/components/Tooltip/TooltipContent.js +11 -11
  87. package/dist/components-manifest.json +779 -37
  88. package/dist/constants/public-class-names.js +198 -0
  89. package/dist/dial-ui-kit.cjs +2 -2
  90. package/dist/dial-ui-kit.js +322 -295
  91. package/dist/editors.cjs +1 -1
  92. package/dist/file-manager.cjs +1 -1
  93. package/dist/grid.cjs +1 -1
  94. package/dist/index.css +2 -2
  95. package/dist/lazy-BEsZqouS.cjs +1 -0
  96. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  97. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  98. package/dist/src/components/New/Accordion/Accordion.d.ts +4 -0
  99. package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
  100. package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
  101. package/dist/src/components/New/Calendar/Calendar.d.ts +14 -1
  102. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  103. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  104. package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
  105. package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
  106. package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
  107. package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
  108. package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
  109. package/dist/src/components/New/FileName/FileName.d.ts +79 -0
  110. package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
  111. package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
  112. package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
  113. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  114. package/dist/src/components/New/Notification/Notification.d.ts +18 -0
  115. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  116. package/dist/src/components/New/Select/constants.d.ts +3 -2
  117. package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
  118. package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
  119. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  120. package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
  121. package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
  122. package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
  123. package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
  124. package/dist/src/components/New/constants/overlay.d.ts +13 -0
  125. package/dist/src/components/Popup/constants.d.ts +1 -1
  126. package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
  127. package/dist/src/components/SchemaRenderer/utils.d.ts +5 -1
  128. package/dist/src/constants/public-class-names.d.ts +189 -0
  129. package/dist/src/index.d.ts +21 -0
  130. package/dist/src/types/accordion.d.ts +7 -0
  131. package/dist/src/types/breadcrumbs.d.ts +9 -0
  132. package/dist/src/types/transfer-queue.d.ts +10 -0
  133. package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
  134. package/dist/src/utils/sub-menu-floating.d.ts +7 -4
  135. package/dist/src/utils/timezone.d.ts +24 -0
  136. package/dist/types/accordion.js +4 -0
  137. package/dist/types/breadcrumbs.js +4 -0
  138. package/dist/types/transfer-queue.js +4 -0
  139. package/dist/use-file-manager-tabs-4s-dbnmu.cjs +3 -0
  140. package/dist/utils/merge-classes.js +12 -5
  141. package/dist/utils/sub-menu-floating.js +98 -54
  142. package/dist/utils/timezone.js +19 -0
  143. package/package.json +2 -2
  144. package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
  145. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  146. package/dist/lazy-tfN4sKhq.cjs +0 -1
  147. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  148. package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
@@ -1,4 +1,5 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { AccordionCaretPosition } from '../../../types/accordion';
2
3
  export interface AccordionProps {
3
4
  /** Title rendered in the header. */
4
5
  title: ReactNode;
@@ -24,6 +25,8 @@ export interface AccordionProps {
24
25
  ariaLabel?: string;
25
26
  /** Fired when the header is clicked. Receives the next expanded state. */
26
27
  onToggle?: (expanded: boolean) => void;
28
+ /** Where the header draws its caret. Defaults to `AccordionCaretPosition.End`. */
29
+ caretPosition?: AccordionCaretPosition;
27
30
  /** Additional CSS classes for the outer container. */
28
31
  className?: string;
29
32
  /** Additional CSS classes for the header. */
@@ -64,6 +67,7 @@ export interface AccordionProps {
64
67
  * @param [nonCollapsible] - Renders the panel permanently expanded, with a static header.
65
68
  * @param [ariaLabel] - Accessible name for the header; needed when `title` carries no text.
66
69
  * @param [onToggle] - Fired when the header is clicked. Receives the next expanded state.
70
+ * @param [caretPosition=AccordionCaretPosition.End] - Where the header draws its caret: before or after the title.
67
71
  * @param [className] - Additional CSS classes for the outer container.
68
72
  * @param [headerClassName] - Additional CSS classes for the header.
69
73
  * @param [contentClassName] - Additional CSS classes for the content region.
@@ -0,0 +1,94 @@
1
+ import { FC, MouseEvent, ReactNode } from 'react';
2
+ import { BreadcrumbsSize } from '../../../types/breadcrumbs';
3
+ /** One step of the trail rendered by {@link Breadcrumbs}. */
4
+ export interface BreadcrumbsItem {
5
+ /**
6
+ * The segment's text. A plain string rather than a node, because it is both
7
+ * what is drawn and what the tooltip shows once the trail truncates it.
8
+ */
9
+ label: string;
10
+ /** Where the segment navigates. Renders the segment as a link. */
11
+ href?: string;
12
+ /**
13
+ * Fired when the segment is activated. Renders the segment as a button when
14
+ * there is no `href`, and runs before the browser follows one when there is —
15
+ * call `preventDefault()` on the event to keep the user where they are.
16
+ */
17
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
18
+ /** Leading icon, e.g. a folder glyph on the root. Decorative: pass `aria-hidden`. */
19
+ icon?: ReactNode;
20
+ }
21
+ export interface BreadcrumbsProps {
22
+ /** The trail, outermost first. The last entry is the current page. */
23
+ items: BreadcrumbsItem[];
24
+ /**
25
+ * How many segments are drawn before the middle collapses behind an
26
+ * ellipsis menu. Clamped to a floor of three — the root, the ellipsis and
27
+ * the current page.
28
+ */
29
+ maxVisibleItems?: number;
30
+ /**
31
+ * The trail's type scale: `dial-small-text` by default, or `dial-h2-text`
32
+ * for a trail that doubles as the page heading.
33
+ */
34
+ size?: BreadcrumbsSize;
35
+ /** Node drawn between two segments. Defaults to a right chevron, mirrored in RTL. */
36
+ separator?: ReactNode;
37
+ /** Accessible name for the `<nav>`. */
38
+ ariaLabel?: string;
39
+ /** Accessible name for the ellipsis button that reveals the collapsed segments. */
40
+ overflowAriaLabel?: string;
41
+ /** Additional CSS classes for the `<nav>`. Must not shrink it to its content. */
42
+ className?: string;
43
+ /** Additional CSS classes applied to every segment. */
44
+ itemClassName?: string;
45
+ }
46
+ /**
47
+ * A navigation trail: where the user is, and every level they can step back to.
48
+ * aliases: Breadcrumb|NavigationPath|BreadcrumbTrail
49
+ * Design system 2.0
50
+ *
51
+ * The last item is the current page — drawn semibold and primary, and never a
52
+ * control, since a link to the page you are already on does nothing. Every
53
+ * earlier item with an `href` or an `onClick` is a link; one with neither is
54
+ * drawn as plain text, which is how a read-only location path is built.
55
+ *
56
+ * The trail never wraps. Segments truncate instead, each revealing its full
57
+ * label in a tooltip only once it is actually clipped, and a trail longer than
58
+ * `maxVisibleItems` collapses its middle behind an ellipsis menu — the root and
59
+ * the current page, the two segments that carry the most meaning, always stay
60
+ * on screen.
61
+ *
62
+ * a11y: an `<ol>` inside a named `<nav>`, with `aria-current="page"` on the last
63
+ * segment. Separators are decorative and hidden from assistive tech, so the
64
+ * trail is announced as a list of links rather than a string of chevrons.
65
+ *
66
+ * The trail is drawn at `dial-small-text` by default; `size` switches it to
67
+ * `dial-h2-text` for a trail that doubles as the page heading, where the
68
+ * token's own semibold weight applies to every segment.
69
+ *
70
+ * Labels are the caller's to translate; the two accessible names default to
71
+ * English and take an override.
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * <Breadcrumbs
76
+ * ariaLabel={t('File path')}
77
+ * items={[
78
+ * { label: t('My files'), onClick: () => open('/') },
79
+ * { label: 'DK Test', onClick: () => open('/DK Test') },
80
+ * { label: 'DK Test with nested' },
81
+ * ]}
82
+ * />
83
+ * ```
84
+ *
85
+ * @param items - The trail, outermost first; the last entry is the current page
86
+ * @param [maxVisibleItems=4] - Segments drawn before the middle collapses behind an ellipsis menu
87
+ * @param [size=BreadcrumbsSize.Small] - The trail's type scale: `dial-small-text` or `dial-h2-text`
88
+ * @param [separator] - Node drawn between two segments; defaults to a right chevron
89
+ * @param [ariaLabel='Breadcrumb'] - Accessible name for the `<nav>`
90
+ * @param [overflowAriaLabel='Show hidden path segments'] - Accessible name for the ellipsis button
91
+ * @param [className] - Additional CSS classes for the `<nav>`
92
+ * @param [itemClassName] - Additional CSS classes applied to every segment
93
+ */
94
+ export declare const Breadcrumbs: FC<BreadcrumbsProps>;
@@ -0,0 +1,60 @@
1
+ import { ReactNode } from 'react';
2
+ import { BreadcrumbsSize } from '../../../types/breadcrumbs';
3
+ /**
4
+ * The `<nav>`. It clips rather than wraps: a breadcrumb that reflows onto a
5
+ * second line moves the content below it, so the trail truncates its segments
6
+ * instead (see `segmentWidthClassName`).
7
+ */
8
+ export declare const navClassName = "w-full overflow-hidden";
9
+ /** The `<ol>` holding the segments and their separators. */
10
+ export declare const listClassName = "flex min-w-0 flex-nowrap items-center gap-2 whitespace-nowrap";
11
+ /** One `<li>`: the segment and the separator that follows it. */
12
+ export declare const itemClassName = "flex min-w-0 items-center gap-2";
13
+ /**
14
+ * The trail's type scale. It sits on the `<li>`, so the segment, the
15
+ * separator and the tooltip trigger inside it all read from one declaration.
16
+ */
17
+ export declare const sizeClassName: Record<BreadcrumbsSize, string>;
18
+ /**
19
+ * The current page is always semibold. `dial-h2-text` already is, so the
20
+ * heading trail repeats its own token rather than reaching for a semibold
21
+ * variant that does not exist.
22
+ */
23
+ export declare const currentSizeClassName: Record<BreadcrumbsSize, string>;
24
+ /**
25
+ * How each segment gives up width when the trail does not fit. The root keeps
26
+ * its full label — it is the anchor the user navigates back to — the middle
27
+ * segments truncate first, and the current page keeps the largest share of
28
+ * what is left, since it names where the user actually is.
29
+ */
30
+ export declare const segmentWidthClassName: Record<'first' | 'middle' | 'last', string>;
31
+ /** The box that draws a segment, around its icon and its label. */
32
+ export declare const segmentClassName = "flex min-w-0 flex-1 items-center gap-1 rounded-sm transition-colors";
33
+ /**
34
+ * A segment the user can follow. Secondary until hovered, then accent — the
35
+ * same pairing the kit's other inline links use.
36
+ */
37
+ export declare const linkSegmentClassName = "text-secondary hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus";
38
+ /**
39
+ * The last segment: where the user is. Semibold and primary, and never a
40
+ * link — a control that navigates to the page it is on has nothing to do.
41
+ */
42
+ export declare const currentSegmentClassName = "cursor-default text-primary";
43
+ /** A segment with nowhere to go: rendered, but not a control. */
44
+ export declare const staticSegmentClassName = "cursor-default text-secondary";
45
+ /** The chevron between two segments. */
46
+ export declare const separatorClassName = "inline-flex flex-none items-center leading-none text-secondary";
47
+ /**
48
+ * The collapsed-middle trigger. `dial-kit-minimum-target` lifts the 16px
49
+ * glyph to the 24×24 of WCAG 2.5.8; the enhanced 44×44 target would overhang
50
+ * the segments on either side of it (see the README exception table).
51
+ */
52
+ export declare const overflowButtonClassName = "dial-kit-minimum-target flex shrink-0 items-center rounded-sm text-secondary transition-colors hover:text-accent focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-focus";
53
+ /**
54
+ * Smallest trail the collapse can produce: the root, the ellipsis and the
55
+ * current page. Below that there is nothing left to hide behind the ellipsis.
56
+ */
57
+ export declare const MIN_VISIBLE_ITEMS = 3;
58
+ /** Segments shown before the trail collapses. */
59
+ export declare const DEFAULT_MAX_VISIBLE_ITEMS = 4;
60
+ export declare const defaultSeparator: ReactNode;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { FC, FocusEventHandler } from 'react';
2
2
  import { LabelProps } from '../Label/Label';
3
3
  import { CalendarMode } from '../../../types/calendar';
4
4
  export type CalendarValue = Date | string | null;
@@ -6,6 +6,11 @@ export interface CalendarProps {
6
6
  mode?: CalendarMode;
7
7
  value?: CalendarValue;
8
8
  onChange?: (value: CalendarValue) => void;
9
+ /**
10
+ * Called when the Calendar's input field loses focus, e.g. for on-blur
11
+ * validation.
12
+ */
13
+ onBlur?: FocusEventHandler<HTMLInputElement>;
9
14
  labelProps?: LabelProps;
10
15
  placeholder?: string;
11
16
  disabled?: boolean;
@@ -17,6 +22,12 @@ export interface CalendarProps {
17
22
  /** BCP 47 locale tag used to localize month/weekday names and date formatting. */
18
23
  locale?: string;
19
24
  fieldClassName?: string;
25
+ /**
26
+ * Shows the viewer's timezone (e.g. `(GMT+01:00) Europe/Berlin`, computed
27
+ * by `getTimezoneLabel`) at the trailing edge of the `time` field, naming
28
+ * the zone the entered time-of-day refers to.
29
+ */
30
+ showTimezone?: boolean;
20
31
  }
21
32
  /**
22
33
  * A date/time picker supporting four selection modes.
@@ -41,6 +52,7 @@ export interface CalendarProps {
41
52
  * @param [mode=CalendarMode.Date] - Selection mode: date, datetime, time or weekday
42
53
  * @param [value] - Controlled value: a `Date` for date/datetime, an `"HH:mm"` string for time, an ISO weekday number (`"1"`=Monday…`"7"`=Sunday) for weekday
43
54
  * @param [onChange] - Callback fired with the next value when the selection changes
55
+ * @param [onBlur] - Called when the Calendar's input field loses focus, e.g. for on-blur validation
44
56
  * @param [labelProps] - Props of the {@link Label} rendered above the control, including `label`, `required` and `caption`
45
57
  * @param [placeholder] - Placeholder shown when there is no value; defaults to a mode-appropriate string ("Select date", "Select date and time", "--:--" or "Select day")
46
58
  * @param [disabled=false] - Disables the control
@@ -51,5 +63,6 @@ export interface CalendarProps {
51
63
  * @param [maxDate] - Latest selectable date (date/datetime modes)
52
64
  * @param [locale="en-GB"] - BCP 47 locale tag used to localize month/weekday names and date formatting
53
65
  * @param [fieldClassName] - Additional classes merged onto the trigger field, overriding conflicting defaults
66
+ * @param [showTimezone=false] - Shows the viewer's timezone (e.g. `(GMT+01:00) Europe/Berlin`) at the trailing edge of the `time` field
54
67
  */
55
68
  export declare const Calendar: FC<CalendarProps>;
@@ -4,7 +4,7 @@ export declare const calendarModeDefaultPlaceholder: Record<CalendarMode, string
4
4
  export declare const calendarFieldBaseClassName = "flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-none transition-colors hover:border-accent-alpha focus-within:border-accent-focus";
5
5
  export declare const calendarFieldDisabledClassName = "!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent";
6
6
  export declare const calendarFieldInvalidClassName = "!border-error";
7
- export declare const calendarPopoverClassName = "z-[53] flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md";
7
+ export declare const calendarPopoverClassName = "z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md";
8
8
  export declare const calendarDayButtonBaseClassName = "flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-none focus-visible:outline focus-visible:outline-focus";
9
9
  export declare const calendarDaySelectedClassName = "bg-control-accent text-control-permanent";
10
10
  export declare const calendarDayTodayClassName = "text-accent dial-small-semi-text";
@@ -1,5 +1,5 @@
1
1
  import { Placement } from '@floating-ui/react';
2
- import { FC, MouseEvent, ReactNode, RefObject } from 'react';
2
+ import { CSSProperties, FC, MouseEvent, ReactNode, RefObject } from 'react';
3
3
  import { DropdownTrigger } from '../../../types/dropdown';
4
4
  import { DropdownItem } from '../../../models/dropdown';
5
5
  export interface DropdownProps {
@@ -25,6 +25,13 @@ export interface DropdownProps {
25
25
  overlayContentClassName?: string;
26
26
  separatorClassName?: string;
27
27
  listClassName?: string;
28
+ /**
29
+ * Inline style for the floating overlay. The overlay renders in a portal, so
30
+ * this is the only way to hand it CSS custom properties from a caller's own
31
+ * scope — e.g. theme variables that its rows and header read. Positioning
32
+ * stays the dropdown's own: `floatingStyles` is applied on top of it.
33
+ */
34
+ listStyle?: CSSProperties;
28
35
  outsidePressIgnoreRef?: RefObject<HTMLElement | null>;
29
36
  outsideClosable?: boolean;
30
37
  anchorToMouse?: boolean;
@@ -97,6 +104,7 @@ export interface DropdownProps {
97
104
  * @param [overlayContentClassName] - Additional CSS classes applied to the overlay content
98
105
  * @param [separatorClassName] - Additional CSS classes applied to the separators between items
99
106
  * @param [listClassName] - Additional CSS classes applied to the floating overlay
107
+ * @param [listStyle] - Inline style applied to the floating overlay, under the dropdown's own positioning styles
100
108
  * @param [outsidePressIgnoreRef] - Ref to an element that should not trigger outside press behavior
101
109
  * @param [outsideClosable=true] - Whether clicks outside the overlay should close it
102
110
  * @param [anchorToMouse=false] - Whether to anchor the dropdown to the mouse position
@@ -1,6 +1,9 @@
1
1
  export declare const dropdownBaseClassName: string;
2
2
  export declare const dropdownListBaseClassName: string;
3
3
  export declare const dropdownSubMenuClassName: string;
4
+ export declare const dropdownSubMenuListClassName: string;
5
+ /** The top-level item list: rows 2px apart, inset from the panel edge. */
6
+ export declare const dropdownItemListClassName: string;
4
7
  /**
5
8
  * The row's own styling lives in {@link MenuItem}, which renders every item of
6
9
  * the menu. This alias is what a fully custom overlay row can lean on to match
@@ -0,0 +1,61 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { DialItemType } from '../../../types/item';
3
+ /** Props for `FileIcon`. */
4
+ export interface FileIconProps {
5
+ /** Whether the item is a file or a folder. */
6
+ type: DialItemType;
7
+ /** Item name; a file's extension is read from it unless `fileExtension` is set. */
8
+ name: string;
9
+ /** Extension to pick the glyph by, overriding the one in `name`. With or without a leading dot. */
10
+ fileExtension?: string;
11
+ /** Draws the shared badge in the bottom-left corner. */
12
+ shared?: boolean;
13
+ /** Replaces the glyph with a spinner. */
14
+ loading?: boolean;
15
+ /** Glyph size in px. Defaults to `DIAL_ICON_SIZE.MD` (20). */
16
+ size?: number;
17
+ /** Additional CSS classes for the root element. */
18
+ className?: string;
19
+ /** Hides the icon from assistive technology when the row already names the item. */
20
+ decorative?: boolean;
21
+ /** Accessible name. Defaults to "PDF file", "File" or "Folder", with ", shared" appended when shared. */
22
+ label?: string;
23
+ /** Accessible name of the spinner shown while `loading`. */
24
+ loadingLabel?: string;
25
+ /** Additional CSS classes for the shared badge. */
26
+ sharedIndicatorClassName?: string;
27
+ /** Tooltip shown over the shared badge. */
28
+ sharedIndicatorTooltip?: ReactNode;
29
+ }
30
+ /**
31
+ * The icon of a file or folder row in a file manager: a file-type glyph picked
32
+ * by extension, or a folder, with an optional shared badge and loading state.
33
+ * aliases: FileTypeIcon|EntityIcon
34
+ * Design system 2.0
35
+ *
36
+ * The root is a `role="img"` whose name says what the item is, and that it is
37
+ * shared — the badge itself is drawn inside the image, so its tooltip is a
38
+ * pointer-only hint and never the only place the state is conveyed. While
39
+ * `loading`, the root drops the role and holds a `Spinner`, which announces
40
+ * itself as a status. Pass `decorative` when the row already names the item.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * <FileIcon name="report.pdf" type={DialItemType.File} shared />
45
+ * <FileIcon name="Projects" type={DialItemType.Folder} loading />
46
+ * ```
47
+ *
48
+ * @param type - Whether the item is a file or a folder
49
+ * @param name - Item name; a file's extension is read from it
50
+ * @param [fileExtension] - Extension overriding the one in `name`
51
+ * @param [shared=false] - Draws the shared badge
52
+ * @param [loading=false] - Replaces the glyph with a spinner
53
+ * @param [size=DIAL_ICON_SIZE.MD] - Glyph size in px
54
+ * @param [className] - Additional CSS classes for the root element
55
+ * @param [decorative=false] - Hides the icon from assistive technology
56
+ * @param [label] - Accessible name, overriding the generated one
57
+ * @param [loadingLabel='Loading'] - Accessible name of the spinner
58
+ * @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
59
+ * @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
60
+ */
61
+ export declare const FileIcon: FC<FileIconProps>;
@@ -0,0 +1,16 @@
1
+ /** The kinds of file the 2.0 glyph distinguishes. */
2
+ export declare enum FileGlyphKind {
3
+ Images = "images",
4
+ Video = "video",
5
+ Audio = "audio",
6
+ Code = "code",
7
+ Text = "text",
8
+ Pdf = "pdf",
9
+ Spreadsheet = "spreadsheet",
10
+ Presentation = "presentation",
11
+ Archive = "archive",
12
+ Dial = "dial",
13
+ Other = "other"
14
+ }
15
+ /** The glyph kind for a lower-case extension; anything unknown is `Other`. */
16
+ export declare const getFileGlyphKind: (extension: string) => FileGlyphKind;
@@ -0,0 +1,18 @@
1
+ import { FC } from 'react';
2
+ import { FileGlyphKind } from '../constants';
3
+ interface FileGlyphProps {
4
+ size: number;
5
+ kind: FileGlyphKind;
6
+ }
7
+ /**
8
+ * The 2.0 file glyph: a gradient sheet with the line work of its kind.
9
+ * Design system 2.0
10
+ *
11
+ * Inlined for the same reasons as `FolderGlyph`: a per-instance gradient `id`
12
+ * from `useId`, and theme tokens in place of fixed hex values.
13
+ *
14
+ * @param size - Width and height in px
15
+ * @param kind - Which art to draw
16
+ */
17
+ export declare const FileGlyph: FC<FileGlyphProps>;
18
+ export {};
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ interface FolderGlyphProps {
3
+ size: number;
4
+ }
5
+ /**
6
+ * The 2.0 folder glyph: a blue back tab over a grey-to-blue gradient body.
7
+ * Design system 2.0
8
+ *
9
+ * Inlined rather than imported as an SVG asset for two reasons: the gradient
10
+ * `id` comes from `useId`, so a list of folders does not repeat one document-
11
+ * wide id (a hidden first copy would otherwise blank every other gradient);
12
+ * and the colours resolve from theme tokens instead of fixed hex values.
13
+ *
14
+ * @param size - Width and height in px
15
+ */
16
+ export declare const FolderGlyph: FC<FolderGlyphProps>;
17
+ export {};
@@ -0,0 +1,79 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { DialItemType } from '../../../types/item';
3
+ /** Props for `FileName`. */
4
+ export interface FileNameProps {
5
+ /** Full item name, with or without an extension. */
6
+ name: string;
7
+ /** Whether the item is a file or a folder. Defaults to a file. */
8
+ type?: DialItemType;
9
+ /** Extension to pick the icon by, overriding the one in `name`. */
10
+ fileExtension?: string;
11
+ /** Draws the shared badge on the icon. */
12
+ shared?: boolean;
13
+ /** Replaces the icon with a spinner, which announces itself as a status. */
14
+ loading?: boolean;
15
+ /** Accessible name of the spinner shown while `loading`. */
16
+ loadingLabel?: string;
17
+ /** Icon size in px. Defaults to the `FileIcon` size (20). */
18
+ iconSize?: number;
19
+ /** Metadata under the name (size, date); switches the text to two lines. */
20
+ details?: ReactNode;
21
+ /** Mutes the name, marking it as containing invalid characters. */
22
+ isInvalidName?: boolean;
23
+ /** Additional CSS classes for the root element. */
24
+ className?: string;
25
+ /** Additional CSS classes for the name text. */
26
+ nameClassName?: string;
27
+ /** Additional CSS classes for the shared badge. */
28
+ sharedIndicatorClassName?: string;
29
+ /** Tooltip shown over the shared badge. */
30
+ sharedIndicatorTooltip?: ReactNode;
31
+ /** Screen-reader text announcing the shared state. */
32
+ sharedLabel?: string;
33
+ /** Suppresses the full-name tooltip even while the name is truncated. */
34
+ hideTooltip?: boolean;
35
+ /** Shown instead of the full name while it is truncated. */
36
+ tooltipContent?: ReactNode;
37
+ }
38
+ /**
39
+ * A file or folder name with its type icon, truncated with a tooltip when it
40
+ * does not fit.
41
+ * aliases: FileDisplay|NameDisplay
42
+ * Design system 2.0
43
+ *
44
+ * The visible name already says what the item is, so the icon is decorative;
45
+ * the shared state, which only the badge shows, is announced by a
46
+ * visually-hidden `sharedLabel` after the name instead.
47
+ *
48
+ * While `loading` the icon is swapped for a `Spinner`, which is left in the
49
+ * accessibility tree so the busy state is announced.
50
+ *
51
+ * With `details` the text switches to two lines — the name, then the metadata.
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * <FileName name="Document.pdf" shared />
56
+ * <FileName
57
+ * name="Document.pdf"
58
+ * details={<span className="dial-tiny-text text-secondary">24 KB · Jul 20</span>}
59
+ * />
60
+ * ```
61
+ *
62
+ * @param name - Full item name, with or without an extension
63
+ * @param [type=DialItemType.File] - Whether the item is a file or a folder
64
+ * @param [fileExtension] - Extension overriding the one in `name`
65
+ * @param [shared=false] - Draws the shared badge on the icon
66
+ * @param [loading=false] - Replaces the icon with a spinner
67
+ * @param [loadingLabel='Loading'] - Accessible name of the spinner
68
+ * @param [iconSize] - Icon size in px
69
+ * @param [details] - Metadata under the name
70
+ * @param [isInvalidName=false] - Mutes the name, marking it as invalid
71
+ * @param [className] - Additional CSS classes for the root element
72
+ * @param [nameClassName] - Additional CSS classes for the name text
73
+ * @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
74
+ * @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
75
+ * @param [sharedLabel='Shared'] - Screen-reader text announcing the shared state
76
+ * @param [hideTooltip=false] - Suppresses the full-name tooltip
77
+ * @param [tooltipContent] - Shown instead of the full name while truncated
78
+ */
79
+ export declare const FileName: FC<FileNameProps>;
@@ -0,0 +1,69 @@
1
+ import { ReactNode } from 'react';
2
+ export interface FilterChipItem<T extends string = string> {
3
+ value: T;
4
+ label: string;
5
+ icon?: ReactNode;
6
+ }
7
+ export interface FilterChipsProps<T extends string = string> {
8
+ items: FilterChipItem<T>[];
9
+ value: T;
10
+ onChange: (value: T) => void;
11
+ stretch?: boolean;
12
+ className?: string;
13
+ chipClassName?: string;
14
+ 'aria-label'?: string;
15
+ 'aria-labelledby'?: string;
16
+ }
17
+ /**
18
+ * A row of filter chips that picks one value out of a few.
19
+ * aliases: FilterChipRow|ChipTabs|TagTabs|FilterTabs
20
+ * Design system 2.0
21
+ *
22
+ * The chip-shaped sibling of the kit's other single-select rows, and the one to
23
+ * reach for when the options label a *subset of a list* — "All", "Shared",
24
+ * "Mine" above a history panel. `Tabs` underlines the active option and reads
25
+ * as navigation between panels; `SegmentedControl` sinks equal segments into a
26
+ * track and reads as a view switch. This one draws `TagAppearance.Selectable`
27
+ * chips: no fill until selected, and a semibold label once it is. Selecting a
28
+ * chip therefore widens it by the difference between the regular and semibold
29
+ * label — give the row `stretch`, or the chips a width, if that shift matters.
30
+ *
31
+ * Each chip is a toggle button carrying its state on `aria-pressed`, wrapped in
32
+ * a named `role="group"` — the pattern `Tag` is built for. That makes every
33
+ * chip its own tab stop, which is what a filter row wants: unlike a
34
+ * `radiogroup`, arrowing onto a chip never changes the filter by accident.
35
+ * Name the group through `aria-label` or `aria-labelledby`, or the chips are
36
+ * announced as a handful of unrelated toggles.
37
+ *
38
+ * There is no disabled chip. An option the user must not pick is left out of
39
+ * `items` — a chip that renders but cannot be activated is a label and nothing
40
+ * else, and `Tag` drops its button role when disabled, so it would not even
41
+ * announce as unavailable.
42
+ *
43
+ * Labels are the caller's to translate — the component ships no English
44
+ * defaults.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <FilterChips
49
+ * aria-label={t('Filter chats')}
50
+ * value={tab}
51
+ * onChange={setTab}
52
+ * items={[
53
+ * { value: 'all', label: t('All') },
54
+ * { value: 'mine', label: t('My chats') },
55
+ * { value: 'shared', label: t('Shared') },
56
+ * ]}
57
+ * />
58
+ * ```
59
+ *
60
+ * @param items - Chips to render, in order; each needs a unique `value` and a `label`
61
+ * @param value - The `value` of the selected chip
62
+ * @param onChange - Called with the `value` of the chip the user picked. A click on the already-selected chip fires it again, so a row that clears back to a default handles that itself
63
+ * @param [stretch=false] - Grows the chips to share the row width equally instead of hugging their labels
64
+ * @param [className] - Additional classes for the row, e.g. its padding or `flex-wrap`
65
+ * @param [chipClassName] - Additional classes for every chip. A panel too narrow for the chips' default padding can tighten it here
66
+ * @param [aria-label] - Names the row as a whole
67
+ * @param [aria-labelledby] - Names the row from an existing element, e.g. a visible heading
68
+ */
69
+ export declare const FilterChips: <T extends string = string>({ items, value, onChange, stretch, className, chipClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: FilterChipsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The chip row itself. It does not wrap by default: a filter row is usually one
3
+ * line of a narrow panel, and a caller that wants it to wrap passes
4
+ * `flex-wrap` through `className`.
5
+ */
6
+ export declare const containerClassName = "flex flex-nowrap items-center gap-1";
7
+ /**
8
+ * `stretch` layout: the chips share the row width equally but never shrink
9
+ * below their label, so a row too narrow for all of them overflows rather than
10
+ * truncating every chip. `Tag` is already `rounded-full` and `inline-flex`, so
11
+ * only the growth and the centring are added here.
12
+ */
13
+ export declare const chipStretchClassName = "min-w-max flex-1 justify-center";
@@ -0,0 +1,37 @@
1
+ import { FC } from 'react';
2
+ import { FileNameProps } from '../FileName/FileName';
3
+ /** Props for `FolderName`. */
4
+ export type FolderNameProps = Omit<FileNameProps, 'type' | 'fileExtension'>;
5
+ /**
6
+ * A folder name with the folder icon, truncated with a tooltip when it does
7
+ * not fit.
8
+ * aliases: FolderDisplay|DirectoryName
9
+ * Design system 2.0
10
+ *
11
+ * A `FileName` fixed to `DialItemType.Folder`, so it shares every behaviour of
12
+ * it — decorative icon, visually-hidden shared label, `details` line and the
13
+ * `loading` spinner. Its root carries `dial-kit-folder-name` on top of
14
+ * `dial-kit-file-name`.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <FolderName name="Organization" shared />
19
+ * <FolderName name="Uploads" loading />
20
+ * ```
21
+ *
22
+ * @param name - Folder name
23
+ * @param [shared=false] - Draws the shared badge on the icon
24
+ * @param [loading=false] - Replaces the icon with a spinner
25
+ * @param [loadingLabel='Loading'] - Accessible name of the spinner
26
+ * @param [iconSize] - Icon size in px
27
+ * @param [details] - Metadata under the name
28
+ * @param [isInvalidName=false] - Mutes the name, marking it as invalid
29
+ * @param [className] - Additional CSS classes for the root element
30
+ * @param [nameClassName] - Additional CSS classes for the name text
31
+ * @param [sharedIndicatorClassName] - Additional CSS classes for the shared badge
32
+ * @param [sharedIndicatorTooltip='Shared'] - Tooltip shown over the shared badge
33
+ * @param [sharedLabel='Shared'] - Screen-reader text announcing the shared state
34
+ * @param [hideTooltip=false] - Suppresses the full-name tooltip
35
+ * @param [tooltipContent] - Shown instead of the full name while truncated
36
+ */
37
+ export declare const FolderName: FC<FolderNameProps>;
@@ -10,9 +10,10 @@ export declare const INTERACTIVE_TOOLTIP_GAP = 8;
10
10
  */
11
11
  export declare const INTERACTIVE_TOOLTIP_HOVER_OPEN_DELAY = 400;
12
12
  /**
13
- * The panel sits above the surface it is anchored to — a dropdown or select
14
- * overlay, both `z-[53]` — since it can be opened from a row inside one of
15
- * them.
13
+ * The panel sits one step of the overlay ladder (`z-interactive-tooltip`, see
14
+ * `zIndex` in `tailwind.config.js`) above the surface it is anchored to — a
15
+ * dropdown or select overlay, both `z-floating` — since it can be opened from
16
+ * a row inside one of them.
16
17
  *
17
18
  * By style this is a neutral floating panel rather than the coloured
18
19
  * `Notification` banner: it shares the raised-card shape a dropdown or the
@@ -23,4 +24,4 @@ export declare const INTERACTIVE_TOOLTIP_HOVER_OPEN_DELAY = 400;
23
24
  * Padding and width are the panel's own, sized for a block of copy and
24
25
  * controls rather than a menu row.
25
26
  */
26
- export declare const interactiveTooltipClassName = "z-[54] max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md";
27
+ export declare const interactiveTooltipClassName = "z-interactive-tooltip max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md";
@@ -5,6 +5,7 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
5
5
  type?: NotificationType;
6
6
  title?: ReactNode;
7
7
  message: ReactNode;
8
+ action?: ReactNode;
8
9
  closable?: boolean;
9
10
  iconSize?: number;
10
11
  iconStroke?: number;
@@ -57,12 +58,29 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
57
58
  * title="Title"
58
59
  * message="Description text example"
59
60
  * />
61
+ *
62
+ * <Notification
63
+ * variant={NotificationVariant.Error}
64
+ * type={NotificationType.SectionMessage}
65
+ * title="Couldn't finish this response"
66
+ * message="Something went wrong. Try again in a moment."
67
+ * action={
68
+ * <Button
69
+ * variant={ButtonVariant.Neutral}
70
+ * appearance={ButtonAppearance.Outlined}
71
+ * size={ElementSize.Small}
72
+ * label="Try again"
73
+ * onClick={handleRetry}
74
+ * />
75
+ * }
76
+ * />
60
77
  * ```
61
78
  *
62
79
  * @param [variant=NotificationVariant.Info] - Defines the visual style and icon of the alert
63
80
  * @param [type=NotificationType.Toast] - Defines the type of notification, either a toast or a section message
64
81
  * @param [title] - Optional heading displayed above the message in semibold
65
82
  * @param message - Message text to display inside the alert
83
+ * @param [action] - Optional control (typically a small `Button`) rendered at the inline end, after the text and before the close button; the caller supplies its accessible name
66
84
  * @param [className] - Additional CSS classes applied to the alert container
67
85
  * @param [textClassName] - Additional CSS classes applied to the message text
68
86
  * @param [closable=false] - Whether the alert has a close button