@cognite/aura 0.3.0 → 0.3.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.
- package/DESIGN.md +2243 -729
- package/README.md +133 -11
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +183 -176
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +4 -4
- package/dist/components/ui/core/alert/alert.js +3 -3
- package/dist/components/ui/core/banner/banner.js +6 -6
- package/dist/components/ui/core/button/button.js +4 -4
- package/dist/components/ui/core/checkbox/checkbox.js +8 -8
- package/dist/components/ui/core/code-block/code-block.js +6 -6
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +73 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +17 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +52 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +64 -75
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +51 -64
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +146 -161
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +124 -137
- package/dist/components/ui/core/date-time-pickers/index.d.ts +4 -0
- package/dist/components/ui/core/date-time-pickers/index.js +10 -0
- package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +8 -8
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +1 -1
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +18 -34
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +32 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +100 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +64 -0
- package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +3 -3
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +1 -1
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +17 -15
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +83 -85
- package/dist/components/ui/core/hover-card/hover-card.js +3 -3
- package/dist/components/ui/core/input/input.js +1 -1
- package/dist/components/ui/core/message/message.js +387 -101
- package/dist/components/ui/core/pagination/pagination.js +9 -7
- package/dist/components/ui/core/prompt-input/prompt-input.js +16 -16
- package/dist/components/ui/core/radio-group/radio-group.js +7 -7
- package/dist/components/ui/core/reasoning/reasoning.js +1 -1
- package/dist/components/ui/core/segmented-control/segmented-control.js +3 -3
- package/dist/components/ui/core/select/select.d.ts +2 -1
- package/dist/components/ui/core/select/select.js +134 -110
- package/dist/components/ui/core/shimmer/shimmer.d.ts +3 -1
- package/dist/components/ui/core/shimmer/shimmer.js +89 -49
- package/dist/components/ui/core/tabs/tabs.js +3 -3
- package/dist/components/ui/core/textarea/textarea.js +1 -1
- package/dist/components/ui/core/toggle/toggle.d.ts +15 -0
- package/dist/components/ui/core/toggle/toggle.js +74 -0
- package/dist/components/ui/core/tool/tool.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/lib/portal-container-context.js +3 -3
- package/dist/lib/use-controllable-state.js +17 -17
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +7 -7
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +3 -0
- package/package.json +200 -18
- package/dist/index.js +0 -308
|
@@ -1,17 +1,36 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
3
|
import { Menu as r } from "@base-ui/react/menu";
|
|
4
|
-
import { IconCheck as l, IconChevronRight as
|
|
5
|
-
import {
|
|
4
|
+
import { IconCheck as l, IconChevronRight as f } from "@tabler/icons-react";
|
|
5
|
+
import { cva as g } from "class-variance-authority";
|
|
6
|
+
import { usePortalContainer as b } from "../../../../lib/portal-container-context.js";
|
|
6
7
|
import { cn as d } from "../../../../lib/utils.js";
|
|
7
|
-
|
|
8
|
+
const c = g(
|
|
9
|
+
"relative flex min-h-9 cursor-default items-center gap-2 rounded-md p-2 text-sm leading-4.5 font-medium outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
inset: {
|
|
13
|
+
true: "pl-8"
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
default: "focus:bg-accent-background focus:text-foreground [&_svg:not([class*='text-'])]:text-foreground",
|
|
17
|
+
destructive: "text-destructive-foreground focus:bg-destructive-background-hover hover:bg-destructive-background-hover focus:text-destructive-foreground [&_svg]:text-destructive-foreground"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
inset: !1,
|
|
22
|
+
variant: "default"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
function I({ ...e }) {
|
|
8
27
|
return /* @__PURE__ */ n(r.Root, { "data-slot": "dropdown-menu", ...e });
|
|
9
28
|
}
|
|
10
|
-
function
|
|
29
|
+
function x({
|
|
11
30
|
container: e,
|
|
12
31
|
...t
|
|
13
32
|
}) {
|
|
14
|
-
const o =
|
|
33
|
+
const o = b();
|
|
15
34
|
return /* @__PURE__ */ n(
|
|
16
35
|
r.Portal,
|
|
17
36
|
{
|
|
@@ -21,22 +40,22 @@ function f({
|
|
|
21
40
|
}
|
|
22
41
|
);
|
|
23
42
|
}
|
|
24
|
-
function
|
|
43
|
+
function C({
|
|
25
44
|
children: e,
|
|
26
45
|
...t
|
|
27
46
|
}) {
|
|
28
47
|
return /* @__PURE__ */ n(r.Trigger, { "data-slot": "dropdown-menu-trigger", ...t, children: e });
|
|
29
48
|
}
|
|
30
|
-
function
|
|
49
|
+
function w({
|
|
31
50
|
align: e = "start",
|
|
32
51
|
alignOffset: t = 0,
|
|
33
52
|
side: o = "bottom",
|
|
34
53
|
sideOffset: a = 4,
|
|
35
54
|
className: s,
|
|
36
|
-
container:
|
|
55
|
+
container: i,
|
|
37
56
|
...p
|
|
38
57
|
}) {
|
|
39
|
-
return /* @__PURE__ */ n(
|
|
58
|
+
return /* @__PURE__ */ n(x, { container: i, children: /* @__PURE__ */ n(
|
|
40
59
|
r.Positioner,
|
|
41
60
|
{
|
|
42
61
|
className: "isolate z-50 outline-none",
|
|
@@ -49,7 +68,7 @@ function b({
|
|
|
49
68
|
{
|
|
50
69
|
"data-slot": "dropdown-menu-content",
|
|
51
70
|
className: d(
|
|
52
|
-
"bg-popover-background text-foreground p-1 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 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-
|
|
71
|
+
"bg-popover-background text-foreground p-1 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 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border border-border shadow-md outline-none",
|
|
53
72
|
s
|
|
54
73
|
),
|
|
55
74
|
...p
|
|
@@ -58,34 +77,28 @@ function b({
|
|
|
58
77
|
}
|
|
59
78
|
) });
|
|
60
79
|
}
|
|
61
|
-
function
|
|
80
|
+
function R({ ...e }) {
|
|
62
81
|
return /* @__PURE__ */ n(r.Group, { "data-slot": "dropdown-menu-group", ...e });
|
|
63
82
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
));
|
|
79
|
-
v.displayName = "DropdownMenuItem";
|
|
80
|
-
const x = i(({ className: e, children: t, checked: o, ...a }, s) => /* @__PURE__ */ c(
|
|
83
|
+
const S = u(
|
|
84
|
+
({ className: e, inset: t, variant: o = "default", children: a, ...s }, i) => /* @__PURE__ */ n(
|
|
85
|
+
r.Item,
|
|
86
|
+
{
|
|
87
|
+
ref: i,
|
|
88
|
+
"data-slot": "dropdown-menu-item",
|
|
89
|
+
"data-inset": t,
|
|
90
|
+
"data-variant": o,
|
|
91
|
+
className: d(c({ inset: t, variant: o }), e),
|
|
92
|
+
...s,
|
|
93
|
+
children: a
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
), _ = u(({ className: e, children: t, checked: o, ...a }, s) => /* @__PURE__ */ m(
|
|
81
97
|
r.CheckboxItem,
|
|
82
98
|
{
|
|
83
99
|
ref: s,
|
|
84
100
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
85
|
-
className: d(
|
|
86
|
-
"focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
87
|
-
e
|
|
88
|
-
),
|
|
101
|
+
className: d(c({ inset: !0 }), e),
|
|
89
102
|
checked: o,
|
|
90
103
|
...a,
|
|
91
104
|
children: [
|
|
@@ -94,8 +107,7 @@ const x = i(({ className: e, children: t, checked: o, ...a }, s) => /* @__PURE__
|
|
|
94
107
|
]
|
|
95
108
|
}
|
|
96
109
|
));
|
|
97
|
-
|
|
98
|
-
function T({
|
|
110
|
+
function y({
|
|
99
111
|
...e
|
|
100
112
|
}) {
|
|
101
113
|
return /* @__PURE__ */ n(
|
|
@@ -106,53 +118,44 @@ function T({
|
|
|
106
118
|
}
|
|
107
119
|
);
|
|
108
120
|
}
|
|
109
|
-
const
|
|
121
|
+
const G = u(({ className: e, children: t, ...o }, a) => /* @__PURE__ */ m(
|
|
110
122
|
r.RadioItem,
|
|
111
123
|
{
|
|
112
124
|
ref: a,
|
|
113
125
|
"data-slot": "dropdown-menu-radio-item",
|
|
114
|
-
className: d(
|
|
115
|
-
"focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
116
|
-
e
|
|
117
|
-
),
|
|
126
|
+
className: d(c({ inset: !0 }), e),
|
|
118
127
|
...o,
|
|
119
128
|
children: [
|
|
120
129
|
/* @__PURE__ */ n("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n(r.RadioItemIndicator, { children: /* @__PURE__ */ n(l, { className: "size-4 text-foreground" }) }) }),
|
|
121
130
|
t
|
|
122
131
|
]
|
|
123
132
|
}
|
|
124
|
-
))
|
|
125
|
-
w.displayName = "DropdownMenuRadioItem";
|
|
126
|
-
const h = i(({ className: e, inset: t, ...o }, a) => /* @__PURE__ */ n(
|
|
133
|
+
)), P = u(({ className: e, inset: t, ...o }, a) => /* @__PURE__ */ n(
|
|
127
134
|
r.GroupLabel,
|
|
128
135
|
{
|
|
129
136
|
ref: a,
|
|
130
137
|
"data-slot": "dropdown-menu-label",
|
|
131
138
|
"data-inset": t,
|
|
132
139
|
className: d(
|
|
133
|
-
"-mx-1 -mt-1 mb-1 px-
|
|
140
|
+
"-mx-1 -mt-1 mb-1 px-3 pt-2 text-sm leading-4.5 border-b border-border font-medium data-inset:pl-8 text-muted-foreground",
|
|
134
141
|
e
|
|
135
142
|
),
|
|
136
143
|
...o
|
|
137
144
|
}
|
|
138
|
-
))
|
|
139
|
-
h.displayName = "DropdownMenuLabel";
|
|
140
|
-
const M = i(
|
|
145
|
+
)), j = u(
|
|
141
146
|
({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
142
147
|
"div",
|
|
143
148
|
{
|
|
144
149
|
ref: o,
|
|
145
150
|
"data-slot": "dropdown-menu-header",
|
|
146
151
|
className: d(
|
|
147
|
-
"-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border
|
|
152
|
+
"-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border p-3 pointer-events-none",
|
|
148
153
|
e
|
|
149
154
|
),
|
|
150
155
|
...t
|
|
151
156
|
}
|
|
152
157
|
)
|
|
153
|
-
)
|
|
154
|
-
M.displayName = "DropdownMenuHeader";
|
|
155
|
-
const D = i(({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
158
|
+
), T = u(({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
156
159
|
r.Separator,
|
|
157
160
|
{
|
|
158
161
|
ref: o,
|
|
@@ -160,9 +163,7 @@ const D = i(({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
|
160
163
|
className: d("bg-border -mx-1 my-1 h-px", e),
|
|
161
164
|
...t
|
|
162
165
|
}
|
|
163
|
-
))
|
|
164
|
-
D.displayName = "DropdownMenuSeparator";
|
|
165
|
-
const N = i(
|
|
166
|
+
)), L = u(
|
|
166
167
|
({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
167
168
|
"span",
|
|
168
169
|
{
|
|
@@ -176,40 +177,38 @@ const N = i(
|
|
|
176
177
|
}
|
|
177
178
|
)
|
|
178
179
|
);
|
|
179
|
-
|
|
180
|
-
function j({
|
|
180
|
+
function V({
|
|
181
181
|
...e
|
|
182
182
|
}) {
|
|
183
183
|
return /* @__PURE__ */ n(r.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...e });
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const H = u(({ className: e, inset: t, children: o, ...a }, s) => /* @__PURE__ */ m(
|
|
186
186
|
r.SubmenuTrigger,
|
|
187
187
|
{
|
|
188
188
|
ref: s,
|
|
189
189
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
190
190
|
"data-inset": t,
|
|
191
191
|
className: d(
|
|
192
|
-
"focus:bg-accent-background focus:text-foreground data-open:bg-accent-background data-open:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-
|
|
192
|
+
"focus:bg-accent-background focus:text-foreground data-open:bg-accent-background data-open:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex min-h-9 cursor-default items-center gap-2 rounded-md px-2 text-sm leading-4.5 font-medium outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
193
193
|
e
|
|
194
194
|
),
|
|
195
195
|
...a,
|
|
196
196
|
children: [
|
|
197
197
|
o,
|
|
198
|
-
/* @__PURE__ */ n(
|
|
198
|
+
/* @__PURE__ */ n(f, { className: "ml-auto size-4" })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
));
|
|
202
|
-
|
|
203
|
-
function H({
|
|
202
|
+
function q({
|
|
204
203
|
align: e = "start",
|
|
205
204
|
alignOffset: t = -3,
|
|
206
205
|
side: o = "right",
|
|
207
206
|
sideOffset: a = 0,
|
|
208
207
|
className: s,
|
|
209
|
-
...
|
|
208
|
+
...i
|
|
210
209
|
}) {
|
|
211
210
|
return /* @__PURE__ */ n(
|
|
212
|
-
|
|
211
|
+
w,
|
|
213
212
|
{
|
|
214
213
|
"data-slot": "dropdown-menu-sub-content",
|
|
215
214
|
className: d("min-w-32 w-auto", s),
|
|
@@ -217,41 +216,40 @@ function H({
|
|
|
217
216
|
alignOffset: t,
|
|
218
217
|
side: o,
|
|
219
218
|
sideOffset: a,
|
|
220
|
-
...
|
|
219
|
+
...i
|
|
221
220
|
}
|
|
222
221
|
);
|
|
223
222
|
}
|
|
224
|
-
const
|
|
223
|
+
const A = u(
|
|
225
224
|
({ className: e, ...t }, o) => /* @__PURE__ */ n(
|
|
226
225
|
"div",
|
|
227
226
|
{
|
|
228
227
|
ref: o,
|
|
229
228
|
"data-slot": "dropdown-menu-section-label",
|
|
230
229
|
className: d(
|
|
231
|
-
"px-2
|
|
230
|
+
"px-3 pt-2 pb-0 text-sm font-medium text-muted-foreground",
|
|
232
231
|
e
|
|
233
232
|
),
|
|
234
233
|
...t
|
|
235
234
|
}
|
|
236
235
|
)
|
|
237
236
|
);
|
|
238
|
-
y.displayName = "DropdownMenuSectionLabel";
|
|
239
237
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
238
|
+
I as DropdownMenu,
|
|
239
|
+
_ as DropdownMenuCheckboxItem,
|
|
240
|
+
w as DropdownMenuContent,
|
|
241
|
+
R as DropdownMenuGroup,
|
|
242
|
+
j as DropdownMenuHeader,
|
|
243
|
+
S as DropdownMenuItem,
|
|
244
|
+
P as DropdownMenuLabel,
|
|
245
|
+
x as DropdownMenuPortal,
|
|
246
|
+
y as DropdownMenuRadioGroup,
|
|
247
|
+
G as DropdownMenuRadioItem,
|
|
248
|
+
A as DropdownMenuSectionLabel,
|
|
249
|
+
T as DropdownMenuSeparator,
|
|
250
|
+
L as DropdownMenuShortcut,
|
|
251
|
+
V as DropdownMenuSub,
|
|
252
|
+
q as DropdownMenuSubContent,
|
|
253
|
+
H as DropdownMenuSubTrigger,
|
|
254
|
+
C as DropdownMenuTrigger
|
|
257
255
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { createContext as p, forwardRef as l, useContext as f, useMemo as u } from "react";
|
|
3
3
|
import { PreviewCard as d } from "@base-ui/react/preview-card";
|
|
4
4
|
import { usePortalContainer as g } from "../../../../lib/portal-container-context.js";
|
|
5
5
|
import { cn as v } from "../../../../lib/utils.js";
|
|
6
|
-
const m =
|
|
6
|
+
const m = p(null);
|
|
7
7
|
function w({
|
|
8
8
|
openDelay: o,
|
|
9
9
|
closeDelay: e,
|
|
10
10
|
...a
|
|
11
11
|
}) {
|
|
12
|
-
const r =
|
|
12
|
+
const r = u(
|
|
13
13
|
() => ({ openDelay: o, closeDelay: e }),
|
|
14
14
|
[o, e]
|
|
15
15
|
);
|