@freightos/freightwind 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/accordion.js +57 -0
- package/dist/cjs/components/alert.js +76 -0
- package/dist/cjs/components/aspect-ratio.js +39 -0
- package/dist/cjs/components/avatar.js +75 -0
- package/dist/cjs/components/badge.js +24 -0
- package/dist/cjs/components/breadcrumb.js +65 -0
- package/dist/cjs/components/button.js +76 -0
- package/dist/cjs/components/calendar.js +106 -0
- package/dist/cjs/components/card.js +59 -0
- package/dist/cjs/components/chart.js +176 -0
- package/dist/cjs/components/checkbox.js +44 -0
- package/dist/cjs/components/chip.js +26 -0
- package/dist/cjs/components/collapsible.js +43 -0
- package/dist/cjs/components/command.js +73 -0
- package/dist/cjs/components/context-menu.js +83 -0
- package/dist/cjs/components/country-select.js +155 -0
- package/dist/cjs/components/date-picker.js +59 -0
- package/dist/cjs/components/date-range-picker.js +59 -0
- package/dist/cjs/components/date-time-picker.js +106 -0
- package/dist/cjs/components/dialog.js +70 -0
- package/dist/cjs/components/drawer.js +68 -0
- package/dist/cjs/components/dropdown-menu.js +85 -0
- package/dist/cjs/components/empty.js +42 -0
- package/dist/cjs/components/file-preview.js +73 -0
- package/dist/cjs/components/form.js +106 -0
- package/dist/cjs/components/inline-edit.js +83 -0
- package/dist/cjs/components/input-group.js +70 -0
- package/dist/cjs/components/input-otp.js +58 -0
- package/dist/cjs/components/input.js +57 -0
- package/dist/cjs/components/label.js +45 -0
- package/dist/cjs/components/menubar.js +96 -0
- package/dist/cjs/components/navigation-menu.js +68 -0
- package/dist/cjs/components/pagination.js +65 -0
- package/dist/cjs/components/phone-input.js +218 -0
- package/dist/cjs/components/popover.js +49 -0
- package/dist/cjs/components/progress.js +43 -0
- package/dist/cjs/components/radio-button-group.js +84 -0
- package/dist/cjs/components/radio-group.js +50 -0
- package/dist/cjs/components/resizable.js +47 -0
- package/dist/cjs/components/rich-text-editor.js +152 -0
- package/dist/cjs/components/route.js +47 -0
- package/dist/cjs/components/scroll-area.js +48 -0
- package/dist/cjs/components/select.js +71 -0
- package/dist/cjs/components/separator.js +43 -0
- package/dist/cjs/components/sheet.js +245 -0
- package/dist/cjs/components/skeleton.js +8 -0
- package/dist/cjs/components/slider.js +47 -0
- package/dist/cjs/components/sonner.js +25 -0
- package/dist/cjs/components/spinner.js +25 -0
- package/dist/cjs/components/stepper.js +99 -0
- package/dist/cjs/components/steps.js +127 -0
- package/dist/cjs/components/switch.js +66 -0
- package/dist/cjs/components/table.js +66 -0
- package/dist/cjs/components/tabs.js +51 -0
- package/dist/cjs/components/textarea.js +44 -0
- package/dist/cjs/components/time-picker.js +110 -0
- package/dist/cjs/components/toast.js +75 -0
- package/dist/cjs/components/toaster.js +12 -0
- package/dist/cjs/components/toggle-group.js +58 -0
- package/dist/cjs/components/toggle.js +62 -0
- package/dist/cjs/components/tooltip.js +49 -0
- package/dist/cjs/hooks/use-toast.js +166 -0
- package/dist/cjs/index.js +88 -0
- package/dist/cjs/lib/countryUtils.js +93 -0
- package/dist/cjs/lib/utils.js +8 -0
- package/dist/esm/components/accordion.js +18 -0
- package/dist/esm/components/alert.js +39 -0
- package/dist/esm/components/aspect-ratio.js +3 -0
- package/dist/esm/components/avatar.js +37 -0
- package/dist/esm/components/badge.js +20 -0
- package/dist/esm/components/breadcrumb.js +23 -0
- package/dist/esm/components/button.js +39 -0
- package/dist/esm/components/calendar.js +70 -0
- package/dist/esm/components/card.js +18 -0
- package/dist/esm/components/chart.js +135 -0
- package/dist/esm/components/checkbox.js +8 -0
- package/dist/esm/components/chip.js +22 -0
- package/dist/esm/components/collapsible.js +5 -0
- package/dist/esm/components/command.js +29 -0
- package/dist/esm/components/context-menu.js +33 -0
- package/dist/esm/components/country-select.js +118 -0
- package/dist/esm/components/date-picker.js +23 -0
- package/dist/esm/components/date-range-picker.js +23 -0
- package/dist/esm/components/date-time-picker.js +70 -0
- package/dist/esm/components/dialog.js +24 -0
- package/dist/esm/components/drawer.js +23 -0
- package/dist/esm/components/dropdown-menu.js +35 -0
- package/dist/esm/components/empty.js +6 -0
- package/dist/esm/components/file-preview.js +69 -0
- package/dist/esm/components/form.js +63 -0
- package/dist/esm/components/inline-edit.js +47 -0
- package/dist/esm/components/input-group.js +63 -0
- package/dist/esm/components/input-otp.js +19 -0
- package/dist/esm/components/input.js +21 -0
- package/dist/esm/components/label.js +9 -0
- package/dist/esm/components/menubar.js +45 -0
- package/dist/esm/components/navigation-menu.js +24 -0
- package/dist/esm/components/pagination.js +23 -0
- package/dist/esm/components/phone-input.js +181 -0
- package/dist/esm/components/popover.js +10 -0
- package/dist/esm/components/progress.js +7 -0
- package/dist/esm/components/radio-button-group.js +47 -0
- package/dist/esm/components/radio-group.js +13 -0
- package/dist/esm/components/resizable.js +9 -0
- package/dist/esm/components/rich-text-editor.js +145 -0
- package/dist/esm/components/route.js +11 -0
- package/dist/esm/components/scroll-area.js +11 -0
- package/dist/esm/components/select.js +26 -0
- package/dist/esm/components/separator.js +7 -0
- package/dist/esm/components/sheet.js +197 -0
- package/dist/esm/components/skeleton.js +6 -0
- package/dist/esm/components/slider.js +11 -0
- package/dist/esm/components/sonner.js +22 -0
- package/dist/esm/components/spinner.js +21 -0
- package/dist/esm/components/stepper.js +57 -0
- package/dist/esm/components/steps.js +80 -0
- package/dist/esm/components/switch.js +30 -0
- package/dist/esm/components/table.js +22 -0
- package/dist/esm/components/tabs.js +12 -0
- package/dist/esm/components/textarea.js +8 -0
- package/dist/esm/components/time-picker.js +74 -0
- package/dist/esm/components/toast.js +33 -0
- package/dist/esm/components/toaster.js +9 -0
- package/dist/esm/components/toggle-group.js +21 -0
- package/dist/esm/components/toggle.js +25 -0
- package/dist/esm/components/tooltip.js +10 -0
- package/dist/esm/hooks/use-toast.js +128 -0
- package/dist/esm/index.js +67 -0
- package/dist/esm/lib/countryUtils.js +87 -0
- package/dist/esm/lib/utils.js +5 -0
- package/dist/styles.css +152 -0
- package/dist/types/components/accordion.d.ts +11 -0
- package/dist/types/components/alert.d.ts +12 -0
- package/dist/types/components/aspect-ratio.d.ts +3 -0
- package/dist/types/components/avatar.d.ts +19 -0
- package/dist/types/components/badge.d.ts +9 -0
- package/dist/types/components/breadcrumb.d.ts +19 -0
- package/dist/types/components/button.d.ts +14 -0
- package/dist/types/components/calendar.d.ts +7 -0
- package/dist/types/components/card.d.ts +11 -0
- package/dist/types/components/chart.d.ts +66 -0
- package/dist/types/components/checkbox.d.ts +4 -0
- package/dist/types/components/chip.d.ts +10 -0
- package/dist/types/components/collapsible.d.ts +5 -0
- package/dist/types/components/command.d.ts +80 -0
- package/dist/types/components/context-menu.d.ts +27 -0
- package/dist/types/components/country-select.d.ts +17 -0
- package/dist/types/components/date-picker.d.ts +9 -0
- package/dist/types/components/date-range-picker.d.ts +10 -0
- package/dist/types/components/date-time-picker.d.ts +10 -0
- package/dist/types/components/dialog.d.ts +23 -0
- package/dist/types/components/drawer.d.ts +22 -0
- package/dist/types/components/dropdown-menu.d.ts +27 -0
- package/dist/types/components/empty.d.ts +6 -0
- package/dist/types/components/file-preview.d.ts +9 -0
- package/dist/types/components/form.d.ts +23 -0
- package/dist/types/components/inline-edit.d.ts +10 -0
- package/dist/types/components/input-group.d.ts +16 -0
- package/dist/types/components/input-otp.d.ts +34 -0
- package/dist/types/components/input.d.ts +9 -0
- package/dist/types/components/label.d.ts +5 -0
- package/dist/types/components/menubar.d.ts +28 -0
- package/dist/types/components/navigation-menu.d.ts +12 -0
- package/dist/types/components/pagination.d.ts +29 -0
- package/dist/types/components/phone-input.d.ts +20 -0
- package/dist/types/components/popover.d.ts +9 -0
- package/dist/types/components/progress.d.ts +4 -0
- package/dist/types/components/radio-button-group.d.ts +17 -0
- package/dist/types/components/radio-group.d.ts +5 -0
- package/dist/types/components/resizable.d.ts +23 -0
- package/dist/types/components/rich-text-editor.d.ts +8 -0
- package/dist/types/components/route.d.ts +10 -0
- package/dist/types/components/scroll-area.d.ts +5 -0
- package/dist/types/components/select.d.ts +13 -0
- package/dist/types/components/separator.d.ts +4 -0
- package/dist/types/components/sheet.d.ts +49 -0
- package/dist/types/components/skeleton.d.ts +2 -0
- package/dist/types/components/slider.d.ts +4 -0
- package/dist/types/components/sonner.d.ts +4 -0
- package/dist/types/components/spinner.d.ts +8 -0
- package/dist/types/components/stepper.d.ts +17 -0
- package/dist/types/components/steps.d.ts +64 -0
- package/dist/types/components/switch.d.ts +10 -0
- package/dist/types/components/table.d.ts +14 -0
- package/dist/types/components/tabs.d.ts +7 -0
- package/dist/types/components/textarea.d.ts +3 -0
- package/dist/types/components/time-picker.d.ts +10 -0
- package/dist/types/components/toast.d.ts +15 -0
- package/dist/types/components/toaster.d.ts +1 -0
- package/dist/types/components/toggle-group.d.ts +12 -0
- package/dist/types/components/toggle.d.ts +12 -0
- package/dist/types/components/tooltip.d.ts +7 -0
- package/dist/types/hooks/use-toast.d.ts +44 -0
- package/dist/types/index.d.ts +62 -0
- package/dist/types/lib/countryUtils.d.ts +20 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/package.json +84 -0
- package/tailwind-preset.js +70 -0
|
@@ -0,0 +1,65 @@
|
|
|
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.PaginationPrevious = exports.PaginationNext = exports.PaginationLink = exports.PaginationItem = exports.PaginationEllipsis = exports.PaginationContent = exports.Pagination = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const lucide_react_1 = require("lucide-react");
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const button_1 = require("./button");
|
|
42
|
+
const Pagination = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)("nav", { role: "navigation", "aria-label": "pagination", className: (0, utils_1.cn)('mx-auto flex w-full justify-center', className), ...props }));
|
|
43
|
+
exports.Pagination = Pagination;
|
|
44
|
+
Pagination.displayName = 'Pagination';
|
|
45
|
+
const PaginationContent = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("ul", { ref: ref, className: (0, utils_1.cn)('flex flex-row items-center gap-1', className), ...props })));
|
|
46
|
+
exports.PaginationContent = PaginationContent;
|
|
47
|
+
PaginationContent.displayName = 'PaginationContent';
|
|
48
|
+
const PaginationItem = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("li", { ref: ref, className: (0, utils_1.cn)('', className), ...props })));
|
|
49
|
+
exports.PaginationItem = PaginationItem;
|
|
50
|
+
PaginationItem.displayName = 'PaginationItem';
|
|
51
|
+
const PaginationLink = ({ className, isActive, icon = true, size, ...props }) => ((0, jsx_runtime_1.jsx)("a", { "aria-current": isActive ? 'page' : undefined, className: (0, utils_1.cn)((0, button_1.buttonVariants)({
|
|
52
|
+
type: isActive ? 'secondary' : 'text',
|
|
53
|
+
size,
|
|
54
|
+
}), icon && 'aspect-square p-0', className), ...props }));
|
|
55
|
+
exports.PaginationLink = PaginationLink;
|
|
56
|
+
PaginationLink.displayName = 'PaginationLink';
|
|
57
|
+
const PaginationPrevious = ({ className, ...props }) => ((0, jsx_runtime_1.jsxs)(PaginationLink, { "aria-label": "Go to previous page", icon: false, size: "medium", className: (0, utils_1.cn)('gap-1 pl-2.5', className), ...props, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: "Previous" })] }));
|
|
58
|
+
exports.PaginationPrevious = PaginationPrevious;
|
|
59
|
+
PaginationPrevious.displayName = 'PaginationPrevious';
|
|
60
|
+
const PaginationNext = ({ className, ...props }) => ((0, jsx_runtime_1.jsxs)(PaginationLink, { "aria-label": "Go to next page", icon: false, size: "medium", className: (0, utils_1.cn)('gap-1 pr-2.5', className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { children: "Next" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] }));
|
|
61
|
+
exports.PaginationNext = PaginationNext;
|
|
62
|
+
PaginationNext.displayName = 'PaginationNext';
|
|
63
|
+
const PaginationEllipsis = ({ className, ...props }) => ((0, jsx_runtime_1.jsxs)("span", { "aria-hidden": true, className: (0, utils_1.cn)('flex h-9 w-9 items-center justify-center', className), ...props, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.MoreHorizontal, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "More pages" })] }));
|
|
64
|
+
exports.PaginationEllipsis = PaginationEllipsis;
|
|
65
|
+
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
@@ -0,0 +1,218 @@
|
|
|
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.PhoneInput = exports.PHONE_COUNTRIES = void 0;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const utils_1 = require("../lib/utils");
|
|
40
|
+
const countryUtils_1 = require("../lib/countryUtils");
|
|
41
|
+
const icons_1 = require("@freightos/icons");
|
|
42
|
+
const React = __importStar(require("react"));
|
|
43
|
+
const libphonenumber_js_1 = require("libphonenumber-js");
|
|
44
|
+
// Countries with dial codes
|
|
45
|
+
exports.PHONE_COUNTRIES = [
|
|
46
|
+
{ code: 'US', name: 'United States', dialCode: '+1' },
|
|
47
|
+
{ code: 'CN', name: 'China', dialCode: '+86' },
|
|
48
|
+
{ code: 'GB', name: 'United Kingdom', dialCode: '+44' },
|
|
49
|
+
{ code: 'CA', name: 'Canada', dialCode: '+1' },
|
|
50
|
+
{ code: 'DE', name: 'Germany', dialCode: '+49' },
|
|
51
|
+
{ code: 'FR', name: 'France', dialCode: '+33' },
|
|
52
|
+
{ code: 'IT', name: 'Italy', dialCode: '+39' },
|
|
53
|
+
{ code: 'ES', name: 'Spain', dialCode: '+34' },
|
|
54
|
+
{ code: 'NL', name: 'Netherlands', dialCode: '+31' },
|
|
55
|
+
{ code: 'BE', name: 'Belgium', dialCode: '+32' },
|
|
56
|
+
{ code: 'CH', name: 'Switzerland', dialCode: '+41' },
|
|
57
|
+
{ code: 'AT', name: 'Austria', dialCode: '+43' },
|
|
58
|
+
{ code: 'SE', name: 'Sweden', dialCode: '+46' },
|
|
59
|
+
{ code: 'NO', name: 'Norway', dialCode: '+47' },
|
|
60
|
+
{ code: 'DK', name: 'Denmark', dialCode: '+45' },
|
|
61
|
+
{ code: 'FI', name: 'Finland', dialCode: '+358' },
|
|
62
|
+
{ code: 'PL', name: 'Poland', dialCode: '+48' },
|
|
63
|
+
{ code: 'CZ', name: 'Czech Republic', dialCode: '+420' },
|
|
64
|
+
{ code: 'IE', name: 'Ireland', dialCode: '+353' },
|
|
65
|
+
{ code: 'PT', name: 'Portugal', dialCode: '+351' },
|
|
66
|
+
{ code: 'GR', name: 'Greece', dialCode: '+30' },
|
|
67
|
+
{ code: 'JP', name: 'Japan', dialCode: '+81' },
|
|
68
|
+
{ code: 'KR', name: 'South Korea', dialCode: '+82' },
|
|
69
|
+
{ code: 'IN', name: 'India', dialCode: '+91' },
|
|
70
|
+
{ code: 'AU', name: 'Australia', dialCode: '+61' },
|
|
71
|
+
{ code: 'NZ', name: 'New Zealand', dialCode: '+64' },
|
|
72
|
+
{ code: 'SG', name: 'Singapore', dialCode: '+65' },
|
|
73
|
+
{ code: 'HK', name: 'Hong Kong', dialCode: '+852' },
|
|
74
|
+
{ code: 'TW', name: 'Taiwan', dialCode: '+886' },
|
|
75
|
+
{ code: 'TH', name: 'Thailand', dialCode: '+66' },
|
|
76
|
+
{ code: 'MY', name: 'Malaysia', dialCode: '+60' },
|
|
77
|
+
{ code: 'ID', name: 'Indonesia', dialCode: '+62' },
|
|
78
|
+
{ code: 'PH', name: 'Philippines', dialCode: '+63' },
|
|
79
|
+
{ code: 'VN', name: 'Vietnam', dialCode: '+84' },
|
|
80
|
+
{ code: 'BR', name: 'Brazil', dialCode: '+55' },
|
|
81
|
+
{ code: 'MX', name: 'Mexico', dialCode: '+52' },
|
|
82
|
+
{ code: 'AR', name: 'Argentina', dialCode: '+54' },
|
|
83
|
+
{ code: 'CL', name: 'Chile', dialCode: '+56' },
|
|
84
|
+
{ code: 'CO', name: 'Colombia', dialCode: '+57' },
|
|
85
|
+
{ code: 'PE', name: 'Peru', dialCode: '+51' },
|
|
86
|
+
{ code: 'ZA', name: 'South Africa', dialCode: '+27' },
|
|
87
|
+
{ code: 'EG', name: 'Egypt', dialCode: '+20' },
|
|
88
|
+
{ code: 'IL', name: 'Israel', dialCode: '+972' },
|
|
89
|
+
{ code: 'AE', name: 'United Arab Emirates', dialCode: '+971' },
|
|
90
|
+
{ code: 'SA', name: 'Saudi Arabia', dialCode: '+966' },
|
|
91
|
+
{ code: 'TR', name: 'Turkey', dialCode: '+90' },
|
|
92
|
+
{ code: 'RU', name: 'Russia', dialCode: '+7' },
|
|
93
|
+
{ code: 'UA', name: 'Ukraine', dialCode: '+380' },
|
|
94
|
+
];
|
|
95
|
+
const PhoneInput = ({ value = '', onChange, onError, placeholder = 'Enter phone number', defaultCountry = 'US', mostUsedCountries = ['US', 'CN'], countries = exports.PHONE_COUNTRIES, className, disabled = false, }) => {
|
|
96
|
+
const [open, setOpen] = React.useState(false);
|
|
97
|
+
const [search, setSearch] = React.useState('');
|
|
98
|
+
const [selectedCountry, setSelectedCountry] = React.useState(() => countries.find((c) => c.code === defaultCountry) || countries[0]);
|
|
99
|
+
const [phoneNumber, setPhoneNumber] = React.useState('');
|
|
100
|
+
const containerRef = React.useRef(null);
|
|
101
|
+
const searchInputRef = React.useRef(null);
|
|
102
|
+
// Parse initial value to extract country and number
|
|
103
|
+
React.useEffect(() => {
|
|
104
|
+
if (value) {
|
|
105
|
+
try {
|
|
106
|
+
const parsed = (0, libphonenumber_js_1.parsePhoneNumberFromString)(value);
|
|
107
|
+
if (parsed) {
|
|
108
|
+
const countryCode = parsed.country;
|
|
109
|
+
if (countryCode) {
|
|
110
|
+
const country = countries.find((c) => c.code === countryCode);
|
|
111
|
+
if (country) {
|
|
112
|
+
setSelectedCountry(country);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
setPhoneNumber(parsed.nationalNumber);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
// Try to extract dial code from value
|
|
119
|
+
const matchingCountry = countries.find((c) => value.startsWith(c.dialCode));
|
|
120
|
+
if (matchingCountry) {
|
|
121
|
+
setSelectedCountry(matchingCountry);
|
|
122
|
+
setPhoneNumber(value.slice(matchingCountry.dialCode.length).trim());
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
setPhoneNumber(value.replace(/^\+\d+\s*/, ''));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
setPhoneNumber(value);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
|
+
}, []);
|
|
135
|
+
// Filter countries based on search
|
|
136
|
+
const filteredCountries = React.useMemo(() => {
|
|
137
|
+
const searchLower = search.toLowerCase();
|
|
138
|
+
const filtered = countries.filter((country) => country.name.toLowerCase().includes(searchLower) ||
|
|
139
|
+
country.code.toLowerCase().includes(searchLower) ||
|
|
140
|
+
country.dialCode.includes(search));
|
|
141
|
+
return filtered.sort((a, b) => {
|
|
142
|
+
const aIsMostUsed = mostUsedCountries.includes(a.code);
|
|
143
|
+
const bIsMostUsed = mostUsedCountries.includes(b.code);
|
|
144
|
+
if (aIsMostUsed && !bIsMostUsed)
|
|
145
|
+
return -1;
|
|
146
|
+
if (!aIsMostUsed && bIsMostUsed)
|
|
147
|
+
return 1;
|
|
148
|
+
return a.name.localeCompare(b.name);
|
|
149
|
+
});
|
|
150
|
+
}, [countries, search, mostUsedCountries]);
|
|
151
|
+
// Close on click outside
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
const handleClickOutside = (e) => {
|
|
154
|
+
if (containerRef.current &&
|
|
155
|
+
!containerRef.current.contains(e.target)) {
|
|
156
|
+
setOpen(false);
|
|
157
|
+
setSearch('');
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
if (open) {
|
|
161
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
162
|
+
}
|
|
163
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
164
|
+
}, [open]);
|
|
165
|
+
const handleCountrySelect = (country) => {
|
|
166
|
+
setSelectedCountry(country);
|
|
167
|
+
setOpen(false);
|
|
168
|
+
setSearch('');
|
|
169
|
+
// Update full value with new country code
|
|
170
|
+
const fullNumber = `${country.dialCode} ${phoneNumber}`.trim();
|
|
171
|
+
onChange?.(fullNumber);
|
|
172
|
+
validateNumber(phoneNumber, country.code);
|
|
173
|
+
};
|
|
174
|
+
const handlePhoneChange = (e) => {
|
|
175
|
+
const input = e.target.value;
|
|
176
|
+
// Format as user types
|
|
177
|
+
const formatter = new libphonenumber_js_1.AsYouType(selectedCountry.code);
|
|
178
|
+
const formatted = formatter.input(input);
|
|
179
|
+
// Extract just the national number part
|
|
180
|
+
const nationalNumber = formatted.replace(/^\+\d+\s*/, '');
|
|
181
|
+
setPhoneNumber(nationalNumber);
|
|
182
|
+
// Build full international number
|
|
183
|
+
const fullNumber = `${selectedCountry.dialCode} ${nationalNumber}`.trim();
|
|
184
|
+
onChange?.(fullNumber);
|
|
185
|
+
validateNumber(nationalNumber, selectedCountry.code);
|
|
186
|
+
};
|
|
187
|
+
const validateNumber = (number, countryCode) => {
|
|
188
|
+
if (!number || !onError)
|
|
189
|
+
return;
|
|
190
|
+
try {
|
|
191
|
+
const fullNumber = `${(0, libphonenumber_js_1.getCountryCallingCode)(countryCode)}${number.replace(/\D/g, '')}`;
|
|
192
|
+
const parsed = (0, libphonenumber_js_1.parsePhoneNumberFromString)(`+${fullNumber}`, countryCode);
|
|
193
|
+
onError?.(!parsed?.isValid());
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
onError?.(true);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const handleTriggerClick = () => {
|
|
200
|
+
if (!disabled) {
|
|
201
|
+
setOpen(!open);
|
|
202
|
+
if (!open) {
|
|
203
|
+
setTimeout(() => searchInputRef.current?.focus(), 0);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: (0, utils_1.cn)('relative flex min-w-0', className), children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: handleTriggerClick, disabled: disabled, className: (0, utils_1.cn)('flex h-[32px] shrink-0 items-center gap-fds-xs rounded-l-fds-md border border-r-0 border-input-border bg-input px-fds-sm text-fds-base outline-none transition-[color,box-shadow]', open &&
|
|
208
|
+
'border-[#2075bd] shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)]', disabled && 'cursor-not-allowed opacity-50'), children: [(0, jsx_runtime_1.jsx)("img", { src: (0, countryUtils_1.getCountryFlag)(selectedCountry.code), alt: selectedCountry.code, className: "h-4 w-4 shrink-0 rounded-full object-cover" }), (0, jsx_runtime_1.jsx)("span", { className: "text-fds-sm text-fds-gray-60", children: selectedCountry.dialCode }), (0, jsx_runtime_1.jsx)(icons_1.IconCaretDown, { size: 14, className: (0, utils_1.cn)('shrink-0 text-fds-gray-60 transition-transform', open && 'rotate-180') })] }), (0, jsx_runtime_1.jsx)("input", { type: "tel", value: phoneNumber, onChange: handlePhoneChange, placeholder: placeholder, disabled: disabled, className: (0, utils_1.cn)('h-[32px] flex-1 rounded-r-fds-md border border-input-border bg-input px-fds-sm text-fds-base outline-none transition-[color,box-shadow] placeholder:text-muted-foreground', 'focus:border-[#2075bd] focus:shadow-[0_0_0_2px_var(--fds-color-primary-blue-20)]', disabled && 'cursor-not-allowed opacity-50') }), open && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute left-0 top-full z-50 mt-fds-xs w-[280px] rounded-fds-md border border-border bg-popover shadow-lg", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b border-border p-fds-xs", children: (0, jsx_runtime_1.jsx)("input", { ref: searchInputRef, 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)]" }) }), (0, jsx_runtime_1.jsx)("div", { className: "max-h-[210px] overflow-y-auto p-fds-xs", children: filteredCountries.length === 0 ? ((0, jsx_runtime_1.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) => {
|
|
209
|
+
const isSelected = country.code === selectedCountry.code;
|
|
210
|
+
const isMostUsed = mostUsedCountries.includes(country.code);
|
|
211
|
+
const isLastMostUsed = isMostUsed &&
|
|
212
|
+
!search &&
|
|
213
|
+
index === mostUsedCountries.length - 1 &&
|
|
214
|
+
filteredCountries.length > mostUsedCountries.length;
|
|
215
|
+
return ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { onClick: () => handleCountrySelect(country), className: (0, utils_1.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: [(0, jsx_runtime_1.jsx)("img", { src: (0, countryUtils_1.getCountryFlag)(country.code), alt: country.code, className: "h-6 w-6 shrink-0 rounded-full object-cover" }), (0, jsx_runtime_1.jsx)("span", { className: "flex-1 truncate text-fds-base", children: country.name }), (0, jsx_runtime_1.jsx)("span", { className: "text-fds-sm text-fds-gray-60", children: country.dialCode })] }), isLastMostUsed && ((0, jsx_runtime_1.jsx)("div", { className: "my-fds-xs h-px bg-border" }))] }, country.code));
|
|
216
|
+
})) })] }))] }));
|
|
217
|
+
};
|
|
218
|
+
exports.PhoneInput = PhoneInput;
|
|
@@ -0,0 +1,49 @@
|
|
|
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.PopoverArrow = exports.PopoverContent = exports.PopoverTrigger = exports.Popover = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const PopoverPrimitive = __importStar(require("@radix-ui/react-popover"));
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const Popover = PopoverPrimitive.Root;
|
|
42
|
+
exports.Popover = Popover;
|
|
43
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
44
|
+
exports.PopoverTrigger = PopoverTrigger;
|
|
45
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, showArrow = false, ...props }, ref) => ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Portal, { children: (0, jsx_runtime_1.jsxs)(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: (0, utils_1.cn)("z-[1300] w-72 rounded-md bg-popover p-4 text-popover-foreground shadow-fds-md outline-none 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-popover-content-transform-origin]", className), ...props, children: [props.children, showArrow && ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Arrow, { className: "fill-popover", width: 16, height: 8 }))] }) })));
|
|
46
|
+
exports.PopoverContent = PopoverContent;
|
|
47
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
48
|
+
const PopoverArrow = PopoverPrimitive.Arrow;
|
|
49
|
+
exports.PopoverArrow = PopoverArrow;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Progress = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const ProgressPrimitive = __importStar(require("@radix-ui/react-progress"));
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const Progress = React.forwardRef(({ className, value, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ProgressPrimitive.Root, { ref: ref, className: (0, utils_1.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className), ...props, children: (0, jsx_runtime_1.jsx)(ProgressPrimitive.Indicator, { className: "h-full w-full flex-1 bg-primary transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
42
|
+
exports.Progress = Progress;
|
|
43
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
@@ -0,0 +1,84 @@
|
|
|
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.RadioButtonGroupItem = exports.RadioButtonGroup = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const utils_1 = require("../lib/utils");
|
|
39
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const radio_group_1 = require("./radio-group");
|
|
42
|
+
const radioButtonGroupItemVariants = (0, class_variance_authority_1.cva)('relative flex cursor-pointer items-center justify-center border bg-card px-[15px] transition-all has-[[data-state=checked]]:z-10', {
|
|
43
|
+
variants: {
|
|
44
|
+
size: {
|
|
45
|
+
small: 'h-[24px]',
|
|
46
|
+
medium: 'h-[32px]',
|
|
47
|
+
large: 'h-[40px]',
|
|
48
|
+
},
|
|
49
|
+
variant: {
|
|
50
|
+
default: 'border-fds-gray-30 text-fds-gray-80 dark:border-fds-gray-60 dark:text-fds-gray-40 has-[[data-state=checked]]:border-fds-blue has-[[data-state=checked]]:bg-fds-blue-10 has-[[data-state=checked]]:text-fds-blue dark:has-[[data-state=checked]]:border-fds-blue-20 dark:has-[[data-state=checked]]:text-fds-blue',
|
|
51
|
+
custom: '', // No default checked styles, allows full customization
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
size: 'medium',
|
|
56
|
+
variant: 'default',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const RadioButtonGroup = React.forwardRef(({ className, children, size, borderRadius = 'lg', ...props }, ref) => {
|
|
60
|
+
const childrenArray = React.Children.toArray(children);
|
|
61
|
+
const childrenWithProps = childrenArray.map((child, index) => {
|
|
62
|
+
if (React.isValidElement(child)) {
|
|
63
|
+
const isFirst = index === 0;
|
|
64
|
+
const isLast = index === childrenArray.length - 1;
|
|
65
|
+
const roundedStart = borderRadius === 'full' ? 'rounded-s-full' : 'rounded-s-fds-md';
|
|
66
|
+
const roundedEnd = borderRadius === 'full' ? 'rounded-e-full' : 'rounded-e-fds-md';
|
|
67
|
+
const childProps = child.props;
|
|
68
|
+
return React.cloneElement(child, {
|
|
69
|
+
...childProps,
|
|
70
|
+
size: childProps.size ?? size ?? undefined,
|
|
71
|
+
className: (0, utils_1.cn)(childProps.className, isFirst && roundedStart, isLast && roundedEnd, !isFirst && '-ml-px') || undefined,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return child;
|
|
75
|
+
});
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(radio_group_1.RadioGroup, { ref: ref, className: (0, utils_1.cn)('flex gap-0', className), ...props, children: childrenWithProps }));
|
|
77
|
+
});
|
|
78
|
+
exports.RadioButtonGroup = RadioButtonGroup;
|
|
79
|
+
RadioButtonGroup.displayName = 'RadioButtonGroup';
|
|
80
|
+
const RadioButtonGroupItem = React.forwardRef(({ className, value, id, size, variant, children, ...props }, ref) => {
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)(radioButtonGroupItemVariants({ size, variant }), className), ...props, children: [(0, jsx_runtime_1.jsx)(radio_group_1.RadioGroupItem, { id: id, value: value, className: "sr-only" }), (0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: "cursor-pointer whitespace-nowrap font-medium after:absolute after:inset-0", style: { color: 'inherit', fontSize: 'inherit' }, children: children })] }));
|
|
82
|
+
});
|
|
83
|
+
exports.RadioButtonGroupItem = RadioButtonGroupItem;
|
|
84
|
+
RadioButtonGroupItem.displayName = 'RadioButtonGroupItem';
|
|
@@ -0,0 +1,50 @@
|
|
|
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.RadioGroupItem = exports.RadioGroup = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const RadioGroupPrimitive = __importStar(require("@radix-ui/react-radio-group"));
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const utils_1 = require("../lib/utils");
|
|
41
|
+
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Root, { className: (0, utils_1.cn)('grid gap-2', className), ...props, ref: ref }));
|
|
43
|
+
});
|
|
44
|
+
exports.RadioGroup = RadioGroup;
|
|
45
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
46
|
+
const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Item, { ref: ref, className: (0, utils_1.cn)('aspect-square h-[16px] w-[16px] rounded-full border border-fds-gray-80 text-fds-blue ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-fds-blue focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-fds-blue', className), ...props, children: (0, jsx_runtime_1.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "h-[8px] w-[8px] rounded-full bg-fds-blue" }) }) }));
|
|
48
|
+
});
|
|
49
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
50
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
@@ -0,0 +1,47 @@
|
|
|
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.ResizablePanelGroup = exports.ResizablePanel = exports.ResizableHandle = void 0;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const lucide_react_1 = require("lucide-react");
|
|
40
|
+
const ResizablePrimitive = __importStar(require("react-resizable-panels"));
|
|
41
|
+
const utils_1 = require("../lib/utils");
|
|
42
|
+
const ResizablePanelGroup = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)(ResizablePrimitive.PanelGroup, { className: (0, utils_1.cn)('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className), ...props }));
|
|
43
|
+
exports.ResizablePanelGroup = ResizablePanelGroup;
|
|
44
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
45
|
+
exports.ResizablePanel = ResizablePanel;
|
|
46
|
+
const ResizableHandle = ({ withHandle, className, ...props }) => ((0, jsx_runtime_1.jsx)(ResizablePrimitive.PanelResizeHandle, { className: (0, utils_1.cn)('relative flex w-px items-center justify-center bg-fds-gray-20 dark:bg-fds-gray-70 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fds-blue-50 focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90', className), ...props, children: withHandle && ((0, jsx_runtime_1.jsx)("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-fds-gray-20 bg-fds-gray-10 dark:border-fds-gray-70 dark:bg-fds-gray-80", children: (0, jsx_runtime_1.jsx)(lucide_react_1.GripVertical, { className: "h-2.5 w-2.5" }) })) }));
|
|
47
|
+
exports.ResizableHandle = ResizableHandle;
|