@wallarm-org/design-system 4.14.0 → 4.15.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 (33) hide show
  1. package/dist/components/AgentAvatar/AgentAvatar.js +71 -54
  2. package/dist/components/AgentGlyph/AgentGlyph.js +38 -87
  3. package/dist/components/Avatar/AgentItem.d.ts +33 -0
  4. package/dist/components/Avatar/AgentItem.js +183 -0
  5. package/dist/components/Avatar/classes.d.ts +3 -0
  6. package/dist/components/Avatar/classes.js +16 -1
  7. package/dist/components/Avatar/index.d.ts +1 -0
  8. package/dist/components/Avatar/index.js +1 -0
  9. package/dist/components/Chat/ChatTrigger.d.ts +1 -1
  10. package/dist/components/Chat/ChatTrigger.js +5 -3
  11. package/dist/components/FilterDropdown/FilterDropdownOption.d.ts +6 -1
  12. package/dist/components/FilterDropdown/FilterDropdownOption.js +66 -49
  13. package/dist/components/FilterDropdown/FilterDropdownTrigger.d.ts +6 -0
  14. package/dist/components/FilterDropdown/FilterDropdownTrigger.js +127 -109
  15. package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts +3 -1
  16. package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.js +12 -10
  17. package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/ValueMenuItem.js +13 -11
  18. package/dist/components/FilterInput/types.d.ts +5 -0
  19. package/dist/components/Select/SelectInput/SelectInputItemRenderer.js +19 -18
  20. package/dist/components/Select/SelectValueIcon.js +3 -1
  21. package/dist/components/Select/types.d.ts +6 -1
  22. package/dist/components/Table/TableBody/TableBodyCell.js +2 -2
  23. package/dist/components/Tag/Tag.js +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/lib/agent-characters/geom.d.ts +4 -0
  27. package/dist/lib/agent-characters/geom.js +12 -1
  28. package/dist/lib/agent-characters/look.d.ts +2 -0
  29. package/dist/lib/agent-characters/look.js +2 -1
  30. package/dist/metadata/components.json +198 -8
  31. package/dist/metadata/guidelines.json +1 -1
  32. package/dist/utils/isValidSvg.js +1 -1
  33. package/package.json +1 -1
@@ -91,6 +91,11 @@ export interface FieldValueOption {
91
91
  * share a label (two `request-id` rows with different paths).
92
92
  */
93
93
  description?: string;
94
+ /**
95
+ * Leading element of the value row, e.g. an agent's `<AgentGlyph size={16} />`.
96
+ * Display-only: the chip still shows the `label` alone.
97
+ */
98
+ icon?: ReactNode;
94
99
  /**
95
100
  * Nested sub-values. When present, this option is a **group** (no own
96
101
  * `value`): a section header at the top level, or a submenu trigger when
@@ -10,7 +10,7 @@ const TAG_SIZE_BY_SELECT_SIZE = {
10
10
  "inline-edit": "large"
11
11
  };
12
12
  const SelectInputItemRenderer = (t0)=>{
13
- const $ = c(15);
13
+ const $ = c(16);
14
14
  const { item, size: t1 } = t0;
15
15
  const size = void 0 === t1 ? "default" : t1;
16
16
  const { value, setValue } = useSelectContext();
@@ -31,23 +31,24 @@ const SelectInputItemRenderer = (t0)=>{
31
31
  const Icon = item.icon;
32
32
  const t3 = TAG_SIZE_BY_SELECT_SIZE[size];
33
33
  let t4;
34
- if ($[4] !== Icon) {
35
- t4 = Icon && /*#__PURE__*/ jsx(Icon, {});
34
+ if ($[4] !== Icon || $[5] !== item.leading) {
35
+ t4 = item.leading ?? (Icon && /*#__PURE__*/ jsx(Icon, {}));
36
36
  $[4] = Icon;
37
- $[5] = t4;
38
- } else t4 = $[5];
37
+ $[5] = item.leading;
38
+ $[6] = t4;
39
+ } else t4 = $[6];
39
40
  let t5;
40
- if ($[6] !== closeTestId || $[7] !== handleRemove) {
41
+ if ($[7] !== closeTestId || $[8] !== handleRemove) {
41
42
  t5 = /*#__PURE__*/ jsx(TagClose, {
42
43
  onClick: handleRemove,
43
44
  "data-testid": closeTestId
44
45
  });
45
- $[6] = closeTestId;
46
- $[7] = handleRemove;
47
- $[8] = t5;
48
- } else t5 = $[8];
46
+ $[7] = closeTestId;
47
+ $[8] = handleRemove;
48
+ $[9] = t5;
49
+ } else t5 = $[9];
49
50
  let t6;
50
- if ($[9] !== item.label || $[10] !== t3 || $[11] !== t4 || $[12] !== t5 || $[13] !== testId) {
51
+ if ($[10] !== item.label || $[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== testId) {
51
52
  t6 = /*#__PURE__*/ jsxs(Tag, {
52
53
  size: t3,
53
54
  "data-testid": testId,
@@ -57,13 +58,13 @@ const SelectInputItemRenderer = (t0)=>{
57
58
  t5
58
59
  ]
59
60
  });
60
- $[9] = item.label;
61
- $[10] = t3;
62
- $[11] = t4;
63
- $[12] = t5;
64
- $[13] = testId;
65
- $[14] = t6;
66
- } else t6 = $[14];
61
+ $[10] = item.label;
62
+ $[11] = t3;
63
+ $[12] = t4;
64
+ $[13] = t5;
65
+ $[14] = testId;
66
+ $[15] = t6;
67
+ } else t6 = $[15];
67
68
  return t6;
68
69
  };
69
70
  export { SelectInputItemRenderer, TAG_SIZE_BY_SELECT_SIZE };
@@ -6,7 +6,9 @@ const SelectValueIcon = (t0)=>{
6
6
  const { index: t1 } = t0;
7
7
  const index = void 0 === t1 ? 0 : t1;
8
8
  const { selectedItems } = useSelectContext();
9
- const Icon = selectedItems.length ? selectedItems[index].icon : null;
9
+ const item = selectedItems[index];
10
+ if (item?.leading) return item.leading;
11
+ const Icon = item?.icon;
10
12
  if (!Icon) return null;
11
13
  let t2;
12
14
  if ($[0] !== Icon) {
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react';
1
+ import type { FC, ReactNode } from 'react';
2
2
  import type { SvgIconProps } from '../../icons/index.js';
3
3
  export interface SelectDataItem {
4
4
  value: string;
@@ -7,4 +7,9 @@ export interface SelectDataItem {
7
7
  description?: string;
8
8
  category?: string;
9
9
  icon?: FC<SvgIconProps>;
10
+ /**
11
+ * A leading element that is not an icon component, such as an agent's `AgentGlyph` (size 20 beside the
12
+ * text-sm option and trigger). The trigger and `SelectInput` chips show it in place of `icon`.
13
+ */
14
+ leading?: ReactNode;
10
15
  }
@@ -78,7 +78,7 @@ const TableBodyCell = (t0)=>{
78
78
  className: "flex items-center justify-between gap-2",
79
79
  children: [
80
80
  /*#__PURE__*/ jsx("div", {
81
- className: "min-w-0 overflow-hidden",
81
+ className: "min-w-0 overflow-x-clip",
82
82
  children: tooltipText ? wrappedContent : content
83
83
  }),
84
84
  /*#__PURE__*/ jsx(TableMasterCellActions, {
@@ -87,7 +87,7 @@ const TableBodyCell = (t0)=>{
87
87
  ]
88
88
  });
89
89
  if (isCut) return /*#__PURE__*/ jsx("div", {
90
- className: "overflow-hidden",
90
+ className: "overflow-x-clip",
91
91
  style: {
92
92
  minWidth: column.columnDef.size
93
93
  },
@@ -5,7 +5,7 @@ import { cva } from "class-variance-authority";
5
5
  import { cn } from "../../utils/cn.js";
6
6
  import { TestIdProvider, useTestId } from "../../utils/testId.js";
7
7
  import { badgeVariants } from "../Badge/index.js";
8
- const tagVariants = cva(cn("inline-flex items-center", "rounded-8 border border-border-primary overlay", "focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-focus-primary", "transition-colors cursor-pointer", "[&_[data-slot=tag-close]]:cursor-pointer"), {
8
+ const tagVariants = cva(cn("inline-flex items-center", "rounded-8 border border-border-primary overlay", "has-[[data-slot=agent-glyph]]:overflow-visible", "focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-focus-primary", "transition-colors cursor-pointer", "[&_[data-slot=tag-close]]:cursor-pointer"), {
9
9
  variants: {
10
10
  disabled: {
11
11
  true: "opacity-50 cursor-not-allowed pointer-events-none",
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export { ApprovalCard, ApprovalCardActions, type ApprovalCardActionsProps, Appro
21
21
  export { AppShell, AppShellAside, type AppShellAsideProps, AppShellHeader, type AppShellHeaderProps, type AppShellProps, AppShellRail, type AppShellRailProps, AppShellRemote, type AppShellRemoteProps, } from './components/AppShell/index.js';
22
22
  export { AssistantMessage, AssistantMessageContent, type AssistantMessageContentProps, AssistantMessageError, type AssistantMessageErrorProps, AssistantMessageLoader, type AssistantMessageLoaderProps, type AssistantMessageProps, } from './components/AssistantMessage/index.js';
23
23
  export { Attribute, AttributeActions, AttributeActionsContent, type AttributeActionsContentProps, AttributeActionsItem, type AttributeActionsItemProps, type AttributeActionsProps, AttributeActionsTarget, type AttributeActionsTargetProps, AttributeLabel, AttributeLabelDescription, type AttributeLabelDescriptionProps, AttributeLabelInfo, type AttributeLabelInfoProps, type AttributeLabelProps, type AttributeProps, AttributeValue, type AttributeValueProps, } from './components/Attribute/index.js';
24
- export { Avatar, AvatarContent, type AvatarContentProps, AvatarDescription, type AvatarDescriptionProps, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, AvatarName, type AvatarNameProps, AvatarOverlay, type AvatarOverlayProps, type AvatarProps, type AvatarStatusChangeDetails, } from './components/Avatar/index.js';
24
+ export { AgentItem, type AgentItemProps, type AgentItemSize, Avatar, AvatarContent, type AvatarContentProps, AvatarDescription, type AvatarDescriptionProps, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, AvatarName, type AvatarNameProps, AvatarOverlay, type AvatarOverlayProps, type AvatarProps, type AvatarStatusChangeDetails, } from './components/Avatar/index.js';
25
25
  export { Badge, type BadgeProps } from './components/Badge/index.js';
26
26
  export { Banner, BannerClose, type BannerCloseProps, BannerContent, type BannerContentProps, BannerControls, type BannerControlsProps, BannerDescription, type BannerDescriptionProps, BannerIcon, type BannerIconProps, BannerLink, type BannerLinkProps, type BannerProps, BannerTitle, type BannerTitleProps, type BannerVariant, } from './components/Banner/index.js';
27
27
  export { Breadcrumbs, BreadcrumbsEllipsis, type BreadcrumbsEllipsisProps, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, BreadcrumbsScopeSwitcher, type BreadcrumbsScopeSwitcherProps, BreadcrumbsSeparator, type BreadcrumbsSeparatorProps, type ScopeSwitcherItem, } from './components/Breadcrumbs/index.js';
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ export { ApprovalCard, ApprovalCardActions, ApprovalCardContent } from "./compon
10
10
  export { AppShell, AppShellAside, AppShellHeader, AppShellRail, AppShellRemote } from "./components/AppShell/index.js";
11
11
  export { AssistantMessage, AssistantMessageContent, AssistantMessageError, AssistantMessageLoader } from "./components/AssistantMessage/index.js";
12
12
  export { Attribute, AttributeActions, AttributeActionsContent, AttributeActionsItem, AttributeActionsTarget, AttributeLabel, AttributeLabelDescription, AttributeLabelInfo, AttributeValue } from "./components/Attribute/index.js";
13
- export { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarImage, AvatarName, AvatarOverlay } from "./components/Avatar/index.js";
13
+ export { AgentItem, Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarImage, AvatarName, AvatarOverlay } from "./components/Avatar/index.js";
14
14
  export { Badge } from "./components/Badge/index.js";
15
15
  export { Banner, BannerClose, BannerContent, BannerControls, BannerDescription, BannerIcon, BannerLink, BannerTitle } from "./components/Banner/index.js";
16
16
  export { Breadcrumbs, BreadcrumbsEllipsis, BreadcrumbsItem, BreadcrumbsScopeSwitcher, BreadcrumbsSeparator } from "./components/Breadcrumbs/index.js";
@@ -21,3 +21,7 @@ export declare function optY(c: {
21
21
  export declare const optPx: (c: {
22
22
  shape: string;
23
23
  }, size: number) => number;
24
+ /** The px between the character's box and its body on each side, so a name can keep its gap from the body. */
25
+ export declare const insetPx: (c: {
26
+ shape: string;
27
+ }, size: number) => number;
@@ -106,4 +106,15 @@ function optY(c) {
106
106
  return v;
107
107
  }
108
108
  const optPx = (c, size)=>-r2(optY(c) * size / 136);
109
- export { SHAPE, geom, optPx, optY, primeGeom, shapeOf };
109
+ const INSET = new Map();
110
+ const insetOf = (c)=>{
111
+ const S = shapeOf(c.shape);
112
+ let v = INSET.get(S.id);
113
+ if (void 0 === v) {
114
+ v = 68 - Math.max(...geom(S).HW);
115
+ INSET.set(S.id, v);
116
+ }
117
+ return v;
118
+ };
119
+ const insetPx = (c, size)=>r2(insetOf(c) * size / 136);
120
+ export { SHAPE, geom, insetPx, optPx, optY, primeGeom, shapeOf };
@@ -21,4 +21,6 @@ export declare function lookIssues(look: Look, { isWally, others }: {
21
21
  * `propPool`: no prop by default (P10), since a custom agent's job is not known.
22
22
  */
23
23
  export declare function defaultLook(agentId: string, others?: readonly Look[], propPool?: readonly AgentPropId[]): AgentLook;
24
+ /** A preset's look; any other id (or none) gets its deterministic default look, never Wally's coral. */
25
+ export declare const lookOf: (id: string | undefined) => AgentLook | import("./data.gen.js").AgentPreset;
24
26
  export {};
@@ -65,4 +65,5 @@ function defaultLook(agentId, others = PRESET_LOOKS, propPool = [
65
65
  }
66
66
  return first;
67
67
  }
68
- export { defaultLook, hash32, lookIssues, rng };
68
+ const lookOf = (id)=>CAST.find((p)=>p.id === id) ?? defaultLook(id ?? '');
69
+ export { defaultLook, hash32, lookIssues, lookOf, rng };