@cognite/aura 0.1.5 → 0.1.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 (74) hide show
  1. package/DESIGN.md +1269 -0
  2. package/README.md +24 -0
  3. package/dist/colors.css +824 -0
  4. package/dist/components/index.d.ts +11 -2
  5. package/dist/components/index.js +284 -249
  6. package/dist/components/ui/core/accordion/accordion.d.ts +24 -0
  7. package/dist/components/ui/core/accordion/accordion.js +113 -0
  8. package/dist/components/ui/core/accordion/accordion.metadata.d.ts +2 -0
  9. package/dist/components/ui/core/accordion/accordion.metadata.js +9 -0
  10. package/dist/components/ui/core/alert/alert.d.ts +2 -1
  11. package/dist/components/ui/core/alert/alert.js +120 -96
  12. package/dist/components/ui/core/alert/alert.metadata.js +1 -1
  13. package/dist/components/ui/core/avatar/avatar.js +29 -32
  14. package/dist/components/ui/core/badge/badge.d.ts +1 -1
  15. package/dist/components/ui/core/badge/badge.js +44 -52
  16. package/dist/components/ui/core/banner/banner.d.ts +40 -0
  17. package/dist/components/ui/core/banner/banner.js +218 -0
  18. package/dist/components/ui/core/banner/banner.metadata.d.ts +2 -0
  19. package/dist/components/ui/core/banner/banner.metadata.js +9 -0
  20. package/dist/components/ui/core/button/button.d.ts +2 -2
  21. package/dist/components/ui/core/button/button.js +19 -20
  22. package/dist/components/ui/core/button-group/button-group.js +10 -10
  23. package/dist/components/ui/core/card/card.js +1 -1
  24. package/dist/components/ui/core/code-block/code-block.d.ts +14 -3
  25. package/dist/components/ui/core/code-block/code-block.js +218 -97
  26. package/dist/components/ui/core/code-block/code-block.metadata.js +1 -1
  27. package/dist/components/ui/core/collapsible/collapsible.js +30 -24
  28. package/dist/components/ui/core/command/command.d.ts +2 -2
  29. package/dist/components/ui/core/command/command.js +30 -30
  30. package/dist/components/ui/core/dialog/dialog.js +8 -8
  31. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +1 -1
  32. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +65 -62
  33. package/dist/components/ui/core/helper-text/helper-text.js +8 -8
  34. package/dist/components/ui/core/hover-card/hover-card.js +5 -5
  35. package/dist/components/ui/core/inline-citation/inline-citation.js +19 -16
  36. package/dist/components/ui/core/input/input.d.ts +1 -5
  37. package/dist/components/ui/core/input/input.js +24 -30
  38. package/dist/components/ui/core/input-group/input-group.d.ts +2 -2
  39. package/dist/components/ui/core/input-group/input-group.js +104 -74
  40. package/dist/components/ui/core/label/label.d.ts +3 -1
  41. package/dist/components/ui/core/label/label.js +39 -16
  42. package/dist/components/ui/core/label/label.metadata.js +2 -2
  43. package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +11 -0
  44. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +13 -0
  45. package/dist/components/ui/core/message/message.d.ts +1 -1
  46. package/dist/components/ui/core/message/message.js +62 -44
  47. package/dist/components/ui/core/popover/popover.d.ts +10 -1
  48. package/dist/components/ui/core/popover/popover.js +137 -34
  49. package/dist/components/ui/core/popover/popover.metadata.js +9 -0
  50. package/dist/components/ui/core/progress/progress.d.ts +10 -0
  51. package/dist/components/ui/core/progress/progress.js +61 -0
  52. package/dist/components/ui/core/progress/progress.metadata.d.ts +2 -0
  53. package/dist/components/ui/core/progress/progress.metadata.js +9 -0
  54. package/dist/components/ui/core/prompt-input/prompt-input.d.ts +2 -2
  55. package/dist/components/ui/core/prompt-input/prompt-input.js +100 -100
  56. package/dist/components/ui/core/scroll-area/scroll-area.d.ts +3 -0
  57. package/dist/components/ui/core/scroll-area/scroll-area.js +71 -0
  58. package/dist/components/ui/core/scroll-area/scroll-area.metadata.d.ts +2 -0
  59. package/dist/components/ui/core/scroll-area/scroll-area.metadata.js +9 -0
  60. package/dist/components/ui/core/select/select.d.ts +3 -3
  61. package/dist/components/ui/core/select/select.js +69 -73
  62. package/dist/components/ui/core/skeleton/skeleton.js +6 -6
  63. package/dist/components/ui/core/sources/sources.js +8 -1
  64. package/dist/components/ui/core/textarea/textarea.d.ts +1 -8
  65. package/dist/components/ui/core/textarea/textarea.js +21 -45
  66. package/dist/components/ui/core/tool/tool.js +58 -50
  67. package/dist/components/ui/core/tooltip/tooltip.js +10 -10
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +281 -249
  70. package/dist/lib/utils.d.ts +6 -6
  71. package/dist/lib/utils.js +26 -26
  72. package/dist/styles.css +1 -1
  73. package/dist/styles.source.css +3 -812
  74. package/package.json +28 -9
@@ -1,55 +1,158 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { Popover as t } from "@base-ui/react/popover";
4
- import { usePortalContainer as l } from "../../../../lib/portal-container-context.js";
5
- import { cn as f } from "../../../../lib/utils.js";
6
- function c(o) {
7
- return /* @__PURE__ */ r(t.Root, { "data-slot": "popover", ...o });
2
+ import { forwardRef as a } from "react";
3
+ import { Popover as i } from "@base-ui/react/popover";
4
+ import { IconX as c } from "@tabler/icons-react";
5
+ import { usePortalContainer as f } from "../../../../lib/portal-container-context.js";
6
+ import { cn as s } from "../../../../lib/utils.js";
7
+ import { Button as v } from "../button/button.js";
8
+ function u(e) {
9
+ return /* @__PURE__ */ r(i.Root, { "data-slot": "popover", ...e });
8
10
  }
9
- c.displayName = "Popover";
10
- function z({
11
- children: o,
12
- ...e
11
+ u.displayName = "Popover";
12
+ function D({
13
+ children: e,
14
+ ...o
13
15
  }) {
14
- return /* @__PURE__ */ r(t.Trigger, { "data-slot": "popover-trigger", ...e, children: o });
16
+ return /* @__PURE__ */ r(i.Trigger, { "data-slot": "popover-trigger", ...o, children: e });
15
17
  }
16
- const g = m(
18
+ const g = a(
19
+ ({ className: e, ...o }, t) => /* @__PURE__ */ r(
20
+ "div",
21
+ {
22
+ ref: t,
23
+ "data-slot": "popover-header",
24
+ className: s(
25
+ "flex flex-col items-start gap-2 self-stretch",
26
+ e
27
+ ),
28
+ ...o
29
+ }
30
+ )
31
+ );
32
+ g.displayName = "PopoverHeader";
33
+ const h = a(
34
+ ({ className: e, ...o }, t) => /* @__PURE__ */ r(
35
+ "div",
36
+ {
37
+ ref: t,
38
+ "data-slot": "popover-header-content",
39
+ className: s(
40
+ "flex items-start justify-between self-stretch",
41
+ e
42
+ ),
43
+ ...o
44
+ }
45
+ )
46
+ );
47
+ h.displayName = "PopoverHeaderContent";
48
+ const P = a(
49
+ ({ className: e, children: o, ...t }, n) => /* @__PURE__ */ r(
50
+ "h3",
51
+ {
52
+ ref: n,
53
+ "data-slot": "popover-title",
54
+ className: s(
55
+ "flex h-7 flex-1 flex-col justify-center self-stretch overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-foreground leading-5 tracking-tighter",
56
+ e
57
+ ),
58
+ ...t,
59
+ children: o
60
+ }
61
+ )
62
+ );
63
+ P.displayName = "PopoverTitle";
64
+ const x = a(({ className: e, ...o }, t) => /* @__PURE__ */ r(
65
+ "p",
66
+ {
67
+ ref: t,
68
+ "data-slot": "popover-description",
69
+ className: s(
70
+ "self-stretch text-sm font-normal text-secondary-foreground leading-[18px] tracking-tight",
71
+ e
72
+ ),
73
+ ...o
74
+ }
75
+ ));
76
+ x.displayName = "PopoverDescription";
77
+ const N = a(
78
+ ({ className: e, ...o }, t) => /* @__PURE__ */ r(
79
+ "div",
80
+ {
81
+ ref: t,
82
+ "data-slot": "popover-slot",
83
+ className: s(
84
+ "flex flex-col items-start gap-3 self-stretch",
85
+ e
86
+ ),
87
+ ...o
88
+ }
89
+ )
90
+ );
91
+ N.displayName = "PopoverSlot";
92
+ const b = a(
93
+ ({ className: e, children: o, "aria-label": t = "Close", ...n }, l) => /* @__PURE__ */ r(
94
+ i.Close,
95
+ {
96
+ "data-slot": "popover-close",
97
+ render: /* @__PURE__ */ r(
98
+ v,
99
+ {
100
+ ref: l,
101
+ variant: "ghost",
102
+ size: "icon-sm",
103
+ className: s("h-7 w-7 shrink-0", e),
104
+ "aria-label": t,
105
+ ...n,
106
+ children: o ?? /* @__PURE__ */ r(c, { className: "h-4 w-4" })
107
+ }
108
+ )
109
+ }
110
+ )
111
+ );
112
+ b.displayName = "PopoverClose";
113
+ const y = a(
17
114
  ({
18
- className: o,
19
- align: e = "center",
20
- alignOffset: a = 0,
115
+ className: e,
116
+ align: o = "center",
117
+ alignOffset: t = 0,
21
118
  side: n = "bottom",
22
- sideOffset: i = 4,
23
- ...d
24
- }, p) => {
25
- const s = l();
26
- return /* @__PURE__ */ r(t.Portal, { container: s, children: /* @__PURE__ */ r(
27
- t.Positioner,
119
+ sideOffset: l = 4,
120
+ ...p
121
+ }, d) => {
122
+ const m = f();
123
+ return /* @__PURE__ */ r(i.Portal, { container: m, children: /* @__PURE__ */ r(
124
+ i.Positioner,
28
125
  {
29
- align: e,
30
- alignOffset: a,
126
+ align: o,
127
+ alignOffset: t,
31
128
  side: n,
32
- sideOffset: i,
129
+ sideOffset: l,
33
130
  className: "isolate z-50",
34
131
  children: /* @__PURE__ */ r(
35
- t.Popup,
132
+ i.Popup,
36
133
  {
37
- ref: p,
134
+ ref: d,
38
135
  "data-slot": "popover-content",
39
- className: f(
40
- "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-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 z-50 w-72 origin-[var(--transform-origin)] rounded-lg border border-border p-3 gap-2 shadow-md outline-none",
41
- o
136
+ className: s(
137
+ "bg-popover-background text-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-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 z-50 flex w-72 flex-col items-start origin-[var(--transform-origin)] rounded-xl border border-border p-4 gap-2 shadow-default outline-none",
138
+ e
42
139
  ),
43
- ...d
140
+ ...p
44
141
  }
45
142
  )
46
143
  }
47
144
  ) });
48
145
  }
49
146
  );
50
- g.displayName = "PopoverContent";
147
+ y.displayName = "PopoverContent";
51
148
  export {
52
- c as Popover,
53
- g as PopoverContent,
54
- z as PopoverTrigger
149
+ u as Popover,
150
+ b as PopoverClose,
151
+ y as PopoverContent,
152
+ x as PopoverDescription,
153
+ g as PopoverHeader,
154
+ h as PopoverHeaderContent,
155
+ N as PopoverSlot,
156
+ P as PopoverTitle,
157
+ D as PopoverTrigger
55
158
  };
@@ -0,0 +1,9 @@
1
+ const o = {
2
+ name: "Popover",
3
+ status: "in-progress-code-review",
4
+ description: "A floating panel anchored to a trigger, with composable header, title, description, close, and slot subcomponents built on Base UI Popover primitives.",
5
+ llmUsage: "Use `<Popover>` with `<PopoverTrigger>` and `<PopoverContent>`, then compose content with `<PopoverHeader>`, `<PopoverHeaderContent>`, `<PopoverTitle>`, `<PopoverDescription>`, optional `<PopoverClose>`, and `<PopoverSlot>`."
6
+ };
7
+ export {
8
+ o as PopoverMetadata
9
+ };
@@ -0,0 +1,10 @@
1
+ import { Progress as ProgressPrimitive } from '@base-ui/react/progress';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const progressTrackVariants: (props?: ({
4
+ size?: "default" | "sm" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ type ProgressProps = ProgressPrimitive.Root.Props & VariantProps<typeof progressTrackVariants> & {
7
+ max?: number;
8
+ };
9
+ declare const Progress: import('react').ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
10
+ export { Progress };
@@ -0,0 +1,61 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as h } from "react";
3
+ import { Progress as s } from "@base-ui/react/progress";
4
+ import { cva as b } from "class-variance-authority";
5
+ import { cn as l } from "../../../../lib/utils.js";
6
+ const k = b(
7
+ "relative w-full overflow-hidden rounded-full bg-muted-background",
8
+ {
9
+ variants: {
10
+ size: {
11
+ default: "h-2",
12
+ sm: "h-1"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ size: "default"
17
+ }
18
+ }
19
+ ), v = h(
20
+ ({
21
+ className: i,
22
+ value: c = 0,
23
+ max: t = 100,
24
+ size: n,
25
+ "aria-label": d,
26
+ ...m
27
+ }, f) => {
28
+ const u = c ?? 0, a = t > 0 ? t : 100, e = Math.max(0, Math.min(u, a)), o = e * 100 / a, g = { width: `${o}%` }, p = `Progress: ${Math.round(o)}%`;
29
+ return /* @__PURE__ */ r(
30
+ s.Root,
31
+ {
32
+ ref: f,
33
+ "data-slot": "progress",
34
+ className: l("block w-full", i),
35
+ value: e,
36
+ max: a,
37
+ "aria-label": d ?? p,
38
+ ...m,
39
+ children: /* @__PURE__ */ r(
40
+ s.Track,
41
+ {
42
+ "data-slot": "progress-track",
43
+ className: l(k({ size: n })),
44
+ children: /* @__PURE__ */ r(
45
+ s.Indicator,
46
+ {
47
+ "data-slot": "progress-indicator",
48
+ className: "bg-active-background h-full transition-[width]",
49
+ style: g
50
+ }
51
+ )
52
+ }
53
+ )
54
+ }
55
+ );
56
+ }
57
+ );
58
+ v.displayName = "Progress";
59
+ export {
60
+ v as Progress
61
+ };
@@ -0,0 +1,2 @@
1
+ import { ComponentMeta } from '../../../../lib/types';
2
+ export declare const ProgressMetadata: ComponentMeta;
@@ -0,0 +1,9 @@
1
+ const s = {
2
+ name: "Progress",
3
+ status: "in-progress-code-review",
4
+ description: "A progress bar component for showing completion status.",
5
+ llmUsage: 'Use `<Progress value={66} size="sm" />` to show progress percentage with optional compact sizing.'
6
+ };
7
+ export {
8
+ s as ProgressMetadata
9
+ };
@@ -44,8 +44,8 @@ type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
44
44
  declare const PromptInputTools: import('react').ForwardRefExoticComponent<PromptInputToolsProps & import('react').RefAttributes<HTMLDivElement>>;
45
45
  type PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;
46
46
  declare const PromptInputButton: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
47
- variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
48
- size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
47
+ variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
48
+ size?: "icon" | "default" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
49
49
  } & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "size"> & import('class-variance-authority').VariantProps<(props?: ({
50
50
  size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
51
51
  } & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;