@caffeinebounce/ui 0.62.3 → 0.63.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/README.md +1 -1
- package/dist/blog.js +7 -6
- package/dist/blog.mjs +2 -1
- package/dist/charts.d.cts +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/{chunk-6DVWMJ3H.mjs → chunk-2EFVMX6V.mjs} +3 -3
- package/dist/{chunk-6ZJCK6KH.js → chunk-375DECW4.js} +31 -31
- package/dist/{chunk-PZRI43EZ.js → chunk-46JYKBRX.js} +0 -43
- package/dist/chunk-5D55OVD5.js +75 -0
- package/dist/{chunk-JORVSG52.js → chunk-663CFAHS.js} +211 -269
- package/dist/chunk-6HKJDV43.mjs +48 -0
- package/dist/chunk-6NCRGHV3.mjs +64 -0
- package/dist/{chunk-OLAAXLXY.mjs → chunk-6QAKQG57.mjs} +4 -4
- package/dist/{chunk-N6AFNFZR.mjs → chunk-7ERVZXIN.mjs} +214 -270
- package/dist/chunk-APFEP5B7.mjs +100 -0
- package/dist/chunk-C3OADNSG.js +348 -0
- package/dist/{chunk-GIJQE3JR.js → chunk-DH5Z3ETN.js} +66 -45
- package/dist/chunk-DYWZ23QT.mjs +90 -0
- package/dist/{chunk-DTVWRRFN.mjs → chunk-E67IR6HU.mjs} +30 -9
- package/dist/{chunk-OVNLC5RD.mjs → chunk-EXQSWHLD.mjs} +6 -6
- package/dist/{chunk-ZOA7B32D.js → chunk-F35KL6TX.js} +9 -9
- package/dist/{chunk-YSLD2HLP.mjs → chunk-FFJC66KO.mjs} +1 -1
- package/dist/{chunk-MPZFPU4X.js → chunk-GMBLPQ3I.js} +3 -3
- package/dist/chunk-IJFPPLQW.js +50 -0
- package/dist/{chunk-BMFQG6RA.mjs → chunk-KJIX6V32.mjs} +107 -1885
- package/dist/chunk-LABHD4PU.js +109 -0
- package/dist/{chunk-GAIQJCAZ.js → chunk-LT5VD4KR.js} +149 -1953
- package/dist/{chunk-7DHKQODW.mjs → chunk-LTLCIRZY.mjs} +256 -474
- package/dist/chunk-N5BHXWR3.mjs +34 -0
- package/dist/chunk-OCO3Z5YA.js +37 -0
- package/dist/chunk-OIJ7XMDV.mjs +71 -0
- package/dist/chunk-ORBH4IBC.mjs +316 -0
- package/dist/chunk-OWWOAYIY.js +2652 -0
- package/dist/chunk-PFHOXDSW.mjs +10 -0
- package/dist/chunk-QRS7DJGS.js +103 -0
- package/dist/{chunk-NXPEJ2UR.mjs → chunk-R3X4B4JJ.mjs} +53 -6
- package/dist/chunk-RM7ACPTM.mjs +2601 -0
- package/dist/chunk-RODSGPBB.mjs +75 -0
- package/dist/{chunk-T6ZBA6VJ.js → chunk-UHAV34YX.js} +8 -8
- package/dist/{chunk-GUSTCU2W.mjs → chunk-ULANYJ7Y.mjs} +1 -59
- package/dist/chunk-ULDE7QSN.js +70 -0
- package/dist/chunk-UT36VNVZ.mjs +47 -0
- package/dist/chunk-UY3H4PKB.js +71 -0
- package/dist/{chunk-KB7UXIQZ.mjs → chunk-VIVWFQG5.mjs} +2 -1
- package/dist/{chunk-ESZ7CBA2.js → chunk-VKBJ3SGT.js} +6 -5
- package/dist/{chunk-UM7WMXIU.js → chunk-W3YOQ5ZD.js} +264 -505
- package/dist/{chunk-GHOFYK2E.js → chunk-XGJL6DLV.js} +55 -5
- package/dist/chunk-YRIBFIQ5.js +116 -0
- package/dist/chunk-ZWWJ3RRA.js +15 -0
- package/dist/data-grid.d.cts +241 -0
- package/dist/data-grid.d.ts +241 -0
- package/dist/data-grid.js +6486 -0
- package/dist/data-grid.mjs +6459 -0
- package/dist/data-table-CDQBo-Ve.d.ts +818 -0
- package/dist/data-table-jLzt6plY.d.cts +818 -0
- package/dist/data-table.d.cts +8 -42
- package/dist/data-table.d.ts +8 -42
- package/dist/data-table.js +61 -187
- package/dist/data-table.mjs +11 -5
- package/dist/finance.d.cts +534 -0
- package/dist/finance.d.ts +534 -0
- package/dist/finance.js +188 -0
- package/dist/finance.mjs +15 -0
- package/dist/forms.js +9 -6
- package/dist/forms.mjs +7 -4
- package/dist/{hooks-B2jU1GVT.d.ts → hooks-A55E0fgf.d.ts} +3 -2
- package/dist/{hooks-8ORd7T1A.d.cts → hooks-Bys_AZPI.d.cts} +3 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +26 -23
- package/dist/hooks.mjs +6 -3
- package/dist/index.d.cts +536 -665
- package/dist/index.d.ts +536 -665
- package/dist/index.js +3829 -3408
- package/dist/index.mjs +2067 -1767
- package/dist/layouts.js +25 -25
- package/dist/layouts.mjs +4 -4
- package/dist/marketing.js +74 -74
- package/dist/marketing.mjs +4 -4
- package/dist/navigation.js +28 -28
- package/dist/navigation.mjs +6 -6
- package/dist/primitives.d.cts +72 -109
- package/dist/primitives.d.ts +72 -109
- package/dist/primitives.js +78 -72
- package/dist/primitives.mjs +8 -6
- package/dist/settings.js +9 -9
- package/dist/settings.mjs +4 -4
- package/package.json +17 -1
- package/dist/UnifiedTableControls-CG299y9h.d.ts +0 -1233
- package/dist/UnifiedTableControls-CIjRpNhy.d.cts +0 -1233
- package/dist/chunk-GMBGWOCR.mjs +0 -49
- package/dist/chunk-HBLKVQIQ.mjs +0 -23
- package/dist/chunk-HMAMMC72.js +0 -26
- package/dist/chunk-MVYRNJA6.js +0 -75
- /package/dist/{chunk-RVEFPVZF.mjs → chunk-C57MX3BG.mjs} +0 -0
- /package/dist/{chunk-C4UT5V3P.js → chunk-OWHI5VGJ.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { Loader2Icon } from 'lucide-react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Spinner({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Loader2Icon,
|
|
9
|
+
{
|
|
10
|
+
role: "status",
|
|
11
|
+
"aria-label": "Loading",
|
|
12
|
+
className: cn("size-4 animate-spin", className),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
var spinnerVariants = cva("text-muted-foreground", {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
xs: "size-3",
|
|
21
|
+
sm: "size-4",
|
|
22
|
+
md: "size-6",
|
|
23
|
+
lg: "size-8"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "sm"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function SizedSpinner({ className, size, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(Spinner, { className: cn(spinnerVariants({ size }), className), ...props });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { SizedSpinner, spinnerVariants };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function Spinner({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
lucideReact.Loader2Icon,
|
|
11
|
+
{
|
|
12
|
+
role: "status",
|
|
13
|
+
"aria-label": "Loading",
|
|
14
|
+
className: chunkADIDI7AJ_js.cn("size-4 animate-spin", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
var spinnerVariants = classVarianceAuthority.cva("text-muted-foreground", {
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
xs: "size-3",
|
|
23
|
+
sm: "size-4",
|
|
24
|
+
md: "size-6",
|
|
25
|
+
lg: "size-8"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: "sm"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function SizedSpinner({ className, size, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: chunkADIDI7AJ_js.cn(spinnerVariants({ size }), className), ...props });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.SizedSpinner = SizedSpinner;
|
|
37
|
+
exports.spinnerVariants = spinnerVariants;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/hooks/spreadsheetWorkbook.ts
|
|
2
|
+
function escapeXml(value) {
|
|
3
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4
|
+
}
|
|
5
|
+
function styleId(style) {
|
|
6
|
+
if (!style) return void 0;
|
|
7
|
+
const map = {
|
|
8
|
+
header: "Header",
|
|
9
|
+
text: "Text",
|
|
10
|
+
number: "Number",
|
|
11
|
+
currency: "Currency",
|
|
12
|
+
percent: "Percent",
|
|
13
|
+
totalLabel: "TotalLabel",
|
|
14
|
+
totalNumber: "TotalNumber"
|
|
15
|
+
};
|
|
16
|
+
return map[style];
|
|
17
|
+
}
|
|
18
|
+
function excelColumnName(columnIndex) {
|
|
19
|
+
let n = columnIndex + 1;
|
|
20
|
+
let result = "";
|
|
21
|
+
while (n > 0) {
|
|
22
|
+
const rem = (n - 1) % 26;
|
|
23
|
+
result = String.fromCharCode(65 + rem) + result;
|
|
24
|
+
n = Math.floor((n - 1) / 26);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
function buildSpreadsheetWorkbookXml({
|
|
29
|
+
worksheetName,
|
|
30
|
+
rows
|
|
31
|
+
}) {
|
|
32
|
+
const xmlRows = rows.map(
|
|
33
|
+
(row) => `<Row>${row.map((cell) => {
|
|
34
|
+
const inferredType = cell.type ?? (typeof cell.value === "number" || cell.formula ? "Number" : "String");
|
|
35
|
+
const rawValue = cell.value ?? "";
|
|
36
|
+
const value = inferredType === "Number" ? Number(rawValue || 0) : escapeXml(String(rawValue));
|
|
37
|
+
const style = styleId(cell.style);
|
|
38
|
+
const styleAttr = style ? ` ss:StyleID="${style}"` : "";
|
|
39
|
+
const formulaAttr = cell.formula ? ` ss:Formula="=${escapeXml(cell.formula)}"` : "";
|
|
40
|
+
return `<Cell${styleAttr}${formulaAttr}><Data ss:Type="${inferredType}">${value}</Data></Cell>`;
|
|
41
|
+
}).join("")}</Row>`
|
|
42
|
+
).join("\n");
|
|
43
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
44
|
+
<?mso-application progid="Excel.Sheet"?>
|
|
45
|
+
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
|
|
46
|
+
<Styles>
|
|
47
|
+
<Style ss:ID="Header"><Font ss:Bold="1"/><Interior ss:Color="#F3F4F6" ss:Pattern="Solid"/></Style>
|
|
48
|
+
<Style ss:ID="Text"><NumberFormat ss:Format="@"/></Style>
|
|
49
|
+
<Style ss:ID="Number"><NumberFormat ss:Format="#,##0.00"/></Style>
|
|
50
|
+
<Style ss:ID="Currency"><NumberFormat ss:Format="$#,##0.00;[Red]($#,##0.00)"/></Style>
|
|
51
|
+
<Style ss:ID="Percent"><NumberFormat ss:Format="0.00%"/></Style>
|
|
52
|
+
<Style ss:ID="TotalLabel"><Font ss:Bold="1"/><Interior ss:Color="#F9FAFB" ss:Pattern="Solid"/></Style>
|
|
53
|
+
<Style ss:ID="TotalNumber"><Font ss:Bold="1"/><NumberFormat ss:Format="$#,##0.00;[Red]($#,##0.00)"/><Interior ss:Color="#F9FAFB" ss:Pattern="Solid"/></Style>
|
|
54
|
+
</Styles>
|
|
55
|
+
<Worksheet ss:Name="${escapeXml(worksheetName)}"><Table>
|
|
56
|
+
${xmlRows}
|
|
57
|
+
</Table></Worksheet></Workbook>`;
|
|
58
|
+
}
|
|
59
|
+
function downloadExcelXml(xml, filename) {
|
|
60
|
+
const blob = new Blob([xml], {
|
|
61
|
+
type: "application/vnd.ms-excel;charset=utf-8;"
|
|
62
|
+
});
|
|
63
|
+
const url = URL.createObjectURL(blob);
|
|
64
|
+
const link = document.createElement("a");
|
|
65
|
+
link.href = url;
|
|
66
|
+
link.download = `${filename}.xls`;
|
|
67
|
+
link.click();
|
|
68
|
+
URL.revokeObjectURL(url);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { buildSpreadsheetWorkbookXml, downloadExcelXml, excelColumnName };
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Dialog, DialogContent, DialogTitle } from './chunk-5THF4YP6.mjs';
|
|
3
|
+
import { buttonVariants, Button } from './chunk-VBD4Q5LL.mjs';
|
|
4
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, Search } from 'lucide-react';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
import { Command as Command$1 } from 'cmdk';
|
|
10
|
+
|
|
11
|
+
function Calendar({
|
|
12
|
+
className,
|
|
13
|
+
classNames,
|
|
14
|
+
showOutsideDays = true,
|
|
15
|
+
captionLayout = "label",
|
|
16
|
+
buttonVariant = "ghost",
|
|
17
|
+
formatters,
|
|
18
|
+
components,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const defaultClassNames = getDefaultClassNames();
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
DayPicker,
|
|
24
|
+
{
|
|
25
|
+
showOutsideDays,
|
|
26
|
+
className: cn(
|
|
27
|
+
"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
28
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
29
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
captionLayout,
|
|
33
|
+
formatters: {
|
|
34
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
35
|
+
...formatters
|
|
36
|
+
},
|
|
37
|
+
classNames: {
|
|
38
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
39
|
+
months: cn(
|
|
40
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
41
|
+
defaultClassNames.months
|
|
42
|
+
),
|
|
43
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
44
|
+
nav: cn(
|
|
45
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
46
|
+
defaultClassNames.nav
|
|
47
|
+
),
|
|
48
|
+
button_previous: cn(
|
|
49
|
+
buttonVariants({ variant: buttonVariant }),
|
|
50
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
51
|
+
defaultClassNames.button_previous
|
|
52
|
+
),
|
|
53
|
+
button_next: cn(
|
|
54
|
+
buttonVariants({ variant: buttonVariant }),
|
|
55
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
56
|
+
defaultClassNames.button_next
|
|
57
|
+
),
|
|
58
|
+
month_caption: cn(
|
|
59
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
60
|
+
defaultClassNames.month_caption
|
|
61
|
+
),
|
|
62
|
+
dropdowns: cn(
|
|
63
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
64
|
+
defaultClassNames.dropdowns
|
|
65
|
+
),
|
|
66
|
+
dropdown_root: cn(
|
|
67
|
+
"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
68
|
+
defaultClassNames.dropdown_root
|
|
69
|
+
),
|
|
70
|
+
dropdown: cn(
|
|
71
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
72
|
+
defaultClassNames.dropdown
|
|
73
|
+
),
|
|
74
|
+
caption_label: cn(
|
|
75
|
+
"font-medium select-none",
|
|
76
|
+
captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
77
|
+
defaultClassNames.caption_label
|
|
78
|
+
),
|
|
79
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
80
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
81
|
+
weekday: cn(
|
|
82
|
+
"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
83
|
+
defaultClassNames.weekday
|
|
84
|
+
),
|
|
85
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
86
|
+
week_number_header: cn(
|
|
87
|
+
"w-(--cell-size) select-none",
|
|
88
|
+
defaultClassNames.week_number_header
|
|
89
|
+
),
|
|
90
|
+
week_number: cn(
|
|
91
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
92
|
+
defaultClassNames.week_number
|
|
93
|
+
),
|
|
94
|
+
day: cn(
|
|
95
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
96
|
+
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
97
|
+
defaultClassNames.day
|
|
98
|
+
),
|
|
99
|
+
range_start: cn(
|
|
100
|
+
"rounded-l-md bg-accent",
|
|
101
|
+
defaultClassNames.range_start
|
|
102
|
+
),
|
|
103
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
104
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
105
|
+
today: cn(
|
|
106
|
+
"rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
107
|
+
defaultClassNames.today
|
|
108
|
+
),
|
|
109
|
+
outside: cn(
|
|
110
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
111
|
+
defaultClassNames.outside
|
|
112
|
+
),
|
|
113
|
+
disabled: cn(
|
|
114
|
+
"text-muted-foreground opacity-50",
|
|
115
|
+
defaultClassNames.disabled
|
|
116
|
+
),
|
|
117
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
118
|
+
...classNames
|
|
119
|
+
},
|
|
120
|
+
components: {
|
|
121
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "calendar",
|
|
126
|
+
ref: rootRef,
|
|
127
|
+
className: cn(className2),
|
|
128
|
+
...props2
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
},
|
|
132
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
133
|
+
if (orientation === "left") {
|
|
134
|
+
return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
135
|
+
}
|
|
136
|
+
if (orientation === "right") {
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
ChevronRightIcon,
|
|
139
|
+
{
|
|
140
|
+
className: cn("size-4", className2),
|
|
141
|
+
...props2
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
|
|
146
|
+
},
|
|
147
|
+
DayButton: CalendarDayButton,
|
|
148
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
149
|
+
return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
150
|
+
},
|
|
151
|
+
...components
|
|
152
|
+
},
|
|
153
|
+
...props
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function CalendarDayButton({
|
|
158
|
+
className,
|
|
159
|
+
day,
|
|
160
|
+
modifiers,
|
|
161
|
+
...props
|
|
162
|
+
}) {
|
|
163
|
+
const defaultClassNames = getDefaultClassNames();
|
|
164
|
+
const ref = React.useRef(null);
|
|
165
|
+
React.useEffect(() => {
|
|
166
|
+
if (modifiers.focused) ref.current?.focus();
|
|
167
|
+
}, [modifiers.focused]);
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
Button,
|
|
170
|
+
{
|
|
171
|
+
ref,
|
|
172
|
+
variant: "ghost",
|
|
173
|
+
size: "icon",
|
|
174
|
+
"data-day": day.date.toLocaleDateString(),
|
|
175
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
176
|
+
"data-range-start": modifiers.range_start,
|
|
177
|
+
"data-range-end": modifiers.range_end,
|
|
178
|
+
"data-range-middle": modifiers.range_middle,
|
|
179
|
+
className: cn(
|
|
180
|
+
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
181
|
+
defaultClassNames.day,
|
|
182
|
+
className
|
|
183
|
+
),
|
|
184
|
+
...props
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function Command({
|
|
189
|
+
className,
|
|
190
|
+
...props
|
|
191
|
+
}) {
|
|
192
|
+
return /* @__PURE__ */ jsx(
|
|
193
|
+
Command$1,
|
|
194
|
+
{
|
|
195
|
+
className: cn(
|
|
196
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-box",
|
|
197
|
+
className
|
|
198
|
+
),
|
|
199
|
+
...props
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
function CommandDialog({
|
|
204
|
+
children,
|
|
205
|
+
title = "Command palette",
|
|
206
|
+
...props
|
|
207
|
+
}) {
|
|
208
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxs(DialogContent, { className: "overflow-hidden p-0", children: [
|
|
209
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "sr-only", children: title }),
|
|
210
|
+
/* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[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 })
|
|
211
|
+
] }) });
|
|
212
|
+
}
|
|
213
|
+
function CommandInput({
|
|
214
|
+
className,
|
|
215
|
+
...props
|
|
216
|
+
}) {
|
|
217
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
218
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
219
|
+
/* @__PURE__ */ jsx(
|
|
220
|
+
Command$1.Input,
|
|
221
|
+
{
|
|
222
|
+
className: cn(
|
|
223
|
+
"placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-10 w-full rounded-box bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
224
|
+
className
|
|
225
|
+
),
|
|
226
|
+
...props
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
] });
|
|
230
|
+
}
|
|
231
|
+
function CommandList({
|
|
232
|
+
className,
|
|
233
|
+
...props
|
|
234
|
+
}) {
|
|
235
|
+
return /* @__PURE__ */ jsx(
|
|
236
|
+
Command$1.List,
|
|
237
|
+
{
|
|
238
|
+
className: cn(
|
|
239
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden scroll-py-1",
|
|
240
|
+
className
|
|
241
|
+
),
|
|
242
|
+
...props
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
function CommandEmpty({
|
|
247
|
+
className,
|
|
248
|
+
...props
|
|
249
|
+
}) {
|
|
250
|
+
return /* @__PURE__ */ jsx(
|
|
251
|
+
Command$1.Empty,
|
|
252
|
+
{
|
|
253
|
+
className: cn("py-6 text-center text-sm", className),
|
|
254
|
+
...props
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function CommandGroup({
|
|
259
|
+
className,
|
|
260
|
+
...props
|
|
261
|
+
}) {
|
|
262
|
+
return /* @__PURE__ */ jsx(
|
|
263
|
+
Command$1.Group,
|
|
264
|
+
{
|
|
265
|
+
className: cn(
|
|
266
|
+
"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",
|
|
267
|
+
className
|
|
268
|
+
),
|
|
269
|
+
...props
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
function CommandSeparator({
|
|
274
|
+
className,
|
|
275
|
+
...props
|
|
276
|
+
}) {
|
|
277
|
+
return /* @__PURE__ */ jsx(
|
|
278
|
+
Command$1.Separator,
|
|
279
|
+
{
|
|
280
|
+
className: cn("bg-border -mx-1 h-px", className),
|
|
281
|
+
...props
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function CommandItem({
|
|
286
|
+
className,
|
|
287
|
+
...props
|
|
288
|
+
}) {
|
|
289
|
+
return /* @__PURE__ */ jsx(
|
|
290
|
+
Command$1.Item,
|
|
291
|
+
{
|
|
292
|
+
className: cn(
|
|
293
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
294
|
+
className
|
|
295
|
+
),
|
|
296
|
+
...props
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
function CommandShortcut({
|
|
301
|
+
className,
|
|
302
|
+
...props
|
|
303
|
+
}) {
|
|
304
|
+
return /* @__PURE__ */ jsx(
|
|
305
|
+
"span",
|
|
306
|
+
{
|
|
307
|
+
className: cn(
|
|
308
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
309
|
+
className
|
|
310
|
+
),
|
|
311
|
+
...props
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export { Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|