@freightos/freightwind 1.0.0 → 1.1.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/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/cjs/components/alert.js +33 -16
- package/dist/cjs/components/avatar.js +53 -58
- package/dist/cjs/components/badge.js +42 -18
- package/dist/cjs/components/button.js +35 -24
- package/dist/cjs/components/checkbox.js +21 -3
- package/dist/cjs/components/chip.js +67 -9
- package/dist/cjs/components/message.js +38 -0
- package/dist/cjs/components/pop-confirm.js +86 -0
- package/dist/cjs/components/radio-button-group.js +31 -35
- package/dist/cjs/components/radio-group.js +2 -1
- package/dist/cjs/components/slider.js +14 -6
- package/dist/cjs/components/switch.js +29 -10
- package/dist/cjs/components/tooltip.js +40 -11
- package/dist/cjs/index.js +38 -84
- package/dist/cjs/lib/icon-utils.js +5 -0
- package/dist/cjs/{components/aspect-ratio.js → lib/use-stable-id.js} +7 -4
- package/dist/cjs/lib/utils.js +18 -1
- package/dist/esm/components/alert.js +34 -17
- package/dist/esm/components/avatar.js +53 -22
- package/dist/esm/components/badge.js +45 -19
- package/dist/esm/components/button.js +36 -25
- package/dist/esm/components/checkbox.js +22 -4
- package/dist/esm/components/chip.js +34 -9
- package/dist/esm/components/message.js +34 -0
- package/dist/esm/components/pop-confirm.js +51 -0
- package/dist/esm/components/radio-button-group.js +31 -33
- package/dist/esm/components/radio-group.js +2 -1
- package/dist/esm/components/slider.js +14 -6
- package/dist/esm/components/switch.js +30 -11
- package/dist/esm/components/tooltip.js +40 -7
- package/dist/esm/index.js +18 -66
- package/dist/esm/lib/icon-utils.js +1 -0
- package/dist/esm/lib/use-stable-id.js +6 -0
- package/dist/esm/lib/utils.js +18 -1
- package/dist/types/components/alert.d.ts +5 -5
- package/dist/types/components/avatar.d.ts +14 -19
- package/dist/types/components/badge.d.ts +22 -8
- package/dist/types/components/button.d.ts +15 -9
- package/dist/types/components/checkbox.d.ts +8 -2
- package/dist/types/components/chip.d.ts +14 -8
- package/dist/types/components/message.d.ts +14 -0
- package/dist/types/components/pop-confirm.d.ts +28 -0
- package/dist/types/components/radio-button-group.d.ts +19 -14
- package/dist/types/components/slider.d.ts +10 -2
- package/dist/types/components/switch.d.ts +7 -6
- package/dist/types/components/tooltip.d.ts +9 -6
- package/dist/types/index.d.ts +25 -61
- package/dist/types/lib/icon-utils.d.ts +1 -0
- package/dist/types/lib/use-stable-id.d.ts +1 -0
- package/package.json +62 -54
- package/tokens.css +387 -0
- package/dist/cjs/components/accordion.js +0 -57
- package/dist/cjs/components/breadcrumb.js +0 -65
- package/dist/cjs/components/calendar.js +0 -106
- package/dist/cjs/components/card.js +0 -59
- package/dist/cjs/components/chart.js +0 -176
- package/dist/cjs/components/collapsible.js +0 -43
- package/dist/cjs/components/command.js +0 -73
- package/dist/cjs/components/context-menu.js +0 -83
- package/dist/cjs/components/country-select.js +0 -155
- package/dist/cjs/components/date-picker.js +0 -59
- package/dist/cjs/components/date-range-picker.js +0 -59
- package/dist/cjs/components/date-time-picker.js +0 -106
- package/dist/cjs/components/dialog.js +0 -70
- package/dist/cjs/components/drawer.js +0 -68
- package/dist/cjs/components/dropdown-menu.js +0 -85
- package/dist/cjs/components/empty.js +0 -42
- package/dist/cjs/components/file-preview.js +0 -73
- package/dist/cjs/components/form.js +0 -106
- package/dist/cjs/components/inline-edit.js +0 -83
- package/dist/cjs/components/input-group.js +0 -70
- package/dist/cjs/components/input-otp.js +0 -58
- package/dist/cjs/components/input.js +0 -57
- package/dist/cjs/components/label.js +0 -45
- package/dist/cjs/components/menubar.js +0 -96
- package/dist/cjs/components/navigation-menu.js +0 -68
- package/dist/cjs/components/pagination.js +0 -65
- package/dist/cjs/components/phone-input.js +0 -218
- package/dist/cjs/components/popover.js +0 -49
- package/dist/cjs/components/progress.js +0 -43
- package/dist/cjs/components/resizable.js +0 -47
- package/dist/cjs/components/rich-text-editor.js +0 -152
- package/dist/cjs/components/route.js +0 -47
- package/dist/cjs/components/scroll-area.js +0 -48
- package/dist/cjs/components/select.js +0 -71
- package/dist/cjs/components/separator.js +0 -43
- package/dist/cjs/components/sheet.js +0 -245
- package/dist/cjs/components/skeleton.js +0 -8
- package/dist/cjs/components/sonner.js +0 -25
- package/dist/cjs/components/spinner.js +0 -25
- package/dist/cjs/components/stepper.js +0 -99
- package/dist/cjs/components/steps.js +0 -127
- package/dist/cjs/components/table.js +0 -66
- package/dist/cjs/components/tabs.js +0 -51
- package/dist/cjs/components/textarea.js +0 -44
- package/dist/cjs/components/time-picker.js +0 -110
- package/dist/cjs/components/toast.js +0 -75
- package/dist/cjs/components/toaster.js +0 -12
- package/dist/cjs/components/toggle-group.js +0 -58
- package/dist/cjs/components/toggle.js +0 -62
- package/dist/cjs/hooks/use-toast.js +0 -166
- package/dist/cjs/lib/countryUtils.js +0 -93
- package/dist/esm/components/accordion.js +0 -18
- package/dist/esm/components/aspect-ratio.js +0 -3
- package/dist/esm/components/breadcrumb.js +0 -23
- package/dist/esm/components/calendar.js +0 -70
- package/dist/esm/components/card.js +0 -18
- package/dist/esm/components/chart.js +0 -135
- package/dist/esm/components/collapsible.js +0 -5
- package/dist/esm/components/command.js +0 -29
- package/dist/esm/components/context-menu.js +0 -33
- package/dist/esm/components/country-select.js +0 -118
- package/dist/esm/components/date-picker.js +0 -23
- package/dist/esm/components/date-range-picker.js +0 -23
- package/dist/esm/components/date-time-picker.js +0 -70
- package/dist/esm/components/dialog.js +0 -24
- package/dist/esm/components/drawer.js +0 -23
- package/dist/esm/components/dropdown-menu.js +0 -35
- package/dist/esm/components/empty.js +0 -6
- package/dist/esm/components/file-preview.js +0 -69
- package/dist/esm/components/form.js +0 -63
- package/dist/esm/components/inline-edit.js +0 -47
- package/dist/esm/components/input-group.js +0 -63
- package/dist/esm/components/input-otp.js +0 -19
- package/dist/esm/components/input.js +0 -21
- package/dist/esm/components/label.js +0 -9
- package/dist/esm/components/menubar.js +0 -45
- package/dist/esm/components/navigation-menu.js +0 -24
- package/dist/esm/components/pagination.js +0 -23
- package/dist/esm/components/phone-input.js +0 -181
- package/dist/esm/components/popover.js +0 -10
- package/dist/esm/components/progress.js +0 -7
- package/dist/esm/components/resizable.js +0 -9
- package/dist/esm/components/rich-text-editor.js +0 -145
- package/dist/esm/components/route.js +0 -11
- package/dist/esm/components/scroll-area.js +0 -11
- package/dist/esm/components/select.js +0 -26
- package/dist/esm/components/separator.js +0 -7
- package/dist/esm/components/sheet.js +0 -197
- package/dist/esm/components/skeleton.js +0 -6
- package/dist/esm/components/sonner.js +0 -22
- package/dist/esm/components/spinner.js +0 -21
- package/dist/esm/components/stepper.js +0 -57
- package/dist/esm/components/steps.js +0 -80
- package/dist/esm/components/table.js +0 -22
- package/dist/esm/components/tabs.js +0 -12
- package/dist/esm/components/textarea.js +0 -8
- package/dist/esm/components/time-picker.js +0 -74
- package/dist/esm/components/toast.js +0 -33
- package/dist/esm/components/toaster.js +0 -9
- package/dist/esm/components/toggle-group.js +0 -21
- package/dist/esm/components/toggle.js +0 -25
- package/dist/esm/hooks/use-toast.js +0 -128
- package/dist/esm/lib/countryUtils.js +0 -87
- package/dist/styles.css +0 -152
- package/dist/types/components/accordion.d.ts +0 -11
- package/dist/types/components/aspect-ratio.d.ts +0 -3
- package/dist/types/components/breadcrumb.d.ts +0 -19
- package/dist/types/components/calendar.d.ts +0 -7
- package/dist/types/components/card.d.ts +0 -11
- package/dist/types/components/chart.d.ts +0 -66
- package/dist/types/components/collapsible.d.ts +0 -5
- package/dist/types/components/command.d.ts +0 -80
- package/dist/types/components/context-menu.d.ts +0 -27
- package/dist/types/components/country-select.d.ts +0 -17
- package/dist/types/components/date-picker.d.ts +0 -9
- package/dist/types/components/date-range-picker.d.ts +0 -10
- package/dist/types/components/date-time-picker.d.ts +0 -10
- package/dist/types/components/dialog.d.ts +0 -23
- package/dist/types/components/drawer.d.ts +0 -22
- package/dist/types/components/dropdown-menu.d.ts +0 -27
- package/dist/types/components/empty.d.ts +0 -6
- package/dist/types/components/file-preview.d.ts +0 -9
- package/dist/types/components/form.d.ts +0 -23
- package/dist/types/components/inline-edit.d.ts +0 -10
- package/dist/types/components/input-group.d.ts +0 -16
- package/dist/types/components/input-otp.d.ts +0 -34
- package/dist/types/components/input.d.ts +0 -9
- package/dist/types/components/label.d.ts +0 -5
- package/dist/types/components/menubar.d.ts +0 -28
- package/dist/types/components/navigation-menu.d.ts +0 -12
- package/dist/types/components/pagination.d.ts +0 -29
- package/dist/types/components/phone-input.d.ts +0 -20
- package/dist/types/components/popover.d.ts +0 -9
- package/dist/types/components/progress.d.ts +0 -4
- package/dist/types/components/resizable.d.ts +0 -23
- package/dist/types/components/rich-text-editor.d.ts +0 -8
- package/dist/types/components/route.d.ts +0 -10
- package/dist/types/components/scroll-area.d.ts +0 -5
- package/dist/types/components/select.d.ts +0 -13
- package/dist/types/components/separator.d.ts +0 -4
- package/dist/types/components/sheet.d.ts +0 -49
- package/dist/types/components/skeleton.d.ts +0 -2
- package/dist/types/components/sonner.d.ts +0 -4
- package/dist/types/components/spinner.d.ts +0 -8
- package/dist/types/components/stepper.d.ts +0 -17
- package/dist/types/components/steps.d.ts +0 -64
- package/dist/types/components/table.d.ts +0 -14
- package/dist/types/components/tabs.d.ts +0 -7
- package/dist/types/components/textarea.d.ts +0 -3
- package/dist/types/components/time-picker.d.ts +0 -10
- package/dist/types/components/toast.d.ts +0 -15
- package/dist/types/components/toaster.d.ts +0 -1
- package/dist/types/components/toggle-group.d.ts +0 -12
- package/dist/types/components/toggle.d.ts +0 -12
- package/dist/types/hooks/use-toast.d.ts +0 -44
- package/dist/types/lib/countryUtils.d.ts +0 -20
- package/tailwind-preset.js +0 -70
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Empty = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
|
-
const utils_1 = require("../lib/utils");
|
|
40
|
-
const Empty = React.forwardRef(({ className, message = 'No data', ...props }, ref) => ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)('flex flex-col items-center justify-center py-fds-xl', className), ...props, children: [(0, jsx_runtime_1.jsx)("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsxs)("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [(0, jsx_runtime_1.jsx)("ellipse", { className: "fill-fds-gray-10 dark:fill-fds-gray-80", cx: "32", cy: "33", rx: "32", ry: "7" }), (0, jsx_runtime_1.jsxs)("g", { fillRule: "nonzero", className: "stroke-fds-gray-30 dark:stroke-fds-gray-60", children: [(0, jsx_runtime_1.jsx)("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), (0, jsx_runtime_1.jsx)("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", className: "fill-fds-gray-5 dark:fill-fds-gray-90" })] })] }) }), (0, jsx_runtime_1.jsx)("span", { className: "mt-fds-sm text-fds-sm text-fds-gray-50", children: message })] })));
|
|
41
|
-
exports.Empty = Empty;
|
|
42
|
-
Empty.displayName = 'Empty';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.FilePreview = void 0;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const button_1 = require("./button");
|
|
7
|
-
const dialog_1 = require("./dialog");
|
|
8
|
-
const icons_1 = require("@freightos/icons");
|
|
9
|
-
const IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg', '.bmp'];
|
|
10
|
-
function isImageFile(fileName) {
|
|
11
|
-
const lowerName = fileName.toLowerCase();
|
|
12
|
-
return IMAGE_EXTENSIONS.some(ext => lowerName.endsWith(ext));
|
|
13
|
-
}
|
|
14
|
-
const FilePreview = ({ fileName, fileUrl, open, onOpenChange, }) => {
|
|
15
|
-
const isImage = isImageFile(fileName);
|
|
16
|
-
const handlePrint = () => {
|
|
17
|
-
if (isImage) {
|
|
18
|
-
// For images, create a printable HTML page
|
|
19
|
-
const printWindow = window.open('', '_blank');
|
|
20
|
-
if (printWindow) {
|
|
21
|
-
printWindow.document.write(`
|
|
22
|
-
<!DOCTYPE html>
|
|
23
|
-
<html>
|
|
24
|
-
<head>
|
|
25
|
-
<title>${fileName}</title>
|
|
26
|
-
<style>
|
|
27
|
-
body { margin: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
|
|
28
|
-
img { max-width: 100%; max-height: 100vh; object-fit: contain; }
|
|
29
|
-
@media print { body { margin: 0; } img { max-width: 100%; max-height: 100%; } }
|
|
30
|
-
</style>
|
|
31
|
-
</head>
|
|
32
|
-
<body>
|
|
33
|
-
<img src="${fileUrl}" alt="${fileName}" onload="window.print(); window.close();" />
|
|
34
|
-
</body>
|
|
35
|
-
</html>
|
|
36
|
-
`);
|
|
37
|
-
printWindow.document.close();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
// For PDFs and other documents
|
|
42
|
-
const printWindow = window.open(fileUrl, '_blank');
|
|
43
|
-
if (printWindow) {
|
|
44
|
-
printWindow.onload = () => {
|
|
45
|
-
printWindow.print();
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const handleDownload = async () => {
|
|
51
|
-
try {
|
|
52
|
-
const response = await fetch(fileUrl);
|
|
53
|
-
const blob = await response.blob();
|
|
54
|
-
const url = window.URL.createObjectURL(blob);
|
|
55
|
-
const link = document.createElement('a');
|
|
56
|
-
link.href = url;
|
|
57
|
-
link.download = fileName;
|
|
58
|
-
document.body.appendChild(link);
|
|
59
|
-
link.click();
|
|
60
|
-
document.body.removeChild(link);
|
|
61
|
-
window.URL.revokeObjectURL(url);
|
|
62
|
-
onOpenChange(false);
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
console.error('Download failed:', error);
|
|
66
|
-
// Fallback: open in new tab
|
|
67
|
-
window.open(fileUrl, '_blank');
|
|
68
|
-
onOpenChange(false);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(dialog_1.Dialog, { open: open, onOpenChange: onOpenChange, children: (0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { className: "h-[90vh] max-w-4xl", children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogHeader, { children: (0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { children: fileName }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 items-center justify-center overflow-auto p-fds-xl", children: isImage ? ((0, jsx_runtime_1.jsx)("img", { src: fileUrl, alt: fileName, className: "max-h-full max-w-full object-contain" })) : ((0, jsx_runtime_1.jsx)("iframe", { src: fileUrl, title: fileName, className: "h-full w-full border-0" })) }), (0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { className: "flex justify-end gap-2 py-fds-lg", children: [(0, jsx_runtime_1.jsxs)(button_1.Button, { type: "secondary", size: "medium", onClick: handlePrint, children: [(0, jsx_runtime_1.jsx)(icons_1.IconPrint, {}), "Print"] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { type: "default", size: "medium", onClick: handleDownload, children: [(0, jsx_runtime_1.jsx)(icons_1.IconDownload, {}), "Download"] })] })] }) }));
|
|
72
|
-
};
|
|
73
|
-
exports.FilePreview = FilePreview;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.FormField = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormLabel = exports.FormItem = exports.Form = exports.useFormField = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const react_slot_1 = require("@radix-ui/react-slot");
|
|
41
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
42
|
-
const utils_1 = require("../lib/utils");
|
|
43
|
-
const label_1 = require("./label");
|
|
44
|
-
const Form = react_hook_form_1.FormProvider;
|
|
45
|
-
exports.Form = Form;
|
|
46
|
-
const FormFieldContext = React.createContext({});
|
|
47
|
-
const FormField = ({ ...props }) => {
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { ...props }) }));
|
|
49
|
-
};
|
|
50
|
-
exports.FormField = FormField;
|
|
51
|
-
const useFormField = () => {
|
|
52
|
-
const fieldContext = React.useContext(FormFieldContext);
|
|
53
|
-
const itemContext = React.useContext(FormItemContext);
|
|
54
|
-
const { getFieldState, formState } = (0, react_hook_form_1.useFormContext)();
|
|
55
|
-
const fieldState = getFieldState(fieldContext.name, formState);
|
|
56
|
-
if (!fieldContext) {
|
|
57
|
-
throw new Error('useFormField should be used within <FormField>');
|
|
58
|
-
}
|
|
59
|
-
const { id } = itemContext;
|
|
60
|
-
return {
|
|
61
|
-
id,
|
|
62
|
-
name: fieldContext.name,
|
|
63
|
-
formItemId: `${id}-form-item`,
|
|
64
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
65
|
-
formMessageId: `${id}-form-item-message`,
|
|
66
|
-
...fieldState,
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
exports.useFormField = useFormField;
|
|
70
|
-
const FormItemContext = React.createContext({});
|
|
71
|
-
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
72
|
-
const id = React.useId();
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(FormItemContext.Provider, { value: { id }, children: (0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)('space-y-fds-xs', className), ...props }) }));
|
|
74
|
-
});
|
|
75
|
-
exports.FormItem = FormItem;
|
|
76
|
-
FormItem.displayName = 'FormItem';
|
|
77
|
-
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
78
|
-
const { error, formItemId } = useFormField();
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)(label_1.Label, { ref: ref, className: (0, utils_1.cn)(error && 'text-destructive', className), htmlFor: formItemId, ...props }));
|
|
80
|
-
});
|
|
81
|
-
exports.FormLabel = FormLabel;
|
|
82
|
-
FormLabel.displayName = 'FormLabel';
|
|
83
|
-
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
84
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
85
|
-
return ((0, jsx_runtime_1.jsx)(react_slot_1.Slot, { ref: ref, id: formItemId, "aria-describedby": !error
|
|
86
|
-
? `${formDescriptionId}`
|
|
87
|
-
: `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
|
|
88
|
-
});
|
|
89
|
-
exports.FormControl = FormControl;
|
|
90
|
-
FormControl.displayName = 'FormControl';
|
|
91
|
-
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
92
|
-
const { formDescriptionId } = useFormField();
|
|
93
|
-
return ((0, jsx_runtime_1.jsx)("p", { ref: ref, id: formDescriptionId, className: (0, utils_1.cn)('text-sm text-muted-foreground', className), ...props }));
|
|
94
|
-
});
|
|
95
|
-
exports.FormDescription = FormDescription;
|
|
96
|
-
FormDescription.displayName = 'FormDescription';
|
|
97
|
-
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
98
|
-
const { error, formMessageId } = useFormField();
|
|
99
|
-
const body = error ? String(error?.message ?? '') : children;
|
|
100
|
-
if (!body) {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
return ((0, jsx_runtime_1.jsx)("p", { ref: ref, id: formMessageId, className: (0, utils_1.cn)('text-sm font-medium text-destructive', className), ...props, children: body }));
|
|
104
|
-
});
|
|
105
|
-
exports.FormMessage = FormMessage;
|
|
106
|
-
FormMessage.displayName = 'FormMessage';
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.InlineEdit = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const utils_1 = require("../lib/utils");
|
|
41
|
-
const icons_1 = require("@freightos/icons");
|
|
42
|
-
const input_1 = require("./input");
|
|
43
|
-
const InlineEdit = React.forwardRef(({ value, onChange, placeholder = 'Click to edit', className, hideIcon = false }, ref) => {
|
|
44
|
-
const [isEditing, setIsEditing] = React.useState(false);
|
|
45
|
-
const [editValue, setEditValue] = React.useState(value);
|
|
46
|
-
const inputRef = React.useRef(null);
|
|
47
|
-
React.useEffect(() => {
|
|
48
|
-
setEditValue(value);
|
|
49
|
-
}, [value]);
|
|
50
|
-
React.useEffect(() => {
|
|
51
|
-
if (isEditing && inputRef.current) {
|
|
52
|
-
inputRef.current.focus();
|
|
53
|
-
inputRef.current.select();
|
|
54
|
-
}
|
|
55
|
-
}, [isEditing]);
|
|
56
|
-
const handleSave = () => {
|
|
57
|
-
setIsEditing(false);
|
|
58
|
-
if (editValue.trim() !== value) {
|
|
59
|
-
onChange(editValue.trim());
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
setEditValue(value);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const handleCancel = () => {
|
|
66
|
-
setIsEditing(false);
|
|
67
|
-
setEditValue(value);
|
|
68
|
-
};
|
|
69
|
-
const handleKeyDown = (e) => {
|
|
70
|
-
if (e.key === 'Enter') {
|
|
71
|
-
handleSave();
|
|
72
|
-
}
|
|
73
|
-
else if (e.key === 'Escape') {
|
|
74
|
-
handleCancel();
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
if (isEditing) {
|
|
78
|
-
return ((0, jsx_runtime_1.jsx)(input_1.Input, { ref: inputRef, type: "text", value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: handleSave, onKeyDown: handleKeyDown, className: (0, utils_1.cn)('w-auto', className), placeholder: placeholder, inputSize: "small" }));
|
|
79
|
-
}
|
|
80
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, onClick: () => setIsEditing(true), className: (0, utils_1.cn)('group inline-flex h-[24px] cursor-pointer items-center gap-fds-xs rounded px-fds-xs font-fds-semibold hover:bg-fds-blue-10 dark:hover:bg-fds-gray-80', className), children: [(0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)(!value && 'text-fds-gray-60'), children: value || placeholder }), !hideIcon && (0, jsx_runtime_1.jsx)(icons_1.IconEdit, { size: 14, className: "text-fds-gray-60" })] }));
|
|
81
|
-
});
|
|
82
|
-
exports.InlineEdit = InlineEdit;
|
|
83
|
-
InlineEdit.displayName = 'InlineEdit';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.InputGroup = InputGroup;
|
|
5
|
-
exports.InputGroupAddon = InputGroupAddon;
|
|
6
|
-
exports.InputGroupButton = InputGroupButton;
|
|
7
|
-
exports.InputGroupInput = InputGroupInput;
|
|
8
|
-
exports.InputGroupText = InputGroupText;
|
|
9
|
-
exports.InputGroupTextarea = InputGroupTextarea;
|
|
10
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
12
|
-
const utils_1 = require("../lib/utils");
|
|
13
|
-
const button_1 = require("./button");
|
|
14
|
-
const input_1 = require("./input");
|
|
15
|
-
const textarea_1 = require("./textarea");
|
|
16
|
-
function InputGroup({ className, ...props }) {
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "input-group", role: "group", className: (0, utils_1.cn)('group/input-group relative flex w-full items-center rounded-fds-md border border-input-border bg-input outline-none transition-[color,box-shadow]', 'h-[32px] has-[>textarea]:h-auto',
|
|
18
|
-
// Variants based on alignment.
|
|
19
|
-
'has-[>[data-align=inline-start]]:[&>input]:pl-2', 'has-[>[data-align=inline-end]]:[&>input]:pr-2', 'has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3', 'has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3',
|
|
20
|
-
// Focus state.
|
|
21
|
-
'focus-within:border-[#2075bd] focus-within:shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)]',
|
|
22
|
-
// Error state.
|
|
23
|
-
'has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40', className), ...props }));
|
|
24
|
-
}
|
|
25
|
-
const inputGroupAddonVariants = (0, class_variance_authority_1.cva)("text-muted-foreground flex h-full cursor-text select-none items-center justify-center gap-2 bg-fds-gray-10 px-3 text-xs font-medium group-data-[disabled=true]/input-group:opacity-50 dark:bg-background [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
26
|
-
variants: {
|
|
27
|
-
align: {
|
|
28
|
-
'inline-start': 'order-first rounded-l-[3px] border-r border-input-border',
|
|
29
|
-
'inline-end': 'order-last rounded-r-[3px] border-l border-input-border',
|
|
30
|
-
'block-start': '[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5',
|
|
31
|
-
'block-end': '[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
defaultVariants: {
|
|
35
|
-
align: 'inline-start',
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
function InputGroupAddon({ className, align = 'inline-start', ...props }) {
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, className: (0, utils_1.cn)(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
40
|
-
if (e.target.closest('button')) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
e.currentTarget.parentElement?.querySelector('input')?.focus();
|
|
44
|
-
}, ...props }));
|
|
45
|
-
}
|
|
46
|
-
const inputGroupButtonVariants = (0, class_variance_authority_1.cva)('flex items-center gap-2 text-sm shadow-none', {
|
|
47
|
-
variants: {
|
|
48
|
-
size: {
|
|
49
|
-
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
50
|
-
sm: 'h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5',
|
|
51
|
-
'icon-xs': 'size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0',
|
|
52
|
-
'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
defaultVariants: {
|
|
56
|
-
size: 'xs',
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
function InputGroupButton({ className, htmlType = 'button', type = 'text', size = 'xs', ...props }) {
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)(button_1.Button, { htmlType: htmlType, type: type, "data-size": size, className: (0, utils_1.cn)(inputGroupButtonVariants({ size }), className), ...props }));
|
|
61
|
-
}
|
|
62
|
-
function InputGroupText({ className, ...props }) {
|
|
63
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("flex items-center gap-2 text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className), ...props }));
|
|
64
|
-
}
|
|
65
|
-
function InputGroupInput({ className, ...props }) {
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(input_1.Input, { "data-slot": "input-group-control", className: (0, utils_1.cn)('flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent', className), ...props }));
|
|
67
|
-
}
|
|
68
|
-
function InputGroupTextarea({ className, ...props }) {
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(textarea_1.Textarea, { "data-slot": "input-group-control", className: (0, utils_1.cn)('flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent', className), ...props }));
|
|
70
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const input_otp_1 = require("input-otp");
|
|
41
|
-
const lucide_react_1 = require("lucide-react");
|
|
42
|
-
const utils_1 = require("../lib/utils");
|
|
43
|
-
const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => ((0, jsx_runtime_1.jsx)(input_otp_1.OTPInput, { ref: ref, containerClassName: (0, utils_1.cn)("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName), className: (0, utils_1.cn)("disabled:cursor-not-allowed", className), ...props })));
|
|
44
|
-
exports.InputOTP = InputOTP;
|
|
45
|
-
InputOTP.displayName = "InputOTP";
|
|
46
|
-
const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("flex items-center", className), ...props })));
|
|
47
|
-
exports.InputOTPGroup = InputOTPGroup;
|
|
48
|
-
InputOTPGroup.displayName = "InputOTPGroup";
|
|
49
|
-
const InputOTPSlot = React.forwardRef(({ index, className, ...props }, ref) => {
|
|
50
|
-
const inputOTPContext = React.useContext(input_otp_1.OTPInputContext);
|
|
51
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
52
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md", isActive && "z-10 ring-2 ring-ring ring-offset-background", className), ...props, children: [char, hasFakeCaret && ((0, jsx_runtime_1.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) }))] }));
|
|
53
|
-
});
|
|
54
|
-
exports.InputOTPSlot = InputOTPSlot;
|
|
55
|
-
InputOTPSlot.displayName = "InputOTPSlot";
|
|
56
|
-
const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, role: "separator", ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Dot, {}) })));
|
|
57
|
-
exports.InputOTPSeparator = InputOTPSeparator;
|
|
58
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Input = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const utils_1 = require("../lib/utils");
|
|
41
|
-
const inputVariants = (0, class_variance_authority_1.cva)('flex w-full rounded-fds-md border border-input-border bg-input text-foreground outline-none transition-[color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:border-[#2075bd] focus:shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)] disabled:cursor-not-allowed disabled:opacity-50', {
|
|
42
|
-
variants: {
|
|
43
|
-
inputSize: {
|
|
44
|
-
small: 'h-[24px] px-2 py-1 text-fds-sm',
|
|
45
|
-
default: 'h-[32px] px-3 py-2 text-fds-base',
|
|
46
|
-
large: 'h-[40px] px-3 py-2 text-fds-h6',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
inputSize: 'default',
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
const Input = React.forwardRef(({ className, type, inputSize, ...props }, ref) => {
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)("input", { type: type, className: (0, utils_1.cn)(inputVariants({ inputSize, className })), ref: ref, ...props }));
|
|
55
|
-
});
|
|
56
|
-
exports.Input = Input;
|
|
57
|
-
Input.displayName = 'Input';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Label = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
|
-
const LabelPrimitive = __importStar(require("@radix-ui/react-label"));
|
|
40
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
-
const utils_1 = require("../lib/utils");
|
|
42
|
-
const labelVariants = (0, class_variance_authority_1.cva)("text-fds-sm font-fds-semibold leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
43
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(LabelPrimitive.Root, { ref: ref, className: (0, utils_1.cn)(labelVariants(), className), ...props })));
|
|
44
|
-
exports.Label = Label;
|
|
45
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.MenubarShortcut = exports.MenubarSubTrigger = exports.MenubarSubContent = exports.MenubarRadioItem = exports.MenubarCheckboxItem = exports.MenubarLabel = exports.MenubarSeparator = exports.MenubarItem = exports.MenubarContent = exports.MenubarTrigger = exports.Menubar = void 0;
|
|
37
|
-
exports.MenubarMenu = MenubarMenu;
|
|
38
|
-
exports.MenubarRadioGroup = MenubarRadioGroup;
|
|
39
|
-
exports.MenubarPortal = MenubarPortal;
|
|
40
|
-
exports.MenubarGroup = MenubarGroup;
|
|
41
|
-
exports.MenubarSub = MenubarSub;
|
|
42
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
-
const React = __importStar(require("react"));
|
|
44
|
-
const MenubarPrimitive = __importStar(require("@radix-ui/react-menubar"));
|
|
45
|
-
const lucide_react_1 = require("lucide-react");
|
|
46
|
-
const utils_1 = require("../lib/utils");
|
|
47
|
-
function MenubarMenu({ ...props }) {
|
|
48
|
-
return (0, jsx_runtime_1.jsx)(MenubarPrimitive.Menu, { ...props });
|
|
49
|
-
}
|
|
50
|
-
function MenubarGroup({ ...props }) {
|
|
51
|
-
return (0, jsx_runtime_1.jsx)(MenubarPrimitive.Group, { ...props });
|
|
52
|
-
}
|
|
53
|
-
function MenubarPortal({ ...props }) {
|
|
54
|
-
return (0, jsx_runtime_1.jsx)(MenubarPrimitive.Portal, { ...props });
|
|
55
|
-
}
|
|
56
|
-
function MenubarRadioGroup({ ...props }) {
|
|
57
|
-
return (0, jsx_runtime_1.jsx)(MenubarPrimitive.RadioGroup, { ...props });
|
|
58
|
-
}
|
|
59
|
-
function MenubarSub({ ...props }) {
|
|
60
|
-
return (0, jsx_runtime_1.jsx)(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
|
|
61
|
-
}
|
|
62
|
-
const Menubar = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Root, { ref: ref, className: (0, utils_1.cn)("flex h-10 items-center space-x-1 rounded-md border bg-background p-1", className), ...props })));
|
|
63
|
-
exports.Menubar = Menubar;
|
|
64
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
65
|
-
const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Trigger, { ref: ref, className: (0, utils_1.cn)("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className), ...props })));
|
|
66
|
-
exports.MenubarTrigger = MenubarTrigger;
|
|
67
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
68
|
-
const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(MenubarPrimitive.SubTrigger, { ref: ref, className: (0, utils_1.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className), ...props, children: [children, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
69
|
-
exports.MenubarSubTrigger = MenubarSubTrigger;
|
|
70
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
71
|
-
const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.SubContent, { ref: ref, className: (0, utils_1.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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 origin-[--radix-menubar-content-transform-origin]", className), ...props })));
|
|
72
|
-
exports.MenubarSubContent = MenubarSubContent;
|
|
73
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
74
|
-
const MenubarContent = React.forwardRef(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(MenubarPrimitive.Content, { ref: ref, align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: (0, utils_1.cn)("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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 origin-[--radix-menubar-content-transform-origin]", className), ...props }) })));
|
|
75
|
-
exports.MenubarContent = MenubarContent;
|
|
76
|
-
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
77
|
-
const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Item, { ref: ref, className: (0, utils_1.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
|
|
78
|
-
exports.MenubarItem = MenubarItem;
|
|
79
|
-
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
80
|
-
const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(MenubarPrimitive.CheckboxItem, { ref: ref, className: (0, utils_1.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: (0, jsx_runtime_1.jsx)(MenubarPrimitive.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
81
|
-
exports.MenubarCheckboxItem = MenubarCheckboxItem;
|
|
82
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
83
|
-
const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(MenubarPrimitive.RadioItem, { ref: ref, className: (0, utils_1.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: (0, jsx_runtime_1.jsx)(MenubarPrimitive.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
84
|
-
exports.MenubarRadioItem = MenubarRadioItem;
|
|
85
|
-
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
86
|
-
const MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Label, { ref: ref, className: (0, utils_1.cn)("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
|
|
87
|
-
exports.MenubarLabel = MenubarLabel;
|
|
88
|
-
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
89
|
-
const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(MenubarPrimitive.Separator, { ref: ref, className: (0, utils_1.cn)("-mx-1 my-1 h-px bg-muted", className), ...props })));
|
|
90
|
-
exports.MenubarSeparator = MenubarSeparator;
|
|
91
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
92
|
-
const MenubarShortcut = ({ className, ...props }) => {
|
|
93
|
-
return ((0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
|
|
94
|
-
};
|
|
95
|
-
exports.MenubarShortcut = MenubarShortcut;
|
|
96
|
-
MenubarShortcut.displayname = "MenubarShortcut";
|