@classytic/fluid 0.1.1 → 0.1.2

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/index.js CHANGED
@@ -11,7 +11,7 @@ import { Pagination, PaginationContent, PaginationItem, PaginationPrevious, Pagi
11
11
  import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/card';
12
12
  import { Skeleton } from '@/components/ui/skeleton';
13
13
  import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '@/components/ui/table';
14
- import { ChevronDown, Minus, Plus, X, Check, LoaderIcon, Wand2, ChevronUp, AlertTriangle, Loader2, AlertCircle, RefreshCw, Copy, Search, ArrowUp, ArrowDown, ArrowUpDown, MoreHorizontal, Sun, Moon, MinusIcon, ChevronUpIcon, ChevronDownIcon, ArrowLeft, ArrowRight, CalendarIcon, Filter, RotateCcw, ChevronLeft, ChevronRight, ChevronsUpDown, Tag } from 'lucide-react';
14
+ import { ChevronDown, Minus, Plus, X, Check, LoaderIcon, Wand2, ChevronUp, AlertTriangle, Loader2, AlertCircle, RefreshCw, Copy, Search, ArrowUp, ArrowDown, ArrowUpDown, MoreHorizontal, Sun, Moon, MinusIcon, ChevronUpIcon, ChevronDownIcon, ArrowLeft, ArrowRight, CalendarIcon, Filter, RotateCcw, ChevronLeft, ChevronRight, Tag } from 'lucide-react';
15
15
  import { Button } from '@/components/ui/button';
16
16
  import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@/components/ui/collapsible';
17
17
  import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from '@/components/ui/alert-dialog';
@@ -41,6 +41,7 @@ import { Checkbox } from '@/components/ui/checkbox';
41
41
  import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
42
42
  import { Switch } from '@/components/ui/switch';
43
43
  import { Calendar } from '@/components/ui/calendar';
44
+ import { Combobox, ComboboxInput as ComboboxInput$1, ComboboxContent, ComboboxEmpty, ComboboxList, ComboboxItem } from '@/components/ui/combobox';
44
45
  import { startOfMonth, endOfMonth, eachDayOfInterval, getDay, isSameDay, subMonths, addMonths, format, isSameMonth, isValid } from 'date-fns';
45
46
 
46
47
  var __defProp = Object.defineProperty;
@@ -2319,23 +2320,23 @@ var PhoneInput = React5.forwardRef(
2319
2320
  if (open) setSearchValue("");
2320
2321
  },
2321
2322
  children: [
2322
- /* @__PURE__ */ jsxs(
2323
+ /* @__PURE__ */ jsx(
2323
2324
  PopoverTrigger,
2324
2325
  {
2325
- render: /* @__PURE__ */ jsx(
2326
+ render: /* @__PURE__ */ jsxs(
2326
2327
  Button,
2327
2328
  {
2328
2329
  type: "button",
2329
2330
  variant: "ghost",
2330
2331
  className: "gap-1.5 rounded-none border-r px-3 focus:z-10 min-w-[90px] h-full",
2331
- disabled
2332
+ disabled,
2333
+ children: [
2334
+ /* @__PURE__ */ jsx("span", { className: "text-base leading-none", children: selectedCountry.flag }),
2335
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: selectedCountry.dialCode }),
2336
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 opacity-50" })
2337
+ ]
2332
2338
  }
2333
- ),
2334
- children: [
2335
- /* @__PURE__ */ jsx("span", { className: "text-base leading-none", children: selectedCountry.flag }),
2336
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: selectedCountry.dialCode }),
2337
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 opacity-50" })
2338
- ]
2339
+ )
2339
2340
  }
2340
2341
  ),
2341
2342
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-[280px] p-0", align: "start", children: /* @__PURE__ */ jsxs(Command, { children: [
@@ -3648,7 +3649,7 @@ function SelectInput({
3648
3649
  "aria-invalid": fieldState?.invalid || void 0,
3649
3650
  children: [
3650
3651
  Icon2 && /* @__PURE__ */ jsx(Icon2, { className: "mr-2 h-4 w-4 text-primary" }),
3651
- /* @__PURE__ */ jsx(SelectValue, { placeholder, children: selectedLabel })
3652
+ /* @__PURE__ */ jsx(SelectValue, { placeholder, children: selectedLabel || null })
3652
3653
  ]
3653
3654
  }
3654
3655
  ),
@@ -4105,10 +4106,10 @@ function DateInput({
4105
4106
  year: "numeric"
4106
4107
  }) : placeholder;
4107
4108
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4108
- /* @__PURE__ */ jsxs(
4109
+ /* @__PURE__ */ jsx(
4109
4110
  PopoverTrigger,
4110
4111
  {
4111
- render: /* @__PURE__ */ jsx(
4112
+ render: /* @__PURE__ */ jsxs(
4112
4113
  Button,
4113
4114
  {
4114
4115
  type: "button",
@@ -4118,20 +4119,20 @@ function DateInput({
4118
4119
  !selected && "text-muted-foreground",
4119
4120
  inputClassName
4120
4121
  ),
4121
- disabled: isDisabled
4122
+ disabled: isDisabled,
4123
+ children: [
4124
+ /* @__PURE__ */ jsx(Icon2, { className: "mr-2 h-4 w-4" }),
4125
+ displayText,
4126
+ allowClear && selected && !isDisabled && /* @__PURE__ */ jsx(
4127
+ X,
4128
+ {
4129
+ className: "ml-auto h-4 w-4 opacity-50 hover:opacity-100",
4130
+ onClick: handleClear
4131
+ }
4132
+ )
4133
+ ]
4122
4134
  }
4123
- ),
4124
- children: [
4125
- /* @__PURE__ */ jsx(Icon2, { className: "mr-2 h-4 w-4" }),
4126
- displayText,
4127
- allowClear && selected && !isDisabled && /* @__PURE__ */ jsx(
4128
- X,
4129
- {
4130
- className: "ml-auto h-4 w-4 opacity-50 hover:opacity-100",
4131
- onClick: handleClear
4132
- }
4133
- )
4134
- ]
4135
+ )
4135
4136
  }
4136
4137
  ),
4137
4138
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsx(
@@ -4609,10 +4610,10 @@ function TagChoiceInputInternal({
4609
4610
  }
4610
4611
  ),
4611
4612
  /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, modal: true, children: [
4612
- /* @__PURE__ */ jsxs(
4613
+ /* @__PURE__ */ jsx(
4613
4614
  PopoverTrigger,
4614
4615
  {
4615
- render: /* @__PURE__ */ jsx(
4616
+ render: /* @__PURE__ */ jsxs(
4616
4617
  Button,
4617
4618
  {
4618
4619
  type: "button",
@@ -4625,33 +4626,33 @@ function TagChoiceInputInternal({
4625
4626
  "hover:bg-accent/50 transition-colors",
4626
4627
  error && "border-destructive",
4627
4628
  disabled && "opacity-50 cursor-not-allowed"
4628
- )
4629
- }
4630
- ),
4631
- children: [
4632
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4633
- /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4 text-muted-foreground" }),
4634
- /* @__PURE__ */ jsx(
4635
- "span",
4636
- {
4637
- className: cn(
4638
- "text-sm",
4639
- selectedValues.length === 0 && "text-muted-foreground"
4640
- ),
4641
- children: selectedValues.length > 0 ? `${selectedValues.length} selected` : placeholder
4642
- }
4643
- )
4644
- ] }),
4645
- /* @__PURE__ */ jsx(
4646
- ChevronDown,
4647
- {
4648
- className: cn(
4649
- "h-4 w-4 text-muted-foreground transition-transform duration-200",
4650
- open && "rotate-180"
4629
+ ),
4630
+ children: [
4631
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
4632
+ /* @__PURE__ */ jsx(Tag, { className: "h-4 w-4 text-muted-foreground" }),
4633
+ /* @__PURE__ */ jsx(
4634
+ "span",
4635
+ {
4636
+ className: cn(
4637
+ "text-sm",
4638
+ selectedValues.length === 0 && "text-muted-foreground"
4639
+ ),
4640
+ children: selectedValues.length > 0 ? `${selectedValues.length} selected` : placeholder
4641
+ }
4642
+ )
4643
+ ] }),
4644
+ /* @__PURE__ */ jsx(
4645
+ ChevronDown,
4646
+ {
4647
+ className: cn(
4648
+ "h-4 w-4 text-muted-foreground transition-transform duration-200",
4649
+ open && "rotate-180"
4650
+ )
4651
+ }
4651
4652
  )
4652
- }
4653
- )
4654
- ]
4653
+ ]
4654
+ }
4655
+ )
4655
4656
  }
4656
4657
  ),
4657
4658
  /* @__PURE__ */ jsxs(
@@ -4719,7 +4720,7 @@ function TagChoiceInput({
4719
4720
  onValueChange
4720
4721
  }) {
4721
4722
  const descriptionText = description || helperText;
4722
- if (control && name) {
4723
+ if (control) {
4723
4724
  return /* @__PURE__ */ jsx(
4724
4725
  Controller,
4725
4726
  {
@@ -4762,15 +4763,11 @@ function TagChoiceInput({
4762
4763
  );
4763
4764
  }
4764
4765
  TagChoiceInput.displayName = "TagChoiceInput";
4765
- function generateStableKey(item, index, prefix) {
4766
- return `${prefix}-${item.value}-${index}`;
4767
- }
4768
4766
  function ComboboxInput({
4769
4767
  control,
4770
4768
  name,
4771
4769
  label,
4772
4770
  placeholder = "Select...",
4773
- searchPlaceholder = "Search...",
4774
4771
  emptyText = "No items found.",
4775
4772
  description,
4776
4773
  helperText,
@@ -4779,86 +4776,67 @@ function ComboboxInput({
4779
4776
  items = [],
4780
4777
  className,
4781
4778
  labelClassName,
4782
- triggerClassName,
4779
+ inputClassName,
4783
4780
  onValueChange,
4784
4781
  renderOption,
4785
4782
  value: propValue,
4786
4783
  onChange: propOnChange
4787
4784
  }) {
4788
4785
  const descriptionText = description || helperText;
4789
- const [open, setOpen] = useState(false);
4790
- const handleSelect = (selectedValue, field) => {
4791
- if (field) {
4792
- field.onChange(selectedValue);
4793
- } else if (propOnChange) {
4794
- propOnChange(selectedValue);
4795
- }
4796
- onValueChange?.(selectedValue);
4797
- setOpen(false);
4798
- };
4786
+ const itemValues = useMemo(() => items.map((item) => item.value), [items]);
4787
+ const handleValueChange = useCallback(
4788
+ (newValue, field) => {
4789
+ const safeValue = newValue || "";
4790
+ if (field) {
4791
+ field.onChange(safeValue);
4792
+ } else if (propOnChange) {
4793
+ propOnChange(safeValue);
4794
+ }
4795
+ onValueChange?.(safeValue);
4796
+ },
4797
+ [propOnChange, onValueChange]
4798
+ );
4799
4799
  const renderCombobox = (currentValue, field, isDisabled) => {
4800
- const selectedItem = items.find((item) => item.value === currentValue);
4801
- return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
4802
- /* @__PURE__ */ jsxs(
4803
- PopoverTrigger,
4804
- {
4805
- render: /* @__PURE__ */ jsx(
4806
- Button,
4800
+ return /* @__PURE__ */ jsxs(
4801
+ Combobox,
4802
+ {
4803
+ items: itemValues,
4804
+ value: currentValue,
4805
+ onValueChange: (value) => handleValueChange(value, field),
4806
+ disabled: isDisabled,
4807
+ children: [
4808
+ /* @__PURE__ */ jsx(
4809
+ ComboboxInput$1,
4807
4810
  {
4808
- variant: "outline",
4809
- role: "combobox",
4810
- "aria-expanded": open,
4811
- disabled: isDisabled,
4812
- className: cn(
4813
- "w-full justify-between font-normal",
4814
- !currentValue && "text-muted-foreground",
4815
- triggerClassName
4816
- )
4811
+ placeholder,
4812
+ className: cn(inputClassName)
4817
4813
  }
4818
4814
  ),
4819
- children: [
4820
- selectedItem ? selectedItem.label : placeholder,
4821
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4822
- ]
4823
- }
4824
- ),
4825
- /* @__PURE__ */ jsx(PopoverContent, { className: "w-(--anchor-width) p-0", align: "start", children: /* @__PURE__ */ jsxs(Command, { children: [
4826
- /* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder }),
4827
- /* @__PURE__ */ jsxs(CommandList, { children: [
4828
- /* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
4829
- /* @__PURE__ */ jsx(CommandGroup, { children: items.map((item, index) => {
4830
- const itemKey = generateStableKey(item, index, name || "combobox");
4831
- return /* @__PURE__ */ jsxs(
4832
- CommandItem,
4833
- {
4834
- value: item.label,
4835
- disabled: item.disabled,
4836
- onSelect: () => handleSelect(item.value, field),
4837
- children: [
4838
- renderOption ? renderOption(item) : item.label,
4839
- /* @__PURE__ */ jsx(
4840
- Check,
4841
- {
4842
- className: cn(
4843
- "ml-auto h-4 w-4",
4844
- currentValue === item.value ? "opacity-100" : "opacity-0"
4845
- )
4846
- }
4847
- )
4848
- ]
4849
- },
4850
- itemKey
4851
- );
4852
- }) })
4853
- ] })
4854
- ] }) })
4855
- ] });
4815
+ /* @__PURE__ */ jsxs(ComboboxContent, { children: [
4816
+ /* @__PURE__ */ jsx(ComboboxEmpty, { children: emptyText }),
4817
+ /* @__PURE__ */ jsx(ComboboxList, { children: (itemValue) => {
4818
+ const option = items.find((item) => item.value === itemValue);
4819
+ if (!option) return null;
4820
+ return /* @__PURE__ */ jsx(
4821
+ ComboboxItem,
4822
+ {
4823
+ value: option.value,
4824
+ disabled: option.disabled,
4825
+ children: renderOption ? renderOption(option) : option.label
4826
+ },
4827
+ option.value
4828
+ );
4829
+ } })
4830
+ ] })
4831
+ ]
4832
+ }
4833
+ );
4856
4834
  };
4857
4835
  if (!control) {
4858
4836
  return /* @__PURE__ */ jsxs(Field, { className, "data-disabled": disabled, children: [
4859
4837
  label && /* @__PURE__ */ jsxs(FieldLabel, { htmlFor: name, className: labelClassName, children: [
4860
4838
  label,
4861
- required && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-1", children: "*" })
4839
+ required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
4862
4840
  ] }),
4863
4841
  renderCombobox(propValue, void 0, disabled),
4864
4842
  descriptionText && /* @__PURE__ */ jsx(FieldDescription, { children: descriptionText })
@@ -4878,7 +4856,7 @@ function ComboboxInput({
4878
4856
  children: [
4879
4857
  label && /* @__PURE__ */ jsxs(FieldLabel, { htmlFor: name, className: labelClassName, children: [
4880
4858
  label,
4881
- required && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-1", children: "*" })
4859
+ required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
4882
4860
  ] }),
4883
4861
  renderCombobox(field.value, field, disabled),
4884
4862
  descriptionText && /* @__PURE__ */ jsx(FieldDescription, { children: descriptionText }),
@@ -5096,32 +5074,32 @@ function DateRangeFilter({
5096
5074
  if (appliedRange.to) return `Until ${formatDate(appliedRange.to)}`;
5097
5075
  };
5098
5076
  return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
5099
- /* @__PURE__ */ jsxs(
5077
+ /* @__PURE__ */ jsx(
5100
5078
  PopoverTrigger,
5101
5079
  {
5102
- render: /* @__PURE__ */ jsx(
5080
+ render: /* @__PURE__ */ jsxs(
5103
5081
  Button,
5104
5082
  {
5105
5083
  type: "button",
5106
5084
  variant: "outline",
5107
5085
  className: cn(
5108
- "w-full justify-start text-left font-normal",
5086
+ "w-full justify-start font-normal",
5109
5087
  !(appliedRange?.from || appliedRange?.to) && "text-muted-foreground",
5110
5088
  buttonClassName
5111
- )
5089
+ ),
5090
+ children: [
5091
+ /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
5092
+ getDisplayText(),
5093
+ (appliedRange?.from || appliedRange?.to) && /* @__PURE__ */ jsx(
5094
+ X,
5095
+ {
5096
+ className: "ml-auto h-4 w-4 opacity-50 hover:opacity-100",
5097
+ onClick: handleClearFilter
5098
+ }
5099
+ )
5100
+ ]
5112
5101
  }
5113
- ),
5114
- children: [
5115
- /* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
5116
- getDisplayText(),
5117
- (appliedRange?.from || appliedRange?.to) && /* @__PURE__ */ jsx(
5118
- X,
5119
- {
5120
- className: "ml-auto h-4 w-4 opacity-50 hover:opacity-100",
5121
- onClick: handleClearFilter
5122
- }
5123
- )
5124
- ]
5102
+ )
5125
5103
  }
5126
5104
  ),
5127
5105
  /* @__PURE__ */ jsx(
@@ -5191,74 +5169,85 @@ function DateRangePopover({
5191
5169
  maxDate
5192
5170
  }) {
5193
5171
  const hasValue = dateRange?.from || dateRange?.to;
5194
- return /* @__PURE__ */ jsxs(Popover, { children: [
5195
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
5196
- /* @__PURE__ */ jsxs(
5197
- Button,
5172
+ return /* @__PURE__ */ jsxs("div", { className: "relative w-full", children: [
5173
+ /* @__PURE__ */ jsxs(Popover, { children: [
5174
+ /* @__PURE__ */ jsx(
5175
+ PopoverTrigger,
5198
5176
  {
5199
- variant: hasValue ? "outline" : "secondary",
5200
- className: cn(
5201
- "w-full justify-start text-left font-normal",
5202
- !hasValue && "text-muted-foreground",
5203
- disabled && "cursor-not-allowed opacity-50",
5204
- hasValue && allowClear && "pr-8",
5205
- buttonClassName
5206
- ),
5207
- disabled,
5208
- type: "button",
5209
- children: [
5210
- /* @__PURE__ */ jsx(Icon2, { className: "mr-2 h-4 w-4" }),
5211
- hasValue ? /* @__PURE__ */ jsxs("span", { children: [
5212
- formatDateRange(dateRange),
5213
- showBadge && dateRange?.from && dateRange?.to && /* @__PURE__ */ jsx("span", { className: "ml-2 text-xs bg-secondary text-secondary-foreground py-0.5 px-2 rounded-full", children: formatDateRange(dateRange) })
5214
- ] }) : /* @__PURE__ */ jsx("span", { children: placeholder })
5215
- ]
5177
+ render: /* @__PURE__ */ jsxs(
5178
+ Button,
5179
+ {
5180
+ type: "button",
5181
+ disabled,
5182
+ variant: "outline",
5183
+ className: cn(
5184
+ "w-full justify-start gap-2 font-normal",
5185
+ !hasValue && "text-muted-foreground",
5186
+ hasValue && allowClear && "pr-10",
5187
+ buttonClassName
5188
+ ),
5189
+ children: [
5190
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }),
5191
+ hasValue ? /* @__PURE__ */ jsxs("span", { className: "flex-1 truncate text-left", children: [
5192
+ formatDateRange(dateRange),
5193
+ showBadge && dateRange?.from && dateRange?.to && (() => {
5194
+ const from = dateRange.from instanceof Date ? dateRange.from : new Date(dateRange.from);
5195
+ const to = dateRange.to instanceof Date ? dateRange.to : new Date(dateRange.to);
5196
+ const days = Math.ceil((to.getTime() - from.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
5197
+ return /* @__PURE__ */ jsxs("span", { className: "ml-2 text-xs bg-secondary text-secondary-foreground py-0.5 px-2 rounded-full", children: [
5198
+ days,
5199
+ " ",
5200
+ days === 1 ? "day" : "days"
5201
+ ] });
5202
+ })()
5203
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-left", children: placeholder })
5204
+ ]
5205
+ }
5206
+ )
5216
5207
  }
5217
5208
  ),
5218
- hasValue && allowClear && !disabled && /* @__PURE__ */ jsxs(
5219
- Button,
5209
+ /* @__PURE__ */ jsxs(
5210
+ PopoverContent,
5220
5211
  {
5221
- type: "button",
5222
- variant: "ghost",
5223
- className: "absolute right-0 top-0 h-full px-2 hover:bg-transparent",
5224
- onClick: handleClear,
5212
+ className: cn("w-auto p-0", calendarClassName),
5213
+ align: "start",
5225
5214
  children: [
5226
- /* @__PURE__ */ jsx(X, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" }),
5227
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Clear date range" })
5215
+ /* @__PURE__ */ jsx(
5216
+ Calendar,
5217
+ {
5218
+ mode: "range",
5219
+ selected: dateRange,
5220
+ onSelect: handleDateRangeSelect,
5221
+ disabled: isDateDisabled,
5222
+ initialFocus: true,
5223
+ ...minDate && { fromDate: minDate },
5224
+ ...maxDate && { toDate: maxDate }
5225
+ }
5226
+ ),
5227
+ /* @__PURE__ */ jsx("div", { className: "p-3 border-t border-border", children: /* @__PURE__ */ jsx(
5228
+ Button,
5229
+ {
5230
+ variant: "ghost",
5231
+ size: "sm",
5232
+ onClick: handleClear,
5233
+ disabled: !hasValue,
5234
+ className: "w-full",
5235
+ type: "button",
5236
+ children: "Clear Date Range"
5237
+ }
5238
+ ) })
5228
5239
  ]
5229
5240
  }
5230
5241
  )
5231
- ] }) }),
5232
- /* @__PURE__ */ jsxs(
5233
- PopoverContent,
5242
+ ] }),
5243
+ hasValue && allowClear && !disabled && /* @__PURE__ */ jsx(
5244
+ "button",
5234
5245
  {
5235
- className: cn("w-auto p-0", calendarClassName),
5236
- align: "start",
5237
- children: [
5238
- /* @__PURE__ */ jsx(
5239
- Calendar,
5240
- {
5241
- mode: "range",
5242
- selected: dateRange,
5243
- onSelect: handleDateRangeSelect,
5244
- disabled: isDateDisabled,
5245
- initialFocus: true,
5246
- ...minDate && { fromDate: minDate },
5247
- ...maxDate && { toDate: maxDate }
5248
- }
5249
- ),
5250
- /* @__PURE__ */ jsx("div", { className: "p-3 border-t border-border", children: /* @__PURE__ */ jsx(
5251
- Button,
5252
- {
5253
- variant: "ghost",
5254
- size: "sm",
5255
- onClick: handleClear,
5256
- disabled: !hasValue,
5257
- className: "w-full",
5258
- children: "Clear Date Range"
5259
- }
5260
- ) })
5261
- ]
5246
+ type: "button",
5247
+ onClick: handleClear,
5248
+ className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-sm hover:bg-muted transition-colors",
5249
+ "aria-label": "Clear date range",
5250
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4 text-muted-foreground hover:text-foreground" })
5262
5251
  }
5263
5252
  )
5264
5253
  ] });
@@ -5294,7 +5283,7 @@ function DateRangeInput({
5294
5283
  clearErrors,
5295
5284
  descriptionComponent,
5296
5285
  allowClear = true,
5297
- showBadge = true,
5286
+ showBadge = false,
5298
5287
  Icon: Icon2 = CalendarIcon,
5299
5288
  transform = defaultTransform
5300
5289
  }) {
@@ -5356,7 +5345,7 @@ function DateRangeInput({
5356
5345
  clearErrors(name);
5357
5346
  }
5358
5347
  };
5359
- if (control && name) {
5348
+ if (control) {
5360
5349
  return /* @__PURE__ */ jsx(
5361
5350
  Controller,
5362
5351
  {
@@ -5413,11 +5402,11 @@ function DateRangeInput({
5413
5402
  }
5414
5403
  return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
5415
5404
  label && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
5416
- /* @__PURE__ */ jsxs("div", { className: cn("text-sm font-medium flex-grow", labelClassName), children: [
5405
+ /* @__PURE__ */ jsxs("div", { className: cn("text-sm font-medium grow", labelClassName), children: [
5417
5406
  label,
5418
5407
  required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
5419
5408
  ] }),
5420
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground flex-shrink-0", children: /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) })
5409
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0", children: /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) })
5421
5410
  ] }),
5422
5411
  /* @__PURE__ */ jsx(
5423
5412
  DateRangePopover,
@@ -6507,7 +6496,7 @@ var CompactTagChoiceInternal = forwardRef(({
6507
6496
  "div",
6508
6497
  {
6509
6498
  className: cn(
6510
- "min-h-[2.5rem] w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
6499
+ "min-h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
6511
6500
  "ring-offset-background focus-within:ring-1 focus-within:ring-primary/20",
6512
6501
  "hover:border-primary/50 transition-all duration-200",
6513
6502
  error && "border-destructive focus-within:ring-destructive/20",
@@ -6538,25 +6527,33 @@ var CompactTagChoiceInternal = forwardRef(({
6538
6527
  ] }, val);
6539
6528
  }) }),
6540
6529
  !disabled && availableChoices.length > 0 && (!maxSelections || value.length < maxSelections) && /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
6541
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
6542
- Button,
6530
+ /* @__PURE__ */ jsx(
6531
+ PopoverTrigger,
6543
6532
  {
6544
- ref: triggerRef,
6545
- type: "button",
6546
- variant: "ghost",
6547
- size: "sm",
6548
- className: "h-auto p-1 text-muted-foreground hover:text-foreground",
6549
- onClick: (e) => {
6550
- e.preventDefault();
6551
- e.stopPropagation();
6552
- setOpen(true);
6553
- },
6554
- children: [
6555
- /* @__PURE__ */ jsx(Plus, { className: "h-3 w-3 mr-1" }),
6556
- value.length === 0 ? placeholder : "Add more..."
6557
- ]
6533
+ render: /* @__PURE__ */ jsxs(
6534
+ Button,
6535
+ {
6536
+ ref: triggerRef,
6537
+ type: "button",
6538
+ variant: "ghost",
6539
+ className: cn(
6540
+ "inline-flex items-center justify-center h-auto p-1 rounded-md text-sm font-medium transition-colors",
6541
+ "text-muted-foreground hover:text-foreground hover:bg-accent",
6542
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
6543
+ ),
6544
+ onClick: (e) => {
6545
+ e.preventDefault();
6546
+ e.stopPropagation();
6547
+ setOpen(true);
6548
+ },
6549
+ children: [
6550
+ /* @__PURE__ */ jsx(Plus, { className: "h-3 w-3 mr-1" }),
6551
+ value.length === 0 ? placeholder : "Add more..."
6552
+ ]
6553
+ }
6554
+ )
6558
6555
  }
6559
- ) }),
6556
+ ),
6560
6557
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-[220px] p-0", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "p-1", children: [
6561
6558
  availableChoices.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-2 py-3 text-sm text-muted-foreground text-center", children: "No options available" }) : /* @__PURE__ */ jsx("div", { className: "space-y-1", children: availableChoices.map((choice) => /* @__PURE__ */ jsxs(
6562
6559
  "div",
@@ -6962,7 +6959,57 @@ function CalendarWithDetail({
6962
6959
  }
6963
6960
  );
6964
6961
  }
6962
+ var backgrounds = {
6963
+ default: "bg-background",
6964
+ muted: "bg-muted",
6965
+ primary: "bg-primary text-primary-foreground",
6966
+ transparent: "bg-transparent"
6967
+ };
6968
+ var paddings = {
6969
+ none: "",
6970
+ sm: "py-8 md:py-12",
6971
+ md: "py-12 md:py-16",
6972
+ lg: "py-16 md:py-24",
6973
+ xl: "py-24 md:py-32"
6974
+ };
6975
+ function Section({
6976
+ id,
6977
+ children,
6978
+ className,
6979
+ background = "default",
6980
+ padding = "sm"
6981
+ }) {
6982
+ return /* @__PURE__ */ jsx(
6983
+ "section",
6984
+ {
6985
+ id,
6986
+ className: cn(backgrounds[background], paddings[padding], className),
6987
+ children
6988
+ }
6989
+ );
6990
+ }
6991
+ var maxWidthClasses = {
6992
+ sm: "max-w-screen-sm",
6993
+ md: "max-w-screen-md",
6994
+ lg: "max-w-screen-lg",
6995
+ xl: "max-w-screen-xl",
6996
+ "2xl": "max-w-screen-2xl",
6997
+ "4xl": "max-w-4xl",
6998
+ "5xl": "max-w-5xl",
6999
+ "6xl": "max-w-6xl",
7000
+ "7xl": "max-w-7xl",
7001
+ full: "max-w-full"
7002
+ };
7003
+ function Container({
7004
+ children,
7005
+ className,
7006
+ maxWidth = "7xl"
7007
+ }) {
7008
+ const isFullWidth = maxWidth === "full";
7009
+ const baseClass = isFullWidth ? "w-full px-4 sm:px-6 lg:px-10" : "mx-auto px-4 sm:px-6 lg:px-8";
7010
+ return /* @__PURE__ */ jsx("div", { className: cn(baseClass, !isFullWidth && maxWidthClasses[maxWidth], className), children });
7011
+ }
6965
7012
 
6966
- export { AccordionSection, ActionDropdown, ActionTooltip, ApiPagination, ButtonTooltip, CalendarDayDetail, CalendarWithDetail, CardWrapper, CheckboxDropdown, CheckboxInput, ClientSubmitButton, CollapsibleCard, CollapsibleSection, CollapsibleWrapper, ComboboxInput, CompactInput, CompactNumberInput, CompactSelect, CompactSlugField, CompactTagChoice, CompactTextarea, ConfirmDialog, ConfirmSheet, CopyButton, CopyCodeBlock, CopyText, CustomPagination, DataCard, DataTable, DateInput, DateRangeFilter, DateRangeInput, DeleteConfirmDialog, DialogWrapper, DisplayHeading, DraggableCard, DropdownWrapper, DynamicTabs, ErrorState, ErrorStateInline, EventCalendar, FacebookIcon, FaqAccordion, FeatureItem, Field13 as Field, FormDialog, FormErrorSummary, FormInput, FormSheet, FormTextarea, GoogleIcon, IconItemMedia, IconTooltip, InfoAlert, InfoRow, InfoTooltip, InstagramIcon, LoadingCard, ModeToggle, PaginationInfo, PhoneInput, Pill, PillAvatar, PillAvatarGroup, PillButton, PillDelta, PillIcon, PillIndicator, PillStatus, RadioDropdown, RadioInput, ResponsiveSplitLayout, search_exports as Search, SearchProvider, SelectDropdown, SelectInput, SheetWrapper, SimpleTable, SkeletonCard, SkeletonGrid, SkeletonList, SkeletonTable, SlugField, StatsCard, SwitchInput, TabContent, TabTrigger, TableWrapper, TabsWrapper, TagChoiceInput, TagInput, Thumbnail, TooltipWrapper, TwitterXIcon, WhatsAppIcon, buildFilterParams, buildListingStatusParams, buildSearchParams, clearSearchAndFilterParams, cn, generateSlug, generateSlug2 as generateSlugCompact, getApiParams, useBaseSearch, useIsMobile, useMediaQuery, useScrollDetection, useSearch };
7013
+ export { AccordionSection, ActionDropdown, ActionTooltip, ApiPagination, ButtonTooltip, CalendarDayDetail, CalendarWithDetail, CardWrapper, CheckboxDropdown, CheckboxInput, ClientSubmitButton, CollapsibleCard, CollapsibleSection, CollapsibleWrapper, ComboboxInput, CompactInput, CompactNumberInput, CompactSelect, CompactSlugField, CompactTagChoice, CompactTextarea, ConfirmDialog, ConfirmSheet, Container, CopyButton, CopyCodeBlock, CopyText, CustomPagination, DataCard, DataTable, DateInput, DateRangeFilter, DateRangeInput, DeleteConfirmDialog, DialogWrapper, DisplayHeading, DraggableCard, DropdownWrapper, DynamicTabs, ErrorState, ErrorStateInline, EventCalendar, FacebookIcon, FaqAccordion, FeatureItem, Field13 as Field, FormDialog, FormErrorSummary, FormInput, FormSheet, FormTextarea, GoogleIcon, IconItemMedia, IconTooltip, InfoAlert, InfoRow, InfoTooltip, InstagramIcon, LoadingCard, ModeToggle, PaginationInfo, PhoneInput, Pill, PillAvatar, PillAvatarGroup, PillButton, PillDelta, PillIcon, PillIndicator, PillStatus, RadioDropdown, RadioInput, ResponsiveSplitLayout, search_exports as Search, SearchProvider, Section, SelectDropdown, SelectInput, SheetWrapper, SimpleTable, SkeletonCard, SkeletonGrid, SkeletonList, SkeletonTable, SlugField, StatsCard, SwitchInput, TabContent, TabTrigger, TableWrapper, TabsWrapper, TagChoiceInput, TagInput, Thumbnail, TooltipWrapper, TwitterXIcon, WhatsAppIcon, buildFilterParams, buildListingStatusParams, buildSearchParams, clearSearchAndFilterParams, cn, generateSlug, generateSlug2 as generateSlugCompact, getApiParams, useBaseSearch, useIsMobile, useMediaQuery, useScrollDetection, useSearch };
6967
7014
  //# sourceMappingURL=index.js.map
6968
7015
  //# sourceMappingURL=index.js.map