diff --git a/packages/design-system/src/lib/components/transfer-list/TransferList.module.scss b/packages/design-system/src/lib/components/transfer-list/TransferList.module.scss index a1ef4ccb1..cadd2e884 100644 --- a/packages/design-system/src/lib/components/transfer-list/TransferList.module.scss +++ b/packages/design-system/src/lib/components/transfer-list/TransferList.module.scss @@ -16,8 +16,7 @@ position: relative; z-index: 1; width: 230px; - height: 230px; - padding-block: 0.75rem; + height: 240px; overflow-y: auto; border: solid 2px $dv-border-color; border-radius: 6px; @@ -57,11 +56,22 @@ label { width: 100%; padding-left: 0.5rem; - padding-block: 0.25rem; + padding-block: 0.5rem; cursor: pointer; } } } + + .column-label { + position: sticky; + top: 0; + left: 0; + margin: 0; + padding: 0.35rem 0.5rem; + font-weight: bold; + text-align: center; + background-color: #f5f5f5; + } } .middle-column { diff --git a/packages/design-system/src/lib/components/transfer-list/TransferList.tsx b/packages/design-system/src/lib/components/transfer-list/TransferList.tsx index cc9c3e9b1..d0179567a 100644 --- a/packages/design-system/src/lib/components/transfer-list/TransferList.tsx +++ b/packages/design-system/src/lib/components/transfer-list/TransferList.tsx @@ -32,6 +32,7 @@ export interface TransferListProps { } // TODO:ME Check scrollbar styles for chrome and safari +// TODO:ME Check navigation with keyboard export const TransferList = ({ availableItems, @@ -103,7 +104,7 @@ export const TransferList = ({ const labelId = `transfer-list-item-${item.value}-label-${uniqueID}` return ( - + -
- {leftLabel &&

{leftLabel}

} +
+ {leftLabel &&

{leftLabel}

} {customList(left)}
@@ -159,8 +160,8 @@ export const TransferList = ({ className={styles['transfer-button']} />
-
- {rightLabel &&

{rightLabel}

} +
+ {rightLabel &&

{rightLabel}

} {customList(right)}
diff --git a/packages/design-system/src/lib/stories/transfer-list/TransferList.stories.tsx b/packages/design-system/src/lib/stories/transfer-list/TransferList.stories.tsx index fced7b06d..96bca5467 100644 --- a/packages/design-system/src/lib/stories/transfer-list/TransferList.stories.tsx +++ b/packages/design-system/src/lib/stories/transfer-list/TransferList.stories.tsx @@ -40,21 +40,37 @@ const availableItems: TransferListItem[] = [ { label: 'Item 6', value: 6 + }, + { + label: 'Item 7', + value: 7 + }, + { + label: 'Item 8', + value: 8 + }, + { + label: 'Item 9', + value: 9 + }, + { + label: 'Item 10', + value: 10 } ] const availableItemsTypeHobbies: TransferListItem[] = [ { label: 'Soccer', - value: 10 + value: 20 }, { label: 'Basketball', - value: 20 + value: 30 }, { label: 'Tennis', - value: 30 + value: 40 } ]