@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,255 +1,157 @@
1
- import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
- import { forwardRef as u } from "react";
3
- import { Menu as r } from "@base-ui/react/menu";
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";
7
- import { cn as d } from "../../../../lib/utils.js";
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 }) {
27
- return /* @__PURE__ */ n(r.Root, { "data-slot": "dropdown-menu", ...e });
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { usePortalContainer as t } from "../../../../lib/portal-container-context.js";
3
+ import { forwardRef as n } from "react";
4
+ import { IconCheck as r, IconChevronRight as i } from "@tabler/icons-react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { cva as s } from "class-variance-authority";
7
+ import { Menu as c } from "@base-ui/react/menu";
8
+ //#region libs/aura/src/components/ui/core/dropdown-menu/dropdown-menu.tsx
9
+ var l = s("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
+ variants: {
11
+ inset: { true: "pl-8" },
12
+ variant: {
13
+ default: "focus:bg-accent-background focus:text-foreground [&_svg:not([class*='text-'])]:text-foreground",
14
+ destructive: "text-destructive-foreground focus:bg-destructive-background-hover hover:bg-destructive-background-hover focus:text-destructive-foreground [&_svg]:text-destructive-foreground"
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ inset: !1,
19
+ variant: "default"
20
+ }
21
+ });
22
+ function u({ ...e }) {
23
+ return /* @__PURE__ */ a(c.Root, {
24
+ "data-slot": "dropdown-menu",
25
+ ...e
26
+ });
28
27
  }
29
- function x({
30
- container: e,
31
- ...t
32
- }) {
33
- const o = b();
34
- return /* @__PURE__ */ n(
35
- r.Portal,
36
- {
37
- "data-slot": "dropdown-menu-portal",
38
- container: e ?? o,
39
- ...t
40
- }
41
- );
28
+ function d({ container: e, ...n }) {
29
+ let r = t();
30
+ return /* @__PURE__ */ a(c.Portal, {
31
+ "data-slot": "dropdown-menu-portal",
32
+ container: e ?? r,
33
+ ...n
34
+ });
42
35
  }
43
- function C({
44
- children: e,
45
- ...t
46
- }) {
47
- return /* @__PURE__ */ n(r.Trigger, { "data-slot": "dropdown-menu-trigger", ...t, children: e });
36
+ var f = n(({ children: e, ...t }, n) => /* @__PURE__ */ a(c.Trigger, {
37
+ ref: n,
38
+ "data-slot": "dropdown-menu-trigger",
39
+ ...t,
40
+ children: e
41
+ }));
42
+ f.displayName = "DropdownMenuTrigger";
43
+ function p({ align: t = "start", alignOffset: n = 0, side: r = "bottom", sideOffset: i = 4, className: o, container: s, ...l }) {
44
+ return /* @__PURE__ */ a(d, {
45
+ container: s,
46
+ children: /* @__PURE__ */ a(c.Positioner, {
47
+ className: "isolate z-50 outline-none",
48
+ align: t,
49
+ alignOffset: n,
50
+ side: r,
51
+ sideOffset: i,
52
+ children: /* @__PURE__ */ a(c.Popup, {
53
+ "data-slot": "dropdown-menu-content",
54
+ className: e("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", o),
55
+ ...l
56
+ })
57
+ })
58
+ });
48
59
  }
49
- function w({
50
- align: e = "start",
51
- alignOffset: t = 0,
52
- side: o = "bottom",
53
- sideOffset: a = 4,
54
- className: s,
55
- container: i,
56
- ...p
57
- }) {
58
- return /* @__PURE__ */ n(x, { container: i, children: /* @__PURE__ */ n(
59
- r.Positioner,
60
- {
61
- className: "isolate z-50 outline-none",
62
- align: e,
63
- alignOffset: t,
64
- side: o,
65
- sideOffset: a,
66
- children: /* @__PURE__ */ n(
67
- r.Popup,
68
- {
69
- "data-slot": "dropdown-menu-content",
70
- className: d(
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",
72
- s
73
- ),
74
- ...p
75
- }
76
- )
77
- }
78
- ) });
60
+ function m({ ...e }) {
61
+ return /* @__PURE__ */ a(c.Group, {
62
+ "data-slot": "dropdown-menu-group",
63
+ ...e
64
+ });
79
65
  }
80
- function R({ ...e }) {
81
- return /* @__PURE__ */ n(r.Group, { "data-slot": "dropdown-menu-group", ...e });
66
+ var h = n(({ className: t, inset: n, variant: r = "default", children: i, ...o }, s) => /* @__PURE__ */ a(c.Item, {
67
+ ref: s,
68
+ "data-slot": "dropdown-menu-item",
69
+ "data-inset": n,
70
+ "data-variant": r,
71
+ className: e(l({
72
+ inset: n,
73
+ variant: r
74
+ }), t),
75
+ ...o,
76
+ children: i
77
+ })), g = n(({ className: t, children: n, checked: i, ...s }, u) => /* @__PURE__ */ o(c.CheckboxItem, {
78
+ ref: u,
79
+ "data-slot": "dropdown-menu-checkbox-item",
80
+ className: e(l({ inset: !0 }), t),
81
+ checked: i,
82
+ ...s,
83
+ children: [/* @__PURE__ */ a("span", {
84
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
85
+ children: /* @__PURE__ */ a(c.CheckboxItemIndicator, { children: /* @__PURE__ */ a(r, { className: "size-4 text-foreground" }) })
86
+ }), n]
87
+ }));
88
+ function _({ ...e }) {
89
+ return /* @__PURE__ */ a(c.RadioGroup, {
90
+ "data-slot": "dropdown-menu-radio-group",
91
+ ...e
92
+ });
82
93
  }
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(
97
- r.CheckboxItem,
98
- {
99
- ref: s,
100
- "data-slot": "dropdown-menu-checkbox-item",
101
- className: d(c({ inset: !0 }), e),
102
- checked: o,
103
- ...a,
104
- children: [
105
- /* @__PURE__ */ n("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n(r.CheckboxItemIndicator, { children: /* @__PURE__ */ n(l, { className: "size-4 text-foreground" }) }) }),
106
- t
107
- ]
108
- }
109
- ));
110
- function y({
111
- ...e
112
- }) {
113
- return /* @__PURE__ */ n(
114
- r.RadioGroup,
115
- {
116
- "data-slot": "dropdown-menu-radio-group",
117
- ...e
118
- }
119
- );
94
+ var v = n(({ className: t, children: n, ...i }, s) => /* @__PURE__ */ o(c.RadioItem, {
95
+ ref: s,
96
+ "data-slot": "dropdown-menu-radio-item",
97
+ className: e(l({ inset: !0 }), t),
98
+ ...i,
99
+ children: [/* @__PURE__ */ a("span", {
100
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
101
+ children: /* @__PURE__ */ a(c.RadioItemIndicator, { children: /* @__PURE__ */ a(r, { className: "size-4 text-foreground" }) })
102
+ }), n]
103
+ })), y = n(({ className: t, inset: n, ...r }, i) => /* @__PURE__ */ a(c.GroupLabel, {
104
+ ref: i,
105
+ "data-slot": "dropdown-menu-label",
106
+ "data-inset": n,
107
+ className: e("-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", t),
108
+ ...r
109
+ })), b = n(({ className: t, ...n }, r) => /* @__PURE__ */ a("div", {
110
+ ref: r,
111
+ "data-slot": "dropdown-menu-header",
112
+ className: e("-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border p-3 pointer-events-none", t),
113
+ ...n
114
+ })), x = n(({ className: t, ...n }, r) => /* @__PURE__ */ a(c.Separator, {
115
+ ref: r,
116
+ "data-slot": "dropdown-menu-separator",
117
+ className: e("bg-border -mx-1 my-1 h-px", t),
118
+ ...n
119
+ })), S = n(({ className: t, ...n }, r) => /* @__PURE__ */ a("span", {
120
+ ref: r,
121
+ "data-slot": "dropdown-menu-shortcut",
122
+ className: e("text-muted-foreground ml-auto text-xs tracking-widest", t),
123
+ ...n
124
+ }));
125
+ function C({ ...e }) {
126
+ return /* @__PURE__ */ a(c.SubmenuRoot, {
127
+ "data-slot": "dropdown-menu-sub",
128
+ ...e
129
+ });
120
130
  }
121
- const G = u(({ className: e, children: t, ...o }, a) => /* @__PURE__ */ m(
122
- r.RadioItem,
123
- {
124
- ref: a,
125
- "data-slot": "dropdown-menu-radio-item",
126
- className: d(c({ inset: !0 }), e),
127
- ...o,
128
- children: [
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" }) }) }),
130
- t
131
- ]
132
- }
133
- )), P = u(({ className: e, inset: t, ...o }, a) => /* @__PURE__ */ n(
134
- r.GroupLabel,
135
- {
136
- ref: a,
137
- "data-slot": "dropdown-menu-label",
138
- "data-inset": t,
139
- className: d(
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",
141
- e
142
- ),
143
- ...o
144
- }
145
- )), j = u(
146
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
147
- "div",
148
- {
149
- ref: o,
150
- "data-slot": "dropdown-menu-header",
151
- className: d(
152
- "-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border p-3 pointer-events-none",
153
- e
154
- ),
155
- ...t
156
- }
157
- )
158
- ), T = u(({ className: e, ...t }, o) => /* @__PURE__ */ n(
159
- r.Separator,
160
- {
161
- ref: o,
162
- "data-slot": "dropdown-menu-separator",
163
- className: d("bg-border -mx-1 my-1 h-px", e),
164
- ...t
165
- }
166
- )), L = u(
167
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
168
- "span",
169
- {
170
- ref: o,
171
- "data-slot": "dropdown-menu-shortcut",
172
- className: d(
173
- "text-muted-foreground ml-auto text-xs tracking-widest",
174
- e
175
- ),
176
- ...t
177
- }
178
- )
179
- );
180
- function V({
181
- ...e
182
- }) {
183
- return /* @__PURE__ */ n(r.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...e });
131
+ var w = n(({ className: t, inset: n, children: r, ...s }, l) => /* @__PURE__ */ o(c.SubmenuTrigger, {
132
+ ref: l,
133
+ "data-slot": "dropdown-menu-sub-trigger",
134
+ "data-inset": n,
135
+ className: e("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", t),
136
+ ...s,
137
+ children: [r, /* @__PURE__ */ a(i, { className: "ml-auto size-4" })]
138
+ }));
139
+ function T({ align: t = "start", alignOffset: n = -3, side: r = "right", sideOffset: i = 0, className: o, ...s }) {
140
+ return /* @__PURE__ */ a(p, {
141
+ "data-slot": "dropdown-menu-sub-content",
142
+ className: e("min-w-32 w-auto", o),
143
+ align: t,
144
+ alignOffset: n,
145
+ side: r,
146
+ sideOffset: i,
147
+ ...s
148
+ });
184
149
  }
185
- const H = u(({ className: e, inset: t, children: o, ...a }, s) => /* @__PURE__ */ m(
186
- r.SubmenuTrigger,
187
- {
188
- ref: s,
189
- "data-slot": "dropdown-menu-sub-trigger",
190
- "data-inset": t,
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 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
- e
194
- ),
195
- ...a,
196
- children: [
197
- o,
198
- /* @__PURE__ */ n(f, { className: "ml-auto size-4" })
199
- ]
200
- }
201
- ));
202
- function q({
203
- align: e = "start",
204
- alignOffset: t = -3,
205
- side: o = "right",
206
- sideOffset: a = 0,
207
- className: s,
208
- ...i
209
- }) {
210
- return /* @__PURE__ */ n(
211
- w,
212
- {
213
- "data-slot": "dropdown-menu-sub-content",
214
- className: d("min-w-32 w-auto", s),
215
- align: e,
216
- alignOffset: t,
217
- side: o,
218
- sideOffset: a,
219
- ...i
220
- }
221
- );
222
- }
223
- const A = u(
224
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
225
- "div",
226
- {
227
- ref: o,
228
- "data-slot": "dropdown-menu-section-label",
229
- className: d(
230
- "px-3 pt-2 pb-0 text-sm font-medium text-muted-foreground",
231
- e
232
- ),
233
- ...t
234
- }
235
- )
236
- );
237
- export {
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
255
- };
150
+ var E = n(({ className: t, ...n }, r) => /* @__PURE__ */ a("div", {
151
+ ref: r,
152
+ "data-slot": "dropdown-menu-section-label",
153
+ className: e("px-3 pt-2 pb-0 text-sm font-medium text-muted-foreground", t),
154
+ ...n
155
+ }));
156
+ //#endregion
157
+ export { u as DropdownMenu, g as DropdownMenuCheckboxItem, p as DropdownMenuContent, m as DropdownMenuGroup, b as DropdownMenuHeader, h as DropdownMenuItem, y as DropdownMenuLabel, d as DropdownMenuPortal, _ as DropdownMenuRadioGroup, v as DropdownMenuRadioItem, E as DropdownMenuSectionLabel, x as DropdownMenuSeparator, S as DropdownMenuShortcut, C as DropdownMenuSub, T as DropdownMenuSubContent, w as DropdownMenuSubTrigger, f as DropdownMenuTrigger };
@@ -1,8 +1,5 @@
1
- import { createContext as t, useContext as e } from "react";
2
- const o = t({
3
- variant: "compact"
4
- }), n = () => e(o);
5
- export {
6
- o as EmptyStateContext,
7
- n as useEmptyState
8
- };
1
+ import { createContext as e, useContext as t } from "react";
2
+ //#region libs/aura/src/components/ui/core/empty-state/empty-state.context.tsx
3
+ var n = e({ variant: "compact" }), r = () => t(n);
4
+ //#endregion
5
+ export { n as EmptyStateContext, r as useEmptyState };
@@ -1,139 +1,87 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as g, useMemo as d } from "react";
3
- import { IconQuestionMark as u, IconMessageDots as p, IconZoomQuestion as f, IconSearchOff as x, IconLock as y, IconPlus as k, IconAlertOctagon as v } from "@tabler/icons-react";
4
- import { cn as s } from "../../../../lib/utils.js";
5
- import { EmptyStateContext as h, useEmptyState as m } from "./empty-state.context.js";
6
- const w = {
7
- "error-generic": "[background-image:var(--gradient-fall)]",
8
- "new-object": "[background-image:var(--gradient-spring)]",
9
- "no-access": "[background-image:var(--gradient-fall)]",
10
- "no-results": "[background-image:var(--gradient-spring)]",
11
- "not-found": "[background-image:var(--gradient-spring)]",
12
- "new-chat": "[background-image:var(--gradient-summer)]",
13
- unknown: "[background-image:var(--gradient-spring)]"
14
- }, b = {
15
- "error-generic": /* @__PURE__ */ t(v, {}),
16
- "new-object": /* @__PURE__ */ t(k, {}),
17
- "no-access": /* @__PURE__ */ t(y, {}),
18
- "no-results": /* @__PURE__ */ t(x, {}),
19
- "not-found": /* @__PURE__ */ t(f, {}),
20
- "new-chat": /* @__PURE__ */ t(p, {}),
21
- unknown: /* @__PURE__ */ t(u, {})
22
- }, S = g(
23
- ({ className: n, variant: e = "compact", type: a, children: o, ...i }, r) => {
24
- const c = e === "full", l = d(() => ({ variant: e, type: a }), [e, a]);
25
- return /* @__PURE__ */ t(h.Provider, { value: l, children: /* @__PURE__ */ t(
26
- "div",
27
- {
28
- ref: r,
29
- "data-slot": "empty-state",
30
- "data-variant": e,
31
- className: s(
32
- "flex min-w-0 flex-col items-center text-center text-foreground",
33
- c ? "gap-8 p-10" : "gap-2",
34
- !c && "w-full max-w-100",
35
- n
36
- ),
37
- ...i,
38
- children: o
39
- }
40
- ) });
41
- }
42
- );
43
- S.displayName = "EmptyState";
44
- const E = g(
45
- ({ className: n, children: e, ...a }, o) => {
46
- const { variant: i, type: r } = m(), c = i === "full", l = e ?? (r ? b[r] : null);
47
- return c ? /* @__PURE__ */ t(
48
- "div",
49
- {
50
- ref: o,
51
- "data-slot": "empty-state-icon",
52
- className: s(
53
- "flex size-20 shrink-0 items-center justify-center rounded-2xl p-5 text-foreground [&_svg]:size-10 [&_svg]:stroke-[1.75]",
54
- r && w[r],
55
- n
56
- ),
57
- ...a,
58
- children: l
59
- }
60
- ) : /* @__PURE__ */ t(
61
- "div",
62
- {
63
- ref: o,
64
- "data-slot": "empty-state-icon",
65
- className: s(
66
- "flex size-6 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-6 [&_svg]:stroke-[1.75]",
67
- n
68
- ),
69
- ...a,
70
- children: l
71
- }
72
- );
73
- }
74
- );
75
- E.displayName = "EmptyStateIcon";
76
- function A({
77
- className: n,
78
- as: e = "h2",
79
- ...a
80
- }) {
81
- const { variant: o } = m();
82
- return /* @__PURE__ */ t(
83
- e,
84
- {
85
- "data-slot": "empty-state-title",
86
- className: s(
87
- "max-w-100 break-words font-medium text-foreground",
88
- o === "full" ? "text-xl leading-6 tracking-tightest" : "text-base leading-5 tracking-tighter",
89
- n
90
- ),
91
- ...a
92
- }
93
- );
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { EmptyStateContext as t, useEmptyState as n } from "./empty-state.context.js";
3
+ import { forwardRef as r, useMemo as i } from "react";
4
+ import { IconAlertOctagon as a, IconLock as o, IconMessageDots as s, IconPlus as c, IconQuestionMark as l, IconSearchOff as u, IconZoomQuestion as d } from "@tabler/icons-react";
5
+ import { jsx as f } from "react/jsx-runtime";
6
+ //#region libs/aura/src/components/ui/core/empty-state/empty-state.tsx
7
+ var p = {
8
+ "error-generic": "[background-image:var(--gradient-fall)]",
9
+ "new-object": "[background-image:var(--gradient-spring)]",
10
+ "no-access": "[background-image:var(--gradient-fall)]",
11
+ "no-results": "[background-image:var(--gradient-spring)]",
12
+ "not-found": "[background-image:var(--gradient-spring)]",
13
+ "new-chat": "[background-image:var(--gradient-summer)]",
14
+ unknown: "[background-image:var(--gradient-spring)]"
15
+ }, m = {
16
+ "error-generic": /* @__PURE__ */ f(a, {}),
17
+ "new-object": /* @__PURE__ */ f(c, {}),
18
+ "no-access": /* @__PURE__ */ f(o, {}),
19
+ "no-results": /* @__PURE__ */ f(u, {}),
20
+ "not-found": /* @__PURE__ */ f(d, {}),
21
+ "new-chat": /* @__PURE__ */ f(s, {}),
22
+ unknown: /* @__PURE__ */ f(l, {})
23
+ }, h = r(({ className: n, variant: r = "compact", type: a, children: o, ...s }, c) => {
24
+ let l = r === "full", u = i(() => ({
25
+ variant: r,
26
+ type: a
27
+ }), [r, a]);
28
+ return /* @__PURE__ */ f(t.Provider, {
29
+ value: u,
30
+ children: /* @__PURE__ */ f("div", {
31
+ ref: c,
32
+ "data-slot": "empty-state",
33
+ "data-variant": r,
34
+ className: e("flex min-w-0 flex-col items-center text-center text-foreground", l ? "gap-8 p-10" : "gap-2", !l && "w-full max-w-100", n),
35
+ ...s,
36
+ children: o
37
+ })
38
+ });
39
+ });
40
+ h.displayName = "EmptyState";
41
+ var g = r(({ className: t, children: r, ...i }, a) => {
42
+ let { variant: o, type: s } = n(), c = o === "full", l = r ?? (s ? m[s] : null);
43
+ return c ? /* @__PURE__ */ f("div", {
44
+ ref: a,
45
+ "data-slot": "empty-state-icon",
46
+ className: e("flex size-20 shrink-0 items-center justify-center rounded-2xl p-5 text-foreground [&_svg]:size-10 [&_svg]:stroke-[1.75]", s && p[s], t),
47
+ ...i,
48
+ children: l
49
+ }) : /* @__PURE__ */ f("div", {
50
+ ref: a,
51
+ "data-slot": "empty-state-icon",
52
+ className: e("flex size-6 shrink-0 items-center justify-center text-muted-foreground [&_svg]:size-6 [&_svg]:stroke-[1.75]", t),
53
+ ...i,
54
+ children: l
55
+ });
56
+ });
57
+ g.displayName = "EmptyStateIcon";
58
+ function _({ className: t, as: r = "h2", ...i }) {
59
+ let { variant: a } = n();
60
+ return /* @__PURE__ */ f(r, {
61
+ "data-slot": "empty-state-title",
62
+ className: e("max-w-100 break-words font-medium text-foreground", a === "full" ? "text-xl leading-6 tracking-tightest" : "text-base leading-5 tracking-tighter", t),
63
+ ...i
64
+ });
94
65
  }
95
- const I = g(
96
- ({ className: n, ...e }, a) => {
97
- const { variant: o } = m();
98
- return /* @__PURE__ */ t(
99
- "p",
100
- {
101
- ref: a,
102
- "data-slot": "empty-state-description",
103
- className: s(
104
- "max-w-100 break-words text-muted-foreground",
105
- o === "full" ? "text-lg leading-6 tracking-tightest" : "text-sm leading-4.5 tracking-tight",
106
- n
107
- ),
108
- ...e
109
- }
110
- );
111
- }
112
- );
113
- I.displayName = "EmptyStateDescription";
114
- const N = g(
115
- ({ className: n, ...e }, a) => {
116
- const { variant: o } = m();
117
- return /* @__PURE__ */ t(
118
- "div",
119
- {
120
- ref: a,
121
- "data-slot": "empty-state-actions",
122
- className: s(
123
- "flex flex-col items-center",
124
- o === "compact" ? "gap-2" : "gap-4",
125
- n
126
- ),
127
- ...e
128
- }
129
- );
130
- }
131
- );
132
- N.displayName = "EmptyStateActions";
133
- export {
134
- S as EmptyState,
135
- N as EmptyStateActions,
136
- I as EmptyStateDescription,
137
- E as EmptyStateIcon,
138
- A as EmptyStateTitle
139
- };
66
+ var v = r(({ className: t, ...r }, i) => {
67
+ let { variant: a } = n();
68
+ return /* @__PURE__ */ f("p", {
69
+ ref: i,
70
+ "data-slot": "empty-state-description",
71
+ className: e("max-w-100 break-words text-muted-foreground", a === "full" ? "text-lg leading-6 tracking-tightest" : "text-sm leading-4.5 tracking-tight", t),
72
+ ...r
73
+ });
74
+ });
75
+ v.displayName = "EmptyStateDescription";
76
+ var y = r(({ className: t, ...r }, i) => {
77
+ let { variant: a } = n();
78
+ return /* @__PURE__ */ f("div", {
79
+ ref: i,
80
+ "data-slot": "empty-state-actions",
81
+ className: e("flex flex-col items-center", a === "compact" ? "gap-2" : "gap-4", t),
82
+ ...r
83
+ });
84
+ });
85
+ y.displayName = "EmptyStateActions";
86
+ //#endregion
87
+ export { h as EmptyState, y as EmptyStateActions, v as EmptyStateDescription, g as EmptyStateIcon, _ as EmptyStateTitle };