@cognite/aura 0.3.2 → 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 (108) hide show
  1. package/DESIGN.md +134 -5
  2. package/README.md +24 -3
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/components/index.js +58 -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/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 -72
  26. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
  27. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
  28. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
  29. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
  30. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
  31. package/dist/components/ui/core/date-time-pickers/index.js +5 -10
  32. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  33. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
  34. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
  35. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  36. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  37. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
  38. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  39. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  40. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  41. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  42. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  43. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  44. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
  45. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  46. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
  47. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
  48. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
  49. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  50. package/dist/components/ui/core/dialog/dialog.js +82 -155
  51. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
  52. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
  53. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  54. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  55. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  56. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  57. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  58. package/dist/components/ui/core/input/input.js +12 -27
  59. package/dist/components/ui/core/input-group/input-group.js +76 -173
  60. package/dist/components/ui/core/kbd/kbd.js +20 -36
  61. package/dist/components/ui/core/label/label.js +26 -43
  62. package/dist/components/ui/core/loader/loader.js +80 -117
  63. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  64. package/dist/components/ui/core/message/message.d.ts +2 -2
  65. package/dist/components/ui/core/message/message.js +316 -542
  66. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  67. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  68. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  69. package/dist/components/ui/core/pagination/pagination.js +231 -334
  70. package/dist/components/ui/core/popover/popover.js +90 -157
  71. package/dist/components/ui/core/progress/progress.js +36 -61
  72. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  73. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  74. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  75. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  76. package/dist/components/ui/core/search/search.js +77 -99
  77. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  78. package/dist/components/ui/core/select/select.js +168 -293
  79. package/dist/components/ui/core/separator/separator.js +13 -23
  80. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  81. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  82. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  83. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  84. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  85. package/dist/components/ui/core/sources/sources.js +58 -79
  86. package/dist/components/ui/core/switch/switch.js +62 -0
  87. package/dist/components/ui/core/tabs/tabs.js +149 -223
  88. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  89. package/dist/components/ui/core/textarea/textarea.js +13 -27
  90. package/dist/components/ui/core/toggle/toggle.js +55 -74
  91. package/dist/components/ui/core/tool/tool.js +127 -163
  92. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  93. package/dist/components/ui/core/topbar/topbar.js +106 -190
  94. package/dist/eslint/index.js +5 -10
  95. package/dist/eslint/no-overriding-styles.js +178 -237
  96. package/dist/icons/index.d.ts +1 -0
  97. package/dist/icons/index.js +1 -0
  98. package/dist/lib/highlight-code.d.ts +9 -0
  99. package/dist/lib/highlight-code.js +42 -0
  100. package/dist/lib/portal-container-context.js +8 -9
  101. package/dist/lib/style-scope.js +6 -6
  102. package/dist/lib/use-controllable-state.js +21 -30
  103. package/dist/lib/utils.d.ts +0 -2
  104. package/dist/lib/utils.js +32 -112
  105. package/dist/styles.css +1 -1
  106. package/dist/styles.source.css +23 -0
  107. package/package.json +23 -7
  108. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
@@ -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 };
@@ -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 };