@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/package.json
CHANGED
|
@@ -31,6 +31,8 @@ export type TableActionsMenuProps = {
|
|
|
31
31
|
triggerAriaLabel: string;
|
|
32
32
|
className?: string;
|
|
33
33
|
menuClassName?: string;
|
|
34
|
+
/** Optional custom trigger icon. Defaults to TableMoreIcon. */
|
|
35
|
+
triggerIcon?: ReactNode;
|
|
34
36
|
/** Dropdown menu width in pixels. Defaults to 231. Ignored when menuFitContent is true. */
|
|
35
37
|
menuWidth?: number;
|
|
36
38
|
/** Size the menu to its content width instead of a fixed pixel width. Defaults to true so labels stay on one line. */
|
|
@@ -73,6 +75,7 @@ export function TableActionsMenu({
|
|
|
73
75
|
triggerAriaLabel,
|
|
74
76
|
className,
|
|
75
77
|
menuClassName,
|
|
78
|
+
triggerIcon,
|
|
76
79
|
menuWidth = MENU_WIDTH_PX,
|
|
77
80
|
menuFitContent = true,
|
|
78
81
|
}: TableActionsMenuProps) {
|
|
@@ -193,13 +196,27 @@ export function TableActionsMenu({
|
|
|
193
196
|
item.onSelect();
|
|
194
197
|
}}
|
|
195
198
|
className={cn(
|
|
196
|
-
'flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left typography-14 font-medium
|
|
199
|
+
'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',
|
|
197
200
|
index > 0 && 'border-t border-storm-gray-50',
|
|
198
201
|
item.disabled && 'cursor-not-allowed opacity-50',
|
|
202
|
+
item.tone === 'danger'
|
|
203
|
+
? 'text-[#AE0011]'
|
|
204
|
+
: item.tone === 'success'
|
|
205
|
+
? 'text-green-600'
|
|
206
|
+
: 'text-storm-gray-900',
|
|
199
207
|
)}
|
|
200
208
|
>
|
|
201
209
|
{icon ? (
|
|
202
|
-
<span
|
|
210
|
+
<span
|
|
211
|
+
className={cn(
|
|
212
|
+
'inline-flex size-5 shrink-0 items-center justify-center',
|
|
213
|
+
item.tone === 'danger'
|
|
214
|
+
? 'text-[#AE0011]'
|
|
215
|
+
: item.tone === 'success'
|
|
216
|
+
? 'text-green-600'
|
|
217
|
+
: 'text-storm-gray-200',
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
203
220
|
{icon}
|
|
204
221
|
</span>
|
|
205
222
|
) : null}
|
|
@@ -215,7 +232,7 @@ export function TableActionsMenu({
|
|
|
215
232
|
<TableActionButton
|
|
216
233
|
ref={triggerRef}
|
|
217
234
|
variant="menu"
|
|
218
|
-
icon={<TableMoreIcon className="size-5" />}
|
|
235
|
+
icon={triggerIcon ?? <TableMoreIcon className="size-5" />}
|
|
219
236
|
ariaLabel={triggerAriaLabel}
|
|
220
237
|
onClick={() => setOpen((current) => !current)}
|
|
221
238
|
aria-expanded={open}
|