@cognite/aura 0.3.2 → 0.3.3
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.
- package/DESIGN.md +134 -5
- package/README.md +24 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +58 -327
- package/dist/components/ui/core/accordion/accordion.js +79 -114
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
- package/dist/components/ui/core/alert/alert.js +158 -206
- package/dist/components/ui/core/avatar/avatar.js +64 -90
- package/dist/components/ui/core/badge/badge.js +73 -108
- package/dist/components/ui/core/banner/banner.js +146 -215
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
- package/dist/components/ui/core/button/button.js +47 -52
- package/dist/components/ui/core/button-group/button-group.js +40 -79
- package/dist/components/ui/core/card/card.js +102 -185
- package/dist/components/ui/core/chart/chart.js +116 -206
- package/dist/components/ui/core/chart/index.js +2 -8
- package/dist/components/ui/core/checkbox/checkbox.js +67 -132
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
- package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
- package/dist/components/ui/core/code-block/code-block.js +179 -267
- package/dist/components/ui/core/collapsible/collapsible.js +29 -49
- package/dist/components/ui/core/combobox/combobox.js +41 -0
- package/dist/components/ui/core/command/command.js +85 -150
- package/dist/components/ui/core/count/count.js +21 -32
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
- package/dist/components/ui/core/date-time-pickers/index.js +5 -10
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
- package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
- package/dist/components/ui/core/dialog/dialog.js +82 -155
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
- package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
- package/dist/components/ui/core/empty-state/empty-state.js +86 -138
- package/dist/components/ui/core/helper-text/helper-text.js +37 -65
- package/dist/components/ui/core/hover-card/hover-card.js +54 -80
- package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
- package/dist/components/ui/core/input/input.js +12 -27
- package/dist/components/ui/core/input-group/input-group.js +76 -173
- package/dist/components/ui/core/kbd/kbd.js +20 -36
- package/dist/components/ui/core/label/label.js +26 -43
- package/dist/components/ui/core/loader/loader.js +80 -117
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
- package/dist/components/ui/core/message/message.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +316 -542
- package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
- package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination.js +231 -334
- package/dist/components/ui/core/popover/popover.js +90 -157
- package/dist/components/ui/core/progress/progress.js +36 -61
- package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
- package/dist/components/ui/core/radio-group/radio-group.js +58 -113
- package/dist/components/ui/core/reasoning/reasoning.js +55 -86
- package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
- package/dist/components/ui/core/search/search.js +77 -99
- package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
- package/dist/components/ui/core/select/select.js +168 -293
- package/dist/components/ui/core/separator/separator.js +13 -23
- package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
- package/dist/components/ui/core/shimmer/shimmer.js +40 -107
- package/dist/components/ui/core/skeleton/skeleton.js +13 -18
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
- package/dist/components/ui/core/sources/sources.d.ts +5 -1
- package/dist/components/ui/core/sources/sources.js +58 -79
- package/dist/components/ui/core/switch/switch.js +62 -0
- package/dist/components/ui/core/tabs/tabs.js +149 -223
- package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
- package/dist/components/ui/core/textarea/textarea.js +13 -27
- package/dist/components/ui/core/toggle/toggle.js +55 -74
- package/dist/components/ui/core/tool/tool.js +127 -163
- package/dist/components/ui/core/tooltip/tooltip.js +47 -86
- package/dist/components/ui/core/topbar/topbar.js +106 -190
- package/dist/eslint/index.js +5 -10
- package/dist/eslint/no-overriding-styles.js +178 -237
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/lib/highlight-code.d.ts +9 -0
- package/dist/lib/highlight-code.js +42 -0
- package/dist/lib/portal-container-context.js +8 -9
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/use-controllable-state.js +21 -30
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +32 -112
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +23 -0
- package/package.json +23 -7
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
|
@@ -1,176 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
ref: c,
|
|
110
|
-
"data-slot": "action-toolbar-action",
|
|
111
|
-
variant: a,
|
|
112
|
-
size: "icon",
|
|
113
|
-
"aria-label": o,
|
|
114
|
-
className: t,
|
|
115
|
-
...l,
|
|
116
|
-
children: r
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ i(N, { sideOffset: 18, children: o })
|
|
122
|
-
] }) : /* @__PURE__ */ i(
|
|
123
|
-
f,
|
|
124
|
-
{
|
|
125
|
-
ref: c,
|
|
126
|
-
"data-slot": "action-toolbar-action",
|
|
127
|
-
variant: a,
|
|
128
|
-
size: n ? "icon" : "default",
|
|
129
|
-
"aria-label": o,
|
|
130
|
-
className: t,
|
|
131
|
-
...l,
|
|
132
|
-
children: r
|
|
133
|
-
}
|
|
134
|
-
)
|
|
135
|
-
);
|
|
136
|
-
u.displayName = "ActionToolbarAction";
|
|
137
|
-
const j = e(
|
|
138
|
-
({ icon: t, label: a = "Clear", ...n }, o) => /* @__PURE__ */ m(
|
|
139
|
-
u,
|
|
140
|
-
{
|
|
141
|
-
ref: o,
|
|
142
|
-
"data-slot": "action-toolbar-action-clear",
|
|
143
|
-
variant: "secondaryOnDark",
|
|
144
|
-
iconOnly: !1,
|
|
145
|
-
...n,
|
|
146
|
-
children: [
|
|
147
|
-
t ?? /* @__PURE__ */ i(T, {}),
|
|
148
|
-
a
|
|
149
|
-
]
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
);
|
|
153
|
-
j.displayName = "ActionToolbarActionClear";
|
|
154
|
-
const D = e(
|
|
155
|
-
({ className: t, ...a }, n) => /* @__PURE__ */ i(
|
|
156
|
-
u,
|
|
157
|
-
{
|
|
158
|
-
ref: n,
|
|
159
|
-
"data-slot": "action-toolbar-primary-action",
|
|
160
|
-
variant: "defaultOnDark",
|
|
161
|
-
iconOnly: !1,
|
|
162
|
-
className: s("ml-2", t),
|
|
163
|
-
...a
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
);
|
|
167
|
-
D.displayName = "ActionToolbarPrimaryAction";
|
|
168
|
-
export {
|
|
169
|
-
k as ActionToolbar,
|
|
170
|
-
u as ActionToolbarAction,
|
|
171
|
-
j as ActionToolbarActionClear,
|
|
172
|
-
O as ActionToolbarActions,
|
|
173
|
-
D as ActionToolbarPrimaryAction,
|
|
174
|
-
C as ActionToolbarSelection,
|
|
175
|
-
S as ActionToolbarSelectionSummary
|
|
176
|
-
};
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "../tooltip/tooltip.js";
|
|
4
|
+
import { createContext as o, forwardRef as s, useContext as c, useMemo as l } from "react";
|
|
5
|
+
import { IconX as u } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { cva as p } from "class-variance-authority";
|
|
8
|
+
//#region libs/aura/src/components/ui/core/action-toolbar/action-toolbar.tsx
|
|
9
|
+
var m = p("min-w-[400px] max-w-[1200px] h-14 flex items-center justify-between gap-3 bg-raised-background text-foreground-fixed-light pl-4 pr-3 rounded-xl shadow-default", {
|
|
10
|
+
variants: { width: {
|
|
11
|
+
full: "w-full",
|
|
12
|
+
fit: "w-fit"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { width: "full" }
|
|
15
|
+
}), h = o({ selectedCount: void 0 }), g = s(({ className: t, width: n, role: r = "toolbar", selectedCount: a, ...o }, s) => {
|
|
16
|
+
let c = typeof a == "number" && a === 0, u = l(() => ({ selectedCount: a }), [a]);
|
|
17
|
+
return c ? null : /* @__PURE__ */ d(i, {
|
|
18
|
+
delayDuration: 0,
|
|
19
|
+
children: /* @__PURE__ */ d(h.Provider, {
|
|
20
|
+
value: u,
|
|
21
|
+
children: /* @__PURE__ */ d("div", {
|
|
22
|
+
ref: s,
|
|
23
|
+
"data-slot": "action-toolbar",
|
|
24
|
+
role: r,
|
|
25
|
+
className: e(m({ width: n }), t),
|
|
26
|
+
...o
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
g.displayName = "ActionToolbar";
|
|
32
|
+
var _ = s(({ className: t, role: n = "group", ...r }, i) => /* @__PURE__ */ d("div", {
|
|
33
|
+
ref: i,
|
|
34
|
+
"data-slot": "action-toolbar-selection",
|
|
35
|
+
role: n,
|
|
36
|
+
className: e("flex min-w-0 shrink-0 items-center gap-3", t),
|
|
37
|
+
...r
|
|
38
|
+
}));
|
|
39
|
+
_.displayName = "ActionToolbarSelection";
|
|
40
|
+
var v = s(({ className: t, count: n, label: r = "selected", children: i, ...a }, o) => {
|
|
41
|
+
let { selectedCount: s } = c(h), l = n ?? s;
|
|
42
|
+
return /* @__PURE__ */ d("div", {
|
|
43
|
+
ref: o,
|
|
44
|
+
"data-slot": "action-toolbar-selection-summary",
|
|
45
|
+
className: e("flex min-w-0", t),
|
|
46
|
+
...a,
|
|
47
|
+
children: i ?? /* @__PURE__ */ f("span", {
|
|
48
|
+
"data-slot": "action-toolbar-selection-label",
|
|
49
|
+
className: "flex min-w-0 items-center gap-0.5 text-sm font-medium leading-4.5 tracking-normal text-foreground-fixed-light",
|
|
50
|
+
children: [l == null ? null : /* @__PURE__ */ d("span", { children: l }), /* @__PURE__ */ d("span", {
|
|
51
|
+
className: "truncate",
|
|
52
|
+
children: r
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
v.displayName = "ActionToolbarSelectionSummary";
|
|
58
|
+
var y = s(({ className: t, role: n = "group", ...r }, i) => /* @__PURE__ */ d("div", {
|
|
59
|
+
ref: i,
|
|
60
|
+
"data-slot": "action-toolbar-actions",
|
|
61
|
+
role: n,
|
|
62
|
+
className: e("flex min-w-0 shrink-0 items-center justify-end gap-1", t),
|
|
63
|
+
...r
|
|
64
|
+
}));
|
|
65
|
+
y.displayName = "ActionToolbarActions";
|
|
66
|
+
var b = s(({ className: e, variant: i = "ghostOnDark", iconOnly: o = !1, "aria-label": s, children: c, ...l }, u) => o && s ? /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(a, { render: /* @__PURE__ */ d(t, {
|
|
67
|
+
ref: u,
|
|
68
|
+
"data-slot": "action-toolbar-action",
|
|
69
|
+
variant: i,
|
|
70
|
+
size: "icon",
|
|
71
|
+
"aria-label": s,
|
|
72
|
+
className: e,
|
|
73
|
+
...l,
|
|
74
|
+
children: c
|
|
75
|
+
}) }), /* @__PURE__ */ d(r, {
|
|
76
|
+
sideOffset: 18,
|
|
77
|
+
children: s
|
|
78
|
+
})] }) : /* @__PURE__ */ d(t, {
|
|
79
|
+
ref: u,
|
|
80
|
+
"data-slot": "action-toolbar-action",
|
|
81
|
+
variant: i,
|
|
82
|
+
size: o ? "icon" : "default",
|
|
83
|
+
"aria-label": s,
|
|
84
|
+
className: e,
|
|
85
|
+
...l,
|
|
86
|
+
children: c
|
|
87
|
+
}));
|
|
88
|
+
b.displayName = "ActionToolbarAction";
|
|
89
|
+
var x = s(({ icon: e, label: t = "Clear", ...n }, r) => /* @__PURE__ */ f(b, {
|
|
90
|
+
ref: r,
|
|
91
|
+
"data-slot": "action-toolbar-action-clear",
|
|
92
|
+
variant: "secondaryOnDark",
|
|
93
|
+
iconOnly: !1,
|
|
94
|
+
...n,
|
|
95
|
+
children: [e ?? /* @__PURE__ */ d(u, {}), t]
|
|
96
|
+
}));
|
|
97
|
+
x.displayName = "ActionToolbarActionClear";
|
|
98
|
+
var S = s(({ className: t, ...n }, r) => /* @__PURE__ */ d(b, {
|
|
99
|
+
ref: r,
|
|
100
|
+
"data-slot": "action-toolbar-primary-action",
|
|
101
|
+
variant: "defaultOnDark",
|
|
102
|
+
iconOnly: !1,
|
|
103
|
+
className: e("ml-2", t),
|
|
104
|
+
...n
|
|
105
|
+
}));
|
|
106
|
+
S.displayName = "ActionToolbarPrimaryAction";
|
|
107
|
+
//#endregion
|
|
108
|
+
export { g as ActionToolbar, b as ActionToolbarAction, x as ActionToolbarActionClear, y as ActionToolbarActions, S as ActionToolbarPrimaryAction, _ as ActionToolbarSelection, v as ActionToolbarSelectionSummary };
|