@sustaina/shared-ui 1.58.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -5019,13 +5019,14 @@ function DatePicker({
5019
5019
  minDate,
5020
5020
  maxDate,
5021
5021
  disabledDates,
5022
+ defaultMonth,
5022
5023
  className,
5023
5024
  ...props
5024
5025
  }) {
5025
5026
  const today = React.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
5026
5027
  const normalizedRangeStart = clampToDay(selectedRange?.start);
5027
5028
  const normalizedRangeEnd = clampToDay(selectedRange?.end);
5028
- const initialDisplay = selectionMode === "range" ? normalizedRangeStart ?? normalizedRangeEnd ?? /* @__PURE__ */ new Date() : selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
5029
+ const initialDisplay = defaultMonth ? new Date(defaultMonth) : selectionMode === "range" ? normalizedRangeStart ?? normalizedRangeEnd ?? /* @__PURE__ */ new Date() : selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
5029
5030
  const [displayed, setDisplayed] = React.useState(initialDisplay);
5030
5031
  minDate = clampToDay(minDate);
5031
5032
  maxDate = clampToDay(maxDate);
@@ -9911,7 +9912,7 @@ function DialogHeader2({ className, children, ...props }) {
9911
9912
  SheetPrimitive.Close,
9912
9913
  {
9913
9914
  "data-slot": "dialog-close",
9914
- className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
9915
+ className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
9915
9916
  children: [
9916
9917
  /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
9917
9918
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
@@ -11645,7 +11646,7 @@ function DropdownMenuSubTrigger({
11645
11646
  "data-slot": "dropdown-menu-sub-trigger",
11646
11647
  "data-inset": inset,
11647
11648
  className: cn(
11648
- "data-highlighted:bg-[#EAF5EE] data-highlighted:text-[#379A2A] focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-3 py-2 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
11649
+ "data-highlighted:bg-[#EAF5EE] data-highlighted:text-[#379A2A] focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-3 py-2 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
11649
11650
  className
11650
11651
  ),
11651
11652
  ...props,
@@ -17413,7 +17414,7 @@ var ActionMenu = ({
17413
17414
  var renderMenuItem = (item) => {
17414
17415
  if (item.subItems && item.subItems.length > 0) {
17415
17416
  return /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
17416
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { disabled: item.disabled, children: [
17417
+ /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { disabled: item.disabled, className: item.className, children: [
17417
17418
  item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
17418
17419
  item.label
17419
17420
  ] }),
@@ -17427,6 +17428,7 @@ var renderMenuItem = (item) => {
17427
17428
  checked: item.checked,
17428
17429
  onCheckedChange: item.onCheckedChange,
17429
17430
  disabled: item.disabled,
17431
+ className: item.className,
17430
17432
  children: [
17431
17433
  item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
17432
17434
  item.label,
@@ -17437,11 +17439,20 @@ var renderMenuItem = (item) => {
17437
17439
  );
17438
17440
  }
17439
17441
  if (item.type === "radio") {
17440
- return /* @__PURE__ */ jsxs(DropdownMenuRadioItem, { value: item.value ?? item.label, disabled: item.disabled, children: [
17441
- item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
17442
- item.label,
17443
- item.shortcut && /* @__PURE__ */ jsx(DropdownMenuShortcut, { children: item.shortcut })
17444
- ] }, item.label);
17442
+ return /* @__PURE__ */ jsxs(
17443
+ DropdownMenuRadioItem,
17444
+ {
17445
+ value: item.value ?? item.label,
17446
+ disabled: item.disabled,
17447
+ className: item.className,
17448
+ children: [
17449
+ item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
17450
+ item.label,
17451
+ item.shortcut && /* @__PURE__ */ jsx(DropdownMenuShortcut, { children: item.shortcut })
17452
+ ]
17453
+ },
17454
+ item.label
17455
+ );
17445
17456
  }
17446
17457
  return /* @__PURE__ */ jsxs(
17447
17458
  DropdownMenuItem,
@@ -17449,6 +17460,7 @@ var renderMenuItem = (item) => {
17449
17460
  onClick: item.onClick,
17450
17461
  disabled: item.disabled,
17451
17462
  variant: item.variant,
17463
+ className: item.className,
17452
17464
  children: [
17453
17465
  item.icon && /* @__PURE__ */ jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
17454
17466
  item.label,