@aleph-alpha/ui-library 6.4.0 → 6.5.0

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.
@@ -1,8 +1,10 @@
1
- import { UiFileItemProps } from './types';
1
+ import { UiFileItemGroupItem, UiFileItemProps } from './types';
2
2
  declare const _default: import('vue').DefineComponent<UiFileItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
3
  remove: () => any;
4
+ removeItem: (item: UiFileItemGroupItem) => any;
4
5
  }, string, import('vue').PublicProps, Readonly<UiFileItemProps> & Readonly<{
5
6
  onRemove?: (() => any) | undefined;
7
+ onRemoveItem?: ((item: UiFileItemGroupItem) => any) | undefined;
6
8
  }>, {
7
9
  disabled: boolean;
8
10
  size: import('./types').UiFileItemSize;
@@ -12,9 +14,16 @@ declare const _default: import('vue').DefineComponent<UiFileItemProps, {}, {}, {
12
14
  removeLabel: string;
13
15
  typeLabel: string;
14
16
  sizeLabel: string;
17
+ processing: boolean;
18
+ processingLabel: string;
15
19
  progressLabel: string;
16
20
  mediaTone: import('./types').UiFileItemMediaTone;
17
21
  mediaIcon: string;
22
+ items: UiFileItemGroupItem[];
23
+ expandLabel: string;
24
+ listLabel: string;
25
+ popoverSide: import('../UiPopover').UiPopoverSide;
26
+ popoverAlign: import('../UiPopover').UiPopoverAlign;
18
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
19
28
  titleRef: HTMLSpanElement;
20
29
  }, HTMLDivElement>;
@@ -1,2 +1,2 @@
1
1
  export { default as UiFileItem } from './UiFileItem.vue';
2
- export type { UiFileItemMediaTone, UiFileItemProps, UiFileItemSize, } from './types';
2
+ export type { UiFileItemGroupItem, UiFileItemMediaTone, UiFileItemProps, UiFileItemSize, } from './types';
@@ -1,10 +1,12 @@
1
1
  import { UiFileTypeTone } from '../UiFileType';
2
+ import { UiPopoverAlign, UiPopoverSide } from '../UiPopover';
2
3
  /**
3
- * Row showing a selected or uploading file with optional progress and errors.
4
+ * Row showing a selected, uploading, or processing file, with an optional
5
+ * multi-file disclosure.
4
6
  * @category Form Inputs
5
- * @useCases file upload list, attachment row
6
- * @keywords file, upload, attachment, progress, success, error
7
- * @related UiFileUploadBox, UiItem, UiButton, UiProgress
7
+ * @useCases file upload list, attachment row, grouped attachments
8
+ * @keywords file, upload, attachment, progress, processing, success, error, multi
9
+ * @related UiFileUploadBox, UiFileType, UiPopover, UiButton, UiProgress
8
10
  */
9
11
  export type UiFileItemSize = 'default' | 'small';
10
12
  /**
@@ -13,10 +15,46 @@ export type UiFileItemSize = 'default' | 'small';
13
15
  * extension when omitted; see `UiFileType` for the mapping.
14
16
  */
15
17
  export type UiFileItemMediaTone = UiFileTypeTone;
18
+ /**
19
+ * One file inside a multi-file popover. Icons come from the filename
20
+ * extension via `UiFileType` (text, markdown, tabular, media) unless
21
+ * `mediaTone` / `mediaIcon` override them.
22
+ */
23
+ export interface UiFileItemGroupItem {
24
+ /** Stable id. Used as the list key; falls back to the filename. */
25
+ id?: string;
26
+ /** Full file name. The trailing extension is hidden from the title. */
27
+ filename: string;
28
+ /** Short type label, e.g. `PDF`. */
29
+ typeLabel?: string;
30
+ /** Size label, e.g. `1.2 MB`. Shown in the success state. */
31
+ sizeLabel?: string;
32
+ /** Upload progress 0–100. Values `< 100` show a progress bar. */
33
+ progress?: number | null;
34
+ /** Error message. When non-empty, the row enters the error state. */
35
+ error?: string | null;
36
+ /**
37
+ * When `true`, the row shows `typeLabel | processingLabel` instead of a
38
+ * progress bar or the file size.
39
+ */
40
+ processing?: boolean;
41
+ /** Visible processing status. Also announced in the status region. */
42
+ processingLabel?: string;
43
+ /** When `false`, the nested row has no remove control. */
44
+ removable?: boolean;
45
+ /** When `true`, the nested row is inert. */
46
+ disabled?: boolean;
47
+ /** Accessible label for the nested remove control. */
48
+ removeLabel?: string;
49
+ /** Media badge tone. Auto-derived from the extension when omitted. */
50
+ mediaTone?: UiFileItemMediaTone;
51
+ /** Lucide icon name for the media badge. Auto-derived when omitted. */
52
+ mediaIcon?: string;
53
+ }
16
54
  export interface UiFileItemProps {
17
55
  /** Full file name. The trailing extension is hidden from the title. */
18
56
  filename: string;
19
- /** Short type label, e.g. `PDF`. Shown only in the success state. */
57
+ /** Short type label, e.g. `PDF`. Shown in the success and processing states. */
20
58
  typeLabel?: string;
21
59
  /** Size label, e.g. `1.2 MB`. Shown only in the success state. */
22
60
  sizeLabel?: string;
@@ -24,6 +62,18 @@ export interface UiFileItemProps {
24
62
  progress?: number | null;
25
63
  /** Error message. When non-empty, the row enters the error state. */
26
64
  error?: string | null;
65
+ /**
66
+ * When `true`, the row is processing: a neutral file badge and
67
+ * `typeLabel | processingLabel`, with no progress bar.
68
+ * @default false
69
+ */
70
+ processing?: boolean;
71
+ /**
72
+ * Visible processing status, e.g. `Processing…`. Announced with the
73
+ * filename from a `status` region so it can be translated.
74
+ * @default 'Processing…'
75
+ */
76
+ processingLabel?: string;
27
77
  /** Accessible label for the remove control. */
28
78
  removeLabel?: string;
29
79
  /** Accessible label for the progress bar (i18n hook). Defaults to the `filename`. */
@@ -44,4 +94,30 @@ export interface UiFileItemProps {
44
94
  mediaTone?: UiFileItemMediaTone;
45
95
  /** Lucide icon name for the media badge. Auto-derived when omitted. */
46
96
  mediaIcon?: string;
97
+ /**
98
+ * Files revealed by the chevron. When the list has entries, the row is the
99
+ * multi variant: a chevron button opens a popover of single file rows.
100
+ * Each entry keeps the icon for its own file type.
101
+ */
102
+ items?: UiFileItemGroupItem[];
103
+ /**
104
+ * Accessible name for the chevron that opens the file list.
105
+ * @default 'Show files'
106
+ */
107
+ expandLabel?: string;
108
+ /**
109
+ * Accessible name for the list inside the popover.
110
+ * @default 'Attached files'
111
+ */
112
+ listLabel?: string;
113
+ /**
114
+ * Which side of the row the file list opens on.
115
+ * @default 'bottom'
116
+ */
117
+ popoverSide?: UiPopoverSide;
118
+ /**
119
+ * Alignment of the file list against the row.
120
+ * @default 'center'
121
+ */
122
+ popoverAlign?: UiPopoverAlign;
47
123
  }
@@ -16,6 +16,7 @@ declare const __VLS_component: import('vue').DefineComponent<UiPopoverContentPro
16
16
  side: import('./types').UiPopoverSide;
17
17
  sideOffset: number;
18
18
  align: import('./types').UiPopoverAlign;
19
+ compact: boolean;
19
20
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
22
  export default _default;
@@ -77,6 +77,12 @@ export interface UiPopoverContentProps {
77
77
  * @default 'center'
78
78
  */
79
79
  align?: UiPopoverAlign;
80
+ /**
81
+ * Tighter padding (`p-2`) and a larger radius, for dense content such as
82
+ * lists or menus inside the panel.
83
+ * @default false
84
+ */
85
+ compact?: boolean;
80
86
  }
81
87
  /**
82
88
  * Emits for the UiPopoverContent component.
@@ -2,6 +2,7 @@ import { PopoverContentProps } from 'reka-ui';
2
2
  import { HTMLAttributes } from 'vue';
3
3
  type __VLS_Props = PopoverContentProps & {
4
4
  class?: HTMLAttributes['class'];
5
+ compact?: boolean;
5
6
  };
6
7
  declare function __VLS_template(): {
7
8
  attrs: Partial<{}>;