@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,73 @@
1
- import { forwardRef as l } from "react";
2
- import { mergeProps as p } from "@base-ui/react/merge-props";
3
- import { useRender as m } from "@base-ui/react/use-render";
4
- import { cva as v } from "class-variance-authority";
5
- import { cn as x } from "../../../../lib/utils.js";
6
- const k = v(
7
- "inline-flex h-5 items-center align-middle justify-center rounded-md border px-1 text-sm font-medium leading-[18px] w-fit whitespace-nowrap shrink-0 gap-1 [&>svg]:pointer-events-none [&>svg]:size-3 outline-none focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
8
- {
9
- variants: {
10
- variant: {
11
- default: "border-transparent bg-neutral-background text-foreground-on-neutral",
12
- fjord: "border-transparent bg-decorative-background-fjord text-decorative-foreground-fjord",
13
- nordic: "border-transparent bg-decorative-background-nordic text-decorative-foreground-nordic",
14
- aurora: "border-transparent bg-decorative-background-aurora text-decorative-foreground-aurora",
15
- sky: "border-transparent bg-decorative-background-sky text-decorative-foreground-sky",
16
- dusk: "border-transparent bg-decorative-background-dusk text-decorative-foreground-dusk",
17
- orange: "border-transparent bg-decorative-background-orange text-decorative-foreground-orange",
18
- gray: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
19
- mountain: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
20
- secondary: "border-transparent bg-secondary-background text-secondary-foreground",
21
- error: "border-transparent bg-destructive-background text-destructive-foreground-on-critical",
22
- warning: "border-transparent bg-warning-background text-warning-foreground-on-warning",
23
- success: "border-transparent bg-success-background text-success-foreground-on-success",
24
- inProgress: "border-transparent bg-info-background text-info-foreground-on-info",
25
- archived: "border-transparent bg-neutral-background text-neutral-foreground-on-neutral",
26
- closable: "border-transparent bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover cursor-pointer"
27
- },
28
- size: {
29
- default: "",
30
- icon: "w-5 px-0 py-0"
31
- },
32
- outline: {
33
- true: "border-border"
34
- },
35
- background: {
36
- false: "bg-transparent"
37
- },
38
- dot: {
39
- true: "min-w-5 rounded-md border border-background px-1 gap-0"
40
- }
41
- },
42
- defaultVariants: {
43
- variant: "default",
44
- size: "default",
45
- outline: !1,
46
- background: !0,
47
- dot: !1
48
- }
49
- }
50
- ), w = l(
51
- ({
52
- className: t,
53
- variant: r,
54
- size: a,
55
- outline: d,
56
- dot: o,
57
- background: i,
58
- urgent: s = !1,
59
- children: n,
60
- render: u,
61
- ...g
62
- }, c) => {
63
- const b = !n, f = r && !(/* @__PURE__ */ new Set([
64
- "mountain",
65
- "fjord",
66
- "nordic",
67
- "aurora",
68
- "dusk",
69
- "orange"
70
- ])).has(r), e = d === !0 && f;
71
- return m({
72
- defaultTagName: "span",
73
- ref: c,
74
- props: p(
75
- {
76
- className: x(
77
- k({
78
- variant: r,
79
- size: a,
80
- outline: e,
81
- background: e ? !1 : i,
82
- dot: o
83
- }),
84
- e && r === "error" && "text-destructive-foreground",
85
- e && r === "warning" && "text-warning-foreground",
86
- e && r === "success" && "text-success-foreground",
87
- e && r === "inProgress" && "text-info-foreground",
88
- e && r === "archived" && "text-neutral-foreground",
89
- o && b && "h-2 w-2 min-h-2 min-w-2 max-h-2 max-w-2 rounded-full p-0 border-0",
90
- o && s && "bg-destructive-background text-destructive-foreground-on-critical",
91
- t
92
- )
93
- },
94
- { ...g, children: n }
95
- ),
96
- render: u,
97
- state: {
98
- slot: "badge",
99
- variant: r
100
- }
101
- });
102
- }
103
- );
104
- w.displayName = "Badge";
105
- export {
106
- w as Badge,
107
- k as badgeVariants
108
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { cva as n } from "class-variance-authority";
4
+ import { mergeProps as r } from "@base-ui/react/merge-props";
5
+ import { useRender as i } from "@base-ui/react/use-render";
6
+ //#region libs/aura/src/components/ui/core/badge/badge.tsx
7
+ var a = n("inline-flex h-5 items-center align-middle justify-center rounded-md border px-1 text-sm font-medium leading-[18px] w-fit whitespace-nowrap shrink-0 gap-1 [&>svg]:pointer-events-none [&>svg]:size-3 outline-none focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
8
+ variants: {
9
+ variant: {
10
+ default: "border-transparent bg-neutral-background text-foreground-on-neutral",
11
+ fjord: "border-transparent bg-decorative-background-fjord text-decorative-foreground-fjord",
12
+ nordic: "border-transparent bg-decorative-background-nordic text-decorative-foreground-nordic",
13
+ aurora: "border-transparent bg-decorative-background-aurora text-decorative-foreground-aurora",
14
+ sky: "border-transparent bg-decorative-background-sky text-decorative-foreground-sky",
15
+ dusk: "border-transparent bg-decorative-background-dusk text-decorative-foreground-dusk",
16
+ orange: "border-transparent bg-decorative-background-orange text-decorative-foreground-orange",
17
+ gray: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
18
+ mountain: "border-transparent bg-decorative-background-mountain text-decorative-foreground-mountain",
19
+ secondary: "border-transparent bg-secondary-background text-secondary-foreground",
20
+ error: "border-transparent bg-destructive-background text-destructive-foreground-on-critical",
21
+ warning: "border-transparent bg-warning-background text-warning-foreground-on-warning",
22
+ success: "border-transparent bg-success-background text-success-foreground-on-success",
23
+ inProgress: "border-transparent bg-info-background text-info-foreground-on-info",
24
+ archived: "border-transparent bg-neutral-background text-neutral-foreground-on-neutral",
25
+ closable: "border-transparent bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover cursor-pointer"
26
+ },
27
+ size: {
28
+ default: "",
29
+ icon: "w-5 px-0 py-0"
30
+ },
31
+ outline: { true: "border-border" },
32
+ background: { false: "bg-transparent" },
33
+ dot: { true: "min-w-5 rounded-md border border-background px-1 gap-0" }
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default",
38
+ outline: !1,
39
+ background: !0,
40
+ dot: !1
41
+ }
42
+ }), o = t(({ className: t, variant: n, size: o, outline: s, dot: c, background: l, urgent: u = !1, children: d, render: f, ...p }, m) => {
43
+ let h = !d, g = n && !(/* @__PURE__ */ new Set([
44
+ "mountain",
45
+ "fjord",
46
+ "nordic",
47
+ "aurora",
48
+ "dusk",
49
+ "orange"
50
+ ])).has(n), _ = s === !0 && g;
51
+ return i({
52
+ defaultTagName: "span",
53
+ ref: m,
54
+ props: r({ className: e(a({
55
+ variant: n,
56
+ size: o,
57
+ outline: _,
58
+ background: !_ && l,
59
+ dot: c
60
+ }), _ && n === "error" && "text-destructive-foreground", _ && n === "warning" && "text-warning-foreground", _ && n === "success" && "text-success-foreground", _ && n === "inProgress" && "text-info-foreground", _ && n === "archived" && "text-neutral-foreground", c && h && "h-2 w-2 min-h-2 min-w-2 max-h-2 max-w-2 rounded-full p-0 border-0", c && u && "bg-destructive-background text-destructive-foreground-on-critical", t) }, {
61
+ ...p,
62
+ children: d
63
+ }),
64
+ render: f,
65
+ state: {
66
+ slot: "badge",
67
+ variant: n
68
+ }
69
+ });
70
+ });
71
+ o.displayName = "Badge";
72
+ //#endregion
73
+ export { o as Badge, a as badgeVariants };
@@ -1,218 +1,149 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { createContext as k, forwardRef as l, useMemo as w, useContext as b, useState as B, useRef as N, useEffect as y, useCallback as C } from "react";
3
- import { cva as V } from "class-variance-authority";
4
- import { cn as u } from "../../../../lib/utils.js";
5
- import { Badge as S } from "../badge/badge.js";
6
- import { Button as A } from "../button/button.js";
7
- const R = (e) => {
8
- }, m = k({
9
- show: !0,
10
- setShow: R,
11
- variant: "default"
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { Badge as n } from "../badge/badge.js";
4
+ import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
5
+ import { jsx as d } from "react/jsx-runtime";
6
+ import { cva as f } from "class-variance-authority";
7
+ var p = r({
8
+ show: !0,
9
+ setShow: (e) => {},
10
+ variant: "default"
12
11
  });
13
- function p(e) {
14
- return typeof e == "function";
12
+ function m(e) {
13
+ return typeof e == "function";
15
14
  }
16
- function j({
17
- visible: e,
18
- defaultVisible: t,
19
- onClose: n
20
- }) {
21
- const [r, a] = B(t), i = e !== void 0, g = i ? e : r, d = N(n);
22
- y(() => {
23
- d.current = n;
24
- }, [n]);
25
- const x = C(
26
- (o) => {
27
- if (i) {
28
- (p(o) ? o(e) : o) || d.current?.();
29
- return;
30
- }
31
- a((c) => {
32
- const f = p(o) ? o(c) : o;
33
- return f || d.current?.(), f;
34
- });
35
- },
36
- [i, e]
37
- );
38
- return [g, x];
15
+ function h({ visible: e, defaultVisible: t, onClose: n }) {
16
+ let [r, i] = u(t), o = e !== void 0, c = o ? e : r, d = l(n);
17
+ return s(() => {
18
+ d.current = n;
19
+ }, [n]), [c, a((t) => {
20
+ if (o) {
21
+ (m(t) ? t(e) : t) || d.current?.();
22
+ return;
23
+ }
24
+ i((e) => {
25
+ let n = m(t) ? t(e) : t;
26
+ return n || d.current?.(), n;
27
+ });
28
+ }, [o, e])];
39
29
  }
40
- const I = V(
41
- "flex w-full h-11 flex-col items-start justify-center px-3 py-0",
42
- {
43
- variants: {
44
- variant: {
45
- default: "bg-neutral-background text-foreground-fixed-dark",
46
- info: "bg-info-background text-foreground-fixed-dark",
47
- warning: "bg-warning-background text-foreground-fixed-dark",
48
- destructive: "bg-destructive-background text-foreground-fixed-dark"
49
- },
50
- inset: {
51
- true: "rounded-lg",
52
- false: ""
53
- }
54
- },
55
- defaultVariants: {
56
- variant: "default",
57
- inset: !1
58
- }
59
- }
60
- ), M = l(
61
- ({
62
- children: e,
63
- visible: t,
64
- defaultVisible: n = !0,
65
- onClose: r,
66
- className: a,
67
- inset: i = !1,
68
- variant: g = "default",
69
- ...d
70
- }, x) => {
71
- const o = g ?? "default", [c, f] = j({
72
- defaultVisible: n,
73
- visible: t,
74
- onClose: r
75
- }), h = w(
76
- () => ({ show: c ?? !0, setShow: f, variant: o }),
77
- [c, f, o]
78
- );
79
- return c ? /* @__PURE__ */ s(m.Provider, { value: h, children: /* @__PURE__ */ s(
80
- "div",
81
- {
82
- ref: x,
83
- "data-slot": "banner",
84
- className: u(
85
- I({ variant: o, inset: i }),
86
- a
87
- ),
88
- ...d,
89
- children: /* @__PURE__ */ s(
90
- "div",
91
- {
92
- "data-slot": "banner-content",
93
- className: "flex h-7 w-full items-center self-stretch gap-2",
94
- children: e
95
- }
96
- )
97
- }
98
- ) }) : null;
99
- }
100
- );
101
- M.displayName = "Banner";
102
- const O = {
103
- default: "text-neutral-foreground-on-neutral",
104
- info: "text-info-foreground-on-info",
105
- warning: "text-warning-foreground-on-warning",
106
- destructive: "text-destructive-foreground-on-critical"
107
- }, _ = l(
108
- ({ icon: e, className: t, ...n }, r) => {
109
- const { variant: a } = b(m);
110
- return /* @__PURE__ */ s(
111
- "div",
112
- {
113
- ref: r,
114
- "data-slot": "banner-icon",
115
- className: u(
116
- "flex h-4 w-4 shrink-0 items-center justify-center",
117
- O[a],
118
- t
119
- ),
120
- ...n,
121
- children: /* @__PURE__ */ s(e, { size: 16 })
122
- }
123
- );
124
- }
125
- );
126
- _.displayName = "BannerIcon";
127
- const E = l(
128
- ({ className: e, ...t }, n) => /* @__PURE__ */ s(
129
- "p",
130
- {
131
- ref: n,
132
- "data-slot": "banner-title",
133
- className: u(
134
- "flex min-w-0 flex-1 items-center text-base font-medium leading-5 tracking-tighter text-foreground-fixed-dark",
135
- e
136
- ),
137
- ...t
138
- }
139
- )
140
- );
141
- E.displayName = "BannerTitle";
142
- const L = l(
143
- ({ outline: e = !0, variant: t, className: n, ...r }, a) => {
144
- const { variant: i } = b(m), d = t ?? {
145
- default: "default",
146
- info: "inProgress",
147
- destructive: "error",
148
- warning: "warning"
149
- }[i];
150
- return /* @__PURE__ */ s(
151
- S,
152
- {
153
- ref: a,
154
- "data-slot": "banner-status",
155
- outline: e,
156
- variant: d,
157
- className: u("shrink-0", n),
158
- ...r
159
- }
160
- );
161
- }
162
- );
163
- L.displayName = "BannerStatus";
164
- const P = l(
165
- ({ className: e, ...t }, n) => /* @__PURE__ */ s(
166
- "div",
167
- {
168
- ref: n,
169
- "data-slot": "banner-actions",
170
- className: u("ml-auto flex h-7 shrink-0 items-center gap-2", e),
171
- ...t
172
- }
173
- )
174
- );
175
- P.displayName = "BannerActions";
176
- const v = l(
177
- ({ variant: e = "ghost", size: t = "sm", className: n, ...r }, a) => /* @__PURE__ */ s(
178
- A,
179
- {
180
- ref: a,
181
- "data-slot": "banner-action",
182
- className: u(
183
- "h-7 min-w-16 shrink-0 rounded px-2 text-sm font-medium leading-4.5 text-foreground-fixed-dark hover:bg-transparent dark:hover:bg-transparent hover:text-foreground-secondary-fixed-dark disabled:bg-transparent dark:disabled:bg-transparent disabled:text-disabled-foreground",
184
- n
185
- ),
186
- size: t,
187
- variant: e,
188
- ...r
189
- }
190
- )
191
- );
192
- v.displayName = "BannerAction";
193
- const T = l(
194
- ({ onClick: e, ...t }, n) => {
195
- const { setShow: r } = b(m);
196
- return /* @__PURE__ */ s(
197
- v,
198
- {
199
- ref: n,
200
- "data-slot": "banner-close",
201
- onClick: (i) => {
202
- r(!1), e?.(i);
203
- },
204
- ...t
205
- }
206
- );
207
- }
208
- );
209
- T.displayName = "BannerClose";
210
- export {
211
- M as Banner,
212
- v as BannerAction,
213
- P as BannerActions,
214
- T as BannerClose,
215
- _ as BannerIcon,
216
- L as BannerStatus,
217
- E as BannerTitle
218
- };
30
+ var g = f("flex w-full h-11 flex-col items-start justify-center px-3 py-0", {
31
+ variants: {
32
+ variant: {
33
+ default: "bg-neutral-background text-foreground-fixed-dark",
34
+ info: "bg-info-background text-foreground-fixed-dark",
35
+ warning: "bg-warning-background text-foreground-fixed-dark",
36
+ destructive: "bg-destructive-background text-foreground-fixed-dark"
37
+ },
38
+ inset: {
39
+ true: "rounded-lg",
40
+ false: ""
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "default",
45
+ inset: !1
46
+ }
47
+ }), _ = i(({ children: t, visible: n, defaultVisible: r = !0, onClose: i, className: a, inset: o = !1, variant: s = "default", ...l }, u) => {
48
+ let f = s ?? "default", [m, _] = h({
49
+ defaultVisible: r,
50
+ visible: n,
51
+ onClose: i
52
+ }), v = c(() => ({
53
+ show: m ?? !0,
54
+ setShow: _,
55
+ variant: f
56
+ }), [
57
+ m,
58
+ _,
59
+ f
60
+ ]);
61
+ return m ? /* @__PURE__ */ d(p.Provider, {
62
+ value: v,
63
+ children: /* @__PURE__ */ d("div", {
64
+ ref: u,
65
+ "data-slot": "banner",
66
+ className: e(g({
67
+ variant: f,
68
+ inset: o
69
+ }), a),
70
+ ...l,
71
+ children: /* @__PURE__ */ d("div", {
72
+ "data-slot": "banner-content",
73
+ className: "flex h-7 w-full items-center self-stretch gap-2",
74
+ children: t
75
+ })
76
+ })
77
+ }) : null;
78
+ });
79
+ _.displayName = "Banner";
80
+ var v = {
81
+ default: "text-neutral-foreground-on-neutral",
82
+ info: "text-info-foreground-on-info",
83
+ warning: "text-warning-foreground-on-warning",
84
+ destructive: "text-destructive-foreground-on-critical"
85
+ }, y = i(({ icon: t, className: n, ...r }, i) => {
86
+ let { variant: a } = o(p);
87
+ return /* @__PURE__ */ d("div", {
88
+ ref: i,
89
+ "data-slot": "banner-icon",
90
+ className: e("flex h-4 w-4 shrink-0 items-center justify-center", v[a], n),
91
+ ...r,
92
+ children: /* @__PURE__ */ d(t, { size: 16 })
93
+ });
94
+ });
95
+ y.displayName = "BannerIcon";
96
+ var b = i(({ className: t, ...n }, r) => /* @__PURE__ */ d("p", {
97
+ ref: r,
98
+ "data-slot": "banner-title",
99
+ className: e("flex min-w-0 flex-1 items-center text-base font-medium leading-5 tracking-tighter text-foreground-fixed-dark", t),
100
+ ...n
101
+ }));
102
+ b.displayName = "BannerTitle";
103
+ var x = i(({ outline: t = !0, variant: r, className: i, ...a }, s) => {
104
+ let { variant: c } = o(p);
105
+ return /* @__PURE__ */ d(n, {
106
+ ref: s,
107
+ "data-slot": "banner-status",
108
+ outline: t,
109
+ variant: r ?? {
110
+ default: "default",
111
+ info: "inProgress",
112
+ destructive: "error",
113
+ warning: "warning"
114
+ }[c],
115
+ className: e("shrink-0", i),
116
+ ...a
117
+ });
118
+ });
119
+ x.displayName = "BannerStatus";
120
+ var S = i(({ className: t, ...n }, r) => /* @__PURE__ */ d("div", {
121
+ ref: r,
122
+ "data-slot": "banner-actions",
123
+ className: e("ml-auto flex h-7 shrink-0 items-center gap-2", t),
124
+ ...n
125
+ }));
126
+ S.displayName = "BannerActions";
127
+ var C = i(({ variant: n = "ghost", size: r = "sm", className: i, ...a }, o) => /* @__PURE__ */ d(t, {
128
+ ref: o,
129
+ "data-slot": "banner-action",
130
+ className: e("h-7 min-w-16 shrink-0 rounded px-2 text-sm font-medium leading-4.5 text-foreground-fixed-dark hover:bg-transparent dark:hover:bg-transparent hover:text-foreground-secondary-fixed-dark disabled:bg-transparent dark:disabled:bg-transparent disabled:text-disabled-foreground", i),
131
+ size: r,
132
+ variant: n,
133
+ ...a
134
+ }));
135
+ C.displayName = "BannerAction";
136
+ var w = i(({ onClick: e, ...t }, n) => {
137
+ let { setShow: r } = o(p);
138
+ return /* @__PURE__ */ d(C, {
139
+ ref: n,
140
+ "data-slot": "banner-close",
141
+ onClick: (t) => {
142
+ r(!1), e?.(t);
143
+ },
144
+ ...t
145
+ });
146
+ });
147
+ w.displayName = "BannerClose";
148
+ //#endregion
149
+ export { _ as Banner, C as BannerAction, S as BannerActions, w as BannerClose, y as BannerIcon, x as BannerStatus, b as BannerTitle };