Skip to content

Commit c90dfb4

Browse files
committed
[LEMS-3361/use-wb-tab-in-expression] move logic for WB Tabs styles
1 parent 626041d commit c90dfb4

File tree

1 file changed

+19
-20
lines changed
  • packages/math-input/src/components/keypad

1 file changed

+19
-20
lines changed

packages/math-input/src/components/keypad/keypad.tsx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ export interface KeypadProps {
3939
) => void;
4040
}
4141

42+
const tabsStyles = {
43+
tab: {
44+
marginBlockStart: sizing.size_080,
45+
marginBlockEnd: sizing.size_080,
46+
},
47+
tablist: {
48+
gap: sizing.size_080,
49+
paddingInline: sizing.size_080,
50+
},
51+
tabPanel: {
52+
display: "flex",
53+
flexDirection: "row",
54+
flexWrap: "nowrap",
55+
backgroundColor: semanticColor.core.background.disabled.strong,
56+
direction: "ltr",
57+
},
58+
} as const;
59+
4260
// The main (v2) Keypad. Use this component to present an accessible, onscreen
4361
// keypad to learners for entering math expressions.
4462
export default function Keypad({extraKeys = [], ...props}: KeypadProps) {
@@ -125,26 +143,7 @@ export default function Keypad({extraKeys = [], ...props}: KeypadProps) {
125143
onTabSelected={(newSelectedPage: string) => {
126144
setSelectedPage(newSelectedPage as KeypadPageType);
127145
}}
128-
styles={{
129-
tab: {
130-
marginBlockStart: sizing.size_080,
131-
marginBlockEnd: sizing.size_080,
132-
},
133-
tablist: {
134-
gap: sizing.size_080,
135-
paddingInline: sizing.size_080,
136-
},
137-
tabPanel: {
138-
display: "flex",
139-
flexDirection: "row",
140-
flexWrap: "nowrap",
141-
backgroundColor:
142-
semanticColor.core.background.disabled.strong,
143-
// Even in RTL languages, math is LTR.
144-
// So we force this component to always render LTR
145-
direction: "ltr",
146-
},
147-
}}
146+
styles={tabsStyles}
148147
/>
149148
</View>
150149
</View>

0 commit comments

Comments
 (0)