@aleph-alpha/ui-library 2.4.4 → 2.5.1

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 (80) hide show
  1. package/config.js +78 -9
  2. package/dist/system/components/UiAvatar/UiAvatar.vue.d.ts +4 -1
  3. package/dist/system/components/UiAvatar/UiAvatarGroup.vue.d.ts +18 -0
  4. package/dist/system/components/UiAvatar/index.d.ts +1 -0
  5. package/dist/system/components/UiAvatar/types.d.ts +12 -1
  6. package/dist/system/components/UiFileItem/UiFileItem.vue.d.ts +6 -1
  7. package/dist/system/components/UiFileItem/types.d.ts +30 -10
  8. package/dist/system/components/UiFileType/UiFileType.vue.d.ts +8 -0
  9. package/dist/system/components/UiFileType/index.d.ts +2 -0
  10. package/dist/system/components/UiFileType/types.d.ts +33 -0
  11. package/dist/system/components/UiItem/UiItem.vue.d.ts +8 -1
  12. package/dist/system/components/UiItem/constants.d.ts +4 -3
  13. package/dist/system/components/UiItem/index.d.ts +1 -1
  14. package/dist/system/components/UiItem/types.d.ts +53 -13
  15. package/dist/system/components/core/avatar/Avatar.vue.d.ts +2 -0
  16. package/dist/system/components/core/avatar/index.d.ts +1 -0
  17. package/dist/system/components/core/item/Item.vue.d.ts +1 -1
  18. package/dist/system/components/core/item/ItemAction.vue.d.ts +25 -0
  19. package/dist/system/components/core/item/index.d.ts +8 -4
  20. package/dist/system/components/index.d.ts +1 -0
  21. package/dist/system/lib/activeIndicator.d.ts +1 -0
  22. package/dist/system/lib.js +6574 -6357
  23. package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -15
  24. package/package.json +1 -1
  25. package/src/components/UiAvatar/UiAvatar.stories.ts +103 -12
  26. package/src/components/UiAvatar/UiAvatar.vue +6 -1
  27. package/src/components/UiAvatar/UiAvatarGroup.vue +16 -0
  28. package/src/components/UiAvatar/UiAvatarImage.vue +1 -1
  29. package/src/components/UiAvatar/__tests__/UiAvatar.test.ts +86 -0
  30. package/src/components/UiAvatar/index.ts +1 -0
  31. package/src/components/UiAvatar/types.ts +15 -1
  32. package/src/components/UiButton/UiButton.stories.ts +60 -0
  33. package/src/components/UiCodeBlock/UiCodeBlock.vue +1 -1
  34. package/src/components/UiFileItem/UiFileItem.stories.ts +344 -185
  35. package/src/components/UiFileItem/UiFileItem.vue +110 -70
  36. package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +64 -3
  37. package/src/components/UiFileItem/types.ts +33 -10
  38. package/src/components/UiFileType/UiFileType.stories.ts +134 -0
  39. package/src/components/UiFileType/UiFileType.vue +116 -0
  40. package/src/components/UiFileType/__tests__/UiFileType.test.ts +41 -0
  41. package/src/components/UiFileType/index.ts +2 -0
  42. package/src/components/UiFileType/types.ts +38 -0
  43. package/src/components/UiItem/UiItem.stories.ts +555 -855
  44. package/src/components/UiItem/UiItem.vue +59 -4
  45. package/src/components/UiItem/UiItemMedia.vue +1 -1
  46. package/src/components/UiItem/__tests__/UiItem.test.ts +432 -26
  47. package/src/components/UiItem/constants.ts +16 -2
  48. package/src/components/UiItem/index.ts +1 -1
  49. package/src/components/UiItem/types.ts +64 -13
  50. package/src/components/UiKbd/UiKbd.stories.ts +1 -1
  51. package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +4 -4
  52. package/src/components/UiSelect/__tests__/UiSelectGroup.test.ts +2 -2
  53. package/src/components/UiTable/__tests__/UiTableRow.test.ts +4 -2
  54. package/src/components/core/avatar/Avatar.vue +17 -1
  55. package/src/components/core/avatar/AvatarFallback.vue +1 -1
  56. package/src/components/core/{item/ItemActions.vue → avatar/AvatarGroup.vue} +7 -2
  57. package/src/components/core/avatar/index.ts +1 -0
  58. package/src/components/core/button/index.ts +1 -1
  59. package/src/components/core/drawer/DrawerContent.vue +1 -1
  60. package/src/components/core/item/Item.vue +2 -2
  61. package/src/components/core/item/ItemAction.vue +30 -0
  62. package/src/components/core/item/ItemContent.vue +1 -1
  63. package/src/components/core/item/ItemDescription.vue +1 -1
  64. package/src/components/core/item/ItemGroup.vue +0 -1
  65. package/src/components/core/item/index.ts +32 -9
  66. package/src/components/core/kbd/Kbd.vue +1 -1
  67. package/src/components/core/skeleton/Skeleton.vue +3 -1
  68. package/src/components/core/slider/Slider.vue +1 -1
  69. package/src/components/core/table/TableFooter.vue +4 -1
  70. package/src/components/core/table/TableRow.vue +1 -1
  71. package/src/components/index.ts +1 -0
  72. package/src/lib/activeIndicator.ts +1 -0
  73. package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +2 -2
  74. package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +2 -2
  75. package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +2 -2
  76. package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +2 -2
  77. package/src/patterns/UiSidebar/__tests__/UiSidebarMenuButton.test.ts +33 -0
  78. package/src/patterns/UiSidebar/activeIndicator.ts +1 -16
  79. package/src/theme/BorderRadius.stories.ts +12 -12
  80. /package/dist/system/components/core/{item/ItemActions.vue.d.ts → avatar/AvatarGroup.vue.d.ts} +0 -0
package/config.js CHANGED
@@ -459,6 +459,36 @@ const mergeThemes = (base, extend) => {
459
459
  };
460
460
  };
461
461
 
462
+ // Static design tokens that exist in Figma Studio but have not been synced
463
+ // into `tokens.json` yet. Adding them here makes the corresponding utility
464
+ // classes (e.g. `bg-background-accent-pink`) resolvable so components don't
465
+ // need to fall back to arbitrary `bg-[var(--…,#hex)]` values. Remove an
466
+ // entry from this map once the matching token lands upstream.
467
+ //
468
+ // TODO Drop these entries once `background.accent.{pink,yellow}` are
469
+ // available in `tokens.json` so they're picked up by
470
+ // `buildAllTokenVarsFromModeSet`.
471
+ const getStaticTokenVars = () => {
472
+ const toOklch = (hex) => {
473
+ const rgba = parseHexColorToRgba(hex);
474
+ if (!rgba) return null;
475
+ return rgbToOklchComponents(rgba.r, rgba.g, rgba.b, rgba.a);
476
+ };
477
+
478
+ // Hex values mirror the Figma `background/accent/{pink,yellow}` tokens;
479
+ // both modes share the same value until the design system supplies a
480
+ // dedicated dark variant.
481
+ const pink = toOklch('#ffa6d7');
482
+ const yellow = toOklch('#ffe1a6');
483
+
484
+ const shared = {
485
+ 'background-accent-pink': pink,
486
+ 'background-accent-yellow': yellow,
487
+ };
488
+
489
+ return { light: shared, dark: shared };
490
+ };
491
+
462
492
  // Exported functions
463
493
  export const getUiLibraryContentConfig = () => ({
464
494
  content: {
@@ -484,14 +514,19 @@ export const getUiLibraryThemeFromTokens = () => ({
484
514
  * - background.surface.secondary -> --background-surface-secondary
485
515
  * - content.on-surface.primary -> --content-on-surface-primary
486
516
  */
487
- export const getUiLibraryTokenVars = () => ({
488
- light: {
489
- ...buildAllTokenVarsFromModeSet('3-mode/Light'),
490
- },
491
- dark: {
492
- ...buildAllTokenVarsFromModeSet('3-mode/Dark'),
493
- },
494
- });
517
+ export const getUiLibraryTokenVars = () => {
518
+ const staticVars = getStaticTokenVars();
519
+ return {
520
+ light: {
521
+ ...buildAllTokenVarsFromModeSet('3-mode/Light'),
522
+ ...staticVars.light,
523
+ },
524
+ dark: {
525
+ ...buildAllTokenVarsFromModeSet('3-mode/Dark'),
526
+ ...staticVars.dark,
527
+ },
528
+ };
529
+ };
495
530
 
496
531
  /**
497
532
  * Get UnoCSS theme colors config for all token-based colors.
@@ -514,6 +549,7 @@ export const getUiLibraryTokenVars = () => ({
514
549
  export const getUiLibraryTokenColors = () => {
515
550
  const lightVars = {
516
551
  ...buildAllTokenVarsFromModeSet('3-mode/Light'),
552
+ ...getStaticTokenVars().light,
517
553
  };
518
554
  const colors = {};
519
555
 
@@ -821,9 +857,42 @@ const vHoverOverlayCSS = `
821
857
  .hover-layer[data-active="true"]::after {
822
858
  opacity: 1;
823
859
  }
860
+ .ui-active-indicator {
861
+ position: relative;
862
+ }
863
+ .ui-active-indicator::before {
864
+ content: "";
865
+ position: absolute;
866
+ z-index: 10;
867
+ top: 50%;
868
+ left: 0;
869
+ width: 0.125rem;
870
+ height: 50%;
871
+ pointer-events: none;
872
+ border-radius: 9999px;
873
+ background-color: oklch(var(--background-accent-default));
874
+ opacity: 0;
875
+ transform: translateY(-50%) scaleX(0);
876
+ transform-origin: left;
877
+ transition:
878
+ transform 200ms linear,
879
+ opacity 200ms linear;
880
+ }
881
+ .ui-active-indicator[data-active="true"]::before,
882
+ .ui-active-indicator-active::before {
883
+ opacity: 1;
884
+ transform: translateY(-50%) scaleX(1);
885
+ }
886
+ .hover-layer:disabled::after,
887
+ .hover-layer[aria-disabled="true"]::after,
888
+ .hover-layer[data-disabled]::after {
889
+ opacity: 0;
890
+ transition: none;
891
+ }
824
892
  @media (prefers-reduced-motion: reduce) {
825
893
  .v-hover-overlay,
826
- .hover-layer::after {
894
+ .hover-layer::after,
895
+ .ui-active-indicator::before {
827
896
  transition: none;
828
897
  }
829
898
  }
@@ -1,3 +1,4 @@
1
+ import { UiAvatarProps } from './types';
1
2
  declare function __VLS_template(): {
2
3
  attrs: Partial<{}>;
3
4
  slots: {
@@ -7,7 +8,9 @@ declare function __VLS_template(): {
7
8
  rootEl: any;
8
9
  };
9
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
- declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
+ declare const __VLS_component: import('vue').DefineComponent<UiAvatarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiAvatarProps> & Readonly<{}>, {
12
+ size: import('./types').UiAvatarSize;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
14
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
15
  export default _default;
13
16
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -0,0 +1,18 @@
1
+ import { UiAvatarGroupProps } from './types';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: HTMLDivElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<UiAvatarGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiAvatarGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
+ export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -1,4 +1,5 @@
1
1
  export { default as UiAvatar } from './UiAvatar.vue';
2
2
  export { default as UiAvatarFallback } from './UiAvatarFallback.vue';
3
+ export { default as UiAvatarGroup } from './UiAvatarGroup.vue';
3
4
  export { default as UiAvatarImage } from './UiAvatarImage.vue';
4
5
  export type * from './types';
@@ -1,4 +1,5 @@
1
- import { ImgHTMLAttributes } from 'vue';
1
+ import { HTMLAttributes, ImgHTMLAttributes } from 'vue';
2
+ export type UiAvatarSize = 5 | 6 | 8 | 10 | 12 | '5' | '6' | '8' | '10' | '12';
2
3
  /**
3
4
  * A circular image for representing users or entities. Use for
4
5
  * profile pictures, user lists, or any person/entity representation.
@@ -7,6 +8,12 @@ import { ImgHTMLAttributes } from 'vue';
7
8
  * @keywords avatar, image, profile, picture, user, photo, initials
8
9
  * @related UiBadge
9
10
  */
11
+ export type UiAvatarProps = {
12
+ /** Avatar width and height token. Maps to `size-{value}` utilities. */
13
+ size?: UiAvatarSize;
14
+ /** Additional classes for the avatar root. */
15
+ class?: HTMLAttributes['class'];
16
+ };
10
17
  export type UiAvatarImageProps = {
11
18
  /** The source URL of the avatar image. */
12
19
  src: string;
@@ -17,3 +24,7 @@ export type UiAvatarImageProps = {
17
24
  /** The CORS setting for the image request. */
18
25
  crossOrigin?: ImgHTMLAttributes['crossorigin'];
19
26
  };
27
+ export type UiAvatarGroupProps = {
28
+ /** Additional classes for the avatar group container. */
29
+ class?: HTMLAttributes['class'];
30
+ };
@@ -5,10 +5,15 @@ declare const _default: import('vue').DefineComponent<UiFileItemProps, {}, {}, {
5
5
  onRemove?: (() => any) | undefined;
6
6
  }>, {
7
7
  disabled: boolean;
8
+ size: import('./types').UiFileItemSize;
8
9
  progress: number | null;
9
10
  error: string | null;
11
+ removable: boolean;
10
12
  removeLabel: string;
11
13
  typeLabel: string;
12
14
  sizeLabel: string;
13
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ progressLabel: string;
16
+ mediaTone: import('./types').UiFileItemMediaTone;
17
+ mediaIcon: string;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
14
19
  export default _default;
@@ -1,27 +1,47 @@
1
+ import { UiFileTypeTone } from '../UiFileType';
1
2
  /**
2
3
  * Row showing a selected or uploading file with optional progress and errors.
3
4
  * @category Form Inputs
4
5
  * @useCases file upload list, attachment row
5
- * @keywords file, upload, attachment, progress
6
- * @related UiFileUploadBox, UiItem, UiButton
6
+ * @keywords file, upload, attachment, progress, success, error
7
+ * @related UiFileUploadBox, UiItem, UiButton, UiProgress
7
8
  */
9
+ export type UiFileItemSize = 'default' | 'small';
10
+ /**
11
+ * Media badge tone. Re-exported alias of `UiFileTypeTone` (the file-type
12
+ * badge is rendered via {@link UiFileType}). Auto-derived from the filename
13
+ * extension when omitted; see `UiFileType` for the mapping.
14
+ */
15
+ export type UiFileItemMediaTone = UiFileTypeTone;
8
16
  export interface UiFileItemProps {
9
- /**
10
- * Full file name (`file.name`). The title omits the final extension; the full name is still exposed to assistive tech.
11
- */
17
+ /** Full file name. The trailing extension is hidden from the title. */
12
18
  filename: string;
13
- /** Short type label, e.g. `PDF`. */
19
+ /** Short type label, e.g. `PDF`. Shown only in the success state. */
14
20
  typeLabel?: string;
15
- /** Size label, e.g. `1.2 MB`. */
21
+ /** Size label, e.g. `1.2 MB`. Shown only in the success state. */
16
22
  sizeLabel?: string;
17
- /** Upload progress 0–100; omit or `null` to hide the bar. */
23
+ /** Upload progress 0–100. Values `< 100` show a progress bar. */
18
24
  progress?: number | null;
19
- /** Validation or upload error message. */
25
+ /** Error message. When non-empty, the row enters the error state. */
20
26
  error?: string | null;
21
27
  /** Accessible label for the remove control. */
22
28
  removeLabel?: string;
29
+ /** Accessible label for the progress bar (i18n hook). Defaults to the `filename`. */
30
+ progressLabel?: string;
23
31
  /**
24
- * When true, the row is non-interactive (`inert`), visually de-emphasized, and remove is disabled.
32
+ * When `true`, renders a close icon that emits `remove`.
33
+ * @default true
25
34
  */
35
+ removable?: boolean;
36
+ /** When `true`, the row is `inert` and visually de-emphasized. */
26
37
  disabled?: boolean;
38
+ /**
39
+ * Visual size preset.
40
+ * @default 'default'
41
+ */
42
+ size?: UiFileItemSize;
43
+ /** Media badge tone. Auto-derived from the extension when omitted. */
44
+ mediaTone?: UiFileItemMediaTone;
45
+ /** Lucide icon name for the media badge. Auto-derived when omitted. */
46
+ mediaIcon?: string;
27
47
  }
@@ -0,0 +1,8 @@
1
+ import { UiFileTypeProps, UiFileTypeTone } from './types';
2
+ declare const _default: import('vue').DefineComponent<UiFileTypeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiFileTypeProps> & Readonly<{}>, {
3
+ icon: string;
4
+ error: boolean;
5
+ filename: string;
6
+ tone: UiFileTypeTone;
7
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
8
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as UiFileType } from './UiFileType.vue';
2
+ export type { UiFileTypeProps, UiFileTypeTone } from './types';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Round 32×32 badge that visualises a file type with a tone + icon. Mirrors
3
+ * the Figma `Filetype` component (`AA26 / File Upload / Filetype`,
4
+ * node id `26438:42144`):
5
+ *
6
+ * - `Type=Text` (`pdf` / `doc` / `docx` / `txt` / `rtf`) → `accent-pink` + `file`
7
+ * - `Type=Markdown` (`html` / `htm` / `md` / `mdx`) → `accent-soft` + `code-xml`
8
+ * - `Type=Tabular` (`csv` / `tsv` / `xls` / `xlsx`) → `accent-yellow` + `table-2`
9
+ * - everything else → `default` + `file`
10
+ * @see {@link https://www.figma.com/design/SrZQ19QVN1sQkuAMnMC746/AA26--WIP-?node-id=26438-42144}
11
+ * @category Data Display
12
+ * @useCases file-type indicator, attachment badge
13
+ * @keywords file, badge, attachment, filetype, icon
14
+ * @related UiFileItem, UiFileUploadBox
15
+ */
16
+ export type UiFileTypeTone = 'default' | 'accent-pink' | 'accent-soft' | 'accent-yellow';
17
+ export interface UiFileTypeProps {
18
+ /**
19
+ * File name used to auto-derive the tone + icon from its extension. Pass
20
+ * the original `file.name` (with extension); the badge itself doesn't
21
+ * render any text.
22
+ */
23
+ filename?: string;
24
+ /** Explicit tone override. Wins over the filename-derived tone. */
25
+ tone?: UiFileTypeTone;
26
+ /** Explicit Lucide icon name. Wins over the filename-derived icon. */
27
+ icon?: string;
28
+ /**
29
+ * Forces the neutral badge + `circle-alert` icon, regardless of any
30
+ * other prop. Use to indicate an upload/validation failure.
31
+ */
32
+ error?: boolean;
33
+ }
@@ -3,12 +3,19 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  default?(_: {}): any;
6
+ icon?(_: {}): any;
7
+ content?(_: {}): any;
8
+ action?(_: {}): any;
6
9
  };
7
10
  refs: {};
8
11
  rootEl: any;
9
12
  };
10
13
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<UiItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiItemProps> & Readonly<{}>, {
14
+ declare const __VLS_component: import('vue').DefineComponent<UiItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ action: (event: MouseEvent) => any;
16
+ }, string, import('vue').PublicProps, Readonly<UiItemProps> & Readonly<{
17
+ onAction?: ((event: MouseEvent) => any) | undefined;
18
+ }>, {
12
19
  asChild: boolean;
13
20
  size: import('./types').UiItemSizes;
14
21
  variant: import('./types').UiItemVariants;
@@ -1,3 +1,4 @@
1
- export declare const ItemVariants: readonly ["default", "outline", "muted"];
2
- export declare const ItemSizes: readonly ["default", "sm"];
3
- export declare const ItemMediaVariants: readonly ["default", "icon", "image"];
1
+ export declare const ItemVariants: readonly ["default", "active", "outline", "hover", "hover-action"];
2
+ export declare const ItemSizes: readonly ["default", "sm", "minimal"];
3
+ export declare const ItemMediaVariants: readonly ["default", "icon", "image", "avatar-group"];
4
+ export declare const ItemActionVariants: readonly ["default", "text", "button"];
@@ -1,6 +1,6 @@
1
1
  export { default as UiItem } from './UiItem.vue';
2
2
  export { default as UiItemMedia } from './UiItemMedia.vue';
3
- export { ItemActions as UiItemActions } from '../core/item';
3
+ export { ItemAction as UiItemAction } from '../core/item';
4
4
  export { ItemContent as UiItemContent } from '../core/item';
5
5
  export { ItemDescription as UiItemDescription } from '../core/item';
6
6
  export { ItemFooter as UiItemFooter } from '../core/item';
@@ -1,15 +1,19 @@
1
1
  /**
2
2
  * Variant types for the UiItem primitive component
3
3
  */
4
- export type UiItemVariants = 'default' | 'outline' | 'muted';
4
+ export type UiItemVariants = 'default' | 'active' | 'outline' | 'hover' | 'hover-action';
5
5
  /**
6
6
  * Size types for the UiItem primitive component
7
7
  */
8
- export type UiItemSizes = 'default' | 'sm';
8
+ export type UiItemSizes = 'default' | 'sm' | 'minimal';
9
9
  /**
10
10
  * Media variant types for the UiItemMedia component
11
11
  */
12
- export type UiItemMediaVariants = 'default' | 'icon' | 'image';
12
+ export type UiItemMediaVariants = 'default' | 'icon' | 'image' | 'avatar-group';
13
+ /**
14
+ * Action variant types for the UiItemAction component
15
+ */
16
+ export type UiItemActionVariants = 'default' | 'text' | 'button';
13
17
  /**
14
18
  * A versatile component that you can use to display any content.
15
19
  * The Item component is a straightforward flex container that can house
@@ -17,15 +21,17 @@ export type UiItemMediaVariants = 'default' | 'icon' | 'image';
17
21
  * Group it with the ItemGroup component to create a list of items.
18
22
  * @category Layout
19
23
  * @useCases list item, menu entry, settings row, navigation item, notification, user card
20
- * @keywords item, list, row, entry, menu, settings, navigation, selectable, card
24
+ * @keywords item, list, row, entry, menu, settings, navigation, card
21
25
  * @related UiCard, UiButton, UiListbox
22
26
  */
23
27
  export interface UiItemProps {
24
28
  /**
25
29
  * Visual variant of the item.
26
- * - `default`: Standard styling with subtle background
30
+ * - `default`: Standard styling without interactive affordance
31
+ * - `active`: Active row with a left-edge indicator and active background
27
32
  * - `outline`: Outlined style with clear borders and transparent background
28
- * - `muted`: Subdued appearance with muted colors for secondary content
33
+ * - `hover`: Row with hover feedback
34
+ * - `hover-action`: Actionable row with hover feedback, except while hovering actions
29
35
  * @default 'default'
30
36
  */
31
37
  variant?: UiItemVariants;
@@ -33,23 +39,43 @@ export interface UiItemProps {
33
39
  * Size of the item.
34
40
  * - `default`: Standard size with comfortable padding
35
41
  * - `sm`: Compact size for dense layouts
42
+ * - `minimal`: Compact size with smaller default action affordance
36
43
  * @default 'default'
37
44
  */
38
45
  size?: UiItemSizes;
46
+ /**
47
+ * Convenience title rendered with UiItemTitle.
48
+ */
49
+ title?: string;
50
+ /**
51
+ * Convenience description rendered with UiItemDescription.
52
+ */
53
+ description?: string;
54
+ /**
55
+ * Alias for `description`.
56
+ */
57
+ desc?: string;
39
58
  /**
40
59
  * Whether to render as a child element (using Radix's asChild pattern).
41
60
  * Useful for rendering the item as a link or custom component.
42
- * The hover and focus states will be applied to the custom component.
61
+ * Variant and focus styles will be applied to the custom component.
43
62
  * @default false
44
63
  */
45
64
  asChild?: boolean;
46
65
  /**
47
- * When true (default), sets `role="listitem"` for use inside lists.
48
- * Set false when the parent already provides list semantics (e.g. inside `<li>`).
49
- * @default true
66
+ * When true, sets `role="listitem"` for use inside a parent with `role="list"`.
67
+ * Keep false when rendering standalone items or when the parent already
68
+ * provides list item semantics (e.g. an `<li>`).
69
+ * @default false
50
70
  */
51
71
  withListSemantics?: boolean;
52
72
  }
73
+ export interface UiItemEmits {
74
+ /**
75
+ * Emitted when the built-in default action button is clicked.
76
+ */
77
+ action: [event: MouseEvent];
78
+ }
53
79
  /**
54
80
  * Props for the UiItemGroup component.
55
81
  * Container that groups related items together with consistent styling.
@@ -69,7 +95,8 @@ export interface UiItemMediaProps {
69
95
  * Visual variant of the media container.
70
96
  * - `default`: Standard styling, suitable for avatars
71
97
  * - `icon`: Styled for icon display with appropriate sizing
72
- * - `image`: Styled for image display
98
+ * - `image`: Styled for a single avatar or image thumbnail
99
+ * - `avatar-group`: Styled for stacked avatar groups
73
100
  * @default 'default'
74
101
  */
75
102
  variant?: UiItemMediaVariants;
@@ -90,10 +117,23 @@ export type UiItemTitleProps = Record<string, never>;
90
117
  */
91
118
  export type UiItemDescriptionProps = Record<string, never>;
92
119
  /**
93
- * Props for the UiItemActions component.
120
+ * Props for the UiItemAction component.
94
121
  * Displays action buttons or other interactive elements.
95
122
  */
96
- export type UiItemActionsProps = Record<string, never>;
123
+ export interface UiItemActionProps {
124
+ /**
125
+ * Visual variant of the action container.
126
+ * - `default`: Standard flex action layout
127
+ * - `text`: Muted label action
128
+ * - `button`: Compact button-like action affordance
129
+ * @default 'default'
130
+ */
131
+ variant?: UiItemActionVariants;
132
+ /**
133
+ * Optional tooltip shown when hovering or focusing the action container.
134
+ */
135
+ tooltip?: string;
136
+ }
97
137
  /**
98
138
  * Props for the UiItemHeader component.
99
139
  * Displays a header above the item content.
@@ -1,6 +1,8 @@
1
1
  import { HTMLAttributes } from 'vue';
2
+ type AvatarSize = 5 | 6 | 8 | 10 | 12 | '5' | '6' | '8' | '10' | '12';
2
3
  type __VLS_Props = {
3
4
  class?: HTMLAttributes['class'];
5
+ size?: AvatarSize;
4
6
  };
5
7
  declare function __VLS_template(): {
6
8
  attrs: Partial<{}>;
@@ -1,3 +1,4 @@
1
1
  export { default as Avatar } from './Avatar.vue';
2
2
  export { default as AvatarFallback } from './AvatarFallback.vue';
3
+ export { default as AvatarGroup } from './AvatarGroup.vue';
3
4
  export { default as AvatarImage } from './AvatarImage.vue';
@@ -5,7 +5,7 @@ type __VLS_Props = PrimitiveProps & {
5
5
  class?: HTMLAttributes['class'];
6
6
  variant?: ItemVariants['variant'];
7
7
  size?: ItemVariants['size'];
8
- /** When false, omits `role="listitem"` (e.g. item is already inside an `<li>`). */
8
+ /** When true, sets `role="listitem"` for use inside an element with `role="list"`. */
9
9
  withListSemantics?: boolean;
10
10
  };
11
11
  declare function __VLS_template(): {
@@ -0,0 +1,25 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { ItemActionVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ variant?: ItemActionVariants['variant'];
6
+ tooltip?: string;
7
+ };
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ default?(_: {}): any;
12
+ default?(_: {}): any;
13
+ };
14
+ refs: {};
15
+ rootEl: any;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  export { default as Item } from './Item.vue';
3
- export { default as ItemActions } from './ItemActions.vue';
3
+ export { default as ItemAction } from './ItemAction.vue';
4
4
  export { default as ItemContent } from './ItemContent.vue';
5
5
  export { default as ItemDescription } from './ItemDescription.vue';
6
6
  export { default as ItemFooter } from './ItemFooter.vue';
@@ -10,11 +10,15 @@ export { default as ItemMedia } from './ItemMedia.vue';
10
10
  export { default as ItemSeparator } from './ItemSeparator.vue';
11
11
  export { default as ItemTitle } from './ItemTitle.vue';
12
12
  export declare const itemVariants: (props?: ({
13
- variant?: "default" | "outline" | "muted" | null | undefined;
14
- size?: "default" | "sm" | null | undefined;
13
+ variant?: "default" | "outline" | "active" | "hover" | "hover-action" | null | undefined;
14
+ size?: "default" | "sm" | "minimal" | null | undefined;
15
15
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
16
16
  export declare const itemMediaVariants: (props?: ({
17
- variant?: "default" | "image" | "icon" | null | undefined;
17
+ variant?: "default" | "image" | "icon" | "avatar-group" | null | undefined;
18
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
19
+ export declare const itemActionVariants: (props?: ({
20
+ variant?: "button" | "default" | "text" | null | undefined;
18
21
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
19
22
  export type ItemVariants = VariantProps<typeof itemVariants>;
20
23
  export type ItemMediaVariants = VariantProps<typeof itemMediaVariants>;
24
+ export type ItemActionVariants = VariantProps<typeof itemActionVariants>;
@@ -19,6 +19,7 @@ export * from './UiDropdownMenu';
19
19
  export * from './UiEmpty';
20
20
  export * from './UiField';
21
21
  export * from './UiFileItem';
22
+ export * from './UiFileType';
22
23
  export * from './UiFileUploadBox';
23
24
  export * from './UiIcon';
24
25
  export * from './UiInput';
@@ -0,0 +1 @@
1
+ export declare const ACTIVE_INDICATOR_CLASS = "ui-active-indicator";