@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,108 +1,41 @@
1
- import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
- import { memo as h, useMemo as p } from "react";
3
- import { motion as m } from "framer-motion";
4
- import { cn as u } from "../../../../lib/utils.js";
5
- const v = {
6
- nordic: "var(--gradient-nordic)",
7
- aurora: "var(--gradient-aurora)",
8
- dusk: "var(--gradient-dusk)",
9
- equinox: "var(--gradient-equinox)",
10
- summer: "var(--gradient-summer)",
11
- spring: "var(--gradient-spring)",
12
- fall: "var(--gradient-fall)"
13
- }, c = {
14
- backgroundPosition: ["100% center, center", "0% center, center"]
15
- };
16
- function x(e, a) {
17
- const r = e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
18
- return {
19
- ...a,
20
- WebkitMaskImage: `url("${r}")`,
21
- maskImage: `url("${r}")`,
22
- WebkitMaskRepeat: "no-repeat",
23
- maskRepeat: "no-repeat",
24
- WebkitMaskSize: "contain",
25
- maskSize: "contain",
26
- WebkitMaskPosition: "center",
27
- maskPosition: "center"
28
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { memo as t, useMemo as n } from "react";
3
+ import { jsx as r } from "react/jsx-runtime";
4
+ import { motion as i } from "framer-motion";
5
+ //#region libs/aura/src/components/ui/core/shimmer/shimmer.tsx
6
+ var a = {
7
+ nordic: "var(--gradient-nordic)",
8
+ aurora: "var(--gradient-aurora)",
9
+ dusk: "var(--gradient-dusk)",
10
+ equinox: "var(--gradient-equinox)",
11
+ summer: "var(--gradient-summer)",
12
+ spring: "var(--gradient-spring)",
13
+ fall: "var(--gradient-fall)",
14
+ active: "var(--gradient-active)"
15
+ }, o = { backgroundPosition: ["100% center, center", "0% center, center"] }, s = { backgroundPosition: ["0% center, 0% center", "-200% center, -200% center"] };
16
+ function c({ children: t, as: c = "p", className: l, duration: u = 2, spread: d = 2, variant: f = "default" }) {
17
+ let p = n(() => (t?.length ?? 0) * d, [t, d]), m = n(() => {
18
+ let e = "linear-gradient(90deg, transparent calc(50% - var(--spread)), rgba(255, 255, 255, 0.4), transparent calc(50% + var(--spread)))";
19
+ return f === "default" ? `${e}, linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))` : `${e}, ${a[f]}`;
20
+ }, [f]), h = {
21
+ "--spread": `${p}px`,
22
+ backgroundImage: m,
23
+ backgroundSize: f === "active" ? "200% 100%, 200% 100%" : "250% 100%, 100% 100%"
24
+ }, g = {
25
+ repeat: Infinity,
26
+ duration: u,
27
+ ease: "linear"
28
+ }, _ = i[c];
29
+ return /* @__PURE__ */ r(_, {
30
+ "data-slot": "shimmer",
31
+ className: e("relative inline-block bg-clip-text text-transparent rounded-md", l),
32
+ animate: f === "active" ? s : o,
33
+ style: h,
34
+ transition: g,
35
+ children: t
36
+ });
29
37
  }
30
- function S({
31
- children: e,
32
- iconUrl: a,
33
- as: r = "p",
34
- className: l,
35
- duration: g = 2,
36
- spread: d = 2,
37
- variant: n = "default"
38
- }) {
39
- const k = p(
40
- () => (e?.length ?? 0) * d,
41
- [e, d]
42
- ), f = p(() => {
43
- const t = "linear-gradient(90deg, transparent calc(50% - var(--spread)), rgba(255, 255, 255, 0.4), transparent calc(50% + var(--spread)))";
44
- return n === "default" ? `${t}, linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))` : `${t}, ${v[n]}`;
45
- }, [n]), i = {
46
- "--spread": `${k}px`,
47
- backgroundImage: f,
48
- backgroundSize: "250% 100%, 100% 100%"
49
- }, o = {
50
- repeat: Number.POSITIVE_INFINITY,
51
- duration: g,
52
- ease: "linear"
53
- };
54
- if (!a) {
55
- const t = m[r];
56
- return /* @__PURE__ */ s(
57
- t,
58
- {
59
- "data-slot": "shimmer",
60
- className: u(
61
- "relative inline-block bg-clip-text text-transparent rounded-md",
62
- l
63
- ),
64
- animate: c,
65
- style: i,
66
- transition: o,
67
- children: e
68
- }
69
- );
70
- }
71
- return /* @__PURE__ */ b(
72
- r,
73
- {
74
- "data-slot": "shimmer",
75
- className: u(
76
- "relative rounded-md inline-flex items-center gap-1.5",
77
- l
78
- ),
79
- children: [
80
- /* @__PURE__ */ s(
81
- m.span,
82
- {
83
- "aria-hidden": !0,
84
- className: "inline-block size-[1em] shrink-0",
85
- animate: c,
86
- style: x(a, i),
87
- transition: o
88
- }
89
- ),
90
- /* @__PURE__ */ s(
91
- m.span,
92
- {
93
- className: "inline-block bg-clip-text text-transparent",
94
- animate: c,
95
- style: i,
96
- transition: o,
97
- children: e
98
- }
99
- )
100
- ]
101
- }
102
- );
103
- }
104
- const I = h(S);
105
- I.displayName = "Shimmer";
106
- export {
107
- I as Shimmer
108
- };
38
+ var l = t(c);
39
+ l.displayName = "Shimmer";
40
+ //#endregion
41
+ export { l as Shimmer };
@@ -1,18 +1,13 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as r } from "react";
3
- import { cn as m } from "../../../../lib/utils.js";
4
- const n = r(
5
- ({ className: o, ...e }, t) => /* @__PURE__ */ a(
6
- "div",
7
- {
8
- ref: t,
9
- "data-slot": "skeleton",
10
- className: m("bg-accent-background animate-pulse rounded-md", o),
11
- ...e
12
- }
13
- )
14
- );
15
- n.displayName = "Skeleton";
16
- export {
17
- n as Skeleton
18
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region libs/aura/src/components/ui/core/skeleton/skeleton.tsx
5
+ var r = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
6
+ ref: i,
7
+ "data-slot": "skeleton",
8
+ className: e("bg-accent-background animate-pulse rounded-md", t),
9
+ ...r
10
+ }));
11
+ r.displayName = "Skeleton";
12
+ //#endregion
13
+ export { r as Skeleton };
@@ -0,0 +1,9 @@
1
+ import { ComponentRef, ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ import { Slider as SliderPrimitive } from '@base-ui/react/slider';
3
+ type SliderProps = Omit<SliderPrimitive.Root.Props<readonly number[]>, 'value' | 'defaultValue' | 'onValueChange'> & {
4
+ value?: number[];
5
+ defaultValue?: number[];
6
+ onValueChange?: (value: number[]) => void;
7
+ };
8
+ declare const Slider: ForwardRefExoticComponent<Omit<SliderProps, 'ref'> & RefAttributes<ComponentRef<typeof SliderPrimitive.Root>>>;
9
+ export { Slider };
@@ -0,0 +1,40 @@
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { Slider as i } from "@base-ui/react/slider";
5
+ //#region libs/aura/src/components/ui/core/slider/slider.tsx
6
+ var a = t(({ className: t, defaultValue: a, value: o, min: s = 0, max: c = 100, onValueChange: l, ...u }, d) => {
7
+ let f = Array.isArray(o) ? o : Array.isArray(a) ? a : [s];
8
+ return /* @__PURE__ */ n(i.Root, {
9
+ ref: d,
10
+ "data-slot": "slider",
11
+ "data-range": f.length > 1 ? "" : void 0,
12
+ defaultValue: a,
13
+ value: o,
14
+ min: s,
15
+ max: c,
16
+ className: e("group/slider data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full", t),
17
+ thumbAlignment: "edge",
18
+ onValueChange: (e) => {
19
+ l && l(Array.isArray(e) ? [...e] : [e]);
20
+ },
21
+ ...u,
22
+ children: /* @__PURE__ */ r(i.Control, {
23
+ className: "relative flex w-full touch-none items-center select-none data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
24
+ children: [/* @__PURE__ */ n(i.Track, {
25
+ "data-slot": "slider-track",
26
+ className: "relative z-0 grow overflow-hidden rounded-full bg-transparent ring-1 ring-border-emphasized ring-inset data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-3",
27
+ children: /* @__PURE__ */ n(i.Indicator, {
28
+ "data-slot": "slider-range",
29
+ className: e("relative z-10 bg-transparent select-none", "after:absolute after:rounded-full after:bg-secondary-background", "group-data-[range]/slider:after:rounded-none", "group-data-[range]/slider:group-data-[orientation=horizontal]/slider:after:left-0", "group-data-[range]/slider:group-data-[orientation=vertical]/slider:after:bottom-0", "group-data-[disabled]/slider:after:bg-disabled-background", "group-data-[orientation=horizontal]/slider:after:inset-e-0 group-data-[orientation=horizontal]/slider:after:left-0.5 group-data-[orientation=horizontal]/slider:after:top-1/2 group-data-[orientation=horizontal]/slider:after:h-2 group-data-[orientation=horizontal]/slider:after:-translate-y-1/2", "group-data-[orientation=vertical]/slider:after:inset-bs-0 group-data-[orientation=vertical]/slider:after:bottom-0.5 group-data-[orientation=vertical]/slider:after:left-1/2 group-data-[orientation=vertical]/slider:after:w-2 group-data-[orientation=vertical]/slider:after:-translate-x-1/2")
30
+ })
31
+ }), f.map((t, r) => /* @__PURE__ */ n(i.Thumb, {
32
+ "data-slot": "slider-thumb",
33
+ className: e("relative block size-3 shrink-0 rounded-full outline-none", "before:absolute before:top-1/2 before:left-1/2 before:size-2 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:bg-foreground before:transition-[width,height]", "hover:before:size-3", "focus-visible:before:size-3 focus-visible:ring-ring-muted focus-visible:ring-4", "active:before:size-3", "data-disabled:pointer-events-none data-disabled:before:bg-disabled-foreground")
34
+ }, r))]
35
+ })
36
+ });
37
+ });
38
+ a.displayName = "Slider";
39
+ //#endregion
40
+ export { a as Slider };
@@ -1,48 +1,55 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { IconLoader2 as o, IconAlertOctagonFilled as s, IconAlertTriangleFilled as a, IconInfoCircleFilled as i, IconCircleCheckFilled as l, IconX as d } from "@tabler/icons-react";
3
- import { Toaster as c } from "sonner";
4
- import { toast as k } from "sonner";
5
- import { cn as r } from "../../../../lib/utils.js";
6
- const g = {
7
- "--normal-bg": "var(--raised-background)",
8
- "--normal-text": "var(--foreground-fixed-light)",
9
- "--normal-border": "transparent",
10
- "--border-radius": "var(--radius-lg)"
11
- }, p = ({ ...n }) => {
12
- const t = "flex h-5 min-w-5 items-center justify-center rounded-md px-1";
13
- return /* @__PURE__ */ e(
14
- c,
15
- {
16
- "data-slot": "sonner-toast",
17
- theme: "system",
18
- className: "toaster group",
19
- icons: {
20
- close: /* @__PURE__ */ e(d, { className: "size-4 text-foreground-fixed-light" }),
21
- success: /* @__PURE__ */ e("span", { className: r(t, "bg-success-background"), children: /* @__PURE__ */ e(l, { className: "size-3 text-success-foreground-on-success" }) }),
22
- info: /* @__PURE__ */ e("span", { className: r(t, "bg-info-background"), children: /* @__PURE__ */ e(i, { className: "size-3 text-info-foreground-on-info" }) }),
23
- warning: /* @__PURE__ */ e("span", { className: r(t, "bg-warning-background"), children: /* @__PURE__ */ e(a, { className: "size-3 text-warning-foreground-on-warning" }) }),
24
- error: /* @__PURE__ */ e("span", { className: r(t, "bg-destructive-background"), children: /* @__PURE__ */ e(s, { className: "size-3 text-destructive-foreground-on-critical" }) }),
25
- loading: /* @__PURE__ */ e(o, { className: "size-4 animate-spin" })
26
- },
27
- style: g,
28
- toastOptions: {
29
- unstyled: !0,
30
- classNames: {
31
- toast: "flex w-[384px] min-h-11 items-center gap-2 rounded-lg bg-raised-background p-3 shadow-md has-[[data-description]]:[&_[data-icon]]:hidden",
32
- icon: "order-1 m-0 shrink-0 flex items-start",
33
- content: "order-2 flex flex-1 basis-0 flex-col items-start gap-0.5",
34
- title: "w-full self-stretch text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light",
35
- description: "w-full self-stretch text-sm font-normal leading-[18px] tracking-tight text-muted-foreground-fixed-light",
36
- actionButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
37
- cancelButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
38
- closeButton: "order-4 inline-flex size-7 items-center justify-center rounded-md text-foreground-fixed-light transition-all hover:cursor-pointer hover:text-foreground-fixed-light hover:!bg-transparent"
39
- }
40
- },
41
- ...n
42
- }
43
- );
44
- };
45
- export {
46
- p as Toaster,
47
- k as toast
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { IconAlertOctagonFilled as t, IconAlertTriangleFilled as n, IconCircleCheckFilled as r, IconInfoCircleFilled as i, IconLoader2 as a, IconX as o } from "@tabler/icons-react";
3
+ import { jsx as s } from "react/jsx-runtime";
4
+ import { Toaster as c, toast as l } from "sonner";
5
+ //#region libs/aura/src/components/ui/core/sonner-toast/sonner-toast.tsx
6
+ var u = {
7
+ "--normal-bg": "var(--raised-background)",
8
+ "--normal-text": "var(--foreground-fixed-light)",
9
+ "--normal-border": "transparent",
10
+ "--border-radius": "var(--radius-lg)"
11
+ }, d = ({ ...l }) => {
12
+ let d = "flex h-5 min-w-5 items-center justify-center rounded-md px-1";
13
+ return /* @__PURE__ */ s(c, {
14
+ "data-slot": "sonner-toast",
15
+ theme: "system",
16
+ className: "toaster group",
17
+ icons: {
18
+ close: /* @__PURE__ */ s(o, { className: "size-4 text-foreground-fixed-light" }),
19
+ success: /* @__PURE__ */ s("span", {
20
+ className: e(d, "bg-success-background"),
21
+ children: /* @__PURE__ */ s(r, { className: "size-3 text-success-foreground-on-success" })
22
+ }),
23
+ info: /* @__PURE__ */ s("span", {
24
+ className: e(d, "bg-info-background"),
25
+ children: /* @__PURE__ */ s(i, { className: "size-3 text-info-foreground-on-info" })
26
+ }),
27
+ warning: /* @__PURE__ */ s("span", {
28
+ className: e(d, "bg-warning-background"),
29
+ children: /* @__PURE__ */ s(n, { className: "size-3 text-warning-foreground-on-warning" })
30
+ }),
31
+ error: /* @__PURE__ */ s("span", {
32
+ className: e(d, "bg-destructive-background"),
33
+ children: /* @__PURE__ */ s(t, { className: "size-3 text-destructive-foreground-on-critical" })
34
+ }),
35
+ loading: /* @__PURE__ */ s(a, { className: "size-4 animate-spin" })
36
+ },
37
+ style: u,
38
+ toastOptions: {
39
+ unstyled: !0,
40
+ classNames: {
41
+ toast: "flex w-[384px] min-h-11 items-center gap-2 rounded-lg bg-raised-background p-3 shadow-md has-[[data-description]]:[&_[data-icon]]:hidden",
42
+ icon: "order-1 m-0 shrink-0 flex items-start",
43
+ content: "order-2 flex flex-1 basis-0 flex-col items-start gap-0.5",
44
+ title: "w-full self-stretch text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light",
45
+ description: "w-full self-stretch text-sm font-normal leading-[18px] tracking-tight text-muted-foreground-fixed-light",
46
+ actionButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
47
+ cancelButton: "order-3 ml-auto inline-flex h-7 items-center justify-center gap-1.5 rounded-md bg-transparent px-2 text-sm font-medium leading-[18px] tracking-normal text-foreground-fixed-light transition-all hover:cursor-pointer",
48
+ closeButton: "order-4 inline-flex size-7 items-center justify-center rounded-md text-foreground-fixed-light transition-all hover:cursor-pointer hover:text-foreground-fixed-light hover:!bg-transparent"
49
+ }
50
+ },
51
+ ...l
52
+ });
48
53
  };
54
+ //#endregion
55
+ export { d as Toaster, l as toast };
@@ -2,8 +2,12 @@ import { ComponentProps, ReactNode } from 'react';
2
2
  import { InlineCitationLink } from '../inline-citation/inline-citation';
3
3
  type SourcesProps = Omit<ComponentProps<'div'>, 'title'> & {
4
4
  title?: ReactNode | boolean;
5
+ collapsible?: boolean;
6
+ defaultOpen?: boolean;
7
+ open?: boolean;
8
+ onOpenChange?: (open: boolean) => void;
5
9
  };
6
- declare const Sources: ({ className, title, children, ...props }: SourcesProps) => ReactNode;
10
+ declare const Sources: ({ className, title, children, collapsible, defaultOpen, open, onOpenChange, ...props }: SourcesProps) => ReactNode;
7
11
  type SourcesTitleProps = ComponentProps<'div'> & {
8
12
  title?: string;
9
13
  };
@@ -1,80 +1,59 @@
1
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
2
- import { IconMist as f } from "@tabler/icons-react";
3
- import { cn as l } from "../../../../lib/utils.js";
4
- import { InlineCitation as p, InlineCitationLink as x } from "../inline-citation/inline-citation.js";
5
- const S = ({
6
- className: r,
7
- title: e,
8
- children: t,
9
- ...o
10
- }) => {
11
- const n = e === !1 || e === "false", i = e === void 0 || e === !0 ? /* @__PURE__ */ s(h, {}) : e;
12
- return /* @__PURE__ */ c(
13
- "div",
14
- {
15
- "data-slot": "sources",
16
- className: l("flex flex-col gap-2 py-2", r),
17
- ...o,
18
- children: [
19
- n ? null : i,
20
- /* @__PURE__ */ s(
21
- "div",
22
- {
23
- "data-slot": "sources-items",
24
- className: "flex flex-wrap gap-2 [&>*]:min-w-0",
25
- children: t
26
- }
27
- )
28
- ]
29
- }
30
- );
31
- }, h = ({
32
- className: r,
33
- title: e = "Sources",
34
- children: t,
35
- ...o
36
- }) => /* @__PURE__ */ c(
37
- "div",
38
- {
39
- "data-slot": "sources-title",
40
- className: l(
41
- "flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground",
42
- r
43
- ),
44
- ...o,
45
- children: [
46
- /* @__PURE__ */ s(f, { className: "size-4 shrink-0" }),
47
- t ?? /* @__PURE__ */ s("span", { children: e })
48
- ]
49
- }
50
- ), I = ({
51
- href: r,
52
- url: e,
53
- title: t,
54
- variant: o = "mountain",
55
- target: n = "_blank",
56
- icon: i,
57
- className: d,
58
- children: u,
59
- ...m
60
- }) => {
61
- const a = r || e;
62
- return a ? /* @__PURE__ */ s(p, { children: /* @__PURE__ */ s(
63
- x,
64
- {
65
- "data-slot": "source",
66
- href: a,
67
- target: n,
68
- variant: o,
69
- icon: i,
70
- className: d,
71
- ...m,
72
- children: u ?? t
73
- }
74
- ) }) : null;
75
- };
76
- export {
77
- I as Source,
78
- S as Sources,
79
- h as SourcesTitle
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { InlineCitation as t, InlineCitationLink as n } from "../inline-citation/inline-citation.js";
3
+ import { IconChevronDown as r, IconMist as i } from "@tabler/icons-react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { Collapsible as s } from "@base-ui/react/collapsible";
6
+ //#region libs/aura/src/components/ui/core/sources/sources.tsx
7
+ var c = ({ className: t, title: n, children: i, collapsible: c = !1, defaultOpen: u = !1, open: d, onOpenChange: f, ...p }) => {
8
+ let m = n === !1 || n === "false", h = n === void 0 || n === !0 ? /* @__PURE__ */ a(l, {}) : n;
9
+ return c ? /* @__PURE__ */ a(s.Root, {
10
+ open: d,
11
+ defaultOpen: u,
12
+ onOpenChange: f,
13
+ children: /* @__PURE__ */ o("div", {
14
+ "data-slot": "sources",
15
+ className: e("flex flex-col gap-2 py-2", t),
16
+ ...p,
17
+ children: [m ? null : /* @__PURE__ */ o(s.Trigger, {
18
+ "data-slot": "sources-trigger",
19
+ className: "group/sources-trigger flex w-fit items-center gap-2 outline-none",
20
+ children: [h, /* @__PURE__ */ a(r, { className: "size-4 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open/sources-trigger:rotate-180" })]
21
+ }), /* @__PURE__ */ a(s.Panel, {
22
+ "data-slot": "sources-items",
23
+ className: "h-(--collapsible-panel-height) overflow-hidden transition-all duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0",
24
+ children: /* @__PURE__ */ a("div", {
25
+ className: "flex flex-wrap gap-2 pt-2 [&>*]:min-w-0",
26
+ children: i
27
+ })
28
+ })]
29
+ })
30
+ }) : /* @__PURE__ */ o("div", {
31
+ "data-slot": "sources",
32
+ className: e("flex flex-col gap-2 py-2", t),
33
+ ...p,
34
+ children: [m ? null : h, /* @__PURE__ */ a("div", {
35
+ "data-slot": "sources-items",
36
+ className: "flex flex-wrap gap-2 [&>*]:min-w-0",
37
+ children: i
38
+ })]
39
+ });
40
+ }, l = ({ className: t, title: n = "Sources", children: r, ...s }) => /* @__PURE__ */ o("div", {
41
+ "data-slot": "sources-title",
42
+ className: e("flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground", t),
43
+ ...s,
44
+ children: [/* @__PURE__ */ a(i, { className: "size-4 shrink-0" }), r ?? /* @__PURE__ */ a("span", { children: n })]
45
+ }), u = ({ href: e, url: r, title: i, variant: o = "mountain", target: s = "_blank", icon: c, className: l, children: u, ...d }) => {
46
+ let f = e || r;
47
+ return f ? /* @__PURE__ */ a(t, { children: /* @__PURE__ */ a(n, {
48
+ "data-slot": "source",
49
+ href: f,
50
+ target: s,
51
+ variant: o,
52
+ icon: c,
53
+ className: l,
54
+ ...d,
55
+ children: u ?? i
56
+ }) }) : null;
80
57
  };
58
+ //#endregion
59
+ export { u as Source, c as Sources, l as SourcesTitle };
@@ -0,0 +1,62 @@
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Label as t } from "../label/label.js";
3
+ import { forwardRef as n, useId as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { Switch as s } from "@base-ui/react/switch";
6
+ //#region libs/aura/src/components/ui/core/switch/switch.tsx
7
+ var c = n(({ className: n, disabled: c, id: l, "aria-label": u, "aria-labelledby": d, label: f, textLeft: p, textRight: m, checkedText: h = "On", uncheckedText: g = "Off", ..._ }, v) => {
8
+ let y = r(), b = !!p, x = !!m, S = b || x, C = b && x, w = l ?? (f || S ? y : void 0), T = /* @__PURE__ */ a(s.Root, {
9
+ ref: v,
10
+ "data-slot": "switch",
11
+ id: w,
12
+ disabled: c,
13
+ "aria-label": u,
14
+ "aria-labelledby": d,
15
+ className: e("peer inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-md p-0.5 transition-colors outline-none", "bg-secondary-background hover:bg-secondary-background-hover", "data-checked:bg-active-background data-checked:hover:bg-active-background-hover", "disabled:bg-disabled-background disabled:cursor-not-allowed", "focus-visible:ring-ring focus-visible:ring-2", n),
16
+ ..._,
17
+ children: /* @__PURE__ */ a(s.Thumb, {
18
+ "data-slot": "switch-thumb",
19
+ className: e("pointer-events-none block size-4 rounded-sm ring-0 transition-transform bg-background shadow-none", "translate-x-0 data-checked:translate-x-5", "data-disabled:bg-secondary-background data-disabled:shadow-none", "data-checked:shadow-sm")
20
+ })
21
+ });
22
+ return !f && !S ? T : /* @__PURE__ */ o("div", {
23
+ className: "inline-flex items-center gap-3",
24
+ children: [f ? /* @__PURE__ */ a(t, {
25
+ htmlFor: w,
26
+ className: "pb-0",
27
+ children: f
28
+ }) : null, /* @__PURE__ */ o("div", {
29
+ className: "inline-flex items-center gap-1",
30
+ children: [
31
+ T,
32
+ b ? /* @__PURE__ */ a("label", {
33
+ htmlFor: w,
34
+ "aria-hidden": "true",
35
+ className: e("order-first text-sm leading-4.5 tracking-tight cursor-pointer", "peer-disabled:text-disabled-foreground peer-disabled:cursor-not-allowed", C ? "text-foreground font-medium peer-data-checked:text-inactive-foreground peer-data-checked:font-normal" : "text-inactive-foreground"),
36
+ children: C ? g : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
37
+ className: "hidden peer-data-checked:inline",
38
+ children: h
39
+ }), /* @__PURE__ */ a("span", {
40
+ className: "inline peer-data-checked:hidden",
41
+ children: g
42
+ })] })
43
+ }) : null,
44
+ x ? /* @__PURE__ */ a("label", {
45
+ htmlFor: w,
46
+ "aria-hidden": "true",
47
+ className: e("text-sm leading-4.5 tracking-tight cursor-pointer", "peer-disabled:text-disabled-foreground peer-disabled:cursor-not-allowed", C ? "text-inactive-foreground peer-data-checked:text-foreground peer-data-checked:font-medium" : "text-inactive-foreground"),
48
+ children: C ? h : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
49
+ className: "hidden peer-data-checked:inline",
50
+ children: h
51
+ }), /* @__PURE__ */ a("span", {
52
+ className: "inline peer-data-checked:hidden",
53
+ children: g
54
+ })] })
55
+ }) : null
56
+ ]
57
+ })]
58
+ });
59
+ });
60
+ c.displayName = "Switch";
61
+ //#endregion
62
+ export { c as Switch };