Skip to content

Commit 801e2b8

Browse files
authored
SOV-631: component fixes for onboarding flow (#70)
* feat: option to disable focus trap on dialog * fix: input prop and z-index on tooltip
1 parent 548f6a1 commit 801e2b8

7 files changed

Lines changed: 21 additions & 5 deletions

File tree

.changeset/cuddly-badgers-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sovryn/ui': patch
3+
---
4+
5+
SOV-631: fix input size prop and tooltip z-index

.changeset/rich-bobcats-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sovryn/ui': patch
3+
---
4+
5+
SOV-631: add posibility to disable focus trap from dialog

packages/ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"jest-canvas-mock": "2.4.0"
6161
},
6262
"peerDependencies": {
63-
"react": ">=18.2",
64-
"react-dom": ">=18.2"
63+
"react": "18.2.0",
64+
"react-dom": "18.2.0"
6565
},
6666
"files": [
6767
"dist/index.js",

packages/ui/src/1_atoms/Input/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { InputBase, InputBaseProps } from '../InputBase/InputBase';
77
import styles from './Input.module.css';
88
import { InputSize } from './Input.types';
99

10-
export type InputProps = Omit<InputBaseProps, 'ref'> & {
10+
export type InputProps = Omit<InputBaseProps, 'ref' | 'size'> & {
1111
classNameInput?: string;
1212
invalid?: boolean;
1313
dataLayoutId?: string;

packages/ui/src/1_atoms/InputBase/InputBase.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import debounceCallback from 'lodash.debounce';
1212

1313
import { noop, applyDataAttr } from '../../utils';
1414

15-
export type InputBaseProps = Omit<HTMLProps<HTMLInputElement>, 'ref'> & {
15+
export type InputBaseProps = Omit<
16+
HTMLProps<HTMLInputElement>,
17+
'ref' | 'size'
18+
> & {
1619
debounce?: number;
1720
dataLayoutId?: string;
1821
onChangeText?: (value: string) => void;

packages/ui/src/2_molecules/Dialog/Dialog.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type DialogProps = {
2222
onClose?: () => void;
2323
closeOnEscape?: boolean;
2424
initialFocusRef?: React.RefObject<HTMLElement>;
25+
disableFocusTrap?: boolean;
2526
};
2627

2728
export const Dialog: IDialogFunctionComponent<DialogProps> = ({
@@ -34,6 +35,7 @@ export const Dialog: IDialogFunctionComponent<DialogProps> = ({
3435
onClose,
3536
closeOnEscape = true,
3637
initialFocusRef,
38+
disableFocusTrap,
3739
}) => {
3840
const ref = useRef<HTMLDivElement>(null);
3941

@@ -90,7 +92,7 @@ export const Dialog: IDialogFunctionComponent<DialogProps> = ({
9092
<div className={styles.wrapper} {...applyDataAttr(dataLayoutId)}>
9193
<div className={styles.container}>
9294
<FocusTrap
93-
active={isOpen}
95+
active={isOpen && !disableFocusTrap}
9496
focusTrapOptions={{
9597
initialFocus: initialFocusRef?.current || undefined,
9698
fallbackFocus: () => ref.current!,

packages/ui/src/2_molecules/Tooltip/Tooltip.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.tooltip {
22
@apply bg-gray-10 rounded p-3 text-gray-90 absolute inline-block min-w-5 max-w-72 leading-5 opacity-0;
3+
z-index: 999999;
34

45
&.bottom,
56
&.bottom-start,

0 commit comments

Comments
 (0)