ikoncomponents 1.1.6 → 1.1.7

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.
Files changed (82) hide show
  1. package/dist/hooks/use-mobile.js +2 -38
  2. package/dist/ikoncomponents/action-menu/index.js +15 -18
  3. package/dist/ikoncomponents/action-menu/type.js +1 -2
  4. package/dist/ikoncomponents/alert-dialog/index.js +6 -10
  5. package/dist/ikoncomponents/buttons/index.js +32 -23
  6. package/dist/ikoncomponents/combobox-input/index.js +14 -16
  7. package/dist/ikoncomponents/combobox-input/type.js +1 -2
  8. package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +13 -16
  9. package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +22 -58
  10. package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +18 -21
  11. package/dist/ikoncomponents/data-table/datatable-pagination/index.js +10 -13
  12. package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +17 -19
  13. package/dist/ikoncomponents/data-table/function.js +4 -7
  14. package/dist/ikoncomponents/data-table/index.js +81 -116
  15. package/dist/ikoncomponents/data-table/type.js +1 -2
  16. package/dist/ikoncomponents/e-chart/index.js +32 -37
  17. package/dist/ikoncomponents/file-input/index.js +20 -11
  18. package/dist/ikoncomponents/glowing-effect/index.js +16 -18
  19. package/dist/ikoncomponents/icon/index.js +16 -40
  20. package/dist/ikoncomponents/loading-spinner/index.js +16 -8
  21. package/dist/ikoncomponents/multi-combobox/index.js +31 -30
  22. package/dist/ikoncomponents/no-data/index.js +4 -7
  23. package/dist/ikoncomponents/page-wrapper/index.js +5 -8
  24. package/dist/ikoncomponents/password-strength-meter/index.js +6 -13
  25. package/dist/ikoncomponents/phone-input/index.js +30 -54
  26. package/dist/ikoncomponents/resource-spreadsheet/index.js +11 -48
  27. package/dist/ikoncomponents/search-input/index.js +18 -9
  28. package/dist/ikoncomponents/sheet/index.js +5 -8
  29. package/dist/ikoncomponents/simple-widget/index.js +8 -11
  30. package/dist/ikoncomponents/tabs/index.js +20 -22
  31. package/dist/ikoncomponents/tabs/type.js +1 -2
  32. package/dist/ikoncomponents/theme-toggle-btn/index.js +8 -11
  33. package/dist/ikoncomponents/title-progress/index.js +4 -7
  34. package/dist/ikoncomponents/tooltip/index.js +4 -7
  35. package/dist/ikoncomponents/twolevel-dropdown/index.js +20 -53
  36. package/dist/ikoncomponents/widgets/index.js +10 -13
  37. package/dist/ikoncomponents/widgets/type.js +1 -2
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.js +70 -123
  40. package/dist/shadcn/accordion.js +28 -51
  41. package/dist/shadcn/alert-dialog.js +60 -70
  42. package/dist/shadcn/alert.d.ts +1 -1
  43. package/dist/shadcn/alert.js +25 -15
  44. package/dist/shadcn/avatar.js +24 -47
  45. package/dist/shadcn/badge.d.ts +1 -1
  46. package/dist/shadcn/badge.js +21 -13
  47. package/dist/shadcn/button.d.ts +1 -1
  48. package/dist/shadcn/button.js +21 -13
  49. package/dist/shadcn/calendar.js +42 -97
  50. package/dist/shadcn/card.js +35 -25
  51. package/dist/shadcn/checkbox.js +19 -42
  52. package/dist/shadcn/command.js +53 -43
  53. package/dist/shadcn/date-input.js +25 -60
  54. package/dist/shadcn/date-range-picker.js +14 -18
  55. package/dist/shadcn/dialog.js +56 -79
  56. package/dist/shadcn/dropdown-menu.js +61 -84
  57. package/dist/shadcn/hover-card.js +24 -47
  58. package/dist/shadcn/input.js +17 -7
  59. package/dist/shadcn/label.js +18 -41
  60. package/dist/shadcn/navigation-menu.d.ts +1 -1
  61. package/dist/shadcn/navigation-menu.js +43 -68
  62. package/dist/shadcn/popover.js +27 -50
  63. package/dist/shadcn/progress.js +19 -42
  64. package/dist/shadcn/radio-group.js +23 -45
  65. package/dist/shadcn/scroll-area.js +22 -45
  66. package/dist/shadcn/select.js +58 -81
  67. package/dist/shadcn/separator.js +18 -41
  68. package/dist/shadcn/sheet.js +52 -73
  69. package/dist/shadcn/sidebar.d.ts +1 -1
  70. package/dist/shadcn/sidebar.js +113 -141
  71. package/dist/shadcn/skeleton.js +17 -7
  72. package/dist/shadcn/slider.js +19 -42
  73. package/dist/shadcn/sonner.js +20 -11
  74. package/dist/shadcn/switch.js +18 -41
  75. package/dist/shadcn/table.js +46 -36
  76. package/dist/shadcn/tabs.js +27 -50
  77. package/dist/shadcn/textarea.js +17 -7
  78. package/dist/shadcn/tooltip.js +27 -50
  79. package/dist/shadcn/workflow.js +8 -8
  80. package/dist/utils/cn.js +4 -7
  81. package/dist/utils/theme-provider/index.js +16 -7
  82. package/package.json +2 -1
@@ -1,47 +1,23 @@
1
- "use strict";
2
1
  "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.Icon = Icon;
38
- const jsx_runtime_1 = require("react/jsx-runtime");
39
- const LucideIcons = __importStar(require("lucide-react"));
40
- function Icon({ name, ...props }) {
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import * as LucideIcons from 'lucide-react';
15
+ export function Icon(_a) {
16
+ var { name } = _a, props = __rest(_a, ["name"]);
41
17
  const IconComponent = LucideIcons[name];
42
18
  if (!IconComponent) {
43
19
  console.warn(`Icon "${name}" not found in lucide-react`);
44
20
  return null;
45
21
  }
46
- return (0, jsx_runtime_1.jsx)(IconComponent, { ...props });
22
+ return _jsx(IconComponent, Object.assign({}, props));
47
23
  }
@@ -1,11 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoadingSpinner = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const cn_1 = require("../../utils/cn");
6
- const LoadingSpinner = ({ size = 48, className, visible = true, ...props }) => {
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { cn } from "../../utils/cn";
14
+ export const LoadingSpinner = (_a) => {
15
+ var { size = 48, className, visible = true } = _a, props = __rest(_a, ["size", "className", "visible"]);
7
16
  if (!visible)
8
17
  return null;
9
- return ((0, jsx_runtime_1.jsx)("div", { className: "h-full w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, ...props, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: (0, cn_1.cn)("animate-spin", className), children: (0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) }) }));
18
+ return (_jsx("div", { className: "h-full w-full", children: _jsx("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size }, props, { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("animate-spin", className), children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })) }) }));
10
19
  };
11
- exports.LoadingSpinner = LoadingSpinner;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiCombobox = MultiCombobox;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
2
  // import React, { useEffect, useState } from 'react'
6
3
  // import { Popover, PopoverContent, PopoverTrigger } from '@/shadcn/ui/popover'
7
4
  // import { Button } from '@/shadcn/ui/button'
@@ -98,25 +95,25 @@ const jsx_runtime_1 = require("react/jsx-runtime");
98
95
  // </>
99
96
  // )
100
97
  // }
101
- const react_1 = require("react");
102
- const popover_1 = require("../../shadcn/popover");
103
- const button_1 = require("../../shadcn/button");
104
- const cn_1 = require("../../utils/cn");
105
- const lucide_react_1 = require("lucide-react");
106
- const command_1 = require("../../shadcn/command");
107
- const tooltip_1 = require("../../shadcn/tooltip");
108
- const checkbox_1 = require("../../shadcn/checkbox");
109
- function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions = 2 }) {
110
- const [selectedItems, setSelectedItems] = (0, react_1.useState)(defaultValue || []);
111
- const [search, setSearch] = (0, react_1.useState)("");
112
- const containerRef = (0, react_1.useRef)(null);
113
- const [open, setOpen] = (0, react_1.useState)(false);
114
- (0, react_1.useEffect)(() => {
98
+ import { useEffect, useState, useRef, useCallback } from 'react';
99
+ import { Popover, PopoverContent, PopoverTrigger } from '../../shadcn/popover';
100
+ import { Button } from '../../shadcn/button';
101
+ import { cn } from '../../utils/cn';
102
+ import { ChevronsUpDown, X } from 'lucide-react';
103
+ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../shadcn/command';
104
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../shadcn/tooltip';
105
+ import { Checkbox } from '../../shadcn/checkbox';
106
+ export function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaultOptions = 2 }) {
107
+ const [selectedItems, setSelectedItems] = useState(defaultValue || []);
108
+ const [search, setSearch] = useState("");
109
+ const containerRef = useRef(null);
110
+ const [open, setOpen] = useState(false);
111
+ useEffect(() => {
115
112
  onValueChange(selectedItems);
116
113
  }, [selectedItems, onValueChange]);
117
114
  const filteredItems = items
118
115
  .filter((item) => (item.label || item.value).toLowerCase().includes(search.toLowerCase()))
119
- .sort((a, b) => (a?.label ?? "").localeCompare(b?.label ?? ""));
116
+ .sort((a, b) => { var _a, _b; return ((_a = a === null || a === void 0 ? void 0 : a.label) !== null && _a !== void 0 ? _a : "").localeCompare((_b = b === null || b === void 0 ? void 0 : b.label) !== null && _b !== void 0 ? _b : ""); });
120
117
  const onWheel = (e) => {
121
118
  const el = e.currentTarget;
122
119
  el.scrollTop += e.deltaY;
@@ -128,8 +125,8 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
128
125
  : [...selectedItems, value];
129
126
  setSelectedItems(updatedItems);
130
127
  };
131
- const [visibleCount, setVisibleCount] = (0, react_1.useState)(selectedItems.length);
132
- const calculateVisibleItems = (0, react_1.useCallback)(() => {
128
+ const [visibleCount, setVisibleCount] = useState(selectedItems.length);
129
+ const calculateVisibleItems = useCallback(() => {
133
130
  const container = containerRef.current;
134
131
  if (!container)
135
132
  return visibleCount;
@@ -149,7 +146,7 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
149
146
  }
150
147
  return fitCount;
151
148
  }, [visibleCount]);
152
- (0, react_1.useEffect)(() => {
149
+ useEffect(() => {
153
150
  const container = containerRef.current;
154
151
  if (!container)
155
152
  return;
@@ -170,9 +167,10 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
170
167
  resizeObserver.disconnect();
171
168
  };
172
169
  }, [calculateVisibleItems]);
173
- return ((0, jsx_runtime_1.jsxs)(popover_1.Popover, { open: open, onOpenChange: setOpen, children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { asChild: true, className: "w-full", children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", role: "combobox", className: (0, cn_1.cn)("justify-between px-3 py-2 h-10", selectedItems.length === 0 && "text-foreground/50", "bg-secondary"), onClick: () => setOpen((prev) => !prev), children: [selectedItems.length > 0 ? ((0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: "flex flex-wrap gap-2 items-center overflow-hidden flex-1", children: [selectedItems.slice(0, defaultOptions).map((value) => {
174
- const label = items.find((item) => item.value === value)?.label || value;
175
- return ((0, jsx_runtime_1.jsxs)("span", { className: "flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full", title: label, children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate max-w-[120px]", children: label }), (0, jsx_runtime_1.jsx)("span", { role: "button", tabIndex: 0, onClick: (e) => {
170
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, className: "w-full", children: _jsxs(Button, { variant: "outline", role: "combobox", className: cn("justify-between px-3 py-2 h-10", selectedItems.length === 0 && "text-foreground/50", "bg-secondary"), onClick: () => setOpen((prev) => !prev), children: [selectedItems.length > 0 ? (_jsx(TooltipProvider, { children: _jsxs("div", { ref: containerRef, className: "flex flex-wrap gap-2 items-center overflow-hidden flex-1", children: [selectedItems.slice(0, defaultOptions).map((value) => {
171
+ var _a;
172
+ const label = ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value;
173
+ return (_jsxs("span", { className: "flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full", title: label, children: [_jsx("span", { className: "truncate max-w-[120px]", children: label }), _jsx("span", { role: "button", tabIndex: 0, onClick: (e) => {
176
174
  e.stopPropagation();
177
175
  toggleItem(value);
178
176
  }, onKeyDown: (e) => {
@@ -181,21 +179,24 @@ function MultiCombobox({ placeholder, items, onValueChange, defaultValue, defaul
181
179
  e.stopPropagation();
182
180
  toggleItem(value);
183
181
  }
184
- }, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-3 h-3 ml-1" }) })] }, value));
185
- }), selectedItems.length > defaultOptions && ((0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("span", { className: "px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer", children: ["+", selectedItems.length - defaultOptions, " more"] }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { className: "max-w-xs break-words", children: (0, jsx_runtime_1.jsx)("div", { onWheel: onWheel, className: "flex flex-col gap-1 max-h-[200px] overflow-auto", children: selectedItems.slice(defaultOptions).map((value) => ((0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: items.find((item) => item.value === value)?.label || value }, value))) }) })] }))] }) })) : ((0, jsx_runtime_1.jsx)("span", { className: "flex-1 text-left truncate", children: placeholder })), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { className: "p-0 min-w-[var(--radix-popover-trigger-width)]", style: { width: 'max-content', maxWidth: 'min(500px, 90vw)' }, align: "start", children: (0, jsx_runtime_1.jsxs)(command_1.Command, { onMouseDown: (e) => e.preventDefault(), children: [(0, jsx_runtime_1.jsx)(command_1.CommandInput, { placeholder: "Search...", value: search, onValueChange: setSearch }), (0, jsx_runtime_1.jsxs)(command_1.CommandList, { onWheel: onWheel, className: "max-h-60 overflow-auto", children: [(0, jsx_runtime_1.jsx)(command_1.CommandEmpty, { children: "No items found." }), (0, jsx_runtime_1.jsx)(command_1.CommandGroup, { children: filteredItems.map((item) => {
182
+ }, className: "ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none", children: _jsx(X, { className: "w-3 h-3 ml-1" }) })] }, value));
183
+ }), selectedItems.length > defaultOptions && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("span", { className: "px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer", children: ["+", selectedItems.length - defaultOptions, " more"] }) }), _jsx(TooltipContent, { className: "max-w-xs break-words", children: _jsx("div", { onWheel: onWheel, className: "flex flex-col gap-1 max-h-[200px] overflow-auto", children: selectedItems.slice(defaultOptions).map((value) => {
184
+ var _a;
185
+ return (_jsx("span", { className: "text-sm", children: ((_a = items.find((item) => item.value === value)) === null || _a === void 0 ? void 0 : _a.label) || value }, value));
186
+ }) }) })] }))] }) })) : (_jsx("span", { className: "flex-1 text-left truncate", children: placeholder })), _jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0 min-w-[var(--radix-popover-trigger-width)]", style: { width: 'max-content', maxWidth: 'min(500px, 90vw)' }, align: "start", children: _jsxs(Command, { onMouseDown: (e) => e.preventDefault(), children: [_jsx(CommandInput, { placeholder: "Search...", value: search, onValueChange: setSearch }), _jsxs(CommandList, { onWheel: onWheel, className: "max-h-60 overflow-auto", children: [_jsx(CommandEmpty, { children: "No items found." }), _jsx(CommandGroup, { children: filteredItems.map((item) => {
186
187
  const isSelected = selectedItems.includes(item.value);
187
188
  const isDisabled = item.disabled === true || (typeof item.disabled === "function" && item.disabled(item));
188
- return ((0, jsx_runtime_1.jsxs)(command_1.CommandItem, { value: item.label || item.value, disabled: isDisabled, onPointerDown: (e) => {
189
+ return (_jsxs(CommandItem, { value: item.label || item.value, disabled: isDisabled, onPointerDown: (e) => {
189
190
  e.preventDefault();
190
191
  e.stopPropagation();
191
192
  }, onSelect: () => {
192
193
  if (!isDisabled) {
193
194
  toggleItem(item.value);
194
195
  }
195
- }, className: (0, cn_1.cn)("flex items-center justify-between space-x-2", isDisabled && "opacity-50 cursor-not-allowed"), children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: isSelected, onCheckedChange: () => {
196
+ }, className: cn("flex items-center justify-between space-x-2", isDisabled && "opacity-50 cursor-not-allowed"), children: [_jsx(Checkbox, { checked: isSelected, onCheckedChange: () => {
196
197
  if (!isDisabled) {
197
198
  toggleItem(item.value);
198
199
  }
199
- }, onClick: (e) => e.stopPropagation(), disabled: isDisabled }), (0, jsx_runtime_1.jsx)("span", { className: "flex-grow text-left", children: item?.label || item.value })] }, item.value));
200
+ }, onClick: (e) => e.stopPropagation(), disabled: isDisabled }), _jsx("span", { className: "flex-grow text-left", children: (item === null || item === void 0 ? void 0 : item.label) || item.value })] }, item.value));
200
201
  }) })] })] }) })] }));
201
202
  }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoDataComponent = NoDataComponent;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const lucide_react_1 = require("lucide-react");
6
- function NoDataComponent({ text }) {
7
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full justify-center text-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { className: "text-muted-foreground mx-auto", size: 36 }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted-foreground", children: text ? text : "No Data Available" })] }));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CircleAlert } from "lucide-react";
3
+ export function NoDataComponent({ text }) {
4
+ return (_jsxs("div", { className: "flex flex-col h-full justify-center text-center gap-2", children: [_jsx(CircleAlert, { className: "text-muted-foreground mx-auto", size: 36 }), _jsx("p", { className: "text-muted-foreground", children: text ? text : "No Data Available" })] }));
8
5
  }
@@ -1,10 +1,7 @@
1
- "use strict";
2
1
  'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PageWrapper = PageWrapper;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- function PageWrapper({ title, subtitle, tools, children }) {
7
- title = title ?? '';
8
- subtitle = subtitle ?? '';
9
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4 h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: 'grid grid-cols-1 gap-1', children: [title && (0, jsx_runtime_1.jsx)("h1", { className: 'text-2xl font-semibold', children: title }), subtitle && (0, jsx_runtime_1.jsx)("p", { className: 'text-muted-foreground/60', children: subtitle })] }), (0, jsx_runtime_1.jsx)("div", { children: tools })] }), children] }));
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export function PageWrapper({ title, subtitle, tools, children }) {
4
+ title = title !== null && title !== void 0 ? title : '';
5
+ subtitle = subtitle !== null && subtitle !== void 0 ? subtitle : '';
6
+ return (_jsxs("div", { className: "flex flex-col gap-4 h-full", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: 'grid grid-cols-1 gap-1', children: [title && _jsx("h1", { className: 'text-2xl font-semibold', children: title }), subtitle && _jsx("p", { className: 'text-muted-foreground/60', children: subtitle })] }), _jsx("div", { children: tools })] }), children] }));
10
7
  }
@@ -1,14 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PasswordStrengthMeter = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const progress_1 = require("../../shadcn/progress");
9
- const zxcvbn_1 = __importDefault(require("zxcvbn"));
10
- const PasswordStrengthMeter = ({ value }) => {
11
- const testResult = (0, zxcvbn_1.default)(value);
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Progress } from "../../shadcn/progress";
3
+ import zxcvbn from "zxcvbn";
4
+ export const PasswordStrengthMeter = ({ value }) => {
5
+ const testResult = zxcvbn(value);
12
6
  const num = (testResult.score * 100) / 4;
13
7
  const createPassLabel = () => {
14
8
  switch (testResult.score) {
@@ -42,6 +36,5 @@ const PasswordStrengthMeter = ({ value }) => {
42
36
  return "";
43
37
  }
44
38
  };
45
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(progress_1.Progress, { value: num, indicatorColor: funcProgressColor() }) }));
39
+ return (_jsx(_Fragment, { children: _jsx(Progress, { value: num, indicatorColor: funcProgressColor() }) }));
46
40
  };
47
- exports.PasswordStrengthMeter = PasswordStrengthMeter;
@@ -1,65 +1,41 @@
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.PhoneInput = PhoneInput;
37
- const jsx_runtime_1 = require("react/jsx-runtime");
38
- const button_1 = require("../../shadcn/button");
39
- const command_1 = require("../../shadcn/command");
40
- const popover_1 = require("../../shadcn/popover");
41
- const lucide_react_1 = require("lucide-react");
42
- const react_1 = require("react");
43
- const countries_list_1 = require("countries-list");
44
- const Flags = __importStar(require("country-flag-icons/react/3x2"));
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Button } from '../../shadcn/button';
14
+ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../shadcn/command';
15
+ import { Popover, PopoverContent, PopoverTrigger } from '../../shadcn/popover';
16
+ import { ChevronsUpDown } from 'lucide-react';
17
+ import { useState } from 'react';
18
+ import { countries } from 'countries-list';
19
+ import * as Flags from "country-flag-icons/react/3x2";
45
20
  const Flag = ({ code }) => {
46
21
  const FlagComponent = Flags[code];
47
- return (0, jsx_runtime_1.jsx)(FlagComponent, {});
22
+ return _jsx(FlagComponent, {});
48
23
  };
49
- function PhoneInput({ className, ...props }) {
50
- const [open, setOpen] = (0, react_1.useState)(false);
51
- const [value, setValue] = (0, react_1.useState)("");
52
- const [countryCode, setCountryCode] = (0, react_1.useState)("");
53
- return ((0, jsx_runtime_1.jsxs)(popover_1.Popover, { open: open, onOpenChange: setOpen, children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: "justify-between bg-secondary", children: [countryCode
54
- ? (0, jsx_runtime_1.jsx)(Flag, { code: countryCode })
55
- : "...", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "opacity-50" })] }) }), (0, jsx_runtime_1.jsx)(popover_1.PopoverContent, { className: "p-0", align: 'start', children: (0, jsx_runtime_1.jsxs)(command_1.Command, { filter: (value, search, keywords = []) => {
24
+ export function PhoneInput(_a) {
25
+ var { className } = _a, props = __rest(_a, ["className"]);
26
+ const [open, setOpen] = useState(false);
27
+ const [value, setValue] = useState("");
28
+ const [countryCode, setCountryCode] = useState("");
29
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: "justify-between bg-secondary", children: [countryCode
30
+ ? _jsx(Flag, { code: countryCode })
31
+ : "...", _jsx(ChevronsUpDown, { className: "opacity-50" })] }) }), _jsx(PopoverContent, { className: "p-0", align: 'start', children: _jsxs(Command, { filter: (value, search, keywords = []) => {
56
32
  const extendValue = value.toLowerCase() + ' ' + keywords.join(' ').toLowerCase();
57
33
  if (extendValue.includes(search.toLowerCase()))
58
34
  return 1;
59
35
  return 0;
60
- }, children: [(0, jsx_runtime_1.jsx)(command_1.CommandInput, { placeholder: "Search ...", className: "h-9" }), (0, jsx_runtime_1.jsxs)(command_1.CommandList, { children: [(0, jsx_runtime_1.jsx)(command_1.CommandEmpty, { children: "No country found." }), (0, jsx_runtime_1.jsx)(command_1.CommandGroup, { children: Object.entries(countries_list_1.countries).map(([code, country]) => (country.phone.map((phone) => (0, jsx_runtime_1.jsxs)(command_1.CommandItem, { value: `${phone}`, keywords: [country.name, "+" + phone.toString(), code], onSelect: (currentValue) => {
36
+ }, children: [_jsx(CommandInput, { placeholder: "Search ...", className: "h-9" }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { children: "No country found." }), _jsx(CommandGroup, { children: Object.entries(countries).map(([code, country]) => (country.phone.map((phone) => _jsxs(CommandItem, { value: `${phone}`, keywords: [country.name, "+" + phone.toString(), code], onSelect: (currentValue) => {
61
37
  setValue(currentValue === value ? "" : currentValue);
62
38
  setCountryCode(code);
63
39
  setOpen(false);
64
- }, children: [(0, jsx_runtime_1.jsx)(Flag, { code: code }), " ", country.name, " +", phone] }, phone)))) })] })] }) })] }));
40
+ }, children: [_jsx(Flag, { code: code }), " ", country.name, " +", phone] }, phone)))) })] })] }) })] }));
65
41
  }
@@ -1,47 +1,11 @@
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.ResourceTable = void 0;
37
- const jsx_runtime_1 = require("react/jsx-runtime");
38
- const card_1 = require("../../shadcn/card");
39
- const input_1 = require("../../shadcn/input");
40
- const select_1 = require("../../shadcn/select");
41
- const table_1 = require("../../shadcn/table");
42
- const lucide_react_1 = require("lucide-react");
43
- const React = __importStar(require("react"));
44
- const react_hook_form_1 = require("react-hook-form");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardContent } from "../../shadcn/card";
3
+ import { Input } from "../../shadcn/input";
4
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../shadcn/select";
5
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../shadcn/table";
6
+ import { ChevronDown, ChevronRight } from "lucide-react";
7
+ import * as React from "react";
8
+ import { useFormContext } from "react-hook-form";
45
9
  const groupResourcesByTask = (resources) => {
46
10
  const groupedMap = resources.reduce((acc, resource) => {
47
11
  const taskId = resource.taskId;
@@ -57,8 +21,8 @@ const groupResourcesByTask = (resources) => {
57
21
  }, new Map());
58
22
  return Array.from(groupedMap.values());
59
23
  };
60
- const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) => {
61
- const { setValue } = (0, react_hook_form_1.useFormContext)();
24
+ export const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) => {
25
+ const { setValue } = useFormContext();
62
26
  const [expandedTasks, setExpandedTasks] = React.useState(new Set());
63
27
  const groupedResources = groupResourcesByTask(resourceDataWithAllocation);
64
28
  const toggleTask = (taskId) => {
@@ -68,6 +32,5 @@ const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange }) =>
68
32
  return newSet;
69
33
  });
70
34
  };
71
- return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "p-0 bg-background", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-0", children: (0, jsx_runtime_1.jsxs)(table_1.Table, { children: [(0, jsx_runtime_1.jsx)(table_1.TableHeader, { children: (0, jsx_runtime_1.jsxs)(table_1.TableRow, { children: [(0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "w-[300px] py-5", children: "Task Name" }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "w-[200px] py-5", children: "Employee Name" }), (0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "w-[200px] py-5", children: "Role" }), monthsRange.map((month) => ((0, jsx_runtime_1.jsx)(table_1.TableHead, { className: "w-[100px] py-5", children: month.replace("_", " ") }, month)))] }) }), (0, jsx_runtime_1.jsx)(table_1.TableBody, { children: groupedResources.map((group) => ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [(0, jsx_runtime_1.jsx)(table_1.TableRow, { className: "cursor-pointer hover:bg-accent", onClick: () => toggleTask(group.taskId), children: (0, jsx_runtime_1.jsx)(table_1.TableCell, { colSpan: 3 + monthsRange.length, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [expandedTasks.has(group.taskId) ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "h-4 w-4 text-primary" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4 text-primary" }), (0, jsx_runtime_1.jsx)("span", { className: "font-medium", children: group.taskName })] }) }) }), expandedTasks.has(group.taskId) && group.resources.map((resource) => ((0, jsx_runtime_1.jsxs)(table_1.TableRow, { className: "hover:bg-muted/30", children: [(0, jsx_runtime_1.jsx)(table_1.TableCell, { className: "pl-8", children: (0, jsx_runtime_1.jsx)(input_1.Input, { value: resource.taskName, disabled: true, className: "w-full bg-transparent border-0 px-0 disabled:opacity-100" }) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { children: (0, jsx_runtime_1.jsxs)(select_1.Select, { defaultValue: resource.resourceId, children: [(0, jsx_runtime_1.jsx)(select_1.SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: (0, jsx_runtime_1.jsx)(select_1.SelectValue, { placeholder: "Select employee" }) }), (0, jsx_runtime_1.jsx)(select_1.SelectContent, { children: Object.entries(userMaps.userDetailsMap).map(([id, user]) => ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: id, children: user.name }, id))) })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableCell, { children: (0, jsx_runtime_1.jsxs)(select_1.Select, { defaultValue: resource.gradeId.toString(), children: [(0, jsx_runtime_1.jsx)(select_1.SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: (0, jsx_runtime_1.jsx)(select_1.SelectValue, { placeholder: "Select role" }) }), (0, jsx_runtime_1.jsx)(select_1.SelectContent, { children: Object.entries(userMaps.rolesMap).map(([id, role]) => ((0, jsx_runtime_1.jsx)(select_1.SelectItem, { value: id, children: role.roleName }, id))) })] }) }), monthsRange.map((month) => ((0, jsx_runtime_1.jsx)(table_1.TableCell, { children: (0, jsx_runtime_1.jsx)(input_1.Input, { type: "number", min: "0", max: "1", step: "0.01", defaultValue: resource.allocation[month] || 0, className: "w-20" }) }, month)))] }, `${resource.taskId}-${resource.resourceId}`)))] }, group.taskId))) })] }) }) }));
35
+ return (_jsx(Card, { className: "p-0 bg-background", children: _jsx(CardContent, { className: "p-0", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[300px] py-5", children: "Task Name" }), _jsx(TableHead, { className: "w-[200px] py-5", children: "Employee Name" }), _jsx(TableHead, { className: "w-[200px] py-5", children: "Role" }), monthsRange.map((month) => (_jsx(TableHead, { className: "w-[100px] py-5", children: month.replace("_", " ") }, month)))] }) }), _jsx(TableBody, { children: groupedResources.map((group) => (_jsxs(React.Fragment, { children: [_jsx(TableRow, { className: "cursor-pointer hover:bg-accent", onClick: () => toggleTask(group.taskId), children: _jsx(TableCell, { colSpan: 3 + monthsRange.length, children: _jsxs("div", { className: "flex items-center gap-2", children: [expandedTasks.has(group.taskId) ? _jsx(ChevronDown, { className: "h-4 w-4 text-primary" }) : _jsx(ChevronRight, { className: "h-4 w-4 text-primary" }), _jsx("span", { className: "font-medium", children: group.taskName })] }) }) }), expandedTasks.has(group.taskId) && group.resources.map((resource) => (_jsxs(TableRow, { className: "hover:bg-muted/30", children: [_jsx(TableCell, { className: "pl-8", children: _jsx(Input, { value: resource.taskName, disabled: true, className: "w-full bg-transparent border-0 px-0 disabled:opacity-100" }) }), _jsx(TableCell, { children: _jsxs(Select, { defaultValue: resource.resourceId, children: [_jsx(SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: _jsx(SelectValue, { placeholder: "Select employee" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.userDetailsMap).map(([id, user]) => (_jsx(SelectItem, { value: id, children: user.name }, id))) })] }) }), _jsx(TableCell, { children: _jsxs(Select, { defaultValue: resource.gradeId.toString(), children: [_jsx(SelectTrigger, { className: "w-full bg-secondary dark:bg-secondary", children: _jsx(SelectValue, { placeholder: "Select role" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.rolesMap).map(([id, role]) => (_jsx(SelectItem, { value: id, children: role.roleName }, id))) })] }) }), monthsRange.map((month) => (_jsx(TableCell, { children: _jsx(Input, { type: "number", min: "0", max: "1", step: "0.01", defaultValue: resource.allocation[month] || 0, className: "w-20" }) }, month)))] }, `${resource.taskId}-${resource.resourceId}`)))] }, group.taskId))) })] }) }) }));
72
36
  };
73
- exports.ResourceTable = ResourceTable;
@@ -1,10 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchInput = SearchInput;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const input_1 = require("../../shadcn/input");
6
- const class_variance_authority_1 = require("class-variance-authority");
7
- const lucide_react_1 = require("lucide-react");
8
- function SearchInput({ className, ...props }) {
9
- return ((0, jsx_runtime_1.jsxs)("div", { className: "relative w-auto flex items-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Search, { className: "absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50" }), (0, jsx_runtime_1.jsx)(input_1.Input, { className: (0, class_variance_authority_1.cx)('pl-8 h-8', className), ...props })] }));
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Input } from '../../shadcn/input';
14
+ import { cx } from 'class-variance-authority';
15
+ import { Search } from 'lucide-react';
16
+ export function SearchInput(_a) {
17
+ var { className } = _a, props = __rest(_a, ["className"]);
18
+ return (_jsxs("div", { className: "relative w-auto flex items-center", children: [_jsx(Search, { className: "absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(Input, Object.assign({ className: cx('pl-8 h-8', className) }, props))] }));
10
19
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SheetComponent = SheetComponent;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const button_1 = require("../../shadcn/button");
6
- const sheet_1 = require("../../shadcn/sheet");
7
- function SheetComponent({ buttonText, buttonIcon, buttonStyle, sheetContent, sheetDescription, sheetTitle, closeButton }) {
8
- return ((0, jsx_runtime_1.jsxs)(sheet_1.Sheet, { children: [(0, jsx_runtime_1.jsx)(sheet_1.SheetTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: 'outline', className: buttonStyle, size: "smIcon", children: [buttonText, buttonIcon] }) }), (0, jsx_runtime_1.jsxs)(sheet_1.SheetContent, { className: "p-4", children: [(0, jsx_runtime_1.jsx)(sheet_1.SheetTitle, { children: sheetTitle }), sheetContent] })] }));
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from "../../shadcn/button";
3
+ import { Sheet, SheetContent, SheetTitle, SheetTrigger } from "../../shadcn/sheet";
4
+ export function SheetComponent({ buttonText, buttonIcon, buttonStyle, sheetContent, sheetDescription, sheetTitle, closeButton }) {
5
+ return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsxs(Button, { variant: 'outline', className: buttonStyle, size: "smIcon", children: [buttonText, buttonIcon] }) }), _jsxs(SheetContent, { className: "p-4", children: [_jsx(SheetTitle, { children: sheetTitle }), sheetContent] })] }));
9
6
  }
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleWidget = SimpleWidget;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const card_1 = require("../../shadcn/card");
6
- const lucide_react_1 = require("lucide-react");
7
- const LUCID_ICONS = lucide_react_1.icons;
8
- function SimpleWidget({ title, iconName, iconSize, iconClass, primaryText, secondaryText, mainClassName = '', loading, loadingMessage }) {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardContent } from "../../shadcn/card";
3
+ import { icons, LoaderCircle } from "lucide-react";
4
+ const LUCID_ICONS = icons;
5
+ export function SimpleWidget({ title, iconName, iconSize, iconClass, primaryText, secondaryText, mainClassName = '', loading, loadingMessage }) {
9
6
  let IconComponent = null;
10
7
  if (iconName) {
11
8
  IconComponent = LUCID_ICONS[iconName];
12
9
  }
13
10
  iconSize = iconSize === undefined ? 20 : iconSize;
14
- iconClass = iconClass ?? '';
15
- loadingMessage = loadingMessage ?? 'Loading...';
16
- return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: mainClassName, children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: 'p-5', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex items-center justify-between gap-4', children: [(0, jsx_runtime_1.jsx)("span", { children: title }), loading ? ((0, jsx_runtime_1.jsx)(lucide_react_1.LoaderCircle, { size: iconSize, className: 'animate-spin ' + iconClass })) : (IconComponent && (0, jsx_runtime_1.jsx)(IconComponent, { size: iconSize, className: iconClass }))] }), (0, jsx_runtime_1.jsx)("div", { className: 'mt-6 text-2xl font-semibold', children: loading ? '...' : primaryText }), secondaryText && ((0, jsx_runtime_1.jsx)("small", { className: 'mt-2 text-gray-400', children: loading ? loadingMessage : secondaryText }))] }) }));
11
+ iconClass = iconClass !== null && iconClass !== void 0 ? iconClass : '';
12
+ loadingMessage = loadingMessage !== null && loadingMessage !== void 0 ? loadingMessage : 'Loading...';
13
+ return (_jsx(Card, { className: mainClassName, children: _jsxs(CardContent, { className: 'p-5', children: [_jsxs("div", { className: 'flex items-center justify-between gap-4', children: [_jsx("span", { children: title }), loading ? (_jsx(LoaderCircle, { size: iconSize, className: 'animate-spin ' + iconClass })) : (IconComponent && _jsx(IconComponent, { size: iconSize, className: iconClass }))] }), _jsx("div", { className: 'mt-6 text-2xl font-semibold', children: loading ? '...' : primaryText }), secondaryText && (_jsx("small", { className: 'mt-2 text-gray-400', children: loading ? loadingMessage : secondaryText }))] }) }));
17
14
  }