create-disposabl-app 0.10.0 → 0.10.1

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 (70) hide show
  1. package/dist/disposabl.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
  4. package/dist/templates/default/bun.lock +16 -1230
  5. package/dist/templates/default/packages/cli/README.md +9 -24
  6. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
  7. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
  8. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +71 -13
  9. package/dist/templates/default/packages/disposabl-kit/package.json +0 -12
  10. package/package.json +1 -1
  11. package/dist/templates/default/apps/web/src/components/connections/expo-connection.tsx +0 -97
  12. package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +0 -44
  13. package/dist/templates/default/apps/web/src/components/connections/use-connection-setup.ts +0 -169
  14. package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +0 -77
  15. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +0 -185
  16. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +0 -75
  17. package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +0 -22
  18. package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +0 -207
  19. package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +0 -106
  20. package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +0 -51
  21. package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +0 -121
  22. package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +0 -127
  23. package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +0 -87
  24. package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +0 -241
  25. package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +0 -239
  26. package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +0 -368
  27. package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +0 -27
  28. package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +0 -243
  29. package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +0 -19
  30. package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +0 -300
  31. package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +0 -194
  32. package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +0 -271
  33. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +0 -156
  34. package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +0 -4
  35. package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +0 -224
  36. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +0 -269
  37. package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +0 -103
  38. package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +0 -50
  39. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +0 -158
  40. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +0 -83
  41. package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +0 -201
  42. package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +0 -26
  43. package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +0 -70
  44. package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +0 -284
  45. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +0 -128
  46. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +0 -91
  47. package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +0 -64
  48. package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +0 -170
  49. package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +0 -133
  50. package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +0 -87
  51. package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +0 -82
  52. package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +0 -330
  53. package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +0 -35
  54. package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +0 -49
  55. package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +0 -51
  56. package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +0 -201
  57. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +0 -132
  58. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +0 -723
  59. package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +0 -13
  60. package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +0 -51
  61. package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +0 -31
  62. package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +0 -113
  63. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +0 -81
  64. package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +0 -17
  65. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +0 -229
  66. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +0 -87
  67. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +0 -42
  68. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +0 -65
  69. package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +0 -161
  70. package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +0 -21
@@ -1,239 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
3
- import useEmblaCarousel, {
4
- type UseEmblaCarouselType,
5
- } from "embla-carousel-react";
6
-
7
- import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
8
- import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
9
-
10
- type CarouselApi = UseEmblaCarouselType[1];
11
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
12
- type CarouselOptions = UseCarouselParameters[0];
13
- type CarouselPlugin = UseCarouselParameters[1];
14
-
15
- type CarouselProps = {
16
- opts?: CarouselOptions;
17
- plugins?: CarouselPlugin;
18
- orientation?: "horizontal" | "vertical";
19
- setApi?: (api: CarouselApi) => void;
20
- };
21
-
22
- type CarouselContextProps = {
23
- carouselRef: ReturnType<typeof useEmblaCarousel>[0];
24
- api: ReturnType<typeof useEmblaCarousel>[1];
25
- scrollPrev: () => void;
26
- scrollNext: () => void;
27
- canScrollPrev: boolean;
28
- canScrollNext: boolean;
29
- } & CarouselProps;
30
-
31
- const CarouselContext = React.createContext<CarouselContextProps | null>(null);
32
-
33
- function useCarousel() {
34
- const context = React.useContext(CarouselContext);
35
-
36
- if (!context) {
37
- throw new Error("useCarousel must be used within a <Carousel />");
38
- }
39
-
40
- return context;
41
- }
42
-
43
- function Carousel({
44
- orientation = "horizontal",
45
- opts,
46
- setApi,
47
- plugins,
48
- className,
49
- children,
50
- ...props
51
- }: React.ComponentProps<"div"> & CarouselProps) {
52
- const [carouselRef, api] = useEmblaCarousel(
53
- {
54
- ...opts,
55
- axis: orientation === "horizontal" ? "x" : "y",
56
- },
57
- plugins,
58
- );
59
- const [canScrollPrev, setCanScrollPrev] = React.useState(false);
60
- const [canScrollNext, setCanScrollNext] = React.useState(false);
61
-
62
- const onSelect = React.useCallback((carouselApi: CarouselApi) => {
63
- if (!carouselApi) return;
64
- setCanScrollPrev(carouselApi.canScrollPrev());
65
- setCanScrollNext(carouselApi.canScrollNext());
66
- }, []);
67
-
68
- const scrollPrev = React.useCallback(() => {
69
- api?.scrollPrev();
70
- }, [api]);
71
-
72
- const scrollNext = React.useCallback(() => {
73
- api?.scrollNext();
74
- }, [api]);
75
-
76
- const handleKeyDown = React.useCallback(
77
- (event: React.KeyboardEvent<HTMLDivElement>) => {
78
- if (event.key === "ArrowLeft") {
79
- event.preventDefault();
80
- scrollPrev();
81
- } else if (event.key === "ArrowRight") {
82
- event.preventDefault();
83
- scrollNext();
84
- }
85
- },
86
- [scrollPrev, scrollNext],
87
- );
88
-
89
- React.useEffect(() => {
90
- if (!api || !setApi) return;
91
- setApi(api);
92
- }, [api, setApi]);
93
-
94
- React.useEffect(() => {
95
- if (!api) return;
96
- onSelect(api);
97
- api.on("reInit", onSelect);
98
- api.on("select", onSelect);
99
-
100
- return () => {
101
- api.off("select", onSelect);
102
- };
103
- }, [api, onSelect]);
104
-
105
- return (
106
- <CarouselContext.Provider
107
- value={{
108
- carouselRef,
109
- api: api,
110
- opts,
111
- orientation,
112
- scrollPrev,
113
- scrollNext,
114
- canScrollPrev,
115
- canScrollNext,
116
- }}
117
- >
118
- <div
119
- onKeyDownCapture={handleKeyDown}
120
- className={cn("relative", className)}
121
- role="region"
122
- aria-roledescription="carousel"
123
- data-slot="carousel"
124
- {...props}
125
- >
126
- {children}
127
- </div>
128
- </CarouselContext.Provider>
129
- );
130
- }
131
-
132
- function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
133
- const { carouselRef, orientation } = useCarousel();
134
-
135
- return (
136
- <div
137
- ref={carouselRef}
138
- className="overflow-hidden"
139
- data-slot="carousel-content"
140
- >
141
- <div
142
- className={cn(
143
- "flex",
144
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
145
- className,
146
- )}
147
- {...props}
148
- />
149
- </div>
150
- );
151
- }
152
-
153
- function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
154
- const { orientation } = useCarousel();
155
-
156
- return (
157
- <div
158
- role="group"
159
- aria-roledescription="slide"
160
- data-slot="carousel-item"
161
- className={cn(
162
- "min-w-0 shrink-0 grow-0 basis-full",
163
- orientation === "horizontal" ? "pl-4" : "pt-4",
164
- className,
165
- )}
166
- {...props}
167
- />
168
- );
169
- }
170
-
171
- function CarouselPrevious({
172
- className,
173
- variant = "outline",
174
- size = "icon-sm",
175
- ...props
176
- }: React.ComponentProps<typeof Button>) {
177
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
178
-
179
- return (
180
- <Button
181
- data-slot="carousel-previous"
182
- variant={variant}
183
- size={size}
184
- className={cn(
185
- "absolute touch-manipulation rounded-full",
186
- orientation === "horizontal"
187
- ? "inset-y-0 -left-12 my-auto"
188
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
189
- className,
190
- )}
191
- disabled={!canScrollPrev}
192
- onClick={scrollPrev}
193
- {...props}
194
- >
195
- <ChevronLeftIcon />
196
- <span className="sr-only">Previous slide</span>
197
- </Button>
198
- );
199
- }
200
-
201
- function CarouselNext({
202
- className,
203
- variant = "outline",
204
- size = "icon-sm",
205
- ...props
206
- }: React.ComponentProps<typeof Button>) {
207
- const { orientation, scrollNext, canScrollNext } = useCarousel();
208
-
209
- return (
210
- <Button
211
- data-slot="carousel-next"
212
- variant={variant}
213
- size={size}
214
- className={cn(
215
- "absolute touch-manipulation rounded-full",
216
- orientation === "horizontal"
217
- ? "inset-y-0 -right-12 my-auto"
218
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
219
- className,
220
- )}
221
- disabled={!canScrollNext}
222
- onClick={scrollNext}
223
- {...props}
224
- >
225
- <ChevronRightIcon />
226
- <span className="sr-only">Next slide</span>
227
- </Button>
228
- );
229
- }
230
-
231
- export {
232
- type CarouselApi,
233
- Carousel,
234
- CarouselContent,
235
- CarouselItem,
236
- CarouselPrevious,
237
- CarouselNext,
238
- useCarousel,
239
- };
@@ -1,368 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
3
- import * as RechartsPrimitive from "recharts";
4
- import type { TooltipValueType } from "recharts";
5
-
6
- // Format: { THEME_NAME: CSS_SELECTOR }
7
- const THEMES = { light: "", dark: ".dark" } as const;
8
-
9
- const INITIAL_DIMENSION = { width: 320, height: 200 } as const;
10
- type TooltipNameType = number | string;
11
-
12
- export type ChartConfig = Record<
13
- string,
14
- {
15
- label?: React.ReactNode;
16
- icon?: React.ComponentType;
17
- } & (
18
- | { color?: string; theme?: never }
19
- | { color?: never; theme: Record<keyof typeof THEMES, string> }
20
- )
21
- >;
22
-
23
- type ChartContextProps = {
24
- config: ChartConfig;
25
- };
26
-
27
- const ChartContext = React.createContext<ChartContextProps | null>(null);
28
-
29
- function useChart() {
30
- const context = React.useContext(ChartContext);
31
-
32
- if (!context) {
33
- throw new Error("useChart must be used within a <ChartContainer />");
34
- }
35
-
36
- return context;
37
- }
38
-
39
- function ChartContainer({
40
- id,
41
- className,
42
- children,
43
- config,
44
- initialDimension = INITIAL_DIMENSION,
45
- ...props
46
- }: React.ComponentProps<"div"> & {
47
- config: ChartConfig;
48
- children: React.ComponentProps<
49
- typeof RechartsPrimitive.ResponsiveContainer
50
- >["children"];
51
- initialDimension?: {
52
- width: number;
53
- height: number;
54
- };
55
- }) {
56
- const uniqueId = React.useId();
57
- const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`;
58
-
59
- return (
60
- <ChartContext.Provider value={{ config }}>
61
- <div
62
- data-slot="chart"
63
- data-chart={chartId}
64
- className={cn(
65
- "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
66
- className,
67
- )}
68
- {...props}
69
- >
70
- <ChartStyle id={chartId} config={config} />
71
- <RechartsPrimitive.ResponsiveContainer
72
- initialDimension={initialDimension}
73
- >
74
- {children}
75
- </RechartsPrimitive.ResponsiveContainer>
76
- </div>
77
- </ChartContext.Provider>
78
- );
79
- }
80
-
81
- const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
82
- const colorConfig = Object.entries(config).filter(
83
- ([, itemConfig]) => itemConfig.theme ?? itemConfig.color,
84
- );
85
-
86
- if (!colorConfig.length) {
87
- return null;
88
- }
89
-
90
- return (
91
- <style
92
- dangerouslySetInnerHTML={{
93
- __html: Object.entries(THEMES)
94
- .map(
95
- ([theme, prefix]) => `
96
- ${prefix} [data-chart=${id}] {
97
- ${colorConfig
98
- .map(([key, itemConfig]) => {
99
- const color =
100
- itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??
101
- itemConfig.color;
102
- return color ? ` --color-${key}: ${color};` : null;
103
- })
104
- .join("\n")}
105
- }
106
- `,
107
- )
108
- .join("\n"),
109
- }}
110
- />
111
- );
112
- };
113
-
114
- const ChartTooltip = RechartsPrimitive.Tooltip;
115
-
116
- function ChartTooltipContent({
117
- active,
118
- payload,
119
- className,
120
- indicator = "dot",
121
- hideLabel = false,
122
- hideIndicator = false,
123
- label,
124
- labelFormatter,
125
- labelClassName,
126
- formatter,
127
- color,
128
- nameKey,
129
- labelKey,
130
- }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
131
- React.ComponentProps<"div"> & {
132
- hideLabel?: boolean;
133
- hideIndicator?: boolean;
134
- indicator?: "line" | "dot" | "dashed";
135
- nameKey?: string;
136
- labelKey?: string;
137
- } & Omit<
138
- RechartsPrimitive.DefaultTooltipContentProps<
139
- TooltipValueType,
140
- TooltipNameType
141
- >,
142
- "accessibilityLayer"
143
- >) {
144
- const { config } = useChart();
145
-
146
- const tooltipLabel = React.useMemo(() => {
147
- if (hideLabel || !payload?.length) {
148
- return null;
149
- }
150
-
151
- const [item] = payload;
152
- const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`;
153
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
154
- const value =
155
- !labelKey && typeof label === "string"
156
- ? (config[label]?.label ?? label)
157
- : itemConfig?.label;
158
-
159
- if (labelFormatter) {
160
- return (
161
- <div className={cn("font-medium", labelClassName)}>
162
- {labelFormatter(value, payload)}
163
- </div>
164
- );
165
- }
166
-
167
- if (!value) {
168
- return null;
169
- }
170
-
171
- return <div className={cn("font-medium", labelClassName)}>{value}</div>;
172
- }, [
173
- label,
174
- labelFormatter,
175
- payload,
176
- hideLabel,
177
- labelClassName,
178
- config,
179
- labelKey,
180
- ]);
181
-
182
- if (!active || !payload?.length) {
183
- return null;
184
- }
185
-
186
- const nestLabel = payload.length === 1 && indicator !== "dot";
187
-
188
- return (
189
- <div
190
- className={cn(
191
- "grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
192
- className,
193
- )}
194
- >
195
- {!nestLabel ? tooltipLabel : null}
196
- <div className="grid gap-1.5">
197
- {payload
198
- .filter((item) => item.type !== "none")
199
- .map((item, index) => {
200
- const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`;
201
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
202
- const indicatorColor = color ?? item.payload?.fill ?? item.color;
203
-
204
- return (
205
- <div
206
- key={index}
207
- className={cn(
208
- "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
209
- indicator === "dot" && "items-center",
210
- )}
211
- >
212
- {formatter && item.value !== undefined && item.name ? (
213
- formatter(item.value, item.name, item, index, item.payload)
214
- ) : (
215
- <>
216
- {itemConfig?.icon ? (
217
- <itemConfig.icon />
218
- ) : (
219
- !hideIndicator && (
220
- <div
221
- className={cn(
222
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
223
- {
224
- "h-2.5 w-2.5": indicator === "dot",
225
- "w-1": indicator === "line",
226
- "w-0 border-[1.5px] border-dashed bg-transparent":
227
- indicator === "dashed",
228
- "my-0.5": nestLabel && indicator === "dashed",
229
- },
230
- )}
231
- style={
232
- {
233
- "--color-bg": indicatorColor,
234
- "--color-border": indicatorColor,
235
- } as React.CSSProperties
236
- }
237
- />
238
- )
239
- )}
240
- <div
241
- className={cn(
242
- "flex flex-1 justify-between leading-none",
243
- nestLabel ? "items-end" : "items-center",
244
- )}
245
- >
246
- <div className="grid gap-1.5">
247
- {nestLabel ? tooltipLabel : null}
248
- <span className="text-muted-foreground">
249
- {itemConfig?.label ?? item.name}
250
- </span>
251
- </div>
252
- {item.value != null && (
253
- <span className="font-mono font-medium text-foreground tabular-nums">
254
- {typeof item.value === "number"
255
- ? item.value.toLocaleString()
256
- : String(item.value)}
257
- </span>
258
- )}
259
- </div>
260
- </>
261
- )}
262
- </div>
263
- );
264
- })}
265
- </div>
266
- </div>
267
- );
268
- }
269
-
270
- const ChartLegend = RechartsPrimitive.Legend;
271
-
272
- function ChartLegendContent({
273
- className,
274
- hideIcon = false,
275
- payload,
276
- verticalAlign = "bottom",
277
- nameKey,
278
- }: React.ComponentProps<"div"> & {
279
- hideIcon?: boolean;
280
- nameKey?: string;
281
- } & RechartsPrimitive.DefaultLegendContentProps) {
282
- const { config } = useChart();
283
-
284
- if (!payload?.length) {
285
- return null;
286
- }
287
-
288
- return (
289
- <div
290
- className={cn(
291
- "flex items-center justify-center gap-4",
292
- verticalAlign === "top" ? "pb-3" : "pt-3",
293
- className,
294
- )}
295
- >
296
- {payload
297
- .filter((item) => item.type !== "none")
298
- .map((item, index) => {
299
- const key = `${nameKey ?? item.dataKey ?? "value"}`;
300
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
301
-
302
- return (
303
- <div
304
- key={index}
305
- className={cn(
306
- "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground",
307
- )}
308
- >
309
- {itemConfig?.icon && !hideIcon ? (
310
- <itemConfig.icon />
311
- ) : (
312
- <div
313
- className="h-2 w-2 shrink-0 rounded-[2px]"
314
- style={{
315
- backgroundColor: item.color,
316
- }}
317
- />
318
- )}
319
- {itemConfig?.label}
320
- </div>
321
- );
322
- })}
323
- </div>
324
- );
325
- }
326
-
327
- function getPayloadConfigFromPayload(
328
- config: ChartConfig,
329
- payload: unknown,
330
- key: string,
331
- ) {
332
- if (typeof payload !== "object" || payload === null) {
333
- return undefined;
334
- }
335
-
336
- const payloadPayload =
337
- "payload" in payload &&
338
- typeof payload.payload === "object" &&
339
- payload.payload !== null
340
- ? payload.payload
341
- : undefined;
342
-
343
- let configLabelKey: string = key;
344
-
345
- if (
346
- key in payload &&
347
- typeof payload[key as keyof typeof payload] === "string"
348
- ) {
349
- configLabelKey = payload[key as keyof typeof payload];
350
- } else if (
351
- payloadPayload &&
352
- key in payloadPayload &&
353
- typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
354
- ) {
355
- configLabelKey = payloadPayload[key as keyof typeof payloadPayload];
356
- }
357
-
358
- return configLabelKey in config ? config[configLabelKey] : config[key];
359
- }
360
-
361
- export {
362
- ChartContainer,
363
- ChartTooltip,
364
- ChartTooltipContent,
365
- ChartLegend,
366
- ChartLegendContent,
367
- ChartStyle,
368
- };
@@ -1,27 +0,0 @@
1
- "use client";
2
-
3
- import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
4
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
5
- import { CheckIcon } from "lucide-react";
6
-
7
- function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
8
- return (
9
- <CheckboxPrimitive.Root
10
- data-slot="checkbox"
11
- className={cn(
12
- "peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
13
- className,
14
- )}
15
- {...props}
16
- >
17
- <CheckboxPrimitive.Indicator
18
- data-slot="checkbox-indicator"
19
- className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
20
- >
21
- <CheckIcon />
22
- </CheckboxPrimitive.Indicator>
23
- </CheckboxPrimitive.Root>
24
- );
25
- }
26
-
27
- export { Checkbox };