@actioneer/ads 0.5.5 → 0.5.7

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 (41) hide show
  1. package/components/agent-icon.js +3 -2
  2. package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
  3. package/components/ai-elements/chain-of-thought-icon.js +341 -201
  4. package/components/ai-elements/chain-of-thought.d.ts +1 -1
  5. package/components/answer-sources.d.ts +42 -0
  6. package/components/answer-sources.js +111 -0
  7. package/components/answer.d.ts +1 -0
  8. package/components/answer.js +665 -671
  9. package/components/assistant-ui/answer-tool-ui.js +11 -7
  10. package/components/assistant-ui/attachment.js +39 -39
  11. package/components/assistant-ui/composer-harness.js +5 -4
  12. package/components/assistant-ui/follow-up-suggestions.d.ts +5 -1
  13. package/components/assistant-ui/follow-up-suggestions.js +47 -19
  14. package/components/assistant-ui/thread-context.d.ts +2 -0
  15. package/components/assistant-ui/thread.js +41 -40
  16. package/components/avatar.js +14 -14
  17. package/components/dropdown.d.ts +1 -1
  18. package/components/dropdown.js +1 -1
  19. package/components/empty-state.d.ts +4 -4
  20. package/components/field.js +16 -16
  21. package/components/index.d.ts +1 -0
  22. package/components/index.js +414 -408
  23. package/components/infinite-canvas.js +1 -1
  24. package/components/pixel-icon.d.ts +3 -1
  25. package/components/pixel-icon.js +294 -214
  26. package/components/segmented.d.ts +4 -1
  27. package/components/segmented.js +9 -8
  28. package/components/sidebar.d.ts +2 -2
  29. package/components/switch.js +22 -4
  30. package/components/table.d.ts +15 -7
  31. package/components/table.js +313 -199
  32. package/components/textarea.js +1 -2
  33. package/components/tooltip.js +1 -1
  34. package/components/ui/tooltip.js +5 -5
  35. package/lib/icons.d.ts +8 -0
  36. package/lib/icons.js +103 -101
  37. package/llms.txt +18 -7
  38. package/manifest.json +125 -13
  39. package/package.json +1 -1
  40. package/styles.css +42 -47
  41. package/theme.css +24 -45
@@ -4,8 +4,11 @@ declare const segmentedListVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  export interface SegmentedOption {
7
- label: string;
7
+ /** Visible option content — text or an icon element. */
8
+ label: React.ReactNode;
8
9
  value: string;
10
+ /** Accessible name; required when `label` is icon-only. */
11
+ ariaLabel?: string;
9
12
  }
10
13
  export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "role">, VariantProps<typeof segmentedListVariants> {
11
14
  options: SegmentedOption[];
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as b } from "react/jsx-runtime";
2
+ import { jsx as n, jsxs as x } from "react/jsx-runtime";
3
3
  import * as l from "react";
4
4
  import { MotionConfig as h, motion as v } from "motion/react";
5
5
  import { cva as d } from "class-variance-authority";
@@ -43,10 +43,10 @@ const y = d(
43
43
  },
44
44
  defaultVariants: { size: "md", selected: !1 }
45
45
  }
46
- ), k = l.forwardRef(({ options: r, value: a, onChange: o, size: s, className: u, ...m }, f) => {
46
+ ), k = l.forwardRef(({ options: r, value: a, onChange: s, size: o, className: u, ...m }, f) => {
47
47
  const p = l.useId(), i = (e) => {
48
- const t = r.findIndex((x) => x.value === a), g = ((t < 0 ? 0 : t) + e + r.length) % r.length;
49
- o(r[g].value);
48
+ const t = r.findIndex((g) => g.value === a), b = ((t < 0 ? 0 : t) + e + r.length) % r.length;
49
+ s(r[b].value);
50
50
  };
51
51
  return /* @__PURE__ */ n(
52
52
  "div",
@@ -65,19 +65,20 @@ const y = d(
65
65
  break;
66
66
  }
67
67
  },
68
- className: c(y({ size: s }), u),
68
+ className: c(y({ size: o }), u),
69
69
  ...m,
70
70
  children: /* @__PURE__ */ n(h, { reducedMotion: "user", children: r.map((e) => {
71
71
  const t = e.value === a;
72
- return /* @__PURE__ */ b(
72
+ return /* @__PURE__ */ x(
73
73
  "button",
74
74
  {
75
75
  type: "button",
76
76
  role: "radio",
77
77
  "aria-checked": t,
78
+ "aria-label": e.ariaLabel,
78
79
  tabIndex: t ? 0 : -1,
79
- onClick: () => o(e.value),
80
- className: D({ size: s, selected: t }),
80
+ onClick: () => s(e.value),
81
+ className: D({ size: o, selected: t }),
81
82
  children: [
82
83
  t && /* @__PURE__ */ n(
83
84
  v.span,
@@ -79,8 +79,8 @@ export interface SidebarActionProps extends React.ButtonHTMLAttributes<HTMLButto
79
79
  icon?: React.ReactNode;
80
80
  }
81
81
  /**
82
- * Primary action for the rail (e.g. "Ask …"). An elevated, subtly-stroked pill
83
- * that collapses to a centered square icon button.
82
+ * Primary action for the rail (e.g. "Ask …"). It shares the quiet navigation
83
+ * treatment at rest and collapses to a centered square icon button.
84
84
  */
85
85
  export declare const SidebarAction: React.ForwardRefExoticComponent<SidebarActionProps & React.RefAttributes<HTMLButtonElement>>;
86
86
  export interface SidebarHistoryProps extends React.HTMLAttributes<HTMLDivElement> {
@@ -3,10 +3,28 @@ import { jsxs as c, jsx as o } from "react/jsx-runtime";
3
3
  import * as d from "react";
4
4
  import { cn as s } from "../lib/cn.js";
5
5
  const m = {
6
- sm: { track: "h-5 w-9", knob: "size-4", on: "translate-x-4", off: "translate-x-0.5" },
7
- md: { track: "h-6 w-11", knob: "size-5", on: "translate-x-5", off: "translate-x-0.5" }
6
+ sm: {
7
+ track: "h-5 w-9",
8
+ knob: "size-4",
9
+ on: "translate-x-4",
10
+ off: "translate-x-0"
11
+ },
12
+ md: {
13
+ track: "h-6 w-11",
14
+ knob: "size-5",
15
+ on: "translate-x-5",
16
+ off: "translate-x-0"
17
+ }
8
18
  }, b = d.forwardRef(
9
- ({ className: i, checked: t = !1, onCheckedChange: n, size: l = "md", disabled: e, children: a, ...u }, f) => {
19
+ ({
20
+ className: i,
21
+ checked: t = !1,
22
+ onCheckedChange: n,
23
+ size: l = "md",
24
+ disabled: e,
25
+ children: a,
26
+ ...u
27
+ }, f) => {
10
28
  const r = m[l];
11
29
  return /* @__PURE__ */ c(
12
30
  "label",
@@ -40,7 +58,7 @@ const m = {
40
58
  {
41
59
  "aria-hidden": !0,
42
60
  className: s(
43
- "inline-block rounded-full bg-elevated shadow-elevation",
61
+ "ml-0.5 inline-block rounded-full bg-elevated shadow-elevation",
44
62
  "transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
45
63
  r.knob,
46
64
  t ? r.on : r.off
@@ -7,6 +7,7 @@ export interface SortDescriptor {
7
7
  column: string;
8
8
  direction: SortDirection;
9
9
  }
10
+ type SortValue = string | number | Date;
10
11
  export type SelectionMode = "none" | "single" | "multiple";
11
12
  /** `"all"` selects every current key without enumerating them. */
12
13
  export type Selection = Set<string> | "all";
@@ -35,6 +36,8 @@ export interface TableProps extends Omit<React.TableHTMLAttributes<HTMLTableElem
35
36
  actionColumnWidth?: string;
36
37
  sortDescriptor?: SortDescriptor;
37
38
  onSortChange?: (descriptor: SortDescriptor) => void;
39
+ /** Enable sortable data-column headers. Defaults to true. */
40
+ allowsSorting?: boolean;
38
41
  /**
39
42
  * A purely display table: no row hover/focus wash, no selection. Set this
40
43
  * when rows have nothing to click — a plain data grid — so hovering never
@@ -46,12 +49,11 @@ export interface TableProps extends Omit<React.TableHTMLAttributes<HTMLTableElem
46
49
  /**
47
50
  * Styled wrapper around a semantic `<table>` with horizontal overflow.
48
51
  *
49
- * Opt-in power features (all backward compatible — a plain `<Table>` is
50
- * unchanged): **row selection** (`selectionMode` + `selectedKeys` /
51
- * `onSelectionChange` / `rowKeys`; give each body `<TableRow>` a `rowKey`),
52
- * **sorting** (`sortDescriptor` + `onSortChange`; mark columns `sortKey`),
53
- * and **sticky columns** (`sticky="left" | "right"` on column/cell). Compose
54
- * with `<Pagination>` below for paging.
52
+ * A plain `<Table>` automatically makes its labeled data columns sortable.
53
+ * Consumers can opt out with `allowsSorting={false}`, or control sorting with
54
+ * `sortDescriptor` + `onSortChange` and explicit column `sortKey` values.
55
+ * Row selection and sticky columns remain opt-in. Compose with `<Pagination>`
56
+ * below for paging.
55
57
  */
56
58
  export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
57
59
  export declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
@@ -64,13 +66,19 @@ export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & R
64
66
  export interface TableColumnProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
65
67
  align?: Align;
66
68
  sticky?: Sticky;
67
- /** Enable sorting on this column; the string is its sort key. */
69
+ /** Sort key used by a consumer-controlled table. */
68
70
  sortKey?: string;
71
+ /** Disable sorting for a non-data or action header. */
72
+ allowsSorting?: boolean;
73
+ /** Assigned internally by Table's automatic header layout. */
74
+ _sortColumnIndex?: number;
69
75
  }
70
76
  export declare const TableColumn: React.ForwardRefExoticComponent<TableColumnProps & React.RefAttributes<HTMLTableCellElement>>;
71
77
  export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
72
78
  align?: Align;
73
79
  sticky?: Sticky;
80
+ /** Explicit value when automatic sorting cannot infer the rendered value. */
81
+ sortValue?: SortValue;
74
82
  }
75
83
  export declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
76
84
  export {};