@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,115 +1,80 @@
1
- import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import { Accordion as r } from "@base-ui/react/accordion";
4
- import { IconChevronDown as A } from "@tabler/icons-react";
5
- import { cn as u } from "../../../../lib/utils.js";
6
- const C = d(
7
- (e, t) => {
8
- if (e.type === "multiple") {
9
- const {
10
- type: s,
11
- value: c,
12
- defaultValue: b,
13
- onValueChange: m,
14
- ...x
15
- } = e;
16
- return /* @__PURE__ */ o(
17
- r.Root,
18
- {
19
- ref: t,
20
- "data-slot": "accordion",
21
- multiple: !0,
22
- value: c,
23
- defaultValue: b,
24
- onValueChange: (y) => {
25
- if (!m) return;
26
- const N = y.filter(
27
- (V) => V != null
28
- );
29
- m(N);
30
- },
31
- ...x
32
- }
33
- );
34
- }
35
- const {
36
- type: n,
37
- collapsible: i = !1,
38
- value: l,
39
- defaultValue: a,
40
- onValueChange: g,
41
- ...p
42
- } = e, h = l === void 0 ? void 0 : l === "" ? [] : [l], v = a === void 0 ? void 0 : a === "" ? [] : [a];
43
- return /* @__PURE__ */ o(
44
- r.Root,
45
- {
46
- ref: t,
47
- "data-slot": "accordion",
48
- multiple: !1,
49
- value: h,
50
- defaultValue: v,
51
- onValueChange: (s, c) => {
52
- if (g) {
53
- if (!i && s.length === 0) {
54
- c.cancel();
55
- return;
56
- }
57
- g(s[0] ?? "");
58
- }
59
- },
60
- ...p
61
- }
62
- );
63
- }
64
- );
65
- C.displayName = "Accordion";
66
- const w = d(({ className: e, ...t }, n) => /* @__PURE__ */ o(
67
- r.Item,
68
- {
69
- ref: n,
70
- "data-slot": "accordion-item",
71
- className: u("mt-2 first:mt-0 rounded-md", e),
72
- ...t
73
- }
74
- ));
75
- w.displayName = "AccordionItem";
76
- const k = d(({ className: e, children: t, icon: n, ...i }, l) => {
77
- const a = n;
78
- return /* @__PURE__ */ o(r.Header, { className: "flex", children: /* @__PURE__ */ f(
79
- r.Trigger,
80
- {
81
- ref: l,
82
- "data-slot": "accordion-trigger",
83
- className: u(
84
- "focus-visible:border-ring focus-visible:ring-ring-muted group/accordion-trigger flex flex-1 items-center justify-between gap-4.5 rounded-lg px-3 py-2 text-left hover:bg-muted-background hover:text-foreground focus-visible:ring text-base font-normal tracking-tightest transition-all outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:text-disabled-foreground aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:text-disabled-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled-foreground",
85
- e
86
- ),
87
- ...i,
88
- children: [
89
- /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
90
- a && /* @__PURE__ */ o(a, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200" }),
91
- /* @__PURE__ */ o("span", { children: t })
92
- ] }),
93
- /* @__PURE__ */ o(A, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200 group-aria-expanded/accordion-trigger:rotate-180" })
94
- ]
95
- }
96
- ) });
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { Accordion as n } from "@base-ui/react/accordion";
4
+ import { IconChevronDown as r } from "@tabler/icons-react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region libs/aura/src/components/ui/core/accordion/accordion.tsx
7
+ var o = t((e, t) => {
8
+ if (e.type === "multiple") {
9
+ let { type: r, value: a, defaultValue: o, onValueChange: s, ...c } = e;
10
+ return /* @__PURE__ */ i(n.Root, {
11
+ ref: t,
12
+ "data-slot": "accordion",
13
+ multiple: !0,
14
+ value: a,
15
+ defaultValue: o,
16
+ onValueChange: (e) => {
17
+ if (!s) return;
18
+ let t = e.filter((e) => e != null);
19
+ s(t);
20
+ },
21
+ ...c
22
+ });
23
+ }
24
+ let { type: r, collapsible: a = !1, value: o, defaultValue: s, onValueChange: c, ...l } = e, u = o === void 0 ? void 0 : o === "" ? [] : [o], d = s === void 0 ? void 0 : s === "" ? [] : [s];
25
+ return /* @__PURE__ */ i(n.Root, {
26
+ ref: t,
27
+ "data-slot": "accordion",
28
+ multiple: !1,
29
+ value: u,
30
+ defaultValue: d,
31
+ onValueChange: (e, t) => {
32
+ if (c) {
33
+ if (!a && e.length === 0) {
34
+ t.cancel();
35
+ return;
36
+ }
37
+ c(e[0] ?? "");
38
+ }
39
+ },
40
+ ...l
41
+ });
97
42
  });
98
- k.displayName = "AccordionTrigger";
99
- const I = d(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ o(
100
- r.Panel,
101
- {
102
- ref: i,
103
- "data-slot": "accordion-content",
104
- className: "h-(--accordion-panel-height) overflow-hidden text-sm font-normal tracking-tightest text-secondary-foreground transition-all duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",
105
- ...n,
106
- children: /* @__PURE__ */ o("div", { className: u("px-3 pb-3 pt-2", e), children: t })
107
- }
108
- ));
109
- I.displayName = "AccordionContent";
110
- export {
111
- C as Accordion,
112
- I as AccordionContent,
113
- w as AccordionItem,
114
- k as AccordionTrigger
115
- };
43
+ o.displayName = "Accordion";
44
+ var s = t(({ className: t, ...r }, a) => /* @__PURE__ */ i(n.Item, {
45
+ ref: a,
46
+ "data-slot": "accordion-item",
47
+ className: e("mt-2 first:mt-0 rounded-md", t),
48
+ ...r
49
+ }));
50
+ s.displayName = "AccordionItem";
51
+ var c = t(({ className: t, children: o, icon: s, ...c }, l) => {
52
+ let u = s;
53
+ return /* @__PURE__ */ i(n.Header, {
54
+ className: "flex",
55
+ children: /* @__PURE__ */ a(n.Trigger, {
56
+ ref: l,
57
+ "data-slot": "accordion-trigger",
58
+ className: e("focus-visible:border-ring focus-visible:ring-ring-muted group/accordion-trigger flex flex-1 items-center justify-between gap-4.5 rounded-lg px-3 py-2 text-left hover:bg-muted-background hover:text-foreground focus-visible:ring text-base font-normal tracking-tightest transition-all outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:text-disabled-foreground aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:text-disabled-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:text-disabled-foreground", t),
59
+ ...c,
60
+ children: [/* @__PURE__ */ a("div", {
61
+ className: "flex items-center gap-2",
62
+ children: [u && /* @__PURE__ */ i(u, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200" }), /* @__PURE__ */ i("span", { children: o })]
63
+ }), /* @__PURE__ */ i(r, { className: "pointer-events-none size-4 shrink-0 transition-transform duration-200 group-aria-expanded/accordion-trigger:rotate-180" })]
64
+ })
65
+ });
66
+ });
67
+ c.displayName = "AccordionTrigger";
68
+ var l = t(({ className: t, children: r, ...a }, o) => /* @__PURE__ */ i(n.Panel, {
69
+ ref: o,
70
+ "data-slot": "accordion-content",
71
+ className: "h-(--accordion-panel-height) overflow-hidden text-sm font-normal tracking-tightest text-secondary-foreground transition-all duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",
72
+ ...a,
73
+ children: /* @__PURE__ */ i("div", {
74
+ className: e("px-3 pb-3 pt-2", t),
75
+ children: r
76
+ })
77
+ }));
78
+ l.displayName = "AccordionContent";
79
+ //#endregion
80
+ export { o as Accordion, l as AccordionContent, s as AccordionItem, c as AccordionTrigger };
@@ -1,176 +1,108 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
- import { createContext as b, forwardRef as e, useMemo as A, useContext as x } from "react";
3
- import { IconX as T } from "@tabler/icons-react";
4
- import { cva as y } from "class-variance-authority";
5
- import { cn as s } from "../../../../lib/utils.js";
6
- import { Button as f } from "../button/button.js";
7
- import { TooltipProvider as g, Tooltip as h, TooltipTrigger as w, TooltipContent as N } from "../tooltip/tooltip.js";
8
- const v = y(
9
- "min-w-[400px] max-w-[1200px] h-14 flex items-center justify-between gap-3 bg-raised-background text-foreground-fixed-light pl-4 pr-3 rounded-xl shadow-default",
10
- {
11
- variants: {
12
- width: {
13
- full: "w-full",
14
- fit: "w-fit"
15
- }
16
- },
17
- defaultVariants: {
18
- width: "full"
19
- }
20
- }
21
- ), p = b({
22
- selectedCount: void 0
23
- }), k = e(
24
- ({ className: t, width: a, role: n = "toolbar", selectedCount: o, ...r }, l) => {
25
- const c = typeof o == "number" && o === 0, d = A(() => ({ selectedCount: o }), [o]);
26
- return c ? null : /* @__PURE__ */ i(g, { delayDuration: 0, children: /* @__PURE__ */ i(p.Provider, { value: d, children: /* @__PURE__ */ i(
27
- "div",
28
- {
29
- ref: l,
30
- "data-slot": "action-toolbar",
31
- role: n,
32
- className: s(v({ width: a }), t),
33
- ...r
34
- }
35
- ) }) });
36
- }
37
- );
38
- k.displayName = "ActionToolbar";
39
- const C = e(
40
- ({ className: t, role: a = "group", ...n }, o) => /* @__PURE__ */ i(
41
- "div",
42
- {
43
- ref: o,
44
- "data-slot": "action-toolbar-selection",
45
- role: a,
46
- className: s("flex min-w-0 shrink-0 items-center gap-3", t),
47
- ...n
48
- }
49
- )
50
- );
51
- C.displayName = "ActionToolbarSelection";
52
- const S = e(
53
- ({ className: t, count: a, label: n = "selected", children: o, ...r }, l) => {
54
- const { selectedCount: c } = x(p), d = a ?? c;
55
- return /* @__PURE__ */ i(
56
- "div",
57
- {
58
- ref: l,
59
- "data-slot": "action-toolbar-selection-summary",
60
- className: s("flex min-w-0", t),
61
- ...r,
62
- children: o ?? /* @__PURE__ */ m(
63
- "span",
64
- {
65
- "data-slot": "action-toolbar-selection-label",
66
- className: "flex min-w-0 items-center gap-0.5 text-sm font-medium leading-4.5 tracking-normal text-foreground-fixed-light",
67
- children: [
68
- d == null ? null : /* @__PURE__ */ i("span", { children: d }),
69
- /* @__PURE__ */ i("span", { className: "truncate", children: n })
70
- ]
71
- }
72
- )
73
- }
74
- );
75
- }
76
- );
77
- S.displayName = "ActionToolbarSelectionSummary";
78
- const O = e(
79
- ({ className: t, role: a = "group", ...n }, o) => /* @__PURE__ */ i(
80
- "div",
81
- {
82
- ref: o,
83
- "data-slot": "action-toolbar-actions",
84
- role: a,
85
- className: s(
86
- "flex min-w-0 shrink-0 items-center justify-end gap-1",
87
- t
88
- ),
89
- ...n
90
- }
91
- )
92
- );
93
- O.displayName = "ActionToolbarActions";
94
- const u = e(
95
- ({
96
- className: t,
97
- variant: a = "ghostOnDark",
98
- iconOnly: n = !1,
99
- "aria-label": o,
100
- children: r,
101
- ...l
102
- }, c) => n && o ? /* @__PURE__ */ m(h, { children: [
103
- /* @__PURE__ */ i(
104
- w,
105
- {
106
- render: /* @__PURE__ */ i(
107
- f,
108
- {
109
- ref: c,
110
- "data-slot": "action-toolbar-action",
111
- variant: a,
112
- size: "icon",
113
- "aria-label": o,
114
- className: t,
115
- ...l,
116
- children: r
117
- }
118
- )
119
- }
120
- ),
121
- /* @__PURE__ */ i(N, { sideOffset: 18, children: o })
122
- ] }) : /* @__PURE__ */ i(
123
- f,
124
- {
125
- ref: c,
126
- "data-slot": "action-toolbar-action",
127
- variant: a,
128
- size: n ? "icon" : "default",
129
- "aria-label": o,
130
- className: t,
131
- ...l,
132
- children: r
133
- }
134
- )
135
- );
136
- u.displayName = "ActionToolbarAction";
137
- const j = e(
138
- ({ icon: t, label: a = "Clear", ...n }, o) => /* @__PURE__ */ m(
139
- u,
140
- {
141
- ref: o,
142
- "data-slot": "action-toolbar-action-clear",
143
- variant: "secondaryOnDark",
144
- iconOnly: !1,
145
- ...n,
146
- children: [
147
- t ?? /* @__PURE__ */ i(T, {}),
148
- a
149
- ]
150
- }
151
- )
152
- );
153
- j.displayName = "ActionToolbarActionClear";
154
- const D = e(
155
- ({ className: t, ...a }, n) => /* @__PURE__ */ i(
156
- u,
157
- {
158
- ref: n,
159
- "data-slot": "action-toolbar-primary-action",
160
- variant: "defaultOnDark",
161
- iconOnly: !1,
162
- className: s("ml-2", t),
163
- ...a
164
- }
165
- )
166
- );
167
- D.displayName = "ActionToolbarPrimaryAction";
168
- export {
169
- k as ActionToolbar,
170
- u as ActionToolbarAction,
171
- j as ActionToolbarActionClear,
172
- O as ActionToolbarActions,
173
- D as ActionToolbarPrimaryAction,
174
- C as ActionToolbarSelection,
175
- S as ActionToolbarSelectionSummary
176
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "../tooltip/tooltip.js";
4
+ import { createContext as o, forwardRef as s, useContext as c, useMemo as l } from "react";
5
+ import { IconX as u } from "@tabler/icons-react";
6
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { cva as p } from "class-variance-authority";
8
+ //#region libs/aura/src/components/ui/core/action-toolbar/action-toolbar.tsx
9
+ var m = p("min-w-[400px] max-w-[1200px] h-14 flex items-center justify-between gap-3 bg-raised-background text-foreground-fixed-light pl-4 pr-3 rounded-xl shadow-default", {
10
+ variants: { width: {
11
+ full: "w-full",
12
+ fit: "w-fit"
13
+ } },
14
+ defaultVariants: { width: "full" }
15
+ }), h = o({ selectedCount: void 0 }), g = s(({ className: t, width: n, role: r = "toolbar", selectedCount: a, ...o }, s) => {
16
+ let c = typeof a == "number" && a === 0, u = l(() => ({ selectedCount: a }), [a]);
17
+ return c ? null : /* @__PURE__ */ d(i, {
18
+ delayDuration: 0,
19
+ children: /* @__PURE__ */ d(h.Provider, {
20
+ value: u,
21
+ children: /* @__PURE__ */ d("div", {
22
+ ref: s,
23
+ "data-slot": "action-toolbar",
24
+ role: r,
25
+ className: e(m({ width: n }), t),
26
+ ...o
27
+ })
28
+ })
29
+ });
30
+ });
31
+ g.displayName = "ActionToolbar";
32
+ var _ = s(({ className: t, role: n = "group", ...r }, i) => /* @__PURE__ */ d("div", {
33
+ ref: i,
34
+ "data-slot": "action-toolbar-selection",
35
+ role: n,
36
+ className: e("flex min-w-0 shrink-0 items-center gap-3", t),
37
+ ...r
38
+ }));
39
+ _.displayName = "ActionToolbarSelection";
40
+ var v = s(({ className: t, count: n, label: r = "selected", children: i, ...a }, o) => {
41
+ let { selectedCount: s } = c(h), l = n ?? s;
42
+ return /* @__PURE__ */ d("div", {
43
+ ref: o,
44
+ "data-slot": "action-toolbar-selection-summary",
45
+ className: e("flex min-w-0", t),
46
+ ...a,
47
+ children: i ?? /* @__PURE__ */ f("span", {
48
+ "data-slot": "action-toolbar-selection-label",
49
+ className: "flex min-w-0 items-center gap-0.5 text-sm font-medium leading-4.5 tracking-normal text-foreground-fixed-light",
50
+ children: [l == null ? null : /* @__PURE__ */ d("span", { children: l }), /* @__PURE__ */ d("span", {
51
+ className: "truncate",
52
+ children: r
53
+ })]
54
+ })
55
+ });
56
+ });
57
+ v.displayName = "ActionToolbarSelectionSummary";
58
+ var y = s(({ className: t, role: n = "group", ...r }, i) => /* @__PURE__ */ d("div", {
59
+ ref: i,
60
+ "data-slot": "action-toolbar-actions",
61
+ role: n,
62
+ className: e("flex min-w-0 shrink-0 items-center justify-end gap-1", t),
63
+ ...r
64
+ }));
65
+ y.displayName = "ActionToolbarActions";
66
+ var b = s(({ className: e, variant: i = "ghostOnDark", iconOnly: o = !1, "aria-label": s, children: c, ...l }, u) => o && s ? /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(a, { render: /* @__PURE__ */ d(t, {
67
+ ref: u,
68
+ "data-slot": "action-toolbar-action",
69
+ variant: i,
70
+ size: "icon",
71
+ "aria-label": s,
72
+ className: e,
73
+ ...l,
74
+ children: c
75
+ }) }), /* @__PURE__ */ d(r, {
76
+ sideOffset: 18,
77
+ children: s
78
+ })] }) : /* @__PURE__ */ d(t, {
79
+ ref: u,
80
+ "data-slot": "action-toolbar-action",
81
+ variant: i,
82
+ size: o ? "icon" : "default",
83
+ "aria-label": s,
84
+ className: e,
85
+ ...l,
86
+ children: c
87
+ }));
88
+ b.displayName = "ActionToolbarAction";
89
+ var x = s(({ icon: e, label: t = "Clear", ...n }, r) => /* @__PURE__ */ f(b, {
90
+ ref: r,
91
+ "data-slot": "action-toolbar-action-clear",
92
+ variant: "secondaryOnDark",
93
+ iconOnly: !1,
94
+ ...n,
95
+ children: [e ?? /* @__PURE__ */ d(u, {}), t]
96
+ }));
97
+ x.displayName = "ActionToolbarActionClear";
98
+ var S = s(({ className: t, ...n }, r) => /* @__PURE__ */ d(b, {
99
+ ref: r,
100
+ "data-slot": "action-toolbar-primary-action",
101
+ variant: "defaultOnDark",
102
+ iconOnly: !1,
103
+ className: e("ml-2", t),
104
+ ...n
105
+ }));
106
+ S.displayName = "ActionToolbarPrimaryAction";
107
+ //#endregion
108
+ export { g as ActionToolbar, b as ActionToolbarAction, x as ActionToolbarActionClear, y as ActionToolbarActions, S as ActionToolbarPrimaryAction, _ as ActionToolbarSelection, v as ActionToolbarSelectionSummary };