@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.
Files changed (120) hide show
  1. package/DESIGN.md +1651 -7
  2. package/README.md +45 -3
  3. package/dist/components/index.d.ts +4 -2
  4. package/dist/components/index.js +58 -325
  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 -83
  26. package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
  27. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -62
  28. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -98
  29. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
  30. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -81
  31. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -189
  32. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
  33. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -158
  34. package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
  35. package/dist/components/ui/core/date-time-pickers/index.js +5 -8
  36. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  37. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
  38. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
  39. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
  40. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  41. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  42. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
  43. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -39
  44. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  45. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  46. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  47. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  48. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  49. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  50. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
  51. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
  52. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
  53. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  54. package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
  55. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
  56. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +79 -0
  57. package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
  58. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
  59. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +42 -0
  60. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
  61. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  62. package/dist/components/ui/core/dialog/dialog.js +82 -155
  63. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +19 -17
  64. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -250
  65. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  66. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  67. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  68. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  69. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  70. package/dist/components/ui/core/input/input.js +12 -27
  71. package/dist/components/ui/core/input-group/input-group.js +76 -173
  72. package/dist/components/ui/core/kbd/kbd.js +20 -36
  73. package/dist/components/ui/core/label/label.js +26 -43
  74. package/dist/components/ui/core/loader/loader.js +80 -117
  75. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  76. package/dist/components/ui/core/message/message.d.ts +2 -2
  77. package/dist/components/ui/core/message/message.js +316 -542
  78. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  79. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  80. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  81. package/dist/components/ui/core/pagination/pagination.js +231 -334
  82. package/dist/components/ui/core/popover/popover.js +90 -157
  83. package/dist/components/ui/core/progress/progress.js +36 -61
  84. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  85. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  86. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  87. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  88. package/dist/components/ui/core/search/search.js +77 -99
  89. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  90. package/dist/components/ui/core/select/select.js +168 -293
  91. package/dist/components/ui/core/separator/separator.js +13 -23
  92. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  93. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  94. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  95. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  96. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  97. package/dist/components/ui/core/sources/sources.js +58 -79
  98. package/dist/components/ui/core/switch/switch.js +62 -0
  99. package/dist/components/ui/core/tabs/tabs.js +149 -223
  100. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  101. package/dist/components/ui/core/textarea/textarea.js +13 -27
  102. package/dist/components/ui/core/toggle/toggle.js +55 -74
  103. package/dist/components/ui/core/tool/tool.js +127 -163
  104. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  105. package/dist/components/ui/core/topbar/topbar.js +106 -190
  106. package/dist/eslint/index.js +5 -10
  107. package/dist/eslint/no-overriding-styles.js +178 -237
  108. package/dist/icons/index.d.ts +1 -0
  109. package/dist/icons/index.js +1 -0
  110. package/dist/lib/highlight-code.d.ts +9 -0
  111. package/dist/lib/highlight-code.js +42 -0
  112. package/dist/lib/portal-container-context.js +8 -9
  113. package/dist/lib/style-scope.js +6 -6
  114. package/dist/lib/use-controllable-state.js +21 -30
  115. package/dist/lib/utils.d.ts +0 -2
  116. package/dist/lib/utils.js +32 -112
  117. package/dist/styles.css +1 -1
  118. package/dist/styles.source.css +23 -0
  119. package/package.json +23 -7
  120. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
@@ -1,257 +1,157 @@
1
- import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
- import { forwardRef as i } from "react";
3
- import { Menu as r } from "@base-ui/react/menu";
4
- import { IconCheck as l, IconChevronRight as m } from "@tabler/icons-react";
5
- import { usePortalContainer as g } from "../../../../lib/portal-container-context.js";
6
- import { cn as d } from "../../../../lib/utils.js";
7
- function G({ ...e }) {
8
- 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
+ });
9
27
  }
10
- function f({
11
- container: e,
12
- ...t
13
- }) {
14
- const o = g();
15
- return /* @__PURE__ */ n(
16
- r.Portal,
17
- {
18
- "data-slot": "dropdown-menu-portal",
19
- container: e ?? o,
20
- ...t
21
- }
22
- );
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
+ });
23
35
  }
24
- function L({
25
- children: e,
26
- ...t
27
- }) {
28
- 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
+ });
29
59
  }
30
- function b({
31
- align: e = "start",
32
- alignOffset: t = 0,
33
- side: o = "bottom",
34
- sideOffset: a = 4,
35
- className: s,
36
- container: u,
37
- ...p
38
- }) {
39
- return /* @__PURE__ */ n(f, { container: u, children: /* @__PURE__ */ n(
40
- r.Positioner,
41
- {
42
- className: "isolate z-50 outline-none",
43
- align: e,
44
- alignOffset: t,
45
- side: o,
46
- sideOffset: a,
47
- children: /* @__PURE__ */ n(
48
- r.Popup,
49
- {
50
- "data-slot": "dropdown-menu-content",
51
- className: d(
52
- "bg-popover-background text-foreground p-1 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md outline-none",
53
- s
54
- ),
55
- ...p
56
- }
57
- )
58
- }
59
- ) });
60
+ function m({ ...e }) {
61
+ return /* @__PURE__ */ a(c.Group, {
62
+ "data-slot": "dropdown-menu-group",
63
+ ...e
64
+ });
60
65
  }
61
- function P({ ...e }) {
62
- 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
+ });
63
93
  }
64
- const v = i(({ className: e, inset: t, variant: o = "default", children: a, ...s }, u) => /* @__PURE__ */ n(
65
- r.Item,
66
- {
67
- ref: u,
68
- "data-slot": "dropdown-menu-item",
69
- "data-inset": t,
70
- "data-variant": o,
71
- className: d(
72
- "focus:bg-accent-background focus:text-foreground data-[variant=destructive]:text-destructive-foreground data-[variant=destructive]:focus:bg-destructive-background-hover dark:data-[variant=destructive]:focus:bg-destructive-background-hover data-[variant=destructive]:focus:text-destructive-foreground data-[variant=destructive]:*:[svg]:text-destructive-foreground data-[variant=destructive]:hover:bg-destructive-background-hover dark:data-[variant=destructive]:hover:bg-destructive-background-hover [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm p-2 text-base outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
73
- e
74
- ),
75
- ...s,
76
- children: a
77
- }
78
- ));
79
- v.displayName = "DropdownMenuItem";
80
- const x = i(({ className: e, children: t, checked: o, ...a }, s) => /* @__PURE__ */ c(
81
- r.CheckboxItem,
82
- {
83
- ref: s,
84
- "data-slot": "dropdown-menu-checkbox-item",
85
- className: d(
86
- "focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
87
- e
88
- ),
89
- checked: o,
90
- ...a,
91
- children: [
92
- /* @__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" }) }) }),
93
- t
94
- ]
95
- }
96
- ));
97
- x.displayName = "DropdownMenuCheckboxItem";
98
- function T({
99
- ...e
100
- }) {
101
- return /* @__PURE__ */ n(
102
- r.RadioGroup,
103
- {
104
- "data-slot": "dropdown-menu-radio-group",
105
- ...e
106
- }
107
- );
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
+ });
108
130
  }
109
- const w = i(({ className: e, children: t, ...o }, a) => /* @__PURE__ */ c(
110
- r.RadioItem,
111
- {
112
- ref: a,
113
- "data-slot": "dropdown-menu-radio-item",
114
- className: d(
115
- "focus:bg-accent-background focus:text-foreground h-9 relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
116
- e
117
- ),
118
- ...o,
119
- children: [
120
- /* @__PURE__ */ n("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ n(r.RadioItemIndicator, { children: /* @__PURE__ */ n(l, { className: "size-4 text-foreground" }) }) }),
121
- t
122
- ]
123
- }
124
- ));
125
- w.displayName = "DropdownMenuRadioItem";
126
- const h = i(({ className: e, inset: t, ...o }, a) => /* @__PURE__ */ n(
127
- r.GroupLabel,
128
- {
129
- ref: a,
130
- "data-slot": "dropdown-menu-label",
131
- "data-inset": t,
132
- className: d(
133
- "-mx-1 -mt-1 mb-1 px-2 py-1.5 text-sm border-b border-border font-medium data-inset:pl-8 text-foreground dark:text-foreground",
134
- e
135
- ),
136
- ...o
137
- }
138
- ));
139
- h.displayName = "DropdownMenuLabel";
140
- const M = i(
141
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
142
- "div",
143
- {
144
- ref: o,
145
- "data-slot": "dropdown-menu-header",
146
- className: d(
147
- "-mx-1 -mt-1 mb-1 flex flex-row items-center gap-2 border-b border-border px-2 py-2 pointer-events-none",
148
- e
149
- ),
150
- ...t
151
- }
152
- )
153
- );
154
- M.displayName = "DropdownMenuHeader";
155
- const D = i(({ className: e, ...t }, o) => /* @__PURE__ */ n(
156
- r.Separator,
157
- {
158
- ref: o,
159
- "data-slot": "dropdown-menu-separator",
160
- className: d("bg-border -mx-1 my-1 h-px", e),
161
- ...t
162
- }
163
- ));
164
- D.displayName = "DropdownMenuSeparator";
165
- const N = i(
166
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
167
- "span",
168
- {
169
- ref: o,
170
- "data-slot": "dropdown-menu-shortcut",
171
- className: d(
172
- "text-muted-foreground ml-auto text-xs tracking-widest",
173
- e
174
- ),
175
- ...t
176
- }
177
- )
178
- );
179
- N.displayName = "DropdownMenuShortcut";
180
- function j({
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 k = i(({ className: e, inset: t, children: o, ...a }, s) => /* @__PURE__ */ c(
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 cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm 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(m, { className: "ml-auto size-4" })
199
- ]
200
- }
201
- ));
202
- k.displayName = "DropdownMenuSubTrigger";
203
- function H({
204
- align: e = "start",
205
- alignOffset: t = -3,
206
- side: o = "right",
207
- sideOffset: a = 0,
208
- className: s,
209
- ...u
210
- }) {
211
- return /* @__PURE__ */ n(
212
- b,
213
- {
214
- "data-slot": "dropdown-menu-sub-content",
215
- className: d("min-w-32 w-auto", s),
216
- align: e,
217
- alignOffset: t,
218
- side: o,
219
- sideOffset: a,
220
- ...u
221
- }
222
- );
223
- }
224
- const y = i(
225
- ({ className: e, ...t }, o) => /* @__PURE__ */ n(
226
- "div",
227
- {
228
- ref: o,
229
- "data-slot": "dropdown-menu-section-label",
230
- className: d(
231
- "px-2 py-1 text-sm text-muted-foreground dark:text-muted-foreground",
232
- e
233
- ),
234
- ...t
235
- }
236
- )
237
- );
238
- y.displayName = "DropdownMenuSectionLabel";
239
- export {
240
- G as DropdownMenu,
241
- x as DropdownMenuCheckboxItem,
242
- b as DropdownMenuContent,
243
- P as DropdownMenuGroup,
244
- M as DropdownMenuHeader,
245
- v as DropdownMenuItem,
246
- h as DropdownMenuLabel,
247
- f as DropdownMenuPortal,
248
- T as DropdownMenuRadioGroup,
249
- w as DropdownMenuRadioItem,
250
- y as DropdownMenuSectionLabel,
251
- D as DropdownMenuSeparator,
252
- N as DropdownMenuShortcut,
253
- j as DropdownMenuSub,
254
- H as DropdownMenuSubContent,
255
- k as DropdownMenuSubTrigger,
256
- L as DropdownMenuTrigger
257
- };
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 };