@cognite/aura 0.1.0 → 0.1.2

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 (38) hide show
  1. package/dist/components/index.d.ts +7 -1
  2. package/dist/components/index.js +251 -0
  3. package/dist/components/ui/core/button/button.d.ts +1 -1
  4. package/dist/components/ui/core/card/card.d.ts +17 -0
  5. package/dist/components/ui/core/card/card.js +143 -0
  6. package/dist/components/ui/core/card/card.metadata.d.ts +8 -0
  7. package/dist/components/ui/core/card/card.metadata.js +9 -0
  8. package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
  9. package/dist/components/ui/core/combobox/combobox.d.ts +15 -0
  10. package/dist/components/ui/{lab/topbar/topbar.metadata.d.ts → core/combobox/combobox.metadata.d.ts} +1 -1
  11. package/dist/components/ui/core/command/command.d.ts +2 -2
  12. package/dist/components/ui/core/dialog/dialog.js +56 -55
  13. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +40 -38
  14. package/dist/components/ui/core/helper-text/helper-text.js +1 -1
  15. package/dist/components/ui/core/hover-card/hover-card.js +48 -44
  16. package/dist/components/ui/core/inline-citation/inline-citation.d.ts +2 -2
  17. package/dist/components/ui/core/inline-citation/inline-citation.js +3 -3
  18. package/dist/components/ui/core/input-group/input-group.d.ts +1 -1
  19. package/dist/components/ui/core/message/message.d.ts +1 -1
  20. package/dist/components/ui/core/message/message.js +187 -120
  21. package/dist/components/ui/core/popover/popover.js +55 -0
  22. package/dist/components/ui/core/prompt-input/prompt-input.d.ts +1 -1
  23. package/dist/components/ui/core/prompt-input/prompt-input.js +18 -18
  24. package/dist/components/ui/core/reasoning/reasoning.js +4 -1
  25. package/dist/components/ui/core/select/select.js +37 -35
  26. package/dist/components/ui/core/sources/sources.js +68 -0
  27. package/dist/components/ui/core/tool/tool.js +1 -1
  28. package/dist/components/ui/core/tooltip/tooltip.js +42 -38
  29. package/dist/index.js +249 -227
  30. package/dist/lib/portal-container-context.d.ts +2 -0
  31. package/dist/lib/portal-container-context.js +12 -0
  32. package/dist/lib/utils.js +44 -30
  33. package/dist/styles.css +1 -0
  34. package/package.json +17 -6
  35. package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +0 -134
  36. package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +0 -2
  37. package/dist/components/ui/lab/topbar/topbar.d.ts +0 -10
  38. package/dist/lib/component-status-config.d.ts +0 -12
@@ -1,17 +1,18 @@
1
1
  import { jsx as t, jsxs as u, Fragment as C } from "react/jsx-runtime";
2
2
  import { createContext as N, useMemo as y, useId as z, useContext as I } from "react";
3
3
  import { Select as o } from "@base-ui/react/select";
4
- import { IconCheck as V, IconChevronDown as v, IconChevronUp as _, IconExclamationCircle as O } from "@tabler/icons-react";
5
- import { useControllableState as P } from "../../../../lib/use-controllable-state.js";
6
- import { getPortalContainer as j, cn as s, disabledState as k, invalidState as D, focusState as T, filledState as B, hoverState as E, formElementBase as G } from "../../../../lib/utils.js";
7
- const f = N(null), L = () => {
8
- const e = I(f);
4
+ import { IconCheck as V, IconChevronDown as h, IconChevronUp as _, IconExclamationCircle as O } from "@tabler/icons-react";
5
+ import { usePortalContainer as P } from "../../../../lib/portal-container-context.js";
6
+ import { useControllableState as j } from "../../../../lib/use-controllable-state.js";
7
+ import { cn as s, disabledState as k, invalidState as D, focusState as T, filledState as B, hoverState as E, formElementBase as G } from "../../../../lib/utils.js";
8
+ const g = N(null), L = () => {
9
+ const e = I(g);
9
10
  if (!e)
10
11
  throw new Error("Select components must be used within Select");
11
12
  return e;
12
13
  };
13
- function K(e) {
14
- const [a, l] = P({
14
+ function Q(e) {
15
+ const [a, l] = j({
15
16
  prop: e.open,
16
17
  defaultProp: e.defaultOpen ?? !1,
17
18
  onChange: e.onOpenChange
@@ -19,44 +20,44 @@ function K(e) {
19
20
  if (e.multiple) {
20
21
  const {
21
22
  multiple: m,
22
- value: g,
23
+ value: v,
23
24
  defaultValue: b,
24
25
  onValueChange: S,
25
26
  ...w
26
27
  } = e;
27
- return /* @__PURE__ */ t(f.Provider, { value: n, children: /* @__PURE__ */ t(
28
+ return /* @__PURE__ */ t(g.Provider, { value: n, children: /* @__PURE__ */ t(
28
29
  o.Root,
29
30
  {
30
31
  "data-slot": "select",
31
32
  open: a,
32
- onOpenChange: (p) => l(p),
33
- value: g,
33
+ onOpenChange: (f) => l(f),
34
+ value: v,
34
35
  defaultValue: b,
35
- onValueChange: (p, R) => {
36
- S?.(p ?? []);
36
+ onValueChange: (f, R) => {
37
+ S?.(f ?? []);
37
38
  },
38
39
  multiple: !0,
39
40
  ...w
40
41
  }
41
42
  ) });
42
43
  }
43
- const { value: r, defaultValue: i, onValueChange: c, ...d } = e, h = r === void 0 ? void 0 : r === "" ? null : r, x = i === void 0 ? void 0 : i === "" ? null : i;
44
- return /* @__PURE__ */ t(f.Provider, { value: n, children: /* @__PURE__ */ t(
44
+ const { value: r, defaultValue: i, onValueChange: c, ...d } = e, p = r === void 0 ? void 0 : r === "" ? null : r, x = i === void 0 ? void 0 : i === "" ? null : i;
45
+ return /* @__PURE__ */ t(g.Provider, { value: n, children: /* @__PURE__ */ t(
45
46
  o.Root,
46
47
  {
47
48
  "data-slot": "select",
48
49
  open: a,
49
50
  onOpenChange: (m) => l(m),
50
- value: h,
51
+ value: p,
51
52
  defaultValue: x,
52
- onValueChange: (m, g) => {
53
+ onValueChange: (m, v) => {
53
54
  c?.(typeof m == "string" ? m : "");
54
55
  },
55
56
  ...d
56
57
  }
57
58
  ) });
58
59
  }
59
- function Q({ className: e, ...a }) {
60
+ function X({ className: e, ...a }) {
60
61
  return /* @__PURE__ */ t(
61
62
  o.Group,
62
63
  {
@@ -66,7 +67,7 @@ function Q({ className: e, ...a }) {
66
67
  }
67
68
  );
68
69
  }
69
- function X({
70
+ function Y({
70
71
  icon: e,
71
72
  ...a
72
73
  }) {
@@ -75,7 +76,7 @@ function X({
75
76
  /* @__PURE__ */ t(o.Value, { "data-slot": "select-value", ...a })
76
77
  ] }) : /* @__PURE__ */ t(o.Value, { "data-slot": "select-value", ...a });
77
78
  }
78
- function Y({
79
+ function Z({
79
80
  className: e,
80
81
  size: a = "default",
81
82
  children: l,
@@ -111,7 +112,7 @@ function Y({
111
112
  o.Icon,
112
113
  {
113
114
  render: /* @__PURE__ */ t(
114
- v,
115
+ h,
115
116
  {
116
117
  className: s(
117
118
  "size-4 opacity-50 transition-transform",
@@ -137,7 +138,7 @@ function Y({
137
138
  )
138
139
  ] });
139
140
  }
140
- function Z({
141
+ function M({
141
142
  className: e,
142
143
  children: a,
143
144
  position: l = "popper",
@@ -147,7 +148,8 @@ function Z({
147
148
  sideOffset: c = 4,
148
149
  ...d
149
150
  }) {
150
- return /* @__PURE__ */ t(o.Portal, { container: j(), children: /* @__PURE__ */ t(
151
+ const p = P();
152
+ return /* @__PURE__ */ t(o.Portal, { container: p, children: /* @__PURE__ */ t(
151
153
  o.Positioner,
152
154
  {
153
155
  alignItemWithTrigger: !1,
@@ -177,7 +179,7 @@ function Z({
177
179
  }
178
180
  ) });
179
181
  }
180
- function M({
182
+ function ee({
181
183
  className: e,
182
184
  ...a
183
185
  }) {
@@ -190,7 +192,7 @@ function M({
190
192
  }
191
193
  );
192
194
  }
193
- function ee({
195
+ function te({
194
196
  className: e,
195
197
  children: a,
196
198
  icon: l,
@@ -218,7 +220,7 @@ function ee({
218
220
  }
219
221
  );
220
222
  }
221
- function te({
223
+ function ae({
222
224
  className: e,
223
225
  ...a
224
226
  }) {
@@ -261,19 +263,19 @@ function A({
261
263
  e
262
264
  ),
263
265
  ...a,
264
- children: /* @__PURE__ */ t(v, { className: "size-4" })
266
+ children: /* @__PURE__ */ t(h, { className: "size-4" })
265
267
  }
266
268
  );
267
269
  }
268
270
  export {
269
- K as Select,
270
- Z as SelectContent,
271
- Q as SelectGroup,
272
- ee as SelectItem,
273
- M as SelectLabel,
271
+ Q as Select,
272
+ M as SelectContent,
273
+ X as SelectGroup,
274
+ te as SelectItem,
275
+ ee as SelectLabel,
274
276
  A as SelectScrollDownButton,
275
277
  U as SelectScrollUpButton,
276
- te as SelectSeparator,
277
- Y as SelectTrigger,
278
- X as SelectValue
278
+ ae as SelectSeparator,
279
+ Z as SelectTrigger,
280
+ Y as SelectValue
279
281
  };
@@ -0,0 +1,68 @@
1
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
2
+ import { IconMist as f } from "@tabler/icons-react";
3
+ import { cn as l } from "../../../../lib/utils.js";
4
+ import { InlineCitation as p, InlineCitationLink as x } from "../inline-citation/inline-citation.js";
5
+ const S = ({ className: r, title: e, children: t, ...o }) => {
6
+ const n = e === !1 || e === "false", i = e === void 0 || e === !0 ? /* @__PURE__ */ s(h, {}) : e;
7
+ return /* @__PURE__ */ c(
8
+ "div",
9
+ {
10
+ "data-slot": "sources",
11
+ className: l("flex flex-col gap-2 py-2", r),
12
+ ...o,
13
+ children: [
14
+ n ? null : i,
15
+ /* @__PURE__ */ s("div", { "data-slot": "sources-items", className: "flex flex-wrap gap-2", children: t })
16
+ ]
17
+ }
18
+ );
19
+ }, h = ({
20
+ className: r,
21
+ title: e = "Sources",
22
+ children: t,
23
+ ...o
24
+ }) => /* @__PURE__ */ c(
25
+ "div",
26
+ {
27
+ "data-slot": "sources-title",
28
+ className: l(
29
+ "flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground",
30
+ r
31
+ ),
32
+ ...o,
33
+ children: [
34
+ /* @__PURE__ */ s(f, { className: "size-4 shrink-0" }),
35
+ t ?? /* @__PURE__ */ s("span", { children: e })
36
+ ]
37
+ }
38
+ ), I = ({
39
+ href: r,
40
+ url: e,
41
+ title: t,
42
+ variant: o = "mountain",
43
+ target: n = "_blank",
44
+ icon: i,
45
+ className: d,
46
+ children: u,
47
+ ...m
48
+ }) => {
49
+ const a = r || e;
50
+ return a ? /* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(
51
+ x,
52
+ {
53
+ "data-slot": "source",
54
+ href: a,
55
+ target: n,
56
+ variant: o,
57
+ icon: i,
58
+ className: d,
59
+ ...m,
60
+ children: u ?? t
61
+ }
62
+ ) }) : null;
63
+ };
64
+ export {
65
+ I as Source,
66
+ S as Sources,
67
+ h as SourcesTitle
68
+ };
@@ -58,7 +58,7 @@ const v = s(({ className: t, ...o }, l) => /* @__PURE__ */ e(
58
58
  ref: l,
59
59
  "data-slot": "tool-content",
60
60
  className: d(
61
- "flex flex-col gap-4 py-3 text-popover-foreground outline-none",
61
+ "data-open:flex flex-col py-3 gap-6 text-popover-foreground outline-none",
62
62
  t
63
63
  ),
64
64
  ...o
@@ -1,8 +1,9 @@
1
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
2
  import { forwardRef as i } from "react";
3
3
  import { Tooltip as e } from "@base-ui/react/tooltip";
4
- import { getPortalContainer as f, cn as g } from "../../../../lib/utils.js";
5
- function x({
4
+ import { usePortalContainer as g } from "../../../../lib/portal-container-context.js";
5
+ import { cn as c } from "../../../../lib/utils.js";
6
+ function P({
6
7
  delayDuration: t = 0,
7
8
  ...a
8
9
  }) {
@@ -15,7 +16,7 @@ function x({
15
16
  }
16
17
  );
17
18
  }
18
- function z({
19
+ function w({
19
20
  disableHoverableContent: t,
20
21
  ...a
21
22
  }) {
@@ -28,7 +29,7 @@ function z({
28
29
  }
29
30
  );
30
31
  }
31
- const c = i((t, a) => /* @__PURE__ */ o(
32
+ const u = i((t, a) => /* @__PURE__ */ o(
32
33
  e.Trigger,
33
34
  {
34
35
  ref: a,
@@ -36,8 +37,8 @@ const c = i((t, a) => /* @__PURE__ */ o(
36
37
  ...t
37
38
  }
38
39
  ));
39
- c.displayName = "TooltipTrigger";
40
- const u = i(
40
+ u.displayName = "TooltipTrigger";
41
+ const h = i(
41
42
  ({
42
43
  className: t,
43
44
  side: a = "top",
@@ -46,37 +47,40 @@ const u = i(
46
47
  alignOffset: r = 0,
47
48
  children: s,
48
49
  ...l
49
- }, p) => /* @__PURE__ */ o(e.Portal, { container: f(), children: /* @__PURE__ */ o(
50
- e.Positioner,
51
- {
52
- align: n,
53
- alignOffset: r,
54
- side: a,
55
- sideOffset: d,
56
- className: "isolate z-50 min-w-max",
57
- children: /* @__PURE__ */ m(
58
- e.Popup,
59
- {
60
- ref: p,
61
- "data-slot": "tooltip-content",
62
- className: g(
63
- "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin) rounded-md p-2 text-sm font-medium leading-tight",
64
- t
65
- ),
66
- ...l,
67
- children: [
68
- s,
69
- /* @__PURE__ */ o(e.Arrow, { className: "size-2.5 -translate-y-1/2 rotate-45 rounded-xs data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=bottom]:-mt-0.5 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5 data-[side=top]:-mt-0.5" })
70
- ]
71
- }
72
- )
73
- }
74
- ) })
50
+ }, m) => {
51
+ const p = g();
52
+ return /* @__PURE__ */ o(e.Portal, { container: p, children: /* @__PURE__ */ o(
53
+ e.Positioner,
54
+ {
55
+ align: n,
56
+ alignOffset: r,
57
+ side: a,
58
+ sideOffset: d,
59
+ className: "isolate z-50 min-w-max",
60
+ children: /* @__PURE__ */ f(
61
+ e.Popup,
62
+ {
63
+ ref: m,
64
+ "data-slot": "tooltip-content",
65
+ className: c(
66
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin) rounded-md p-2 text-sm font-medium leading-tight",
67
+ t
68
+ ),
69
+ ...l,
70
+ children: [
71
+ s,
72
+ /* @__PURE__ */ o(e.Arrow, { className: "size-2.5 -translate-y-1/2 rotate-45 rounded-xs data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=bottom]:-mt-0.5 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5 data-[side=top]:-mt-0.5" })
73
+ ]
74
+ }
75
+ )
76
+ }
77
+ ) });
78
+ }
75
79
  );
76
- u.displayName = "TooltipContent";
80
+ h.displayName = "TooltipContent";
77
81
  export {
78
- z as Tooltip,
79
- u as TooltipContent,
80
- x as TooltipProvider,
81
- c as TooltipTrigger
82
+ w as Tooltip,
83
+ h as TooltipContent,
84
+ P as TooltipProvider,
85
+ u as TooltipTrigger
82
86
  };