@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.
Files changed (108) hide show
  1. package/DESIGN.md +134 -5
  2. package/README.md +24 -3
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/components/index.js +58 -327
  5. package/dist/components/ui/core/accordion/accordion.js +79 -114
  6. package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
  7. package/dist/components/ui/core/alert/alert.js +158 -206
  8. package/dist/components/ui/core/avatar/avatar.js +64 -90
  9. package/dist/components/ui/core/badge/badge.js +73 -108
  10. package/dist/components/ui/core/banner/banner.js +146 -215
  11. package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
  12. package/dist/components/ui/core/button/button.js +47 -52
  13. package/dist/components/ui/core/button-group/button-group.js +40 -79
  14. package/dist/components/ui/core/card/card.js +102 -185
  15. package/dist/components/ui/core/chart/chart.js +116 -206
  16. package/dist/components/ui/core/chart/index.js +2 -8
  17. package/dist/components/ui/core/checkbox/checkbox.js +67 -132
  18. package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
  19. package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
  20. package/dist/components/ui/core/code-block/code-block.js +179 -267
  21. package/dist/components/ui/core/collapsible/collapsible.js +29 -49
  22. package/dist/components/ui/core/combobox/combobox.js +41 -0
  23. package/dist/components/ui/core/command/command.js +85 -150
  24. package/dist/components/ui/core/count/count.js +21 -32
  25. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
  26. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
  27. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
  28. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
  29. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
  30. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
  31. package/dist/components/ui/core/date-time-pickers/index.js +5 -10
  32. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  33. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
  34. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
  35. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  36. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  37. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
  38. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  39. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  40. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  41. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  42. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  43. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  44. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
  45. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  46. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
  47. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
  48. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
  49. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  50. package/dist/components/ui/core/dialog/dialog.js +82 -155
  51. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
  52. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
  53. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  54. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  55. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  56. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  57. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  58. package/dist/components/ui/core/input/input.js +12 -27
  59. package/dist/components/ui/core/input-group/input-group.js +76 -173
  60. package/dist/components/ui/core/kbd/kbd.js +20 -36
  61. package/dist/components/ui/core/label/label.js +26 -43
  62. package/dist/components/ui/core/loader/loader.js +80 -117
  63. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  64. package/dist/components/ui/core/message/message.d.ts +2 -2
  65. package/dist/components/ui/core/message/message.js +316 -542
  66. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  67. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  68. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  69. package/dist/components/ui/core/pagination/pagination.js +231 -334
  70. package/dist/components/ui/core/popover/popover.js +90 -157
  71. package/dist/components/ui/core/progress/progress.js +36 -61
  72. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  73. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  74. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  75. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  76. package/dist/components/ui/core/search/search.js +77 -99
  77. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  78. package/dist/components/ui/core/select/select.js +168 -293
  79. package/dist/components/ui/core/separator/separator.js +13 -23
  80. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  81. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  82. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  83. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  84. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  85. package/dist/components/ui/core/sources/sources.js +58 -79
  86. package/dist/components/ui/core/switch/switch.js +62 -0
  87. package/dist/components/ui/core/tabs/tabs.js +149 -223
  88. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  89. package/dist/components/ui/core/textarea/textarea.js +13 -27
  90. package/dist/components/ui/core/toggle/toggle.js +55 -74
  91. package/dist/components/ui/core/tool/tool.js +127 -163
  92. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  93. package/dist/components/ui/core/topbar/topbar.js +106 -190
  94. package/dist/eslint/index.js +5 -10
  95. package/dist/eslint/no-overriding-styles.js +178 -237
  96. package/dist/icons/index.d.ts +1 -0
  97. package/dist/icons/index.js +1 -0
  98. package/dist/lib/highlight-code.d.ts +9 -0
  99. package/dist/lib/highlight-code.js +42 -0
  100. package/dist/lib/portal-container-context.js +8 -9
  101. package/dist/lib/style-scope.js +6 -6
  102. package/dist/lib/use-controllable-state.js +21 -30
  103. package/dist/lib/utils.d.ts +0 -2
  104. package/dist/lib/utils.js +32 -112
  105. package/dist/styles.css +1 -1
  106. package/dist/styles.source.css +23 -0
  107. package/package.json +23 -7
  108. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
@@ -1,172 +1,115 @@
1
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
- import { createContext as m, useContext as f } from "react";
3
- import { Tabs as a } from "@base-ui/react/tabs";
4
- import { cva as l } from "class-variance-authority";
5
- import { cn as i } from "../../../../lib/utils.js";
6
- function N({
7
- className: t,
8
- ...e
9
- }) {
10
- return /* @__PURE__ */ n(
11
- a.Root,
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
- const g = l(
20
- "bg-muted-background text-muted-foreground relative isolate inline-flex w-fit items-center justify-center gap-2 p-0.5",
21
- {
22
- variants: {
23
- size: {
24
- default: "h-9 rounded-lg",
25
- small: "h-7 rounded-md"
26
- }
27
- },
28
- defaultVariants: {
29
- size: "default"
30
- }
31
- }
32
- ), d = m(void 0);
33
- function S({
34
- className: t,
35
- size: e,
36
- children: o,
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
- const b = l(
54
- "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",
55
- {
56
- variants: {
57
- size: {
58
- default: "rounded-md",
59
- small: "rounded-sm"
60
- }
61
- },
62
- defaultVariants: {
63
- size: "default"
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
- const v = l(
82
- "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",
83
- {
84
- variants: {
85
- size: {
86
- default: "rounded-md",
87
- small: "rounded-sm"
88
- },
89
- tabContent: {
90
- "icon-label": "",
91
- "label-only": "",
92
- "icon-only": "px-0"
93
- }
94
- },
95
- compoundVariants: [
96
- {
97
- size: "default",
98
- tabContent: "icon-label",
99
- className: "h-8 gap-2 px-2 py-0"
100
- },
101
- {
102
- size: "default",
103
- tabContent: "label-only",
104
- className: "h-8 gap-0 px-2 py-0"
105
- },
106
- {
107
- size: "default",
108
- tabContent: "icon-only",
109
- className: "size-8 gap-0 py-0"
110
- },
111
- {
112
- size: "small",
113
- tabContent: "icon-label",
114
- className: "h-6 gap-2 px-2 py-0"
115
- },
116
- {
117
- size: "small",
118
- tabContent: "label-only",
119
- className: "h-6 gap-0 px-2 py-0"
120
- },
121
- {
122
- size: "small",
123
- tabContent: "icon-only",
124
- className: "size-6 gap-0 py-0"
125
- }
126
- ],
127
- defaultVariants: {
128
- size: "default",
129
- tabContent: "icon-label"
130
- }
131
- }
132
- );
133
- function w({
134
- className: t,
135
- size: e,
136
- tabContent: o,
137
- ...r
138
- }) {
139
- const s = f(d), c = e ?? s;
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 V({
153
- className: t,
154
- ...e
155
- }) {
156
- return /* @__PURE__ */ n(
157
- a.Panel,
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
- export {
166
- N as SegmentedControl,
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 };