1
1
import React , { useState , useMemo } from 'react'
2
- import Box from '../Box'
3
2
import type { Meta } from '@storybook/react-vite'
4
3
import { Button } from '../Button'
5
4
import type { ItemInput } from '../deprecated/ActionList/List'
@@ -10,6 +9,7 @@ import {ActionList} from '../deprecated/ActionList'
10
9
import FormControl from '../FormControl'
11
10
import { Stack } from '../Stack'
12
11
import { Dialog } from '../experimental'
12
+ import styles from './SelectPanel.examples.stories.module.css'
13
13
14
14
const meta : Meta < typeof SelectPanel > = {
15
15
title : 'Components/SelectPanel/Examples' ,
@@ -29,15 +29,12 @@ const NoResultsMessage = (filter: string): {variant: 'empty'; title: string; bod
29
29
function getColorCircle ( color : string ) {
30
30
return function ( ) {
31
31
return (
32
- < Box
33
- bg = { color }
34
- borderColor = { color }
35
- width = { 14 }
36
- height = { 14 }
37
- borderRadius = { 10 }
38
- margin = "auto"
39
- borderWidth = "1px"
40
- borderStyle = "solid"
32
+ < div
33
+ className = { styles . ColorCircle }
34
+ style = { {
35
+ backgroundColor : color ,
36
+ borderColor : color ,
37
+ } }
41
38
/>
42
39
)
43
40
}
@@ -300,28 +297,9 @@ export const CustomItemRenderer = () => {
300
297
onFilterChange = { setFilter }
301
298
overlayProps = { { width : 'medium' } }
302
299
renderItem = { item => (
303
- < ActionList . Item
304
- { ...item }
305
- text = { undefined }
306
- sx = { {
307
- mx : 2 ,
308
- '&[data-is-active-descendant="activated-directly"]' : {
309
- backgroundColor : 'transparent' ,
310
- outline : '2px solid var(--focus-outlineColor, var(--color-accent-emphasis))' ,
311
- outlineOffset : '-2px' ,
312
- } ,
313
- } }
314
- >
300
+ < ActionList . Item { ...item } text = { undefined } className = { styles . CustomActionListItem } >
315
301
{ ' ' }
316
- < Box
317
- sx = { {
318
- overflow : 'hidden' ,
319
- whiteSpace : 'nowrap' ,
320
- textOverflow : 'ellipsis' ,
321
- } }
322
- >
323
- { item . text }
324
- </ Box >
302
+ < div className = { styles . TruncatedText } > { item . text } </ div >
325
303
</ ActionList . Item >
326
304
) }
327
305
message = { filteredItems . length === 0 ? NoResultsMessage ( filter ) : undefined }
0 commit comments