@taicode/common-web 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/output/components/alert-dialog.js +10 -10
- package/output/components/alert.js +5 -5
- package/output/components/avatar.js +7 -7
- package/output/components/badge.d.ts +7 -6
- package/output/components/badge.d.ts.map +1 -1
- package/output/components/badge.js +21 -13
- package/output/components/button.d.ts +8 -8
- package/output/components/button.d.ts.map +1 -1
- package/output/components/button.js +26 -22
- 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 +12 -7
- package/output/components/card.d.ts.map +1 -1
- package/output/components/card.js +26 -21
- 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.js +2 -2
- package/output/components/command.js +10 -10
- package/output/components/dialog.js +7 -7
- 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.js +10 -10
- package/output/components/field.js +11 -11
- package/output/components/index.d.ts +6 -0
- package/output/components/index.d.ts.map +1 -1
- package/output/components/index.js +6 -0
- package/output/components/input-group.d.ts +1 -1
- package/output/components/input-group.js +7 -7
- package/output/components/input.d.ts +3 -2
- package/output/components/input.d.ts.map +1 -1
- package/output/components/input.js +7 -7
- package/output/components/item.d.ts +1 -1
- package/output/components/item.js +11 -11
- package/output/components/json-view/index.js +2 -2
- package/output/components/kbd.js +3 -3
- package/output/components/label.js +2 -2
- package/output/components/native-select.js +3 -3
- package/output/components/popover.js +5 -5
- package/output/components/progress.js +2 -2
- package/output/components/radio-group.js +3 -3
- package/output/components/scroll-area.js +3 -3
- package/output/components/select.js +9 -9
- package/output/components/separator.d.ts +4 -5
- package/output/components/separator.d.ts.map +1 -1
- package/output/components/separator.js +8 -7
- package/output/components/sheet.js +7 -7
- 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/skeleton.d.ts +2 -2
- package/output/components/skeleton.d.ts.map +1 -1
- package/output/components/skeleton.js +5 -4
- package/output/components/spinner.js +2 -2
- package/output/components/switch.js +2 -2
- package/output/components/table.js +9 -9
- package/output/components/tabs.js +5 -5
- package/output/components/textarea.js +2 -2
- 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.js +2 -2
- package/output/features/confirm-dialog/index.js +2 -2
- package/output/layout/app/index.js +7 -7
- package/output/layout/dashboard/index.js +2 -2
- package/output/layout/empty/index.d.ts +20 -0
- package/output/layout/empty/index.d.ts.map +1 -0
- package/output/layout/empty/index.js +14 -0
- package/output/layout/index.d.ts +4 -0
- package/output/layout/index.d.ts.map +1 -1
- package/output/layout/index.js +4 -0
- package/output/layout/list-actions/index.d.ts +23 -0
- package/output/layout/list-actions/index.d.ts.map +1 -0
- package/output/layout/list-actions/index.js +15 -0
- package/output/layout/page-back-button/index.d.ts +8 -0
- package/output/layout/page-back-button/index.d.ts.map +1 -0
- package/output/layout/page-back-button/index.js +7 -0
- package/output/layout/pagination/index.d.ts +34 -0
- package/output/layout/pagination/index.d.ts.map +1 -0
- package/output/layout/pagination/index.js +75 -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/{cn → merge-class-names}/index.js +1 -1
- 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/package.json +5 -46
- package/output/utils/cn/index.d.ts +0 -3
- package/output/utils/cn/index.d.ts.map +0 -1
- package/output/utils/cn/index.test.d.ts.map +0 -1
- package/output/utils/cn/index.test.js +0 -7
- /package/output/utils/{cn → merge-class-names}/index.test.d.ts +0 -0
|
@@ -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 };
|
|
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Checkbox as CheckboxPrimitive } from 'radix-ui';
|
|
15
15
|
import { CheckIcon } from 'lucide-react';
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
17
|
function Checkbox(params) {
|
|
18
18
|
const { className } = params, props = __rest(params, ["className"]);
|
|
19
|
-
return (_jsx(CheckboxPrimitive.Root, Object.assign({ "data-slot": "checkbox", 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
20
|
}
|
|
21
21
|
export { Checkbox };
|
|
@@ -12,44 +12,44 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Command as CommandPrimitive } from "cmdk";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
|
|
17
17
|
import { InputGroup, InputGroupAddon, } from "./input-group.js";
|
|
18
18
|
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
19
19
|
function Command(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", 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
22
|
}
|
|
23
23
|
function CommandDialog(params) {
|
|
24
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:
|
|
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
26
|
}
|
|
27
27
|
function CommandInput(params) {
|
|
28
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:
|
|
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
30
|
}
|
|
31
31
|
function CommandList(params) {
|
|
32
32
|
const { className } = params, props = __rest(params, ["className"]);
|
|
33
|
-
return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", 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
34
|
}
|
|
35
35
|
function CommandEmpty(params) {
|
|
36
36
|
const { className } = params, props = __rest(params, ["className"]);
|
|
37
|
-
return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className:
|
|
37
|
+
return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: mergeClassNames("py-6 text-center text-sm", className) }, props)));
|
|
38
38
|
}
|
|
39
39
|
function CommandGroup(params) {
|
|
40
40
|
const { className } = params, props = __rest(params, ["className"]);
|
|
41
|
-
return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", 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
42
|
}
|
|
43
43
|
function CommandSeparator(params) {
|
|
44
44
|
const { className } = params, props = __rest(params, ["className"]);
|
|
45
|
-
return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", 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
46
|
}
|
|
47
47
|
function CommandItem(params) {
|
|
48
48
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
49
|
-
return (_jsxs(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className:
|
|
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
50
|
}
|
|
51
51
|
function CommandShortcut(params) {
|
|
52
52
|
const { className } = params, props = __rest(params, ["className"]);
|
|
53
|
-
return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", 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
54
|
}
|
|
55
55
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
import { Button } from './button.js';
|
|
17
17
|
import { XIcon } from 'lucide-react';
|
|
18
18
|
function Dialog(params) {
|
|
@@ -33,26 +33,26 @@ function DialogClose(params) {
|
|
|
33
33
|
}
|
|
34
34
|
function DialogOverlay(params) {
|
|
35
35
|
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
-
return (_jsx(DialogPrimitive.Overlay, Object.assign({ "data-slot": "dialog-overlay", 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
37
|
}
|
|
38
38
|
function DialogContent(params) {
|
|
39
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:
|
|
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
41
|
}
|
|
42
42
|
function DialogHeader(params) {
|
|
43
43
|
const { className } = params, props = __rest(params, ["className"]);
|
|
44
|
-
return (_jsx("div", Object.assign({ "data-slot": "dialog-header", className:
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "dialog-header", className: mergeClassNames('gap-2 flex flex-col', className) }, props)));
|
|
45
45
|
}
|
|
46
46
|
function DialogFooter(params) {
|
|
47
47
|
const { className, showCloseButton = false, children } = params, props = __rest(params, ["className", "showCloseButton", "children"]);
|
|
48
|
-
return (_jsxs("div", Object.assign({ "data-slot": "dialog-footer", className:
|
|
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
49
|
}
|
|
50
50
|
function DialogTitle(params) {
|
|
51
51
|
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
-
return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className:
|
|
52
|
+
return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className: mergeClassNames('leading-none font-medium', className) }, props)));
|
|
53
53
|
}
|
|
54
54
|
function DialogDescription(params) {
|
|
55
55
|
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
-
return (_jsx(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", 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
57
|
}
|
|
58
58
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -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 };
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
18
18
|
function DropdownMenu(params) {
|
|
19
19
|
const props = __rest(params, []);
|
|
@@ -29,7 +29,7 @@ function DropdownMenuTrigger(params) {
|
|
|
29
29
|
}
|
|
30
30
|
function DropdownMenuContent(params) {
|
|
31
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:
|
|
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
33
|
}
|
|
34
34
|
function DropdownMenuGroup(params) {
|
|
35
35
|
const props = __rest(params, []);
|
|
@@ -37,11 +37,11 @@ function DropdownMenuGroup(params) {
|
|
|
37
37
|
}
|
|
38
38
|
function DropdownMenuItem(params) {
|
|
39
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:
|
|
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
41
|
}
|
|
42
42
|
function DropdownMenuCheckboxItem(params) {
|
|
43
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:
|
|
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
45
|
}
|
|
46
46
|
function DropdownMenuRadioGroup(params) {
|
|
47
47
|
const props = __rest(params, []);
|
|
@@ -49,19 +49,19 @@ function DropdownMenuRadioGroup(params) {
|
|
|
49
49
|
}
|
|
50
50
|
function DropdownMenuRadioItem(params) {
|
|
51
51
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
52
|
-
return (_jsxs(DropdownMenuPrimitive.RadioItem, Object.assign({ "data-slot": "dropdown-menu-radio-item", className:
|
|
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
53
|
}
|
|
54
54
|
function DropdownMenuLabel(params) {
|
|
55
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:
|
|
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
57
|
}
|
|
58
58
|
function DropdownMenuSeparator(params) {
|
|
59
59
|
const { className } = params, props = __rest(params, ["className"]);
|
|
60
|
-
return (_jsx(DropdownMenuPrimitive.Separator, Object.assign({ "data-slot": "dropdown-menu-separator", 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
61
|
}
|
|
62
62
|
function DropdownMenuShortcut(params) {
|
|
63
63
|
const { className } = params, props = __rest(params, ["className"]);
|
|
64
|
-
return (_jsx("span", Object.assign({ "data-slot": "dropdown-menu-shortcut", 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
65
|
}
|
|
66
66
|
function DropdownMenuSub(params) {
|
|
67
67
|
const props = __rest(params, []);
|
|
@@ -69,10 +69,10 @@ function DropdownMenuSub(params) {
|
|
|
69
69
|
}
|
|
70
70
|
function DropdownMenuSubTrigger(params) {
|
|
71
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:
|
|
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
73
|
}
|
|
74
74
|
function DropdownMenuSubContent(params) {
|
|
75
75
|
const { className } = params, props = __rest(params, ["className"]);
|
|
76
|
-
return (_jsx(DropdownMenuPrimitive.SubContent, Object.assign({ "data-slot": "dropdown-menu-sub-content", 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
77
|
}
|
|
78
78
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -13,20 +13,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useMemo } from "react";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { Label } from "./label.js";
|
|
18
18
|
import { Separator } from "./separator.js";
|
|
19
19
|
function FieldSet(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx("fieldset", Object.assign({ "data-slot": "field-set", className:
|
|
21
|
+
return (_jsx("fieldset", Object.assign({ "data-slot": "field-set", className: mergeClassNames("gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className) }, props)));
|
|
22
22
|
}
|
|
23
23
|
function FieldLegend(params) {
|
|
24
24
|
const { className, variant = "legend" } = params, props = __rest(params, ["className", "variant"]);
|
|
25
|
-
return (_jsx("legend", Object.assign({ "data-slot": "field-legend", "data-variant": variant, className:
|
|
25
|
+
return (_jsx("legend", Object.assign({ "data-slot": "field-legend", "data-variant": variant, className: mergeClassNames("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className) }, props)));
|
|
26
26
|
}
|
|
27
27
|
function FieldGroup(params) {
|
|
28
28
|
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-group", className:
|
|
29
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-group", className: mergeClassNames("gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col", className) }, props)));
|
|
30
30
|
}
|
|
31
31
|
const fieldVariants = cva("data-[invalid=true]:text-destructive gap-3 group/field flex w-full", {
|
|
32
32
|
variants: {
|
|
@@ -42,27 +42,27 @@ const fieldVariants = cva("data-[invalid=true]:text-destructive gap-3 group/fiel
|
|
|
42
42
|
});
|
|
43
43
|
function Field(params) {
|
|
44
44
|
const { className, orientation = "vertical" } = params, props = __rest(params, ["className", "orientation"]);
|
|
45
|
-
return (_jsx("div", Object.assign({ role: "group", "data-slot": "field", "data-orientation": orientation, className:
|
|
45
|
+
return (_jsx("div", Object.assign({ role: "group", "data-slot": "field", "data-orientation": orientation, className: mergeClassNames(fieldVariants({ orientation }), className) }, props)));
|
|
46
46
|
}
|
|
47
47
|
function FieldContent(params) {
|
|
48
48
|
const { className } = params, props = __rest(params, ["className"]);
|
|
49
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-content", className:
|
|
49
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-content", className: mergeClassNames("gap-1 group/field-content flex flex-1 flex-col leading-snug", className) }, props)));
|
|
50
50
|
}
|
|
51
51
|
function FieldLabel(params) {
|
|
52
52
|
const { className } = params, props = __rest(params, ["className"]);
|
|
53
|
-
return (_jsx(Label, Object.assign({ "data-slot": "field-label", className:
|
|
53
|
+
return (_jsx(Label, Object.assign({ "data-slot": "field-label", className: mergeClassNames("has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-3 group/field-label peer/field-label flex w-fit leading-snug", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className) }, props)));
|
|
54
54
|
}
|
|
55
55
|
function FieldTitle(params) {
|
|
56
56
|
const { className } = params, props = __rest(params, ["className"]);
|
|
57
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-label", className:
|
|
57
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-label", className: mergeClassNames("gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug", className) }, props)));
|
|
58
58
|
}
|
|
59
59
|
function FieldDescription(params) {
|
|
60
60
|
const { className } = params, props = __rest(params, ["className"]);
|
|
61
|
-
return (_jsx("p", Object.assign({ "data-slot": "field-description", className:
|
|
61
|
+
return (_jsx("p", Object.assign({ "data-slot": "field-description", className: mergeClassNames("text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className) }, props)));
|
|
62
62
|
}
|
|
63
63
|
function FieldSeparator(params) {
|
|
64
64
|
const { children, className } = params, props = __rest(params, ["children", "className"]);
|
|
65
|
-
return (_jsxs("div", Object.assign({ "data-slot": "field-separator", "data-content": !!children, className:
|
|
65
|
+
return (_jsxs("div", Object.assign({ "data-slot": "field-separator", "data-content": !!children, className: mergeClassNames("-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative", className) }, props, { children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit", "data-slot": "field-separator-content", children: children }))] })));
|
|
66
66
|
}
|
|
67
67
|
function FieldError(params) {
|
|
68
68
|
const { className, children, errors } = params, props = __rest(params, ["className", "children", "errors"]);
|
|
@@ -85,7 +85,7 @@ function FieldError(params) {
|
|
|
85
85
|
if (!content) {
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
|
-
return (_jsx("div", Object.assign({ role: "alert", "data-slot": "field-error", className:
|
|
88
|
+
return (_jsx("div", Object.assign({ role: "alert", "data-slot": "field-error", className: mergeClassNames("text-destructive text-sm font-normal", className) }, props, { children: content })));
|
|
89
89
|
}
|
|
90
90
|
// 命名空间导出
|
|
91
91
|
const FieldNamespace = Object.assign(Field, {
|
|
@@ -4,11 +4,14 @@ export * from './avatar.js';
|
|
|
4
4
|
export * from './badge.js';
|
|
5
5
|
export * from './button.js';
|
|
6
6
|
export * from './card.js';
|
|
7
|
+
export * from './calendar.js';
|
|
8
|
+
export * from './chart.js';
|
|
7
9
|
export * from './checkbox.js';
|
|
8
10
|
export * from './command.js';
|
|
9
11
|
export * from './dialog.js';
|
|
10
12
|
export * from './direction.js';
|
|
11
13
|
export * from './dropdown-menu.js';
|
|
14
|
+
export * from './drawer.js';
|
|
12
15
|
export * from './field.js';
|
|
13
16
|
export * from './input-group.js';
|
|
14
17
|
export * from './input.js';
|
|
@@ -32,5 +35,8 @@ export * from './table.js';
|
|
|
32
35
|
export * from './tabs.js';
|
|
33
36
|
export * from './textarea.js';
|
|
34
37
|
export * from './theme-switcher.js';
|
|
38
|
+
export * from './toggle.js';
|
|
39
|
+
export * from './toggle-group.js';
|
|
35
40
|
export * from './tooltip.js';
|
|
41
|
+
export * from './sidebar.js';
|
|
36
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
|
|
@@ -4,11 +4,14 @@ export * from './avatar.js';
|
|
|
4
4
|
export * from './badge.js';
|
|
5
5
|
export * from './button.js';
|
|
6
6
|
export * from './card.js';
|
|
7
|
+
export * from './calendar.js';
|
|
8
|
+
export * from './chart.js';
|
|
7
9
|
export * from './checkbox.js';
|
|
8
10
|
export * from './command.js';
|
|
9
11
|
export * from './dialog.js';
|
|
10
12
|
export * from './direction.js';
|
|
11
13
|
export * from './dropdown-menu.js';
|
|
14
|
+
export * from './drawer.js';
|
|
12
15
|
export * from './field.js';
|
|
13
16
|
export * from './input-group.js';
|
|
14
17
|
export * from './input.js';
|
|
@@ -32,4 +35,7 @@ export * from './table.js';
|
|
|
32
35
|
export * from './tabs.js';
|
|
33
36
|
export * from './textarea.js';
|
|
34
37
|
export * from './theme-switcher.js';
|
|
38
|
+
export * from './toggle.js';
|
|
39
|
+
export * from './toggle-group.js';
|
|
35
40
|
export * from './tooltip.js';
|
|
41
|
+
export * from './sidebar.js';
|
|
@@ -7,7 +7,7 @@ declare const inputGroupAddonVariants: (props?: ({
|
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function InputGroupAddon(params: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
9
9
|
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
-
size?: "
|
|
10
|
+
size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare function InputGroupButton(params: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
|
13
13
|
declare function InputGroupText(params: React.ComponentProps<"span">): React.JSX.Element;
|