@epam/ai-dial-ui-kit 0.15.0-dev.30 → 0.15.0-dev.35

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 (31) hide show
  1. package/README.md +4 -0
  2. package/dist/CHANGELOG.md +8 -0
  3. package/dist/{DateCellRenderer-J1V3xwF7.cjs → DateCellRenderer-DABG5c2F.cjs} +1 -1
  4. package/dist/{DateCellRenderer-BFEh4rXZ.cjs → DateCellRenderer-DB9p0E9c.cjs} +27 -27
  5. package/dist/components/New/Avatar/Avatar.js +70 -0
  6. package/dist/components/New/Badge/Badge.js +45 -0
  7. package/dist/components/New/BottomSheet/BottomSheet.js +114 -0
  8. package/dist/components/New/SideDrawer/SideDrawer.js +144 -0
  9. package/dist/components/New/TagInput/TagInput.js +3 -1
  10. package/dist/components-manifest.json +421 -3
  11. package/dist/constants/public-class-names.js +8 -0
  12. package/dist/dial-ui-kit.cjs +2 -2
  13. package/dist/dial-ui-kit.js +149 -134
  14. package/dist/file-manager.cjs +1 -1
  15. package/dist/grid.cjs +1 -1
  16. package/dist/index.css +2 -2
  17. package/dist/src/components/New/Avatar/Avatar.d.ts +55 -0
  18. package/dist/src/components/New/Badge/Badge.d.ts +47 -0
  19. package/dist/src/components/New/BottomSheet/BottomSheet.d.ts +72 -0
  20. package/dist/src/components/New/SideDrawer/SideDrawer.d.ts +91 -0
  21. package/dist/src/constants/public-class-names.d.ts +8 -0
  22. package/dist/src/index.d.ts +11 -0
  23. package/dist/src/types/avatar.d.ts +7 -0
  24. package/dist/src/types/badge.d.ts +16 -0
  25. package/dist/src/utils/__tests__/avatar.spec.d.ts +1 -0
  26. package/dist/src/utils/avatar.d.ts +12 -0
  27. package/dist/types/avatar.js +4 -0
  28. package/dist/types/badge.js +5 -0
  29. package/dist/{use-file-manager-tabs-C0h1Sq5T.cjs → use-file-manager-tabs-BJP7po3N.cjs} +1 -1
  30. package/dist/utils/avatar.js +22 -0
  31. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ import { FC, ReactNode } from 'react';
2
+ /** Props for `SideDrawer`. */
3
+ export interface SideDrawerProps {
4
+ /** Whether the drawer is open. */
5
+ open: boolean;
6
+ /** Called when the drawer asks to close: the close button, Escape, or a press on the backdrop. */
7
+ onClose: () => void;
8
+ /** Header title. A string also names the dialog; a node needs `ariaLabel`. */
9
+ header?: ReactNode;
10
+ /** Accessible name of the drawer when `header` is not a string. */
11
+ ariaLabel?: string;
12
+ /** Controls placed in the header between the title and the close button. */
13
+ headerActions?: ReactNode;
14
+ /** Shows a back button at the start of the header when set. */
15
+ onBack?: () => void;
16
+ /** Accessible name of the back button. */
17
+ backAriaLabel?: string;
18
+ /** Whether the back button is disabled. */
19
+ backDisabled?: boolean;
20
+ /** Accessible name of the close button. */
21
+ closeAriaLabel?: string;
22
+ /** Whether the close button is disabled, e.g. while a submission is in flight. */
23
+ closeDisabled?: boolean;
24
+ /** Whether the header's close button is left out. */
25
+ hideClose?: boolean;
26
+ /** Whether a press on the backdrop closes the drawer. */
27
+ closeOnOutsideClick?: boolean;
28
+ /** Content of the drawer, scrolled when it is taller than the viewport. */
29
+ children?: ReactNode;
30
+ /** Additional CSS classes for the drawer panel, e.g. a different desktop width. */
31
+ className?: string;
32
+ /** Additional CSS classes for the backdrop. */
33
+ overlayClassName?: string;
34
+ /** Additional CSS classes for the header row. */
35
+ headerClassName?: string;
36
+ /** Additional CSS classes for the scrolling body. */
37
+ bodyClassName?: string;
38
+ /** Type-scale class for a string title, replacing its own. */
39
+ titleClassName?: string;
40
+ /** Id of the element to portal into, instead of the end of `<body>`. */
41
+ portalId?: string;
42
+ }
43
+ /**
44
+ * A full-height panel that slides in from the inline end over a dimmed page.
45
+ * aliases: Drawer|SidePanel|SideSheet|DetailsPanel
46
+ * Design system 2.0
47
+ *
48
+ * It is a modal dialog while open: focus moves to the panel and stays inside,
49
+ * returns to where it came from on close, and the page behind it does not
50
+ * scroll. Escape, the close button and a press on the backdrop all call
51
+ * `onClose`; the drawer stays controlled by `open`.
52
+ *
53
+ * The panel stays mounted while closed, so it can slide out as well as in and
54
+ * keep the state of whatever it holds. Closed, it is `inert` — out of both
55
+ * the tab order and the accessibility tree — and the backdrop lets pointer
56
+ * events through. On desktop the drawer is 540px wide with a rounded,
57
+ * bordered leading edge; on mobile it takes the full width. It slides from
58
+ * the end in either direction, and not at all under `prefers-reduced-motion`.
59
+ *
60
+ * The header follows `Popup`: an optional back button, the title,
61
+ * `headerActions`, and the close button. A string `header` renders an `<h2>`
62
+ * that names the dialog; for a node, pass `ariaLabel`.
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * <SideDrawer open={isOpen} header="Publish" onClose={() => setIsOpen(false)}>
67
+ * <PublishForm />
68
+ * </SideDrawer>
69
+ * ```
70
+ *
71
+ * @param open - Whether the drawer is open
72
+ * @param onClose - Called when the drawer asks to close
73
+ * @param [header] - Header title; a string also names the dialog
74
+ * @param [ariaLabel] - Accessible name when `header` is not a string
75
+ * @param [headerActions] - Controls between the title and the close button
76
+ * @param [onBack] - Shows a back button at the start of the header
77
+ * @param [backAriaLabel='Back'] - Accessible name of the back button
78
+ * @param [backDisabled=false] - Whether the back button is disabled
79
+ * @param [closeAriaLabel='Close'] - Accessible name of the close button
80
+ * @param [closeDisabled=false] - Whether the close button is disabled
81
+ * @param [hideClose=false] - Whether the close button is left out
82
+ * @param [closeOnOutsideClick=true] - Whether a press on the backdrop closes the drawer
83
+ * @param [children] - Content of the drawer
84
+ * @param [className] - Additional CSS classes for the drawer panel
85
+ * @param [overlayClassName] - Additional CSS classes for the backdrop
86
+ * @param [headerClassName] - Additional CSS classes for the header row
87
+ * @param [bodyClassName] - Additional CSS classes for the scrolling body
88
+ * @param [titleClassName] - Type-scale class for a string title
89
+ * @param [portalId] - Id of the element to portal into
90
+ */
91
+ export declare const SideDrawer: FC<SideDrawerProps>;
@@ -41,6 +41,10 @@ export declare const DIAL_KIT_CLASS: {
41
41
  * `overlayClassName`.
42
42
  */
43
43
  readonly popup: "dial-kit-popup";
44
+ /** The `role="dialog"` panel of a `BottomSheet`. */
45
+ readonly bottomSheet: "dial-kit-bottom-sheet";
46
+ /** The `role="dialog"` panel of a `SideDrawer`, open or closed. */
47
+ readonly sideDrawer: "dial-kit-side-drawer";
44
48
  /** The `Popup` panel of a `ConfirmationPopup`, additive to `popup`. */
45
49
  readonly confirmationPopup: "dial-kit-confirmation-popup";
46
50
  /** The root of an `Accordion`. */
@@ -121,6 +125,10 @@ export declare const DIAL_KIT_CLASS: {
121
125
  * shared badge a `FileIcon` draws over its glyph.
122
126
  */
123
127
  readonly sharedEntityIndicator: "dial-kit-shared-entity-indicator";
128
+ /** The root of a `Badge`: the label box, with its icon when it has one. */
129
+ readonly badge: "dial-kit-badge";
130
+ /** The root of an `Avatar`: the image, or the initials box that replaces it. */
131
+ readonly avatar: "dial-kit-avatar";
124
132
  /** The row of a `Switch`: the control and its label. */
125
133
  readonly switch: "dial-kit-switch";
126
134
  /** The row of a `Checkbox`: the box and its label. */
@@ -240,6 +240,17 @@ export { FolderName } from './components/New/FolderName/FolderName';
240
240
  export type { FolderNameProps } from './components/New/FolderName/FolderName';
241
241
  export { SharedEntityIndicator } from './components/New/SharedEntityIndicator/SharedEntityIndicator';
242
242
  export type { SharedEntityIndicatorProps } from './components/New/SharedEntityIndicator/SharedEntityIndicator';
243
+ export { BottomSheet } from './components/New/BottomSheet/BottomSheet';
244
+ export type { BottomSheetProps } from './components/New/BottomSheet/BottomSheet';
245
+ export { Badge } from './components/New/Badge/Badge';
246
+ export type { BadgeProps } from './components/New/Badge/Badge';
247
+ export { BadgeColor, BadgeVariant } from './types/badge';
248
+ export { Avatar } from './components/New/Avatar/Avatar';
249
+ export type { AvatarProps } from './components/New/Avatar/Avatar';
250
+ export { AvatarShape } from './types/avatar';
251
+ export { extractInitials } from './utils/avatar';
252
+ export { SideDrawer } from './components/New/SideDrawer/SideDrawer';
253
+ export type { SideDrawerProps } from './components/New/SideDrawer/SideDrawer';
243
254
  export { Tag } from './components/New/Tag/Tag';
244
255
  export type { TagProps } from './components/New/Tag/Tag';
245
256
  export { TagAppearance } from './types/tag';
@@ -0,0 +1,7 @@
1
+ /** The outline an `Avatar` is clipped to. */
2
+ export declare enum AvatarShape {
3
+ /** A circle — the avatar of a person. */
4
+ Circle = "circle",
5
+ /** A rounded square — the avatar of an application, model or other entity. */
6
+ Square = "square"
7
+ }
@@ -0,0 +1,16 @@
1
+ /** How a `Badge` is drawn. */
2
+ export declare enum BadgeVariant {
3
+ /** A neutral label with a border on the sunken layer, for topics and plain categories. */
4
+ Outlined = "outlined",
5
+ /** A pill filled with one of the visual colours, for a label that is told apart by colour. */
6
+ Filled = "filled"
7
+ }
8
+ /** The visual colour of a `BadgeVariant.Filled` badge. */
9
+ export declare enum BadgeColor {
10
+ Blue = "blue",
11
+ Green = "green",
12
+ Violet = "violet",
13
+ Indigo = "indigo",
14
+ Brown = "brown",
15
+ Red = "red"
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /** A background and text colour pair for an initials avatar, as Tailwind classes. */
2
+ export interface AvatarColorClasses {
3
+ /** Background class, bound to a `--bg-visual-*` token. */
4
+ background: string;
5
+ /** Text class, bound to the matching `--text-visual-*` token. */
6
+ foreground: string;
7
+ }
8
+ export declare const AVATAR_PALETTE: readonly AvatarColorClasses[];
9
+ /** Returns the palette entry for a name; the same name always gets the same colours. */
10
+ export declare const pickAvatarColor: (name: string) => AvatarColorClasses;
11
+ /** Returns 1–2 uppercase initials derived from a display name, or `'?'` when it has no letters. */
12
+ export declare const extractInitials: (name: string) => string;
@@ -0,0 +1,4 @@
1
+ var e = /* @__PURE__ */ ((r) => (r.Circle = "circle", r.Square = "square", r))(e || {});
2
+ export {
3
+ e as AvatarShape
4
+ };
@@ -0,0 +1,5 @@
1
+ var n = /* @__PURE__ */ ((e) => (e.Outlined = "outlined", e.Filled = "filled", e))(n || {}), i = /* @__PURE__ */ ((e) => (e.Blue = "blue", e.Green = "green", e.Violet = "violet", e.Indigo = "indigo", e.Brown = "brown", e.Red = "red", e))(i || {});
2
+ export {
3
+ i as BadgeColor,
4
+ n as BadgeVariant
5
+ };