@wealthx/shadcn 0.0.1 → 1.0.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.
- package/.turbo/turbo-build.log +160 -0
- package/CHANGELOG.md +13 -0
- package/CHANGES.md +345 -0
- package/dist/chunk-2WZVSBAY.mjs +232 -0
- package/dist/chunk-2Y7YJKPE.mjs +47 -0
- package/dist/chunk-3U7SD3MS.mjs +55 -0
- package/dist/chunk-3VQNJ235.mjs +114 -0
- package/dist/chunk-55CEW76V.mjs +35 -0
- package/dist/chunk-6AFMNC42.mjs +146 -0
- package/dist/chunk-6OJF6XRN.mjs +117 -0
- package/dist/chunk-7LDIMXGM.mjs +181 -0
- package/dist/chunk-AMJ23O53.mjs +122 -0
- package/dist/chunk-BBJBJSXQ.mjs +44 -0
- package/dist/chunk-BGP2N52Z.mjs +126 -0
- package/dist/chunk-BMFN37JH.mjs +41 -0
- package/dist/chunk-CGOKTPXU.mjs +79 -0
- package/dist/chunk-CZ3BW5GL.mjs +81 -0
- package/dist/chunk-DBHJ5KC3.mjs +55 -0
- package/dist/chunk-DDPA2XXS.mjs +97 -0
- package/dist/chunk-DS2AMHN2.mjs +30 -0
- package/dist/chunk-E3K6O4FZ.mjs +57 -0
- package/dist/chunk-FWCSY2DS.mjs +37 -0
- package/dist/chunk-GPRJQ24C.mjs +28 -0
- package/dist/chunk-HS7TFG7V.mjs +24 -0
- package/dist/chunk-HUVTPUV2.mjs +256 -0
- package/dist/chunk-IAOOZCUY.mjs +90 -0
- package/dist/chunk-JF4PHPD5.mjs +111 -0
- package/dist/chunk-JU2RUWHF.mjs +123 -0
- package/dist/chunk-KKHTJNMM.mjs +86 -0
- package/dist/chunk-MJIEMGRD.mjs +266 -0
- package/dist/chunk-MKFL5MNH.mjs +372 -0
- package/dist/chunk-MQ72DIBH.mjs +105 -0
- package/dist/chunk-NGYG2EA6.mjs +148 -0
- package/dist/chunk-NWZ46DJL.mjs +213 -0
- package/dist/chunk-OXQQNQZI.mjs +75 -0
- package/dist/chunk-PMKODV6M.mjs +161 -0
- package/dist/chunk-QOJ2DQD6.mjs +57 -0
- package/dist/chunk-RL772EH7.mjs +126 -0
- package/dist/chunk-SLWCCURD.mjs +99 -0
- package/dist/chunk-V7CNWJT3.mjs +10 -0
- package/dist/chunk-VG6UF6UT.mjs +68 -0
- package/dist/chunk-VYMHBV6D.mjs +123 -0
- package/dist/chunk-VZ2NR7L3.mjs +195 -0
- package/dist/chunk-YN5SYTOO.mjs +117 -0
- package/dist/chunk-Z3MK2KKZ.mjs +83 -0
- package/dist/chunk-ZN2QKLF6.mjs +187 -0
- package/dist/chunk-ZZV5JVNW.mjs +34 -0
- package/dist/components/ui/accordion.js +142 -0
- package/dist/components/ui/accordion.mjs +14 -0
- package/dist/components/ui/alert-dialog.js +413 -0
- package/dist/components/ui/alert-dialog.mjs +34 -0
- package/dist/components/ui/alert.js +134 -0
- package/dist/components/ui/alert.mjs +12 -0
- package/dist/components/ui/avatar.js +173 -0
- package/dist/components/ui/avatar.mjs +18 -0
- package/dist/components/ui/badge.js +163 -0
- package/dist/components/ui/badge.mjs +11 -0
- package/dist/components/ui/button.js +198 -0
- package/dist/components/ui/button.mjs +11 -0
- package/dist/components/ui/calendar.js +408 -0
- package/dist/components/ui/calendar.mjs +12 -0
- package/dist/components/ui/card.js +156 -0
- package/dist/components/ui/card.mjs +20 -0
- package/dist/components/ui/checkbox.js +166 -0
- package/dist/components/ui/checkbox.mjs +11 -0
- package/dist/components/ui/chip.js +199 -0
- package/dist/components/ui/chip.mjs +10 -0
- package/dist/components/ui/data-table.js +925 -0
- package/dist/components/ui/data-table.mjs +29 -0
- package/dist/components/ui/date-picker.js +561 -0
- package/dist/components/ui/date-picker.mjs +15 -0
- package/dist/components/ui/dialog.js +378 -0
- package/dist/components/ui/dialog.mjs +30 -0
- package/dist/components/ui/drawer.js +213 -0
- package/dist/components/ui/drawer.mjs +28 -0
- package/dist/components/ui/dropdown-menu.js +338 -0
- package/dist/components/ui/dropdown-menu.mjs +38 -0
- package/dist/components/ui/empty.js +173 -0
- package/dist/components/ui/empty.mjs +18 -0
- package/dist/components/ui/field.js +359 -0
- package/dist/components/ui/field.mjs +28 -0
- package/dist/components/ui/input-group.js +406 -0
- package/dist/components/ui/input-group.mjs +22 -0
- package/dist/components/ui/input-otp.js +149 -0
- package/dist/components/ui/input-otp.mjs +14 -0
- package/dist/components/ui/input.js +81 -0
- package/dist/components/ui/input.mjs +8 -0
- package/dist/components/ui/label.js +85 -0
- package/dist/components/ui/label.mjs +8 -0
- package/dist/components/ui/pagination.js +333 -0
- package/dist/components/ui/pagination.mjs +22 -0
- package/dist/components/ui/popover.js +167 -0
- package/dist/components/ui/popover.mjs +22 -0
- package/dist/components/ui/progress.js +97 -0
- package/dist/components/ui/progress.mjs +8 -0
- package/dist/components/ui/radio-group.js +178 -0
- package/dist/components/ui/radio-group.mjs +12 -0
- package/dist/components/ui/select.js +262 -0
- package/dist/components/ui/select.mjs +28 -0
- package/dist/components/ui/separator.js +86 -0
- package/dist/components/ui/separator.mjs +8 -0
- package/dist/components/ui/sheet.js +227 -0
- package/dist/components/ui/sheet.mjs +26 -0
- package/dist/components/ui/skeleton.js +75 -0
- package/dist/components/ui/skeleton.mjs +8 -0
- package/dist/components/ui/sonner.js +86 -0
- package/dist/components/ui/sonner.mjs +7 -0
- package/dist/components/ui/spinner.js +93 -0
- package/dist/components/ui/spinner.mjs +10 -0
- package/dist/components/ui/switch.js +178 -0
- package/dist/components/ui/switch.mjs +11 -0
- package/dist/components/ui/table.js +184 -0
- package/dist/components/ui/table.mjs +22 -0
- package/dist/components/ui/tabs.js +181 -0
- package/dist/components/ui/tabs.mjs +16 -0
- package/dist/components/ui/textarea.js +79 -0
- package/dist/components/ui/textarea.mjs +8 -0
- package/dist/components/ui/toggle-group.js +184 -0
- package/dist/components/ui/toggle-group.mjs +12 -0
- package/dist/components/ui/toggle.js +108 -0
- package/dist/components/ui/toggle.mjs +11 -0
- package/dist/components/ui/tooltip.js +140 -0
- package/dist/components/ui/tooltip.mjs +16 -0
- package/dist/index.js +4409 -0
- package/dist/index.mjs +462 -0
- package/dist/lib/colors.js +84 -0
- package/dist/lib/colors.mjs +13 -0
- package/dist/lib/theme-provider.js +150 -0
- package/dist/lib/theme-provider.mjs +13 -0
- package/dist/lib/typography.js +157 -0
- package/dist/lib/typography.mjs +25 -0
- package/dist/lib/utils.js +34 -0
- package/dist/lib/utils.mjs +7 -0
- package/dist/styles.css +2 -0
- package/package.json +228 -11
- package/scripts/build-css.ts +15 -9
- package/src/components/index.tsx +443 -0
- package/src/components/ui/accordion.tsx +99 -0
- package/src/components/ui/alert-dialog.tsx +239 -0
- package/src/components/ui/alert.tsx +81 -0
- package/src/components/ui/avatar.tsx +130 -0
- package/src/components/ui/badge.tsx +57 -0
- package/src/components/ui/button.tsx +69 -37
- package/src/components/ui/calendar.tsx +252 -0
- package/src/components/ui/card.tsx +106 -0
- package/src/components/ui/checkbox.tsx +111 -0
- package/src/components/ui/chip.tsx +65 -0
- package/src/components/ui/data-table.tsx +490 -0
- package/src/components/ui/date-picker.tsx +133 -0
- package/src/components/ui/dialog.tsx +195 -0
- package/src/components/ui/drawer.tsx +169 -0
- package/src/components/ui/dropdown-menu.tsx +315 -0
- package/src/components/ui/empty.tsx +128 -0
- package/src/components/ui/field.tsx +273 -0
- package/src/components/ui/input-group.tsx +190 -0
- package/src/components/ui/input-otp.tsx +90 -0
- package/src/components/ui/input.tsx +28 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/pagination.tsx +148 -0
- package/src/components/ui/popover.tsx +112 -0
- package/src/components/ui/progress.tsx +40 -0
- package/src/components/ui/radio-group.tsx +129 -0
- package/src/components/ui/select.tsx +201 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +182 -0
- package/src/components/ui/skeleton.tsx +22 -0
- package/src/components/ui/sonner.tsx +48 -0
- package/src/components/ui/spinner.tsx +41 -0
- package/src/components/ui/switch.tsx +126 -0
- package/src/components/ui/table.tsx +143 -0
- package/src/components/ui/tabs.tsx +119 -0
- package/src/components/ui/textarea.tsx +28 -0
- package/src/components/ui/toggle-group.tsx +94 -0
- package/src/components/ui/toggle.tsx +59 -0
- package/src/components/ui/tooltip.tsx +80 -0
- package/src/index.ts +15 -3
- package/src/lib/colors.ts +74 -0
- package/src/lib/slot.tsx +68 -0
- package/src/lib/theme-provider.tsx +134 -0
- package/src/lib/typography.ts +153 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/globals.css +377 -107
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +48 -2
- package/src/provider/ShadcnProvider.tsx +0 -89
- package/src/provider/index.ts +0 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
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 __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
|
|
50
|
+
// src/components/ui/checkbox.tsx
|
|
51
|
+
var checkbox_exports = {};
|
|
52
|
+
__export(checkbox_exports, {
|
|
53
|
+
Checkbox: () => Checkbox,
|
|
54
|
+
CheckboxCard: () => CheckboxCard
|
|
55
|
+
});
|
|
56
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
57
|
+
var import_react = require("react");
|
|
58
|
+
var import_lucide_react = require("lucide-react");
|
|
59
|
+
var import_checkbox = require("@base-ui/react/checkbox");
|
|
60
|
+
|
|
61
|
+
// src/lib/utils.ts
|
|
62
|
+
var import_clsx = require("clsx");
|
|
63
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
64
|
+
function cn(...inputs) {
|
|
65
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/components/ui/checkbox.tsx
|
|
69
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
70
|
+
function Checkbox(_a) {
|
|
71
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_checkbox.Checkbox.Root,
|
|
74
|
+
__spreadProps(__spreadValues({
|
|
75
|
+
className: cn(
|
|
76
|
+
"peer group inline-flex size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-all outline-none",
|
|
77
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
78
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
79
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
80
|
+
"data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground",
|
|
81
|
+
"data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground",
|
|
82
|
+
// Dark mode (upstream shadcn)
|
|
83
|
+
"dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary",
|
|
84
|
+
// Stacked (2 attr selectors) → wins over single-attr rules above
|
|
85
|
+
"aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-checked:text-destructive-foreground",
|
|
86
|
+
"aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive aria-invalid:data-indeterminate:text-destructive-foreground",
|
|
87
|
+
className
|
|
88
|
+
),
|
|
89
|
+
"data-slot": "checkbox"
|
|
90
|
+
}, props), {
|
|
91
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
92
|
+
import_checkbox.Checkbox.Indicator,
|
|
93
|
+
{
|
|
94
|
+
className: "grid place-content-center text-current transition-none",
|
|
95
|
+
"data-slot": "checkbox-indicator",
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckIcon, { className: "size-3.5 group-data-indeterminate:hidden" }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MinusIcon, { className: "size-3.5 hidden group-data-indeterminate:block" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function CheckboxCard(_a) {
|
|
106
|
+
var _b = _a, {
|
|
107
|
+
className,
|
|
108
|
+
checked,
|
|
109
|
+
defaultChecked,
|
|
110
|
+
onCheckedChange,
|
|
111
|
+
disabled,
|
|
112
|
+
error,
|
|
113
|
+
label,
|
|
114
|
+
description
|
|
115
|
+
} = _b, props = __objRest(_b, [
|
|
116
|
+
"className",
|
|
117
|
+
"checked",
|
|
118
|
+
"defaultChecked",
|
|
119
|
+
"onCheckedChange",
|
|
120
|
+
"disabled",
|
|
121
|
+
"error",
|
|
122
|
+
"label",
|
|
123
|
+
"description"
|
|
124
|
+
]);
|
|
125
|
+
const [internalChecked, setInternalChecked] = (0, import_react.useState)(
|
|
126
|
+
Boolean(defaultChecked)
|
|
127
|
+
);
|
|
128
|
+
const resolvedChecked = checked != null ? checked : internalChecked;
|
|
129
|
+
const isTinted = resolvedChecked;
|
|
130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
131
|
+
"label",
|
|
132
|
+
{
|
|
133
|
+
className: cn(
|
|
134
|
+
"flex items-start gap-3 border border-border p-4 font-sans transition-colors cursor-pointer",
|
|
135
|
+
error ? ["border-destructive", isTinted && "bg-destructive/5"] : isTinted && "border-primary bg-primary/5",
|
|
136
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
137
|
+
className
|
|
138
|
+
),
|
|
139
|
+
"data-slot": "checkbox-card",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
Checkbox,
|
|
143
|
+
__spreadValues({
|
|
144
|
+
"aria-invalid": error || void 0,
|
|
145
|
+
checked: resolvedChecked,
|
|
146
|
+
className: "mt-0.5",
|
|
147
|
+
disabled,
|
|
148
|
+
onCheckedChange: (value, event) => {
|
|
149
|
+
setInternalChecked(value);
|
|
150
|
+
onCheckedChange == null ? void 0 : onCheckedChange(value, event);
|
|
151
|
+
}
|
|
152
|
+
}, props)
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm font-medium leading-none", children: label }),
|
|
156
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
157
|
+
] })
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
163
|
+
0 && (module.exports = {
|
|
164
|
+
Checkbox,
|
|
165
|
+
CheckboxCard
|
|
166
|
+
});
|
|
@@ -0,0 +1,199 @@
|
|
|
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/chip.tsx
|
|
60
|
+
var chip_exports = {};
|
|
61
|
+
__export(chip_exports, {
|
|
62
|
+
Chip: () => Chip
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(chip_exports);
|
|
65
|
+
var import_lucide_react = require("lucide-react");
|
|
66
|
+
|
|
67
|
+
// src/lib/utils.ts
|
|
68
|
+
var import_clsx = require("clsx");
|
|
69
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
70
|
+
function cn(...inputs) {
|
|
71
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/components/ui/badge.tsx
|
|
75
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
76
|
+
|
|
77
|
+
// src/lib/slot.tsx
|
|
78
|
+
var React = __toESM(require("react"));
|
|
79
|
+
function mergeRefs(...refs) {
|
|
80
|
+
return (value) => {
|
|
81
|
+
for (const ref of refs) {
|
|
82
|
+
if (typeof ref === "function") ref(value);
|
|
83
|
+
else if (ref !== null)
|
|
84
|
+
ref.current = value;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var Slot = React.forwardRef(
|
|
89
|
+
(_a, forwardedRef) => {
|
|
90
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
91
|
+
const child = React.Children.only(children);
|
|
92
|
+
if (!React.isValidElement(child)) return null;
|
|
93
|
+
const childProps = child.props;
|
|
94
|
+
const merged = __spreadValues({}, props);
|
|
95
|
+
for (const key of Object.keys(childProps)) {
|
|
96
|
+
if (key === "className") {
|
|
97
|
+
merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
|
|
98
|
+
} else if (key === "style") {
|
|
99
|
+
merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
|
|
100
|
+
} else if (key.startsWith("on") && typeof childProps[key] === "function") {
|
|
101
|
+
const parentHandler = props[key];
|
|
102
|
+
if (typeof parentHandler === "function") {
|
|
103
|
+
merged[key] = (...args) => {
|
|
104
|
+
childProps[key](...args);
|
|
105
|
+
parentHandler(...args);
|
|
106
|
+
};
|
|
107
|
+
} else {
|
|
108
|
+
merged[key] = childProps[key];
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
merged[key] = childProps[key];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const childRef = child.ref;
|
|
115
|
+
merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
|
|
116
|
+
return React.cloneElement(
|
|
117
|
+
child,
|
|
118
|
+
merged
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
Slot.displayName = "Slot";
|
|
123
|
+
|
|
124
|
+
// src/components/ui/badge.tsx
|
|
125
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
126
|
+
var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
127
|
+
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium font-sans whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
128
|
+
{
|
|
129
|
+
variants: {
|
|
130
|
+
variant: {
|
|
131
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
132
|
+
secondary: "bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
133
|
+
destructive: "bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
134
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
135
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
136
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
variant: "default"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
// src/components/ui/chip.tsx
|
|
146
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
147
|
+
function Chip(_a) {
|
|
148
|
+
var _b = _a, {
|
|
149
|
+
className,
|
|
150
|
+
variant = "secondary",
|
|
151
|
+
onRemove,
|
|
152
|
+
disabled,
|
|
153
|
+
children
|
|
154
|
+
} = _b, props = __objRest(_b, [
|
|
155
|
+
"className",
|
|
156
|
+
"variant",
|
|
157
|
+
"onRemove",
|
|
158
|
+
"disabled",
|
|
159
|
+
"children"
|
|
160
|
+
]);
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
162
|
+
"span",
|
|
163
|
+
__spreadProps(__spreadValues({
|
|
164
|
+
"aria-disabled": disabled,
|
|
165
|
+
className: cn(
|
|
166
|
+
badgeVariants({ variant }),
|
|
167
|
+
// extra right padding only when dismiss button is present
|
|
168
|
+
onRemove && "pr-1",
|
|
169
|
+
disabled && "pointer-events-none opacity-50",
|
|
170
|
+
className
|
|
171
|
+
),
|
|
172
|
+
"data-slot": "chip",
|
|
173
|
+
"data-variant": variant
|
|
174
|
+
}, props), {
|
|
175
|
+
children: [
|
|
176
|
+
children,
|
|
177
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
178
|
+
"button",
|
|
179
|
+
{
|
|
180
|
+
"aria-label": "Remove",
|
|
181
|
+
className: "ml-0.5 inline-flex shrink-0 items-center justify-center rounded-full p-0.5 opacity-60 hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none",
|
|
182
|
+
"data-slot": "chip-remove",
|
|
183
|
+
disabled,
|
|
184
|
+
onClick: (e) => {
|
|
185
|
+
e.stopPropagation();
|
|
186
|
+
onRemove();
|
|
187
|
+
},
|
|
188
|
+
type: "button",
|
|
189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.X, { className: "size-3" })
|
|
190
|
+
}
|
|
191
|
+
) : null
|
|
192
|
+
]
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
197
|
+
0 && (module.exports = {
|
|
198
|
+
Chip
|
|
199
|
+
});
|