1
1
'use client' ;
2
2
3
3
import { isPhone } from '@ui5/webcomponents-base/dist/Device.js' ;
4
- import { useI18nBundle , useSyncRef } from '@ui5/webcomponents-react-base' ;
4
+ import { useI18nBundle , useStylesheet , useSyncRef } from '@ui5/webcomponents-react-base' ;
5
5
import { clsx } from 'clsx' ;
6
6
import type { ReactElement } from 'react' ;
7
7
import React , { forwardRef , useReducer , useRef } from 'react' ;
8
8
import { createPortal } from 'react-dom' ;
9
- import { createUseStyles } from 'react-jss' ;
10
9
import { ButtonDesign } from '../../enums/index.js' ;
11
10
import { AVAILABLE_ACTIONS , CANCEL , X_OF_Y } from '../../i18n/i18n-defaults.js' ;
12
11
import { addCustomCSSWithScoping } from '../../internal/addCustomCSSWithScoping.js' ;
@@ -20,7 +19,7 @@ import type {
20
19
ResponsivePopoverPropTypes
21
20
} from '../../webComponents/index.js' ;
22
21
import { Button , ResponsivePopover } from '../../webComponents/index.js' ;
23
- import styles from './ActionSheet.jss .js' ;
22
+ import { classNames , styleData } from './ActionSheet.module.css .js' ;
24
23
25
24
export interface ActionSheetPropTypes extends Omit < ResponsivePopoverPropTypes , 'header' | 'headerText' | 'children' > {
26
25
/**
@@ -64,8 +63,6 @@ export interface ActionSheetPropTypes extends Omit<ResponsivePopoverPropTypes, '
64
63
portalContainer ?: Element ;
65
64
}
66
65
67
- const useStyles = createUseStyles ( styles , { name : 'ActionSheet' } ) ;
68
-
69
66
if ( isPhone ( ) ) {
70
67
addCustomCSSWithScoping (
71
68
'ui5-responsive-popover' ,
@@ -154,8 +151,9 @@ const ActionSheet = forwardRef<ResponsivePopoverDomRef, ActionSheetPropTypes>((p
154
151
...rest
155
152
} = props ;
156
153
154
+ useStylesheet ( styleData , ActionSheet . displayName ) ;
155
+
157
156
const i18nBundle = useI18nBundle ( '@ui5/webcomponents-react' ) ;
158
- const classes = useStyles ( ) ;
159
157
const [ componentRef , popoverRef ] = useSyncRef ( ref ) ;
160
158
const actionBtnsRef = useRef ( null ) ;
161
159
const [ focusedItem , setFocusedItem ] = useReducer ( ( _ , action ) => {
@@ -268,11 +266,11 @@ const ActionSheet = forwardRef<ResponsivePopoverDomRef, ActionSheetPropTypes>((p
268
266
{ ...rest }
269
267
onAfterOpen = { handleAfterOpen }
270
268
ref = { componentRef }
271
- className = { clsx ( classes . actionSheet , isPhone ( ) && classes . actionSheetMobile , className ) }
269
+ className = { clsx ( classNames . actionSheet , isPhone ( ) && classNames . actionSheetMobile , className ) }
272
270
data-actionsheet
273
271
>
274
272
< div
275
- className = { isPhone ( ) ? classes . contentMobile : undefined }
273
+ className = { isPhone ( ) ? classNames . contentMobile : undefined }
276
274
data-component-name = "ActionSheetMobileContent"
277
275
role = { a11yConfig ?. actionSheetMobileContent ?. role ?? 'application' }
278
276
onKeyDown = { handleKeyDown }
0 commit comments