@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,135 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as RechartsPrimitive from "recharts";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
-
const THEMES = { light: "", dark: ".dark" };
|
|
8
|
-
const ChartContext = React.createContext(null);
|
|
9
|
-
function useChart() {
|
|
10
|
-
const context = React.useContext(ChartContext);
|
|
11
|
-
if (!context) {
|
|
12
|
-
throw new Error("useChart must be used within a <ChartContainer />");
|
|
13
|
-
}
|
|
14
|
-
return context;
|
|
15
|
-
}
|
|
16
|
-
const ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
17
|
-
const uniqueId = React.useId();
|
|
18
|
-
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
19
|
-
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-chart": chartId, ref: ref, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
|
-
});
|
|
21
|
-
ChartContainer.displayName = "Chart";
|
|
22
|
-
const ChartStyle = ({ id, config }) => {
|
|
23
|
-
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
24
|
-
if (!colorConfig.length) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
28
|
-
__html: Object.entries(THEMES)
|
|
29
|
-
.map(([theme, prefix]) => `
|
|
30
|
-
${prefix} [data-chart=${id}] {
|
|
31
|
-
${colorConfig
|
|
32
|
-
.map(([key, itemConfig]) => {
|
|
33
|
-
const color = itemConfig.theme?.[theme] ||
|
|
34
|
-
itemConfig.color;
|
|
35
|
-
return color ? ` --color-${key}: ${color};` : null;
|
|
36
|
-
})
|
|
37
|
-
.join("\n")}
|
|
38
|
-
}
|
|
39
|
-
`)
|
|
40
|
-
.join("\n"),
|
|
41
|
-
} }));
|
|
42
|
-
};
|
|
43
|
-
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
44
|
-
const ChartTooltipContent = React.forwardRef(({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }, ref) => {
|
|
45
|
-
const { config } = useChart();
|
|
46
|
-
const tooltipLabel = React.useMemo(() => {
|
|
47
|
-
if (hideLabel || !payload?.length) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const [item] = payload;
|
|
51
|
-
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
52
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
53
|
-
const value = !labelKey && typeof label === "string"
|
|
54
|
-
? config[label]?.label || label
|
|
55
|
-
: itemConfig?.label;
|
|
56
|
-
if (labelFormatter) {
|
|
57
|
-
return (_jsx("div", { className: cn("font-medium", labelClassName), children: labelFormatter(value, payload) }));
|
|
58
|
-
}
|
|
59
|
-
if (!value) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return _jsx("div", { className: cn("font-medium", labelClassName), children: value });
|
|
63
|
-
}, [
|
|
64
|
-
label,
|
|
65
|
-
labelFormatter,
|
|
66
|
-
payload,
|
|
67
|
-
hideLabel,
|
|
68
|
-
labelClassName,
|
|
69
|
-
config,
|
|
70
|
-
labelKey,
|
|
71
|
-
]);
|
|
72
|
-
if (!active || !payload?.length) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
76
|
-
return (_jsxs("div", { ref: ref, className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload
|
|
77
|
-
.filter((item) => item.type !== "none")
|
|
78
|
-
.map((item, index) => {
|
|
79
|
-
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
80
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
81
|
-
const indicatorColor = color || item.payload?.fill || item.color;
|
|
82
|
-
return (_jsx("div", { className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
|
83
|
-
"h-2.5 w-2.5": indicator === "dot",
|
|
84
|
-
"w-1": indicator === "line",
|
|
85
|
-
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
86
|
-
"my-0.5": nestLabel && indicator === "dashed",
|
|
87
|
-
}), style: {
|
|
88
|
-
"--color-bg": indicatorColor,
|
|
89
|
-
"--color-border": indicatorColor,
|
|
90
|
-
} }))), _jsxs("div", { className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })] }), item.value && (_jsx("span", { className: "font-mono font-medium tabular-nums text-foreground", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
91
|
-
}) })] }));
|
|
92
|
-
});
|
|
93
|
-
ChartTooltipContent.displayName = "ChartTooltip";
|
|
94
|
-
const ChartLegend = RechartsPrimitive.Legend;
|
|
95
|
-
const ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
|
96
|
-
const { config } = useChart();
|
|
97
|
-
if (!payload?.length) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
return (_jsx("div", { ref: ref, className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload
|
|
101
|
-
.filter((item) => item.type !== "none")
|
|
102
|
-
.map((item) => {
|
|
103
|
-
const key = `${nameKey || item.dataKey || "value"}`;
|
|
104
|
-
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
105
|
-
return (_jsxs("div", { className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
106
|
-
backgroundColor: item.color,
|
|
107
|
-
} })), itemConfig?.label] }, item.value));
|
|
108
|
-
}) }));
|
|
109
|
-
});
|
|
110
|
-
ChartLegendContent.displayName = "ChartLegend";
|
|
111
|
-
// Helper to extract item config from a payload.
|
|
112
|
-
function getPayloadConfigFromPayload(config, payload, key) {
|
|
113
|
-
if (typeof payload !== "object" || payload === null) {
|
|
114
|
-
return undefined;
|
|
115
|
-
}
|
|
116
|
-
const payloadPayload = "payload" in payload &&
|
|
117
|
-
typeof payload.payload === "object" &&
|
|
118
|
-
payload.payload !== null
|
|
119
|
-
? payload.payload
|
|
120
|
-
: undefined;
|
|
121
|
-
let configLabelKey = key;
|
|
122
|
-
if (key in payload &&
|
|
123
|
-
typeof payload[key] === "string") {
|
|
124
|
-
configLabelKey = payload[key];
|
|
125
|
-
}
|
|
126
|
-
else if (payloadPayload &&
|
|
127
|
-
key in payloadPayload &&
|
|
128
|
-
typeof payloadPayload[key] === "string") {
|
|
129
|
-
configLabelKey = payloadPayload[key];
|
|
130
|
-
}
|
|
131
|
-
return configLabelKey in config
|
|
132
|
-
? config[configLabelKey]
|
|
133
|
-
: config[key];
|
|
134
|
-
}
|
|
135
|
-
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
-
const Collapsible = CollapsiblePrimitive.Root;
|
|
3
|
-
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
4
|
-
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
5
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
5
|
-
import { Search } from 'lucide-react';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
import { Dialog, DialogContent } from './dialog';
|
|
8
|
-
const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', className), ...props })));
|
|
9
|
-
Command.displayName = CommandPrimitive.displayName;
|
|
10
|
-
const CommandDialog = ({ children, ...props }) => {
|
|
11
|
-
return (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) }) }));
|
|
12
|
-
};
|
|
13
|
-
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [_jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, className: cn('flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
|
|
14
|
-
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
15
|
-
const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className), ...props })));
|
|
16
|
-
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
17
|
-
const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
|
|
18
|
-
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
19
|
-
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, className: cn('overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground', className), ...props })));
|
|
20
|
-
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
21
|
-
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn('-mx-1 h-px bg-border', className), ...props })));
|
|
22
|
-
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
23
|
-
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, className: cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-fds-blue-10 hover:text-foreground data-[disabled=true]:pointer-events-none data-[selected='true']:bg-fds-blue-10 data-[selected=true]:text-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
|
|
24
|
-
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
25
|
-
const CommandShortcut = ({ className, ...props }) => {
|
|
26
|
-
return (_jsx("span", { className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props }));
|
|
27
|
-
};
|
|
28
|
-
CommandShortcut.displayName = 'CommandShortcut';
|
|
29
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
const ContextMenu = ContextMenuPrimitive.Root;
|
|
7
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
8
|
-
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
9
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
10
|
-
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
11
|
-
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
12
|
-
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.SubTrigger, { ref: ref, className: 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, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
13
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
14
|
-
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]", className), ...props })));
|
|
15
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
16
|
-
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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-context-menu-content-transform-origin]", className), ...props }) })));
|
|
17
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
18
|
-
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: 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 })));
|
|
19
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
20
|
-
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(ContextMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
21
|
-
ContextMenuCheckboxItem.displayName =
|
|
22
|
-
ContextMenuPrimitive.CheckboxItem.displayName;
|
|
23
|
-
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
24
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
25
|
-
const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className), ...props })));
|
|
26
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
27
|
-
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-border", className), ...props })));
|
|
28
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
29
|
-
const ContextMenuShortcut = ({ className, ...props }) => {
|
|
30
|
-
return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
|
|
31
|
-
};
|
|
32
|
-
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
33
|
-
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
import { getCountryFlag } from '../lib/countryUtils';
|
|
5
|
-
import { IconCaretDown, IconCheck } from '@freightos/icons';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
// Common countries list - can be extended or replaced via props
|
|
8
|
-
export const COUNTRIES = [
|
|
9
|
-
{ code: 'US', name: 'United States' },
|
|
10
|
-
{ code: 'CN', name: 'China' },
|
|
11
|
-
{ code: 'GB', name: 'United Kingdom' },
|
|
12
|
-
{ code: 'CA', name: 'Canada' },
|
|
13
|
-
{ code: 'DE', name: 'Germany' },
|
|
14
|
-
{ code: 'FR', name: 'France' },
|
|
15
|
-
{ code: 'IT', name: 'Italy' },
|
|
16
|
-
{ code: 'ES', name: 'Spain' },
|
|
17
|
-
{ code: 'NL', name: 'Netherlands' },
|
|
18
|
-
{ code: 'BE', name: 'Belgium' },
|
|
19
|
-
{ code: 'CH', name: 'Switzerland' },
|
|
20
|
-
{ code: 'AT', name: 'Austria' },
|
|
21
|
-
{ code: 'SE', name: 'Sweden' },
|
|
22
|
-
{ code: 'NO', name: 'Norway' },
|
|
23
|
-
{ code: 'DK', name: 'Denmark' },
|
|
24
|
-
{ code: 'FI', name: 'Finland' },
|
|
25
|
-
{ code: 'PL', name: 'Poland' },
|
|
26
|
-
{ code: 'CZ', name: 'Czech Republic' },
|
|
27
|
-
{ code: 'IE', name: 'Ireland' },
|
|
28
|
-
{ code: 'PT', name: 'Portugal' },
|
|
29
|
-
{ code: 'GR', name: 'Greece' },
|
|
30
|
-
{ code: 'JP', name: 'Japan' },
|
|
31
|
-
{ code: 'KR', name: 'South Korea' },
|
|
32
|
-
{ code: 'IN', name: 'India' },
|
|
33
|
-
{ code: 'AU', name: 'Australia' },
|
|
34
|
-
{ code: 'NZ', name: 'New Zealand' },
|
|
35
|
-
{ code: 'SG', name: 'Singapore' },
|
|
36
|
-
{ code: 'HK', name: 'Hong Kong' },
|
|
37
|
-
{ code: 'TW', name: 'Taiwan' },
|
|
38
|
-
{ code: 'TH', name: 'Thailand' },
|
|
39
|
-
{ code: 'MY', name: 'Malaysia' },
|
|
40
|
-
{ code: 'ID', name: 'Indonesia' },
|
|
41
|
-
{ code: 'PH', name: 'Philippines' },
|
|
42
|
-
{ code: 'VN', name: 'Vietnam' },
|
|
43
|
-
{ code: 'BR', name: 'Brazil' },
|
|
44
|
-
{ code: 'MX', name: 'Mexico' },
|
|
45
|
-
{ code: 'AR', name: 'Argentina' },
|
|
46
|
-
{ code: 'CL', name: 'Chile' },
|
|
47
|
-
{ code: 'CO', name: 'Colombia' },
|
|
48
|
-
{ code: 'PE', name: 'Peru' },
|
|
49
|
-
{ code: 'ZA', name: 'South Africa' },
|
|
50
|
-
{ code: 'EG', name: 'Egypt' },
|
|
51
|
-
{ code: 'IL', name: 'Israel' },
|
|
52
|
-
{ code: 'AE', name: 'United Arab Emirates' },
|
|
53
|
-
{ code: 'SA', name: 'Saudi Arabia' },
|
|
54
|
-
{ code: 'TR', name: 'Turkey' },
|
|
55
|
-
{ code: 'RU', name: 'Russia' },
|
|
56
|
-
{ code: 'UA', name: 'Ukraine' },
|
|
57
|
-
];
|
|
58
|
-
export const CountrySelect = ({ value, onChange, placeholder = 'Select country', mostUsedCountries = ['US', 'CN'], countries = COUNTRIES, className, disabled = false, }) => {
|
|
59
|
-
const [open, setOpen] = React.useState(false);
|
|
60
|
-
const [search, setSearch] = React.useState('');
|
|
61
|
-
const containerRef = React.useRef(null);
|
|
62
|
-
const inputRef = React.useRef(null);
|
|
63
|
-
// Get selected country
|
|
64
|
-
const selectedCountry = countries.find((c) => c.code === value);
|
|
65
|
-
// Filter countries based on search
|
|
66
|
-
const filteredCountries = React.useMemo(() => {
|
|
67
|
-
const searchLower = search.toLowerCase();
|
|
68
|
-
const filtered = countries.filter((country) => country.name.toLowerCase().includes(searchLower) ||
|
|
69
|
-
country.code.toLowerCase().includes(searchLower));
|
|
70
|
-
// Sort: most used first, then alphabetically
|
|
71
|
-
return filtered.sort((a, b) => {
|
|
72
|
-
const aIsMostUsed = mostUsedCountries.includes(a.code);
|
|
73
|
-
const bIsMostUsed = mostUsedCountries.includes(b.code);
|
|
74
|
-
if (aIsMostUsed && !bIsMostUsed)
|
|
75
|
-
return -1;
|
|
76
|
-
if (!aIsMostUsed && bIsMostUsed)
|
|
77
|
-
return 1;
|
|
78
|
-
return a.name.localeCompare(b.name);
|
|
79
|
-
});
|
|
80
|
-
}, [countries, search, mostUsedCountries]);
|
|
81
|
-
// Close on click outside
|
|
82
|
-
React.useEffect(() => {
|
|
83
|
-
const handleClickOutside = (e) => {
|
|
84
|
-
if (containerRef.current &&
|
|
85
|
-
!containerRef.current.contains(e.target)) {
|
|
86
|
-
setOpen(false);
|
|
87
|
-
setSearch('');
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
if (open) {
|
|
91
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
92
|
-
}
|
|
93
|
-
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
94
|
-
}, [open]);
|
|
95
|
-
const handleSelect = (country) => {
|
|
96
|
-
onChange?.(country.code);
|
|
97
|
-
setOpen(false);
|
|
98
|
-
setSearch('');
|
|
99
|
-
};
|
|
100
|
-
const handleTriggerClick = () => {
|
|
101
|
-
if (!disabled) {
|
|
102
|
-
setOpen(!open);
|
|
103
|
-
if (!open) {
|
|
104
|
-
setTimeout(() => inputRef.current?.focus(), 0);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
return (_jsxs("div", { ref: containerRef, className: cn('relative', className), children: [_jsxs("button", { type: "button", onClick: handleTriggerClick, disabled: disabled, className: cn('flex h-[32px] w-full items-center gap-fds-sm rounded-fds-md border border-input-border bg-input px-fds-sm text-fds-base outline-none transition-[color,box-shadow]', open &&
|
|
109
|
-
'border-[#2075bd] shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)]', disabled && 'cursor-not-allowed opacity-50'), children: [selectedCountry ? (_jsxs(_Fragment, { children: [_jsx("img", { src: getCountryFlag(selectedCountry.code), alt: selectedCountry.code, className: "h-4 w-4 shrink-0 rounded-full object-cover" }), _jsx("span", { className: "flex-1 truncate text-left", children: selectedCountry.name })] })) : (_jsx("span", { className: "flex-1 text-left text-muted-foreground", children: placeholder })), _jsx(IconCaretDown, { size: 16, className: cn('shrink-0 text-fds-gray-60 transition-transform', open && 'rotate-180') })] }), open && (_jsxs("div", { className: "absolute top-full z-50 mt-fds-xs w-full rounded-fds-md border border-border bg-popover shadow-lg", children: [_jsx("div", { className: "border-b border-border p-fds-xs", children: _jsx("input", { ref: inputRef, type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search country...", className: "h-[28px] w-full rounded-fds-sm border border-input-border bg-input px-fds-sm text-fds-sm outline-none focus:border-[#2075bd] focus:shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)]" }) }), _jsx("div", { className: "max-h-[210px] overflow-y-auto p-fds-xs", children: filteredCountries.length === 0 ? (_jsx("div", { className: "px-fds-sm py-fds-md text-center text-fds-sm text-muted-foreground", children: "No countries found" })) : (filteredCountries.map((country, index) => {
|
|
110
|
-
const isSelected = country.code === value;
|
|
111
|
-
const isMostUsed = mostUsedCountries.includes(country.code);
|
|
112
|
-
const isLastMostUsed = isMostUsed &&
|
|
113
|
-
!search &&
|
|
114
|
-
index === mostUsedCountries.length - 1 &&
|
|
115
|
-
filteredCountries.length > mostUsedCountries.length;
|
|
116
|
-
return (_jsxs(React.Fragment, { children: [_jsxs("div", { onClick: () => handleSelect(country), className: cn('flex cursor-pointer items-center gap-fds-sm rounded-fds-sm px-fds-sm py-fds-xs hover:bg-accent', isSelected && 'bg-accent'), children: [_jsx("img", { src: getCountryFlag(country.code), alt: country.code, className: "h-6 w-6 shrink-0 rounded-full object-cover" }), _jsx("span", { className: "flex-1 truncate text-fds-base", children: country.name }), isSelected && (_jsx(IconCheck, { size: 16, className: "shrink-0 text-fds-blue" }))] }), isLastMostUsed && (_jsx("div", { className: "my-fds-xs h-px bg-border" }))] }, country.code));
|
|
117
|
-
})) })] }))] }));
|
|
118
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CalendarIcon } from 'lucide-react';
|
|
5
|
-
import { IconClearCircledSolid } from '@freightos/icons';
|
|
6
|
-
import { format } from 'date-fns';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
import { Calendar } from './calendar';
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger, } from './popover';
|
|
10
|
-
export function DatePicker({ value, onChange, placeholder = 'Pick a date', disabled = false, className, }) {
|
|
11
|
-
const [open, setOpen] = React.useState(false);
|
|
12
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
13
|
-
const handleSelect = (date) => {
|
|
14
|
-
onChange?.(date);
|
|
15
|
-
setOpen(false);
|
|
16
|
-
};
|
|
17
|
-
const handleClear = (e) => {
|
|
18
|
-
e.stopPropagation();
|
|
19
|
-
onChange?.(undefined);
|
|
20
|
-
};
|
|
21
|
-
const showClearIcon = isHovered && value;
|
|
22
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: disabled, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), className: cn('flex h-[var(--fds-size-xl)] w-full items-center justify-between gap-3 rounded-[var(--fds-border-radius-md)] border border-input-border bg-input py-1 pl-3 pr-2 text-sm', 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', !value && 'text-muted-foreground', className), children: [_jsx("span", { className: "truncate", children: value ? format(value, 'dd/MM/yyyy') : placeholder }), showClearIcon ? (_jsx(IconClearCircledSolid, { size: 16, className: "shrink-0 cursor-pointer text-muted-foreground hover:text-foreground", onClick: handleClear })) : (_jsx(CalendarIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }))] }) }), _jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: _jsx(Calendar, { mode: "single", selected: value, onSelect: handleSelect }) })] }));
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CalendarIcon } from 'lucide-react';
|
|
5
|
-
import { IconClearCircledSolid } from '@freightos/icons';
|
|
6
|
-
import { format } from 'date-fns';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
import { Calendar } from './calendar';
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger, } from './popover';
|
|
10
|
-
export function DateRangePicker({ value, onChange, placeholder = 'Start date - End date', disabled = false, className, }) {
|
|
11
|
-
const [open, setOpen] = React.useState(false);
|
|
12
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
13
|
-
const handleSelect = (range) => {
|
|
14
|
-
onChange?.(range);
|
|
15
|
-
};
|
|
16
|
-
const handleClear = (e) => {
|
|
17
|
-
e.stopPropagation();
|
|
18
|
-
onChange?.(undefined);
|
|
19
|
-
};
|
|
20
|
-
const hasValue = value?.from;
|
|
21
|
-
const showClearIcon = isHovered && hasValue;
|
|
22
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: disabled, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), className: cn('flex h-[var(--fds-size-xl)] w-full items-center justify-between gap-3 rounded-[var(--fds-border-radius-md)] border border-input-border bg-input py-1 pl-3 pr-2 text-sm', 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', !hasValue && 'text-muted-foreground', className), children: [_jsx("span", { className: "truncate", children: value?.from ? (value.to ? (_jsxs(_Fragment, { children: [format(value.from, 'dd/MM/yyyy'), " - ", format(value.to, 'dd/MM/yyyy')] })) : (format(value.from, 'dd/MM/yyyy'))) : (placeholder) }), showClearIcon ? (_jsx(IconClearCircledSolid, { size: 16, className: "shrink-0 cursor-pointer text-muted-foreground hover:text-foreground", onClick: handleClear })) : (_jsx(CalendarIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }))] }) }), _jsx(PopoverContent, { className: "w-auto p-0", align: "end", children: _jsx(Calendar, { mode: "range", defaultMonth: value?.from, selected: value, onSelect: handleSelect, numberOfMonths: 2, showOutsideDays: false }) })] }));
|
|
23
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CalendarIcon } from 'lucide-react';
|
|
5
|
-
import { IconClearCircledSolid } from '@freightos/icons';
|
|
6
|
-
import { format } from 'date-fns';
|
|
7
|
-
import { cn } from '../lib/utils';
|
|
8
|
-
import { Button } from './button';
|
|
9
|
-
import { Calendar } from './calendar';
|
|
10
|
-
import { Popover, PopoverContent, PopoverTrigger, } from './popover';
|
|
11
|
-
import { ScrollArea, ScrollBar, } from './scroll-area';
|
|
12
|
-
export function DateTimePicker({ value, onChange, placeholder = 'Pick date and time', disabled = false, className, use24Hour = false, }) {
|
|
13
|
-
const [open, setOpen] = React.useState(false);
|
|
14
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
15
|
-
const hours = use24Hour
|
|
16
|
-
? Array.from({ length: 24 }, (_, i) => i)
|
|
17
|
-
: Array.from({ length: 12 }, (_, i) => i + 1);
|
|
18
|
-
const handleDateSelect = (selectedDate) => {
|
|
19
|
-
if (selectedDate) {
|
|
20
|
-
const newDate = new Date(selectedDate);
|
|
21
|
-
if (value) {
|
|
22
|
-
newDate.setHours(value.getHours());
|
|
23
|
-
newDate.setMinutes(value.getMinutes());
|
|
24
|
-
}
|
|
25
|
-
onChange?.(newDate);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const handleTimeChange = (type, val) => {
|
|
29
|
-
const newDate = value ? new Date(value) : new Date();
|
|
30
|
-
if (type === 'hour') {
|
|
31
|
-
if (use24Hour) {
|
|
32
|
-
newDate.setHours(parseInt(val));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
newDate.setHours((parseInt(val) % 12) + (newDate.getHours() >= 12 ? 12 : 0));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (type === 'minute') {
|
|
39
|
-
newDate.setMinutes(parseInt(val));
|
|
40
|
-
}
|
|
41
|
-
else if (type === 'ampm') {
|
|
42
|
-
const currentHours = newDate.getHours();
|
|
43
|
-
if (val === 'PM' && currentHours < 12) {
|
|
44
|
-
newDate.setHours(currentHours + 12);
|
|
45
|
-
}
|
|
46
|
-
else if (val === 'AM' && currentHours >= 12) {
|
|
47
|
-
newDate.setHours(currentHours - 12);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
onChange?.(newDate);
|
|
51
|
-
};
|
|
52
|
-
const handleClear = (e) => {
|
|
53
|
-
e.stopPropagation();
|
|
54
|
-
onChange?.(undefined);
|
|
55
|
-
};
|
|
56
|
-
const formatString = use24Hour ? 'dd/MM/yyyy HH:mm' : 'dd/MM/yyyy hh:mm aa';
|
|
57
|
-
const showClearIcon = isHovered && value;
|
|
58
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: disabled, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), className: cn('flex h-[var(--fds-size-xl)] w-full items-center justify-between gap-3 rounded-[var(--fds-border-radius-md)] border border-input-border bg-input py-1 pl-3 pr-2 text-sm', 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', 'disabled:cursor-not-allowed disabled:opacity-50', !value && 'text-muted-foreground', className), children: [_jsx("span", { className: "truncate", children: value ? format(value, formatString) : placeholder }), showClearIcon ? (_jsx(IconClearCircledSolid, { size: 16, className: "shrink-0 cursor-pointer text-muted-foreground hover:text-foreground", onClick: handleClear })) : (_jsx(CalendarIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }))] }) }), _jsx(PopoverContent, { className: "w-auto p-0", children: _jsxs("div", { className: "sm:flex", children: [_jsx(Calendar, { mode: "single", selected: value, onSelect: handleDateSelect }), _jsxs("div", { className: "flex flex-col divide-y sm:h-[300px] sm:flex-row sm:divide-x sm:divide-y-0", children: [_jsxs(ScrollArea, { className: "w-64 sm:w-auto", children: [_jsx("div", { className: "flex p-2 sm:flex-col", children: hours.map((hour) => (_jsx(Button, { size: "small", htmlType: "button", type: value &&
|
|
59
|
-
(use24Hour
|
|
60
|
-
? value.getHours() === hour
|
|
61
|
-
: value.getHours() % 12 === hour % 12)
|
|
62
|
-
? 'default'
|
|
63
|
-
: 'text', className: "aspect-square shrink-0 sm:w-full", onClick: () => handleTimeChange('hour', hour.toString()), children: use24Hour ? hour.toString().padStart(2, '0') : hour }, hour))) }), _jsx(ScrollBar, { orientation: "horizontal", className: "sm:hidden" })] }), _jsxs(ScrollArea, { className: "w-64 sm:w-auto", children: [_jsx("div", { className: "flex p-2 sm:flex-col", children: Array.from({ length: 12 }, (_, i) => i * 5).map((minute) => (_jsx(Button, { size: "small", htmlType: "button", type: value && value.getMinutes() === minute
|
|
64
|
-
? 'default'
|
|
65
|
-
: 'text', className: "aspect-square shrink-0 sm:w-full", onClick: () => handleTimeChange('minute', minute.toString()), children: minute.toString().padStart(2, '0') }, minute))) }), _jsx(ScrollBar, { orientation: "horizontal", className: "sm:hidden" })] }), !use24Hour && (_jsx(ScrollArea, { className: "", children: _jsx("div", { className: "flex p-2 sm:flex-col", children: ['AM', 'PM'].map((ampm) => (_jsx(Button, { size: "small", htmlType: "button", type: value &&
|
|
66
|
-
((ampm === 'AM' && value.getHours() < 12) ||
|
|
67
|
-
(ampm === 'PM' && value.getHours() >= 12))
|
|
68
|
-
? 'default'
|
|
69
|
-
: 'text', className: "aspect-square shrink-0 sm:w-full", onClick: () => handleTimeChange('ampm', ampm), children: ampm }, ampm))) }) }))] })] }) })] }));
|
|
70
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { cn } from '../lib/utils';
|
|
5
|
-
import { IconClose } from '@freightos/icons';
|
|
6
|
-
const Dialog = DialogPrimitive.Root;
|
|
7
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
9
|
-
const DialogClose = DialogPrimitive.Close;
|
|
10
|
-
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-[9999] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
|
|
11
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
12
|
-
const DialogContent = React.forwardRef(({ className, children, closable = true, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-[9999] flex w-full max-w-lg translate-x-[-50%] translate-y-[-50%] flex-col bg-card shadow-lg duration-150 ease-out 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 sm:rounded-lg', className), ...props, children: [children, closable && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsxs("button", { className: "hover:text-fds-gray-90 absolute end-fds-xl top-fds-lg text-fds-gray-60 dark:text-fds-gray-40 dark:hover:text-fds-gray-10", children: [_jsx(IconClose, { size: 24 }), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] })));
|
|
13
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
14
|
-
const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 border-b px-fds-xl py-fds-lg text-center sm:text-left', className), ...props }));
|
|
15
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
16
|
-
const DialogBody = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn('flex-1 overflow-y-auto p-6', className), ...props })));
|
|
17
|
-
DialogBody.displayName = 'DialogBody';
|
|
18
|
-
const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse border-t p-6 sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
|
|
19
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
20
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight', className), ...props })));
|
|
21
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
22
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
23
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
24
|
-
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
const Drawer = ({ shouldScaleBackground = true, ...props }) => (_jsx(DrawerPrimitive.Root, { shouldScaleBackground: shouldScaleBackground, ...props }));
|
|
7
|
-
Drawer.displayName = 'Drawer';
|
|
8
|
-
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
9
|
-
const DrawerPortal = DrawerPrimitive.Portal;
|
|
10
|
-
const DrawerClose = DrawerPrimitive.Close;
|
|
11
|
-
const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DrawerPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/80', className), ...props })));
|
|
12
|
-
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
13
|
-
const DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DrawerPortal, { children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerPrimitive.Content, { ref: ref, className: cn('fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background', className), ...props, children: [_jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }), children] })] })));
|
|
14
|
-
DrawerContent.displayName = 'DrawerContent';
|
|
15
|
-
const DrawerHeader = ({ className, ...props }) => (_jsx("div", { className: cn('grid gap-1.5 p-4 text-center sm:text-left', className), ...props }));
|
|
16
|
-
DrawerHeader.displayName = 'DrawerHeader';
|
|
17
|
-
const DrawerFooter = ({ className, ...props }) => (_jsx("div", { className: cn('mt-auto flex flex-col gap-2 p-4', className), ...props }));
|
|
18
|
-
DrawerFooter.displayName = 'DrawerFooter';
|
|
19
|
-
const DrawerTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DrawerPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight', className), ...props })));
|
|
20
|
-
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
21
|
-
const DrawerDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DrawerPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
|
|
22
|
-
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
23
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
-
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
9
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
10
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
11
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
12
|
-
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
|
|
13
|
-
DropdownMenuSubTrigger.displayName =
|
|
14
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
15
|
-
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));
|
|
16
|
-
DropdownMenuSubContent.displayName =
|
|
17
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
18
|
-
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-[1010] max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md bg-popover py-1 text-popover-foreground shadow-fds-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
|
|
19
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
20
|
-
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-fds-xs text-sm outline-none transition-colors hover:bg-fds-blue-10 focus:bg-fds-blue-10 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props })));
|
|
21
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
22
|
-
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
23
|
-
DropdownMenuCheckboxItem.displayName =
|
|
24
|
-
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
25
|
-
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
26
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
27
|
-
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));
|
|
28
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
29
|
-
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-muted', className), ...props })));
|
|
30
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
31
|
-
const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
32
|
-
return (_jsx("span", { className: cn('ml-auto text-xs tracking-widest opacity-60', className), ...props }));
|
|
33
|
-
};
|
|
34
|
-
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
35
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
const Empty = React.forwardRef(({ className, message = 'No data', ...props }, ref) => (_jsxs("div", { ref: ref, className: cn('flex flex-col items-center justify-center py-fds-xl', className), ...props, children: [_jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [_jsx("ellipse", { className: "fill-fds-gray-10 dark:fill-fds-gray-80", cx: "32", cy: "33", rx: "32", ry: "7" }), _jsxs("g", { fillRule: "nonzero", className: "stroke-fds-gray-30 dark:stroke-fds-gray-60", children: [_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" }), _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" })] })] }) }), _jsx("span", { className: "mt-fds-sm text-fds-sm text-fds-gray-50", children: message })] })));
|
|
5
|
-
Empty.displayName = 'Empty';
|
|
6
|
-
export { Empty };
|