@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,75 +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.ToastAction = exports.ToastClose = exports.ToastDescription = exports.ToastTitle = exports.Toast = exports.ToastViewport = exports.ToastProvider = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
|
-
const ToastPrimitives = __importStar(require("@radix-ui/react-toast"));
|
|
40
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
-
const lucide_react_1 = require("lucide-react");
|
|
42
|
-
const utils_1 = require("../lib/utils");
|
|
43
|
-
const ToastProvider = ToastPrimitives.Provider;
|
|
44
|
-
exports.ToastProvider = ToastProvider;
|
|
45
|
-
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Viewport, { ref: ref, className: (0, utils_1.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", className), ...props })));
|
|
46
|
-
exports.ToastViewport = ToastViewport;
|
|
47
|
-
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
48
|
-
const toastVariants = (0, class_variance_authority_1.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", {
|
|
49
|
-
variants: {
|
|
50
|
-
variant: {
|
|
51
|
-
default: "border bg-background text-foreground",
|
|
52
|
-
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
defaultVariants: {
|
|
56
|
-
variant: "default",
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)(ToastPrimitives.Root, { ref: ref, className: (0, utils_1.cn)(toastVariants({ variant }), className), ...props }));
|
|
61
|
-
});
|
|
62
|
-
exports.Toast = Toast;
|
|
63
|
-
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
64
|
-
const ToastAction = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Action, { ref: ref, className: (0, utils_1.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive", className), ...props })));
|
|
65
|
-
exports.ToastAction = ToastAction;
|
|
66
|
-
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
67
|
-
const ToastClose = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Close, { ref: ref, className: (0, utils_1.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className), "toast-close": "", ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-4 w-4" }) })));
|
|
68
|
-
exports.ToastClose = ToastClose;
|
|
69
|
-
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
70
|
-
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Title, { ref: ref, className: (0, utils_1.cn)("text-sm font-semibold", className), ...props })));
|
|
71
|
-
exports.ToastTitle = ToastTitle;
|
|
72
|
-
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
73
|
-
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Description, { ref: ref, className: (0, utils_1.cn)("text-sm opacity-90", className), ...props })));
|
|
74
|
-
exports.ToastDescription = ToastDescription;
|
|
75
|
-
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Toaster = Toaster;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const use_toast_1 = require("../hooks/use-toast");
|
|
6
|
-
const toast_1 = require("./toast");
|
|
7
|
-
function Toaster() {
|
|
8
|
-
const { toasts } = (0, use_toast_1.useToast)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(toast_1.ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(toast_1.Toast, { ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-1", children: [title && (0, jsx_runtime_1.jsx)(toast_1.ToastTitle, { children: title }), description && ((0, jsx_runtime_1.jsx)(toast_1.ToastDescription, { children: description }))] }), action, (0, jsx_runtime_1.jsx)(toast_1.ToastClose, {})] }, id));
|
|
11
|
-
}), (0, jsx_runtime_1.jsx)(toast_1.ToastViewport, {})] }));
|
|
12
|
-
}
|
|
@@ -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.ToggleGroupItem = exports.ToggleGroup = void 0;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const ToggleGroupPrimitive = __importStar(require("@radix-ui/react-toggle-group"));
|
|
41
|
-
const utils_1 = require("../lib/utils");
|
|
42
|
-
const toggle_1 = require("./toggle");
|
|
43
|
-
const ToggleGroupContext = React.createContext({
|
|
44
|
-
size: "default",
|
|
45
|
-
variant: "default",
|
|
46
|
-
});
|
|
47
|
-
const ToggleGroup = React.forwardRef(({ className, variant, size, children, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToggleGroupPrimitive.Root, { ref: ref, className: (0, utils_1.cn)("flex items-center justify-center gap-1", className), ...props, children: (0, jsx_runtime_1.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children: children }) })));
|
|
48
|
-
exports.ToggleGroup = ToggleGroup;
|
|
49
|
-
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
50
|
-
const ToggleGroupItem = React.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
51
|
-
const context = React.useContext(ToggleGroupContext);
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(ToggleGroupPrimitive.Item, { ref: ref, className: (0, utils_1.cn)((0, toggle_1.toggleVariants)({
|
|
53
|
-
variant: context.variant || variant,
|
|
54
|
-
size: context.size || size,
|
|
55
|
-
}), className), ...props, children: children }));
|
|
56
|
-
});
|
|
57
|
-
exports.ToggleGroupItem = ToggleGroupItem;
|
|
58
|
-
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
@@ -1,62 +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.toggleVariants = exports.Toggle = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
|
-
const TogglePrimitive = __importStar(require("@radix-ui/react-toggle"));
|
|
40
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
41
|
-
const utils_1 = require("../lib/utils");
|
|
42
|
-
const toggleVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2", {
|
|
43
|
-
variants: {
|
|
44
|
-
variant: {
|
|
45
|
-
default: "bg-transparent",
|
|
46
|
-
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
47
|
-
},
|
|
48
|
-
size: {
|
|
49
|
-
default: "h-10 px-3 min-w-10",
|
|
50
|
-
sm: "h-9 px-2.5 min-w-9",
|
|
51
|
-
lg: "h-11 px-5 min-w-11",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
defaultVariants: {
|
|
55
|
-
variant: "default",
|
|
56
|
-
size: "default",
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
exports.toggleVariants = toggleVariants;
|
|
60
|
-
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => ((0, jsx_runtime_1.jsx)(TogglePrimitive.Root, { ref: ref, className: (0, utils_1.cn)(toggleVariants({ variant, size, className })), ...props })));
|
|
61
|
-
exports.Toggle = Toggle;
|
|
62
|
-
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
@@ -1,166 +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.reducer = void 0;
|
|
38
|
-
exports.useToast = useToast;
|
|
39
|
-
exports.toast = toast;
|
|
40
|
-
// Inspired by react-hot-toast library
|
|
41
|
-
const React = __importStar(require("react"));
|
|
42
|
-
const TOAST_LIMIT = 1;
|
|
43
|
-
const TOAST_REMOVE_DELAY = 1000000;
|
|
44
|
-
const actionTypes = {
|
|
45
|
-
ADD_TOAST: "ADD_TOAST",
|
|
46
|
-
UPDATE_TOAST: "UPDATE_TOAST",
|
|
47
|
-
DISMISS_TOAST: "DISMISS_TOAST",
|
|
48
|
-
REMOVE_TOAST: "REMOVE_TOAST",
|
|
49
|
-
};
|
|
50
|
-
let count = 0;
|
|
51
|
-
function genId() {
|
|
52
|
-
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
53
|
-
return count.toString();
|
|
54
|
-
}
|
|
55
|
-
const toastTimeouts = new Map();
|
|
56
|
-
const addToRemoveQueue = (toastId) => {
|
|
57
|
-
if (toastTimeouts.has(toastId)) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const timeout = setTimeout(() => {
|
|
61
|
-
toastTimeouts.delete(toastId);
|
|
62
|
-
dispatch({
|
|
63
|
-
type: "REMOVE_TOAST",
|
|
64
|
-
toastId: toastId,
|
|
65
|
-
});
|
|
66
|
-
}, TOAST_REMOVE_DELAY);
|
|
67
|
-
toastTimeouts.set(toastId, timeout);
|
|
68
|
-
};
|
|
69
|
-
const reducer = (state, action) => {
|
|
70
|
-
switch (action.type) {
|
|
71
|
-
case "ADD_TOAST":
|
|
72
|
-
return {
|
|
73
|
-
...state,
|
|
74
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
75
|
-
};
|
|
76
|
-
case "UPDATE_TOAST":
|
|
77
|
-
return {
|
|
78
|
-
...state,
|
|
79
|
-
toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
|
|
80
|
-
};
|
|
81
|
-
case "DISMISS_TOAST": {
|
|
82
|
-
const { toastId } = action;
|
|
83
|
-
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
84
|
-
// but I'll keep it here for simplicity
|
|
85
|
-
if (toastId) {
|
|
86
|
-
addToRemoveQueue(toastId);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
state.toasts.forEach((toast) => {
|
|
90
|
-
addToRemoveQueue(toast.id);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
...state,
|
|
95
|
-
toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
|
96
|
-
? {
|
|
97
|
-
...t,
|
|
98
|
-
open: false,
|
|
99
|
-
}
|
|
100
|
-
: t),
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
case "REMOVE_TOAST":
|
|
104
|
-
if (action.toastId === undefined) {
|
|
105
|
-
return {
|
|
106
|
-
...state,
|
|
107
|
-
toasts: [],
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
...state,
|
|
112
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
exports.reducer = reducer;
|
|
117
|
-
const listeners = [];
|
|
118
|
-
let memoryState = { toasts: [] };
|
|
119
|
-
function dispatch(action) {
|
|
120
|
-
memoryState = (0, exports.reducer)(memoryState, action);
|
|
121
|
-
listeners.forEach((listener) => {
|
|
122
|
-
listener(memoryState);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function toast({ ...props }) {
|
|
126
|
-
const id = genId();
|
|
127
|
-
const update = (props) => dispatch({
|
|
128
|
-
type: "UPDATE_TOAST",
|
|
129
|
-
toast: { ...props, id },
|
|
130
|
-
});
|
|
131
|
-
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
132
|
-
dispatch({
|
|
133
|
-
type: "ADD_TOAST",
|
|
134
|
-
toast: {
|
|
135
|
-
...props,
|
|
136
|
-
id,
|
|
137
|
-
open: true,
|
|
138
|
-
onOpenChange: (open) => {
|
|
139
|
-
if (!open)
|
|
140
|
-
dismiss();
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
return {
|
|
145
|
-
id: id,
|
|
146
|
-
dismiss,
|
|
147
|
-
update,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function useToast() {
|
|
151
|
-
const [state, setState] = React.useState(memoryState);
|
|
152
|
-
React.useEffect(() => {
|
|
153
|
-
listeners.push(setState);
|
|
154
|
-
return () => {
|
|
155
|
-
const index = listeners.indexOf(setState);
|
|
156
|
-
if (index > -1) {
|
|
157
|
-
listeners.splice(index, 1);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
}, [state]);
|
|
161
|
-
return {
|
|
162
|
-
...state,
|
|
163
|
-
toast,
|
|
164
|
-
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
|
165
|
-
};
|
|
166
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCountryInfo = exports.getCountryFlagEmoji = exports.getCountryFlag = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Get flag image URL for country code (ISO 3166-1 alpha-2)
|
|
6
|
-
* Uses Freightos festatic CDN for flag images
|
|
7
|
-
* @param countryCode Two-letter country code (e.g., 'US', 'GB', 'FR')
|
|
8
|
-
* @returns Flag image URL or empty string if invalid
|
|
9
|
-
*/
|
|
10
|
-
const getCountryFlag = (countryCode) => {
|
|
11
|
-
if (!countryCode || countryCode.length !== 2)
|
|
12
|
-
return '';
|
|
13
|
-
const lowerCode = countryCode.toLowerCase();
|
|
14
|
-
// Use Freightos festatic CDN for flag images
|
|
15
|
-
return `https://festatic.freightos.com/flags/1x1/${lowerCode}.svg`;
|
|
16
|
-
};
|
|
17
|
-
exports.getCountryFlag = getCountryFlag;
|
|
18
|
-
/**
|
|
19
|
-
* Get flag emoji for country code (ISO 3166-1 alpha-2)
|
|
20
|
-
* Uses Unicode regional indicator symbols to display flag emojis
|
|
21
|
-
*/
|
|
22
|
-
const getCountryFlagEmoji = (countryCode) => {
|
|
23
|
-
if (!countryCode || countryCode.length !== 2)
|
|
24
|
-
return '';
|
|
25
|
-
const upperCode = countryCode.toUpperCase();
|
|
26
|
-
// Convert country code to regional indicator symbols (flag emoji)
|
|
27
|
-
const codePoints = [...upperCode].map(char => 0x1F1E6 + char.charCodeAt(0) - 65);
|
|
28
|
-
return String.fromCodePoint(...codePoints);
|
|
29
|
-
};
|
|
30
|
-
exports.getCountryFlagEmoji = getCountryFlagEmoji;
|
|
31
|
-
/**
|
|
32
|
-
* Common country names mapping (ISO 3166-1 alpha-2 codes)
|
|
33
|
-
*/
|
|
34
|
-
const COUNTRY_NAMES = {
|
|
35
|
-
US: 'United States',
|
|
36
|
-
GB: 'United Kingdom',
|
|
37
|
-
CA: 'Canada',
|
|
38
|
-
FR: 'France',
|
|
39
|
-
DE: 'Germany',
|
|
40
|
-
IT: 'Italy',
|
|
41
|
-
ES: 'Spain',
|
|
42
|
-
NL: 'Netherlands',
|
|
43
|
-
BE: 'Belgium',
|
|
44
|
-
CH: 'Switzerland',
|
|
45
|
-
AT: 'Austria',
|
|
46
|
-
SE: 'Sweden',
|
|
47
|
-
NO: 'Norway',
|
|
48
|
-
DK: 'Denmark',
|
|
49
|
-
FI: 'Finland',
|
|
50
|
-
PL: 'Poland',
|
|
51
|
-
CZ: 'Czech Republic',
|
|
52
|
-
IE: 'Ireland',
|
|
53
|
-
PT: 'Portugal',
|
|
54
|
-
GR: 'Greece',
|
|
55
|
-
CN: 'China',
|
|
56
|
-
JP: 'Japan',
|
|
57
|
-
KR: 'South Korea',
|
|
58
|
-
IN: 'India',
|
|
59
|
-
AU: 'Australia',
|
|
60
|
-
NZ: 'New Zealand',
|
|
61
|
-
SG: 'Singapore',
|
|
62
|
-
HK: 'Hong Kong',
|
|
63
|
-
TW: 'Taiwan',
|
|
64
|
-
TH: 'Thailand',
|
|
65
|
-
MY: 'Malaysia',
|
|
66
|
-
ID: 'Indonesia',
|
|
67
|
-
PH: 'Philippines',
|
|
68
|
-
VN: 'Vietnam',
|
|
69
|
-
BR: 'Brazil',
|
|
70
|
-
MX: 'Mexico',
|
|
71
|
-
AR: 'Argentina',
|
|
72
|
-
CL: 'Chile',
|
|
73
|
-
CO: 'Colombia',
|
|
74
|
-
PE: 'Peru',
|
|
75
|
-
ZA: 'South Africa',
|
|
76
|
-
EG: 'Egypt',
|
|
77
|
-
IL: 'Israel',
|
|
78
|
-
AE: 'United Arab Emirates',
|
|
79
|
-
SA: 'Saudi Arabia',
|
|
80
|
-
TR: 'Turkey',
|
|
81
|
-
RU: 'Russia',
|
|
82
|
-
UA: 'Ukraine',
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Get country information including flag, code, and name
|
|
86
|
-
*/
|
|
87
|
-
const getCountryInfo = (countryCode) => {
|
|
88
|
-
const upperCode = countryCode?.toUpperCase() || '';
|
|
89
|
-
const flag = (0, exports.getCountryFlag)(upperCode);
|
|
90
|
-
const name = COUNTRY_NAMES[upperCode] || upperCode;
|
|
91
|
-
return { flag, code: upperCode, name };
|
|
92
|
-
};
|
|
93
|
-
exports.getCountryInfo = getCountryInfo;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { IconCaretDown } from '@freightos/icons';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
const Accordion = AccordionPrimitive.Root;
|
|
7
|
-
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn(className), ...props })));
|
|
8
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
9
|
-
const AccordionTrigger = React.forwardRef(({ className, children, caretPosition = 'end', bottom, ...props }, ref) => {
|
|
10
|
-
const caretIcon = (_jsx(IconCaretDown, { size: 18, className: "h-6 w-6 shrink-0 transition-transform duration-200" }));
|
|
11
|
-
return (_jsxs(AccordionPrimitive.Header, { className: "flex flex-col", children: [_jsxs(AccordionPrimitive.Trigger, { ref: ref, className: cn('flex flex-1 cursor-pointer items-center py-4 transition-all [&[data-state=open]>svg]:rotate-180', caretPosition === 'end'
|
|
12
|
-
? 'justify-between pe-fds-lg'
|
|
13
|
-
: 'gap-fds-md ps-fds-lg', className), ...props, children: [caretPosition === 'start' && caretIcon, children, caretPosition === 'end' && caretIcon] }), bottom && _jsx("div", { children: bottom })] }));
|
|
14
|
-
});
|
|
15
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
16
|
-
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Content, { ref: ref, className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn(className), children: children }) })));
|
|
17
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
18
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
const Breadcrumb = React.forwardRef(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
|
|
7
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
8
|
-
const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className), ...props })));
|
|
9
|
-
BreadcrumbList.displayName = "BreadcrumbList";
|
|
10
|
-
const BreadcrumbItem = React.forwardRef(({ className, ...props }, ref) => (_jsx("li", { ref: ref, className: cn("inline-flex items-center gap-1.5", className), ...props })));
|
|
11
|
-
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
12
|
-
const BreadcrumbLink = React.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
13
|
-
const Comp = asChild ? Slot : "a";
|
|
14
|
-
return (_jsx(Comp, { ref: ref, className: cn("transition-colors hover:text-foreground", className), ...props }));
|
|
15
|
-
});
|
|
16
|
-
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
17
|
-
const BreadcrumbPage = React.forwardRef(({ className, ...props }, ref) => (_jsx("span", { ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className), ...props })));
|
|
18
|
-
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
19
|
-
const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
20
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
21
|
-
const BreadcrumbEllipsis = ({ className, ...props }) => (_jsxs("span", { role: "presentation", "aria-hidden": "true", className: cn("flex h-9 w-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
22
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
23
|
-
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from 'lucide-react';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
6
|
-
import { buttonVariants } from './button';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'text', formatters, components, ...props }) {
|
|
9
|
-
const defaultClassNames = getDefaultClassNames();
|
|
10
|
-
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('group/calendar bg-card p-3 [--cell-size:2rem]', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
|
|
11
|
-
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
12
|
-
...formatters,
|
|
13
|
-
}, classNames: {
|
|
14
|
-
root: cn('w-fit', defaultClassNames.root),
|
|
15
|
-
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
16
|
-
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
17
|
-
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
18
|
-
button_previous: cn(buttonVariants({ type: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
|
|
19
|
-
button_next: cn(buttonVariants({ type: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
|
|
20
|
-
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
21
|
-
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
22
|
-
dropdown_root: cn('relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md', defaultClassNames.dropdown_root),
|
|
23
|
-
dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
|
|
24
|
-
caption_label: cn('select-none font-medium', captionLayout === 'label'
|
|
25
|
-
? 'text-sm'
|
|
26
|
-
: 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
|
|
27
|
-
table: 'w-full border-collapse',
|
|
28
|
-
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
29
|
-
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
30
|
-
week: cn('flex w-full mt-2', defaultClassNames.week),
|
|
31
|
-
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
32
|
-
week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
33
|
-
day: cn('relative w-full h-full p-0 text-center group/day aspect-square select-none', defaultClassNames.day),
|
|
34
|
-
range_start: cn('[&_button]:bg-primary [&_button]:text-primary-foreground [&_button]:rounded-l-md [&_button]:rounded-r-none [&_button]:hover:bg-primary [&_button]:hover:text-primary-foreground', defaultClassNames.range_start),
|
|
35
|
-
range_middle: cn('[&_button]:bg-fds-blue-10 [&_button]:text-fds-gray [&_button]:rounded-none [&_button]:hover:bg-fds-blue-20 [&_button]:hover:text-fds-gray', defaultClassNames.range_middle),
|
|
36
|
-
range_end: cn('[&_button]:bg-primary [&_button]:text-primary-foreground [&_button]:rounded-r-md [&_button]:rounded-l-none [&_button]:hover:bg-primary [&_button]:hover:text-primary-foreground', defaultClassNames.range_end),
|
|
37
|
-
today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
38
|
-
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
39
|
-
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
40
|
-
hidden: cn('invisible', defaultClassNames.hidden),
|
|
41
|
-
...classNames,
|
|
42
|
-
}, components: {
|
|
43
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
44
|
-
return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
|
|
45
|
-
},
|
|
46
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
47
|
-
if (orientation === 'left') {
|
|
48
|
-
return (_jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props }));
|
|
49
|
-
}
|
|
50
|
-
if (orientation === 'right') {
|
|
51
|
-
return (_jsx(ChevronRightIcon, { className: cn('size-4', className), ...props }));
|
|
52
|
-
}
|
|
53
|
-
return (_jsx(ChevronDownIcon, { className: cn('size-4', className), ...props }));
|
|
54
|
-
},
|
|
55
|
-
DayButton: CalendarDayButton,
|
|
56
|
-
WeekNumber: ({ children, ...props }) => {
|
|
57
|
-
return (_jsx("td", { ...props, children: _jsx("div", { className: "size-(--cell-size) flex items-center justify-center text-center", children: children }) }));
|
|
58
|
-
},
|
|
59
|
-
...components,
|
|
60
|
-
}, ...props }));
|
|
61
|
-
}
|
|
62
|
-
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
63
|
-
const ref = React.useRef(null);
|
|
64
|
-
React.useEffect(() => {
|
|
65
|
-
if (modifiers.focused)
|
|
66
|
-
ref.current?.focus();
|
|
67
|
-
}, [modifiers.focused]);
|
|
68
|
-
return (_jsx("button", { ref: ref, type: "button", "data-day": day.date.toLocaleDateString(), className: cn('inline-flex items-center justify-center rounded-md text-sm font-normal transition-colors', 'hover:bg-accent hover:text-accent-foreground', 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring', 'disabled:pointer-events-none disabled:opacity-50', 'h-9 w-9 p-0', 'aria-selected:bg-primary aria-selected:text-primary-foreground aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground', className), ...props }));
|
|
69
|
-
}
|
|
70
|
-
export { Calendar, CalendarDayButton };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('rounded-lg bg-card p-fds-xl shadow-fds-sm', 'text-card-foreground', className), ...props })));
|
|
5
|
-
Card.displayName = 'Card';
|
|
6
|
-
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 has-[[data-slot=card-action]]:grid-cols-[1fr_auto]', className), ...props })));
|
|
7
|
-
CardHeader.displayName = 'CardHeader';
|
|
8
|
-
const CardAction = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props })));
|
|
9
|
-
CardAction.displayName = 'CardAction';
|
|
10
|
-
const CardTitle = React.forwardRef(({ className, size = 'medium', ...props }, ref) => {
|
|
11
|
-
return (_jsx("div", { ref: ref, className: cn('font-fds-bold leading-none tracking-tight', size === 'small' ? 'text-fds-h5' : 'text-fds-h3', className), ...props }));
|
|
12
|
-
});
|
|
13
|
-
CardTitle.displayName = 'CardTitle';
|
|
14
|
-
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('pt-0', className), ...props })));
|
|
15
|
-
CardContent.displayName = 'CardContent';
|
|
16
|
-
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex items-center p-6 pt-0', className), ...props })));
|
|
17
|
-
CardFooter.displayName = 'CardFooter';
|
|
18
|
-
export { Card, CardAction, CardContent, CardFooter, CardHeader, CardTitle };
|