@embedreach/components 0.2.49 → 0.2.50
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/chunks/index.js +43 -64
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/chunks/index.js
CHANGED
|
@@ -58307,10 +58307,9 @@ var Portal$2 = PopoverPortal;
|
|
|
58307
58307
|
var Content2$1 = PopoverContent$1;
|
|
58308
58308
|
const Popover = Root2$3;
|
|
58309
58309
|
const PopoverTrigger = Trigger$2;
|
|
58310
|
-
const PopoverContent = React__default.forwardRef(({ className: className2, align = "center", sideOffset = 4, ...props2 }, ref) => /* @__PURE__ */ jsx(Portal$2, {
|
|
58310
|
+
const PopoverContent = React__default.forwardRef(({ className: className2, align = "center", sideOffset = 4, ...props2 }, ref) => /* @__PURE__ */ jsx(Portal$2, { children: /* @__PURE__ */ jsx(
|
|
58311
58311
|
Content2$1,
|
|
58312
58312
|
{
|
|
58313
|
-
"data-reach-root": true,
|
|
58314
58313
|
ref,
|
|
58315
58314
|
align,
|
|
58316
58315
|
sideOffset,
|
|
@@ -77627,49 +77626,51 @@ function Calendar({
|
|
|
77627
77626
|
showOutsideDays = true,
|
|
77628
77627
|
...props2
|
|
77629
77628
|
}) {
|
|
77630
|
-
|
|
77629
|
+
const finalClassNames = {
|
|
77630
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
77631
|
+
month: "space-y-4",
|
|
77632
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
77633
|
+
caption_label: "text-sm font-medium",
|
|
77634
|
+
nav: "space-x-1 flex items-center",
|
|
77635
|
+
nav_button: cn$1(
|
|
77636
|
+
buttonVariants({ variant: "outline" }),
|
|
77637
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
77638
|
+
),
|
|
77639
|
+
nav_button_previous: "absolute left-1",
|
|
77640
|
+
nav_button_next: "absolute right-1",
|
|
77641
|
+
table: "w-full border-collapse space-y-1",
|
|
77642
|
+
head_row: "flex",
|
|
77643
|
+
head_cell: "text-[#6b7280] rounded-md w-8 font-normal text-[0.8rem]",
|
|
77644
|
+
row: "flex w-full mt-2",
|
|
77645
|
+
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",
|
|
77646
|
+
day: cn$1(
|
|
77647
|
+
buttonVariants({ variant: "ghost" }),
|
|
77648
|
+
"h-8 w-8 p-0 font-normal aria-selected:opacity-100"
|
|
77649
|
+
),
|
|
77650
|
+
day_range_start: "day-range-start",
|
|
77651
|
+
day_range_end: "day-range-end",
|
|
77652
|
+
day_selected: "!bg-black !text-gray-200 hover:!bg-black hover:!text-gray-200 focus:!bg-black focus:!text-black",
|
|
77653
|
+
day_today: "bg-gray-200 text-black",
|
|
77654
|
+
day_outside: "day-outside text-[#94a3b8] aria-selected:bg-[#f1f5f9]/50 aria-selected:text-[#94a3b8]",
|
|
77655
|
+
day_disabled: "text-[#94a3b8] opacity-50",
|
|
77656
|
+
day_range_middle: "aria-selected:bg-[#f1f5f9] aria-selected:text-black",
|
|
77657
|
+
day_hidden: "invisible",
|
|
77658
|
+
...classNames
|
|
77659
|
+
};
|
|
77660
|
+
console.log(finalClassNames);
|
|
77661
|
+
return /* @__PURE__ */ jsx(
|
|
77631
77662
|
DayPicker,
|
|
77632
77663
|
{
|
|
77633
77664
|
showOutsideDays,
|
|
77634
77665
|
className: cn$1("p-3", className2),
|
|
77635
|
-
classNames:
|
|
77636
|
-
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
77637
|
-
month: "space-y-4",
|
|
77638
|
-
caption: "flex justify-center pt-1 relative items-center",
|
|
77639
|
-
caption_label: "text-sm font-medium",
|
|
77640
|
-
nav: "space-x-1 flex items-center",
|
|
77641
|
-
nav_button: cn$1(
|
|
77642
|
-
buttonVariants({ variant: "outline" }),
|
|
77643
|
-
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
77644
|
-
),
|
|
77645
|
-
nav_button_previous: "absolute left-1",
|
|
77646
|
-
nav_button_next: "absolute right-1",
|
|
77647
|
-
table: "w-full border-collapse space-y-1",
|
|
77648
|
-
head_row: "flex",
|
|
77649
|
-
head_cell: "text-[#6b7280] rounded-md w-8 font-normal text-[0.8rem]",
|
|
77650
|
-
row: "flex w-full mt-2",
|
|
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",
|
|
77652
|
-
day: cn$1(
|
|
77653
|
-
buttonVariants({ variant: "ghost" }),
|
|
77654
|
-
"h-8 w-8 p-0 font-normal aria-selected:opacity-100"
|
|
77655
|
-
),
|
|
77656
|
-
day_range_start: "day-range-start",
|
|
77657
|
-
day_range_end: "day-range-end",
|
|
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",
|
|
77663
|
-
day_hidden: "invisible",
|
|
77664
|
-
...classNames
|
|
77665
|
-
},
|
|
77666
|
+
classNames: finalClassNames,
|
|
77666
77667
|
components: {
|
|
77667
77668
|
IconLeft: () => /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
77668
77669
|
IconRight: () => /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
77669
77670
|
},
|
|
77670
77671
|
...props2
|
|
77671
77672
|
}
|
|
77672
|
-
)
|
|
77673
|
+
);
|
|
77673
77674
|
}
|
|
77674
77675
|
Calendar.displayName = "Calendar";
|
|
77675
77676
|
const ComboboxDemo = ({
|
|
@@ -77815,6 +77816,7 @@ const SetScheduleTime = ({ setScheduleTime, setTimezone, timezone, scheduleTime,
|
|
|
77815
77816
|
},
|
|
77816
77817
|
initialFocus: true,
|
|
77817
77818
|
classNames: {
|
|
77819
|
+
head_cell: "text-[#6b7280] rounded-md w-8 font-normal text-[0.8rem]",
|
|
77818
77820
|
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",
|
|
77819
77821
|
day_range_start: "day-range-start",
|
|
77820
77822
|
day_range_end: "day-range-end",
|
|
@@ -79450,8 +79452,7 @@ function MultiSelectDialog({
|
|
|
79450
79452
|
searchPlaceholder = "Search items...",
|
|
79451
79453
|
emptyMessage = "No items found",
|
|
79452
79454
|
handleSearchInput,
|
|
79453
|
-
extraCommandItems = []
|
|
79454
|
-
disabled = false
|
|
79455
|
+
extraCommandItems = []
|
|
79455
79456
|
}) {
|
|
79456
79457
|
const [open, setOpen] = React.useState(false);
|
|
79457
79458
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
@@ -79472,7 +79473,6 @@ function MultiSelectDialog({
|
|
|
79472
79473
|
});
|
|
79473
79474
|
}, [selectedValues, options]);
|
|
79474
79475
|
const handleItemToggle = (optionValue) => {
|
|
79475
|
-
if (disabled) return;
|
|
79476
79476
|
setTempSelected((prev) => {
|
|
79477
79477
|
const isSelected = prev.includes(optionValue);
|
|
79478
79478
|
if (isSelected) {
|
|
@@ -79486,7 +79486,6 @@ function MultiSelectDialog({
|
|
|
79486
79486
|
});
|
|
79487
79487
|
};
|
|
79488
79488
|
const handleSelectAll = () => {
|
|
79489
|
-
if (disabled) return;
|
|
79490
79489
|
const availableOptions = filteredOptions.filter(
|
|
79491
79490
|
(option) => !tempSelected.includes(option.value)
|
|
79492
79491
|
);
|
|
@@ -79494,24 +79493,20 @@ function MultiSelectDialog({
|
|
|
79494
79493
|
setTempSelected((prev) => [...prev, ...toAdd.map((opt) => opt.value)]);
|
|
79495
79494
|
};
|
|
79496
79495
|
const handleDeselectAll = () => {
|
|
79497
|
-
if (disabled) return;
|
|
79498
79496
|
const filteredValues = new Set(filteredOptions.map((option) => option.value));
|
|
79499
79497
|
setTempSelected((prev) => prev.filter((item) => !filteredValues.has(item)));
|
|
79500
79498
|
};
|
|
79501
79499
|
const handleApply = () => {
|
|
79502
|
-
if (disabled) return;
|
|
79503
79500
|
onValueChange(tempSelected);
|
|
79504
79501
|
setSelectedValues(tempSelected);
|
|
79505
79502
|
setOpen(false);
|
|
79506
79503
|
};
|
|
79507
79504
|
const handleCancel = () => {
|
|
79508
|
-
if (disabled) return;
|
|
79509
79505
|
setTempSelected(selectedValues);
|
|
79510
79506
|
setSearchQuery("");
|
|
79511
79507
|
setOpen(false);
|
|
79512
79508
|
};
|
|
79513
79509
|
const handleSearchKeyDown = (e4) => {
|
|
79514
|
-
if (disabled) return;
|
|
79515
79510
|
if (e4.key === "Enter" && searchQuery.trim() && handleSearchInput) {
|
|
79516
79511
|
e4.preventDefault();
|
|
79517
79512
|
handleSearchInput(searchQuery.trim());
|
|
@@ -79536,7 +79531,6 @@ function MultiSelectDialog({
|
|
|
79536
79531
|
{
|
|
79537
79532
|
variant: "outline",
|
|
79538
79533
|
className: "w-full justify-between text-left font-normal h-9 p-3",
|
|
79539
|
-
disabled,
|
|
79540
79534
|
children: [
|
|
79541
79535
|
/* @__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(
|
|
79542
79536
|
Badge,
|
|
@@ -79587,8 +79581,7 @@ function MultiSelectDialog({
|
|
|
79587
79581
|
value: searchQuery,
|
|
79588
79582
|
onChange: (e4) => setSearchQuery(e4.target.value),
|
|
79589
79583
|
onKeyDown: handleSearchKeyDown,
|
|
79590
|
-
className: "pl-10 h-11"
|
|
79591
|
-
disabled
|
|
79584
|
+
className: "pl-10 h-11"
|
|
79592
79585
|
}
|
|
79593
79586
|
),
|
|
79594
79587
|
handleSearchInput && searchQuery.trim() && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx(
|
|
@@ -79598,11 +79591,9 @@ function MultiSelectDialog({
|
|
|
79598
79591
|
variant: "ghost",
|
|
79599
79592
|
className: "h-6 w-6 p-0",
|
|
79600
79593
|
onClick: () => {
|
|
79601
|
-
if (disabled) return;
|
|
79602
79594
|
handleSearchInput(searchQuery.trim());
|
|
79603
79595
|
setSearchQuery("");
|
|
79604
79596
|
},
|
|
79605
|
-
disabled,
|
|
79606
79597
|
children: /* @__PURE__ */ jsx(IconDefinitions.PlusIcon, { className: "h-3 w-3" })
|
|
79607
79598
|
}
|
|
79608
79599
|
) })
|
|
@@ -79622,7 +79613,7 @@ function MultiSelectDialog({
|
|
|
79622
79613
|
variant: "ghost",
|
|
79623
79614
|
size: "sm",
|
|
79624
79615
|
onClick: handleSelectAll,
|
|
79625
|
-
disabled:
|
|
79616
|
+
disabled: !canSelectMore || filteredSelectedCount === filteredOptions.length,
|
|
79626
79617
|
className: "h-8 text-xs",
|
|
79627
79618
|
children: "Select All"
|
|
79628
79619
|
}
|
|
@@ -79633,7 +79624,7 @@ function MultiSelectDialog({
|
|
|
79633
79624
|
variant: "ghost",
|
|
79634
79625
|
size: "sm",
|
|
79635
79626
|
onClick: handleDeselectAll,
|
|
79636
|
-
disabled:
|
|
79627
|
+
disabled: filteredSelectedCount === 0,
|
|
79637
79628
|
className: "h-8 text-xs",
|
|
79638
79629
|
children: "Clear All"
|
|
79639
79630
|
}
|
|
@@ -79656,11 +79647,9 @@ function MultiSelectDialog({
|
|
|
79656
79647
|
size: "sm",
|
|
79657
79648
|
className: "mt-3",
|
|
79658
79649
|
onClick: () => {
|
|
79659
|
-
if (disabled) return;
|
|
79660
79650
|
handleSearchInput(searchQuery.trim());
|
|
79661
79651
|
setSearchQuery("");
|
|
79662
79652
|
},
|
|
79663
|
-
disabled,
|
|
79664
79653
|
children: [
|
|
79665
79654
|
/* @__PURE__ */ jsx(IconDefinitions.PlusIcon, { className: "h-3 w-3 mr-1" }),
|
|
79666
79655
|
'Add "',
|
|
@@ -79671,7 +79660,7 @@ function MultiSelectDialog({
|
|
|
79671
79660
|
)
|
|
79672
79661
|
] }) : filteredOptions.map((option) => {
|
|
79673
79662
|
const isSelected = tempSelected.includes(option.value);
|
|
79674
|
-
const isDisabled =
|
|
79663
|
+
const isDisabled = !isSelected && !canSelectMore;
|
|
79675
79664
|
return /* @__PURE__ */ jsxs(
|
|
79676
79665
|
CommandItem,
|
|
79677
79666
|
{
|
|
@@ -79697,22 +79686,12 @@ function MultiSelectDialog({
|
|
|
79697
79686
|
] }) }) }),
|
|
79698
79687
|
/* @__PURE__ */ jsx(Separator, {}),
|
|
79699
79688
|
/* @__PURE__ */ jsx("div", { className: "p-6 pt-4", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
79700
|
-
/* @__PURE__ */ jsx(
|
|
79701
|
-
Button$1,
|
|
79702
|
-
{
|
|
79703
|
-
variant: "outline",
|
|
79704
|
-
onClick: handleCancel,
|
|
79705
|
-
className: "flex-1",
|
|
79706
|
-
disabled,
|
|
79707
|
-
children: "Cancel"
|
|
79708
|
-
}
|
|
79709
|
-
),
|
|
79689
|
+
/* @__PURE__ */ jsx(Button$1, { variant: "outline", onClick: handleCancel, className: "flex-1", children: "Cancel" }),
|
|
79710
79690
|
/* @__PURE__ */ jsxs(
|
|
79711
79691
|
Button$1,
|
|
79712
79692
|
{
|
|
79713
79693
|
onClick: handleApply,
|
|
79714
79694
|
className: "flex-1 bg-primary hover:bg-primary/90",
|
|
79715
|
-
disabled,
|
|
79716
79695
|
children: [
|
|
79717
79696
|
"Apply (",
|
|
79718
79697
|
selectedCount,
|