@wealthx/shadcn 1.0.1 → 1.1.0

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 (63) hide show
  1. package/.turbo/turbo-build.log +154 -135
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +82 -0
  4. package/dist/chunk-3EQP72AW.mjs +58 -0
  5. package/dist/{chunk-2WZVSBAY.mjs → chunk-3NQGYJEZ.mjs} +1 -1
  6. package/dist/{chunk-ZN2QKLF6.mjs → chunk-46OFHMQA.mjs} +1 -1
  7. package/dist/{chunk-IAOOZCUY.mjs → chunk-4AJ5HWHD.mjs} +4 -1
  8. package/dist/chunk-5JGQAAQV.mjs +212 -0
  9. package/dist/{chunk-MKFL5MNH.mjs → chunk-CJ46PDXE.mjs} +6 -6
  10. package/dist/{chunk-7LDIMXGM.mjs → chunk-DKZRJOMF.mjs} +1 -1
  11. package/dist/{chunk-AMJ23O53.mjs → chunk-FHNT55I5.mjs} +2 -2
  12. package/dist/chunk-GLW2UO6O.mjs +212 -0
  13. package/dist/{chunk-NGYG2EA6.mjs → chunk-I64K754C.mjs} +1 -1
  14. package/dist/chunk-K74JRTJR.mjs +105 -0
  15. package/dist/{chunk-NWZ46DJL.mjs → chunk-KQDD5MU3.mjs} +1 -1
  16. package/dist/chunk-RN67642N.mjs +171 -0
  17. package/dist/chunk-UEL4RD5P.mjs +272 -0
  18. package/dist/chunk-YBXCIF5Q.mjs +198 -0
  19. package/dist/components/ui/alert-dialog.js +4 -1
  20. package/dist/components/ui/alert-dialog.mjs +2 -2
  21. package/dist/components/ui/button.js +4 -1
  22. package/dist/components/ui/button.mjs +1 -1
  23. package/dist/components/ui/calendar.js +4 -1
  24. package/dist/components/ui/calendar.mjs +2 -2
  25. package/dist/components/ui/cashflow-bar-chart.js +596 -0
  26. package/dist/components/ui/cashflow-bar-chart.mjs +16 -0
  27. package/dist/components/ui/combobox.js +261 -0
  28. package/dist/components/ui/combobox.mjs +28 -0
  29. package/dist/components/ui/data-table.js +4 -1
  30. package/dist/components/ui/data-table.mjs +4 -4
  31. package/dist/components/ui/date-picker.js +4 -1
  32. package/dist/components/ui/date-picker.mjs +3 -3
  33. package/dist/components/ui/dialog.js +4 -1
  34. package/dist/components/ui/dialog.mjs +2 -2
  35. package/dist/components/ui/expense-bar-chart.js +543 -0
  36. package/dist/components/ui/expense-bar-chart.mjs +16 -0
  37. package/dist/components/ui/field.mjs +2 -2
  38. package/dist/components/ui/income-bar-chart.js +543 -0
  39. package/dist/components/ui/income-bar-chart.mjs +16 -0
  40. package/dist/components/ui/input-group.js +4 -1
  41. package/dist/components/ui/input-group.mjs +2 -2
  42. package/dist/components/ui/pagination.js +4 -1
  43. package/dist/components/ui/pagination.mjs +2 -2
  44. package/dist/components/ui/slider.js +166 -0
  45. package/dist/components/ui/slider.mjs +8 -0
  46. package/dist/components/ui/transactions-income-expense-bar-chart.js +478 -0
  47. package/dist/components/ui/transactions-income-expense-bar-chart.mjs +16 -0
  48. package/dist/index.js +1757 -698
  49. package/dist/index.mjs +160 -115
  50. package/dist/styles.css +1 -1
  51. package/package.json +35 -2
  52. package/src/components/index.tsx +59 -0
  53. package/src/components/ui/button.tsx +2 -0
  54. package/src/components/ui/cashflow-bar-chart.tsx +336 -0
  55. package/src/components/ui/chart-shared.tsx +100 -0
  56. package/src/components/ui/combobox.tsx +217 -0
  57. package/src/components/ui/expense-bar-chart.tsx +278 -0
  58. package/src/components/ui/income-bar-chart.tsx +278 -0
  59. package/src/components/ui/slider.tsx +107 -0
  60. package/src/components/ui/transactions-income-expense-bar-chart.tsx +198 -0
  61. package/src/styles/styles-css.ts +1 -1
  62. package/tsup.config.ts +6 -0
  63. package/dist/{chunk-HUVTPUV2.mjs → chunk-NLLKTU4B.mjs} +3 -3
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __objRest = (source, exclude) => {
23
+ var target = {};
24
+ for (var prop in source)
25
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
+ target[prop] = source[prop];
27
+ if (source != null && __getOwnPropSymbols)
28
+ for (var prop of __getOwnPropSymbols(source)) {
29
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
+ target[prop] = source[prop];
31
+ }
32
+ return target;
33
+ };
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, { get: all[name], enumerable: true });
37
+ };
38
+ var __copyProps = (to, from, except, desc) => {
39
+ if (from && typeof from === "object" || typeof from === "function") {
40
+ for (let key of __getOwnPropNames(from))
41
+ if (!__hasOwnProp.call(to, key) && key !== except)
42
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
43
+ }
44
+ return to;
45
+ };
46
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
47
+ // If the importer is in node compatibility mode or this is not an ESM
48
+ // file that has been converted to a CommonJS file using a Babel-
49
+ // compatible transform (i.e. "__esModule" has not been set), then set
50
+ // "default" to the CommonJS "module.exports" for node compatibility.
51
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
52
+ mod
53
+ ));
54
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
55
+
56
+ // src/components/ui/slider.tsx
57
+ var slider_exports = {};
58
+ __export(slider_exports, {
59
+ Slider: () => Slider
60
+ });
61
+ module.exports = __toCommonJS(slider_exports);
62
+ var React = __toESM(require("react"));
63
+
64
+ // src/lib/utils.ts
65
+ var import_clsx = require("clsx");
66
+ var import_tailwind_merge = require("tailwind-merge");
67
+ function cn(...inputs) {
68
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
69
+ }
70
+
71
+ // src/components/ui/slider.tsx
72
+ var import_jsx_runtime = require("react/jsx-runtime");
73
+ var Slider = React.forwardRef(
74
+ (_a, ref) => {
75
+ var _b = _a, {
76
+ className,
77
+ value,
78
+ defaultValue = 0,
79
+ min = 0,
80
+ max = 100,
81
+ step = 1,
82
+ disabled = false,
83
+ onValueChange
84
+ } = _b, props = __objRest(_b, [
85
+ "className",
86
+ "value",
87
+ "defaultValue",
88
+ "min",
89
+ "max",
90
+ "step",
91
+ "disabled",
92
+ "onValueChange"
93
+ ]);
94
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
95
+ const currentValue = value !== void 0 ? value : internalValue;
96
+ const percentage = (currentValue - min) / (max - min) * 100;
97
+ const handleChange = (e) => {
98
+ const newValue = Number(e.target.value);
99
+ if (value === void 0) {
100
+ setInternalValue(newValue);
101
+ }
102
+ onValueChange == null ? void 0 : onValueChange(newValue);
103
+ };
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
105
+ "div",
106
+ {
107
+ "data-slot": "slider",
108
+ className: cn(
109
+ "relative flex w-full touch-none items-center select-none",
110
+ disabled && "opacity-50",
111
+ className
112
+ ),
113
+ children: [
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
115
+ "div",
116
+ {
117
+ "data-slot": "slider-track",
118
+ className: "relative h-2 w-full overflow-hidden rounded-full bg-muted",
119
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ "div",
121
+ {
122
+ "data-slot": "slider-range",
123
+ className: "absolute h-full rounded-full bg-primary",
124
+ style: { width: `${percentage}%` }
125
+ }
126
+ )
127
+ }
128
+ ),
129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
+ "input",
131
+ __spreadValues({
132
+ ref,
133
+ type: "range",
134
+ min,
135
+ max,
136
+ step,
137
+ value: currentValue,
138
+ disabled,
139
+ onChange: handleChange,
140
+ className: cn(
141
+ "absolute inset-0 h-full w-full cursor-pointer opacity-0",
142
+ disabled && "cursor-not-allowed"
143
+ )
144
+ }, props)
145
+ ),
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
147
+ "div",
148
+ {
149
+ "data-slot": "slider-thumb",
150
+ className: cn(
151
+ "pointer-events-none absolute top-1/2 -translate-x-1/2 -translate-y-1/2",
152
+ "block size-5 rounded-full border-2 border-primary bg-background shadow-sm"
153
+ ),
154
+ style: { left: `${percentage}%` }
155
+ }
156
+ )
157
+ ]
158
+ }
159
+ );
160
+ }
161
+ );
162
+ Slider.displayName = "Slider";
163
+ // Annotate the CommonJS export names for ESM import in node:
164
+ 0 && (module.exports = {
165
+ Slider
166
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ Slider
3
+ } from "../../chunk-K74JRTJR.mjs";
4
+ import "../../chunk-V7CNWJT3.mjs";
5
+ import "../../chunk-FWCSY2DS.mjs";
6
+ export {
7
+ Slider
8
+ };
@@ -0,0 +1,478 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/components/ui/transactions-income-expense-bar-chart.tsx
60
+ var transactions_income_expense_bar_chart_exports = {};
61
+ __export(transactions_income_expense_bar_chart_exports, {
62
+ TransactionsIncomeExpenseBarChart: () => TransactionsIncomeExpenseBarChart
63
+ });
64
+ module.exports = __toCommonJS(transactions_income_expense_bar_chart_exports);
65
+ var import_react3 = require("react");
66
+ var import_chart = require("chart.js");
67
+ var import_chartjs_plugin_datalabels = __toESM(require("chartjs-plugin-datalabels"));
68
+ var import_react_chartjs_2 = require("react-chartjs-2");
69
+
70
+ // src/lib/theme-provider.tsx
71
+ var import_react = require("react");
72
+ var import_jsx_runtime = require("react/jsx-runtime");
73
+ var ThemeVarsContext = (0, import_react.createContext)({});
74
+ function useThemeVars() {
75
+ return (0, import_react.useContext)(ThemeVarsContext);
76
+ }
77
+
78
+ // src/lib/utils.ts
79
+ var import_clsx = require("clsx");
80
+ var import_tailwind_merge = require("tailwind-merge");
81
+ function cn(...inputs) {
82
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
83
+ }
84
+
85
+ // src/components/ui/card.tsx
86
+ var import_jsx_runtime2 = require("react/jsx-runtime");
87
+ function Card(_a) {
88
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
89
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
90
+ "div",
91
+ __spreadValues({
92
+ className: cn(
93
+ "flex flex-col gap-6 border bg-card py-6 text-card-foreground shadow-sm",
94
+ className
95
+ ),
96
+ "data-slot": "card"
97
+ }, props)
98
+ );
99
+ }
100
+ function CardHeader(_a) {
101
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
102
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
103
+ "div",
104
+ __spreadValues({
105
+ className: cn(
106
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
107
+ className
108
+ ),
109
+ "data-slot": "card-header"
110
+ }, props)
111
+ );
112
+ }
113
+ function CardTitle(_a) {
114
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
115
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
116
+ "div",
117
+ __spreadValues({
118
+ className: cn("leading-none font-semibold", className),
119
+ "data-slot": "card-title"
120
+ }, props)
121
+ );
122
+ }
123
+ function CardContent(_a) {
124
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
125
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
126
+ "div",
127
+ __spreadValues({
128
+ className: cn("px-6", className),
129
+ "data-slot": "card-content"
130
+ }, props)
131
+ );
132
+ }
133
+
134
+ // src/components/ui/empty.tsx
135
+ var import_class_variance_authority = require("class-variance-authority");
136
+ var import_jsx_runtime3 = require("react/jsx-runtime");
137
+ function Empty(_a) {
138
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
139
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
140
+ "div",
141
+ __spreadValues({
142
+ className: cn(
143
+ "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 border border-dashed p-6 text-center text-balance md:p-12",
144
+ className
145
+ ),
146
+ "data-slot": "empty"
147
+ }, props)
148
+ );
149
+ }
150
+ var emptyMediaVariants = (0, import_class_variance_authority.cva)(
151
+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
152
+ {
153
+ variants: {
154
+ variant: {
155
+ default: "[&_svg:not([class*='size-'])]:size-10",
156
+ icon: "flex size-10 shrink-0 items-center justify-center text-muted-foreground [&_svg:not([class*='size-'])]:size-6"
157
+ }
158
+ },
159
+ defaultVariants: {
160
+ variant: "default"
161
+ }
162
+ }
163
+ );
164
+ function EmptyDescription(_a) {
165
+ var _b = _a, {
166
+ className
167
+ } = _b, props = __objRest(_b, [
168
+ "className"
169
+ ]);
170
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
171
+ "div",
172
+ __spreadValues({
173
+ className: cn(
174
+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
175
+ className
176
+ ),
177
+ "data-slot": "empty-description"
178
+ }, props)
179
+ );
180
+ }
181
+
182
+ // src/components/ui/spinner.tsx
183
+ var import_class_variance_authority2 = require("class-variance-authority");
184
+ var import_lucide_react = require("lucide-react");
185
+ var import_jsx_runtime4 = require("react/jsx-runtime");
186
+ var spinnerVariants = (0, import_class_variance_authority2.cva)("animate-spin shrink-0", {
187
+ variants: {
188
+ size: {
189
+ sm: "size-3",
190
+ default: "size-4",
191
+ lg: "size-6",
192
+ xl: "size-8"
193
+ }
194
+ },
195
+ defaultVariants: {
196
+ size: "default"
197
+ }
198
+ });
199
+ function Spinner(_a) {
200
+ var _b = _a, { className, size } = _b, props = __objRest(_b, ["className", "size"]);
201
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
202
+ import_lucide_react.LoaderCircle,
203
+ __spreadValues({
204
+ "aria-hidden": "true",
205
+ className: cn(spinnerVariants({ size }), className),
206
+ "data-slot": "spinner"
207
+ }, props)
208
+ );
209
+ }
210
+
211
+ // src/components/ui/button.tsx
212
+ var import_react2 = require("react");
213
+ var import_class_variance_authority3 = require("class-variance-authority");
214
+ var import_lucide_react2 = require("lucide-react");
215
+
216
+ // src/lib/slot.tsx
217
+ var React2 = __toESM(require("react"));
218
+ function mergeRefs(...refs) {
219
+ return (value) => {
220
+ for (const ref of refs) {
221
+ if (typeof ref === "function") ref(value);
222
+ else if (ref !== null)
223
+ ref.current = value;
224
+ }
225
+ };
226
+ }
227
+ var Slot = React2.forwardRef(
228
+ (_a, forwardedRef) => {
229
+ var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
230
+ const child = React2.Children.only(children);
231
+ if (!React2.isValidElement(child)) return null;
232
+ const childProps = child.props;
233
+ const merged = __spreadValues({}, props);
234
+ for (const key of Object.keys(childProps)) {
235
+ if (key === "className") {
236
+ merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
237
+ } else if (key === "style") {
238
+ merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
239
+ } else if (key.startsWith("on") && typeof childProps[key] === "function") {
240
+ const parentHandler = props[key];
241
+ if (typeof parentHandler === "function") {
242
+ merged[key] = (...args) => {
243
+ childProps[key](...args);
244
+ parentHandler(...args);
245
+ };
246
+ } else {
247
+ merged[key] = childProps[key];
248
+ }
249
+ } else {
250
+ merged[key] = childProps[key];
251
+ }
252
+ }
253
+ const childRef = child.ref;
254
+ merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
255
+ return React2.cloneElement(
256
+ child,
257
+ merged
258
+ );
259
+ }
260
+ );
261
+ Slot.displayName = "Slot";
262
+
263
+ // src/components/ui/button.tsx
264
+ var import_jsx_runtime5 = require("react/jsx-runtime");
265
+ var buttonVariants = (0, import_class_variance_authority3.cva)(
266
+ "inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-sm font-medium whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
267
+ {
268
+ variants: {
269
+ variant: {
270
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
271
+ secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
272
+ destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
273
+ outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
274
+ "outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
275
+ "outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:ring-brand-secondary/30",
276
+ ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs dark:hover:bg-accent/50",
277
+ link: "text-primary underline-offset-4 hover:underline"
278
+ },
279
+ size: {
280
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
281
+ xs: "h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
282
+ sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
283
+ lg: "h-10 px-6 has-[>svg]:px-4",
284
+ icon: "size-9",
285
+ "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
286
+ "icon-sm": "size-8",
287
+ "icon-lg": "size-10"
288
+ }
289
+ },
290
+ defaultVariants: {
291
+ variant: "default",
292
+ size: "default"
293
+ }
294
+ }
295
+ );
296
+ var Button = (0, import_react2.forwardRef)(function Button2(_a, ref) {
297
+ var _b = _a, {
298
+ className,
299
+ variant,
300
+ size,
301
+ asChild = false,
302
+ loading = false,
303
+ disabled,
304
+ type = "button",
305
+ children
306
+ } = _b, props = __objRest(_b, [
307
+ "className",
308
+ "variant",
309
+ "size",
310
+ "asChild",
311
+ "loading",
312
+ "disabled",
313
+ "type",
314
+ "children"
315
+ ]);
316
+ const Comp = asChild ? Slot : "button";
317
+ const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
318
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
319
+ Comp,
320
+ __spreadProps(__spreadValues({
321
+ className: cn(buttonVariants({ variant, size, className })),
322
+ "data-size": size,
323
+ "data-slot": "button",
324
+ "data-variant": variant,
325
+ disabled: loading || disabled,
326
+ ref,
327
+ type
328
+ }, props), {
329
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
330
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
331
+ !isIconOnly && children
332
+ ] }) : children
333
+ })
334
+ );
335
+ });
336
+
337
+ // src/components/ui/chart-shared.tsx
338
+ var import_jsx_runtime6 = require("react/jsx-runtime");
339
+ var FALLBACK_TICK = "#9EAAB5";
340
+
341
+ // src/components/ui/transactions-income-expense-bar-chart.tsx
342
+ var import_jsx_runtime7 = require("react/jsx-runtime");
343
+ import_chart.Chart.register(import_chart.CategoryScale, import_chart.LinearScale, import_chart.BarElement, import_chart.Tooltip);
344
+ var FALLBACK_PRIMARY = "#33FF99";
345
+ var FALLBACK_SECONDARY = "#162029";
346
+ var VALUE_LABEL_COLOR = "#162029";
347
+ function formatDollar(value) {
348
+ return `$${value.toLocaleString(void 0, {
349
+ minimumFractionDigits: 2,
350
+ maximumFractionDigits: 2
351
+ })}`;
352
+ }
353
+ function TransactionsIncomeExpenseBarChart({
354
+ totalIncome,
355
+ totalExpense,
356
+ title = "Transactions \u2014 Income vs Expense",
357
+ height = 120,
358
+ width = "100%",
359
+ className,
360
+ isLoading = false
361
+ }) {
362
+ const themeVars = useThemeVars();
363
+ const brandPrimary = themeVars["--theme-primary"] || FALLBACK_PRIMARY;
364
+ const brandSecondary = themeVars["--theme-secondary"] || FALLBACK_SECONDARY;
365
+ const hasData = totalIncome != null && totalExpense != null;
366
+ const incomeVal = totalIncome != null ? totalIncome : 0;
367
+ const expenseVal = Math.abs(totalExpense != null ? totalExpense : 0);
368
+ const maxVal = Math.max(incomeVal, expenseVal);
369
+ const chartData = (0, import_react3.useMemo)(() => {
370
+ if (!hasData) return { labels: [], datasets: [] };
371
+ return {
372
+ labels: ["Incoming", "Outgoing"],
373
+ datasets: [
374
+ {
375
+ barThickness: 40,
376
+ backgroundColor: [brandPrimary, brandSecondary],
377
+ hoverBackgroundColor: [brandPrimary, brandSecondary],
378
+ borderWidth: 0,
379
+ borderRadius: 0,
380
+ borderSkipped: false,
381
+ data: [incomeVal, expenseVal],
382
+ // chartjs-plugin-datalabels config — typed via plugin module augmentation
383
+ datalabels: {
384
+ labels: {
385
+ value: {
386
+ anchor: "end",
387
+ align: "end",
388
+ offset: 10,
389
+ clamp: false,
390
+ font: { weight: "bold", size: 14 },
391
+ color: VALUE_LABEL_COLOR,
392
+ textAlign: "left",
393
+ // Returns array for multi-line: dollar value on line 1, blank on line 2
394
+ formatter: (v) => [formatDollar(v), ""]
395
+ },
396
+ name: {
397
+ anchor: "end",
398
+ align: "end",
399
+ offset: 10,
400
+ clamp: false,
401
+ font: { size: 12 },
402
+ color: FALLBACK_TICK,
403
+ textAlign: "left",
404
+ // Returns array for multi-line: blank on line 1, bar label on line 2
405
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
406
+ formatter: (_, ctx) => {
407
+ var _a, _b;
408
+ return ["", String((_b = (_a = ctx.chart.data.labels) == null ? void 0 : _a[ctx.dataIndex]) != null ? _b : "")];
409
+ }
410
+ }
411
+ }
412
+ }
413
+ }
414
+ ]
415
+ };
416
+ }, [hasData, incomeVal, expenseVal, brandPrimary, brandSecondary]);
417
+ const options = (0, import_react3.useMemo)(() => ({
418
+ indexAxis: "y",
419
+ responsive: true,
420
+ maintainAspectRatio: false,
421
+ animation: { duration: 800, easing: "easeOutQuart" },
422
+ layout: {
423
+ // Right padding reserves space for the datalabels rendered outside the bar area
424
+ padding: { right: 180, left: 0, top: 10, bottom: 10 }
425
+ },
426
+ plugins: {
427
+ legend: { display: false },
428
+ tooltip: { enabled: false }
429
+ },
430
+ scales: {
431
+ y: {
432
+ display: true,
433
+ grid: { display: false },
434
+ border: { display: false },
435
+ ticks: { display: false }
436
+ },
437
+ x: {
438
+ display: true,
439
+ suggestedMax: maxVal * 1.3,
440
+ grid: { display: false },
441
+ border: { display: false },
442
+ ticks: { display: false }
443
+ }
444
+ }
445
+ }), [maxVal]);
446
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
447
+ Card,
448
+ {
449
+ className: cn("w-full py-4 sm:py-6 gap-2", className),
450
+ style: { maxWidth: width },
451
+ children: [
452
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardHeader, { className: "px-3 sm:px-6", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardTitle, { className: "text-sm sm:text-base", children: title }) }),
453
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardContent, { className: "px-3 sm:px-6", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
454
+ "div",
455
+ {
456
+ className: "flex items-center justify-center text-muted-foreground",
457
+ style: { height, width: "100%" },
458
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Spinner, { size: "lg" })
459
+ }
460
+ ) : !hasData ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Empty, { className: "flex-none p-4", style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyDescription, { children: "No data available" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { height, width: "100%", position: "relative" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
461
+ import_react_chartjs_2.Chart,
462
+ {
463
+ type: "bar",
464
+ data: chartData,
465
+ options,
466
+ plugins: [import_chartjs_plugin_datalabels.default],
467
+ "aria-label": title
468
+ },
469
+ `${brandPrimary}__${brandSecondary}`
470
+ ) }) })
471
+ ]
472
+ }
473
+ );
474
+ }
475
+ // Annotate the CommonJS export names for ESM import in node:
476
+ 0 && (module.exports = {
477
+ TransactionsIncomeExpenseBarChart
478
+ });
@@ -0,0 +1,16 @@
1
+ import {
2
+ TransactionsIncomeExpenseBarChart
3
+ } from "../../chunk-RN67642N.mjs";
4
+ import "../../chunk-BMFN37JH.mjs";
5
+ import "../../chunk-3EQP72AW.mjs";
6
+ import "../../chunk-YN5SYTOO.mjs";
7
+ import "../../chunk-SLWCCURD.mjs";
8
+ import "../../chunk-4AJ5HWHD.mjs";
9
+ import "../../chunk-DBHJ5KC3.mjs";
10
+ import "../../chunk-OXQQNQZI.mjs";
11
+ import "../../chunk-QOJ2DQD6.mjs";
12
+ import "../../chunk-V7CNWJT3.mjs";
13
+ import "../../chunk-FWCSY2DS.mjs";
14
+ export {
15
+ TransactionsIncomeExpenseBarChart
16
+ };