@wealthx/shadcn 1.2.1 → 1.2.2
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 +76 -67
- package/CHANGELOG.md +7 -0
- package/dist/{chunk-4CX4SBRO.mjs → chunk-A6AAWBPF.mjs} +1 -1
- package/dist/{chunk-WOEHFRGB.mjs → chunk-BDYZCBRT.mjs} +4 -4
- package/dist/{chunk-PMB3A7V3.mjs → chunk-EI5F6FMT.mjs} +1 -1
- package/dist/{chunk-CSDO6VBW.mjs → chunk-LBMRIB3G.mjs} +10 -10
- package/dist/{chunk-PG6K5XEC.mjs → chunk-S4QRUQNW.mjs} +1 -1
- package/dist/chunk-U4NDAF2P.mjs +207 -0
- package/dist/{chunk-DOH3EHX7.mjs → chunk-U5X52X37.mjs} +1 -1
- package/dist/{chunk-WA6O6EUR.mjs → chunk-URGMJAE3.mjs} +9 -9
- package/dist/{chunk-ZRO5JO3H.mjs → chunk-UT4KJR7V.mjs} +48 -12
- package/dist/{chunk-SYOD63OZ.mjs → chunk-VGSESELX.mjs} +2 -2
- package/dist/chunk-ZRSDX6OW.mjs +385 -0
- package/dist/chunk-ZSHYDDRB.mjs +249 -0
- package/dist/components/ui/add-column-modal.mjs +3 -3
- package/dist/components/ui/add-lead-modal.mjs +2 -2
- package/dist/components/ui/color-picker.js +417 -0
- package/dist/components/ui/color-picker.mjs +22 -0
- package/dist/components/ui/data-table.js +44 -12
- package/dist/components/ui/data-table.mjs +1 -1
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/form-primitives.js +4 -4
- package/dist/components/ui/form-primitives.mjs +3 -3
- package/dist/components/ui/opportunity-edit-modals.js +4 -4
- package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
- package/dist/components/ui/opportunity-summary-tab.js +4 -4
- package/dist/components/ui/opportunity-summary-tab.mjs +9 -9
- package/dist/components/ui/pipeline-board.js +4 -4
- package/dist/components/ui/pipeline-board.mjs +3 -3
- package/dist/components/ui/pipeline-dialogs.js +4 -4
- package/dist/components/ui/pipeline-dialogs.mjs +5 -5
- package/dist/components/ui/sidebar-nav.js +540 -0
- package/dist/components/ui/sidebar-nav.mjs +11 -0
- package/dist/components/ui/stepper.js +283 -0
- package/dist/components/ui/stepper.mjs +18 -0
- package/dist/components/ui/toggle-group.js +4 -4
- package/dist/components/ui/toggle-group.mjs +2 -2
- package/dist/components/ui/toggle.js +4 -4
- package/dist/components/ui/toggle.mjs +1 -1
- package/dist/index.js +2141 -1292
- package/dist/index.mjs +103 -71
- package/dist/lib/typography.js +10 -10
- package/dist/lib/typography.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +16 -1
- package/src/components/index.tsx +41 -0
- package/src/components/ui/color-picker.tsx +307 -0
- package/src/components/ui/data-table.tsx +91 -11
- package/src/components/ui/sidebar-nav.tsx +517 -0
- package/src/components/ui/stepper.tsx +347 -0
- package/src/components/ui/toggle.tsx +4 -4
- package/src/lib/typography.ts +11 -11
- package/src/styles/globals.css +19 -19
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +3 -0
- package/dist/{chunk-KUDCQ4FI.mjs → chunk-5MEWU56Z.mjs} +3 -3
- package/dist/{chunk-PR6V5XKM.mjs → chunk-CGH4DRNG.mjs} +3 -3
- package/dist/{chunk-3WMX6KWS.mjs → chunk-Y4QFWRNR.mjs} +8 -8
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-VLQZANBF.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/ui/stepper.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Check } from "lucide-react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var StepperContext = React.createContext({
|
|
10
|
+
activeStep: 0,
|
|
11
|
+
orientation: "horizontal",
|
|
12
|
+
totalSteps: 0
|
|
13
|
+
});
|
|
14
|
+
var StepContext = React.createContext({
|
|
15
|
+
index: 0,
|
|
16
|
+
isActive: false,
|
|
17
|
+
isCompleted: false,
|
|
18
|
+
isFirst: true,
|
|
19
|
+
isLast: false
|
|
20
|
+
});
|
|
21
|
+
function Stepper({
|
|
22
|
+
activeStep = 0,
|
|
23
|
+
orientation = "horizontal",
|
|
24
|
+
className,
|
|
25
|
+
children
|
|
26
|
+
}) {
|
|
27
|
+
const totalSteps = React.Children.count(children);
|
|
28
|
+
return /* @__PURE__ */ jsx(StepperContext.Provider, { value: { activeStep, orientation, totalSteps }, children: /* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "stepper",
|
|
32
|
+
className: cn(
|
|
33
|
+
"font-sans",
|
|
34
|
+
orientation === "horizontal" ? "flex w-full items-start" : "flex flex-col",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
children: React.Children.map(
|
|
38
|
+
children,
|
|
39
|
+
(step, index) => React.isValidElement(step) ? React.cloneElement(
|
|
40
|
+
step,
|
|
41
|
+
{ _index: index }
|
|
42
|
+
) : step
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
function Step({ _index = 0, error, className, children }) {
|
|
48
|
+
const { activeStep, orientation, totalSteps } = React.useContext(StepperContext);
|
|
49
|
+
const isActive = _index === activeStep;
|
|
50
|
+
const isCompleted = _index < activeStep;
|
|
51
|
+
const isFirst = _index === 0;
|
|
52
|
+
const isLast = _index === totalSteps - 1;
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
StepContext.Provider,
|
|
55
|
+
{
|
|
56
|
+
value: { index: _index, isActive, isCompleted, isFirst, isLast },
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "step",
|
|
61
|
+
"aria-current": isActive ? "step" : void 0,
|
|
62
|
+
"data-active": isActive || void 0,
|
|
63
|
+
"data-completed": isCompleted || void 0,
|
|
64
|
+
"data-error": error || void 0,
|
|
65
|
+
className: cn(
|
|
66
|
+
orientation === "horizontal" ? "flex flex-1 flex-col items-center" : "flex flex-row gap-3",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
children
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function StepIndicator({ error, className }) {
|
|
76
|
+
const { orientation } = React.useContext(StepperContext);
|
|
77
|
+
const { index, isActive, isCompleted, isFirst, isLast } = React.useContext(StepContext);
|
|
78
|
+
const filled = isActive || isCompleted;
|
|
79
|
+
const circle = /* @__PURE__ */ jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: cn(
|
|
83
|
+
"relative z-10 flex size-8 shrink-0 items-center justify-center rounded-full text-sm font-medium transition-colors",
|
|
84
|
+
!filled && !error && "border-2 border-border bg-background text-muted-foreground",
|
|
85
|
+
isActive && !error && "border-2 border-primary bg-primary text-primary-foreground",
|
|
86
|
+
isCompleted && !error && "bg-primary text-primary-foreground",
|
|
87
|
+
error && "border-2 border-destructive bg-destructive text-destructive-foreground"
|
|
88
|
+
),
|
|
89
|
+
children: isCompleted && !error ? /* @__PURE__ */ jsx(Check, { className: "size-4", strokeWidth: 2.5 }) : /* @__PURE__ */ jsx("span", { children: index + 1 })
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
if (orientation === "horizontal") {
|
|
93
|
+
return /* @__PURE__ */ jsxs(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "step-indicator",
|
|
97
|
+
className: cn("flex w-full items-center", className),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: cn(
|
|
103
|
+
"h-[2px] flex-1 transition-colors",
|
|
104
|
+
isFirst ? "bg-transparent" : isActive || isCompleted ? "bg-primary" : "bg-border"
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
circle,
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: cn(
|
|
113
|
+
"h-[2px] flex-1 transition-colors",
|
|
114
|
+
isLast ? "bg-transparent" : isCompleted ? "bg-primary" : "bg-border"
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return /* @__PURE__ */ jsxs(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "step-indicator",
|
|
126
|
+
className: cn("flex w-8 shrink-0 flex-col items-center", className),
|
|
127
|
+
children: [
|
|
128
|
+
circle,
|
|
129
|
+
!isLast && /* @__PURE__ */ jsx(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "step-connector",
|
|
133
|
+
className: cn(
|
|
134
|
+
"mt-1 w-[2px] flex-1 transition-colors",
|
|
135
|
+
isActive || isCompleted ? "bg-primary" : "bg-border"
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function StepLabel({
|
|
144
|
+
children,
|
|
145
|
+
description,
|
|
146
|
+
error,
|
|
147
|
+
className
|
|
148
|
+
}) {
|
|
149
|
+
const { orientation } = React.useContext(StepperContext);
|
|
150
|
+
const { isActive, isCompleted, isLast } = React.useContext(StepContext);
|
|
151
|
+
const subtext = typeof error === "string" ? error : description;
|
|
152
|
+
return /* @__PURE__ */ jsxs(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
"data-slot": "step-label",
|
|
156
|
+
className: cn(
|
|
157
|
+
"flex flex-col",
|
|
158
|
+
orientation === "horizontal" ? "mt-2 items-center text-center" : cn("flex-1", !isLast && "pb-5"),
|
|
159
|
+
className
|
|
160
|
+
),
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
className: cn(
|
|
166
|
+
"text-sm font-medium leading-tight transition-colors",
|
|
167
|
+
(isActive || isCompleted) && !error && "text-foreground",
|
|
168
|
+
!isActive && !isCompleted && !error && "text-muted-foreground",
|
|
169
|
+
error && "text-destructive"
|
|
170
|
+
),
|
|
171
|
+
children
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
subtext && /* @__PURE__ */ jsx(
|
|
175
|
+
"span",
|
|
176
|
+
{
|
|
177
|
+
className: cn(
|
|
178
|
+
"mt-0.5 text-xs",
|
|
179
|
+
error ? "text-destructive" : "text-muted-foreground"
|
|
180
|
+
),
|
|
181
|
+
children: subtext
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function StepContent({ className, children }) {
|
|
189
|
+
const { isActive } = React.useContext(StepContext);
|
|
190
|
+
if (!isActive) return null;
|
|
191
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "step-content", className: cn("pb-4 pt-2", className), children });
|
|
192
|
+
}
|
|
193
|
+
function StepItem({ label, description, error }) {
|
|
194
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
195
|
+
/* @__PURE__ */ jsx(StepIndicator, { error: !!error }),
|
|
196
|
+
/* @__PURE__ */ jsx(StepLabel, { description, error, children: label })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export {
|
|
201
|
+
Stepper,
|
|
202
|
+
Step,
|
|
203
|
+
StepIndicator,
|
|
204
|
+
StepLabel,
|
|
205
|
+
StepContent,
|
|
206
|
+
StepItem
|
|
207
|
+
};
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
AddressAutocomplete,
|
|
7
7
|
CurrencyInputWithSlider,
|
|
8
8
|
OwnershipSplit
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-U5X52X37.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Slider
|
|
12
12
|
} from "./chunk-Y6DWJSKZ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ToggleGroup,
|
|
15
15
|
ToggleGroupItem
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EI5F6FMT.mjs";
|
|
17
17
|
import {
|
|
18
18
|
DatePicker
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5MEWU56Z.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Textarea
|
|
22
22
|
} from "./chunk-34NWQURD.mjs";
|
|
@@ -25,6 +25,9 @@ import {
|
|
|
25
25
|
AccordionContent,
|
|
26
26
|
AccordionItem
|
|
27
27
|
} from "./chunk-MARPPFOJ.mjs";
|
|
28
|
+
import {
|
|
29
|
+
Label
|
|
30
|
+
} from "./chunk-NSLMILBT.mjs";
|
|
28
31
|
import {
|
|
29
32
|
Select,
|
|
30
33
|
SelectContent,
|
|
@@ -32,15 +35,9 @@ import {
|
|
|
32
35
|
SelectTrigger,
|
|
33
36
|
SelectValue
|
|
34
37
|
} from "./chunk-7PYJD5JI.mjs";
|
|
35
|
-
import {
|
|
36
|
-
Label
|
|
37
|
-
} from "./chunk-NSLMILBT.mjs";
|
|
38
38
|
import {
|
|
39
39
|
Checkbox
|
|
40
40
|
} from "./chunk-RGVKLTLH.mjs";
|
|
41
|
-
import {
|
|
42
|
-
Input
|
|
43
|
-
} from "./chunk-GYMYRIZP.mjs";
|
|
44
41
|
import {
|
|
45
42
|
Dialog,
|
|
46
43
|
DialogContent,
|
|
@@ -48,6 +45,9 @@ import {
|
|
|
48
45
|
DialogHeader,
|
|
49
46
|
DialogTitle
|
|
50
47
|
} from "./chunk-XIRTEFKH.mjs";
|
|
48
|
+
import {
|
|
49
|
+
Input
|
|
50
|
+
} from "./chunk-GYMYRIZP.mjs";
|
|
51
51
|
import {
|
|
52
52
|
Button
|
|
53
53
|
} from "./chunk-2I5S2AMY.mjs";
|
|
@@ -37,6 +37,10 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
cn
|
|
39
39
|
} from "./chunk-VLQZANBF.mjs";
|
|
40
|
+
import {
|
|
41
|
+
__spreadProps,
|
|
42
|
+
__spreadValues
|
|
43
|
+
} from "./chunk-FWCSY2DS.mjs";
|
|
40
44
|
|
|
41
45
|
// src/components/ui/data-table.tsx
|
|
42
46
|
import * as React from "react";
|
|
@@ -317,41 +321,73 @@ function DataTable({
|
|
|
317
321
|
onRowSelectionChange,
|
|
318
322
|
className,
|
|
319
323
|
toolbar,
|
|
320
|
-
emptyText = "No results."
|
|
324
|
+
emptyText = "No results.",
|
|
325
|
+
manualPagination = false,
|
|
326
|
+
manualSorting = false,
|
|
327
|
+
manualFiltering = false,
|
|
328
|
+
pageCount,
|
|
329
|
+
rowCount,
|
|
330
|
+
sorting: controlledSorting,
|
|
331
|
+
pagination: controlledPagination,
|
|
332
|
+
columnFilters: controlledColumnFilters,
|
|
333
|
+
onSortingChange: onSortingChangeProp,
|
|
334
|
+
onPaginationChange: onPaginationChangeProp,
|
|
335
|
+
onColumnFiltersChange: onColumnFiltersChangeProp
|
|
321
336
|
}) {
|
|
322
|
-
|
|
323
|
-
const [
|
|
337
|
+
var _a;
|
|
338
|
+
const [internalSorting, setInternalSorting] = React.useState(
|
|
324
339
|
[]
|
|
325
340
|
);
|
|
341
|
+
const [internalColumnFilters, setInternalColumnFilters] = React.useState([]);
|
|
342
|
+
const [internalPagination, setInternalPagination] = React.useState({
|
|
343
|
+
pageIndex: 0,
|
|
344
|
+
pageSize: (_a = pageSizeOptions[0]) != null ? _a : 10
|
|
345
|
+
});
|
|
326
346
|
const [columnVisibility, setColumnVisibility] = React.useState({});
|
|
327
347
|
const [rowSelection, setRowSelection] = React.useState({});
|
|
348
|
+
const sorting = controlledSorting != null ? controlledSorting : internalSorting;
|
|
349
|
+
const columnFilters = controlledColumnFilters != null ? controlledColumnFilters : internalColumnFilters;
|
|
350
|
+
const pagination = controlledPagination != null ? controlledPagination : internalPagination;
|
|
328
351
|
const resolvedColumns = React.useMemo(() => {
|
|
329
352
|
if (!enableRowSelection) return userColumns;
|
|
330
353
|
return [getSelectionColumn(), ...userColumns];
|
|
331
354
|
}, [userColumns, enableRowSelection]);
|
|
332
|
-
const table = useReactTable({
|
|
355
|
+
const table = useReactTable(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
333
356
|
data,
|
|
334
357
|
columns: resolvedColumns,
|
|
335
358
|
state: {
|
|
336
359
|
sorting,
|
|
337
360
|
columnFilters,
|
|
338
361
|
columnVisibility,
|
|
339
|
-
rowSelection
|
|
362
|
+
rowSelection,
|
|
363
|
+
pagination
|
|
364
|
+
},
|
|
365
|
+
onSortingChange: (updater) => {
|
|
366
|
+
const next = typeof updater === "function" ? updater(sorting) : updater;
|
|
367
|
+
if (controlledSorting === void 0) setInternalSorting(next);
|
|
368
|
+
onSortingChangeProp == null ? void 0 : onSortingChangeProp(next);
|
|
369
|
+
},
|
|
370
|
+
onColumnFiltersChange: (updater) => {
|
|
371
|
+
const next = typeof updater === "function" ? updater(columnFilters) : updater;
|
|
372
|
+
if (controlledColumnFilters === void 0)
|
|
373
|
+
setInternalColumnFilters(next);
|
|
374
|
+
onColumnFiltersChangeProp == null ? void 0 : onColumnFiltersChangeProp(next);
|
|
375
|
+
},
|
|
376
|
+
onPaginationChange: (updater) => {
|
|
377
|
+
const next = typeof updater === "function" ? updater(pagination) : updater;
|
|
378
|
+
if (controlledPagination === void 0) setInternalPagination(next);
|
|
379
|
+
onPaginationChangeProp == null ? void 0 : onPaginationChangeProp(next);
|
|
340
380
|
},
|
|
341
|
-
onSortingChange: setSorting,
|
|
342
|
-
onColumnFiltersChange: setColumnFilters,
|
|
343
381
|
onColumnVisibilityChange: setColumnVisibility,
|
|
344
382
|
onRowSelectionChange: (updater) => {
|
|
345
383
|
const next = typeof updater === "function" ? updater(rowSelection) : updater;
|
|
346
384
|
setRowSelection(next);
|
|
347
385
|
onRowSelectionChange == null ? void 0 : onRowSelectionChange(next);
|
|
348
386
|
},
|
|
349
|
-
getCoreRowModel: getCoreRowModel()
|
|
350
|
-
|
|
351
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
352
|
-
getSortedRowModel: getSortedRowModel(),
|
|
387
|
+
getCoreRowModel: getCoreRowModel()
|
|
388
|
+
}, manualFiltering ? { manualFiltering: true } : { getFilteredRowModel: getFilteredRowModel() }), manualPagination ? { manualPagination: true } : { getPaginationRowModel: getPaginationRowModel() }), manualSorting ? { manualSorting: true } : { getSortedRowModel: getSortedRowModel() }), pageCount !== void 0 && { pageCount }), rowCount !== void 0 && { rowCount }), {
|
|
353
389
|
enableRowSelection
|
|
354
|
-
});
|
|
390
|
+
}));
|
|
355
391
|
function renderTableBody() {
|
|
356
392
|
if (loading) {
|
|
357
393
|
return /* @__PURE__ */ jsx(
|