@cognite/aura 0.3.1 → 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 +1651 -7
- package/README.md +45 -3
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +58 -325
- 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 -83
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -62
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -98
- 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 +60 -81
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -189
- 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 +104 -158
- package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
- package/dist/components/ui/core/date-time-pickers/index.js +5 -8
- 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.d.ts +1 -1
- 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.d.ts +0 -2
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -39
- 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/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/shared/time-picker-scroll/time-picker-scroll.js +33 -50
- 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 +79 -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 +42 -0
- 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 +19 -17
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -250
- 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,172 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as
|
|
3
|
-
import {
|
|
4
|
-
import { cva as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"data-slot": "segmented-control",
|
|
14
|
-
className: i("flex flex-col gap-2", t),
|
|
15
|
-
...e
|
|
16
|
-
}
|
|
17
|
-
);
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { createContext as t, useContext as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { cva as a } from "class-variance-authority";
|
|
5
|
+
import { Tabs as o } from "@base-ui/react/tabs";
|
|
6
|
+
//#region libs/aura/src/components/ui/core/segmented-control/segmented-control.tsx
|
|
7
|
+
function s({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ r(o.Root, {
|
|
9
|
+
"data-slot": "segmented-control",
|
|
10
|
+
className: e("flex flex-col gap-2", t),
|
|
11
|
+
...n
|
|
12
|
+
});
|
|
18
13
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
...r
|
|
38
|
-
}) {
|
|
39
|
-
const s = e ?? "default";
|
|
40
|
-
return /* @__PURE__ */ n(
|
|
41
|
-
a.List,
|
|
42
|
-
{
|
|
43
|
-
"data-slot": "segmented-control-list",
|
|
44
|
-
className: i(g({ size: e }), t),
|
|
45
|
-
...r,
|
|
46
|
-
children: /* @__PURE__ */ u(d.Provider, { value: s, children: [
|
|
47
|
-
/* @__PURE__ */ n(p, { size: s }),
|
|
48
|
-
o
|
|
49
|
-
] })
|
|
50
|
-
}
|
|
51
|
-
);
|
|
14
|
+
var c = a("bg-muted-background text-muted-foreground relative isolate inline-flex w-fit items-center justify-center gap-2 p-0.5", {
|
|
15
|
+
variants: { size: {
|
|
16
|
+
default: "h-9 rounded-lg",
|
|
17
|
+
small: "h-7 rounded-md"
|
|
18
|
+
} },
|
|
19
|
+
defaultVariants: { size: "default" }
|
|
20
|
+
}), l = t(void 0);
|
|
21
|
+
function u({ className: t, size: n, children: a, ...s }) {
|
|
22
|
+
let u = n ?? "default";
|
|
23
|
+
return /* @__PURE__ */ r(o.List, {
|
|
24
|
+
"data-slot": "segmented-control-list",
|
|
25
|
+
className: e(c({ size: n }), t),
|
|
26
|
+
...s,
|
|
27
|
+
children: /* @__PURE__ */ i(l.Provider, {
|
|
28
|
+
value: u,
|
|
29
|
+
children: [/* @__PURE__ */ r(f, { size: u }), a]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
52
32
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
-
function p({
|
|
68
|
-
className: t,
|
|
69
|
-
size: e,
|
|
70
|
-
...o
|
|
71
|
-
}) {
|
|
72
|
-
return /* @__PURE__ */ n(
|
|
73
|
-
a.Indicator,
|
|
74
|
-
{
|
|
75
|
-
"data-slot": "segmented-control-indicator",
|
|
76
|
-
className: i(b({ size: e }), t),
|
|
77
|
-
...o
|
|
78
|
-
}
|
|
79
|
-
);
|
|
33
|
+
var d = a("bg-background pointer-events-none absolute top-(--active-tab-top) left-(--active-tab-left) -z-0 h-(--active-tab-height) w-(--active-tab-width) motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none", {
|
|
34
|
+
variants: { size: {
|
|
35
|
+
default: "rounded-md",
|
|
36
|
+
small: "rounded-sm"
|
|
37
|
+
} },
|
|
38
|
+
defaultVariants: { size: "default" }
|
|
39
|
+
});
|
|
40
|
+
function f({ className: t, size: n, ...i }) {
|
|
41
|
+
return /* @__PURE__ */ r(o.Indicator, {
|
|
42
|
+
"data-slot": "segmented-control-indicator",
|
|
43
|
+
className: e(d({ size: n }), t),
|
|
44
|
+
...i
|
|
45
|
+
});
|
|
80
46
|
}
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return /* @__PURE__ */ n(
|
|
141
|
-
a.Tab,
|
|
142
|
-
{
|
|
143
|
-
"data-slot": "segmented-control-trigger",
|
|
144
|
-
className: i(
|
|
145
|
-
v({ size: c, tabContent: o }),
|
|
146
|
-
t
|
|
147
|
-
),
|
|
148
|
-
...r
|
|
149
|
-
}
|
|
150
|
-
);
|
|
47
|
+
var p = a("text-sm leading-4.5 tracking-normal font-medium relative z-10 inline-flex flex-1 items-center justify-center whitespace-nowrap text-muted-foreground dark:text-muted-foreground border border-transparent transition-[color,box-shadow] duration-200 ease-out focus-visible:border-ring focus-visible:ring focus-visible:ring-ring-shadow focus-visible:outline-1 focus-visible:outline-ring [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4 data-disabled:pointer-events-none data-disabled:opacity-50 hover:text-foreground data-active:text-foreground data-active:hover:text-foreground", {
|
|
48
|
+
variants: {
|
|
49
|
+
size: {
|
|
50
|
+
default: "rounded-md",
|
|
51
|
+
small: "rounded-sm"
|
|
52
|
+
},
|
|
53
|
+
tabContent: {
|
|
54
|
+
"icon-label": "",
|
|
55
|
+
"label-only": "",
|
|
56
|
+
"icon-only": "px-0"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
size: "default",
|
|
62
|
+
tabContent: "icon-label",
|
|
63
|
+
className: "h-8 gap-2 px-2 py-0"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
size: "default",
|
|
67
|
+
tabContent: "label-only",
|
|
68
|
+
className: "h-8 gap-0 px-2 py-0"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
size: "default",
|
|
72
|
+
tabContent: "icon-only",
|
|
73
|
+
className: "size-8 gap-0 py-0"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
size: "small",
|
|
77
|
+
tabContent: "icon-label",
|
|
78
|
+
className: "h-6 gap-2 px-2 py-0"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
size: "small",
|
|
82
|
+
tabContent: "label-only",
|
|
83
|
+
className: "h-6 gap-0 px-2 py-0"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
size: "small",
|
|
87
|
+
tabContent: "icon-only",
|
|
88
|
+
className: "size-6 gap-0 py-0"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
defaultVariants: {
|
|
92
|
+
size: "default",
|
|
93
|
+
tabContent: "icon-label"
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
function m({ className: t, size: i, tabContent: a, ...s }) {
|
|
97
|
+
let c = n(l), u = i ?? c;
|
|
98
|
+
return /* @__PURE__ */ r(o.Tab, {
|
|
99
|
+
"data-slot": "segmented-control-trigger",
|
|
100
|
+
className: e(p({
|
|
101
|
+
size: u,
|
|
102
|
+
tabContent: a
|
|
103
|
+
}), t),
|
|
104
|
+
...s
|
|
105
|
+
});
|
|
151
106
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
"data-slot": "segmented-control-content",
|
|
160
|
-
className: i("flex-1 outline-none", t),
|
|
161
|
-
...e
|
|
162
|
-
}
|
|
163
|
-
);
|
|
107
|
+
function h({ className: t, ...n }) {
|
|
108
|
+
return /* @__PURE__ */ r(o.Panel, {
|
|
109
|
+
"data-slot": "segmented-control-content",
|
|
110
|
+
className: e("flex-1 outline-none", t),
|
|
111
|
+
...n
|
|
112
|
+
});
|
|
164
113
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
w as SegmentedControlButton,
|
|
168
|
-
V as SegmentedControlContent,
|
|
169
|
-
S as SegmentedControlList,
|
|
170
|
-
v as segmentedControlButtonVariants,
|
|
171
|
-
g as segmentedControlListVariants
|
|
172
|
-
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { s as SegmentedControl, m as SegmentedControlButton, h as SegmentedControlContent, u as SegmentedControlList, p as segmentedControlButtonVariants, c as segmentedControlListVariants };
|