@mantajs/ui 0.2.0-beta.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/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +25 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +32 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/avatar.d.ts +16 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +23 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +30 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +45 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +43 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +17 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart.d.ts +63 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +122 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/command.d.ts +78 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +17 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +12 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.js +51 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +14 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +17 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +49 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +47 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/input.d.ts +7 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +9 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +9 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +10 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/pagination.d.ts +14 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +14 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +10 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +8 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +11 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +6 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +8 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +12 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +22 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +9 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +16 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +20 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +30 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/sonner.d.ts +5 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +17 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +40 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +40 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +10 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/tooltip.d.ts +16 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +16 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-prompt.d.ts +17 -0
- package/dist/hooks/use-prompt.d.ts.map +1 -0
- package/dist/hooks/use-prompt.js +39 -0
- package/dist/hooks/use-prompt.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/__tests__/date-range.test.d.ts +2 -0
- package/dist/lib/__tests__/date-range.test.d.ts.map +1 -0
- package/dist/lib/__tests__/date-range.test.js +63 -0
- package/dist/lib/__tests__/date-range.test.js.map +1 -0
- package/dist/lib/date-range.d.ts +41 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +111 -0
- package/dist/lib/date-range.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Chart primitives — verbatim from shadcn/ui registry, lightly adapted to
|
|
3
|
+
// match repo conventions (path aliases, single-quote style). Provides
|
|
4
|
+
// ChartContainer + a typed tooltip/legend setup over Recharts.
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import * as RechartsPrimitive from 'recharts';
|
|
7
|
+
import { cn } from '../lib/utils';
|
|
8
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
9
|
+
const THEMES = { light: '', dark: '.dark' };
|
|
10
|
+
const ChartContext = React.createContext(null);
|
|
11
|
+
function useChart() {
|
|
12
|
+
const context = React.useContext(ChartContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
const ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
19
|
+
const uniqueId = React.useId();
|
|
20
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
21
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-chart": chartId, ref: ref, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
22
|
+
});
|
|
23
|
+
ChartContainer.displayName = 'Chart';
|
|
24
|
+
const ChartStyle = ({ id, config }) => {
|
|
25
|
+
const colorConfig = Object.entries(config).filter(([, cfg]) => cfg.theme || cfg.color);
|
|
26
|
+
if (!colorConfig.length) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return (_jsx("style", {
|
|
30
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: shadcn pattern — injects scoped CSS vars per chart instance
|
|
31
|
+
dangerouslySetInnerHTML: {
|
|
32
|
+
__html: Object.entries(THEMES)
|
|
33
|
+
.map(([theme, prefix]) => `
|
|
34
|
+
${prefix} [data-chart=${id}] {
|
|
35
|
+
${colorConfig
|
|
36
|
+
.map(([key, itemConfig]) => {
|
|
37
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
38
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
39
|
+
})
|
|
40
|
+
.join('\n')}
|
|
41
|
+
}
|
|
42
|
+
`)
|
|
43
|
+
.join('\n'),
|
|
44
|
+
} }));
|
|
45
|
+
};
|
|
46
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
47
|
+
const ChartTooltipContent = React.forwardRef(({ active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }, ref) => {
|
|
48
|
+
const { config } = useChart();
|
|
49
|
+
const tooltipLabel = React.useMemo(() => {
|
|
50
|
+
if (hideLabel || !payload?.length) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const [item] = payload;
|
|
54
|
+
const key = `${labelKey || item.dataKey || item.name || 'value'}`;
|
|
55
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
56
|
+
const value = !labelKey && typeof label === 'string'
|
|
57
|
+
? config[label]?.label || label
|
|
58
|
+
: itemConfig?.label;
|
|
59
|
+
if (labelFormatter) {
|
|
60
|
+
return _jsx("div", { className: cn('font-medium', labelClassName), children: labelFormatter(value, payload) });
|
|
61
|
+
}
|
|
62
|
+
if (!value) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return _jsx("div", { className: cn('font-medium', labelClassName), children: value });
|
|
66
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
67
|
+
if (!active || !payload?.length) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
71
|
+
return (_jsxs("div", { ref: ref, className: cn('grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
72
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
73
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
74
|
+
const indicatorColor = color || item.payload?.fill || item.color;
|
|
75
|
+
return (_jsx("div", { className: cn('flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground', indicator === 'dot' && 'items-center'), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {
|
|
76
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
77
|
+
'w-1': indicator === 'line',
|
|
78
|
+
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
79
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
80
|
+
}), style: {
|
|
81
|
+
'--color-bg': indicatorColor,
|
|
82
|
+
'--color-border': indicatorColor,
|
|
83
|
+
} }))), _jsxs("div", { className: cn('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?.label || item.name })] }), item.value && (_jsx("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() }))] })] })) }, item.dataKey ?? index));
|
|
84
|
+
}) })] }));
|
|
85
|
+
});
|
|
86
|
+
ChartTooltipContent.displayName = 'ChartTooltip';
|
|
87
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
88
|
+
const ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
|
|
89
|
+
const { config } = useChart();
|
|
90
|
+
if (!payload?.length) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return (_jsx("div", { ref: ref, className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload.map((item) => {
|
|
94
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
95
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
96
|
+
return (_jsxs("div", { className: cn('flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground'), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
97
|
+
backgroundColor: item.color,
|
|
98
|
+
} })), itemConfig?.label] }, item.value));
|
|
99
|
+
}) }));
|
|
100
|
+
});
|
|
101
|
+
ChartLegendContent.displayName = 'ChartLegend';
|
|
102
|
+
// Helper to extract item config from a payload.
|
|
103
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
104
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
const payloadPayload = 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null
|
|
108
|
+
? payload.payload
|
|
109
|
+
: undefined;
|
|
110
|
+
let configLabelKey = key;
|
|
111
|
+
if (key in payload && typeof payload[key] === 'string') {
|
|
112
|
+
configLabelKey = payload[key];
|
|
113
|
+
}
|
|
114
|
+
else if (payloadPayload &&
|
|
115
|
+
key in payloadPayload &&
|
|
116
|
+
typeof payloadPayload[key] === 'string') {
|
|
117
|
+
configLabelKey = payloadPayload[key];
|
|
118
|
+
}
|
|
119
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
120
|
+
}
|
|
121
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
122
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../src/components/chart.tsx"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,+DAA+D;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAA;AAE7C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,uCAAuC;AACvC,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAW,CAAA;AAapD,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAA2B,IAAI,CAAC,CAAA;AAExE,SAAS,QAAQ;IACf,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;IAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;IACtE,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAM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ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
5
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAE7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,QAAQ,iKAgBZ,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
import { Check } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn('flex items-center justify-center text-current'), children: _jsx(Check, { className: "h-4 w-4" }) }) })));
|
|
7
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8
|
+
export { Checkbox };
|
|
9
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,iBAAiB,CAAC,IAAI,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,gTAAgT,EAChT,SAAS,CACV,KACG,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,IAAC,SAAS,EAAE,EAAE,CAAC,+CAA+C,CAAC,YACzF,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,GACD,GACP,CAC1B,CAAC,CAAA;AACF,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DialogProps } from '@radix-ui/react-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
} & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
shouldFilter?: boolean;
|
|
12
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
disablePointerSelection?: boolean;
|
|
18
|
+
vimBindings?: boolean;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const CommandDialog: ({ children, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
22
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
23
|
+
} & {
|
|
24
|
+
asChild?: boolean;
|
|
25
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
26
|
+
value?: string;
|
|
27
|
+
onValueChange?: (search: string) => void;
|
|
28
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
32
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
33
|
+
} & {
|
|
34
|
+
asChild?: boolean;
|
|
35
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
36
|
+
label?: string;
|
|
37
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
41
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
42
|
+
} & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
48
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
49
|
+
} & {
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
|
|
52
|
+
heading?: React.ReactNode;
|
|
53
|
+
value?: string;
|
|
54
|
+
forceMount?: boolean;
|
|
55
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
} & {
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
61
|
+
alwaysRender?: boolean;
|
|
62
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
64
|
+
children?: React.ReactNode;
|
|
65
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
66
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
67
|
+
} & {
|
|
68
|
+
asChild?: boolean;
|
|
69
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
onSelect?: (value: string) => void;
|
|
72
|
+
value?: string;
|
|
73
|
+
keywords?: string[];
|
|
74
|
+
forceMount?: boolean;
|
|
75
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
declare const CommandShortcut: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
|
|
78
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;sFAYX,CAAA;AAEF,QAAA,MAAM,aAAa,GAAI,wBAAwB,WAAW,4CAQzD,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;0FAehB,CAAA;AAEF,QAAA,MAAM,WAAW;;;;;;;;sFASf,CAAA;AAEF,QAAA,MAAM,YAAY;;;;;;uJAGqF,CAAA;AAEvG,QAAA,MAAM,YAAY;;;;;;;;;;sFAYhB,CAAA;AAEF,QAAA,MAAM,gBAAgB;;;;;;sFAKpB,CAAA;AAEF,QAAA,MAAM,WAAW;;;;;;;;;;;;sFAYf,CAAA;AAEF,QAAA,MAAM,eAAe,GAAI,yBAAyB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,4CAEtF,CAAA;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
3
|
+
import { Search } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
|
+
import { Dialog, DialogContent } from './dialog';
|
|
7
|
+
const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', className), ...props })));
|
|
8
|
+
const CommandDialog = ({ children, ...props }) => (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) }) }));
|
|
9
|
+
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [_jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, className: cn('flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
|
|
10
|
+
const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className), ...props })));
|
|
11
|
+
const CommandEmpty = React.forwardRef((props, ref) => _jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props }));
|
|
12
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, className: cn('overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground', className), ...props })));
|
|
13
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn('-mx-1 h-px bg-border', className), ...props })));
|
|
14
|
+
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', className), ...props })));
|
|
15
|
+
const CommandShortcut = ({ className, ...props }) => (_jsx("span", { className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props }));
|
|
16
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
|
|
17
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MA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DAAuD,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACvG,CAAA;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DateRangePreset, type DateRangeValue } from '../lib/date-range';
|
|
2
|
+
export interface DateRangePickerProps {
|
|
3
|
+
value?: DateRangeValue;
|
|
4
|
+
onChange: (next: DateRangeValue) => void;
|
|
5
|
+
allowedPresets?: DateRangePreset[];
|
|
6
|
+
allowCustom?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Override the trigger button content. Defaults to formatRangeLabel(value). */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function DateRangePicker({ value, onChange, allowedPresets, allowCustom, className, label, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=date-range-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-range-picker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAmC,MAAM,mBAAmB,CAAA;AAM9G,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAA;IACxC,cAAc,CAAC,EAAE,eAAe,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAkBD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,cAAqC,EACrC,WAAkB,EAClB,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,2CAiEtB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// DateRangePicker — Popover trigger + Calendar (range) + preset list.
|
|
3
|
+
// Controlled component: emits DateRangeValue via onChange. NO URL coupling.
|
|
4
|
+
import { Calendar as CalendarIcon } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { formatRangeLabel, RANGE_PRESETS } from '../lib/date-range';
|
|
7
|
+
import { cn } from '../lib/utils';
|
|
8
|
+
import { Button } from './button';
|
|
9
|
+
import { Calendar } from './calendar';
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger } from './popover';
|
|
11
|
+
function toIsoDate(d) {
|
|
12
|
+
return new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())).toISOString().slice(0, 10);
|
|
13
|
+
}
|
|
14
|
+
function valueToDayPickerRange(v) {
|
|
15
|
+
if (!v)
|
|
16
|
+
return undefined;
|
|
17
|
+
if (v.kind === 'custom') {
|
|
18
|
+
return { from: new Date(`${v.from}T00:00:00.000Z`), to: new Date(`${v.to}T00:00:00.000Z`) };
|
|
19
|
+
}
|
|
20
|
+
if (v.kind === 'date') {
|
|
21
|
+
const d = new Date(`${v.date}T00:00:00.000Z`);
|
|
22
|
+
return { from: d, to: d };
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
export function DateRangePicker({ value, onChange, allowedPresets = ['7d', '30d', '90d'], allowCustom = true, className, label, }) {
|
|
27
|
+
const [open, setOpen] = React.useState(false);
|
|
28
|
+
const triggerLabel = label ?? (value ? formatRangeLabel(value) : 'Sélectionner une période');
|
|
29
|
+
const presets = RANGE_PRESETS.filter((p) => allowedPresets.includes(p.value));
|
|
30
|
+
const handlePreset = (preset) => {
|
|
31
|
+
onChange({ kind: 'preset', preset });
|
|
32
|
+
setOpen(false);
|
|
33
|
+
};
|
|
34
|
+
const handleRangeSelect = (range) => {
|
|
35
|
+
if (!range?.from)
|
|
36
|
+
return;
|
|
37
|
+
const from = toIsoDate(range.from);
|
|
38
|
+
const to = range.to ? toIsoDate(range.to) : from;
|
|
39
|
+
if (from === to) {
|
|
40
|
+
onChange({ kind: 'date', date: from });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
onChange({ kind: 'custom', from, to });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "small", className: cn('justify-start gap-2', className), children: [_jsx(CalendarIcon, { className: "h-3.5 w-3.5" }), _jsx("span", { children: triggerLabel })] }) }), _jsx(PopoverContent, { className: "w-auto p-0", align: "end", children: _jsxs("div", { className: "flex", children: [presets.length > 0 && (_jsx("div", { className: "flex flex-col gap-1 border-r p-2 min-w-[10rem]", children: presets.map((p) => {
|
|
47
|
+
const isActive = value?.kind === 'preset' && value.preset === p.value;
|
|
48
|
+
return (_jsx("button", { type: "button", onClick: () => handlePreset(p.value), className: cn('rounded-md px-2 py-1.5 text-left text-sm transition-colors', isActive ? 'bg-accent text-accent-foreground' : 'hover:bg-accent'), children: p.label }, p.value));
|
|
49
|
+
}) })), allowCustom && (_jsx(Calendar, { mode: "range", numberOfMonths: 2, selected: valueToDayPickerRange(value), onSelect: handleRangeSelect, defaultMonth: valueToDayPickerRange(value)?.from }))] }) })] }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=date-range-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/components/date-range-picker.tsx"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO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|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const DialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
12
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
13
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
14
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAEzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,aAAa,8GAA0B,CAAA;AAC7C,QAAA,MAAM,YAAY,6CAAyB,CAAA;AAC3C,QAAA,MAAM,WAAW,4GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,8JAYjB,CAAA;AAEF,QAAA,MAAM,aAAa,8JAqBjB,CAAA;AAEF,QAAA,MAAM,YAAY,GAAI,yBAAyB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,4CAElF,CAAA;AAED,QAAA,MAAM,YAAY,GAAI,yBAAyB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,4CAElF,CAAA;AAED,QAAA,MAAM,WAAW,oKASf,CAAA;AAEF,QAAA,MAAM,iBAAiB,8KAKrB,CAAA;AAEF,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,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
9
|
+
const DialogClose = DialogPrimitive.Close;
|
|
10
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
|
|
11
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
12
|
+
const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
|
|
13
|
+
const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
|
|
14
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight', className), ...props })));
|
|
15
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
16
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
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AChB,IACA,IACb,CAChB,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC,EAAE,EAAE,CAAC,CACtF,cAAK,SAAS,EAAE,EAAE,CAAC,oDAAoD,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACnG,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwC,EAAE,EAAE,CAAC,CACtF,cAAK,SAAS,EAAE,EAAE,CAAC,+DAA+D,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC9G,CAAA;AAED,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,KAAK,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,mDAAmD,EAAE,SAAS,CAAC,KACzE,KAAK,GACT,CACH,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,WAAW,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAChH,CAAC,CAAA;AAEF,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,49 @@
|
|
|
1
|
+
import { DropdownMenu as RadixDropdownMenu } from 'radix-ui';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const DropdownMenuPortal: React.FC<RadixDropdownMenu.DropdownMenuPortalProps>;
|
|
6
|
+
declare const DropdownMenuSub: React.FC<RadixDropdownMenu.DropdownMenuSubProps>;
|
|
7
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenu: React.FC<RadixDropdownMenu.DropdownMenuProps> & {
|
|
23
|
+
Trigger: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
Content: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
Item: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
CheckboxItem: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
RadioItem: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Label: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
31
|
+
inset?: boolean;
|
|
32
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Separator: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
Group: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
Portal: React.FC<RadixDropdownMenu.DropdownMenuPortalProps>;
|
|
36
|
+
Sub: React.FC<RadixDropdownMenu.DropdownMenuSubProps>;
|
|
37
|
+
SubMenu: React.FC<RadixDropdownMenu.DropdownMenuSubProps>;
|
|
38
|
+
SubContent: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
SubTrigger: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
40
|
+
inset?: boolean;
|
|
41
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
SubMenuTrigger: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
43
|
+
inset?: boolean;
|
|
44
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
SubMenuContent: React.ForwardRefExoticComponent<Omit<RadixDropdownMenu.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
RadioGroup: React.ForwardRefExoticComponent<RadixDropdownMenu.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
};
|
|
48
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
49
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,QAAA,MAAM,mBAAmB,sHAA4B,CAAA;AACrD,QAAA,MAAM,iBAAiB,iHAA0B,CAAA;AACjD,QAAA,MAAM,kBAAkB,qDAA2B,CAAA;AACnD,QAAA,MAAM,eAAe,kDAAwB,CAAA;AAC7C,QAAA,MAAM,sBAAsB,sHAA+B,CAAA;AAE3D,QAAA,MAAM,sBAAsB;YAEsD,OAAO;wCAavF,CAAA;AAGF,QAAA,MAAM,sBAAsB,yKAY1B,CAAA;AAGF,QAAA,MAAM,mBAAmB,sKAevB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAEsD,OAAO;wCAWjF,CAAA;AAGF,QAAA,MAAM,wBAAwB,2KA0B5B,CAAA;AAGF,QAAA,MAAM,qBAAqB,wKAsBzB,CAAA;AAGF,QAAA,MAAM,iBAAiB;YAEsD,OAAO;wCAOlF,CAAA;AAGF,QAAA,MAAM,qBAAqB,wKAKzB,CAAA;AAKF,QAAA,MAAM,YAAY;;;;gBA1F0D,OAAO;;;;;gBAsEN,OAAO;;;;;;;;;gBAzHF,OAAO;;;gBAAP,OAAO;;;;CA8JvF,CAAA;AAEF,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownMenu as RadixDropdownMenu } from 'radix-ui';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
const DropdownMenuRoot = RadixDropdownMenu.Root;
|
|
6
|
+
const DropdownMenuTrigger = RadixDropdownMenu.Trigger;
|
|
7
|
+
const DropdownMenuGroup = RadixDropdownMenu.Group;
|
|
8
|
+
const DropdownMenuPortal = RadixDropdownMenu.Portal;
|
|
9
|
+
const DropdownMenuSub = RadixDropdownMenu.Sub;
|
|
10
|
+
const DropdownMenuRadioGroup = RadixDropdownMenu.RadioGroup;
|
|
11
|
+
const DropdownMenuSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => (_jsx(RadixDropdownMenu.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: children })));
|
|
12
|
+
DropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';
|
|
13
|
+
const DropdownMenuSubContent = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDropdownMenu.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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', className), ...props })));
|
|
14
|
+
DropdownMenuSubContent.displayName = 'DropdownMenuSubContent';
|
|
15
|
+
const DropdownMenuContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(RadixDropdownMenu.Portal, { children: _jsx(RadixDropdownMenu.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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', className), ...props }) })));
|
|
16
|
+
DropdownMenuContent.displayName = 'DropdownMenuContent';
|
|
17
|
+
const DropdownMenuItem = forwardRef(({ className, inset, ...props }, ref) => (_jsx(RadixDropdownMenu.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props })));
|
|
18
|
+
DropdownMenuItem.displayName = 'DropdownMenuItem';
|
|
19
|
+
const DropdownMenuCheckboxItem = forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(RadixDropdownMenu.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(RadixDropdownMenu.ItemIndicator, { children: _jsxs("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", "aria-hidden": "true", children: [_jsx("title", { children: "Checked" }), _jsx("path", { d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3354 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.5553 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z", fill: "currentColor" })] }) }) }), children] })));
|
|
20
|
+
DropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';
|
|
21
|
+
const DropdownMenuRadioItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(RadixDropdownMenu.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(RadixDropdownMenu.ItemIndicator, { children: _jsxs("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", "aria-hidden": "true", children: [_jsx("title", { children: "Selected" }), _jsx("path", { d: "M7.5 11C9.433 11 11 9.433 11 7.5S9.433 4 7.5 4 4 5.567 4 7.5 5.567 11 7.5 11Z", fill: "currentColor" })] }) }) }), children] })));
|
|
22
|
+
DropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';
|
|
23
|
+
const DropdownMenuLabel = forwardRef(({ className, inset, ...props }, ref) => (_jsx(RadixDropdownMenu.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));
|
|
24
|
+
DropdownMenuLabel.displayName = 'DropdownMenuLabel';
|
|
25
|
+
const DropdownMenuSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDropdownMenu.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-transparent', className), ...props })));
|
|
26
|
+
DropdownMenuSeparator.displayName = 'DropdownMenuSeparator';
|
|
27
|
+
// ── Compound component to match @medusajs/ui DropdownMenu API ──
|
|
28
|
+
const DropdownMenu = Object.assign(DropdownMenuRoot, {
|
|
29
|
+
Trigger: DropdownMenuTrigger,
|
|
30
|
+
Content: DropdownMenuContent,
|
|
31
|
+
Item: DropdownMenuItem,
|
|
32
|
+
CheckboxItem: DropdownMenuCheckboxItem,
|
|
33
|
+
RadioItem: DropdownMenuRadioItem,
|
|
34
|
+
Label: DropdownMenuLabel,
|
|
35
|
+
Separator: DropdownMenuSeparator,
|
|
36
|
+
Group: DropdownMenuGroup,
|
|
37
|
+
Portal: DropdownMenuPortal,
|
|
38
|
+
Sub: DropdownMenuSub,
|
|
39
|
+
SubMenu: DropdownMenuSub,
|
|
40
|
+
SubContent: DropdownMenuSubContent,
|
|
41
|
+
SubTrigger: DropdownMenuSubTrigger,
|
|
42
|
+
SubMenuTrigger: DropdownMenuSubTrigger,
|
|
43
|
+
SubMenuContent: DropdownMenuSubContent,
|
|
44
|
+
RadioGroup: DropdownMenuRadioGroup,
|
|
45
|
+
});
|
|
46
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
47
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,IAAI,CAAA;AAC/C,MAAM,mBA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gBAAgB;IACtB,YAAY,EAAE,wBAAwB;IACtC,SAAS,EAAE,qBAAqB;IAChC,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,qBAAqB;IAChC,KAAK,EAAE,iBAAiB;IACxB,MAAM,EAAE,kBAAkB;IAC1B,GAAG,EAAE,eAAe;IACpB,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,sBAAsB;IAClC,UAAU,EAAE,sBAAsB;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,sBAAsB;IACtC,UAAU,EAAE,sBAAsB;CACnC,CAAC,CAAA;AAEF,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
size?: 'default' | 'small';
|
|
4
|
+
}
|
|
5
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export { Input };
|
|
7
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3F,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAC3B;AAED,QAAA,MAAM,KAAK,qFAaT,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cn } from '../lib/utils';
|
|
4
|
+
const Input = forwardRef(({ className, type, size = 'default', ...props }, ref) => {
|
|
5
|
+
return (_jsx("input", { type: type, className: cn('flex w-full rounded-md bg-card px-3 text-sm text-foreground placeholder:text-muted-foreground transition-all border border-transparent focus-visible:outline-none focus-visible:border-border focus-visible:ring-1 focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50', size === 'small' ? 'h-7 py-1 text-xs' : 'h-8 py-1.5', className), ref: ref, ...props }));
|
|
6
|
+
});
|
|
7
|
+
Input.displayName = 'Input';
|
|
8
|
+
export { Input };
|
|
9
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAMjC,MAAM,KAAK,GAAG,UAAU,CAA+B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC9G,OAAO,CACL,gBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,+RAA+R,EAC/R,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,EACpD,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Label as RadixLabel } from 'radix-ui';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<RadixLabel.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & {
|
|
5
|
+
size?: "small" | "base" | "large" | "xsmall";
|
|
6
|
+
weight?: "regular" | "plus";
|
|
7
|
+
} & React.RefAttributes<HTMLLabelElement>>;
|
|
8
|
+
export { Label };
|
|
9
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,QAAA,MAAM,KAAK;WAIE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;aACnC,SAAS,GAAG,MAAM;0CAI/B,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { Label as RadixLabel } from 'radix-ui';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { cn } from '../lib/utils';
|
|
6
|
+
const labelVariants = cva('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70');
|
|
7
|
+
const Label = forwardRef(({ className, size: _size, weight: _weight, ...props }, ref) => (_jsx(RadixLabel.Root, { ref: ref, className: cn(labelVariants(), className), ...props })));
|
|
8
|
+
Label.displayName = 'Label';
|
|
9
|
+
export { Label };
|
|
10
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,aAAa,GAAG,GAAG,CAAC,4FAA4F,CAAC,CAAA;AAEvH,MAAM,KAAK,GAAG,UAAU,CAOtB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChE,KAAC,UAAU,CAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACpF,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,CAAA"}
|