Skip to content

Commit 69840ff

Browse files
anuj-kumaryclaude
andcommitted
Revert font-size support from Select and SelectItem context
Removes fontSize from SelectContext so it can be shipped as a standalone feature in a separate PR, keeping this branch focused on permission fixes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 352f1b1 commit 69840ff

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

openmetadata-ui-core-components/src/main/resources/ui/src/components/base/select/select-item.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { Avatar } from '@/components/base/avatar/avatar';
2-
import { cx } from '@/utils/cx';
3-
import { isReactComponent } from '@/utils/is-react-component';
4-
import { fontSizeClass } from '@/utils/tailwindClasses';
5-
import { Check } from '@untitledui/icons';
61
import { isValidElement, useContext } from 'react';
2+
import { Check } from '@untitledui/icons';
73
import type { ListBoxItemProps as AriaListBoxItemProps } from 'react-aria-components';
84
import {
95
ListBoxItem as AriaListBoxItem,
106
Text as AriaText,
117
} from 'react-aria-components';
8+
import { Avatar } from '@/components/base/avatar/avatar';
9+
import { cx } from '@/utils/cx';
10+
import { isReactComponent } from '@/utils/is-react-component';
1211
import type { SelectItemType } from './select';
1312
import { SelectContext } from './select';
1413

@@ -33,7 +32,7 @@ export const SelectItem = ({
3332
children,
3433
...props
3534
}: SelectItemProps) => {
36-
const { fontSize, size } = useContext(SelectContext);
35+
const { size } = useContext(SelectContext);
3736

3837
const labelOrChildren =
3938
label || (typeof children === 'string' ? children : '');
@@ -90,8 +89,7 @@ export const SelectItem = ({
9089
<div className="tw:flex tw:w-full tw:min-w-0 tw:flex-1 tw:flex-wrap tw:gap-x-2">
9190
<AriaText
9291
className={cx(
93-
'tw:truncate tw:whitespace-nowrap tw:text-primary',
94-
fontSizeClass[fontSize],
92+
'tw:truncate tw:text-md tw:font-medium tw:whitespace-nowrap tw:text-primary',
9593
state.isDisabled && 'tw:text-disabled'
9694
)}
9795
slot="label">
@@ -102,8 +100,7 @@ export const SelectItem = ({
102100
{supportingText && (
103101
<AriaText
104102
className={cx(
105-
'tw:whitespace-nowrap tw:text-tertiary',
106-
fontSizeClass[fontSize],
103+
'tw:text-md tw:whitespace-nowrap tw:text-tertiary',
107104
state.isDisabled && 'tw:text-disabled'
108105
)}
109106
slot="description">

openmetadata-ui-core-components/src/main/resources/ui/src/components/base/select/select.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ const SelectValue = ({
152152
);
153153
};
154154

155-
export const SelectContext = createContext<{
156-
size: 'sm' | 'md';
157-
fontSize: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
158-
}>({
159-
fontSize: 'md',
155+
export const SelectContext = createContext<{ size: 'sm' | 'md' }>({
160156
size: 'sm',
161157
});
162158

@@ -174,7 +170,7 @@ const Select = ({
174170
...rest
175171
}: SelectProps) => {
176172
return (
177-
<SelectContext.Provider value={{ fontSize, size }}>
173+
<SelectContext.Provider value={{ size }}>
178174
<AriaSelect
179175
{...rest}
180176
className={(state) =>

0 commit comments

Comments
 (0)