@scripso-homepad/ui 0.4.34 → 0.4.35
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/web/index.cjs +15 -4
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +3 -1
- package/dist/web/index.d.ts +3 -1
- package/dist/web/index.js +15 -4
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/web/components/TableActionsMenu.tsx +20 -3
package/dist/web/index.d.cts
CHANGED
|
@@ -270,12 +270,14 @@ type TableActionsMenuProps = {
|
|
|
270
270
|
triggerAriaLabel: string;
|
|
271
271
|
className?: string;
|
|
272
272
|
menuClassName?: string;
|
|
273
|
+
/** Optional custom trigger icon. Defaults to TableMoreIcon. */
|
|
274
|
+
triggerIcon?: ReactNode;
|
|
273
275
|
/** Dropdown menu width in pixels. Defaults to 231. Ignored when menuFitContent is true. */
|
|
274
276
|
menuWidth?: number;
|
|
275
277
|
/** Size the menu to its content width instead of a fixed pixel width. Defaults to true so labels stay on one line. */
|
|
276
278
|
menuFitContent?: boolean;
|
|
277
279
|
};
|
|
278
|
-
declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
|
|
280
|
+
declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, triggerIcon, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
|
|
279
281
|
|
|
280
282
|
type TableRowActionsConfig = {
|
|
281
283
|
status: ReactNode;
|
package/dist/web/index.d.ts
CHANGED
|
@@ -270,12 +270,14 @@ type TableActionsMenuProps = {
|
|
|
270
270
|
triggerAriaLabel: string;
|
|
271
271
|
className?: string;
|
|
272
272
|
menuClassName?: string;
|
|
273
|
+
/** Optional custom trigger icon. Defaults to TableMoreIcon. */
|
|
274
|
+
triggerIcon?: ReactNode;
|
|
273
275
|
/** Dropdown menu width in pixels. Defaults to 231. Ignored when menuFitContent is true. */
|
|
274
276
|
menuWidth?: number;
|
|
275
277
|
/** Size the menu to its content width instead of a fixed pixel width. Defaults to true so labels stay on one line. */
|
|
276
278
|
menuFitContent?: boolean;
|
|
277
279
|
};
|
|
278
|
-
declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
|
|
280
|
+
declare function TableActionsMenu({ items, triggerAriaLabel, className, menuClassName, triggerIcon, menuWidth, menuFitContent, }: TableActionsMenuProps): react.JSX.Element | null;
|
|
279
281
|
|
|
280
282
|
type TableRowActionsConfig = {
|
|
281
283
|
status: ReactNode;
|
package/dist/web/index.js
CHANGED
|
@@ -30009,6 +30009,7 @@ function TableActionsMenu({
|
|
|
30009
30009
|
triggerAriaLabel,
|
|
30010
30010
|
className,
|
|
30011
30011
|
menuClassName,
|
|
30012
|
+
triggerIcon,
|
|
30012
30013
|
menuWidth = MENU_WIDTH_PX,
|
|
30013
30014
|
menuFitContent = true
|
|
30014
30015
|
}) {
|
|
@@ -30105,12 +30106,22 @@ function TableActionsMenu({
|
|
|
30105
30106
|
item.onSelect();
|
|
30106
30107
|
},
|
|
30107
30108
|
className: cn(
|
|
30108
|
-
"flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left typography-14 font-medium
|
|
30109
|
+
"flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left typography-14 font-medium transition-colors hover:bg-storm-gray-0",
|
|
30109
30110
|
index > 0 && "border-t border-storm-gray-50",
|
|
30110
|
-
item.disabled && "cursor-not-allowed opacity-50"
|
|
30111
|
+
item.disabled && "cursor-not-allowed opacity-50",
|
|
30112
|
+
item.tone === "danger" ? "text-[#AE0011]" : item.tone === "success" ? "text-green-600" : "text-storm-gray-900"
|
|
30111
30113
|
),
|
|
30112
30114
|
children: [
|
|
30113
|
-
icon ? /* @__PURE__ */ jsx(
|
|
30115
|
+
icon ? /* @__PURE__ */ jsx(
|
|
30116
|
+
"span",
|
|
30117
|
+
{
|
|
30118
|
+
className: cn(
|
|
30119
|
+
"inline-flex size-5 shrink-0 items-center justify-center",
|
|
30120
|
+
item.tone === "danger" ? "text-[#AE0011]" : item.tone === "success" ? "text-green-600" : "text-storm-gray-200"
|
|
30121
|
+
),
|
|
30122
|
+
children: icon
|
|
30123
|
+
}
|
|
30124
|
+
) : null,
|
|
30114
30125
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: item.label })
|
|
30115
30126
|
]
|
|
30116
30127
|
},
|
|
@@ -30125,7 +30136,7 @@ function TableActionsMenu({
|
|
|
30125
30136
|
{
|
|
30126
30137
|
ref: triggerRef,
|
|
30127
30138
|
variant: "menu",
|
|
30128
|
-
icon: /* @__PURE__ */ jsx(TableMoreIcon, { className: "size-5" }),
|
|
30139
|
+
icon: triggerIcon ?? /* @__PURE__ */ jsx(TableMoreIcon, { className: "size-5" }),
|
|
30129
30140
|
ariaLabel: triggerAriaLabel,
|
|
30130
30141
|
onClick: () => setOpen((current) => !current),
|
|
30131
30142
|
"aria-expanded": open,
|