Skip to content

Commit ea528b9

Browse files
authored
feat(design-system): action menu classname pass down to secondary row action [AR-43506] (#136)
https://drivenets.atlassian.net/browse/AR-43506 <img width="260" height="233" alt="image" src="https://github.com/user-attachments/assets/09e43548-42fb-411c-baab-2a3c6178ac51" />
1 parent d643427 commit ea528b9

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

.changeset/real-clocks-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@drivenets/design-system': patch
3+
---
4+
5+
- Add `className` option to the SecondaryRowAction props

packages/design-system/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const DsTableCell = <TData, TValue>({
7676
key={i}
7777
value={label}
7878
disabled={isDisabled}
79+
className={action.className}
7980
onClick={(e) => e.stopPropagation()}
8081
onSelect={() => action.onClick(row.original)}
8182
>

packages/design-system/src/components/ds-table/components/ds-table-cell/ds-table-cell.types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export type SecondaryRowAction<TData> = Omit<RowAction<TData>, 'icon'> & {
3939
* Optional icon to be displayed for the action
4040
*/
4141
icon?: IconType;
42+
43+
/**
44+
* Optional className to apply custom styling to the action item
45+
*/
46+
className?: string;
4247
};
4348

4449
/**

packages/design-system/src/components/ds-table/ds-table.stories.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,7 @@
369369
white-space: pre-wrap;
370370
word-break: break-all;
371371
}
372+
373+
.destructiveAction {
374+
color: var(--system-status-error);
375+
}

packages/design-system/src/components/ds-table/ds-table.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ export const WithRowActions: Story = {
491491
label: 'Delete',
492492
tooltip: 'Delete this row',
493493
disabled: (data) => data.status === 'single',
494+
className: styles.destructiveAction,
494495
onClick: (data) => {
495496
alert(`Delete action for ${data.firstName}`);
496497
},

0 commit comments

Comments
 (0)