@embedreach/components 0.2.48 → 0.2.49

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.
@@ -77646,23 +77646,20 @@ function Calendar({
77646
77646
  nav_button_next: "absolute right-1",
77647
77647
  table: "w-full border-collapse space-y-1",
77648
77648
  head_row: "flex",
77649
- head_cell: "text-muted-foreground! rounded-md w-8 font-normal text-[0.8rem]",
77649
+ head_cell: "text-[#6b7280] rounded-md w-8 font-normal text-[0.8rem]",
77650
77650
  row: "flex w-full mt-2",
77651
- cell: cn$1(
77652
- "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent! [&:has([aria-selected].day-outside)]:bg-accent/50! [&:has([aria-selected].day-range-end)]:rounded-r-md",
77653
- props2.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
77654
- ),
77651
+ cell: "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-[#f1f5f9] [&:has([aria-selected].day-outside)]:bg-[#f1f5f9]/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
77655
77652
  day: cn$1(
77656
77653
  buttonVariants({ variant: "ghost" }),
77657
77654
  "h-8 w-8 p-0 font-normal aria-selected:opacity-100"
77658
77655
  ),
77659
77656
  day_range_start: "day-range-start",
77660
77657
  day_range_end: "day-range-end",
77661
- day_selected: "bg-primary! text-primary-foreground! hover:bg-primary! hover:text-primary-foreground! focus:bg-primary! focus:text-primary-foreground!",
77662
- day_today: "bg-accent! text-accent-foreground!",
77663
- day_outside: "day-outside text-muted-foreground! aria-selected:bg-accent/50! aria-selected:text-muted-foreground!",
77664
- day_disabled: "text-muted-foreground! opacity-50",
77665
- day_range_middle: "aria-selected:bg-accent! aria-selected:text-accent-foreground!",
77658
+ day_selected: "!bg-black !text-gray-200 hover:!bg-black hover:!text-gray-200 focus:!bg-black focus:!text-black",
77659
+ day_today: "bg-gray-200 text-black",
77660
+ day_outside: "day-outside text-[#94a3b8] aria-selected:bg-[#f1f5f9]/50 aria-selected:text-[#94a3b8]",
77661
+ day_disabled: "text-[#94a3b8] opacity-50",
77662
+ day_range_middle: "aria-selected:bg-[#f1f5f9] aria-selected:text-black",
77666
77663
  day_hidden: "invisible",
77667
77664
  ...classNames
77668
77665
  },
@@ -79453,7 +79450,8 @@ function MultiSelectDialog({
79453
79450
  searchPlaceholder = "Search items...",
79454
79451
  emptyMessage = "No items found",
79455
79452
  handleSearchInput,
79456
- extraCommandItems = []
79453
+ extraCommandItems = [],
79454
+ disabled = false
79457
79455
  }) {
79458
79456
  const [open, setOpen] = React.useState(false);
79459
79457
  const [searchQuery, setSearchQuery] = React.useState("");
@@ -79474,6 +79472,7 @@ function MultiSelectDialog({
79474
79472
  });
79475
79473
  }, [selectedValues, options]);
79476
79474
  const handleItemToggle = (optionValue) => {
79475
+ if (disabled) return;
79477
79476
  setTempSelected((prev) => {
79478
79477
  const isSelected = prev.includes(optionValue);
79479
79478
  if (isSelected) {
@@ -79487,6 +79486,7 @@ function MultiSelectDialog({
79487
79486
  });
79488
79487
  };
79489
79488
  const handleSelectAll = () => {
79489
+ if (disabled) return;
79490
79490
  const availableOptions = filteredOptions.filter(
79491
79491
  (option) => !tempSelected.includes(option.value)
79492
79492
  );
@@ -79494,20 +79494,24 @@ function MultiSelectDialog({
79494
79494
  setTempSelected((prev) => [...prev, ...toAdd.map((opt) => opt.value)]);
79495
79495
  };
79496
79496
  const handleDeselectAll = () => {
79497
+ if (disabled) return;
79497
79498
  const filteredValues = new Set(filteredOptions.map((option) => option.value));
79498
79499
  setTempSelected((prev) => prev.filter((item) => !filteredValues.has(item)));
79499
79500
  };
79500
79501
  const handleApply = () => {
79502
+ if (disabled) return;
79501
79503
  onValueChange(tempSelected);
79502
79504
  setSelectedValues(tempSelected);
79503
79505
  setOpen(false);
79504
79506
  };
79505
79507
  const handleCancel = () => {
79508
+ if (disabled) return;
79506
79509
  setTempSelected(selectedValues);
79507
79510
  setSearchQuery("");
79508
79511
  setOpen(false);
79509
79512
  };
79510
79513
  const handleSearchKeyDown = (e4) => {
79514
+ if (disabled) return;
79511
79515
  if (e4.key === "Enter" && searchQuery.trim() && handleSearchInput) {
79512
79516
  e4.preventDefault();
79513
79517
  handleSearchInput(searchQuery.trim());
@@ -79532,6 +79536,7 @@ function MultiSelectDialog({
79532
79536
  {
79533
79537
  variant: "outline",
79534
79538
  className: "w-full justify-between text-left font-normal h-9 p-3",
79539
+ disabled,
79535
79540
  children: [
79536
79541
  /* @__PURE__ */ jsx("div", { className: "flex flex-nowrap items-center gap-1 max-w-[70%]", children: selectedDisplay.length === 0 ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: placeholder }) : selectedDisplay.length <= 2 ? selectedDisplay.map((item) => /* @__PURE__ */ jsx(
79537
79542
  Badge,
@@ -79582,7 +79587,8 @@ function MultiSelectDialog({
79582
79587
  value: searchQuery,
79583
79588
  onChange: (e4) => setSearchQuery(e4.target.value),
79584
79589
  onKeyDown: handleSearchKeyDown,
79585
- className: "pl-10 h-11"
79590
+ className: "pl-10 h-11",
79591
+ disabled
79586
79592
  }
79587
79593
  ),
79588
79594
  handleSearchInput && searchQuery.trim() && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx(
@@ -79592,9 +79598,11 @@ function MultiSelectDialog({
79592
79598
  variant: "ghost",
79593
79599
  className: "h-6 w-6 p-0",
79594
79600
  onClick: () => {
79601
+ if (disabled) return;
79595
79602
  handleSearchInput(searchQuery.trim());
79596
79603
  setSearchQuery("");
79597
79604
  },
79605
+ disabled,
79598
79606
  children: /* @__PURE__ */ jsx(IconDefinitions.PlusIcon, { className: "h-3 w-3" })
79599
79607
  }
79600
79608
  ) })
@@ -79614,7 +79622,7 @@ function MultiSelectDialog({
79614
79622
  variant: "ghost",
79615
79623
  size: "sm",
79616
79624
  onClick: handleSelectAll,
79617
- disabled: !canSelectMore || filteredSelectedCount === filteredOptions.length,
79625
+ disabled: disabled || !canSelectMore || filteredSelectedCount === filteredOptions.length,
79618
79626
  className: "h-8 text-xs",
79619
79627
  children: "Select All"
79620
79628
  }
@@ -79625,7 +79633,7 @@ function MultiSelectDialog({
79625
79633
  variant: "ghost",
79626
79634
  size: "sm",
79627
79635
  onClick: handleDeselectAll,
79628
- disabled: filteredSelectedCount === 0,
79636
+ disabled: disabled || filteredSelectedCount === 0,
79629
79637
  className: "h-8 text-xs",
79630
79638
  children: "Clear All"
79631
79639
  }
@@ -79648,9 +79656,11 @@ function MultiSelectDialog({
79648
79656
  size: "sm",
79649
79657
  className: "mt-3",
79650
79658
  onClick: () => {
79659
+ if (disabled) return;
79651
79660
  handleSearchInput(searchQuery.trim());
79652
79661
  setSearchQuery("");
79653
79662
  },
79663
+ disabled,
79654
79664
  children: [
79655
79665
  /* @__PURE__ */ jsx(IconDefinitions.PlusIcon, { className: "h-3 w-3 mr-1" }),
79656
79666
  'Add "',
@@ -79661,7 +79671,7 @@ function MultiSelectDialog({
79661
79671
  )
79662
79672
  ] }) : filteredOptions.map((option) => {
79663
79673
  const isSelected = tempSelected.includes(option.value);
79664
- const isDisabled = !isSelected && !canSelectMore;
79674
+ const isDisabled = disabled || !isSelected && !canSelectMore;
79665
79675
  return /* @__PURE__ */ jsxs(
79666
79676
  CommandItem,
79667
79677
  {
@@ -79687,12 +79697,22 @@ function MultiSelectDialog({
79687
79697
  ] }) }) }),
79688
79698
  /* @__PURE__ */ jsx(Separator, {}),
79689
79699
  /* @__PURE__ */ jsx("div", { className: "p-6 pt-4", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
79690
- /* @__PURE__ */ jsx(Button$1, { variant: "outline", onClick: handleCancel, className: "flex-1", children: "Cancel" }),
79700
+ /* @__PURE__ */ jsx(
79701
+ Button$1,
79702
+ {
79703
+ variant: "outline",
79704
+ onClick: handleCancel,
79705
+ className: "flex-1",
79706
+ disabled,
79707
+ children: "Cancel"
79708
+ }
79709
+ ),
79691
79710
  /* @__PURE__ */ jsxs(
79692
79711
  Button$1,
79693
79712
  {
79694
79713
  onClick: handleApply,
79695
79714
  className: "flex-1 bg-primary hover:bg-primary/90",
79715
+ disabled,
79696
79716
  children: [
79697
79717
  "Apply (",
79698
79718
  selectedCount,