@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,215 +1,125 @@
1
- import { jsx as a, jsxs as g, Fragment as L } from "react/jsx-runtime";
2
- import { useMemo as O, createContext as K, useContext as Y } from "react";
3
- import { Legend as $, Tooltip as D, ResponsiveContainer as M } from "recharts";
4
- import { cn as i } from "../../../../lib/utils.js";
5
- function S(e) {
6
- if (!e)
7
- return;
8
- const r = e.trim();
9
- return { backgroundColor: r, borderColor: r };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { createContext as t, useContext as n, useMemo as r } from "react";
3
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import { Legend as s, ResponsiveContainer as c, Tooltip as l } from "recharts";
5
+ //#region libs/aura/src/components/ui/core/chart/chart.tsx
6
+ function u(e) {
7
+ if (!e) return;
8
+ let t = e.trim();
9
+ return {
10
+ backgroundColor: t,
11
+ borderColor: t
12
+ };
10
13
  }
11
- const V = K(null);
12
- function j() {
13
- const e = Y(V);
14
- if (!e)
15
- throw new Error("useChart must be used within a <ChartContainer>");
16
- return e;
14
+ var d = t(null);
15
+ function f() {
16
+ let e = n(d);
17
+ if (!e) throw Error("useChart must be used within a <ChartContainer>");
18
+ return e;
17
19
  }
18
- function R(e) {
19
- const r = {};
20
- for (const [s, n] of Object.entries(e))
21
- n.color && (r[`--color-${s}`] = n.color);
22
- return r;
20
+ function p(e) {
21
+ let t = {};
22
+ for (let [n, r] of Object.entries(e)) r.color && (t[`--color-${n}`] = r.color);
23
+ return t;
23
24
  }
24
- function Q({
25
- id: e,
26
- className: r,
27
- children: s,
28
- config: n,
29
- style: d,
30
- role: c = "img",
31
- ...o
32
- }) {
33
- const l = O(() => ({ config: n }), [n]), f = R(n);
34
- return /* @__PURE__ */ a(V.Provider, { value: l, children: /* @__PURE__ */ a(
35
- "div",
36
- {
37
- role: c,
38
- "data-slot": "chart",
39
- "data-chart-id": e,
40
- className: i(
41
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
42
- r
43
- ),
44
- style: { ...f, ...d },
45
- ...o,
46
- children: /* @__PURE__ */ a(M, { children: s })
47
- }
48
- ) });
25
+ function m({ id: t, className: n, children: i, config: o, style: s, role: l = "img", ...u }) {
26
+ let f = r(() => ({ config: o }), [o]), m = p(o);
27
+ return /* @__PURE__ */ a(d.Provider, {
28
+ value: f,
29
+ children: /* @__PURE__ */ a("div", {
30
+ role: l,
31
+ "data-slot": "chart",
32
+ "data-chart-id": t,
33
+ className: e("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-curve.recharts-tooltip-cursor]:stroke-chart-gridlines [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-chart-gridlines [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-chart-gridlines flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", n),
34
+ style: {
35
+ ...m,
36
+ ...s
37
+ },
38
+ ...u,
39
+ children: /* @__PURE__ */ a(c, { children: i })
40
+ })
41
+ });
49
42
  }
50
- const U = D, G = [], H = (e) => typeof e == "number" ? e.toLocaleString() : String(e);
51
- function W({
52
- active: e,
53
- payload: r = G,
54
- className: s,
55
- indicator: n = "dot",
56
- hideLabel: d = !1,
57
- hideIndicator: c = !1,
58
- label: o,
59
- labelFormatter: l,
60
- labelClassName: f,
61
- formatter: h,
62
- color: y,
63
- nameKey: T,
64
- labelKey: _,
65
- valueFormatter: A = H
66
- }) {
67
- const { config: x } = j(), k = (() => {
68
- if (d || !r?.length)
69
- return null;
70
- const [t] = r, v = `${_ ?? t?.dataKey ?? t?.name ?? "value"}`, C = b(x, t, v), u = !_ && typeof o == "string" ? x[o]?.label ?? o : C?.label;
71
- return l ? /* @__PURE__ */ a("div", { className: i("font-medium", f), children: l(u, r) }) : u ? /* @__PURE__ */ a("div", { className: i("font-medium", f), children: u }) : null;
72
- })(), w = !e || !r.length, p = r.length === 1 && n !== "dot";
73
- return /* @__PURE__ */ a(
74
- "div",
75
- {
76
- className: i(
77
- "bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md",
78
- w && "invisible",
79
- s
80
- ),
81
- children: w ? null : /* @__PURE__ */ g(L, { children: [
82
- p ? null : k,
83
- /* @__PURE__ */ a("div", { className: "grid gap-1.5", children: r.filter((t) => t.type !== "none").map((t, v) => {
84
- const C = `${T ?? t.name ?? t.dataKey ?? "value"}`, u = b(
85
- x,
86
- t,
87
- C
88
- ), E = m(t.payload) && typeof t.payload.fill == "string" ? t.payload.fill : void 0, N = y ?? E ?? t.color, F = S(
89
- typeof N == "string" ? N : void 0
90
- );
91
- return /* @__PURE__ */ a(
92
- "div",
93
- {
94
- className: i(
95
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
96
- n === "dot" && "items-center"
97
- ),
98
- children: h && t.value != null && t.name != null ? h(
99
- t.value,
100
- t.name,
101
- t,
102
- v,
103
- m(t.payload) ? t.payload : void 0
104
- ) : /* @__PURE__ */ g(L, { children: [
105
- u?.icon ? u.icon : !c && /* @__PURE__ */ a(
106
- "div",
107
- {
108
- className: i("shrink-0 rounded-xs", {
109
- "h-2 w-2": n === "dot",
110
- "w-1": n === "line",
111
- "w-0 border border-dashed bg-transparent": n === "dashed",
112
- "my-0.5": p && n === "dashed"
113
- }),
114
- style: F
115
- }
116
- ),
117
- /* @__PURE__ */ g(
118
- "div",
119
- {
120
- className: i(
121
- "flex flex-1 justify-between gap-4 leading-none",
122
- p ? "items-end" : "items-center"
123
- ),
124
- children: [
125
- /* @__PURE__ */ g("div", { className: "grid gap-1", children: [
126
- p ? k : null,
127
- /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: u?.label ?? t.name })
128
- ] }),
129
- t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", { className: "text-foreground tabular-nums", children: A(t.value) })
130
- ]
131
- }
132
- )
133
- ] })
134
- },
135
- t.dataKey ?? v
136
- );
137
- }) })
138
- ] })
139
- }
140
- );
43
+ var h = l, g = [], _ = (e) => typeof e == "number" ? e.toLocaleString() : String(e);
44
+ function v({ active: t, payload: n = g, className: r, indicator: s = "dot", hideLabel: c = !1, hideIndicator: l = !1, label: d, labelFormatter: p, labelClassName: m, formatter: h, color: v, nameKey: y, labelKey: b, valueFormatter: x = _ }) {
45
+ let { config: w } = f(), T = (() => {
46
+ if (c || !n?.length) return null;
47
+ let [t] = n, r = `${b ?? t?.dataKey ?? t?.name ?? "value"}`, i = S(w, t, r), o = !b && typeof d == "string" ? w[d]?.label ?? d : i?.label;
48
+ return p ? /* @__PURE__ */ a("div", {
49
+ className: e("font-medium", m),
50
+ children: p(o, n)
51
+ }) : o ? /* @__PURE__ */ a("div", {
52
+ className: e("font-medium", m),
53
+ children: o
54
+ }) : null;
55
+ })(), E = !t || !n.length, D = n.length === 1 && s !== "dot";
56
+ return /* @__PURE__ */ a("div", {
57
+ className: e("bg-popover-background grid min-w-32 items-start gap-1 rounded-md p-2 text-sm shadow-md", E && "invisible", r),
58
+ children: E ? null : /* @__PURE__ */ o(i, { children: [D ? null : T, /* @__PURE__ */ a("div", {
59
+ className: "grid gap-1.5",
60
+ children: n.filter((e) => e.type !== "none").map((t, n) => {
61
+ let r = `${y ?? t.name ?? t.dataKey ?? "value"}`, c = S(w, t, r), d = C(t.payload) && typeof t.payload.fill == "string" ? t.payload.fill : void 0, f = v ?? d ?? t.color, p = u(typeof f == "string" ? f : void 0);
62
+ return /* @__PURE__ */ a("div", {
63
+ className: e("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", s === "dot" && "items-center"),
64
+ children: h && t.value != null && t.name != null ? h(t.value, t.name, t, n, C(t.payload) ? t.payload : void 0) : /* @__PURE__ */ o(i, { children: [c?.icon ? c.icon : !l && /* @__PURE__ */ a("div", {
65
+ className: e("shrink-0 rounded-xs", {
66
+ "h-2 w-2": s === "dot",
67
+ "w-1": s === "line",
68
+ "w-0 border border-dashed bg-transparent": s === "dashed",
69
+ "my-0.5": D && s === "dashed"
70
+ }),
71
+ style: p
72
+ }), /* @__PURE__ */ o("div", {
73
+ className: e("flex flex-1 justify-between gap-4 leading-none", D ? "items-end" : "items-center"),
74
+ children: [/* @__PURE__ */ o("div", {
75
+ className: "grid gap-1",
76
+ children: [D ? T : null, /* @__PURE__ */ a("span", {
77
+ className: "text-muted-foreground",
78
+ children: c?.label ?? t.name
79
+ })]
80
+ }), t.value !== void 0 && t.value !== null && /* @__PURE__ */ a("span", {
81
+ className: "text-foreground tabular-nums",
82
+ children: x(t.value)
83
+ })]
84
+ })] })
85
+ }, t.dataKey ?? n);
86
+ })
87
+ })] })
88
+ });
141
89
  }
142
- const X = $, I = [];
143
- function Z({
144
- className: e,
145
- hideIcon: r = !1,
146
- payload: s = I,
147
- verticalAlign: n = "bottom",
148
- nameKey: d
149
- }) {
150
- const { config: c } = j();
151
- return s?.length ? /* @__PURE__ */ a(
152
- "div",
153
- {
154
- className: i(
155
- "flex items-center justify-center gap-4",
156
- n === "top" ? "pb-3" : "pt-3",
157
- e
158
- ),
159
- children: s.filter((o) => o.type !== "none").map((o, l) => {
160
- const f = `${d ?? o.dataKey ?? "value"}`, h = b(c, o, f), y = S(
161
- typeof o.color == "string" ? o.color : void 0
162
- );
163
- return /* @__PURE__ */ g(
164
- "div",
165
- {
166
- className: i(
167
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
168
- ),
169
- children: [
170
- h?.icon && !r ? h.icon : /* @__PURE__ */ a(
171
- "div",
172
- {
173
- className: "h-2 w-2 shrink-0 rounded-xs",
174
- style: y
175
- }
176
- ),
177
- h?.label ?? o.value
178
- ]
179
- },
180
- o.value ?? l
181
- );
182
- })
183
- }
184
- ) : null;
90
+ var y = s, b = [];
91
+ function x({ className: t, hideIcon: n = !1, payload: r = b, verticalAlign: i = "bottom", nameKey: s }) {
92
+ let { config: c } = f();
93
+ return r?.length ? /* @__PURE__ */ a("div", {
94
+ className: e("flex items-center justify-center gap-4", i === "top" ? "pb-3" : "pt-3", t),
95
+ children: r.filter((e) => e.type !== "none").map((t, r) => {
96
+ let i = `${s ?? t.dataKey ?? "value"}`, l = S(c, t, i), d = u(typeof t.color == "string" ? t.color : void 0);
97
+ return /* @__PURE__ */ o("div", {
98
+ className: e("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
99
+ children: [l?.icon && !n ? l.icon : /* @__PURE__ */ a("div", {
100
+ className: "h-2 w-2 shrink-0 rounded-xs",
101
+ style: d
102
+ }), l?.label ?? t.value]
103
+ }, t.value ?? r);
104
+ })
105
+ }) : null;
185
106
  }
186
- function b(e, r, s) {
187
- if (!m(r))
188
- return;
189
- const n = r, d = m(n.payload) ? n.payload : void 0;
190
- let c = s;
191
- const o = P(n, s);
192
- if (o)
193
- c = o;
194
- else {
195
- const l = d ? P(d, s) : void 0;
196
- l && (c = l);
197
- }
198
- return e[c] ?? e[s];
107
+ function S(e, t, n) {
108
+ if (!C(t)) return;
109
+ let r = t, i = C(r.payload) ? r.payload : void 0, a = n, o = w(r, n);
110
+ if (o) a = o;
111
+ else {
112
+ let e = i ? w(i, n) : void 0;
113
+ e && (a = e);
114
+ }
115
+ return e[a] ?? e[n];
199
116
  }
200
- function m(e) {
201
- return typeof e == "object" && e !== null && !Array.isArray(e);
117
+ function C(e) {
118
+ return typeof e == "object" && !!e && !Array.isArray(e);
202
119
  }
203
- function P(e, r) {
204
- const s = e[r];
205
- return typeof s == "string" ? s : void 0;
120
+ function w(e, t) {
121
+ let n = e[t];
122
+ return typeof n == "string" ? n : void 0;
206
123
  }
207
- export {
208
- Q as ChartContainer,
209
- X as ChartLegend,
210
- Z as ChartLegendContent,
211
- U as ChartTooltip,
212
- W as ChartTooltipContent,
213
- R as colorVarsFromConfig,
214
- b as getPayloadConfigFromPayload
215
- };
124
+ //#endregion
125
+ export { m as ChartContainer, y as ChartLegend, x as ChartLegendContent, h as ChartTooltip, v as ChartTooltipContent, p as colorVarsFromConfig, S as getPayloadConfigFromPayload };
@@ -1,8 +1,2 @@
1
- import { ChartContainer as e, ChartLegend as n, ChartLegendContent as r, ChartTooltip as C, ChartTooltipContent as a } from "./chart.js";
2
- export {
3
- e as ChartContainer,
4
- n as ChartLegend,
5
- r as ChartLegendContent,
6
- C as ChartTooltip,
7
- a as ChartTooltipContent
8
- };
1
+ import { ChartContainer as e, ChartLegend as t, ChartLegendContent as n, ChartTooltip as r, ChartTooltipContent as i } from "./chart.js";
2
+ export { e as ChartContainer, t as ChartLegend, n as ChartLegendContent, r as ChartTooltip, i as ChartTooltipContent };
@@ -1,133 +1,68 @@
1
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
- import { forwardRef as r } from "react";
3
- import { Checkbox as i } from "@base-ui/react/checkbox";
4
- import { IconCheck as l, IconMinus as b } from "@tabler/icons-react";
5
- import { cva as m } from "class-variance-authority";
6
- import { cn as d, selectionItemBase as h, selectionItemCard as k, selectionItemDefault as u, invalidState as x, focusState as p, selectionItemLabel as g, selectionItemDescription as f } from "../../../../lib/utils.js";
7
- const I = r(
8
- ({ className: a, orientation: e = "vertical", role: t = "group", ...c }, n) => /* @__PURE__ */ o(
9
- "div",
10
- {
11
- ref: n,
12
- role: t,
13
- "data-slot": "checkbox-group",
14
- "data-orientation": e,
15
- className: d(
16
- e === "horizontal" ? "flex items-center gap-2" : "grid has-[[data-variant=card]]:gap-2",
17
- a
18
- ),
19
- ...c
20
- }
21
- )
22
- );
23
- I.displayName = "CheckboxGroup";
24
- const C = m(d("group/checkbox-item", h), {
25
- variants: {
26
- variant: {
27
- default: u,
28
- card: k
29
- }
30
- },
31
- defaultVariants: {
32
- variant: "default"
33
- }
34
- }), v = r(
35
- ({ className: a, variant: e, ...t }, c) => /* @__PURE__ */ o(
36
- "label",
37
- {
38
- ref: c,
39
- "data-slot": "checkbox-item",
40
- "data-variant": e ?? "default",
41
- className: d(C({ variant: e }), a),
42
- ...t
43
- }
44
- )
45
- );
46
- v.displayName = "CheckboxItem";
47
- const N = r(({ className: a, ...e }, t) => /* @__PURE__ */ o(
48
- i.Root,
49
- {
50
- ref: t,
51
- "data-slot": "checkbox-item-control",
52
- className: d(
53
- "peer relative size-4 shrink-0 rounded-sm border-[1.5px] border-inactive-foreground bg-transparent text-foreground-on-primary outline-none transition-colors",
54
- "[&:is([data-checked],[data-indeterminate]):not([data-disabled])]:border-transparent [&:is([data-checked],[data-indeterminate]):not([data-disabled])]:bg-primary-background",
55
- "data-unchecked:not-data-disabled:hover:border-secondary-foreground group-hover/checkbox-item:data-unchecked:not-data-disabled:border-secondary-foreground",
56
- "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:border-transparent data-disabled:bg-disabled-background data-disabled:text-disabled-foreground data-disabled:data-unchecked:border-border",
57
- "[&[data-checked]_[data-slot=checkbox-check]]:block [&[data-indeterminate]_[data-slot=checkbox-dash]]:block",
58
- p,
59
- x,
60
- a
61
- ),
62
- ...e,
63
- children: /* @__PURE__ */ s(
64
- i.Indicator,
65
- {
66
- "data-slot": "checkbox-indicator",
67
- className: "grid size-full place-content-center text-current transition-none",
68
- children: [
69
- /* @__PURE__ */ o(
70
- l,
71
- {
72
- "aria-hidden": "true",
73
- "data-slot": "checkbox-check",
74
- className: "hidden size-3",
75
- stroke: 3
76
- }
77
- ),
78
- /* @__PURE__ */ o(
79
- b,
80
- {
81
- "aria-hidden": "true",
82
- "data-slot": "checkbox-dash",
83
- className: "hidden size-3",
84
- stroke: 3.5
85
- }
86
- )
87
- ]
88
- }
89
- )
90
- }
91
- ));
92
- N.displayName = "CheckboxItemControl";
93
- const y = r(
94
- ({ className: a, ...e }, t) => /* @__PURE__ */ o(
95
- "span",
96
- {
97
- ref: t,
98
- "data-slot": "checkbox-item-label",
99
- className: d(
100
- g,
101
- "group-has-[[data-checked]]/checkbox-item:text-foreground",
102
- "group-has-[[data-indeterminate]]/checkbox-item:text-foreground",
103
- "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground",
104
- a
105
- ),
106
- ...e
107
- }
108
- )
109
- );
1
+ import { cn as e, focusState as t, invalidState as n, selectionItemBase as r, selectionItemCard as i, selectionItemDefault as a, selectionItemDescription as o, selectionItemLabel as s } from "../../../../lib/utils.js";
2
+ import { forwardRef as c } from "react";
3
+ import { IconCheck as l, IconMinus as u } from "@tabler/icons-react";
4
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { cva as p } from "class-variance-authority";
6
+ import { Checkbox as m } from "@base-ui/react/checkbox";
7
+ //#region libs/aura/src/components/ui/core/checkbox/checkbox.tsx
8
+ var h = c(({ className: t, orientation: n = "vertical", role: r = "group", ...i }, a) => /* @__PURE__ */ d("div", {
9
+ ref: a,
10
+ role: r,
11
+ "data-slot": "checkbox-group",
12
+ "data-orientation": n,
13
+ className: e(n === "horizontal" ? "flex items-center gap-2" : "grid has-[[data-variant=card]]:gap-2", t),
14
+ ...i
15
+ }));
16
+ h.displayName = "CheckboxGroup";
17
+ var g = p(e("group/checkbox-item", r), {
18
+ variants: { variant: {
19
+ default: a,
20
+ card: i
21
+ } },
22
+ defaultVariants: { variant: "default" }
23
+ }), _ = c(({ className: t, variant: n, ...r }, i) => /* @__PURE__ */ d("label", {
24
+ ref: i,
25
+ "data-slot": "checkbox-item",
26
+ "data-variant": n ?? "default",
27
+ className: e(g({ variant: n }), t),
28
+ ...r
29
+ }));
30
+ _.displayName = "CheckboxItem";
31
+ var v = c(({ className: r, ...i }, a) => /* @__PURE__ */ d(m.Root, {
32
+ ref: a,
33
+ "data-slot": "checkbox-item-control",
34
+ className: e("peer relative size-4 shrink-0 rounded-sm border-[1.5px] border-inactive-foreground bg-transparent text-foreground-on-primary outline-none transition-colors", "[&:is([data-checked],[data-indeterminate]):not([data-disabled])]:border-transparent [&:is([data-checked],[data-indeterminate]):not([data-disabled])]:bg-primary-background", "data-unchecked:not-data-disabled:hover:border-secondary-foreground group-hover/checkbox-item:data-unchecked:not-data-disabled:border-secondary-foreground", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:border-transparent data-disabled:bg-disabled-background data-disabled:text-disabled-foreground data-disabled:data-unchecked:border-border", "[&[data-checked]_[data-slot=checkbox-check]]:block [&[data-indeterminate]_[data-slot=checkbox-dash]]:block", t, n, r),
35
+ ...i,
36
+ children: /* @__PURE__ */ f(m.Indicator, {
37
+ "data-slot": "checkbox-indicator",
38
+ className: "grid size-full place-content-center text-current transition-none",
39
+ children: [/* @__PURE__ */ d(l, {
40
+ "aria-hidden": "true",
41
+ "data-slot": "checkbox-check",
42
+ className: "hidden size-3",
43
+ stroke: 3
44
+ }), /* @__PURE__ */ d(u, {
45
+ "aria-hidden": "true",
46
+ "data-slot": "checkbox-dash",
47
+ className: "hidden size-3",
48
+ stroke: 3.5
49
+ })]
50
+ })
51
+ }));
52
+ v.displayName = "CheckboxItemControl";
53
+ var y = c(({ className: t, ...n }, r) => /* @__PURE__ */ d("span", {
54
+ ref: r,
55
+ "data-slot": "checkbox-item-label",
56
+ className: e(s, "group-has-[[data-checked]]/checkbox-item:text-foreground", "group-has-[[data-indeterminate]]/checkbox-item:text-foreground", "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground", t),
57
+ ...n
58
+ }));
110
59
  y.displayName = "CheckboxItemLabel";
111
- const z = r(
112
- ({ className: a, ...e }, t) => /* @__PURE__ */ o(
113
- "span",
114
- {
115
- ref: t,
116
- "data-slot": "checkbox-item-description",
117
- className: d(
118
- f,
119
- "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground",
120
- a
121
- ),
122
- ...e
123
- }
124
- )
125
- );
126
- z.displayName = "CheckboxItemDescription";
127
- export {
128
- I as CheckboxGroup,
129
- v as CheckboxItem,
130
- N as CheckboxItemControl,
131
- z as CheckboxItemDescription,
132
- y as CheckboxItemLabel
133
- };
60
+ var b = c(({ className: t, ...n }, r) => /* @__PURE__ */ d("span", {
61
+ ref: r,
62
+ "data-slot": "checkbox-item-description",
63
+ className: e(o, "group-has-[[data-disabled]]/checkbox-item:text-disabled-foreground", t),
64
+ ...n
65
+ }));
66
+ b.displayName = "CheckboxItemDescription";
67
+ //#endregion
68
+ export { h as CheckboxGroup, _ as CheckboxItem, v as CheckboxItemControl, b as CheckboxItemDescription, y as CheckboxItemLabel };
@@ -1,8 +1,8 @@
1
- const e = {
2
- name: "Checkbox",
3
- description: "A composable checkbox group with optional label and description slots, including a card-style item variant and support for checked, unchecked, and indeterminate states.",
4
- llmUsage: 'Use `<CheckboxGroup>` with `<CheckboxItem>` wrapping `<CheckboxItemControl />`, plus optional `<CheckboxItemLabel>` and `<CheckboxItemDescription>`. Always pass an accessible name on `<CheckboxItemControl>` via `aria-label` (or `aria-labelledby` pointing to the label\'s id) — the wrapping `<label>` element names the underlying hidden form input, but does not name the visible `role="checkbox"` element that screen readers focus on. `<CheckboxItemDescription>` is a visual slot at this primitive layer; if you need it announced by screen readers, give it an `id` and pass `aria-describedby` to `<CheckboxItemControl>`. Use `variant="card"` on `<CheckboxItem>` for card-style options. `<CheckboxItemControl>` supports `checked`, `defaultChecked`, `indeterminate`, `onCheckedChange`, `disabled`, and `required` for form integration.'
5
- };
6
- export {
7
- e as CheckboxMetadata
1
+ //#region libs/aura/src/components/ui/core/checkbox/checkbox.metadata.ts
2
+ var e = {
3
+ name: "Checkbox",
4
+ description: "A composable checkbox group with optional label and description slots, including a card-style item variant and support for checked, unchecked, and indeterminate states.",
5
+ llmUsage: "Use `<CheckboxGroup>` with `<CheckboxItem>` wrapping `<CheckboxItemControl />`, plus optional `<CheckboxItemLabel>` and `<CheckboxItemDescription>`. Always pass an accessible name on `<CheckboxItemControl>` via `aria-label` (or `aria-labelledby` pointing to the label's id) — the wrapping `<label>` element names the underlying hidden form input, but does not name the visible `role=\"checkbox\"` element that screen readers focus on. `<CheckboxItemDescription>` is a visual slot at this primitive layer; if you need it announced by screen readers, give it an `id` and pass `aria-describedby` to `<CheckboxItemControl>`. Use `variant=\"card\"` on `<CheckboxItem>` for card-style options. `<CheckboxItemControl>` supports `checked`, `defaultChecked`, `indeterminate`, `onCheckedChange`, `disabled`, and `required` for form integration."
8
6
  };
7
+ //#endregion
8
+ export { e as CheckboxMetadata };
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from 'react';
2
- import { BundledLanguage } from 'shiki';
2
+ import { BundledLanguage } from 'shiki/bundle/web';
3
3
  import { Button } from '../button/button';
4
4
  export declare function getCollapsedPreviewDisplay(code: string): string;
5
5
  export declare function isContentLargerThanPreview(code: string): boolean;