@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.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -524,9 +524,10 @@ type DatePickerProps$1 = {
|
|
|
524
524
|
minDate?: Date;
|
|
525
525
|
maxDate?: Date;
|
|
526
526
|
disabledDates?: Date[];
|
|
527
|
+
defaultMonth?: Date;
|
|
527
528
|
} & React$1.HTMLAttributes<HTMLDivElement>;
|
|
528
529
|
/** ---------- Component ---------- */
|
|
529
|
-
declare function DatePicker$1({ selectionMode, selectedDate, onDateSelect, selectedRange, onRangeSelect, callbacks, onMonthBackward, onMonthForward, variant, minDate, maxDate, disabledDates, className, ...props }: DatePickerProps$1): react_jsx_runtime.JSX.Element;
|
|
530
|
+
declare function DatePicker$1({ selectionMode, selectedDate, onDateSelect, selectedRange, onRangeSelect, callbacks, onMonthBackward, onMonthForward, variant, minDate, maxDate, disabledDates, defaultMonth, className, ...props }: DatePickerProps$1): react_jsx_runtime.JSX.Element;
|
|
530
531
|
|
|
531
532
|
type CalendarProps$1 = React__default.ComponentProps<typeof DatePicker$1>;
|
|
532
533
|
type DateRange = {
|
|
@@ -1867,6 +1868,8 @@ type MenuItem = {
|
|
|
1867
1868
|
subItems?: MenuItem[];
|
|
1868
1869
|
/** Click handler (plain items and sub-trigger items only). */
|
|
1869
1870
|
onClick?: () => void;
|
|
1871
|
+
/** Extra class names forwarded to the rendered menu item element. */
|
|
1872
|
+
className?: string;
|
|
1870
1873
|
};
|
|
1871
1874
|
type ActionItemGroup = {
|
|
1872
1875
|
/** Optional label rendered above the group. */
|
package/dist/index.d.ts
CHANGED
|
@@ -524,9 +524,10 @@ type DatePickerProps$1 = {
|
|
|
524
524
|
minDate?: Date;
|
|
525
525
|
maxDate?: Date;
|
|
526
526
|
disabledDates?: Date[];
|
|
527
|
+
defaultMonth?: Date;
|
|
527
528
|
} & React$1.HTMLAttributes<HTMLDivElement>;
|
|
528
529
|
/** ---------- Component ---------- */
|
|
529
|
-
declare function DatePicker$1({ selectionMode, selectedDate, onDateSelect, selectedRange, onRangeSelect, callbacks, onMonthBackward, onMonthForward, variant, minDate, maxDate, disabledDates, className, ...props }: DatePickerProps$1): react_jsx_runtime.JSX.Element;
|
|
530
|
+
declare function DatePicker$1({ selectionMode, selectedDate, onDateSelect, selectedRange, onRangeSelect, callbacks, onMonthBackward, onMonthForward, variant, minDate, maxDate, disabledDates, defaultMonth, className, ...props }: DatePickerProps$1): react_jsx_runtime.JSX.Element;
|
|
530
531
|
|
|
531
532
|
type CalendarProps$1 = React__default.ComponentProps<typeof DatePicker$1>;
|
|
532
533
|
type DateRange = {
|
|
@@ -1867,6 +1868,8 @@ type MenuItem = {
|
|
|
1867
1868
|
subItems?: MenuItem[];
|
|
1868
1869
|
/** Click handler (plain items and sub-trigger items only). */
|
|
1869
1870
|
onClick?: () => void;
|
|
1871
|
+
/** Extra class names forwarded to the rendered menu item element. */
|
|
1872
|
+
className?: string;
|
|
1870
1873
|
};
|
|
1871
1874
|
type ActionItemGroup = {
|
|
1872
1875
|
/** Optional label rendered above the group. */
|
package/dist/index.js
CHANGED
|
@@ -5062,13 +5062,14 @@ function DatePicker({
|
|
|
5062
5062
|
minDate,
|
|
5063
5063
|
maxDate,
|
|
5064
5064
|
disabledDates,
|
|
5065
|
+
defaultMonth,
|
|
5065
5066
|
className,
|
|
5066
5067
|
...props
|
|
5067
5068
|
}) {
|
|
5068
5069
|
const today = React__namespace.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
5069
5070
|
const normalizedRangeStart = clampToDay(selectedRange?.start);
|
|
5070
5071
|
const normalizedRangeEnd = clampToDay(selectedRange?.end);
|
|
5071
|
-
const initialDisplay = selectionMode === "range" ? normalizedRangeStart ?? normalizedRangeEnd ?? /* @__PURE__ */ new Date() : selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
|
|
5072
|
+
const initialDisplay = defaultMonth ? new Date(defaultMonth) : selectionMode === "range" ? normalizedRangeStart ?? normalizedRangeEnd ?? /* @__PURE__ */ new Date() : selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
|
|
5072
5073
|
const [displayed, setDisplayed] = React__namespace.useState(initialDisplay);
|
|
5073
5074
|
minDate = clampToDay(minDate);
|
|
5074
5075
|
maxDate = clampToDay(maxDate);
|
|
@@ -9954,7 +9955,7 @@ function DialogHeader2({ className, children, ...props }) {
|
|
|
9954
9955
|
SheetPrimitive__namespace.Close,
|
|
9955
9956
|
{
|
|
9956
9957
|
"data-slot": "dialog-close",
|
|
9957
|
-
className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden
|
|
9958
|
+
className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
|
|
9958
9959
|
children: [
|
|
9959
9960
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
|
|
9960
9961
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -11688,7 +11689,7 @@ function DropdownMenuSubTrigger({
|
|
|
11688
11689
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
11689
11690
|
"data-inset": inset,
|
|
11690
11691
|
className: cn(
|
|
11691
|
-
"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",
|
|
11692
|
+
"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",
|
|
11692
11693
|
className
|
|
11693
11694
|
),
|
|
11694
11695
|
...props,
|
|
@@ -17456,7 +17457,7 @@ var ActionMenu = ({
|
|
|
17456
17457
|
var renderMenuItem = (item) => {
|
|
17457
17458
|
if (item.subItems && item.subItems.length > 0) {
|
|
17458
17459
|
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSub, { children: [
|
|
17459
|
-
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { disabled: item.disabled, children: [
|
|
17460
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { disabled: item.disabled, className: item.className, children: [
|
|
17460
17461
|
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
|
|
17461
17462
|
item.label
|
|
17462
17463
|
] }),
|
|
@@ -17470,6 +17471,7 @@ var renderMenuItem = (item) => {
|
|
|
17470
17471
|
checked: item.checked,
|
|
17471
17472
|
onCheckedChange: item.onCheckedChange,
|
|
17472
17473
|
disabled: item.disabled,
|
|
17474
|
+
className: item.className,
|
|
17473
17475
|
children: [
|
|
17474
17476
|
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
|
|
17475
17477
|
item.label,
|
|
@@ -17480,11 +17482,20 @@ var renderMenuItem = (item) => {
|
|
|
17480
17482
|
);
|
|
17481
17483
|
}
|
|
17482
17484
|
if (item.type === "radio") {
|
|
17483
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17484
|
-
|
|
17485
|
-
|
|
17486
|
-
|
|
17487
|
-
|
|
17485
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17486
|
+
DropdownMenuRadioItem,
|
|
17487
|
+
{
|
|
17488
|
+
value: item.value ?? item.label,
|
|
17489
|
+
disabled: item.disabled,
|
|
17490
|
+
className: item.className,
|
|
17491
|
+
children: [
|
|
17492
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
|
|
17493
|
+
item.label,
|
|
17494
|
+
item.shortcut && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuShortcut, { children: item.shortcut })
|
|
17495
|
+
]
|
|
17496
|
+
},
|
|
17497
|
+
item.label
|
|
17498
|
+
);
|
|
17488
17499
|
}
|
|
17489
17500
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17490
17501
|
DropdownMenuItem,
|
|
@@ -17492,6 +17503,7 @@ var renderMenuItem = (item) => {
|
|
|
17492
17503
|
onClick: item.onClick,
|
|
17493
17504
|
disabled: item.disabled,
|
|
17494
17505
|
variant: item.variant,
|
|
17506
|
+
className: item.className,
|
|
17495
17507
|
children: [
|
|
17496
17508
|
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2 shrink-0", children: item.icon }),
|
|
17497
17509
|
item.label,
|