@aleph-alpha/ui-library 6.4.0 → 6.6.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.
Files changed (188) hide show
  1. package/dist/system/components/UiFileItem/UiFileItem.vue.d.ts +10 -1
  2. package/dist/system/components/UiFileItem/index.d.ts +1 -1
  3. package/dist/system/components/UiFileItem/types.d.ts +81 -5
  4. package/dist/system/components/UiPopover/UiPopoverContent.vue.d.ts +1 -0
  5. package/dist/system/components/UiPopover/types.d.ts +6 -0
  6. package/dist/system/components/core/popover/PopoverContent.vue.d.ts +1 -0
  7. package/dist/system/components/core/toggle/index.d.ts +1 -1
  8. package/dist/system/lib.js +12336 -12055
  9. package/dist/system/patterns/UiFloatActions/UiFloatActionItems.vue.d.ts +21 -174
  10. package/dist/system/patterns/UiFloatActions/core/FloatingButton.vue.d.ts +36 -0
  11. package/dist/system/patterns/UiFloatActions/core/FloatingInput.vue.d.ts +19 -0
  12. package/dist/system/patterns/UiFloatActions/floatActionItemContext.d.ts +3 -1
  13. package/dist/system/patterns/UiFloatActions/types.d.ts +93 -19
  14. package/dist/system/patterns/UiLayout/layout-shell.d.ts +117 -252
  15. package/package.json +2 -2
  16. package/src/components/UiAccordion/UiAccordion.stories.ts +8 -8
  17. package/src/components/UiAlert/UiAlert.stories.ts +13 -13
  18. package/src/components/UiAlertDialog/UiAlertDialog.stories.ts +4 -4
  19. package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +13 -13
  20. package/src/components/UiAutocomplete/UiAutocomplete.vue +3 -3
  21. package/src/components/UiBadge/UiBadge.stories.ts +9 -9
  22. package/src/components/UiBreadcrumb/UiBreadcrumb.stories.ts +14 -14
  23. package/src/components/UiButton/UiButton.stories.ts +35 -35
  24. package/src/components/UiButtonGroup/UiButtonGroup.stories.ts +6 -6
  25. package/src/components/UiCalendar/UiCalendar.stories.ts +6 -6
  26. package/src/components/UiCard/UiCard.stories.ts +6 -6
  27. package/src/components/UiCheckbox/UiCheckbox.stories.ts +30 -30
  28. package/src/components/UiChip/UiChip.stories.ts +14 -14
  29. package/src/components/UiChip/UiChip.vue +1 -1
  30. package/src/components/UiDialog/UiDialog.stories.ts +20 -20
  31. package/src/components/UiDrawer/UiDrawer.stories.ts +29 -29
  32. package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +13 -13
  33. package/src/components/UiEmpty/UiEmpty.vue +1 -1
  34. package/src/components/UiFadeMask/UiFadeMask.stories.ts +13 -13
  35. package/src/components/UiField/UiField.stories.ts +27 -27
  36. package/src/components/UiFileItem/UiFileItem.vue +114 -9
  37. package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +54 -2
  38. package/src/components/UiFileItem/index.ts +1 -0
  39. package/src/components/UiFileItem/types.ts +82 -5
  40. package/src/components/UiFileType/UiFileType.stories.ts +10 -10
  41. package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +10 -10
  42. package/src/components/UiFileUploadBox/UiFileUploadBox.vue +3 -3
  43. package/src/components/UiIcon/UiIcon.stories.ts +9 -9
  44. package/src/components/UiInput/UiInput.stories.ts +13 -13
  45. package/src/components/UiInput/UiInput.vue +1 -1
  46. package/src/components/UiInputGroup/UiInputGroup.stories.ts +10 -10
  47. package/src/components/UiItem/UiItem.stories.ts +12 -12
  48. package/src/components/UiItem/__tests__/UiItem.test.ts +2 -2
  49. package/src/components/UiKbd/UiKbd.stories.ts +18 -18
  50. package/src/components/UiKbd/UiKbd.vue +1 -1
  51. package/src/components/UiLabel/UiLabel.stories.ts +12 -12
  52. package/src/components/UiLabel/__tests__/UiLabel.test.ts +1 -1
  53. package/src/components/UiListbox/UiListbox.stories.ts +20 -20
  54. package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +94 -94
  55. package/src/components/UiPopover/UiPopover.stories.ts +168 -27
  56. package/src/components/UiPopover/UiPopoverContent.vue +2 -0
  57. package/src/components/UiPopover/__tests__/UiPopover.test.ts +48 -0
  58. package/src/components/UiPopover/types.ts +7 -0
  59. package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +53 -53
  60. package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +6 -6
  61. package/src/components/UiResizable/UiResizable.stories.ts +40 -40
  62. package/src/components/UiSelect/UiSelect.stories.ts +14 -14
  63. package/src/components/UiSeparator/UiSeparator.stories.ts +16 -16
  64. package/src/components/UiSheet/UiSheet.stories.ts +29 -29
  65. package/src/components/UiSlider/UiSlider.stories.ts +28 -28
  66. package/src/components/UiSnackbar/UiSnackbar.stories.ts +6 -6
  67. package/src/components/UiSnackbar/UiSnackbar.vue +2 -2
  68. package/src/components/UiSnackbar/UiSnackbarContent.vue +2 -2
  69. package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
  70. package/src/components/UiStepper/UiStepper.stories.ts +6 -6
  71. package/src/components/UiSwitch/UiSwitch.stories.ts +37 -37
  72. package/src/components/UiTable/UiTable.stories.ts +4 -4
  73. package/src/components/UiTabs/UiTabs.stories.ts +64 -64
  74. package/src/components/UiTagsInput/UiTagsInput.stories.ts +16 -16
  75. package/src/components/UiTextarea/UiTextarea.stories.ts +20 -20
  76. package/src/components/UiToggle/UiToggle.stories.ts +26 -26
  77. package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +31 -31
  78. package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
  79. package/src/components/core/accordion/AccordionContent.vue +1 -1
  80. package/src/components/core/accordion/AccordionTrigger.vue +1 -1
  81. package/src/components/core/alert/AlertDescription.vue +1 -1
  82. package/src/components/core/alert/index.ts +1 -1
  83. package/src/components/core/alert-dialog/AlertDialogDescription.vue +1 -1
  84. package/src/components/core/badge/index.ts +2 -2
  85. package/src/components/core/button/index.ts +3 -3
  86. package/src/components/core/calendar/Calendar.vue +4 -4
  87. package/src/components/core/calendar/CalendarCell.vue +1 -1
  88. package/src/components/core/calendar/CalendarHeading.vue +1 -1
  89. package/src/components/core/card/CardDescription.vue +1 -1
  90. package/src/components/core/dialog/DialogDescription.vue +1 -1
  91. package/src/components/core/drawer/DrawerDescription.vue +1 -1
  92. package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  93. package/src/components/core/dropdown-menu/DropdownMenuLabel.vue +1 -1
  94. package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
  95. package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +1 -1
  96. package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  97. package/src/components/core/field/FieldDescription.vue +1 -1
  98. package/src/components/core/field/FieldError.vue +1 -1
  99. package/src/components/core/field/FieldLabel.vue +1 -1
  100. package/src/components/core/field/FieldLegend.vue +2 -2
  101. package/src/components/core/field/FieldSeparator.vue +1 -1
  102. package/src/components/core/field/FieldTitle.vue +1 -1
  103. package/src/components/core/input/Input.vue +1 -1
  104. package/src/components/core/input-group/InputGroupText.vue +1 -1
  105. package/src/components/core/input-group/index.ts +1 -1
  106. package/src/components/core/item/ItemDescription.vue +1 -1
  107. package/src/components/core/item/ItemTitle.vue +1 -1
  108. package/src/components/core/item/index.ts +2 -2
  109. package/src/components/core/label/Label.vue +1 -1
  110. package/src/components/core/listbox/ListboxFilter.vue +1 -1
  111. package/src/components/core/listbox/ListboxGroupLabel.vue +1 -1
  112. package/src/components/core/listbox/ListboxItem.vue +1 -1
  113. package/src/components/core/native-select/NativeSelect.vue +1 -1
  114. package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
  115. package/src/components/core/navigation-menu/index.ts +1 -1
  116. package/src/components/core/popover/PopoverContent.vue +9 -3
  117. package/src/components/core/range-calendar/RangeCalendarCell.vue +1 -1
  118. package/src/components/core/range-calendar/RangeCalendarHeading.vue +1 -1
  119. package/src/components/core/select/SelectItem.vue +1 -1
  120. package/src/components/core/select/SelectLabel.vue +1 -1
  121. package/src/components/core/select/SelectTrigger.vue +1 -1
  122. package/src/components/core/sheet/SheetDescription.vue +1 -1
  123. package/src/components/core/sidebar/SidebarGroupContent.vue +1 -1
  124. package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
  125. package/src/components/core/sidebar/SidebarMenuBadge.vue +1 -1
  126. package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
  127. package/src/components/core/sidebar/index.ts +4 -4
  128. package/src/components/core/stepper/StepperDescription.vue +1 -1
  129. package/src/components/core/stepper/StepperTitle.vue +1 -1
  130. package/src/components/core/table/Table.vue +1 -1
  131. package/src/components/core/table/TableCaption.vue +1 -1
  132. package/src/components/core/table/TableEmpty.vue +1 -1
  133. package/src/components/core/tabs/TabsTrigger.vue +1 -1
  134. package/src/components/core/tags-input/TagsInput.vue +1 -1
  135. package/src/components/core/tags-input/TagsInputItem.vue +1 -1
  136. package/src/components/core/textarea/Textarea.vue +1 -1
  137. package/src/components/core/toggle/index.ts +1 -1
  138. package/src/components/core/tooltip/TooltipContent.vue +1 -1
  139. package/src/directives/vHover.stories.ts +17 -17
  140. package/src/lib/useDevice.stories.ts +29 -29
  141. package/src/lib/useDrag.stories.ts +14 -14
  142. package/src/patterns/UiDataTable/UiDataTable.stories.ts +27 -27
  143. package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +2 -2
  144. package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +2 -2
  145. package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
  146. package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +2 -2
  147. package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +14 -14
  148. package/src/patterns/UiFileUpload/UiFileItem.stories.ts +818 -32
  149. package/src/patterns/UiFileUpload/UiFileUpload.stories.ts +194 -12
  150. package/src/patterns/UiFloatActions/UiFloatActionItems.vue +226 -76
  151. package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +1136 -116
  152. package/src/patterns/UiFloatActions/__tests__/UiFloatActionItems.test.ts +187 -1
  153. package/src/patterns/UiFloatActions/core/FloatingButton.vue +83 -0
  154. package/src/patterns/UiFloatActions/core/FloatingInput.vue +53 -0
  155. package/src/patterns/UiFloatActions/floatActionItemContext.ts +3 -1
  156. package/src/patterns/UiFloatActions/types.ts +106 -19
  157. package/src/patterns/UiLayout/UiLayoutContent.stories.ts +17 -17
  158. package/src/patterns/UiLayout/UiLayoutMobile.stories.ts +4 -4
  159. package/src/patterns/UiLayout/layout-shell.ts +6 -6
  160. package/src/patterns/UiProfileCard/UiProfileCard.stories.ts +8 -8
  161. package/src/patterns/UiProfileCard/profile-card.ts +2 -2
  162. package/src/patterns/UiSidebar/UiSidebar.stories.ts +6 -6
  163. package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +1 -1
  164. package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +4 -4
  165. package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +1 -1
  166. package/src/patterns/UiSidebar/UiSidebarHeader.vue +1 -1
  167. package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +7 -7
  168. package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +4 -4
  169. package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +4 -4
  170. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.stories.ts +1 -1
  171. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +1 -1
  172. package/src/patterns/UiSidebar/UiSidebarPopoverMenu.vue +1 -1
  173. package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +3 -3
  174. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +1 -1
  175. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +1 -1
  176. package/src/patterns/UiSidebar/UiSidebarSub.stories.ts +1 -1
  177. package/src/patterns/UiTopBar/UiTopBar.stories.ts +24 -24
  178. package/src/theme/Background.stories.ts +62 -62
  179. package/src/theme/Border.stories.ts +19 -19
  180. package/src/theme/BorderRadius.stories.ts +14 -14
  181. package/src/theme/Extended.stories.ts +26 -26
  182. package/src/theme/Flex.stories.ts +21 -21
  183. package/src/theme/Grid.stories.ts +19 -19
  184. package/src/theme/HoverLayer.stories.ts +26 -26
  185. package/src/theme/Overlay.stories.ts +14 -14
  186. package/src/theme/Scrollbar.stories.ts +58 -58
  187. package/src/theme/Shadow.stories.ts +5 -5
  188. package/src/theme/Theme.stories.ts +38 -38
@@ -57,49 +57,49 @@ const BAND_HEIGHT = { mobile: 64, desktop: 96 } as const;
57
57
  const scrollRegionAttributes = `role="region" aria-label="${SCROLL_REGION_LABEL}" tabindex="0"`;
58
58
 
59
59
  const scrollingParagraphs = `
60
- <h4 class="body-14-medium text-content-on-surface-primary">Deployment boundaries</h4>
61
- <p class="body-14-regular text-content-on-surface-primary">
60
+ <h4 class="body-s-medium text-content-on-surface-primary">Deployment boundaries</h4>
61
+ <p class="body-s-regular text-content-on-surface-primary">
62
62
  Sovereign AI keeps model weights, data and operations inside the boundary a
63
63
  customer controls, which makes deployment topology part of the product rather
64
64
  than an afterthought handled by whoever operates the cluster.
65
65
  </p>
66
- <p class="body-14-regular text-content-on-surface-primary">
66
+ <p class="body-s-regular text-content-on-surface-primary">
67
67
  Scroll this panel: the band stays pinned to its edge while the text moves
68
68
  underneath it, because the gradient sits in the wrapper rather than in the
69
69
  scrolling element itself.
70
70
  </p>
71
- <p class="body-14-regular text-content-on-surface-primary">
71
+ <p class="body-s-regular text-content-on-surface-primary">
72
72
  That is the whole point of wrapping the scroll container instead of placing
73
73
  the gradient inside it. A gradient inside the scroll area would travel with
74
74
  the content and drift out of view on the first swipe.
75
75
  </p>
76
- <p class="body-14-regular text-content-on-surface-primary">
76
+ <p class="body-s-regular text-content-on-surface-primary">
77
77
  The band is decorative and lets pointer events through, so scrolling, text
78
78
  selection and clicks on the content underneath all keep working while it is
79
79
  on screen.
80
80
  </p>
81
- <h4 class="body-14-medium text-content-on-surface-primary">Responsive behaviour</h4>
82
- <p class="body-14-regular text-content-on-surface-primary">
81
+ <h4 class="body-s-medium text-content-on-surface-primary">Responsive behaviour</h4>
82
+ <p class="body-s-regular text-content-on-surface-primary">
83
83
  Switch the Media breakpoint toolbar between Desktop and Mobile to compare
84
84
  both renderings of the band. Mobile gets a shorter runway, and its bottom
85
85
  gradient turns opaque much earlier.
86
86
  </p>
87
- <p class="body-14-regular text-content-on-surface-primary">
87
+ <p class="body-s-regular text-content-on-surface-primary">
88
88
  Keep the wrapper background aligned with the surface the content sits on. A
89
89
  mismatch is most obvious here, halfway through a scroll, where the fade ends
90
90
  on a visible horizontal seam.
91
91
  </p>
92
- <p class="body-14-regular text-content-on-surface-primary">
92
+ <p class="body-s-regular text-content-on-surface-primary">
93
93
  The fade covers a fixed strip of the container, so a taller panel shows more
94
94
  unmasked content while the masked strip stays the same size.
95
95
  </p>
96
- <h4 class="body-14-medium text-content-on-surface-primary">Reaching the end</h4>
97
- <p class="body-14-regular text-content-on-surface-primary">
96
+ <h4 class="body-s-medium text-content-on-surface-primary">Reaching the end</h4>
97
+ <p class="body-s-regular text-content-on-surface-primary">
98
98
  With a bottom band, the last line of a scroll area never sits flush against
99
99
  the container edge, which is what tells a reader there is nothing more to
100
100
  scroll to.
101
101
  </p>
102
- <p class="body-14-regular text-content-on-surface-primary">
102
+ <p class="body-s-regular text-content-on-surface-primary">
103
103
  This is the final paragraph, so a bottom-anchored band should be covering it
104
104
  completely once you get here.
105
105
  </p>
@@ -530,7 +530,7 @@ export const AllVariants: Story = {
530
530
  :key="variant.background + variant.position"
531
531
  class="flex flex-col gap-y-2"
532
532
  >
533
- <span class="label-12-regular text-content-on-surface-muted">
533
+ <span class="label-xs-regular text-content-on-surface-muted">
534
534
  {{ variant.background }} · {{ variant.position }}
535
535
  </span>
536
536
  <UiFadeMask
@@ -167,7 +167,7 @@ export const DesignNotes: Story = {
167
167
  <section class="flex flex-col gap-8 p-4 bg-surface-secondary">
168
168
  <div>
169
169
  <h2 class="heading-m font-bold text-content-on-surface-primary">Usage</h2>
170
- <div class="body-16-regular mt-2 flex flex-col gap-4 text-content-on-surface-primary">
170
+ <div class="body-m-regular mt-2 flex flex-col gap-4 text-content-on-surface-primary">
171
171
  <p>
172
172
  The Field component establishes a consistent structure for collecting information from users.
173
173
  It creates a predictable relationship between inputs, labels, help text, and validation messages,
@@ -181,11 +181,11 @@ export const DesignNotes: Story = {
181
181
 
182
182
  <div class="grid gap-8 md:grid-cols-1">
183
183
  <div class="flex flex-col gap-3">
184
- <h3 class="body-16-medium text-content-on-surface-primary">Clarity first</h3>
185
- <p class="body-16-regular text-content-on-surface-primary">
184
+ <h3 class="body-m-medium text-content-on-surface-primary">Clarity first</h3>
185
+ <p class="body-m-regular text-content-on-surface-primary">
186
186
  Users should immediately understand:
187
187
  </p>
188
- <ul class="body-16-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
188
+ <ul class="body-m-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
189
189
  <li>What information is being requested</li>
190
190
  <li>Whether the field is required or optional</li>
191
191
  <li>How to successfully complete the field</li>
@@ -194,11 +194,11 @@ export const DesignNotes: Story = {
194
194
  </div>
195
195
 
196
196
  <div class="flex flex-col gap-3">
197
- <h3 class="body-16-medium text-content-on-surface-primary">Progressive guidance</h3>
198
- <p class="body-16-regular text-content-on-surface-primary">
197
+ <h3 class="body-m-medium text-content-on-surface-primary">Progressive guidance</h3>
198
+ <p class="body-m-regular text-content-on-surface-primary">
199
199
  Provide information only when it helps the user complete a task:
200
200
  </p>
201
- <ul class="body-16-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
201
+ <ul class="body-m-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
202
202
  <li>Label explains what is needed</li>
203
203
  <li>Description provides additional guidance</li>
204
204
  <li>Error message appears only when required</li>
@@ -206,11 +206,11 @@ export const DesignNotes: Story = {
206
206
  </div>
207
207
 
208
208
  <div class="flex flex-col gap-3">
209
- <h3 class="body-16-medium text-content-on-surface-primary">Consistency</h3>
210
- <p class="body-16-regular text-content-on-surface-primary">
209
+ <h3 class="body-m-medium text-content-on-surface-primary">Consistency</h3>
210
+ <p class="body-m-regular text-content-on-surface-primary">
211
211
  All form controls should follow the same structure regardless of input type:
212
212
  </p>
213
- <ul class="body-16-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
213
+ <ul class="body-m-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
214
214
  <li>Text Input</li>
215
215
  <li>Select</li>
216
216
  <li>Checkbox</li>
@@ -226,8 +226,8 @@ export const DesignNotes: Story = {
226
226
  <h2 class="heading-m font-bold text-content-on-surface-primary">Do's and Don'ts</h2>
227
227
  <div class="grid gap-8 md:grid-cols-2">
228
228
  <div class="flex flex-col gap-3">
229
- <h3 class="body-16-medium text-content-on-surface-primary">Do</h3>
230
- <ul class="body-16-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
229
+ <h3 class="body-m-medium text-content-on-surface-primary">Do</h3>
230
+ <ul class="body-m-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
231
231
  <li>Use a clear label for every field</li>
232
232
  <li>Provide helpful descriptions when needed</li>
233
233
  <li>Group related information together</li>
@@ -237,8 +237,8 @@ export const DesignNotes: Story = {
237
237
  </div>
238
238
 
239
239
  <div class="flex flex-col gap-3">
240
- <h3 class="body-16-medium text-content-on-surface-primary">Don't</h3>
241
- <ul class="body-16-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
240
+ <h3 class="body-m-medium text-content-on-surface-primary">Don't</h3>
241
+ <ul class="body-m-regular list-disc space-y-2 pl-5 text-content-on-surface-primary">
242
242
  <li>Use placeholders as labels</li>
243
243
  <li>Display errors before interaction</li>
244
244
  <li>Overload fields with excessive guidance</li>
@@ -300,10 +300,10 @@ export const Accessibility: Story = {
300
300
 
301
301
  <div class="flex flex-col gap-6">
302
302
  <div class="flex flex-col gap-2">
303
- <h3 class="body-16-medium text-content-on-surface-primary">
303
+ <h3 class="body-m-medium text-content-on-surface-primary">
304
304
  Requirements
305
305
  </h3>
306
- <ul class="body-16-regular list-disc pl-5 text-content-on-surface-primary">
306
+ <ul class="body-m-regular list-disc pl-5 text-content-on-surface-primary">
307
307
  <li>Every field has a visible label</li>
308
308
  <li>Error states are communicated through more than color alone</li>
309
309
  <li>Descriptions remain readable and associated with the field</li>
@@ -312,10 +312,10 @@ export const Accessibility: Story = {
312
312
  </div>
313
313
 
314
314
  <div class="flex flex-col gap-2">
315
- <h3 class="body-16-medium text-content-on-surface-primary">
315
+ <h3 class="body-m-medium text-content-on-surface-primary">
316
316
  Enable accessibility theme
317
317
  </h3>
318
- <p class="body-16-regular text-content-on-surface-primary">
318
+ <p class="body-m-regular text-content-on-surface-primary">
319
319
  When accessibility is required, enable our accessibility theme. This
320
320
  increases contrast and ensures there are no color contrast issues.
321
321
  </p>
@@ -324,7 +324,7 @@ export const Accessibility: Story = {
324
324
 
325
325
  <div class="grid gap-4 md:grid-cols-2">
326
326
  <div class="flex flex-col gap-3">
327
- <h3 class="label-16-medium text-center text-content-on-surface-primary">
327
+ <h3 class="label-m-medium text-center text-content-on-surface-primary">
328
328
  Default
329
329
  </h3>
330
330
  <div class="flex min-h-28 items-center justify-center border border-border-surface-default p-6">
@@ -357,7 +357,7 @@ export const Accessibility: Story = {
357
357
  </div>
358
358
 
359
359
  <div class="accessible-theme flex flex-col gap-3">
360
- <h3 class="label-16-medium text-center text-content-on-surface-primary">
360
+ <h3 class="label-m-medium text-center text-content-on-surface-primary">
361
361
  Accessible
362
362
  </h3>
363
363
  <div class="flex min-h-28 items-center justify-center border border-border-surface-default p-6">
@@ -1419,7 +1419,7 @@ const plan = ref('pro')
1419
1419
  <UiField orientation="responsive">
1420
1420
  <UiRadioGroupItem id="plan-free" value="free" />
1421
1421
  <UiFieldContent>
1422
- <label for="plan-free" class="label-14-medium">Free</label>
1422
+ <label for="plan-free" class="label-s-medium">Free</label>
1423
1423
  <UiFieldDescription>Basic features for personal use.</UiFieldDescription>
1424
1424
  </UiFieldContent>
1425
1425
  </UiField>
@@ -1427,7 +1427,7 @@ const plan = ref('pro')
1427
1427
  <UiField orientation="responsive">
1428
1428
  <UiRadioGroupItem id="plan-pro" value="pro" />
1429
1429
  <UiFieldContent>
1430
- <label for="plan-pro" class="label-14-medium">Pro</label>
1430
+ <label for="plan-pro" class="label-s-medium">Pro</label>
1431
1431
  <UiFieldDescription>Everything you need for work.</UiFieldDescription>
1432
1432
  </UiFieldContent>
1433
1433
  </UiField>
@@ -1435,7 +1435,7 @@ const plan = ref('pro')
1435
1435
  <UiField orientation="responsive" data-disabled="true">
1436
1436
  <UiRadioGroupItem id="plan-enterprise" value="enterprise" disabled />
1437
1437
  <UiFieldContent>
1438
- <label for="plan-enterprise" class="label-14-medium text-content-on-surface-muted">Enterprise</label>
1438
+ <label for="plan-enterprise" class="label-s-medium text-content-on-surface-muted">Enterprise</label>
1439
1439
  <UiFieldDescription>Contact sales for pricing.</UiFieldDescription>
1440
1440
  </UiFieldContent>
1441
1441
  </UiField>
@@ -1474,7 +1474,7 @@ export const RadioGroupInFieldSet: Story = {
1474
1474
  <UiField orientation="responsive">
1475
1475
  <UiRadioGroupItem id="plan-free" value="free" />
1476
1476
  <UiFieldContent>
1477
- <label for="plan-free" class="label-14-medium">Free</label>
1477
+ <label for="plan-free" class="label-s-medium">Free</label>
1478
1478
  <UiFieldDescription>Basic features for personal use.</UiFieldDescription>
1479
1479
  </UiFieldContent>
1480
1480
  </UiField>
@@ -1482,7 +1482,7 @@ export const RadioGroupInFieldSet: Story = {
1482
1482
  <UiField orientation="responsive">
1483
1483
  <UiRadioGroupItem id="plan-pro" value="pro" />
1484
1484
  <UiFieldContent>
1485
- <label for="plan-pro" class="label-14-medium">Pro</label>
1485
+ <label for="plan-pro" class="label-s-medium">Pro</label>
1486
1486
  <UiFieldDescription>Everything you need for work.</UiFieldDescription>
1487
1487
  </UiFieldContent>
1488
1488
  </UiField>
@@ -1490,7 +1490,7 @@ export const RadioGroupInFieldSet: Story = {
1490
1490
  <UiField orientation="responsive" data-disabled="true">
1491
1491
  <UiRadioGroupItem id="plan-enterprise" value="enterprise" disabled />
1492
1492
  <UiFieldContent>
1493
- <label for="plan-enterprise" class="label-14-medium text-content-on-surface-muted">Enterprise</label>
1493
+ <label for="plan-enterprise" class="label-s-medium text-content-on-surface-muted">Enterprise</label>
1494
1494
  <UiFieldDescription>Contact sales for pricing.</UiFieldDescription>
1495
1495
  </UiFieldContent>
1496
1496
  </UiField>
@@ -2779,7 +2779,7 @@ export const FormKeyboardFlow: Story = {
2779
2779
  <p
2780
2780
  v-if="status === 'success'"
2781
2781
  role="status"
2782
- class="body-14-regular text-content-on-surface-primary"
2782
+ class="body-s-regular text-content-on-surface-primary"
2783
2783
  >
2784
2784
  Your details were saved.
2785
2785
  </p>
@@ -2,12 +2,17 @@
2
2
  import { UiButton } from '@/components/UiButton';
3
3
  import { UiFileType } from '@/components/UiFileType';
4
4
  import { UiIcon } from '@/components/UiIcon';
5
+ import {
6
+ UiPopover,
7
+ UiPopoverContent,
8
+ UiPopoverTrigger,
9
+ } from '@/components/UiPopover';
5
10
  import { UiProgress } from '@/components/UiProgress';
6
11
  import { UiTooltip } from '@/components/UiTooltip';
7
12
  import { cn } from '@/lib/utils';
8
13
  import { useIsTruncated } from '@/lib/useIsTruncated';
9
- import { computed, useTemplateRef } from 'vue';
10
- import type { UiFileItemProps } from './types';
14
+ import { computed, ref, useTemplateRef } from 'vue';
15
+ import type { UiFileItemGroupItem, UiFileItemProps } from './types';
11
16
 
12
17
  defineOptions({
13
18
  name: 'UiFileItem',
@@ -24,19 +29,36 @@ const props = withDefaults(defineProps<UiFileItemProps>(), {
24
29
  removable: true,
25
30
  disabled: false,
26
31
  size: 'default',
32
+ processing: false,
33
+ processingLabel: 'Processing…',
34
+ expandLabel: 'Show files',
35
+ listLabel: 'Attached files',
36
+ popoverSide: 'top',
37
+ popoverAlign: 'end',
27
38
  // `mediaTone` and `mediaIcon` are intentionally undefined by default so
28
39
  // `UiFileType`'s extension-based auto-detection can decide both. Pass
29
40
  // them explicitly to override.
30
41
  mediaTone: undefined,
31
42
  mediaIcon: undefined,
43
+ items: undefined,
32
44
  });
33
45
 
34
- /* eslint-disable jsdoc/require-jsdoc -- emit payload is empty tuple */
46
+ /* eslint-disable jsdoc/require-jsdoc -- emit payloads are tuples */
35
47
  const emit = defineEmits<{
36
48
  remove: [];
49
+ /** Fired when a file inside the multi-file list is removed. */
50
+ removeItem: [item: UiFileItemGroupItem];
37
51
  }>();
38
52
  /* eslint-enable jsdoc/require-jsdoc */
39
53
 
54
+ /**
55
+ * Re-emits a nested row's remove so the parent can tell which file left the group.
56
+ * @param item - The file that was removed from the popover list
57
+ */
58
+ function onRemoveItem(item: UiFileItemGroupItem) {
59
+ emit('removeItem', item);
60
+ }
61
+
40
62
  /**
41
63
  * Drops the last `.ext` segment; leaves `.gitignore`-style names unchanged.
42
64
  * @param name - Full file name
@@ -53,9 +75,12 @@ const displayFilename = computed(() =>
53
75
 
54
76
  const isError = computed(() => props.error != null && props.error !== '');
55
77
 
78
+ const isProcessing = computed(() => !isError.value && props.processing);
79
+
56
80
  const isWithProgress = computed(
57
81
  () =>
58
82
  !isError.value &&
83
+ !isProcessing.value &&
59
84
  props.progress != null &&
60
85
  props.progress >= 0 &&
61
86
  props.progress < 100,
@@ -65,9 +90,28 @@ const showMeta = computed(
65
90
  () =>
66
91
  !isError.value &&
67
92
  !isWithProgress.value &&
93
+ !isProcessing.value &&
68
94
  (props.typeLabel || props.sizeLabel),
69
95
  );
70
96
 
97
+ const isMulti = computed(
98
+ () => Array.isArray(props.items) && props.items.length > 0,
99
+ );
100
+
101
+ const listOpen = ref(false);
102
+
103
+ /**
104
+ * Name announced when the processing status appears. Includes the file so a
105
+ * live region can tell rows apart, while the visible line stays
106
+ * `type | processingLabel`.
107
+ */
108
+ const processingStatusName = computed(() => {
109
+ const parts = [props.filename];
110
+ if (props.typeLabel) parts.push(props.typeLabel);
111
+ parts.push(props.processingLabel);
112
+ return parts.join(', ');
113
+ });
114
+
71
115
  const isSmall = computed(() => props.size === 'small');
72
116
 
73
117
  const containerClass = computed(() =>
@@ -79,8 +123,8 @@ const containerClass = computed(() =>
79
123
  ),
80
124
  );
81
125
 
82
- // Body column: title plus one of {progress, error, meta}. The vertical gap
83
- // shrinks for compact rows (small size or error/multi states).
126
+ // Body column: title plus one of {progress, error, processing, meta}. The
127
+ // vertical gap shrinks for compact rows (small size or error states).
84
128
  const contentClass = computed(() =>
85
129
  cn(
86
130
  'flex min-w-0 flex-1 flex-col items-start',
@@ -91,7 +135,7 @@ const contentClass = computed(() =>
91
135
  const titleClass = computed(() =>
92
136
  cn(
93
137
  'block w-full min-w-0 truncate text-content-on-surface-primary',
94
- isSmall.value ? 'label-12-medium' : 'body-14-medium',
138
+ isSmall.value ? 'label-xs-medium' : 'body-s-medium',
95
139
  ),
96
140
  );
97
141
 
@@ -116,7 +160,7 @@ const isTitleTruncated = useIsTruncated(titleRef, () => displayFilename.value);
116
160
  :tone="mediaTone"
117
161
  :icon="mediaIcon"
118
162
  :error="isError"
119
- :loading="isWithProgress"
163
+ :loading="isWithProgress || isProcessing"
120
164
  />
121
165
 
122
166
  <div data-slot="file-item-content" :class="contentClass">
@@ -139,16 +183,34 @@ const isTitleTruncated = useIsTruncated(titleRef, () => displayFilename.value);
139
183
 
140
184
  <p
141
185
  v-else-if="isError"
142
- class="label-12-medium text-content-on-status-error-inverse w-full truncate"
186
+ class="label-xs-medium text-content-on-status-error-inverse w-full truncate"
143
187
  role="alert"
144
188
  >
145
189
  {{ error }}
146
190
  </p>
147
191
 
192
+ <div
193
+ v-else-if="isProcessing"
194
+ data-slot="file-item-meta"
195
+ role="status"
196
+ :aria-label="processingStatusName"
197
+ :aria-busy="processing"
198
+ class="label-xs-medium text-content-on-surface-muted flex w-full min-w-0 items-center gap-2"
199
+ >
200
+ <span v-if="typeLabel" class="truncate">{{ typeLabel }}</span>
201
+ <span
202
+ v-if="typeLabel"
203
+ aria-hidden="true"
204
+ class="text-content-on-surface-muted shrink-0"
205
+ >|</span
206
+ >
207
+ <span class="truncate">{{ processingLabel }}</span>
208
+ </div>
209
+
148
210
  <div
149
211
  v-else-if="showMeta"
150
212
  data-slot="file-item-meta"
151
- class="label-12-medium text-content-on-surface-muted flex w-full min-w-0 items-center gap-2"
213
+ class="label-xs-medium text-content-on-surface-muted flex w-full min-w-0 items-center gap-2"
152
214
  >
153
215
  <span v-if="typeLabel" class="truncate">{{ typeLabel }}</span>
154
216
  <span
@@ -173,5 +235,48 @@ const isTitleTruncated = useIsTruncated(titleRef, () => displayFilename.value);
173
235
  >
174
236
  <UiIcon name="x" :size="16" aria-hidden="true" />
175
237
  </UiButton>
238
+
239
+ <UiPopover v-if="isMulti" v-model:open="listOpen">
240
+ <UiPopoverTrigger as-child>
241
+ <UiButton
242
+ type="button"
243
+ variant="ghost"
244
+ size="icon-sm"
245
+ class="shrink-0"
246
+ :disabled="disabled"
247
+ :aria-label="expandLabel"
248
+ >
249
+ <UiIcon
250
+ :name="listOpen ? 'chevron-up' : 'chevron-down'"
251
+ :size="16"
252
+ aria-hidden="true"
253
+ />
254
+ </UiButton>
255
+ </UiPopoverTrigger>
256
+ <UiPopoverContent
257
+ :side="popoverSide"
258
+ :align="popoverAlign"
259
+ compact
260
+ aria-label="listLabel"
261
+ >
262
+ <ul
263
+ data-slot="file-item-list"
264
+ class="flex max-h-[calc(var(--reka-popover-content-available-height)-2rem)] w-full flex-col gap-2 overflow-y-auto"
265
+ :aria-label="listLabel"
266
+ >
267
+ <li
268
+ v-for="(item, index) in items"
269
+ :key="item.id ?? `${item.filename}-${index}`"
270
+ >
271
+ <UiFileItem
272
+ v-bind="item"
273
+ :disabled="disabled || item.disabled"
274
+ size="small"
275
+ @remove="onRemoveItem(item)"
276
+ />
277
+ </li>
278
+ </ul>
279
+ </UiPopoverContent>
280
+ </UiPopover>
176
281
  </div>
177
282
  </template>
@@ -74,7 +74,59 @@ describe('UiFileItem', () => {
74
74
  expect(container.querySelector('[data-slot="file-item"]')).toHaveClass(
75
75
  'p-2',
76
76
  );
77
- expect(getByLabelText('doc.pdf')).toHaveClass('label-12-medium');
77
+ expect(getByLabelText('doc.pdf')).toHaveClass('label-xs-medium');
78
+ });
79
+
80
+ test('processing shows the status text and hides the size and progress bar', () => {
81
+ const { getByRole, getByText, queryByRole, queryByText } = render(
82
+ UiFileItem,
83
+ {
84
+ props: {
85
+ filename: 'doc.pdf',
86
+ typeLabel: 'PDF',
87
+ sizeLabel: '1 MB',
88
+ progress: 40,
89
+ processing: true,
90
+ processingLabel: 'Processing…',
91
+ },
92
+ },
93
+ );
94
+ expect(getByText('PDF')).toBeInTheDocument();
95
+ expect(getByText('Processing…')).toBeInTheDocument();
96
+ expect(getByRole('status')).toHaveAccessibleName(
97
+ 'doc.pdf, PDF, Processing…',
98
+ );
99
+ expect(queryByText('1 MB')).not.toBeInTheDocument();
100
+ expect(queryByRole('progressbar')).not.toBeInTheDocument();
101
+ });
102
+
103
+ test('a group of files exposes a chevron that lists each file', async () => {
104
+ const user = userEvent.setup();
105
+ const { getByRole, queryByRole } = render(UiFileItem, {
106
+ props: {
107
+ filename: 'Attached documents',
108
+ typeLabel: '2 files',
109
+ expandLabel: 'Show attached documents',
110
+ items: [
111
+ { filename: 'plan.pdf', typeLabel: 'PDF', sizeLabel: '12 MB' },
112
+ { filename: 'notes.md', typeLabel: 'MD', sizeLabel: '4 KB' },
113
+ ],
114
+ },
115
+ });
116
+ const chevron = getByRole('button', { name: 'Show attached documents' });
117
+ expect(chevron).toHaveAttribute('aria-expanded', 'false');
118
+ expect(
119
+ queryByRole('list', { name: 'Attached files' }),
120
+ ).not.toBeInTheDocument();
121
+
122
+ await user.click(chevron);
123
+ expect(
124
+ screen.getByRole('list', { name: 'Attached files' }),
125
+ ).toBeInTheDocument();
126
+ expect(screen.getByText('plan')).toBeInTheDocument();
127
+ expect(screen.getByText('notes')).toBeInTheDocument();
128
+ expect(screen.getByText('PDF')).toBeInTheDocument();
129
+ expect(screen.getByText('MD')).toBeInTheDocument();
78
130
  });
79
131
 
80
132
  test('default size keeps the roomier padding and title scale', () => {
@@ -84,6 +136,6 @@ describe('UiFileItem', () => {
84
136
  expect(container.querySelector('[data-slot="file-item"]')).toHaveClass(
85
137
  'p-3',
86
138
  );
87
- expect(getByLabelText('doc.pdf')).toHaveClass('body-14-medium');
139
+ expect(getByLabelText('doc.pdf')).toHaveClass('body-s-medium');
88
140
  });
89
141
  });
@@ -1,5 +1,6 @@
1
1
  export { default as UiFileItem } from './UiFileItem.vue';
2
2
  export type {
3
+ UiFileItemGroupItem,
3
4
  UiFileItemMediaTone,
4
5
  UiFileItemProps,
5
6
  UiFileItemSize,
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Row showing a selected or uploading file with optional progress and errors.
2
+ * Row showing a selected, uploading, or processing file, with an optional
3
+ * multi-file disclosure.
3
4
  * @category Form Inputs
4
- * @useCases file upload list, attachment row
5
- * @keywords file, upload, attachment, progress, success, error
6
- * @related UiFileUploadBox, UiItem, UiButton, UiProgress
5
+ * @useCases file upload list, attachment row, grouped attachments
6
+ * @keywords file, upload, attachment, progress, processing, success, error, multi
7
+ * @related UiFileUploadBox, UiFileType, UiPopover, UiButton, UiProgress
7
8
  */
8
9
  export type UiFileItemSize = 'default' | 'small';
9
10
 
10
11
  import type { UiFileTypeTone } from '@/components/UiFileType';
12
+ import type { UiPopoverAlign, UiPopoverSide } from '@/components/UiPopover';
11
13
 
12
14
  /**
13
15
  * Media badge tone. Re-exported alias of `UiFileTypeTone` (the file-type
@@ -16,10 +18,47 @@ import type { UiFileTypeTone } from '@/components/UiFileType';
16
18
  */
17
19
  export type UiFileItemMediaTone = UiFileTypeTone;
18
20
 
21
+ /**
22
+ * One file inside a multi-file popover. Icons come from the filename
23
+ * extension via `UiFileType` (text, markdown, tabular, media) unless
24
+ * `mediaTone` / `mediaIcon` override them.
25
+ */
26
+ export interface UiFileItemGroupItem {
27
+ /** Stable id. Used as the list key; falls back to the filename. */
28
+ id?: string;
29
+ /** Full file name. The trailing extension is hidden from the title. */
30
+ filename: string;
31
+ /** Short type label, e.g. `PDF`. */
32
+ typeLabel?: string;
33
+ /** Size label, e.g. `1.2 MB`. Shown in the success state. */
34
+ sizeLabel?: string;
35
+ /** Upload progress 0–100. Values `< 100` show a progress bar. */
36
+ progress?: number | null;
37
+ /** Error message. When non-empty, the row enters the error state. */
38
+ error?: string | null;
39
+ /**
40
+ * When `true`, the row shows `typeLabel | processingLabel` instead of a
41
+ * progress bar or the file size.
42
+ */
43
+ processing?: boolean;
44
+ /** Visible processing status. Also announced in the status region. */
45
+ processingLabel?: string;
46
+ /** When `false`, the nested row has no remove control. */
47
+ removable?: boolean;
48
+ /** When `true`, the nested row is inert. */
49
+ disabled?: boolean;
50
+ /** Accessible label for the nested remove control. */
51
+ removeLabel?: string;
52
+ /** Media badge tone. Auto-derived from the extension when omitted. */
53
+ mediaTone?: UiFileItemMediaTone;
54
+ /** Lucide icon name for the media badge. Auto-derived when omitted. */
55
+ mediaIcon?: string;
56
+ }
57
+
19
58
  export interface UiFileItemProps {
20
59
  /** Full file name. The trailing extension is hidden from the title. */
21
60
  filename: string;
22
- /** Short type label, e.g. `PDF`. Shown only in the success state. */
61
+ /** Short type label, e.g. `PDF`. Shown in the success and processing states. */
23
62
  typeLabel?: string;
24
63
  /** Size label, e.g. `1.2 MB`. Shown only in the success state. */
25
64
  sizeLabel?: string;
@@ -27,6 +66,18 @@ export interface UiFileItemProps {
27
66
  progress?: number | null;
28
67
  /** Error message. When non-empty, the row enters the error state. */
29
68
  error?: string | null;
69
+ /**
70
+ * When `true`, the row is processing: a neutral file badge and
71
+ * `typeLabel | processingLabel`, with no progress bar.
72
+ * @default false
73
+ */
74
+ processing?: boolean;
75
+ /**
76
+ * Visible processing status, e.g. `Processing…`. Announced with the
77
+ * filename from a `status` region so it can be translated.
78
+ * @default 'Processing…'
79
+ */
80
+ processingLabel?: string;
30
81
  /** Accessible label for the remove control. */
31
82
  removeLabel?: string;
32
83
  /** Accessible label for the progress bar (i18n hook). Defaults to the `filename`. */
@@ -47,4 +98,30 @@ export interface UiFileItemProps {
47
98
  mediaTone?: UiFileItemMediaTone;
48
99
  /** Lucide icon name for the media badge. Auto-derived when omitted. */
49
100
  mediaIcon?: string;
101
+ /**
102
+ * Files revealed by the chevron. When the list has entries, the row is the
103
+ * multi variant: a chevron button opens a popover of single file rows.
104
+ * Each entry keeps the icon for its own file type.
105
+ */
106
+ items?: UiFileItemGroupItem[];
107
+ /**
108
+ * Accessible name for the chevron that opens the file list.
109
+ * @default 'Show files'
110
+ */
111
+ expandLabel?: string;
112
+ /**
113
+ * Accessible name for the list inside the popover.
114
+ * @default 'Attached files'
115
+ */
116
+ listLabel?: string;
117
+ /**
118
+ * Which side of the row the file list opens on.
119
+ * @default 'bottom'
120
+ */
121
+ popoverSide?: UiPopoverSide;
122
+ /**
123
+ * Alignment of the file list against the row.
124
+ * @default 'center'
125
+ */
126
+ popoverAlign?: UiPopoverAlign;
50
127
  }