@taicode/common-web 3.7.7 → 3.7.8
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/output/components/alert-dialog.d.ts +20 -0
- package/output/components/alert-dialog.d.ts.map +1 -0
- package/output/components/alert-dialog.js +65 -0
- package/output/components/alert.d.ts +11 -0
- package/output/components/alert.d.ts.map +1 -0
- package/output/components/alert.js +38 -0
- package/output/components/avatar.d.ts +13 -0
- package/output/components/avatar.d.ts.map +1 -0
- package/output/components/avatar.js +40 -0
- package/output/components/badge.d.ts +11 -0
- package/output/components/badge.d.ts.map +1 -0
- package/output/components/badge.js +39 -0
- package/output/components/button.d.ts +12 -0
- package/output/components/button.d.ts.map +1 -0
- package/output/components/button.js +48 -0
- package/output/components/calendar.d.ts +13 -0
- package/output/components/calendar.d.ts.map +1 -0
- package/output/components/calendar.js +57 -0
- package/output/components/card.d.ts +13 -0
- package/output/components/card.d.ts.map +1 -0
- package/output/components/card.js +43 -0
- package/output/components/chart.d.ts +56 -0
- package/output/components/chart.d.ts.map +1 -0
- package/output/components/chart.js +127 -0
- package/output/components/checkbox.d.ts +5 -0
- package/output/components/checkbox.d.ts.map +1 -0
- package/output/components/checkbox.js +21 -0
- package/output/components/command.d.ts +20 -0
- package/output/components/command.d.ts.map +1 -0
- package/output/components/command.js +55 -0
- package/output/components/dialog.d.ts +20 -0
- package/output/components/dialog.d.ts.map +1 -0
- package/output/components/dialog.js +58 -0
- package/output/components/direction.d.ts +9 -0
- package/output/components/direction.d.ts.map +1 -0
- package/output/components/direction.js +10 -0
- package/output/components/drawer.d.ts +14 -0
- package/output/components/drawer.d.ts.map +1 -0
- package/output/components/drawer.js +56 -0
- package/output/components/dropdown-menu.d.ts +29 -0
- package/output/components/dropdown-menu.d.ts.map +1 -0
- package/output/components/dropdown-menu.js +78 -0
- package/output/components/field.d.ts +39 -0
- package/output/components/field.d.ts.map +1 -0
- package/output/components/field.js +102 -0
- package/output/components/footer/index.d.ts +27 -0
- package/output/components/footer/index.d.ts.map +1 -0
- package/output/components/footer/index.js +17 -0
- package/output/components/form.d.ts +26 -0
- package/output/components/form.d.ts.map +1 -0
- package/output/components/form.js +69 -0
- package/output/components/index.d.ts +46 -0
- package/output/components/index.d.ts.map +1 -0
- package/output/components/index.js +45 -0
- package/output/components/input-group.d.ts +17 -0
- package/output/components/input-group.d.ts.map +1 -0
- package/output/components/input-group.js +75 -0
- package/output/components/input.d.ts +4 -0
- package/output/components/input.d.ts.map +1 -0
- package/output/components/input.js +19 -0
- package/output/components/item.d.ts +25 -0
- package/output/components/item.d.ts.map +1 -0
- package/output/components/item.js +89 -0
- package/output/components/json-view/index.d.ts +11 -0
- package/output/components/json-view/index.d.ts.map +1 -0
- package/output/components/json-view/index.js +52 -0
- package/output/components/json-view/lazy/index.d.ts +18 -0
- package/output/components/json-view/lazy/index.d.ts.map +1 -0
- package/output/components/json-view/lazy/index.js +22 -0
- package/output/components/kbd.d.ts +4 -0
- package/output/components/kbd.d.ts.map +1 -0
- package/output/components/kbd.js +22 -0
- package/output/components/label.d.ts +5 -0
- package/output/components/label.d.ts.map +1 -0
- package/output/components/label.js +20 -0
- package/output/components/list-actions/index.d.ts +23 -0
- package/output/components/list-actions/index.d.ts.map +1 -0
- package/output/components/list-actions/index.js +15 -0
- package/output/components/loading-button/index.d.ts +44 -0
- package/output/components/loading-button/index.d.ts.map +1 -0
- package/output/components/loading-button/index.js +75 -0
- package/output/components/loading-button/index.test.d.ts +2 -0
- package/output/components/loading-button/index.test.d.ts.map +1 -0
- package/output/components/loading-button/index.test.js +203 -0
- package/output/components/native-select.d.ts +9 -0
- package/output/components/native-select.d.ts.map +1 -0
- package/output/components/native-select.js +28 -0
- package/output/components/page-back-button/index.d.ts +8 -0
- package/output/components/page-back-button/index.d.ts.map +1 -0
- package/output/components/page-back-button/index.js +7 -0
- package/output/components/page-state.d.ts +19 -0
- package/output/components/page-state.d.ts.map +1 -0
- package/output/components/page-state.js +13 -0
- package/output/components/pagination/index.d.ts +34 -0
- package/output/components/pagination/index.d.ts.map +1 -0
- package/output/components/pagination/index.js +75 -0
- package/output/components/popover.d.ts +11 -0
- package/output/components/popover.d.ts.map +1 -0
- package/output/components/popover.js +44 -0
- package/output/components/progress.d.ts +5 -0
- package/output/components/progress.d.ts.map +1 -0
- package/output/components/progress.js +21 -0
- package/output/components/radio-group.d.ts +6 -0
- package/output/components/radio-group.d.ts.map +1 -0
- package/output/components/radio-group.js +25 -0
- package/output/components/route-pending-indicator/index.d.ts +20 -0
- package/output/components/route-pending-indicator/index.d.ts.map +1 -0
- package/output/components/route-pending-indicator/index.js +17 -0
- package/output/components/scroll-area.d.ts +6 -0
- package/output/components/scroll-area.d.ts.map +1 -0
- package/output/components/scroll-area.js +24 -0
- package/output/components/searchable-select/index.d.ts +41 -0
- package/output/components/searchable-select/index.d.ts.map +1 -0
- package/output/components/searchable-select/index.js +46 -0
- package/output/components/select.d.ts +17 -0
- package/output/components/select.d.ts.map +1 -0
- package/output/components/select.js +58 -0
- package/output/components/separator.d.ts +5 -0
- package/output/components/separator.d.ts.map +1 -0
- package/output/components/separator.js +20 -0
- package/output/components/sheet.d.ts +16 -0
- package/output/components/sheet.d.ts.map +1 -0
- package/output/components/sheet.js +58 -0
- package/output/components/sidebar.d.ts +78 -0
- package/output/components/sidebar.d.ts.map +1 -0
- package/output/components/sidebar.js +233 -0
- package/output/components/size-provider/index.d.ts +2 -0
- package/output/components/size-provider/index.d.ts.map +1 -0
- package/output/components/size-provider/index.js +1 -0
- package/output/components/size-provider/size-provider.d.ts +9 -0
- package/output/components/size-provider/size-provider.d.ts.map +1 -0
- package/output/components/size-provider/size-provider.js +29 -0
- package/output/components/skeleton.d.ts +3 -0
- package/output/components/skeleton.d.ts.map +1 -0
- package/output/components/skeleton.js +18 -0
- package/output/components/sonner.d.ts +8 -0
- package/output/components/sonner.d.ts.map +1 -0
- package/output/components/sonner.js +34 -0
- package/output/components/spinner.d.ts +3 -0
- package/output/components/spinner.d.ts.map +1 -0
- package/output/components/spinner.js +19 -0
- package/output/components/switch.d.ts +8 -0
- package/output/components/switch.d.ts.map +1 -0
- package/output/components/switch.js +20 -0
- package/output/components/table.d.ts +11 -0
- package/output/components/table.d.ts.map +1 -0
- package/output/components/table.js +47 -0
- package/output/components/tabs.d.ts +12 -0
- package/output/components/tabs.d.ts.map +1 -0
- package/output/components/tabs.js +45 -0
- package/output/components/textarea.d.ts +4 -0
- package/output/components/textarea.d.ts.map +1 -0
- package/output/components/textarea.js +19 -0
- package/output/components/theme-switcher.d.ts +6 -0
- package/output/components/theme-switcher.d.ts.map +1 -0
- package/output/components/theme-switcher.js +19 -0
- package/output/components/toaster/index.d.ts +16 -0
- package/output/components/toaster/index.d.ts.map +1 -0
- package/output/components/toaster/index.js +70 -0
- package/output/components/toggle-group.d.ts +12 -0
- package/output/components/toggle-group.d.ts.map +1 -0
- package/output/components/toggle-group.js +38 -0
- package/output/components/toggle.d.ts +10 -0
- package/output/components/toggle.d.ts.map +1 -0
- package/output/components/toggle.js +38 -0
- package/output/components/tooltip.d.ts +8 -0
- package/output/components/tooltip.d.ts.map +1 -0
- package/output/components/tooltip.js +33 -0
- package/output/features/confirm-dialog/index.d.ts +41 -0
- package/output/features/confirm-dialog/index.d.ts.map +1 -0
- package/output/features/confirm-dialog/index.js +19 -0
- package/output/features/input-confirm/index.d.ts +26 -0
- package/output/features/input-confirm/index.d.ts.map +1 -0
- package/output/features/input-confirm/index.js +59 -0
- package/output/features/signin/context.d.ts +14 -0
- package/output/features/signin/context.d.ts.map +1 -0
- package/output/features/signin/context.js +13 -0
- package/output/features/signin/index.d.ts +58 -0
- package/output/features/signin/index.d.ts.map +1 -0
- package/output/features/signin/index.js +137 -0
- package/output/features/signin/service.d.ts +92 -0
- package/output/features/signin/service.d.ts.map +1 -0
- package/output/features/signin/service.js +519 -0
- package/output/features/signin/service.test.d.ts +2 -0
- package/output/features/signin/service.test.d.ts.map +1 -0
- package/output/features/signin/service.test.js +211 -0
- package/output/features/signin/types.d.ts +63 -0
- package/output/features/signin/types.d.ts.map +1 -0
- package/output/features/signin/types.js +1 -0
- package/output/hooks/use-loading/index.d.ts +6 -0
- package/output/hooks/use-loading/index.d.ts.map +1 -0
- package/output/hooks/use-loading/index.js +14 -0
- package/output/hooks/use-loading/index.test.d.ts +2 -0
- package/output/hooks/use-loading/index.test.d.ts.map +1 -0
- package/output/hooks/use-loading/index.test.js +24 -0
- package/output/hooks/use-mobile/index.d.ts +2 -0
- package/output/hooks/use-mobile/index.d.ts.map +1 -0
- package/output/hooks/use-mobile/index.js +16 -0
- package/output/hooks/use-observer/index.d.ts +2 -0
- package/output/hooks/use-observer/index.d.ts.map +1 -0
- package/output/hooks/use-observer/index.js +1 -0
- package/output/hooks/use-observer/use-observer.d.ts +3 -0
- package/output/hooks/use-observer/use-observer.d.ts.map +1 -0
- package/output/hooks/use-observer/use-observer.js +16 -0
- package/output/hooks/use-observer/use-observer.test.d.ts +2 -0
- package/output/hooks/use-observer/use-observer.test.d.ts.map +1 -0
- package/output/hooks/use-observer/use-observer.test.js +134 -0
- package/output/hooks/use-offline/index.d.ts +6 -0
- package/output/hooks/use-offline/index.d.ts.map +1 -0
- package/output/hooks/use-offline/index.js +19 -0
- package/output/layout/app/index.d.ts +34 -0
- package/output/layout/app/index.d.ts.map +1 -0
- package/output/layout/app/index.js +34 -0
- package/output/layout/dashboard/index.d.ts +76 -0
- package/output/layout/dashboard/index.d.ts.map +1 -0
- package/output/layout/dashboard/index.js +84 -0
- package/output/layout/index.d.ts +3 -0
- package/output/layout/index.d.ts.map +1 -0
- package/output/layout/index.js +2 -0
- package/output/services/cache-api/cache-api.d.ts +23 -0
- package/output/services/cache-api/cache-api.d.ts.map +1 -0
- package/output/services/cache-api/cache-api.js +145 -0
- package/output/services/cache-api/cache-api.test.d.ts +2 -0
- package/output/services/cache-api/cache-api.test.d.ts.map +1 -0
- package/output/services/cache-api/cache-api.test.js +610 -0
- package/output/services/cache-api/index.d.ts +2 -0
- package/output/services/cache-api/index.d.ts.map +1 -0
- package/output/services/cache-api/index.js +1 -0
- package/output/services/cached-fetch/index.d.ts +50 -0
- package/output/services/cached-fetch/index.d.ts.map +1 -0
- package/output/services/cached-fetch/index.js +196 -0
- package/output/services/service/index.d.ts +2 -0
- package/output/services/service/index.d.ts.map +1 -0
- package/output/services/service/index.js +1 -0
- package/output/services/service/service.d.ts +135 -0
- package/output/services/service/service.d.ts.map +1 -0
- package/output/services/service/service.js +276 -0
- package/output/services/service/service.test.d.ts +2 -0
- package/output/services/service/service.test.d.ts.map +1 -0
- package/output/services/service/service.test.js +1399 -0
- package/output/services/side-cache/index.d.ts +2 -0
- package/output/services/side-cache/index.d.ts.map +1 -0
- package/output/services/side-cache/index.js +1 -0
- package/output/services/side-cache/side-cache.d.ts +11 -0
- package/output/services/side-cache/side-cache.d.ts.map +1 -0
- package/output/services/side-cache/side-cache.js +161 -0
- package/output/services/side-cache/side-cache.test.d.ts +2 -0
- package/output/services/side-cache/side-cache.test.d.ts.map +1 -0
- package/output/services/side-cache/side-cache.test.js +271 -0
- package/output/utils/avatar/index.d.ts +28 -0
- package/output/utils/avatar/index.d.ts.map +1 -0
- package/output/utils/avatar/index.js +35 -0
- package/output/utils/delay/index.d.ts +2 -0
- package/output/utils/delay/index.d.ts.map +1 -0
- package/output/utils/delay/index.js +5 -0
- package/output/utils/form/index.d.ts +3 -0
- package/output/utils/form/index.d.ts.map +1 -0
- package/output/utils/form/index.js +1 -0
- package/output/utils/merge-class-names/index.d.ts +3 -0
- package/output/utils/merge-class-names/index.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.js +5 -0
- package/output/utils/merge-class-names/index.test.d.ts +2 -0
- package/output/utils/merge-class-names/index.test.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.test.js +7 -0
- package/output/utils/performance/index.d.ts +82 -0
- package/output/utils/performance/index.d.ts.map +1 -0
- package/output/utils/performance/index.js +129 -0
- package/output/utils/redirect/index.d.ts +6 -0
- package/output/utils/redirect/index.d.ts.map +1 -0
- package/output/utils/redirect/index.js +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useContext, useId, useMemo } from 'react';
|
|
15
|
+
import * as RechartsPrimitive from 'recharts';
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
18
|
+
const THEMES = { light: '', dark: '.dark' };
|
|
19
|
+
const ChartContext = React.createContext(null);
|
|
20
|
+
function useChart() {
|
|
21
|
+
const context = useContext(ChartContext);
|
|
22
|
+
if (!context) {
|
|
23
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
24
|
+
}
|
|
25
|
+
return context;
|
|
26
|
+
}
|
|
27
|
+
function ChartContainer(params) {
|
|
28
|
+
const { id, className, children, config } = params, props = __rest(params, ["id", "className", "children", "config"]);
|
|
29
|
+
const uniqueId = useId();
|
|
30
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
31
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", Object.assign({ "data-slot": "chart", "data-chart": chartId, className: mergeClassNames("[&_.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-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 flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className) }, props, { children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] })) }));
|
|
32
|
+
}
|
|
33
|
+
const ChartStyle = ({ id, config }) => {
|
|
34
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
35
|
+
if (!colorConfig.length) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
39
|
+
__html: Object.entries(THEMES)
|
|
40
|
+
.map(([theme, prefix]) => `
|
|
41
|
+
${prefix} [data-chart=${id}] {
|
|
42
|
+
${colorConfig
|
|
43
|
+
.map(([key, itemConfig]) => {
|
|
44
|
+
var _a;
|
|
45
|
+
const color = ((_a = itemConfig.theme) === null || _a === void 0 ? void 0 : _a[theme]) || itemConfig.color;
|
|
46
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
47
|
+
})
|
|
48
|
+
.join('\n')}
|
|
49
|
+
}
|
|
50
|
+
`)
|
|
51
|
+
.join('\n'),
|
|
52
|
+
} }));
|
|
53
|
+
};
|
|
54
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
55
|
+
function ChartTooltipContent(params) {
|
|
56
|
+
const { active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, } = params;
|
|
57
|
+
const { config } = useChart();
|
|
58
|
+
const tooltipLabel = useMemo(() => {
|
|
59
|
+
var _a;
|
|
60
|
+
if (hideLabel || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const [item] = payload;
|
|
64
|
+
const key = `${labelKey || (item === null || item === void 0 ? void 0 : item.dataKey) || (item === null || item === void 0 ? void 0 : item.name) || 'value'}`;
|
|
65
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
66
|
+
const value = !labelKey && typeof label === 'string' ? ((_a = config[label]) === null || _a === void 0 ? void 0 : _a.label) || label : itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label;
|
|
67
|
+
if (labelFormatter) {
|
|
68
|
+
return _jsx("div", { className: mergeClassNames('font-medium', labelClassName), children: labelFormatter(value, payload) });
|
|
69
|
+
}
|
|
70
|
+
if (!value) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return _jsx("div", { className: mergeClassNames('font-medium', labelClassName), children: value });
|
|
74
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
75
|
+
if (!active || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
79
|
+
return (_jsxs("div", { className: mergeClassNames('border-border/50 bg-background gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl grid min-w-[8rem] items-start', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
|
|
80
|
+
.filter((item) => item.type !== 'none')
|
|
81
|
+
.map((item, index) => {
|
|
82
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
83
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
84
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
85
|
+
return (_jsx("div", { className: mergeClassNames('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', indicator === 'dot' && 'items-center'), children: formatter && (item === null || item === void 0 ? void 0 : item.value) !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: mergeClassNames('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {
|
|
86
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
87
|
+
'w-1': indicator === 'line',
|
|
88
|
+
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
89
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
90
|
+
}), style: {
|
|
91
|
+
'--color-bg': indicatorColor,
|
|
92
|
+
'--color-border': indicatorColor,
|
|
93
|
+
} }))), _jsxs("div", { className: mergeClassNames('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label) || item.name })] }), item.value && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
94
|
+
}) })] }));
|
|
95
|
+
}
|
|
96
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
97
|
+
function ChartLegendContent(params) {
|
|
98
|
+
const { className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey } = params;
|
|
99
|
+
const { config } = useChart();
|
|
100
|
+
if (!(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return (_jsx("div", { className: mergeClassNames('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload
|
|
104
|
+
.filter((item) => item.type !== 'none')
|
|
105
|
+
.map((item) => {
|
|
106
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
107
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
108
|
+
return (_jsxs("div", { className: mergeClassNames('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'), children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
109
|
+
backgroundColor: item.color,
|
|
110
|
+
} })), itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label] }, item.value));
|
|
111
|
+
}) }));
|
|
112
|
+
}
|
|
113
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
114
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const payloadPayload = 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null ? payload.payload : undefined;
|
|
118
|
+
let configLabelKey = key;
|
|
119
|
+
if (key in payload && typeof payload[key] === 'string') {
|
|
120
|
+
configLabelKey = payload[key];
|
|
121
|
+
}
|
|
122
|
+
else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === 'string') {
|
|
123
|
+
configLabelKey = payloadPayload[key];
|
|
124
|
+
}
|
|
125
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
126
|
+
}
|
|
127
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../source/components/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAKxD,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,qBAgB5E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Checkbox as CheckboxPrimitive } from 'radix-ui';
|
|
15
|
+
import { CheckIcon } from 'lucide-react';
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
|
+
function Checkbox(params) {
|
|
18
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
19
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ "data-slot": "checkbox", className: mergeClassNames('border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[3px] aria-invalid:ring-[3px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: _jsx(CheckIcon, {}) }) })));
|
|
20
|
+
}
|
|
21
|
+
export { Checkbox };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Dialog } from "./dialog.js";
|
|
4
|
+
type CommandDialogParams = {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
showCloseButton?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function Command(params: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
11
|
+
declare function CommandDialog(params: React.ComponentProps<typeof Dialog> & CommandDialogParams): React.JSX.Element;
|
|
12
|
+
declare function CommandInput(params: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
13
|
+
declare function CommandList(params: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
14
|
+
declare function CommandEmpty(params: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
15
|
+
declare function CommandGroup(params: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
16
|
+
declare function CommandSeparator(params: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
17
|
+
declare function CommandItem(params: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
18
|
+
declare function CommandShortcut(params: React.ComponentProps<"span">): React.JSX.Element;
|
|
19
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
20
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../source/components/command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAGlD,OAAO,EACL,MAAM,EAKP,MAAM,aAAa,CAAA;AAOpB,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,iBAAS,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,qBAerE;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG,mBAAmB,qBA0BvF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAsBhF;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAe9E;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAYhF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAYhF;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,qBAYxF;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAmB9E;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAY5D;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
|
|
17
|
+
import { InputGroup, InputGroupAddon, } from "./input-group.js";
|
|
18
|
+
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
19
|
+
function Command(params) {
|
|
20
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
+
return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", className: mergeClassNames("bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden", className) }, props)));
|
|
22
|
+
}
|
|
23
|
+
function CommandDialog(params) {
|
|
24
|
+
const { title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false } = params, props = __rest(params, ["title", "description", "children", "className", "showCloseButton"]);
|
|
25
|
+
return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: mergeClassNames("rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0", className), showCloseButton: showCloseButton, children: children })] })));
|
|
26
|
+
}
|
|
27
|
+
function CommandInput(params) {
|
|
28
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
+
return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className: mergeClassNames("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className) }, props)), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
|
|
30
|
+
}
|
|
31
|
+
function CommandList(params) {
|
|
32
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
33
|
+
return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className: mergeClassNames("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto", className) }, props)));
|
|
34
|
+
}
|
|
35
|
+
function CommandEmpty(params) {
|
|
36
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
37
|
+
return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: mergeClassNames("py-6 text-center text-sm", className) }, props)));
|
|
38
|
+
}
|
|
39
|
+
function CommandGroup(params) {
|
|
40
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
41
|
+
return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className: mergeClassNames("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className) }, props)));
|
|
42
|
+
}
|
|
43
|
+
function CommandSeparator(params) {
|
|
44
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
45
|
+
return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className: mergeClassNames("bg-border -mx-1 h-px w-auto", className) }, props)));
|
|
46
|
+
}
|
|
47
|
+
function CommandItem(params) {
|
|
48
|
+
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
49
|
+
return (_jsxs(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className: mergeClassNames("data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=dialog-content]_&]:rounded-lg! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] })));
|
|
50
|
+
}
|
|
51
|
+
function CommandShortcut(params) {
|
|
52
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
53
|
+
return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", className: mergeClassNames("text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest", className) }, props)));
|
|
54
|
+
}
|
|
55
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
3
|
+
type DialogContentParams = {
|
|
4
|
+
showCloseButton?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type DialogFooterParams = {
|
|
7
|
+
showCloseButton?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function Dialog(params: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
10
|
+
declare function DialogTrigger(params: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
11
|
+
declare function DialogPortal(params: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
12
|
+
declare function DialogClose(params: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
13
|
+
declare function DialogOverlay(params: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
14
|
+
declare function DialogContent(params: React.ComponentProps<typeof DialogPrimitive.Content> & DialogContentParams): React.JSX.Element;
|
|
15
|
+
declare function DialogHeader(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
16
|
+
declare function DialogFooter(params: React.ComponentProps<'div'> & DialogFooterParams): React.JSX.Element;
|
|
17
|
+
declare function DialogTitle(params: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
18
|
+
declare function DialogDescription(params: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
20
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../source/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAMpD,KAAK,mBAAmB,GAAG;IACzB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAKxE;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAKlF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAKhF;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAK9E;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAYlF;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,mBAAmB,qBA+BxG;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASxD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,kBAAkB,qBAwB7E;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAY9E;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAY1F;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
|
+
import { Button } from './button.js';
|
|
17
|
+
import { XIcon } from 'lucide-react';
|
|
18
|
+
function Dialog(params) {
|
|
19
|
+
const props = __rest(params, []);
|
|
20
|
+
return _jsx(DialogPrimitive.Root, Object.assign({ "data-slot": "dialog" }, props));
|
|
21
|
+
}
|
|
22
|
+
function DialogTrigger(params) {
|
|
23
|
+
const props = __rest(params, []);
|
|
24
|
+
return _jsx(DialogPrimitive.Trigger, Object.assign({ "data-slot": "dialog-trigger" }, props));
|
|
25
|
+
}
|
|
26
|
+
function DialogPortal(params) {
|
|
27
|
+
const props = __rest(params, []);
|
|
28
|
+
return _jsx(DialogPrimitive.Portal, Object.assign({ "data-slot": "dialog-portal" }, props));
|
|
29
|
+
}
|
|
30
|
+
function DialogClose(params) {
|
|
31
|
+
const props = __rest(params, []);
|
|
32
|
+
return _jsx(DialogPrimitive.Close, Object.assign({ "data-slot": "dialog-close" }, props));
|
|
33
|
+
}
|
|
34
|
+
function DialogOverlay(params) {
|
|
35
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
+
return (_jsx(DialogPrimitive.Overlay, Object.assign({ "data-slot": "dialog-overlay", className: mergeClassNames('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50', className) }, props)));
|
|
37
|
+
}
|
|
38
|
+
function DialogContent(params) {
|
|
39
|
+
const { className, children, showCloseButton = true } = params, props = __rest(params, ["className", "children", "showCloseButton"]);
|
|
40
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, Object.assign({ "data-slot": "dialog-content", className: mergeClassNames('bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none', className) }, props, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: _jsxs(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] }))] }));
|
|
41
|
+
}
|
|
42
|
+
function DialogHeader(params) {
|
|
43
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "dialog-header", className: mergeClassNames('gap-2 flex flex-col', className) }, props)));
|
|
45
|
+
}
|
|
46
|
+
function DialogFooter(params) {
|
|
47
|
+
const { className, showCloseButton = false, children } = params, props = __rest(params, ["className", "showCloseButton", "children"]);
|
|
48
|
+
return (_jsxs("div", Object.assign({ "data-slot": "dialog-footer", className: mergeClassNames('gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className) }, props, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }))] })));
|
|
49
|
+
}
|
|
50
|
+
function DialogTitle(params) {
|
|
51
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
+
return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className: mergeClassNames('leading-none font-medium', className) }, props)));
|
|
53
|
+
}
|
|
54
|
+
function DialogDescription(params) {
|
|
55
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
+
return (_jsx(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", className: mergeClassNames('text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3', className) }, props)));
|
|
57
|
+
}
|
|
58
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Direction } from "radix-ui";
|
|
3
|
+
type DirectionProviderParams = {
|
|
4
|
+
direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"];
|
|
5
|
+
};
|
|
6
|
+
declare function DirectionProvider(params: React.ComponentProps<typeof Direction.DirectionProvider> & DirectionProviderParams): React.JSX.Element;
|
|
7
|
+
declare const useDirection: typeof Direction.useDirection;
|
|
8
|
+
export { DirectionProvider, useDirection };
|
|
9
|
+
//# sourceMappingURL=direction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../source/components/direction.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,KAAK,uBAAuB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAA;CAC5E,CAAA;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,GAAG,uBAAuB,qBAWpH;AAED,QAAA,MAAM,YAAY,+BAAyB,CAAA;AAE3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Direction } from "radix-ui";
|
|
5
|
+
function DirectionProvider(params) {
|
|
6
|
+
const { dir, direction, children, } = params;
|
|
7
|
+
return (_jsx(Direction.DirectionProvider, { dir: direction !== null && direction !== void 0 ? direction : dir, children: children }));
|
|
8
|
+
}
|
|
9
|
+
const useDirection = Direction.useDirection;
|
|
10
|
+
export { DirectionProvider, useDirection };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
|
+
declare function Drawer(params: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DrawerTrigger(params: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DrawerPortal(params: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DrawerClose(params: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DrawerOverlay(params: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DrawerContent(params: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
|
|
9
|
+
declare function DrawerHeader(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
|
+
declare function DrawerFooter(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
declare function DrawerTitle(params: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
|
|
12
|
+
declare function DrawerDescription(params: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
|
|
13
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription };
|
|
14
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../source/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAIhD,iBAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAGxE;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAGlF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAGhF;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAG9E;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBASlF;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAkBlF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASxD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAKxD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAS9E;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAS1F;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
|
+
function Drawer(params) {
|
|
17
|
+
const props = __rest(params, []);
|
|
18
|
+
return _jsx(DrawerPrimitive.Root, Object.assign({ "data-slot": "drawer" }, props));
|
|
19
|
+
}
|
|
20
|
+
function DrawerTrigger(params) {
|
|
21
|
+
const props = __rest(params, []);
|
|
22
|
+
return _jsx(DrawerPrimitive.Trigger, Object.assign({ "data-slot": "drawer-trigger" }, props));
|
|
23
|
+
}
|
|
24
|
+
function DrawerPortal(params) {
|
|
25
|
+
const props = __rest(params, []);
|
|
26
|
+
return _jsx(DrawerPrimitive.Portal, Object.assign({ "data-slot": "drawer-portal" }, props));
|
|
27
|
+
}
|
|
28
|
+
function DrawerClose(params) {
|
|
29
|
+
const props = __rest(params, []);
|
|
30
|
+
return _jsx(DrawerPrimitive.Close, Object.assign({ "data-slot": "drawer-close" }, props));
|
|
31
|
+
}
|
|
32
|
+
function DrawerOverlay(params) {
|
|
33
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
34
|
+
return (_jsx(DrawerPrimitive.Overlay, Object.assign({ "data-slot": "drawer-overlay", className: mergeClassNames('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50', className) }, props)));
|
|
35
|
+
}
|
|
36
|
+
function DrawerContent(params) {
|
|
37
|
+
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
38
|
+
return (_jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerPrimitive.Content, Object.assign({ "data-slot": "drawer-content", className: mergeClassNames('bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50', className) }, props, { children: [_jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children] }))] }));
|
|
39
|
+
}
|
|
40
|
+
function DrawerHeader(params) {
|
|
41
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
42
|
+
return (_jsx("div", Object.assign({ "data-slot": "drawer-header", className: mergeClassNames('gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left flex flex-col', className) }, props)));
|
|
43
|
+
}
|
|
44
|
+
function DrawerFooter(params) {
|
|
45
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
46
|
+
return (_jsx("div", Object.assign({ "data-slot": "drawer-footer", className: mergeClassNames('gap-2 p-4 mt-auto flex flex-col', className) }, props)));
|
|
47
|
+
}
|
|
48
|
+
function DrawerTitle(params) {
|
|
49
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
50
|
+
return (_jsx(DrawerPrimitive.Title, Object.assign({ "data-slot": "drawer-title", className: mergeClassNames('text-foreground font-medium', className) }, props)));
|
|
51
|
+
}
|
|
52
|
+
function DrawerDescription(params) {
|
|
53
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
54
|
+
return (_jsx(DrawerPrimitive.Description, Object.assign({ "data-slot": "drawer-description", className: mergeClassNames('text-muted-foreground text-sm', className) }, props)));
|
|
55
|
+
}
|
|
56
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
type DropdownMenuItemParams = {
|
|
4
|
+
inset?: boolean;
|
|
5
|
+
variant?: "default" | "destructive";
|
|
6
|
+
};
|
|
7
|
+
type DropdownMenuLabelParams = {
|
|
8
|
+
inset?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type DropdownMenuSubTriggerParams = {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function DropdownMenu(params: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuPortal(params: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuTrigger(params: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuContent(params: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
17
|
+
declare function DropdownMenuGroup(params: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuItem(params: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & DropdownMenuItemParams): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuCheckboxItem(params: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuRadioGroup(params: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuRadioItem(params: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuLabel(params: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & DropdownMenuLabelParams): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuSeparator(params: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuShortcut(params: React.ComponentProps<"span">): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuSub(params: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
26
|
+
declare function DropdownMenuSubTrigger(params: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & DropdownMenuSubTriggerParams): React.JSX.Element;
|
|
27
|
+
declare function DropdownMenuSubContent(params: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
28
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
29
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../source/components/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAKhE,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;CACpC,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,KAAK,4BAA4B,GAAG;IAClC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAKpF;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,qBAO5F;AAED,iBAAS,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAU9F;AAED,iBAAS,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAkB9F;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,qBAO1F;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG,sBAAsB,qBAmBjH;AAED,iBAAS,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,YAAY,CAAC,qBA6BxG;AAED,iBAAS,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAUpG;AAED,iBAAS,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,qBA2BlG;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG,uBAAuB,qBAcpH;AAED,iBAAS,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,qBAYlG;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAYjE;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,qBAKtF;AAED,iBAAS,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG,4BAA4B,qBAqBnI;AAED,iBAAS,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAYpG;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
18
|
+
function DropdownMenu(params) {
|
|
19
|
+
const props = __rest(params, []);
|
|
20
|
+
return _jsx(DropdownMenuPrimitive.Root, Object.assign({ "data-slot": "dropdown-menu" }, props));
|
|
21
|
+
}
|
|
22
|
+
function DropdownMenuPortal(params) {
|
|
23
|
+
const props = __rest(params, []);
|
|
24
|
+
return (_jsx(DropdownMenuPrimitive.Portal, Object.assign({ "data-slot": "dropdown-menu-portal" }, props)));
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuTrigger(params) {
|
|
27
|
+
const props = __rest(params, []);
|
|
28
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, Object.assign({ "data-slot": "dropdown-menu-trigger" }, props)));
|
|
29
|
+
}
|
|
30
|
+
function DropdownMenuContent(params) {
|
|
31
|
+
const { className, align = "start", sideOffset = 4 } = params, props = __rest(params, ["className", "align", "sideOffset"]);
|
|
32
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden", className) }, props)) }));
|
|
33
|
+
}
|
|
34
|
+
function DropdownMenuGroup(params) {
|
|
35
|
+
const props = __rest(params, []);
|
|
36
|
+
return (_jsx(DropdownMenuPrimitive.Group, Object.assign({ "data-slot": "dropdown-menu-group" }, props)));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuItem(params) {
|
|
39
|
+
const { className, inset, variant = "default" } = params, props = __rest(params, ["className", "inset", "variant"]);
|
|
40
|
+
return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: mergeClassNames("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props)));
|
|
41
|
+
}
|
|
42
|
+
function DropdownMenuCheckboxItem(params) {
|
|
43
|
+
const { className, children, checked } = params, props = __rest(params, ["className", "children", "checked"]);
|
|
44
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, Object.assign({ "data-slot": "dropdown-menu-checkbox-item", className: mergeClassNames("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), checked: checked }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] })));
|
|
45
|
+
}
|
|
46
|
+
function DropdownMenuRadioGroup(params) {
|
|
47
|
+
const props = __rest(params, []);
|
|
48
|
+
return (_jsx(DropdownMenuPrimitive.RadioGroup, Object.assign({ "data-slot": "dropdown-menu-radio-group" }, props)));
|
|
49
|
+
}
|
|
50
|
+
function DropdownMenuRadioItem(params) {
|
|
51
|
+
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
52
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, Object.assign({ "data-slot": "dropdown-menu-radio-item", className: mergeClassNames("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] })));
|
|
53
|
+
}
|
|
54
|
+
function DropdownMenuLabel(params) {
|
|
55
|
+
const { className, inset } = params, props = __rest(params, ["className", "inset"]);
|
|
56
|
+
return (_jsx(DropdownMenuPrimitive.Label, Object.assign({ "data-slot": "dropdown-menu-label", "data-inset": inset, className: mergeClassNames("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className) }, props)));
|
|
57
|
+
}
|
|
58
|
+
function DropdownMenuSeparator(params) {
|
|
59
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
60
|
+
return (_jsx(DropdownMenuPrimitive.Separator, Object.assign({ "data-slot": "dropdown-menu-separator", className: mergeClassNames("bg-border -mx-1 my-1 h-px", className) }, props)));
|
|
61
|
+
}
|
|
62
|
+
function DropdownMenuShortcut(params) {
|
|
63
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
64
|
+
return (_jsx("span", Object.assign({ "data-slot": "dropdown-menu-shortcut", className: mergeClassNames("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest", className) }, props)));
|
|
65
|
+
}
|
|
66
|
+
function DropdownMenuSub(params) {
|
|
67
|
+
const props = __rest(params, []);
|
|
68
|
+
return _jsx(DropdownMenuPrimitive.Sub, Object.assign({ "data-slot": "dropdown-menu-sub" }, props));
|
|
69
|
+
}
|
|
70
|
+
function DropdownMenuSubTrigger(params) {
|
|
71
|
+
const { className, inset, children } = params, props = __rest(params, ["className", "inset", "children"]);
|
|
72
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, Object.assign({ "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: mergeClassNames("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })));
|
|
73
|
+
}
|
|
74
|
+
function DropdownMenuSubContent(params) {
|
|
75
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
76
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, Object.assign({ "data-slot": "dropdown-menu-sub-content", className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden", className) }, props)));
|
|
77
|
+
}
|
|
78
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Label } from "./label.js";
|
|
3
|
+
type FieldErrorParams = {
|
|
4
|
+
errors?: Array<{
|
|
5
|
+
message?: string;
|
|
6
|
+
} | undefined>;
|
|
7
|
+
};
|
|
8
|
+
type FieldLegendParams = {
|
|
9
|
+
variant?: "legend" | "label";
|
|
10
|
+
};
|
|
11
|
+
type FieldSeparatorParams = {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare function FieldSet(params: React.ComponentProps<"fieldset">): import("react").JSX.Element;
|
|
15
|
+
declare function FieldLegend(params: React.ComponentProps<"legend"> & FieldLegendParams): import("react").JSX.Element;
|
|
16
|
+
declare function FieldGroup(params: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
17
|
+
declare const fieldVariants: (props?: ({
|
|
18
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
declare function Field(params: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
21
|
+
declare function FieldContent(params: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
22
|
+
declare function FieldLabel(params: React.ComponentProps<typeof Label>): import("react").JSX.Element;
|
|
23
|
+
declare function FieldTitle(params: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
24
|
+
declare function FieldDescription(params: React.ComponentProps<"p">): import("react").JSX.Element;
|
|
25
|
+
declare function FieldSeparator(params: React.ComponentProps<"div"> & FieldSeparatorParams): import("react").JSX.Element;
|
|
26
|
+
declare function FieldError(params: React.ComponentProps<"div"> & FieldErrorParams): import("react").JSX.Element | null;
|
|
27
|
+
declare const FieldNamespace: typeof Field & {
|
|
28
|
+
Label: typeof FieldLabel;
|
|
29
|
+
Description: typeof FieldDescription;
|
|
30
|
+
Error: typeof FieldError;
|
|
31
|
+
Group: typeof FieldGroup;
|
|
32
|
+
Legend: typeof FieldLegend;
|
|
33
|
+
Separator: typeof FieldSeparator;
|
|
34
|
+
Set: typeof FieldSet;
|
|
35
|
+
Content: typeof FieldContent;
|
|
36
|
+
Title: typeof FieldTitle;
|
|
37
|
+
};
|
|
38
|
+
export { FieldNamespace as Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
39
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../source/components/field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,KAAK,gBAAgB,GAAG;IACtB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;CACjD,CAAA;AAED,KAAK,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,CAAA;AAEzD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,+BASzD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,iBAAiB,+BAc9E;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAYtD;AAED,QAAA,MAAM,aAAa;;8EAcjB,CAAA;AAEF,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,+BAetF;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAYxD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,+BAgB7D;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,+BAYtD;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,+BAc1D;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,oBAAoB,+BAwBjF;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,gBAAgB,sCAgDzE;AAGD,QAAA,MAAM,cAAc;;;;;;;;;;CAUlB,CAAA;AAEF,OAAO,EACL,cAAc,IAAI,KAAK,EACvB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,CAAA"}
|