@cognite/aura 0.3.2 → 0.3.4

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 (143) hide show
  1. package/DESIGN.md +134 -5
  2. package/README.md +24 -3
  3. package/dist/components/index.d.ts +5 -1
  4. package/dist/components/index.js +59 -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/calendar/calendar-header.js +63 -0
  15. package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
  16. package/dist/components/ui/core/calendar/calendar.js +68 -0
  17. package/dist/components/ui/core/calendar/constants.d.ts +1 -0
  18. package/dist/components/ui/core/card/card.js +102 -185
  19. package/dist/components/ui/core/chart/chart.js +116 -206
  20. package/dist/components/ui/core/chart/index.js +2 -8
  21. package/dist/components/ui/core/checkbox/checkbox.js +67 -132
  22. package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
  23. package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
  24. package/dist/components/ui/core/code-block/code-block.js +179 -267
  25. package/dist/components/ui/core/collapsible/collapsible.js +29 -49
  26. package/dist/components/ui/core/combobox/combobox.js +41 -0
  27. package/dist/components/ui/core/command/command.js +85 -150
  28. package/dist/components/ui/core/count/count.js +21 -32
  29. package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
  30. package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
  31. package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
  32. package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
  33. package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
  34. package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
  35. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
  36. package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
  37. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
  38. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
  39. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
  40. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
  41. package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
  42. package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
  43. package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
  44. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
  45. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
  46. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
  47. package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
  48. package/dist/components/ui/core/date-time-pickers/index.js +6 -10
  49. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
  50. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  51. package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
  52. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  53. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  54. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
  55. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  56. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  57. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  58. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
  59. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  60. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  61. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
  62. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  63. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
  64. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
  65. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  66. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
  67. package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
  68. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
  69. package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
  70. package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
  71. package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
  72. package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
  73. package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
  74. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  75. package/dist/components/ui/core/dialog/dialog.js +82 -155
  76. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
  77. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
  78. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  79. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  80. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  81. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  82. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  83. package/dist/components/ui/core/input/input.js +12 -27
  84. package/dist/components/ui/core/input-group/input-group.js +76 -173
  85. package/dist/components/ui/core/kbd/kbd.js +20 -36
  86. package/dist/components/ui/core/label/label.js +26 -43
  87. package/dist/components/ui/core/loader/loader.js +80 -117
  88. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  89. package/dist/components/ui/core/message/message.d.ts +2 -2
  90. package/dist/components/ui/core/message/message.js +316 -542
  91. package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
  92. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  93. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  94. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  95. package/dist/components/ui/core/pagination/pagination.js +231 -334
  96. package/dist/components/ui/core/popover/popover.js +90 -157
  97. package/dist/components/ui/core/progress/progress.js +36 -61
  98. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  99. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  100. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  101. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  102. package/dist/components/ui/core/search/search.js +77 -99
  103. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  104. package/dist/components/ui/core/select/select.js +168 -293
  105. package/dist/components/ui/core/separator/separator.js +13 -23
  106. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  107. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  108. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  109. package/dist/components/ui/core/slider/slider.d.ts +9 -0
  110. package/dist/components/ui/core/slider/slider.js +40 -0
  111. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  112. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  113. package/dist/components/ui/core/sources/sources.js +58 -79
  114. package/dist/components/ui/core/switch/switch.js +62 -0
  115. package/dist/components/ui/core/tabs/tabs.js +149 -223
  116. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  117. package/dist/components/ui/core/textarea/textarea.js +13 -27
  118. package/dist/components/ui/core/toggle/toggle.js +55 -74
  119. package/dist/components/ui/core/tool/tool.js +127 -163
  120. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  121. package/dist/components/ui/core/topbar/topbar.js +106 -190
  122. package/dist/eslint/index.js +5 -10
  123. package/dist/eslint/no-overriding-styles.js +178 -237
  124. package/dist/icons/index.d.ts +1 -0
  125. package/dist/icons/index.js +1 -0
  126. package/dist/index.d.ts +1 -1
  127. package/dist/lib/highlight-code.d.ts +9 -0
  128. package/dist/lib/highlight-code.js +42 -0
  129. package/dist/lib/portal-container-context.js +8 -9
  130. package/dist/lib/style-scope.js +6 -6
  131. package/dist/lib/use-controllable-state.js +21 -30
  132. package/dist/lib/utils.d.ts +0 -2
  133. package/dist/lib/utils.js +32 -112
  134. package/dist/styles.css +1 -1
  135. package/dist/styles.source.css +26 -0
  136. package/package.json +42 -8
  137. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
  138. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
  139. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
  140. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
  141. /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
  142. /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
  143. /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
@@ -1,151 +1,86 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import { IconSearch as p } from "@tabler/icons-react";
4
- import { Command as r } from "cmdk";
5
- import { cn as m } from "../../../../lib/utils.js";
6
- import { Dialog as u, DialogHeader as g, DialogTitle as h, DialogDescription as f, DialogContent as x } from "../dialog/dialog.js";
7
- const s = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
8
- r,
9
- {
10
- ref: a,
11
- "data-slot": "command",
12
- className: m(
13
- "rounded-lg bg-background text-muted-foreground flex h-full w-full flex-col overflow-hidden",
14
- e
15
- ),
16
- ...t
17
- }
18
- ));
19
- s.displayName = "Command";
20
- function G({
21
- title: e = "Command Palette",
22
- description: t = "Search for a command to run...",
23
- children: a,
24
- className: l,
25
- showCloseButton: c = !0,
26
- ...i
27
- }) {
28
- return /* @__PURE__ */ n(u, { ...i, children: [
29
- /* @__PURE__ */ n(g, { className: "sr-only rounded-lg", children: [
30
- /* @__PURE__ */ o(h, { children: e }),
31
- /* @__PURE__ */ o(f, { children: t })
32
- ] }),
33
- /* @__PURE__ */ o(
34
- x,
35
- {
36
- "data-slot": "command-dialog",
37
- className: m("overflow-hidden p-0", l),
38
- showCloseButton: c,
39
- children: /* @__PURE__ */ o(s, { className: "**:[[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: a })
40
- }
41
- )
42
- ] });
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Dialog as t, DialogContent as n, DialogDescription as r, DialogHeader as i, DialogTitle as a } from "../dialog/dialog.js";
3
+ import { forwardRef as o } from "react";
4
+ import { IconSearch as s } from "@tabler/icons-react";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { Command as u } from "cmdk";
7
+ //#region libs/aura/src/components/ui/core/command/command.tsx
8
+ var d = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u, {
9
+ ref: r,
10
+ "data-slot": "command",
11
+ className: e("rounded-xl bg-background text-muted-foreground flex h-full w-full flex-col overflow-hidden", t),
12
+ ...n
13
+ }));
14
+ d.displayName = "Command";
15
+ function f({ title: o = "Command Palette", description: s = "Search for a command to run...", children: u, className: f, showCloseButton: p = !0, ...m }) {
16
+ return /* @__PURE__ */ l(t, {
17
+ ...m,
18
+ children: [/* @__PURE__ */ l(i, {
19
+ className: "sr-only rounded-lg",
20
+ children: [/* @__PURE__ */ c(a, { children: o }), /* @__PURE__ */ c(r, { children: s })]
21
+ }), /* @__PURE__ */ c(n, {
22
+ "data-slot": "command-dialog",
23
+ className: e("overflow-hidden p-0", f),
24
+ showCloseButton: p,
25
+ children: /* @__PURE__ */ c(d, {
26
+ className: "**:[[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
27
+ children: u
28
+ })
29
+ })]
30
+ });
43
31
  }
44
- const k = d(({ className: e, ...t }, a) => /* @__PURE__ */ n(
45
- "div",
46
- {
47
- "data-slot": "command-input-wrapper",
48
- className: "flex h-10 items-center gap-2 border-b px-2",
49
- children: [
50
- /* @__PURE__ */ o(p, { className: "size-4 shrink-0 opacity-50" }),
51
- /* @__PURE__ */ o(
52
- r.Input,
53
- {
54
- ref: a,
55
- "data-slot": "command-input",
56
- className: m(
57
- "placeholder:text-muted-foreground flex h-10 w-full rounded-lg bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
58
- e
59
- ),
60
- ...t
61
- }
62
- )
63
- ]
64
- }
65
- ));
66
- k.displayName = "CommandInput";
67
- const y = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
68
- r.List,
69
- {
70
- ref: a,
71
- "data-slot": "command-list",
72
- className: m(
73
- "max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto",
74
- e
75
- ),
76
- ...t
77
- }
78
- ));
79
- y.displayName = "CommandList";
80
- const C = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
81
- r.Empty,
82
- {
83
- ref: a,
84
- "data-slot": "command-empty",
85
- className: m("py-6 text-center text-sm", e),
86
- ...t
87
- }
88
- ));
89
- C.displayName = "CommandEmpty";
90
- const N = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
91
- r.Group,
92
- {
93
- ref: a,
94
- "data-slot": "command-group",
95
- className: m(
96
- "text-foreground font-normal **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-medium",
97
- e
98
- ),
99
- ...t
100
- }
101
- ));
102
- N.displayName = "CommandGroup";
103
- const v = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
104
- r.Separator,
105
- {
106
- ref: a,
107
- "data-slot": "command-separator",
108
- className: m("bg-border -mx-1 h-px", e),
109
- ...t
110
- }
111
- ));
112
- v.displayName = "CommandSeparator";
113
- const w = d(({ className: e, ...t }, a) => /* @__PURE__ */ o(
114
- r.Item,
115
- {
116
- ref: a,
117
- "data-slot": "command-item",
118
- className: m(
119
- "data-[selected=true]:bg-accent-background data-[selected=true]:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
120
- e
121
- ),
122
- ...t
123
- }
124
- ));
125
- w.displayName = "CommandItem";
126
- const _ = d(
127
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
128
- "span",
129
- {
130
- ref: a,
131
- "data-slot": "command-shortcut",
132
- className: m(
133
- "text-muted-foreground ml-auto text-xs tracking-widest",
134
- e
135
- ),
136
- ...t
137
- }
138
- )
139
- );
140
- _.displayName = "CommandShortcut";
141
- export {
142
- s as Command,
143
- G as CommandDialog,
144
- C as CommandEmpty,
145
- N as CommandGroup,
146
- k as CommandInput,
147
- w as CommandItem,
148
- y as CommandList,
149
- v as CommandSeparator,
150
- _ as CommandShortcut
151
- };
32
+ var p = o(({ className: t, ...n }, r) => /* @__PURE__ */ l("div", {
33
+ "data-slot": "command-input-wrapper",
34
+ className: "flex h-10 items-center gap-2 border-b px-2",
35
+ children: [/* @__PURE__ */ c(s, { className: "size-4 shrink-0 opacity-50" }), /* @__PURE__ */ c(u.Input, {
36
+ ref: r,
37
+ "data-slot": "command-input",
38
+ className: e("placeholder:text-muted-foreground flex h-10 w-full rounded-lg bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", t),
39
+ ...n
40
+ })]
41
+ }));
42
+ p.displayName = "CommandInput";
43
+ var m = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.List, {
44
+ ref: r,
45
+ "data-slot": "command-list",
46
+ className: e("max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto", t),
47
+ ...n
48
+ }));
49
+ m.displayName = "CommandList";
50
+ var h = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Empty, {
51
+ ref: r,
52
+ "data-slot": "command-empty",
53
+ className: e("py-6 text-center text-sm", t),
54
+ ...n
55
+ }));
56
+ h.displayName = "CommandEmpty";
57
+ var g = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Group, {
58
+ ref: r,
59
+ "data-slot": "command-group",
60
+ className: e("text-foreground font-normal **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-medium", t),
61
+ ...n
62
+ }));
63
+ g.displayName = "CommandGroup";
64
+ var _ = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Separator, {
65
+ ref: r,
66
+ "data-slot": "command-separator",
67
+ className: e("bg-border -mx-1 h-px", t),
68
+ ...n
69
+ }));
70
+ _.displayName = "CommandSeparator";
71
+ var v = o(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Item, {
72
+ ref: r,
73
+ "data-slot": "command-item",
74
+ className: e("data-[selected=true]:bg-accent-background data-[selected=true]:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
75
+ ...n
76
+ }));
77
+ v.displayName = "CommandItem";
78
+ var y = o(({ className: t, ...n }, r) => /* @__PURE__ */ c("span", {
79
+ ref: r,
80
+ "data-slot": "command-shortcut",
81
+ className: e("text-muted-foreground ml-auto text-xs tracking-widest", t),
82
+ ...n
83
+ }));
84
+ y.displayName = "CommandShortcut";
85
+ //#endregion
86
+ export { d as Command, f as CommandDialog, h as CommandEmpty, g as CommandGroup, p as CommandInput, v as CommandItem, m as CommandList, _ as CommandSeparator, y as CommandShortcut };
@@ -1,32 +1,21 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as o } from "react";
3
- import { cva as i } from "class-variance-authority";
4
- import { cn as u } from "../../../../lib/utils.js";
5
- const c = i(
6
- "flex min-h-9 min-w-9 flex-col items-center justify-center rounded-sm px-0.5 text-3xl font-medium leading-8 tracking-tightest",
7
- {
8
- variants: {
9
- variant: {
10
- default: "bg-neutral-background text-neutral-foreground-on-neutral",
11
- warning: "bg-warning-background text-warning-foreground-on-warning",
12
- critical: "bg-destructive-background text-destructive-foreground-on-critical"
13
- }
14
- },
15
- defaultVariants: {
16
- variant: "default"
17
- }
18
- }
19
- ), d = o(({ className: t, variant: r, ...n }, a) => /* @__PURE__ */ e(
20
- "output",
21
- {
22
- ref: a,
23
- "data-slot": "count",
24
- className: u(c({ variant: r }), t),
25
- ...n
26
- }
27
- ));
28
- d.displayName = "Count";
29
- export {
30
- d as Count,
31
- c as countVariants
32
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { cva as r } from "class-variance-authority";
5
+ //#region libs/aura/src/components/ui/core/count/count.tsx
6
+ var i = r("flex min-h-9 min-w-9 flex-col items-center justify-center rounded-sm px-0.5 text-3xl font-medium leading-8 tracking-tightest", {
7
+ variants: { variant: {
8
+ default: "bg-neutral-background text-neutral-foreground-on-neutral",
9
+ warning: "bg-warning-background text-warning-foreground-on-warning",
10
+ critical: "bg-destructive-background text-destructive-foreground-on-critical"
11
+ } },
12
+ defaultVariants: { variant: "default" }
13
+ }), a = t(({ className: t, variant: r, ...a }, o) => /* @__PURE__ */ n("output", {
14
+ ref: o,
15
+ "data-slot": "count",
16
+ className: e(i({ variant: r }), t),
17
+ ...a
18
+ }));
19
+ a.displayName = "Count";
20
+ //#endregion
21
+ export { a as Count, i as countVariants };
@@ -0,0 +1,10 @@
1
+ import { ComponentProps, ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ type DataGridCellProps = ComponentProps<'div'> & {
3
+ isPinned?: boolean;
4
+ isLastPinned?: boolean;
5
+ colIndex?: number;
6
+ textValue?: string;
7
+ truncate?: boolean;
8
+ };
9
+ declare const DataGridCell: ForwardRefExoticComponent<DataGridCellProps & RefAttributes<HTMLDivElement>>;
10
+ export { DataGridCell, type DataGridCellProps };
@@ -0,0 +1,13 @@
1
+ import { ReactElement } from 'react';
2
+ import { HeaderGroup } from '@tanstack/react-table';
3
+ type DataGridHeaderRowProps<TData> = {
4
+ headerGroup: HeaderGroup<TData>;
5
+ headerRowIndex: number;
6
+ resolvedHeaderHeight: number;
7
+ gridTemplateColumns: string;
8
+ pinnedColumnIds: Set<string>;
9
+ lastPinnedColumnId: string | undefined;
10
+ pinnedLeftByColumnId: Map<string, number>;
11
+ };
12
+ declare function DataGridHeaderRow<TData>({ headerGroup, headerRowIndex, resolvedHeaderHeight, gridTemplateColumns, pinnedColumnIds, lastPinnedColumnId, pinnedLeftByColumnId, }: DataGridHeaderRowProps<TData>): ReactElement;
13
+ export { DataGridHeaderRow, type DataGridHeaderRowProps };
@@ -0,0 +1,18 @@
1
+ import { ReactElement } from 'react';
2
+ import { Row } from '@tanstack/react-table';
3
+ import { VirtualItem } from '@tanstack/react-virtual';
4
+ type DataGridRowProps<TData> = {
5
+ row: Row<TData>;
6
+ virtualRow: VirtualItem;
7
+ headerGroupCount: number;
8
+ gridTemplateColumns: string;
9
+ pinnedColumnIds: Set<string>;
10
+ lastPinnedColumnId: string | undefined;
11
+ pinnedLeftByColumnId: Map<string, number>;
12
+ customCellColumnIds: Set<string>;
13
+ maxDepth: number;
14
+ hasExpanding: boolean;
15
+ onRowClick?: (row: Row<TData>) => void;
16
+ };
17
+ declare function DataGridRow<TData>({ row, virtualRow, headerGroupCount, gridTemplateColumns, pinnedColumnIds, lastPinnedColumnId, pinnedLeftByColumnId, customCellColumnIds, maxDepth, hasExpanding, onRowClick, }: DataGridRowProps<TData>): ReactElement;
18
+ export { DataGridRow, type DataGridRowProps };
@@ -0,0 +1,43 @@
1
+ import { ReactElement, ReactNode, RefObject } from 'react';
2
+ import { ColumnDef, ExpandedState, FilterFnOption, Row, SortingState } from '@tanstack/react-table';
3
+ type DataGridSize = 'default' | 'compact';
4
+ type DataGridHandle = {
5
+ scrollToRow: (index: number) => void;
6
+ resetSorting: () => void;
7
+ };
8
+ type DataGridBaseProps<TData> = {
9
+ data: TData[];
10
+ columns: ColumnDef<TData>[];
11
+ getRowId?: (originalRow: TData, index: number) => string;
12
+ rowCount?: number;
13
+ globalFilterFn?: FilterFnOption<TData>;
14
+ enableSorting?: boolean;
15
+ manualSorting?: boolean;
16
+ sorting?: SortingState;
17
+ defaultSorting?: SortingState;
18
+ onSortingChange?: (value: SortingState) => void;
19
+ getSubRows?: (row: TData, index: number) => TData[] | undefined;
20
+ expanded?: ExpandedState;
21
+ defaultExpanded?: ExpandedState;
22
+ onExpandedChange?: (value: ExpandedState) => void;
23
+ getRowCanExpand?: (row: Row<TData>) => boolean;
24
+ maxDepth?: number;
25
+ pinnedColumns?: string[];
26
+ gridRef?: RefObject<DataGridHandle | null>;
27
+ size?: DataGridSize;
28
+ children?: ReactNode;
29
+ className?: string;
30
+ onRowClick?: (row: Row<TData>) => void;
31
+ rowHeight?: number;
32
+ headerHeight?: number;
33
+ };
34
+ type DataGridAccessibleNameProps = {
35
+ 'aria-label': string;
36
+ 'aria-labelledby'?: string;
37
+ } | {
38
+ 'aria-labelledby': string;
39
+ 'aria-label'?: string;
40
+ };
41
+ type DataGridProps<TData> = DataGridBaseProps<TData> & DataGridAccessibleNameProps;
42
+ declare function DataGrid<TData>({ data, columns, getRowId, rowCount, globalFilterFn, enableSorting, manualSorting, sorting, defaultSorting, onSortingChange, getSubRows, expanded, defaultExpanded, onExpandedChange, getRowCanExpand, maxDepth, pinnedColumns, gridRef, size, children, className, onRowClick, rowHeight, headerHeight, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: DataGridProps<TData>): ReactElement;
43
+ export { DataGrid, type DataGridHandle };
@@ -0,0 +1,12 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ type AssetRow = {
3
+ id: string;
4
+ name: string;
5
+ type: string;
6
+ status: 'Running' | 'Stopped' | 'Needs attention';
7
+ area: string;
8
+ updated: string;
9
+ };
10
+ declare const assetRows: AssetRow[];
11
+ declare const assetColumns: ColumnDef<AssetRow>[];
12
+ export { type AssetRow, assetColumns, assetRows };
@@ -0,0 +1,9 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ declare const PINNED_COLUMN_Z_INDEX = 10;
3
+ declare function getAriaSort(sortDirection: false | 'asc' | 'desc', canSort: boolean): 'ascending' | 'descending' | 'none' | undefined;
4
+ declare function getTextValue(value: unknown): string | undefined;
5
+ declare function isAccessorColumn<TData>(def: ColumnDef<TData>): boolean;
6
+ declare function isFromIgnoredCellTarget(target?: EventTarget | null): boolean;
7
+ declare function isFromExpandToggleTarget(target?: EventTarget | null): boolean;
8
+ declare function collectCustomCellColumnIds<TData>(columns: ColumnDef<TData>[]): Set<string>;
9
+ export { PINNED_COLUMN_Z_INDEX, collectCustomCellColumnIds, getAriaSort, getTextValue, isAccessorColumn, isFromExpandToggleTarget, isFromIgnoredCellTarget, };
@@ -1,73 +1,61 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { cn as k } from "../../../../../lib/utils.js";
3
- import { Popover as x, PopoverTrigger as P, PopoverContent as M } from "../../popover/popover.js";
4
- import { Calendar as N } from "../shared/calendar/calendar.js";
5
- import { DateTimeInput as w } from "../shared/date-time-input/date-time-input.js";
6
- import { ShortcutsPanel as R } from "../shared/shortcuts-panel/shortcuts-panel.js";
7
- import { useDatePicker as S } from "./use-date-picker.js";
8
- const Y = (n) => n ? [n, n] : [null, null], V = ({
9
- value: n,
10
- onChange: r,
11
- format: i = "DD/MM/YYYY",
12
- placeholder: p,
13
- displayWeekNumber: c = !1,
14
- shortcuts: t,
15
- defaultDate: d,
16
- className: s
17
- }) => {
18
- const {
19
- isOpen: o,
20
- displayedMonth: m,
21
- tempDate: a,
22
- handleOpenChange: h,
23
- handleDateClick: f,
24
- handleMonthChange: u,
25
- handleApplyShortcut: v,
26
- inputRef: g,
27
- popoverRef: C
28
- } = S({ value: n, onChange: r, defaultDate: d }), D = o ? a : n;
29
- return /* @__PURE__ */ e("div", { "data-slot": "date-picker", className: k("relative w-full", s), children: /* @__PURE__ */ l(x, { open: o, onOpenChange: h, children: [
30
- /* @__PURE__ */ e(P, { render: /* @__PURE__ */ e("div", { ref: g, className: "w-full" }), children: /* @__PURE__ */ e(
31
- w,
32
- {
33
- value: D,
34
- format: i,
35
- placeholder: p,
36
- isOpen: o,
37
- variant: "date"
38
- }
39
- ) }),
40
- /* @__PURE__ */ e(
41
- M,
42
- {
43
- ref: C,
44
- className: "rounded-xl w-auto p-0",
45
- side: "bottom",
46
- align: "start",
47
- children: /* @__PURE__ */ l("div", { "data-slot": "date-picker-content", className: "flex flex-row", children: [
48
- t && t.length > 0 && /* @__PURE__ */ e(
49
- R,
50
- {
51
- shortcuts: t,
52
- onShortcutClick: v
53
- }
54
- ),
55
- /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(
56
- N,
57
- {
58
- displayedMonth: m,
59
- selectedRange: Y(a),
60
- hoverDate: null,
61
- displayWeekNumber: c,
62
- onDateClick: f,
63
- onMonthChange: u
64
- }
65
- ) })
66
- ] })
67
- }
68
- )
69
- ] }) });
70
- };
71
- export {
72
- V as DatePicker
1
+ import { cn as e } from "../../../../../lib/utils.js";
2
+ import { Popover as t, PopoverContent as n, PopoverTrigger as r } from "../../popover/popover.js";
3
+ import { Calendar as i } from "../../calendar/calendar.js";
4
+ import { DateTimeInput as a } from "../shared/date-time-input/date-time-input.js";
5
+ import { ShortcutsPanel as o } from "../shared/shortcuts-panel/shortcuts-panel.js";
6
+ import { useDatePicker as s } from "./use-date-picker.js";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ //#region libs/aura/src/components/ui/core/date-time-pickers/date-picker/date-picker.tsx
9
+ var u = (e) => e ? [e, e] : [null, null], d = ({ value: d, onChange: f, format: p = "DD/MM/YYYY", placeholder: m, displayWeekNumber: h = !1, shortcuts: g, defaultDate: _, className: v }) => {
10
+ let { isOpen: y, displayedMonth: b, tempDate: x, handleOpenChange: S, handleDateClick: C, handleMonthChange: w, handleApplyShortcut: T, inputRef: E, popoverRef: D } = s({
11
+ value: d,
12
+ onChange: f,
13
+ defaultDate: _
14
+ }), O = y ? x : d;
15
+ return /* @__PURE__ */ c("div", {
16
+ "data-slot": "date-picker",
17
+ className: e("relative w-full", v),
18
+ children: /* @__PURE__ */ l(t, {
19
+ open: y,
20
+ onOpenChange: S,
21
+ children: [/* @__PURE__ */ c(r, {
22
+ render: /* @__PURE__ */ c("div", {
23
+ ref: E,
24
+ className: "w-full"
25
+ }),
26
+ children: /* @__PURE__ */ c(a, {
27
+ value: O,
28
+ format: p,
29
+ placeholder: m,
30
+ isOpen: y,
31
+ variant: "date"
32
+ })
33
+ }), /* @__PURE__ */ c(n, {
34
+ ref: D,
35
+ className: "rounded-xl w-auto p-0",
36
+ side: "bottom",
37
+ align: "start",
38
+ children: /* @__PURE__ */ l("div", {
39
+ "data-slot": "date-picker-content",
40
+ className: "flex flex-row",
41
+ children: [g && g.length > 0 && /* @__PURE__ */ c(o, {
42
+ shortcuts: g,
43
+ onShortcutClick: T
44
+ }), /* @__PURE__ */ c("div", {
45
+ className: "p-3",
46
+ children: /* @__PURE__ */ c(i, {
47
+ displayedMonth: b,
48
+ selectedRange: u(x),
49
+ hoverDate: null,
50
+ displayWeekNumber: h,
51
+ onDateClick: C,
52
+ onMonthChange: w
53
+ })
54
+ })]
55
+ })
56
+ })]
57
+ })
58
+ });
73
59
  };
60
+ //#endregion
61
+ export { d as DatePicker };
@@ -1,4 +1,5 @@
1
1
  import { Dayjs } from 'dayjs';
2
+ import { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';
2
3
  export interface UseDatePickerProps {
3
4
  value: Dayjs | null;
4
5
  onChange: (date: Dayjs | null) => void;
@@ -11,7 +12,7 @@ export interface UseDatePickerReturn {
11
12
  handleOpenChange: (open: boolean) => void;
12
13
  handleDateClick: (date: Dayjs) => void;
13
14
  handleMonthChange: (month: Dayjs) => void;
14
- handleApplyShortcut: (shortcutValue: Dayjs | [Dayjs, Dayjs] | [Dayjs | null, Dayjs | null]) => void;
15
+ handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
15
16
  inputRef: React.RefObject<HTMLDivElement>;
16
17
  popoverRef: React.RefObject<HTMLDivElement>;
17
18
  }