@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,207 +1,159 @@
1
- import { jsx as a, jsxs as N } from "react/jsx-runtime";
2
- import { createContext as k, forwardRef as l, useMemo as C, useContext as g } from "react";
3
- import { IconX as S, IconInfoCircleFilled as I, IconAlertCircleFilled as V, IconAlertTriangleFilled as z } from "@tabler/icons-react";
4
- import { cva as v } from "class-variance-authority";
5
- import { useControllableState as _ } from "../../../../lib/use-controllable-state.js";
6
- import { cn as s } from "../../../../lib/utils.js";
7
- import { Button as b } from "../button/button.js";
8
- const i = k({
9
- show: !0,
10
- setShow: () => {
11
- },
12
- variant: "default",
13
- alertStyle: "card"
14
- }), B = v(
15
- [
16
- "[&_svg]:shrink-0",
17
- "[&_svg:not([class*='size-']):not([class*='w-'])]:w-4",
18
- "[&_svg:not([class*='size-']):not([class*='h-'])]:h-4"
19
- ].join(" ")
20
- ), D = v(
21
- "relative w-full rounded-md pt-2.5 pr-3 has-[>button[data-slot=alert-close]]:pr-12 pb-2 pl-3 text-sm grid has-[>[data-slot=alert-icon]]:grid-cols-[auto_1fr] grid-cols-[0_1fr] has-[>[data-slot=alert-icon]]:gap-x-2 has-[>[data-slot=alert-icon]]:gap-y-1 items-start",
22
- {
23
- variants: {
24
- variant: {
25
- default: "bg-neutral-muted-background text-foreground [&>[data-slot=alert-icon]]:text-muted-foreground",
26
- info: "bg-info-muted-background text-foreground [&>[data-slot=alert-icon]]:text-info-foreground",
27
- warning: "bg-warning-muted-background [&>[data-slot=alert-icon]]:text-warning-foreground",
28
- error: "bg-destructive-muted-background text-foreground [&>[data-slot=alert-icon]]:text-destructive-foreground"
29
- },
30
- alertStyle: {
31
- card: "pt-3 pr-5 pb-3 pl-3 [&>[data-slot=alert-title]+[data-slot=alert-description]]:mt-2 [&>[data-slot=alert-icon]]:mt-0.5",
32
- strip: "flex min-h-11 items-center gap-2 py-2 pr-3 pl-3 [&>[data-slot=alert-title]]:hidden"
33
- }
34
- },
35
- defaultVariants: {
36
- variant: "default",
37
- alertStyle: "card"
38
- }
39
- }
40
- );
41
- function T(r) {
42
- const t = { "aria-hidden": !0 };
43
- switch (r) {
44
- case "warning":
45
- return /* @__PURE__ */ a(z, { ...t });
46
- case "error":
47
- return /* @__PURE__ */ a(V, { ...t });
48
- default:
49
- return /* @__PURE__ */ a(I, { ...t });
50
- }
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { useControllableState as n } from "../../../../lib/use-controllable-state.js";
4
+ import { createContext as r, forwardRef as i, useContext as a, useMemo as o } from "react";
5
+ import { IconAlertCircleFilled as s, IconAlertTriangleFilled as c, IconInfoCircleFilled as l, 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/alert/alert.tsx
9
+ var m = r({
10
+ show: !0,
11
+ setShow: () => {},
12
+ variant: "default",
13
+ alertStyle: "card"
14
+ }), h = p([
15
+ "[&_svg]:shrink-0",
16
+ "[&_svg:not([class*='size-']):not([class*='w-'])]:w-4",
17
+ "[&_svg:not([class*='size-']):not([class*='h-'])]:h-4"
18
+ ].join(" ")), g = p("relative w-full rounded-md pt-2.5 pr-3 has-[>button[data-slot=alert-close]]:pr-12 pb-2 pl-3 text-sm grid has-[>[data-slot=alert-icon]]:grid-cols-[auto_1fr] grid-cols-[0_1fr] has-[>[data-slot=alert-icon]]:gap-x-2 has-[>[data-slot=alert-icon]]:gap-y-1 items-start", {
19
+ variants: {
20
+ variant: {
21
+ default: "bg-neutral-muted-background text-foreground [&>[data-slot=alert-icon]]:text-muted-foreground",
22
+ info: "bg-info-muted-background text-foreground [&>[data-slot=alert-icon]]:text-info-foreground",
23
+ warning: "bg-warning-muted-background [&>[data-slot=alert-icon]]:text-warning-foreground",
24
+ error: "bg-destructive-muted-background text-foreground [&>[data-slot=alert-icon]]:text-destructive-foreground"
25
+ },
26
+ alertStyle: {
27
+ card: "pt-3 pr-5 pb-3 pl-3 [&>[data-slot=alert-title]+[data-slot=alert-description]]:mt-2 [&>[data-slot=alert-icon]]:mt-0.5",
28
+ strip: "flex min-h-11 items-center gap-2 py-2 pr-3 pl-3 [&>[data-slot=alert-title]]:hidden"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "default",
33
+ alertStyle: "card"
34
+ }
35
+ });
36
+ function _(e) {
37
+ let t = { "aria-hidden": !0 };
38
+ switch (e) {
39
+ case "warning": return /* @__PURE__ */ d(c, { ...t });
40
+ case "error": return /* @__PURE__ */ d(s, { ...t });
41
+ default: return /* @__PURE__ */ d(l, { ...t });
42
+ }
51
43
  }
52
- const j = l(
53
- ({
54
- className: r,
55
- variant: t = "default",
56
- alertStyle: e = "card",
57
- visible: o,
58
- defaultVisible: n = !0,
59
- onClose: d,
60
- icon: c,
61
- children: f,
62
- ...m
63
- }, w) => {
64
- const [p, x] = _({
65
- defaultProp: n,
66
- prop: o,
67
- onChange: d
68
- }), u = t === "secondary" ? "info" : t ?? "default", A = C(() => ({ show: p, setShow: x, variant: u, alertStyle: e }), [p, x, u, e]);
69
- if (!p)
70
- return null;
71
- const h = c !== void 0 ? c : T(u);
72
- return /* @__PURE__ */ a(i.Provider, { value: A, children: /* @__PURE__ */ N(
73
- "div",
74
- {
75
- ref: w,
76
- "data-slot": "alert",
77
- role: "alert",
78
- className: s(
79
- D({ variant: u, alertStyle: e }),
80
- r
81
- ),
82
- ...m,
83
- children: [
84
- h && /* @__PURE__ */ a("span", { "data-slot": "alert-icon", className: B(), children: h }),
85
- f,
86
- d && /* @__PURE__ */ a(y, {})
87
- ]
88
- }
89
- ) });
90
- }
91
- );
92
- j.displayName = "Alert";
93
- const F = {
94
- default: "text-foreground",
95
- info: "text-foreground",
96
- warning: "text-foreground",
97
- error: "text-foreground"
98
- }, P = l(
99
- ({ className: r, ...t }, e) => {
100
- const { variant: o, alertStyle: n } = g(i);
101
- return /* @__PURE__ */ a(
102
- "div",
103
- {
104
- ref: e,
105
- "data-slot": "alert-title",
106
- className: s(
107
- n === "strip" ? "text-sm font-medium leading-[18px] tracking-normal" : "col-start-2 text-base font-medium leading-5 tracking-tighter",
108
- F[o],
109
- r
110
- ),
111
- ...t
112
- }
113
- );
114
- }
115
- );
116
- P.displayName = "AlertTitle";
117
- const L = {
118
- default: "text-secondary-foreground",
119
- info: "text-secondary-foreground",
120
- warning: "text-secondary-foreground",
121
- error: "text-secondary-foreground"
122
- }, M = l(
123
- ({ className: r, ...t }, e) => {
124
- const { variant: o, alertStyle: n } = g(i);
125
- return /* @__PURE__ */ a(
126
- "div",
127
- {
128
- ref: e,
129
- "data-slot": "alert-description",
130
- className: s(
131
- n === "strip" ? "flex-1 min-w-0 pr-4 text-sm font-normal leading-[18px] tracking-tight" : "col-start-2 text-sm font-normal leading-[18px] tracking-tight",
132
- L[o],
133
- r
134
- ),
135
- ...t
136
- }
137
- );
138
- }
139
- );
140
- M.displayName = "AlertDescription";
141
- const R = l(
142
- ({ className: r, ...t }, e) => {
143
- const { alertStyle: o } = g(i);
144
- return /* @__PURE__ */ a(
145
- "div",
146
- {
147
- ref: e,
148
- "data-slot": "alert-actions",
149
- className: s(
150
- o === "strip" ? "ml-auto flex shrink-0 items-center gap-3" : "col-start-2 flex flex-wrap items-center gap-3 pt-2",
151
- r
152
- ),
153
- ...t
154
- }
155
- );
156
- }
157
- );
158
- R.displayName = "AlertActions";
159
- const X = {
160
- default: "gap-2 rounded-md",
161
- ghost: "h-auto p-0 hover:bg-transparent"
162
- }, q = l(({ className: r, variant: t = "default", ...e }, o) => /* @__PURE__ */ a(
163
- b,
164
- {
165
- ref: o,
166
- "data-slot": "alert-button",
167
- variant: t === "ghost" ? "ghost" : void 0,
168
- size: "sm",
169
- className: s(X[t], r),
170
- ...e
171
- }
172
- ));
173
- q.displayName = "AlertButton";
174
- const y = l(
175
- ({ className: r, onClick: t, ...e }, o) => {
176
- const { setShow: n, alertStyle: d } = g(i), c = e["aria-label"] ?? "Close alert", f = (m) => {
177
- n(!1), t?.(m);
178
- };
179
- return /* @__PURE__ */ a(
180
- b,
181
- {
182
- ref: o,
183
- "data-slot": "alert-close",
184
- variant: "ghost",
185
- size: "sm",
186
- className: s(
187
- "shrink-0 size-7 rounded-md p-0 text-secondary-foreground hover:bg-transparent hover:text-foreground",
188
- d === "card" && "absolute right-2 top-2",
189
- r
190
- ),
191
- "aria-label": c,
192
- onClick: f,
193
- ...e,
194
- children: /* @__PURE__ */ a(S, { "aria-hidden": "true", className: "size-4" })
195
- }
196
- );
197
- }
198
- );
199
- y.displayName = "AlertClose";
200
- export {
201
- j as Alert,
202
- R as AlertActions,
203
- q as AlertButton,
204
- y as AlertClose,
205
- M as AlertDescription,
206
- P as AlertTitle
207
- };
44
+ var v = i(({ className: t, variant: r = "default", alertStyle: i = "card", visible: a, defaultVisible: s = !0, onClose: c, icon: l, children: u, ...p }, v) => {
45
+ let [y, b] = n({
46
+ defaultProp: s,
47
+ prop: a,
48
+ onChange: c
49
+ }), x = r === "secondary" ? "info" : r ?? "default", S = o(() => ({
50
+ show: y,
51
+ setShow: b,
52
+ variant: x,
53
+ alertStyle: i
54
+ }), [
55
+ y,
56
+ b,
57
+ x,
58
+ i
59
+ ]);
60
+ if (!y) return null;
61
+ let C = l === void 0 ? _(x) : l;
62
+ return /* @__PURE__ */ d(m.Provider, {
63
+ value: S,
64
+ children: /* @__PURE__ */ f("div", {
65
+ ref: v,
66
+ "data-slot": "alert",
67
+ role: "alert",
68
+ className: e(g({
69
+ variant: x,
70
+ alertStyle: i
71
+ }), t),
72
+ ...p,
73
+ children: [
74
+ C && /* @__PURE__ */ d("span", {
75
+ "data-slot": "alert-icon",
76
+ className: h(),
77
+ children: C
78
+ }),
79
+ u,
80
+ c && /* @__PURE__ */ d(E, {})
81
+ ]
82
+ })
83
+ });
84
+ });
85
+ v.displayName = "Alert";
86
+ var y = {
87
+ default: "text-foreground",
88
+ info: "text-foreground",
89
+ warning: "text-foreground",
90
+ error: "text-foreground"
91
+ }, b = i(({ className: t, ...n }, r) => {
92
+ let { variant: i, alertStyle: o } = a(m);
93
+ return /* @__PURE__ */ d("div", {
94
+ ref: r,
95
+ "data-slot": "alert-title",
96
+ className: e(o === "strip" ? "text-sm font-medium leading-[18px] tracking-normal" : "col-start-2 text-base font-medium leading-5 tracking-tighter", y[i], t),
97
+ ...n
98
+ });
99
+ });
100
+ b.displayName = "AlertTitle";
101
+ var x = {
102
+ default: "text-secondary-foreground",
103
+ info: "text-secondary-foreground",
104
+ warning: "text-secondary-foreground",
105
+ error: "text-secondary-foreground"
106
+ }, S = i(({ className: t, ...n }, r) => {
107
+ let { variant: i, alertStyle: o } = a(m);
108
+ return /* @__PURE__ */ d("div", {
109
+ ref: r,
110
+ "data-slot": "alert-description",
111
+ className: e(o === "strip" ? "flex-1 min-w-0 pr-4 text-sm font-normal leading-[18px] tracking-tight" : "col-start-2 text-sm font-normal leading-[18px] tracking-tight", x[i], t),
112
+ ...n
113
+ });
114
+ });
115
+ S.displayName = "AlertDescription";
116
+ var C = i(({ className: t, ...n }, r) => {
117
+ let { alertStyle: i } = a(m);
118
+ return /* @__PURE__ */ d("div", {
119
+ ref: r,
120
+ "data-slot": "alert-actions",
121
+ className: e(i === "strip" ? "ml-auto flex shrink-0 items-center gap-3" : "col-start-2 flex flex-wrap items-center gap-3 pt-2", t),
122
+ ...n
123
+ });
124
+ });
125
+ C.displayName = "AlertActions";
126
+ var w = {
127
+ default: "gap-2 rounded-md",
128
+ ghost: "h-auto p-0 hover:bg-transparent"
129
+ }, T = i(({ className: n, variant: r = "default", ...i }, a) => /* @__PURE__ */ d(t, {
130
+ ref: a,
131
+ "data-slot": "alert-button",
132
+ variant: r === "ghost" ? "ghost" : void 0,
133
+ size: "sm",
134
+ className: e(w[r], n),
135
+ ...i
136
+ }));
137
+ T.displayName = "AlertButton";
138
+ var E = i(({ className: n, onClick: r, ...i }, o) => {
139
+ let { setShow: s, alertStyle: c } = a(m), l = i["aria-label"] ?? "Close alert";
140
+ return /* @__PURE__ */ d(t, {
141
+ ref: o,
142
+ "data-slot": "alert-close",
143
+ variant: "ghost",
144
+ size: "sm",
145
+ className: e("shrink-0 size-7 rounded-md p-0 text-secondary-foreground hover:bg-transparent hover:text-foreground", c === "card" && "absolute right-2 top-2", n),
146
+ "aria-label": l,
147
+ onClick: (e) => {
148
+ s(!1), r?.(e);
149
+ },
150
+ ...i,
151
+ children: /* @__PURE__ */ d(u, {
152
+ "aria-hidden": "true",
153
+ className: "size-4"
154
+ })
155
+ });
156
+ });
157
+ E.displayName = "AlertClose";
158
+ //#endregion
159
+ export { v as Alert, C as AlertActions, T as AlertButton, E as AlertClose, S as AlertDescription, b as AlertTitle };
@@ -1,91 +1,65 @@
1
- import { jsx as o, jsxs as i, Fragment as v } from "react/jsx-runtime";
1
+ import { cn as e } from "../../../../lib/utils.js";
2
2
  import { forwardRef as t } from "react";
3
- import { Avatar as n } from "@base-ui/react/avatar";
4
- import { cva as g } from "class-variance-authority";
5
- import { cn as d } from "../../../../lib/utils.js";
6
- const u = g(
7
- "group/avatar relative inline-flex text-base font-medium leading-5 shrink-0 overflow-hidden flex-col justify-center items-center box-border",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-decorative-background-mountain text-decorative-foreground-mountain hover:bg-decorative-background-mountain-hover",
12
- nordic: "bg-decorative-background-nordic text-decorative-foreground-nordic hover:bg-decorative-background-nordic-hover",
13
- aurora: "bg-decorative-background-aurora text-decorative-foreground-aurora hover:bg-decorative-background-aurora-hover",
14
- fjord: "bg-decorative-background-fjord text-decorative-foreground-fjord hover:bg-decorative-background-fjord-hover",
15
- dusk: "bg-decorative-background-dusk text-decorative-foreground-dusk hover:bg-decorative-background-dusk-hover",
16
- orange: "bg-decorative-background-orange text-decorative-foreground-orange hover:bg-decorative-background-orange-hover",
17
- sky: "bg-decorative-background-sky text-decorative-foreground-sky hover:bg-decorative-background-sky-hover",
18
- overflow: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover"
19
- },
20
- sizes: {
21
- default: "size-9 rounded-lg text-sm [&_svg]:w-5 [&_svg]:h-5",
22
- xsm: "size-7 rounded-md text-xs [&_svg]:w-4 [&_svg]:h-4",
23
- xxsm: "size-5 rounded-sm text-2xs [&_svg]:w-3 [&_svg]:h-3"
24
- }
25
- },
26
- defaultVariants: {
27
- variant: "default",
28
- sizes: "default"
29
- }
30
- }
31
- ), l = t(({ className: a, variant: e, sizes: r, ...c }, s) => /* @__PURE__ */ o(
32
- n.Root,
33
- {
34
- ref: s,
35
- "data-slot": "avatar",
36
- className: d(u({ variant: e, sizes: r }), a),
37
- ...c
38
- }
39
- ));
40
- l.displayName = "Avatar";
41
- const b = t(({ className: a, ...e }, r) => /* @__PURE__ */ i(v, { children: [
42
- /* @__PURE__ */ o(
43
- n.Image,
44
- {
45
- ref: r,
46
- "data-slot": "avatar-image",
47
- className: d(
48
- "aspect-square size-full object-cover object-center",
49
- a
50
- ),
51
- ...e
52
- }
53
- ),
54
- /* @__PURE__ */ o(
55
- "span",
56
- {
57
- "data-slot": "avatar-image-backdrop",
58
- className: "absolute inset-0 bg-overlay-background opacity-0 transition-opacity group-hover/avatar:opacity-100 pointer-events-none",
59
- "aria-hidden": "true"
60
- }
61
- )
62
- ] }));
63
- b.displayName = "AvatarImage";
64
- const f = t(({ className: a, ...e }, r) => /* @__PURE__ */ o(
65
- n.Fallback,
66
- {
67
- ref: r,
68
- "data-slot": "avatar-fallback",
69
- className: d(" flex size-full items-center justify-center", a),
70
- ...e
71
- }
72
- ));
73
- f.displayName = "AvatarFallback";
74
- const m = t(
75
- ({ className: a, ...e }, r) => /* @__PURE__ */ o(
76
- "span",
77
- {
78
- ref: r,
79
- "data-slot": "avatar-icon",
80
- className: d("flex size-full items-center justify-center", a),
81
- ...e
82
- }
83
- )
84
- );
85
- m.displayName = "AvatarIcon";
86
- export {
87
- l as Avatar,
88
- f as AvatarFallback,
89
- m as AvatarIcon,
90
- b as AvatarImage
91
- };
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { cva as a } from "class-variance-authority";
5
+ import { Avatar as o } from "@base-ui/react/avatar";
6
+ //#region libs/aura/src/components/ui/core/avatar/avatar.tsx
7
+ var s = a("group/avatar relative inline-flex text-base font-medium leading-5 shrink-0 overflow-hidden flex-col justify-center items-center box-border", {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-decorative-background-mountain text-decorative-foreground-mountain hover:bg-decorative-background-mountain-hover",
11
+ nordic: "bg-decorative-background-nordic text-decorative-foreground-nordic hover:bg-decorative-background-nordic-hover",
12
+ aurora: "bg-decorative-background-aurora text-decorative-foreground-aurora hover:bg-decorative-background-aurora-hover",
13
+ fjord: "bg-decorative-background-fjord text-decorative-foreground-fjord hover:bg-decorative-background-fjord-hover",
14
+ dusk: "bg-decorative-background-dusk text-decorative-foreground-dusk hover:bg-decorative-background-dusk-hover",
15
+ orange: "bg-decorative-background-orange text-decorative-foreground-orange hover:bg-decorative-background-orange-hover",
16
+ sky: "bg-decorative-background-sky text-decorative-foreground-sky hover:bg-decorative-background-sky-hover",
17
+ overflow: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover"
18
+ },
19
+ sizes: {
20
+ default: "size-9 rounded-lg text-sm [&_svg]:w-5 [&_svg]:h-5",
21
+ xsm: "size-7 rounded-md text-xs [&_svg]:w-4 [&_svg]:h-4",
22
+ xxsm: "size-5 rounded-sm text-2xs [&_svg]:w-3 [&_svg]:h-3"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ sizes: "default"
28
+ }
29
+ }), c = t(({ className: t, variant: n, sizes: i, ...a }, c) => /* @__PURE__ */ r(o.Root, {
30
+ ref: c,
31
+ "data-slot": "avatar",
32
+ className: e(s({
33
+ variant: n,
34
+ sizes: i
35
+ }), t),
36
+ ...a
37
+ }));
38
+ c.displayName = "Avatar";
39
+ var l = t(({ className: t, ...a }, s) => /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(o.Image, {
40
+ ref: s,
41
+ "data-slot": "avatar-image",
42
+ className: e("aspect-square size-full object-cover object-center", t),
43
+ ...a
44
+ }), /* @__PURE__ */ r("span", {
45
+ "data-slot": "avatar-image-backdrop",
46
+ className: "absolute inset-0 bg-overlay-background opacity-0 transition-opacity group-hover/avatar:opacity-100 pointer-events-none",
47
+ "aria-hidden": "true"
48
+ })] }));
49
+ l.displayName = "AvatarImage";
50
+ var u = t(({ className: t, ...n }, i) => /* @__PURE__ */ r(o.Fallback, {
51
+ ref: i,
52
+ "data-slot": "avatar-fallback",
53
+ className: e(" flex size-full items-center justify-center", t),
54
+ ...n
55
+ }));
56
+ u.displayName = "AvatarFallback";
57
+ var d = t(({ className: t, ...n }, i) => /* @__PURE__ */ r("span", {
58
+ ref: i,
59
+ "data-slot": "avatar-icon",
60
+ className: e("flex size-full items-center justify-center", t),
61
+ ...n
62
+ }));
63
+ d.displayName = "AvatarIcon";
64
+ //#endregion
65
+ export { c as Avatar, u as AvatarFallback, d as AvatarIcon, l as AvatarImage };