Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(design): use component sizes for mobile controls (#8137)

白熱0561e624306f
diff --git a/packages/design/src/components/action-row/MobileActionRowGroup.tsx b/packages/design/src/components/action-row/MobileActionRowGroup.tsx
index 8bfacf3472..be69b3490b 100644
--- a/packages/design/src/components/action-row/MobileActionRowGroup.tsx
+++ b/packages/design/src/components/action-row/MobileActionRowGroup.tsx
@@ -24,8 +24,7 @@ export function MobileActionRowGroup({ className, ...props }: IMobileActionRowGr
<div
className={clsx(className, `
univer-flex univer-w-full univer-justify-stretch univer-gap-3
- [&>button]:!univer-m-0 [&>button]:!univer-h-12 [&>button]:!univer-min-w-0 [&>button]:!univer-flex-1
- [&>button]:!univer-rounded-xl
+ [&>button]:!univer-m-0 [&>button]:!univer-min-w-0 [&>button]:!univer-flex-1 [&>button]:!univer-rounded-xl
`)}
{...props}
/>
diff --git a/packages/design/src/components/color-picker/ColorInput.tsx b/packages/design/src/components/color-picker/ColorInput.tsx
index e244f2fc96..2bffa3dce3 100644
--- a/packages/design/src/components/color-picker/ColorInput.tsx
+++ b/packages/design/src/components/color-picker/ColorInput.tsx
@@ -14,27 +14,28 @@
* limitations under the License.
*/
-import type { ChangeEvent } from 'react';
import { useEffect, useMemo, useState } from 'react';
-import { borderClassName } from '../../helper/class-utilities';
-import { clsx } from '../../helper/clsx';
+import type { IInputProps } from '../input/Input';
+import { Input } from '../input/Input';
import { hexToHsv, hsvToHex, hsvToRgb, rgbToHsv } from './color-conversion';
interface IColorInputProps {
hsv: [number, number, number];
alpha: number;
format: 'hex' | 'rgba';
+ size?: IInputProps['size'];
onChange: (h: number, s: number, v: number, a?: number) => void;
}
-interface IInputProps {
+interface IColorChannelInputProps {
+ size?: IInputProps['size'];
hsv: [number, number, number];
alpha?: number;
format?: 'hex' | 'rgba';
onChange?: (h: number, s: number, v: number, a?: number) => void;
}
-function HexInput({ hsv, onChange }: IInputProps) {
+function HexInput({ hsv, size, onChange }: IColorChannelInputProps) {
const [inputValue, setInputValue] = useState('');
const hexValue = useMemo(() => hsvToHex(hsv[0], hsv[1], hsv[2]), [hsv]);
@@ -47,8 +48,8 @@ function HexInput({ hsv, onChange }: IInputProps) {
return /^[0-9A-Fa-f]{6}$/.test(hex);
};
- const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
- const newValue = e.target.value.trim();
+ const handleChange = (value: string) => {
+ const newValue = value.trim();
if (newValue.length > 6) {
return;
@@ -76,18 +77,18 @@ function HexInput({ hsv, onChange }: IInputProps) {
return (
<>
- <input
- className={clsx(`
- univer-w-full univer-min-w-0 univer-px-2 !univer-pl-4 univer-uppercase
- rtl:!univer-pl-2 rtl:!univer-pr-4
- dark:!univer-text-gray-0
- `, borderClassName)}
+ <Input
+ size={size}
+ className="univer-min-w-0"
+ inputClass="!univer-pl-4 univer-uppercase rtl:!univer-pl-2 rtl:!univer-pr-4"
value={inputValue}
onChange={handleChange}
onBlur={handleBlur}
onPaste={(event) => {
const pastedValue = event.clipboardData.getData('text').trim();
- if (!/^#[0-9A-Fa-f]{6}$/.test(pastedValue)) return;
+ if (!/^#[0-9A-Fa-f]{6}$/.test(pastedValue)) {
+ return;
+ }
event.preventDefault();
const hex = pastedValue.slice(1);
setInputValue(hex);
@@ -110,7 +111,7 @@ function HexInput({ hsv, onChange }: IInputProps) {
);
}
-function RgbInput({ hsv, alpha, format, onChange }: IInputProps) {
+function RgbInput({ hsv, alpha, format, size, onChange }: IColorChannelInputProps) {
const [localValues, setLocalValues] = useState({ r: 0, g: 0, b: 0, a: 1 });
useEffect(() => {
@@ -162,39 +163,41 @@ function RgbInput({ hsv, alpha, format, onChange }: IInputProps) {
};
return (
- <div
- className={`
- univer-flex univer-items-center univer-gap-2
- [&>input]:univer-w-11 [&>input]:univer-border-gray-200
- dark:[&>input]:!univer-border-gray-600 dark:[&>input]:!univer-text-gray-0
- `}
- >
- <input
+ <div className="univer-flex univer-items-center univer-gap-2">
+ <Input
+ size={size}
+ className="univer-w-11"
aria-label="R"
- value={localValues.r}
- onChange={(e) => handleChange('r', e.target.value)}
+ value={String(localValues.r)}
+ onChange={(value) => handleChange('r', value)}
onBlur={handleBlur}
maxLength={3}
/>
- <input
+ <Input
+ size={size}
+ className="univer-w-11"
aria-label="G"
- value={localValues.g}
- onChange={(e) => handleChange('g', e.target.value)}
+ value={String(localValues.g)}
+ onChange={(value) => handleChange('g', value)}
onBlur={handleBlur}
maxLength={3}
/>
- <input
+ <Input
+ size={size}
+ className="univer-w-11"
aria-label="B"
- value={localValues.b}
- onChange={(e) => handleChange('b', e.target.value)}
+ value={String(localValues.b)}
+ onChange={(value) => handleChange('b', value)}
onBlur={handleBlur}
maxLength={3}
/>
{format === 'rgba' && (
- <input
+ <Input
+ size={size}
+ className="univer-w-11"
aria-label="A"
- value={localValues.a}
- onChange={(e) => handleChange('a', e.target.value)}
+ value={String(localValues.a)}
+ onChange={(value) => handleChange('a', value)}
onBlur={handleBlur}
maxLength={4}
/>
@@ -203,25 +206,12 @@ function RgbInput({ hsv, alpha, format, onChange }: IInputProps) {
);
}
-export function ColorInput({ hsv, alpha, format, onChange }: IColorInputProps) {
+export function ColorInput({ hsv, alpha, format, size = 'mini', onChange }: IColorInputProps) {
return (
- <div
- className={`
- univer-flex univer-gap-2
- [&_input:focus]:!univer-border-primary-600 [&_input:focus]:univer-ring-2
- [&_input:focus]:univer-ring-primary-50
- dark:[&_input:focus]:!univer-border-primary-300 dark:[&_input:focus]:!univer-ring-primary-900
- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-7 [&_input]:univer-items-center
- [&_input]:univer-rounded-md [&_input]:univer-border [&_input]:univer-border-solid
- [&_input]:univer-border-gray-200 [&_input]:univer-bg-gray-0 [&_input]:univer-px-1.5
- [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none
- dark:[&_input]:!univer-border-gray-600 dark:[&_input]:!univer-bg-gray-700
- dark:[&_input]:!univer-text-gray-0
- `}
- >
+ <div className="univer-flex univer-gap-2">
<div className="univer-relative univer-flex univer-flex-1 univer-gap-2">
- <HexInput hsv={hsv} onChange={onChange} />
- <RgbInput hsv={hsv} alpha={alpha} format={format} onChange={onChange} />
+ <HexInput hsv={hsv} size={size} onChange={onChange} />
+ <RgbInput hsv={hsv} alpha={alpha} format={format} size={size} onChange={onChange} />
</div>
</div>
);
diff --git a/packages/design/src/components/color-picker/MobileColorPicker.tsx b/packages/design/src/components/color-picker/MobileColorPicker.tsx
index e19d1c1965..165410896e 100644
--- a/packages/design/src/components/color-picker/MobileColorPicker.tsx
+++ b/packages/design/src/components/color-picker/MobileColorPicker.tsx
@@ -106,12 +106,13 @@ export function MobileColorPicker({ format = 'hex', value, onChange }: IMobileCo
}}
/>
- <div className="univer-flex univer-h-12 univer-items-center">
- <button
+ <div className="univer-flex univer-items-center">
+ <Button
+ size="middle"
type="button"
className="
- univer-h-11 univer-w-full univer-cursor-pointer univer-rounded-xl univer-border-0
- univer-bg-gray-100 univer-text-sm univer-font-medium univer-text-gray-900
+ univer-w-full univer-cursor-pointer univer-rounded-xl univer-border-0 univer-bg-gray-100
+ univer-font-medium univer-text-gray-900
active:univer-bg-gray-200
dark:!univer-bg-gray-800 dark:!univer-text-gray-0
dark:active:!univer-bg-gray-700
@@ -119,7 +120,7 @@ export function MobileColorPicker({ format = 'hex', value, onChange }: IMobileCo
onClick={() => setVisible(true)}
>
{locale?.ColorPicker.more}
- </button>
+ </Button>
</div>
<MobileDialog
@@ -149,6 +150,7 @@ export function MobileColorPicker({ format = 'hex', value, onChange }: IMobileCo
</div>
<MemoizedColorInput
+ size="small"
hsv={hsv}
alpha={alpha}
format={format}
@@ -161,8 +163,8 @@ export function MobileColorPicker({ format = 'hex', value, onChange }: IMobileCo
/>
<MobileActionRowGroup>
- <Button onClick={() => setVisible(false)} size="extra-large">{locale?.ColorPicker.cancel}</Button>
- <Button variant="primary" onClick={handleConfirmCustomColor} size="extra-large">{locale?.ColorPicker.confirm}</Button>
+ <Button onClick={() => setVisible(false)} size="middle">{locale?.ColorPicker.cancel}</Button>
+ <Button variant="primary" onClick={handleConfirmCustomColor} size="middle">{locale?.ColorPicker.confirm}</Button>
</MobileActionRowGroup>
</div>
</MobileDialog>
diff --git a/packages/design/src/components/confirm/MobileConfirm.tsx b/packages/design/src/components/confirm/MobileConfirm.tsx
index 929438b78d..031fe249ff 100644
--- a/packages/design/src/components/confirm/MobileConfirm.tsx
+++ b/packages/design/src/components/confirm/MobileConfirm.tsx
@@ -43,8 +43,8 @@ export function MobileConfirm(props: IMobileConfirmProps) {
maskClosable={false}
footer={(
<MobileActionRowGroup>
- {closable && <Button onClick={onClose} size="extra-large">{cancelText ?? locale?.Confirm.cancel}</Button>}
- <Button variant="primary" onClick={onConfirm} size="extra-large">
+ {closable && <Button onClick={onClose} size="middle">{cancelText ?? locale?.Confirm.cancel}</Button>}
+ <Button variant="primary" onClick={onConfirm} size="middle">
{confirmText ?? locale?.Confirm.confirm}
</Button>
</MobileActionRowGroup>
diff --git a/packages/design/src/components/dialog/MobileDialog.tsx b/packages/design/src/components/dialog/MobileDialog.tsx
index e67257fda7..259e3c66ac 100644
--- a/packages/design/src/components/dialog/MobileDialog.tsx
+++ b/packages/design/src/components/dialog/MobileDialog.tsx
@@ -59,8 +59,8 @@ export function MobileDialog(props: IMobileDialogProps) {
const footer = propFooter ?? (showOk || showCancel
? (
<MobileActionRowGroup>
- {showCancel && <Button onClick={onCancel} size="extra-large">{locale?.Confirm.cancel}</Button>}
- {showOk && <Button variant="primary" onClick={onOk} size="extra-large">{locale?.Confirm.confirm}</Button>}
+ {showCancel && <Button onClick={onCancel} size="middle">{locale?.Confirm.cancel}</Button>}
+ {showOk && <Button variant="primary" onClick={onOk} size="middle">{locale?.Confirm.confirm}</Button>}
</MobileActionRowGroup>
)
: null);
@@ -89,7 +89,6 @@ export function MobileDialog(props: IMobileDialogProps) {
!univer-translate-y-0 !univer-flex-col !univer-gap-4 !univer-overflow-hidden !univer-rounded-t-2xl
!univer-p-4
[&_[data-slot='dialog-footer']]:!univer-flex-row [&_[data-slot='dialog-footer']]:!univer-gap-3
- [&_[data-slot='dialog-footer']_button]:!univer-h-12
[&_[data-slot='dialog-footer']_button]:!univer-flex-1
[&_button[data-slot='close']]:!univer-right-3 [&_button[data-slot='close']]:!univer-top-3
[&_button[data-slot='close']]:!univer-size-10
diff --git a/packages/design/src/components/dropdown/MobileDropdownSurface.tsx b/packages/design/src/components/dropdown/MobileDropdownSurface.tsx
index 85b47d5bca..3a0c715081 100644
--- a/packages/design/src/components/dropdown/MobileDropdownSurface.tsx
+++ b/packages/design/src/components/dropdown/MobileDropdownSurface.tsx
@@ -61,7 +61,6 @@ export function MobileDropdownSurface(props: {
dark:!univer-bg-gray-900
[&_button[data-slot='close']]:!univer-right-3 [&_button[data-slot='close']]:!univer-top-3
[&_button[data-slot='close']]:!univer-size-10
- [&_button]:!univer-min-h-11
"
style={{
position: 'fixed',
diff --git a/packages/design/src/components/gradient-color-picker/GradientColorPicker.tsx b/packages/design/src/components/gradient-color-picker/GradientColorPicker.tsx
index 5255c29369..381291b4bd 100644
--- a/packages/design/src/components/gradient-color-picker/GradientColorPicker.tsx
+++ b/packages/design/src/components/gradient-color-picker/GradientColorPicker.tsx
@@ -249,7 +249,6 @@ export function GradientColorPicker(props: IGradientColorPickerProps) {
onPointerDown={(e) => e.stopPropagation()}
>
<Segmented
- size={size}
className="univer-w-full univer-min-w-0 univer-gap-1 univer-overflow-hidden"
items={[
{ label: locale?.GradientColorPicker.linear, value: 'linear' },
diff --git a/packages/design/src/components/gradient-color-picker/MobileGradientColorPicker.tsx b/packages/design/src/components/gradient-color-picker/MobileGradientColorPicker.tsx
index 9f845041a7..ddf1ad1b2a 100644
--- a/packages/design/src/components/gradient-color-picker/MobileGradientColorPicker.tsx
+++ b/packages/design/src/components/gradient-color-picker/MobileGradientColorPicker.tsx
@@ -23,7 +23,7 @@ import { Button } from '../button/Button';
import { MobileColorPicker } from '../color-picker/MobileColorPicker';
import { ConfigContext } from '../config-provider/ConfigProvider';
import { InputNumber } from '../input-number/InputNumber';
-import { MobileActionRow } from '../mobile-action-row/MobileActionRow';
+import { Segmented } from '../segmented/Segmented';
const GRADIENT_TYPES: readonly GradientType[] = ['linear', 'radial', 'angular', 'diamond'];
@@ -47,34 +47,31 @@ export function MobileGradientColorPicker({ value = { type: 'linear', stops: [{
return (
<div className={clsx('univer-grid univer-w-full univer-min-w-0 univer-gap-4', className)}>
{types.length > 1 && (
- <div className="univer-grid univer-grid-cols-2 univer-gap-2">
- {types.map((type) => (
- <MobileActionRow
- key={type}
- title={locale?.GradientColorPicker[type]}
- aria-pressed={value.type === type}
- onClick={() => onChange?.({ ...value, type })}
- />
- ))}
- </div>
+ <Segmented
+ className="univer-w-full"
+ items={types.map((type) => ({ label: locale?.GradientColorPicker[type], value: type }))}
+ value={value.type}
+ onChange={(type) => onChange?.({ ...value, type })}
+ />
)}
{(value.type === 'linear' || value.type === 'angular') && (
<label className="univer-grid univer-gap-2 univer-text-base">
{locale?.GradientColorPicker.angle}
- <InputNumber className="univer-w-full" controls={false} value={value.angle ?? 0} min={0} max={360} onChange={(angle) => onChange?.({ ...value, angle: angle ?? 0 })} size="large" inputClassName="univer-text-base" />
+ <InputNumber className="univer-w-full" controls={false} value={value.angle ?? 0} min={0} max={360} onChange={(angle) => onChange?.({ ...value, angle: angle ?? 0 })} size="small" />
</label>
)}
<div className="univer-flex univer-flex-wrap univer-gap-2">
{value.stops.map((stop, stopIndex) => (
- <button
+ <Button
+ size="middle"
key={stopIndex}
type="button"
aria-label={`${locale?.GradientColorPicker.offset} ${stop.offset}%`}
aria-pressed={index === stopIndex}
className={clsx(focusClassName, `
- univer-flex univer-h-12 univer-min-w-12 univer-appearance-none univer-items-center
- univer-justify-center univer-gap-2 univer-rounded-lg univer-border univer-border-solid
- univer-bg-transparent univer-px-2 univer-text-sm
+ univer-flex univer-min-w-8 univer-appearance-none univer-items-center univer-justify-center
+ univer-gap-2 univer-rounded-lg univer-border univer-border-solid univer-bg-transparent
+ univer-px-2 univer-text-sm
`, index === stopIndex
? `
univer-border-primary-600 univer-text-primary-600
@@ -88,18 +85,18 @@ export function MobileGradientColorPicker({ value = { type: 'linear', stops: [{
>
<span className="univer-size-6 univer-shrink-0 univer-rounded" style={{ backgroundColor: stop.color, opacity: stop.opacity ?? 1 }} />
{`${stop.offset}%`}
- </button>
+ </Button>
))}
- <Button className="univer-size-12" aria-label={locale?.Accessibility.increment} onClick={addStop} size="extra-large"><IncreaseIcon /></Button>
+ <Button className="" aria-label={locale?.Accessibility.increment} onClick={addStop} size="icon"><IncreaseIcon /></Button>
<Button
- className="univer-size-12"
+ className=""
aria-label={locale?.GradientColorPicker.delete}
disabled={value.stops.length <= 2}
onClick={() => {
onChange?.({ ...value, stops: value.stops.filter((_, stopIndex) => stopIndex !== index) });
setSelectedIndex(0);
}}
- size="extra-large"
+ size="icon"
>
<DeleteIcon />
</Button>
@@ -109,11 +106,11 @@ export function MobileGradientColorPicker({ value = { type: 'linear', stops: [{
<div className="univer-grid univer-grid-cols-2 univer-gap-3">
<label className="univer-grid univer-gap-2 univer-text-base">
{locale?.GradientColorPicker.offset}
- <InputNumber className="univer-w-full" controls={false} value={selectedStop.offset} min={0} max={100} onChange={(offset) => updateStop({ offset: offset ?? 0 })} size="large" inputClassName="univer-text-base" />
+ <InputNumber className="univer-w-full" controls={false} value={selectedStop.offset} min={0} max={100} onChange={(offset) => updateStop({ offset: offset ?? 0 })} size="small" />
</label>
<label className="univer-grid univer-gap-2 univer-text-base">
{locale?.GradientColorPicker.transparency}
- <InputNumber className="univer-w-full" controls={false} value={Math.round((1 - (selectedStop.opacity ?? 1)) * 100)} min={0} max={100} onChange={(transparency) => updateStop({ opacity: 1 - (transparency ?? 0) / 100 })} size="large" inputClassName="univer-text-base" />
+ <InputNumber className="univer-w-full" controls={false} value={Math.round((1 - (selectedStop.opacity ?? 1)) * 100)} min={0} max={100} onChange={(transparency) => updateStop({ opacity: 1 - (transparency ?? 0) / 100 })} size="small" />
</label>
</div>
<MobileColorPicker value={selectedStop.color} onChange={(color) => updateStop({ color })} />
diff --git a/packages/design/src/components/gradient-color-picker/__tests__/MobileGradientColorPicker.spec.tsx b/packages/design/src/components/gradient-color-picker/__tests__/MobileGradientColorPicker.spec.tsx
index 8a9565218c..e0f20746bf 100644
--- a/packages/design/src/components/gradient-color-picker/__tests__/MobileGradientColorPicker.spec.tsx
+++ b/packages/design/src/components/gradient-color-picker/__tests__/MobileGradientColorPicker.spec.tsx
@@ -27,7 +27,14 @@ import { ConfigProvider } from '../../config-provider/ConfigProvider';
import { MobileGradientColorPicker } from '../MobileGradientColorPicker';
import '@testing-library/jest-dom/vitest';
-beforeEach(() => vi.stubGlobal('CSS', { ...globalThis.CSS, supports: () => false }));
+beforeEach(() => {
+ vi.stubGlobal('CSS', { ...globalThis.CSS, supports: () => false });
+ vi.stubGlobal('ResizeObserver', class {
+ observe() {}
+ unobserve() {}
+ disconnect() {}
+ });
+});
afterEach(() => {
cleanup();
vi.unstubAllGlobals();
diff --git a/packages/design/src/components/input-number/__tests__/InputNumber.spec.tsx b/packages/design/src/components/input-number/__tests__/InputNumber.spec.tsx
index 161ce286b2..1cbe5f2d31 100644
--- a/packages/design/src/components/input-number/__tests__/InputNumber.spec.tsx
+++ b/packages/design/src/components/input-number/__tests__/InputNumber.spec.tsx
@@ -198,10 +198,10 @@ describe('InputNumber', () => {
expect(onPressEnter).toHaveBeenCalled();
});
- it('keeps numeric editing and bounds when a large input hides its stepper controls', () => {
+ it('keeps numeric editing and bounds when a compact input hides its stepper controls', () => {
const onChange = vi.fn();
const { getByRole, queryByRole } = render(
- <InputNumber size="large" controls={false} defaultValue={12} min={0} max={19} onChange={onChange} />
+ <InputNumber size="small" controls={false} defaultValue={12} min={0} max={19} onChange={onChange} />
);
const input = getByRole('textbox');
expect(queryByRole('button')).toBeNull();
diff --git a/packages/design/src/components/mobile-action-row/MobileActionRow.tsx b/packages/design/src/components/mobile-action-row/MobileActionRow.tsx
index eb62c97117..327a17a3a7 100644
--- a/packages/design/src/components/mobile-action-row/MobileActionRow.tsx
+++ b/packages/design/src/components/mobile-action-row/MobileActionRow.tsx
@@ -17,6 +17,7 @@
import type { ButtonHTMLAttributes, ReactNode } from 'react';
import { borderBottomClassName, focusClassName, resetButtonClassName } from '../../helper/class-utilities';
import { clsx } from '../../helper/clsx';
+import { Button } from '../button/Button';
export interface IMobileActionRowProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title' | 'value'> {
title: ReactNode;
@@ -43,11 +44,12 @@ export function MobileActionRow(props: IMobileActionRowProps) {
} = props;
return (
- <button
+ <Button
+ size="middle"
type={type}
className={clsx(resetButtonClassName, focusClassName, `
- univer-flex univer-min-h-12 univer-w-full univer-items-center univer-gap-3 univer-rounded-xl univer-px-4
- univer-text-left univer-text-base univer-font-medium univer-text-gray-900
+ univer-flex univer-w-full univer-items-center univer-gap-3 univer-rounded-xl univer-text-left
+ univer-font-medium univer-text-gray-900
aria-pressed:!univer-bg-primary-50 aria-pressed:!univer-text-primary-600
disabled:univer-opacity-40
dark:!univer-text-gray-100
@@ -60,7 +62,7 @@ export function MobileActionRow(props: IMobileActionRowProps) {
{...buttonProps}
>
{icon}
- <span className="univer-flex-1">{title}</span>
+ <span className="univer-min-w-0 univer-flex-1 univer-truncate">{title}</span>
{value && valueType === 'color' && (
<span
className="
@@ -73,7 +75,7 @@ export function MobileActionRow(props: IMobileActionRowProps) {
{value && valueType === 'text' && (
<span
className="
- univer-max-w-32 univer-truncate univer-text-sm univer-font-normal univer-text-gray-500
+ univer-max-w-32 univer-truncate univer-font-normal univer-text-gray-500
dark:!univer-text-gray-300
"
>
@@ -81,6 +83,6 @@ export function MobileActionRow(props: IMobileActionRowProps) {
</span>
)}
{trailing}
- </button>
+ </Button>
);
}
diff --git a/packages/design/src/components/mobile-action-row/__tests__/MobileActionRow.spec.tsx b/packages/design/src/components/mobile-action-row/__tests__/MobileActionRow.spec.tsx
index ba2cfb626c..dcdec52cb2 100644
--- a/packages/design/src/components/mobile-action-row/__tests__/MobileActionRow.spec.tsx
+++ b/packages/design/src/components/mobile-action-row/__tests__/MobileActionRow.spec.tsx
@@ -19,14 +19,16 @@ import { describe, expect, it, vi } from 'vitest';
import { MobileActionRow } from '../MobileActionRow';
describe('MobileActionRow', () => {
- it('provides a full-width touch action without desktop hover behavior', () => {
+ it('runs enabled actions and blocks disabled actions', () => {
const onClick = vi.fn();
- render(<MobileActionRow title="Rename" aria-label="Rename" onClick={onClick} />);
+ const { rerender } = render(<MobileActionRow title="Rename" aria-label="Rename" onClick={onClick} />);
const button = screen.getByRole('button', { name: 'Rename' });
- expect(button.className).toContain('univer-min-h-12');
- expect(button.className).not.toContain('hover:');
fireEvent.click(button);
expect(onClick).toHaveBeenCalledOnce();
+
+ rerender(<MobileActionRow title="Rename" aria-label="Rename" disabled onClick={onClick} />);
+ fireEvent.click(screen.getByRole('button', { name: 'Rename' }));
+ expect(onClick).toHaveBeenCalledOnce();
});
});
diff --git a/packages/design/src/components/segmented/Segmented.tsx b/packages/design/src/components/segmented/Segmented.tsx
index d6e22c20d2..a1e404d60d 100644
--- a/packages/design/src/components/segmented/Segmented.tsx
+++ b/packages/design/src/components/segmented/Segmented.tsx
@@ -33,7 +33,6 @@ interface ISegmentedProps<T extends ItemValue = ItemValue> {
defaultValue?: T;
onChange?: (value: T) => void;
className?: string;
- size?: 'small' | 'large';
role?: 'group' | 'tablist';
'aria-label'?: string;
}
@@ -44,12 +43,11 @@ export function Segmented<T extends ItemValue = ItemValue>({
defaultValue,
onChange,
className = '',
- size = 'small',
role = 'group',
'aria-label': ariaLabel,
}: ISegmentedProps<T>) {
const { direction } = useContext(ConfigContext);
- const padding = size === 'large' ? 2 : 4;
+ const padding = 4;
const [internalValue, setInternalValue] = useState(defaultValue ?? items.find((item) => !item.disabled)?.value);
const selectedItem = value ?? internalValue;
const itemsRef = useRef<Map<T, HTMLButtonElement>>(new Map());
@@ -117,9 +115,9 @@ export function Segmented<T extends ItemValue = ItemValue>({
ref={containerRef}
className={clsx(`
univer-relative univer-box-border univer-flex univer-min-w-0 univer-gap-1 univer-rounded-lg
- univer-bg-gray-100
+ univer-bg-gray-100 univer-p-1
dark:!univer-bg-gray-800
- `, size === 'large' ? 'univer-p-0.5' : 'univer-p-1', className)}
+ `, className)}
>
<div
className={`
@@ -150,12 +148,10 @@ export function Segmented<T extends ItemValue = ItemValue>({
}}
className={clsx(`
univer-relative univer-box-border univer-min-w-0 univer-flex-1 univer-cursor-pointer
- univer-border-none univer-bg-transparent univer-px-3 univer-py-1 univer-text-xs univer-font-medium
- univer-transition-colors
+ univer-truncate univer-border-none univer-bg-transparent univer-px-3 univer-py-1 univer-text-xs
+ univer-font-medium univer-transition-colors
disabled:univer-cursor-not-allowed disabled:univer-opacity-50
- `, focusClassName, size === 'large' && 'univer-min-h-11', role === 'tablist'
- ? 'univer-whitespace-normal univer-break-words'
- : 'univer-truncate', {
+ `, focusClassName, {
'univer-text-gray-900 dark:!univer-text-gray-0': selectedItem === item.value,
'univer-text-gray-500 hover:univer-text-gray-900 dark:!univer-text-gray-300 dark:hover:!univer-text-gray-0': selectedItem !== item.value,
})}
diff --git a/packages/design/src/components/select/MobileSelect.tsx b/packages/design/src/components/select/MobileSelect.tsx
index 843cd91e42..63e4460f30 100644
--- a/packages/design/src/components/select/MobileSelect.tsx
+++ b/packages/design/src/components/select/MobileSelect.tsx
@@ -20,6 +20,7 @@ import { useContext, useMemo, useState } from 'react';
import type { IMobileDropdownMenuProps } from '../dropdown-menu/MobileDropdownMenu';
import type { ISelectProps } from './Select';
import { clsx } from '../../helper/clsx';
+import { Button } from '../button/Button';
import { MobileDropdownMenu } from '../dropdown-menu/MobileDropdownMenu';
import { FormLayoutContext } from '../form-layout/FormLayout';
import { selectClassName } from './Select';
@@ -35,7 +36,7 @@ export type IMobileSelectProps = ISelectProps;
export function MobileSelect(props: IMobileSelectProps) {
const {
className,
- size = 'large',
+ size = 'small',
value,
disabled = false,
options = EMPTY_OPTIONS,
@@ -101,14 +102,15 @@ export function MobileSelect(props: IMobileSelectProps) {
avoidCollisions={avoidCollisions}
onOpenChange={setOpen}
>
- <button
+ <Button
+ size={size === 'large' ? 'extra-large' : 'middle'}
{...triggerProps}
type="button"
disabled={disabled}
aria-expanded={open}
data-u-comp="mobile-select"
aria-invalid={triggerProps['aria-invalid'] ?? (invalid || undefined)}
- className={clsx(selectClassName, 'univer-text-left', size === 'large' && 'univer-h-auto univer-min-h-12', {
+ className={clsx(selectClassName, 'univer-text-left', {
'!univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-border-primary-300 dark:!univer-ring-primary-900': open && !borderless,
'univer-border-transparent univer-bg-transparent': borderless,
'univer-cursor-not-allowed univer-opacity-50': disabled,
@@ -117,7 +119,7 @@ export function MobileSelect(props: IMobileSelectProps) {
>
<span
className="
- univer-flex-1 univer-truncate univer-text-base univer-text-gray-500
+ univer-flex-1 univer-truncate univer-text-gray-500
dark:!univer-text-gray-0
"
>
@@ -129,7 +131,7 @@ export function MobileSelect(props: IMobileSelectProps) {
dark:!univer-text-gray-0
"
/>
- </button>
+ </Button>
</MobileDropdownMenu>
);
}
diff --git a/packages/design/src/components/select/MultipleSelect.tsx b/packages/design/src/components/select/MultipleSelect.tsx
index 2caec0ab18..ef1e32e186 100644
--- a/packages/design/src/components/select/MultipleSelect.tsx
+++ b/packages/design/src/components/select/MultipleSelect.tsx
@@ -129,7 +129,9 @@ export function MultipleSelect(props: IMultipleSelectProps) {
<div
data-u-comp="multiple-select"
aria-invalid={invalid || undefined}
- className={clsx(selectClassName, size === 'large' && 'univer-h-auto univer-min-h-12', {
+ className={clsx(selectClassName, size === 'large'
+ ? 'univer-h-auto univer-min-h-12 univer-text-base'
+ : 'univer-text-sm', {
'!univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-border-primary-300 dark:!univer-ring-primary-900': open && !borderless,
'univer-border-transparent univer-bg-transparent hover:univer-border-transparent': borderless,
'univer-cursor-not-allowed univer-opacity-50': disabled,
diff --git a/packages/design/src/components/select/Select.tsx b/packages/design/src/components/select/Select.tsx
index b400ef83e9..c2f0379fc2 100644
--- a/packages/design/src/components/select/Select.tsx
+++ b/packages/design/src/components/select/Select.tsx
@@ -171,12 +171,13 @@ export function Select(props: ISelectProps) {
onOpenChange={handleOpenChange}
>
<Button
+ size={size === 'large' ? 'extra-large' : 'middle'}
{...triggerProps}
type="button"
disabled={disabled}
data-u-comp="select"
aria-invalid={triggerProps['aria-invalid'] ?? (invalid || undefined)}
- className={clsx(selectClassName, size === 'large' && 'univer-h-auto univer-min-h-12', {
+ className={clsx(selectClassName, {
'!univer-border-primary-600 univer-outline-none univer-ring-2 univer-ring-primary-50 dark:!univer-border-primary-300 dark:!univer-ring-primary-900': open && !borderless,
'univer-border-transparent univer-bg-transparent hover:univer-border-transparent': borderless,
'univer-cursor-not-allowed': disabled,
@@ -186,7 +187,7 @@ export function Select(props: ISelectProps) {
>
<span
className={`
- univer-flex-1 univer-truncate univer-text-start univer-text-sm univer-text-gray-500
+ univer-flex-1 univer-truncate univer-text-start univer-text-gray-500
dark:!univer-text-gray-0
`}
>
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPanel.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPanel.tsx
index 1fa9880d86..c606c19ee9 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPanel.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPanel.tsx
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-import type { LocaleKey } from '../../locale/types';
import { ICommandService, LocaleService } from '@univerjs/core';
import { MobileActionRow } from '@univerjs/design';
import { IDrawingManagerService } from '@univerjs/drawing';
import { DrawingCommonPanel } from '@univerjs/drawing-ui';
import { useDependency, useObservable } from '@univerjs/ui';
import { useState } from 'react';
+import type { LocaleKey } from '../../locale/types';
import { SidebarDocDrawingOperation } from '../../commands/operations/open-drawing-panel.operation';
import { MobileDocDrawingPosition } from './MobileDocDrawingPosition';
import { MobileDocDrawingTextWrap } from './MobileDocDrawingTextWrap';
@@ -48,7 +48,7 @@ export function MobileDocDrawingPanel() {
title={localeService.t<LocaleKey>(item.label)}
variant="subtle"
className="
- univer-min-w-0 univer-px-2 univer-text-center univer-text-sm
+ univer-min-w-0 univer-px-2 univer-text-center
aria-pressed:!univer-bg-primary-50 aria-pressed:!univer-text-primary-600
"
onClick={() => setTab(item.value)}
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPosition.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPosition.tsx
index 5bc3ef0f25..6b921b3453 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPosition.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingPosition.tsx
@@ -78,8 +78,7 @@ function MobileDocDrawingPositionControls(props: IMobileDocDrawingPositionProps)
{localeService.t<LocaleKey>('docs-drawing-ui.image-position.absolutePosition')}
<InputNumber
disabled={props.disabled}
- className="univer-h-12 univer-w-full"
- inputClassName="[&_input]:!univer-h-12 [&_input]:!univer-text-base"
+ className="univer-w-full"
controls={false}
min={props.minOffset}
max={props.maxOffset}
@@ -90,7 +89,7 @@ function MobileDocDrawingPositionControls(props: IMobileDocDrawingPositionProps)
axis.onOffsetChange(value);
}
}}
- size="large"
+ size="small"
/>
</label>
<div className="univer-grid univer-grid-cols-2 univer-gap-2" role="group" aria-label={localeService.t<LocaleKey>(axis.reference)}>
@@ -102,7 +101,7 @@ function MobileDocDrawingPositionControls(props: IMobileDocDrawingPositionProps)
disabled={props.disabled || option.disabled}
aria-pressed={String(axis.position.relativeFrom) === option.value}
className="
- univer-px-3 univer-text-center univer-text-sm
+ univer-px-3 univer-text-center
aria-pressed:!univer-bg-primary-50 aria-pressed:!univer-text-primary-600
"
onClick={() => axis.onReferenceChange(option.value)}
diff --git a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingTextWrap.tsx b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingTextWrap.tsx
index eda6e59624..53f7f1392b 100644
--- a/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingTextWrap.tsx
+++ b/packages/docs-drawing-ui/src/views/doc-image-panel/MobileDocDrawingTextWrap.tsx
@@ -92,7 +92,7 @@ function MobileDocDrawingTextWrapControls(props: IMobileDocDrawingTextWrapProps)
variant="subtle"
aria-pressed={props.wrapText === option.value}
className="
- univer-px-2 univer-text-center univer-text-sm
+ univer-px-2 univer-text-center
aria-pressed:!univer-bg-primary-50 aria-pressed:!univer-text-primary-600
"
onClick={() => props.onWrapTextChange(option.value)}
@@ -109,15 +109,14 @@ function MobileDocDrawingTextWrapControls(props: IMobileDocDrawingTextWrapProps)
<label key={key} className="univer-grid univer-gap-2 univer-text-sm">
{localeService.t<LocaleKey>(label)}
<InputNumber
- className="univer-h-12 univer-w-full"
- inputClassName="[&_input]:!univer-h-12 [&_input]:!univer-text-base"
+ className="univer-w-full"
controls={false}
min={props.minMargin}
max={props.maxMargin}
precision={1}
value={props.distToText[key] ?? 0}
onChange={(value) => props.onDistanceChange(value, key)}
- size="large"
+ size="small"
/>
</label>
))}
diff --git a/packages/docs-hyper-link-ui/src/views/MobileDocHyperLinkEdit.tsx b/packages/docs-hyper-link-ui/src/views/MobileDocHyperLinkEdit.tsx
index 2950988e71..3ed64cfec5 100644
--- a/packages/docs-hyper-link-ui/src/views/MobileDocHyperLinkEdit.tsx
+++ b/packages/docs-hyper-link-ui/src/views/MobileDocHyperLinkEdit.tsx
@@ -63,8 +63,7 @@ export function MobileDocHyperLinkEdit() {
handleConfirm();
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</FormLayout>
)
@@ -82,21 +81,20 @@ export function MobileDocHyperLinkEdit() {
handleConfirm();
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</FormLayout>
</div>
<div className="univer-mt-5 univer-flex univer-gap-3">
- <Button className="univer-h-12 univer-flex-1" onClick={handleCancel} size="extra-large">
+ <Button className="univer-flex-1" onClick={handleCancel} size="middle">
{localeService.t<LocaleKey>('docs-hyper-link-ui.edit.cancel')}
</Button>
<Button
variant="primary"
- className="univer-h-12 univer-flex-1"
+ className="univer-flex-1"
disabled={isBlankInput(link)}
onClick={handleConfirm}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('docs-hyper-link-ui.edit.confirm')}
</Button>
diff --git a/packages/docs-ui/src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx b/packages/docs-ui/src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
index 3896debe2d..0a281d4252 100644
--- a/packages/docs-ui/src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
+++ b/packages/docs-ui/src/views/mobile-rich-text-editor/MobileRichTextEditor.tsx
@@ -63,7 +63,7 @@ export function MobileRichTextEditor(props: IMobileRichTextEditorProps) {
keyboardWasVisibleRef.current = visible;
}, [confirmOnDismiss, keyboardInset]);
- const buttonClassName = clsx('univer-h-12 univer-shrink-0 univer-text-lg', expanded
+ const buttonClassName = clsx('univer-shrink-0', expanded
? 'univer-flex-1'
: 'univer-w-10');
const expandButton = (
@@ -74,7 +74,7 @@ export function MobileRichTextEditor(props: IMobileRichTextEditorProps) {
aria-expanded={expanded}
onPointerDown={(event) => event.preventDefault()}
onClick={() => onExpandedChange(!expanded)}
- size="extra-large"
+ size="middle"
>
<DownIcon className={clsx('univer-size-5', !expanded && 'univer-rotate-180')} />
</Button>
@@ -118,10 +118,10 @@ export function MobileRichTextEditor(props: IMobileRichTextEditorProps) {
dark:!univer-bg-gray-800
`)}
>
- <Button variant="ghost" className={buttonClassName} aria-label={labels.cancel} onPointerDown={(event) => event.preventDefault()} onClick={onCancel} size="extra-large">
+ <Button variant="ghost" className={buttonClassName} aria-label={labels.cancel} onPointerDown={(event) => event.preventDefault()} onClick={onCancel} size="middle">
<CloseIcon />
</Button>
- <Button variant="ghost" className={clsx(buttonClassName, 'univer-text-primary-600')} aria-label={labels.confirm} onPointerDown={(event) => event.preventDefault()} onClick={onConfirm} size="extra-large">
+ <Button variant="ghost" className={clsx(buttonClassName, 'univer-text-primary-600')} aria-label={labels.confirm} onPointerDown={(event) => event.preventDefault()} onClick={onConfirm} size="middle">
<CheckMarkIcon />
</Button>
{expanded && expandButton}
diff --git a/packages/docs-ui/src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx b/packages/docs-ui/src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
index 09f64e8540..bf32ea5405 100644
--- a/packages/docs-ui/src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
+++ b/packages/docs-ui/src/views/mobile-rich-text-toolbar/MobileRichTextToolbar.tsx
@@ -16,8 +16,6 @@
import type { ITextStyle, Nullable } from '@univerjs/core';
import type { ReactNode } from 'react';
-import type { LocaleKey } from '../../locale/types';
-import type { Editor } from '../../services/editor/editor';
import {
BooleanNumber,
BuildTextUtils,
@@ -42,6 +40,8 @@ import {
import { useDependency, useObservable } from '@univerjs/ui';
import { useEffect, useState } from 'react';
import { merge } from 'rxjs';
+import type { LocaleKey } from '../../locale/types';
+import type { Editor } from '../../services/editor/editor';
import {
getStyleInTextRange,
ResetInlineFormatTextColorCommand,
@@ -239,7 +239,7 @@ export function MobileRichTextToolbar({ editorId, className }: IMobileRichTextTo
variant="text"
size="icon"
aria-label={localeService.t<LocaleKey>('docs-ui.toolbar.textColor.main')}
- className="univer-size-7 univer-justify-self-center"
+ className="univer-justify-self-center"
>
<ColorWheelMultiIcon className="!univer-size-6" />
</Button>
diff --git a/packages/docs-ui/src/views/mobile/MobileDocPasteOptions.tsx b/packages/docs-ui/src/views/mobile/MobileDocPasteOptions.tsx
index 5fc361bd34..4682a4a571 100644
--- a/packages/docs-ui/src/views/mobile/MobileDocPasteOptions.tsx
+++ b/packages/docs-ui/src/views/mobile/MobileDocPasteOptions.tsx
@@ -62,8 +62,8 @@ export function MobileDocPasteOptions({ popup }: { popup: IPopupWithExtraProps<{
<Button
aria-label={localeService.t<LocaleKey>('docs-ui.pasteOptions.title')}
className="
- univer-min-h-11 univer-min-w-11 univer-shadow-sm
- [&_svg]:!univer-size-6
+ [&_svg]:!
+ univer-min-w-11 univer-shadow-sm
"
style={keyboard.visible
? {
@@ -102,7 +102,7 @@ export function MobileDocPasteOptions({ popup }: { popup: IPopupWithExtraProps<{
"
>
<span>{localeService.t<LocaleKey>('docs-ui.pasteOptions.title')}</span>
- <Button variant="text" className="univer-min-h-11" onClick={() => setOpen(false)} size="extra-large">
+ <Button variant="text" onClick={() => setOpen(false)} size="middle">
{localeService.t<LocaleKey>('docs-ui.mobile.done')}
</Button>
</div>
@@ -120,12 +120,9 @@ export function MobileDocPasteOptions({ popup }: { popup: IPopupWithExtraProps<{
aria-checked={state.mode === option.value}
disabled={busy}
variant="text"
- className="
- !univer-h-auto univer-min-h-11 univer-justify-start univer-whitespace-normal
- univer-py-3 univer-text-start
- "
+ className="univer-justify-start univer-whitespace-normal univer-text-start"
onClick={() => changeMode(option.value)}
- size="extra-large"
+ size="middle"
>
<span
className="univer-inline-flex univer-size-5 univer-shrink-0 univer-items-center"
diff --git a/packages/docs-ui/src/views/mobile/MobileDocSettings.tsx b/packages/docs-ui/src/views/mobile/MobileDocSettings.tsx
index c2798cfa5c..6a29727c2e 100644
--- a/packages/docs-ui/src/views/mobile/MobileDocSettings.tsx
+++ b/packages/docs-ui/src/views/mobile/MobileDocSettings.tsx
@@ -49,15 +49,15 @@ const MobileSettingNumber = forwardRef<HTMLInputElement, ComponentProps<typeof I
<InputNumber
{...props}
ref={ref}
- className={clsx(props.className, 'univer-h-12 univer-w-full')}
- inputClassName={clsx(props.inputClassName, 'univer-text-base')}
- size="large"
+ className={clsx(props.className, 'univer-w-full')}
+ inputClassName={clsx(props.inputClassName, '')}
+ size="small"
controls={false}
/>
));
function MobileSettingSelect(props: ComponentProps<typeof MobileSelect>) {
- return <MobileSelect {...props} className={clsx(props.className, 'univer-h-12 univer-w-full')} />;
+ return <MobileSelect {...props} className={clsx(props.className, 'univer-w-full')} size="small" />;
}
function MobileParagraphNumber({ min = 0, max = 100, step = 0.1, precision = 1, onChange, ...props }: ComponentProps<NonNullable<IParagraphSettingProps['NumberComponent']>>) {
@@ -71,9 +71,9 @@ function MobileParagraphAlignmentButton({ label, selected, onClick, children }:
variant="text"
aria-label={label}
aria-pressed={selected}
- className={clsx('univer-h-12 univer-w-full', { '!univer-bg-gray-200 dark:!univer-bg-gray-700': selected })}
+ className={clsx('univer-w-full', { '!univer-bg-gray-200 dark:!univer-bg-gray-700': selected })}
onClick={onClick}
- size="extra-large"
+ size="middle"
>
<span className="univer-flex univer-size-5 univer-items-center univer-justify-center univer-text-lg">
{children}
@@ -162,7 +162,7 @@ function MobileHeaderFooterOptions({ unitId }: { unitId: string }) {
</div>
<div className="univer-flex">
- <Button className="univer-h-12 univer-w-full" onClick={closeHeaderFooter} size="extra-large">
+ <Button className="univer-w-full" onClick={closeHeaderFooter} size="middle">
{localeService.t<LocaleKey>('docs-ui.headerFooter.closeHeaderFooter')}
</Button>
</div>
diff --git a/packages/drawing-ui/src/views/object-list-panel/MobileObjectListPanel.tsx b/packages/drawing-ui/src/views/object-list-panel/MobileObjectListPanel.tsx
index aca4d3e2bd..309a6fb400 100644
--- a/packages/drawing-ui/src/views/object-list-panel/MobileObjectListPanel.tsx
+++ b/packages/drawing-ui/src/views/object-list-panel/MobileObjectListPanel.tsx
@@ -32,9 +32,9 @@ function MobileObjectListInput(props: ComponentProps<typeof Input>) {
return (
<Input
{...props}
- className={clsx(props.className, 'univer-h-12')}
- inputClass={clsx(props.inputClass, '!univer-text-base')}
- size="large"
+ className={clsx(props.className, '')}
+ inputClass={clsx(props.inputClass, '')}
+ size="small"
/>
);
}
@@ -55,7 +55,7 @@ export function MobileObjectListPanel(props: IObjectListPanelBaseProps) {
<div className="univer-flex univer-min-w-0 univer-flex-col univer-gap-2">
<div className="univer-flex univer-w-full univer-min-w-0 univer-gap-2">
<Button
- className="univer-h-12 univer-flex-1"
+ className="univer-flex-1"
size="middle"
disabled={visibilityItems.length === 0}
onClick={() => onSetVisible(visibilityItems.map((item) => item.id), !allVisible)}
@@ -65,7 +65,7 @@ export function MobileObjectListPanel(props: IObjectListPanelBaseProps) {
{onSetSelectable && (
<Button
size="middle"
- className="univer-h-12 univer-flex-1"
+ className="univer-flex-1"
disabled={selectableItems.length === 0}
onClick={() => onSetSelectable(selectableItems.map((item) => item.id), allLocked)}
>
@@ -115,13 +115,11 @@ export function MobileObjectListPanel(props: IObjectListPanelBaseProps) {
<div className="univer-flex univer-shrink-0 univer-flex-col univer-gap-2">
<Input
- className="univer-h-12"
- inputClass="!univer-text-base"
value={searchQuery}
aria-label={labels.search}
placeholder={labels.search}
onChange={setSearchQuery}
- size="large"
+ size="small"
/>
<div className="univer-flex univer-min-w-0 univer-gap-1">
{([
diff --git a/packages/drawing-ui/src/views/panel/MobileDrawingArrange.tsx b/packages/drawing-ui/src/views/panel/MobileDrawingArrange.tsx
index 4494de4a03..8ade3b377f 100644
--- a/packages/drawing-ui/src/views/panel/MobileDrawingArrange.tsx
+++ b/packages/drawing-ui/src/views/panel/MobileDrawingArrange.tsx
@@ -64,19 +64,19 @@ export function MobileDrawingArrange(props: IMobileDrawingArrangeProps) {
</header>
<div className="univer-grid univer-grid-cols-2 univer-gap-2">
- <Button className="univer-h-12 univer-w-full" onClick={() => arrange(ArrangeTypeEnum.forward)} size="extra-large">
+ <Button className="univer-w-full" onClick={() => arrange(ArrangeTypeEnum.forward)} size="middle">
<MoveUpIcon />
{localeService.t<LocaleKey>('drawing-ui.image-panel.arrange.forward')}
</Button>
- <Button className="univer-h-12 univer-w-full" onClick={() => arrange(ArrangeTypeEnum.backward)} size="extra-large">
+ <Button className="univer-w-full" onClick={() => arrange(ArrangeTypeEnum.backward)} size="middle">
<MoveDownIcon />
{localeService.t<LocaleKey>('drawing-ui.image-panel.arrange.backward')}
</Button>
- <Button className="univer-h-12 univer-w-full" onClick={() => arrange(ArrangeTypeEnum.front)} size="extra-large">
+ <Button className="univer-w-full" onClick={() => arrange(ArrangeTypeEnum.front)} size="middle">
<TopmostIcon />
{localeService.t<LocaleKey>('drawing-ui.image-panel.arrange.front')}
</Button>
- <Button className="univer-h-12 univer-w-full" onClick={() => arrange(ArrangeTypeEnum.back)} size="extra-large">
+ <Button className="univer-w-full" onClick={() => arrange(ArrangeTypeEnum.back)} size="middle">
<BottomIcon />
{localeService.t<LocaleKey>('drawing-ui.image-panel.arrange.back')}
</Button>
diff --git a/packages/drawing-ui/src/views/panel/MobileDrawingControls.tsx b/packages/drawing-ui/src/views/panel/MobileDrawingControls.tsx
index a80593a26e..e4944cc462 100644
--- a/packages/drawing-ui/src/views/panel/MobileDrawingControls.tsx
+++ b/packages/drawing-ui/src/views/panel/MobileDrawingControls.tsx
@@ -54,26 +54,23 @@ function MobileDrawingInputNumber(props: ComponentProps<typeof InputNumber>) {
<InputNumber
{...props}
controls={false}
- className={clsx('univer-h-12 univer-w-full', props.className)}
- inputClassName={clsx('[&_input]:!univer-h-12 [&_input]:!univer-text-base', props.inputClassName)}
- size="large"
+ className={clsx('univer-w-full', props.className)}
+ inputClassName={clsx('', props.inputClassName)}
+ size="small"
/>
);
}
function MobileDrawingCheckbox(props: ComponentProps<typeof Checkbox>) {
- return <Checkbox {...props} className={clsx('univer-flex univer-min-h-12 univer-items-center univer-justify-center', props.className)} />;
+ return <Checkbox {...props} className={clsx('univer-flex univer-items-center univer-justify-center', props.className)} />;
}
function MobileDrawingButton(props: ComponentProps<typeof Button>) {
return (
<Button
{...props}
- className={clsx(`
- univer-flex univer-min-h-12 univer-flex-1 univer-items-center univer-justify-center univer-gap-2
- univer-text-base
- `, props.className)}
- size="extra-large"
+ className={clsx('univer-flex univer-flex-1 univer-items-center univer-justify-center univer-gap-2', props.className)}
+ size="middle"
/>
);
}
@@ -396,7 +393,7 @@ export function MobileDrawingAlign(props: IMobileDrawingAlignProps) {
dark:!univer-text-gray-0
"
>
- <MobileSelect value={alignValue} options={alignOptions} onChange={handleAlignChange} />
+ <MobileSelect value={alignValue} options={alignOptions} onChange={handleAlignChange} size="small" />
</div>
</div>
</div>
diff --git a/packages/find-replace/src/views/mobile/MobileFindReplaceBar.tsx b/packages/find-replace/src/views/mobile/MobileFindReplaceBar.tsx
index 535ce34b95..67c8824d71 100644
--- a/packages/find-replace/src/views/mobile/MobileFindReplaceBar.tsx
+++ b/packages/find-replace/src/views/mobile/MobileFindReplaceBar.tsx
@@ -188,7 +188,7 @@ function MobileFindReplaceBarContent() {
/>
<Input
ref={inputRef}
- size="middle"
+ size="small"
allowClear
value={findValue}
placeholder={localeService.t<LocaleKey>('find-replace.dialog.find-placeholder')}
@@ -234,12 +234,11 @@ function MobileFindReplaceBarContent() {
{state.replaceRevealed && (
<div className="univer-flex univer-gap-1 univer-pl-9">
<Input
- size="middle"
+ size="small"
className="univer-min-w-0 univer-flex-1"
value={state.replaceString}
placeholder={localeService.t<LocaleKey>('find-replace.dialog.replace-placeholder')}
onChange={(value) => findReplaceService.changeReplaceString(value)}
- inputClass="univer-text-base"
/>
<ActionButton
disabled={replaceDisabled}
@@ -274,7 +273,7 @@ function IconButton(props: IIconButtonProps) {
disabled={props.disabled}
variant="text"
size="icon"
- className="univer-size-9 univer-flex-none univer-rounded-full"
+ className="univer-flex-none univer-rounded-full"
onClick={props.onClick}
>
{props.children}
@@ -294,7 +293,7 @@ function ActionButton(props: IActionButtonProps) {
type="button"
disabled={props.disabled}
variant="primary"
- size="large"
+ size="middle"
className="univer-flex-none"
onClick={props.onClick}
>
diff --git a/packages/find-replace/src/views/mobile/MobileFindReplaceSettings.tsx b/packages/find-replace/src/views/mobile/MobileFindReplaceSettings.tsx
index bb7fe0f0e7..983d7a858d 100644
--- a/packages/find-replace/src/views/mobile/MobileFindReplaceSettings.tsx
+++ b/packages/find-replace/src/views/mobile/MobileFindReplaceSettings.tsx
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import type { LocaleKey } from '../../locale/types';
import { LocaleService } from '@univerjs/core';
import { Checkbox, MobileSelect } from '@univerjs/design';
import { useDependency, useObservable } from '@univerjs/ui';
+import type { LocaleKey } from '../../locale/types';
import { FindBy, FindDirection, FindScope, IFindReplaceService } from '../../services/find-replace.service';
const FIND_SCOPE_OPTIONS: Array<{ label: LocaleKey; value: FindScope }> = [
@@ -157,7 +157,7 @@ function SettingSelect(props: ISettingSelectProps) {
"
>
<span>{props.label}</span>
- <MobileSelect value={props.value} options={props.options} onChange={props.onChange} />
+ <MobileSelect value={props.value} options={props.options} onChange={props.onChange} size="small" />
</label>
);
}
diff --git a/packages/sheets-filter-ui/src/views/mobile/MobileFilterByCondition.tsx b/packages/sheets-filter-ui/src/views/mobile/MobileFilterByCondition.tsx
index ea4502aac8..30bdfc9d03 100644
--- a/packages/sheets-filter-ui/src/views/mobile/MobileFilterByCondition.tsx
+++ b/packages/sheets-filter-ui/src/views/mobile/MobileFilterByCondition.tsx
@@ -54,6 +54,7 @@ export function MobileFilterByCondition(props: { model: ByConditionsModel }) {
onChange={(nextOperator) => model.onConditionFormChange({
[name]: nextOperator as FilterOperator,
})}
+ size="small"
/>
{needsValue && (
<Input
@@ -62,8 +63,7 @@ export function MobileFilterByCondition(props: { model: ByConditionsModel }) {
onChange={(nextValue) => model.onConditionFormChange({
[name === 'operator1' ? 'val1' : 'val2']: nextValue,
})}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
)}
</div>
@@ -78,8 +78,7 @@ export function MobileFilterByCondition(props: { model: ByConditionsModel }) {
value={formParams!.val1 ?? ''}
placeholder={localeService.t<LocaleKey>('sheets-filter-ui.panel.input-values-placeholder')}
onChange={(value) => model.onConditionFormChange({ val1: value })}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
)}
{condition!.numOfParameters >= 2 && renderSecondaryCondition(
diff --git a/packages/sheets-filter-ui/src/views/mobile/MobileFilterByValue.tsx b/packages/sheets-filter-ui/src/views/mobile/MobileFilterByValue.tsx
index 1deb2a29d4..b3a11d0b20 100644
--- a/packages/sheets-filter-ui/src/views/mobile/MobileFilterByValue.tsx
+++ b/packages/sheets-filter-ui/src/views/mobile/MobileFilterByValue.tsx
@@ -65,8 +65,7 @@ export function MobileFilterByValue(props: { model: ByValuesModel }) {
value={searchText}
placeholder={searchLabel}
onChange={(value) => model.setSearchString(value)}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
<button
type="button"
@@ -87,7 +86,7 @@ export function MobileFilterByValue(props: { model: ByValuesModel }) {
: (
<>
<Checkbox
- className="univer-min-h-12 univer-flex-1 univer-text-base"
+ className="univer-flex-1"
contentClassName="univer-flex univer-items-center univer-gap-1"
indeterminate={indeterminate}
disabled={items.length === 0}
diff --git a/packages/sheets-filter-ui/src/views/mobile/MobileSheetsFilterPanel.tsx b/packages/sheets-filter-ui/src/views/mobile/MobileSheetsFilterPanel.tsx
index 023bc0b8d6..dd9a3ab86a 100644
--- a/packages/sheets-filter-ui/src/views/mobile/MobileSheetsFilterPanel.tsx
+++ b/packages/sheets-filter-ui/src/views/mobile/MobileSheetsFilterPanel.tsx
@@ -231,14 +231,14 @@ function MobileSheetsFilterPanelContent() {
"
>
<MobileActionRowGroup>
- <Button onClick={() => closePanel().catch(() => undefined)} size="extra-large">
+ <Button onClick={() => closePanel().catch(() => undefined)} size="middle">
{localeService.t<LocaleKey>('sheets-filter-ui.panel.cancel')}
</Button>
<Button
variant="primary"
disabled={!canApply || !filterByModel}
onClick={() => applyFilter().catch(() => undefined)}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('sheets-filter-ui.panel.confirm')}
</Button>
@@ -265,14 +265,14 @@ function MobileSheetsFilterPanelContent() {
<Button
disabled={!filterRange || col <= filterRange.startColumn}
onClick={() => changeColumn(-1)}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('sheets-filter-ui.panel.mobile.previous-column')}
</Button>
<Button
disabled={!filterRange || col >= filterRange.endColumn}
onClick={() => changeColumn(1)}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('sheets-filter-ui.panel.mobile.next-column')}
</Button>
@@ -315,7 +315,7 @@ function MobileSheetsFilterPanelContent() {
</div>
<MobileFilterSyncSwitch />
<Button
- size="large"
+ size="middle"
disabled={!hasCriteria || !filterByModel}
onClick={() => clearFilter().catch(() => undefined)}
>
diff --git a/packages/sheets-formula-ui/src/views/mobile/formula-editor/mobile-function-panel/MobileFunctionPanel.tsx b/packages/sheets-formula-ui/src/views/mobile/formula-editor/mobile-function-panel/MobileFunctionPanel.tsx
index 493665adf1..f99fb9d7a7 100644
--- a/packages/sheets-formula-ui/src/views/mobile/formula-editor/mobile-function-panel/MobileFunctionPanel.tsx
+++ b/packages/sheets-formula-ui/src/views/mobile/formula-editor/mobile-function-panel/MobileFunctionPanel.tsx
@@ -252,8 +252,7 @@ export function MobileFunctionPanel(props: {
aria-label={copy.search}
placeholder={copy.search}
onChange={setQuery}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</div>
{!query && (
diff --git a/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelector.tsx b/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelector.tsx
index 26144295cd..e719542388 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelector.tsx
+++ b/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelector.tsx
@@ -125,8 +125,6 @@ export function MobileRangeSelector(props: IRangeSelectorProps) {
<RichTextEditor
isSingle
{...props}
- defaultHeight={48}
- maxHeight={48}
className={className}
preserveHostFocus
onFocusChange={(isFocusing, newValue) => {
diff --git a/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelectorDialog.tsx b/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelectorDialog.tsx
index b35d751c02..f9685f346c 100644
--- a/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelectorDialog.tsx
+++ b/packages/sheets-formula-ui/src/views/range-selector/MobileRangeSelectorDialog.tsx
@@ -139,15 +139,14 @@ export function MobileRangeSelectorDialog(props: IRangeSelectorDialogProps) {
return (
<div key={index} className="univer-mb-2 univer-flex univer-items-center univer-gap-2">
<Input
- className={clsx('univer-box-border univer-h-10 univer-w-full', {
+ className={clsx('univer-box-border univer-w-full', {
'univer-border-primary-600': focusIndex === index,
})}
placeholder={localeService.t<LocaleKey>('sheets-formula-ui.rangeSelector.placeHolder')}
onFocus={() => setFocusIndex(index)}
value={text}
onChange={(value) => handleRangeInput(index, value)}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
{ranges.length > 1 && (
<button
@@ -205,10 +204,10 @@ export function MobileRangeSelectorDialog(props: IRangeSelectorDialogProps) {
footer={(
<footer className="univer-box-border univer-shrink-0 univer-p-4">
<MobileActionRowGroup>
- <Button onClick={onClose} size="extra-large">
+ <Button onClick={onClose} size="middle">
{localeService.t<LocaleKey>('sheets-formula-ui.rangeSelector.cancel')}
</Button>
- <Button variant="primary" onClick={confirmRanges} size="extra-large">
+ <Button variant="primary" onClick={confirmRanges} size="middle">
{localeService.t<LocaleKey>('sheets-formula-ui.rangeSelector.confirm')}
</Button>
</MobileActionRowGroup>
@@ -223,13 +222,13 @@ export function MobileRangeSelectorDialog(props: IRangeSelectorDialogProps) {
{ranges.map(renderRangeInput)}
{ranges.length < maxRangeCount && (
<Button
- className="univer-h-10 univer-w-full"
+ className="univer-w-full"
variant="link"
onClick={() => {
setRanges([...ranges, '']);
setFocusIndex(ranges.length);
}}
- size="large"
+ size="middle"
>
<IncreaseIcon />
<span>{localeService.t<LocaleKey>('sheets-formula-ui.rangeSelector.addAnotherRange')}</span>
diff --git a/packages/sheets-hyper-link-ui/src/views/MobileCellLinkEdit.tsx b/packages/sheets-hyper-link-ui/src/views/MobileCellLinkEdit.tsx
index 45cd7ee3a4..a2c90238ab 100644
--- a/packages/sheets-hyper-link-ui/src/views/MobileCellLinkEdit.tsx
+++ b/packages/sheets-hyper-link-ui/src/views/MobileCellLinkEdit.tsx
@@ -448,14 +448,13 @@ export const MobileCellLinkEdit = () => {
handleSubmit();
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</FormLayout>
)
: null}
<FormLayout label={localeService.t<LocaleKey>('sheets-hyper-link-ui.form.tooltip')}>
- <Input value={tooltip} onChange={setTooltip} size="large" inputClass="univer-text-base" />
+ <Input value={tooltip} onChange={setTooltip} size="small" />
</FormLayout>
<FormLayout label={localeService.t<LocaleKey>('sheets-hyper-link-ui.form.type')}>
<MobileSelect
@@ -466,6 +465,7 @@ export const MobileCellLinkEdit = () => {
setType(newType as SheetHyperLinkType);
setPayload('');
}}
+ size="small"
/>
</FormLayout>
{type === SheetHyperLinkType.URL && (
@@ -489,8 +489,7 @@ export const MobileCellLinkEdit = () => {
handleSubmit();
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</FormLayout>
)}
@@ -534,6 +533,7 @@ export const MobileCellLinkEdit = () => {
setDisplaySyncedWithPayload(true);
}
}}
+ size="small"
/>
</FormLayout>
)}
@@ -552,6 +552,7 @@ export const MobileCellLinkEdit = () => {
setDisplaySyncedWithPayload(true);
}
}}
+ size="small"
/>
</FormLayout>
)}
@@ -578,14 +579,14 @@ export const MobileCellLinkEdit = () => {
}
await commandService.executeCommand(CloseHyperLinkPopupOperation.id);
}}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('sheets-hyper-link-ui.form.cancel')}
</Button>
<Button
variant="primary"
onClick={handleSubmit}
- size="extra-large"
+ size="middle"
>
{localeService.t<LocaleKey>('sheets-hyper-link-ui.form.ok')}
</Button>
diff --git a/packages/sheets-numfmt-ui/src/views/mobile/MobileCustomFormat.tsx b/packages/sheets-numfmt-ui/src/views/mobile/MobileCustomFormat.tsx
index 38bb3e5567..689ff40bf8 100644
--- a/packages/sheets-numfmt-ui/src/views/mobile/MobileCustomFormat.tsx
+++ b/packages/sheets-numfmt-ui/src/views/mobile/MobileCustomFormat.tsx
@@ -50,8 +50,7 @@ export function MobileCustomFormat(props: IMobileCustomFormatProps) {
value={pattern}
placeholder={title}
onChange={setPattern}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
<MobileSelect
className="
@@ -61,6 +60,7 @@ export function MobileCustomFormat(props: IMobileCustomFormatProps) {
value={pattern || title}
options={options}
onChange={setPattern}
+ size="small"
/>
<div
className="
@@ -71,7 +71,7 @@ export function MobileCustomFormat(props: IMobileCustomFormatProps) {
{localeService.t<LocaleKey>('sheets-numfmt-ui.customFormatDes')}
</div>
<MobileActionRowGroup className="univer-shrink-0">
- <Button variant="primary" disabled={!pattern.trim()} onClick={() => onConfirm(pattern.trim())} size="extra-large">
+ <Button variant="primary" disabled={!pattern.trim()} onClick={() => onConfirm(pattern.trim())} size="middle">
{localeService.t<LocaleKey>('sheets-numfmt-ui.confirm')}
</Button>
</MobileActionRowGroup>
diff --git a/packages/sheets-sort-ui/src/views/mobile/MobileCustomSortPanel.tsx b/packages/sheets-sort-ui/src/views/mobile/MobileCustomSortPanel.tsx
index c066829428..95651e550d 100644
--- a/packages/sheets-sort-ui/src/views/mobile/MobileCustomSortPanel.tsx
+++ b/packages/sheets-sort-ui/src/views/mobile/MobileCustomSortPanel.tsx
@@ -82,7 +82,7 @@ function MobileCustomSortPanelContent({ location }: { location: ISheetSortLocati
<Checkbox checked={hasTitle} onChange={(value) => setTitle(Boolean(value))}>
{localeService.t<LocaleKey>('sheets-sort-ui.dialog.first-row-check')}
</Checkbox>
- <Button variant="text" disabled={!canAddCondition} onClick={addCondition} size="extra-large">
+ <Button variant="text" disabled={!canAddCondition} onClick={addCondition} size="middle">
{localeService.t<LocaleKey>('sheets-sort-ui.dialog.add-condition')}
</Button>
</div>
@@ -108,6 +108,7 @@ function MobileCustomSortPanelContent({ location }: { location: ISheetSortLocati
value: `${title.index}`,
}))}
onChange={(value) => updateRule(index, { colIndex: Number(value) })}
+ size="small"
/>
{orderRules.length > 1 && (
<Button
@@ -134,6 +135,7 @@ function MobileCustomSortPanelContent({ location }: { location: ISheetSortLocati
},
]}
onChange={(value) => updateRule(index, { type: value as SortType })}
+ size="small"
/>
</div>
);
@@ -145,10 +147,10 @@ function MobileCustomSortPanelContent({ location }: { location: ISheetSortLocati
dark:!univer-bg-gray-900
"
>
- <Button size="large" onClick={() => sheetsSortUIService.closeCustomSortPanel()}>
+ <Button size="middle" onClick={() => sheetsSortUIService.closeCustomSortPanel()}>
{localeService.t<LocaleKey>('sheets-sort-ui.dialog.cancel')}
</Button>
- <Button size="large" variant="primary" onClick={apply}>
+ <Button size="middle" variant="primary" onClick={apply}>
{localeService.t<LocaleKey>('sheets-sort-ui.dialog.confirm')}
</Button>
</div>
diff --git a/packages/sheets-table-ui/src/views/components/MobileSheetTableConditionPanel.tsx b/packages/sheets-table-ui/src/views/components/MobileSheetTableConditionPanel.tsx
index f87acf89df..4688f085cd 100644
--- a/packages/sheets-table-ui/src/views/components/MobileSheetTableConditionPanel.tsx
+++ b/packages/sheets-table-ui/src/views/components/MobileSheetTableConditionPanel.tsx
@@ -162,13 +162,12 @@ export function MobileSheetTableConditionPanel(props: IMobileSheetTableCondition
placeholder={localeService.t<LocaleKey>('sheets-table-ui.filter.input-values-placeholder')}
value={conditionInfo.info.string}
onChange={(value) => handleConditionInfo({ string: value })}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
)
: (
<Input
- className="univer-h-7 univer-w-full"
+ className="univer-w-full"
inputMode="decimal"
value={numberDraft}
aria-invalid={numberDraft !== '' && !Number.isFinite(Number(numberDraft))}
@@ -179,8 +178,7 @@ export function MobileSheetTableConditionPanel(props: IMobileSheetTableCondition
handleConditionInfo({ number: Number(value) });
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
)}
</>
@@ -220,8 +218,7 @@ export function MobileSheetTableConditionPanel(props: IMobileSheetTableCondition
handleConditionInfo({ numberRange: [Number(value), conditionInfo.info.numberRange?.[1]] });
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
<span> - </span>
<Input
@@ -236,8 +233,7 @@ export function MobileSheetTableConditionPanel(props: IMobileSheetTableCondition
handleConditionInfo({ numberRange: [conditionInfo.info.numberRange?.[0], Number(value)] });
}
}}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
</div>
)}
@@ -247,6 +243,7 @@ export function MobileSheetTableConditionPanel(props: IMobileSheetTableCondition
value={conditionInfo.info.dateSelect ?? conditionDateOptions[0].value}
options={conditionDateOptions}
onChange={(value) => handleConditionInfo({ dateSelect: value })}
+ size="small"
/>
)}
</div>
diff --git a/packages/sheets-table-ui/src/views/components/MobileSheetTableFilterPanel.tsx b/packages/sheets-table-ui/src/views/components/MobileSheetTableFilterPanel.tsx
index 415d4a0dcf..a82574b57f 100644
--- a/packages/sheets-table-ui/src/views/components/MobileSheetTableFilterPanel.tsx
+++ b/packages/sheets-table-ui/src/views/components/MobileSheetTableFilterPanel.tsx
@@ -303,10 +303,10 @@ function MobileSheetTableFilterPanelContent(props: IMobileSheetTableFilterPanelC
"
>
<MobileActionRowGroup>
- <Button onClick={closeDetail} size="extra-large">
+ <Button onClick={closeDetail} size="middle">
{localeService.t<LocaleKey>('sheets-table-ui.filter.cancel')}
</Button>
- <Button variant="primary" onClick={() => applyFilter().catch(() => undefined)} size="extra-large">
+ <Button variant="primary" onClick={() => applyFilter().catch(() => undefined)} size="middle">
{localeService.t<LocaleKey>('sheets-table-ui.filter.confirm')}
</Button>
</MobileActionRowGroup>
diff --git a/packages/sheets-table-ui/src/views/components/MobileSheetTableItemsFilterPanel.tsx b/packages/sheets-table-ui/src/views/components/MobileSheetTableItemsFilterPanel.tsx
index d9158b7035..a3e696fd05 100644
--- a/packages/sheets-table-ui/src/views/components/MobileSheetTableItemsFilterPanel.tsx
+++ b/packages/sheets-table-ui/src/views/components/MobileSheetTableItemsFilterPanel.tsx
@@ -79,8 +79,7 @@ export function MobileSheetTableItemsFilterPanel(props: IMobileSheetTableItemsFi
value={searchText}
placeholder={localeService.t<LocaleKey>('sheets-table-ui.filter.search-placeholder')}
onChange={setSearchText}
- size="large"
- inputClass="univer-text-base"
+ size="small"
/>
<div
className="
@@ -95,7 +94,7 @@ export function MobileSheetTableItemsFilterPanel(props: IMobileSheetTableItemsFi
"
>
<Checkbox
- className="univer-flex univer-min-h-12 univer-items-center"
+ className="univer-flex univer-items-center"
checked={allDisplayedChecked}
indeterminate={!allDisplayedChecked && someDisplayedChecked}
disabled={displayItems.length === 0}
@@ -116,7 +115,7 @@ export function MobileSheetTableItemsFilterPanel(props: IMobileSheetTableItemsFi
"
>
<Checkbox
- className="univer-flex univer-min-h-12 univer-items-center"
+ className="univer-flex univer-items-center"
checked={checkedItemSet.has(itemKey)}
onChange={() => toggleItem(itemKey)}
>
diff --git a/packages/sheets-ui/src/views/mobile/action-panel/MobileStylePanel.tsx b/packages/sheets-ui/src/views/mobile/action-panel/MobileStylePanel.tsx
index 702a7fe70a..63502d82e5 100644
--- a/packages/sheets-ui/src/views/mobile/action-panel/MobileStylePanel.tsx
+++ b/packages/sheets-ui/src/views/mobile/action-panel/MobileStylePanel.tsx
@@ -1016,7 +1016,7 @@ function MobileStyleRootItem(props: { schema: MenuSchemaWithItem; onOpenView: (v
<div
className="
univer-flex univer-min-h-12 univer-items-center univer-justify-center
- [&_button]:!univer-min-h-12 [&_button]:!univer-w-full
+ [&_button]:!univer-w-full
"
>
<ToolbarItem {...item} grid />
diff --git a/packages/sheets-ui/src/views/mobile/menu-item-input/MobileMenuItemInput.tsx b/packages/sheets-ui/src/views/mobile/menu-item-input/MobileMenuItemInput.tsx
index 246f8e5d66..1c4e0e4991 100644
--- a/packages/sheets-ui/src/views/mobile/menu-item-input/MobileMenuItemInput.tsx
+++ b/packages/sheets-ui/src/views/mobile/menu-item-input/MobileMenuItemInput.tsx
@@ -83,7 +83,6 @@ export function MobileMenuItemInput(props: IMenuItemInputProps) {
disabled={disabled}
onKeyDown={handleKeyDown}
onChange={handleChange}
- inputClassName="univer-text-base"
/>
</div>
<span className="univer-min-w-0 univer-truncate univer-text-base univer-font-medium">
@@ -92,7 +91,7 @@ export function MobileMenuItemInput(props: IMenuItemInputProps) {
<Button
type="button"
variant="primary"
- size="large"
+ size="middle"
className="univer-shrink-0"
disabled={disabled || inputValue == null || !Number.isFinite(inputValue)}
onClick={handleConfirm}
diff --git a/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx b/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
index 36bf81032f..5f8e313a04 100644
--- a/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
+++ b/packages/sheets-ui/src/views/mobile/sheet-bar/MobileSheetBar.tsx
@@ -357,7 +357,7 @@ function MobileSheetBarImpl(props: { workbook: Workbook }) {
<Input
autoFocus
disabled={renameDisabled}
- size="large"
+ size="small"
value={renameValue}
onChange={(value) => {
setRenameValue(value);
@@ -368,7 +368,6 @@ function MobileSheetBarImpl(props: { workbook: Workbook }) {
confirmRename();
}
}}
- inputClass="univer-text-base"
/>
{renameError && (
<div
diff --git a/packages/thread-comment-ui/src/views/mobile/MobileThreadCommentPanel.tsx b/packages/thread-comment-ui/src/views/mobile/MobileThreadCommentPanel.tsx
index 06a19f27ae..aab5462130 100644
--- a/packages/thread-comment-ui/src/views/mobile/MobileThreadCommentPanel.tsx
+++ b/packages/thread-comment-ui/src/views/mobile/MobileThreadCommentPanel.tsx
@@ -17,7 +17,7 @@
import type { ISelectProps } from '@univerjs/design';
import type { IThreadComment } from '@univerjs/thread-comment';
import { ICommandService, LocaleService, UniverInstanceType, UserManagerService } from '@univerjs/core';
-import { Button, clsx, MobileActionRowGroup, resetButtonClassName } from '@univerjs/design';
+import { Button, MobileActionRowGroup, Segmented } from '@univerjs/design';
import { IncreaseIcon, MoreLeftIcon } from '@univerjs/icons';
import { ThreadCommentModel } from '@univerjs/thread-comment';
import { useDependency, useObservable } from '@univerjs/ui';
@@ -37,31 +37,16 @@ interface IThreadCommentWithUsers extends IThreadComment {
function MobileCommentFilter({ value, options = [], onChange }: ISelectProps) {
return (
- <div
- className="
- univer-flex univer-gap-1 univer-overflow-x-auto univer-rounded-xl univer-bg-gray-100 univer-p-1
- dark:!univer-bg-gray-800
- "
- >
- {options.flatMap((option) => option.options ?? [option]).map((option) => (
- <button
- key={option.value}
- type="button"
- aria-pressed={option.value === value}
- className={clsx(resetButtonClassName, `
- univer-h-10 univer-shrink-0 univer-rounded-lg univer-px-3 univer-text-sm univer-text-gray-700
- active:univer-scale-95
- dark:!univer-text-gray-200
- `, option.value === value && `
- univer-bg-gray-0 univer-font-medium univer-text-primary-600 univer-shadow-sm
- dark:!univer-bg-gray-700 dark:!univer-text-primary-300
- `)}
- onClick={() => option.value != null && onChange?.(option.value)}
- >
- {option.label}
- </button>
- ))}
- </div>
+ <Segmented
+ className="univer-w-full"
+ value={value}
+ items={options.flatMap((option) => option.options ?? [option]).filter((option) => option.value != null).map((option) => ({
+ label: option.label,
+ value: option.value!,
+ disabled: option.disabled,
+ }))}
+ onChange={onChange}
+ />
);
}
@@ -76,21 +61,14 @@ function MobileCommentHeader({ comment: activeComment, displayRef }: { comment:
dark:!univer-border-gray-700
"
>
- <button
- type="button"
+ <Button
+ size="icon"
+ variant="text"
aria-label={localeService.t<LocaleKey>('thread-comment-ui.mobile.back')}
- className={`
- ${resetButtonClassName}
- univer-flex univer-size-12 univer-shrink-0 univer-items-center univer-justify-center univer-rounded-xl
- univer-text-2xl univer-text-gray-700
- active:univer-bg-gray-100
- dark:!univer-text-gray-200
- dark:active:!univer-bg-gray-700
- `}
onClick={() => commandService.executeCommand(SetActiveCommentOperation.id)}
>
<MoreLeftIcon />
- </button>
+ </Button>
<div className="univer-min-w-0 univer-flex-1">
<div
className="
@@ -119,7 +97,7 @@ function MobileAddComment({ onAdd }: { onAdd: () => void }) {
const localeService = useDependency(LocaleService);
return (
<MobileActionRowGroup className="univer-mt-3">
- <Button className="univer-w-full" onClick={onAdd} size="extra-large">
+ <Button className="univer-w-full" onClick={onAdd} size="middle">
<IncreaseIcon className="univer-mr-1.5" />
{localeService.t<LocaleKey>('thread-comment-ui.panel.addComment')}
</Button>
@@ -360,7 +338,7 @@ export function MobileThreadCommentPanel(props: IThreadCommentPanelProps) {
{isFiltering
? (
<MobileActionRowGroup className="univer-mt-2 univer-flex univer-flex-row">
- <Button onClick={handleReset} size="extra-large">
+ <Button onClick={handleReset} size="middle">
{localeService.t<LocaleKey>('thread-comment-ui.panel.reset')}
</Button>
</MobileActionRowGroup>
diff --git a/packages/ui/src/views/components/dialog-part/MobileDialogPart.tsx b/packages/ui/src/views/components/dialog-part/MobileDialogPart.tsx
index 5cccaab5da..be7c28ebfe 100644
--- a/packages/ui/src/views/components/dialog-part/MobileDialogPart.tsx
+++ b/packages/ui/src/views/components/dialog-part/MobileDialogPart.tsx
@@ -69,8 +69,8 @@ export function MobileDialogPart() {
const footer = options.footer ?? (options.showOk || options.showCancel
? (
<>
- {options.showCancel && <Button onClick={options.onCancel} size="extra-large">{locale?.Confirm.cancel}</Button>}
- {options.showOk && <Button variant="primary" onClick={options.onOk} size="extra-large">{locale?.Confirm.confirm}</Button>}
+ {options.showCancel && <Button onClick={options.onCancel} size="middle">{locale?.Confirm.cancel}</Button>}
+ {options.showOk && <Button variant="primary" onClick={options.onOk} size="middle">{locale?.Confirm.confirm}</Button>}
</>
)
: null);
diff --git a/packages/ui/src/views/components/mobile-drawer/MobileDrawer.tsx b/packages/ui/src/views/components/mobile-drawer/MobileDrawer.tsx
index d5a383aaa7..ed9191a880 100644
--- a/packages/ui/src/views/components/mobile-drawer/MobileDrawer.tsx
+++ b/packages/ui/src/views/components/mobile-drawer/MobileDrawer.tsx
@@ -300,16 +300,11 @@ export function MobileDrawer(props: {
aria-label={ariaLabel}
data-u-comp={componentName}
data-snap={snap}
- // Small form text triggers iOS focus zoom. Keep this local to mobile
- // drawers, without overriding document/contenteditable text styles.
className={clsx(`
univer-absolute univer-inset-x-0 univer-bottom-0 univer-z-20 univer-flex univer-flex-col
univer-overflow-hidden univer-rounded-t-[24px] univer-bg-gray-50 univer-shadow-2xl
univer-transition-[height] univer-duration-200
dark:!univer-bg-gray-900
- [&_input]:!univer-text-base
- [&_select]:!univer-text-base
- [&_textarea]:!univer-text-base
`, 'univer-pointer-events-auto', dragPercent != null && '!univer-transition-none', panelClassName)}
style={{
height: autoHeight ? 'auto' : `${drawerPercent}${viewportHeightUnit}`,
diff --git a/packages/ui/src/views/components/ribbon/MobileRibbon.tsx b/packages/ui/src/views/components/ribbon/MobileRibbon.tsx
index 2fc0480d63..22a58b5953 100644
--- a/packages/ui/src/views/components/ribbon/MobileRibbon.tsx
+++ b/packages/ui/src/views/components/ribbon/MobileRibbon.tsx
@@ -440,9 +440,8 @@ function MobileCompactTopBar(props: IMobileRibbonProps & { ribbon: IMenuSchema[]
className="
univer-w-full
[&>span]:univer-block [&>span]:univer-w-full
- [&_button]:!univer-h-12 [&_button]:!univer-w-full [&_button]:!univer-justify-start
- [&_button]:!univer-gap-3 [&_button]:!univer-rounded-xl [&_button]:!univer-px-4
- [&_button]:!univer-text-base
+ [&_button]:!univer-w-full [&_button]:!univer-justify-start [&_button]:!univer-gap-3
+ [&_button]:!univer-rounded-xl [&_button]:!univer-px-4
"
onClick={() => setMoreOpen(false)}
>
@@ -467,7 +466,7 @@ function MobileCompactTopBar(props: IMobileRibbonProps & { ribbon: IMenuSchema[]
<div
className="
univer-flex univer-items-center univer-gap-1
- [&_button]:!univer-min-h-10 [&_button]:!univer-min-w-10 [&_button]:!univer-rounded-lg
+ [&_button]:!univer-min-w-10 [&_button]:!univer-rounded-lg
[&_button_svg]:!univer-size-5
"
>
diff --git a/packages/ui/src/views/font-family/MobileFontFamilyDropdown.tsx b/packages/ui/src/views/font-family/MobileFontFamilyDropdown.tsx
index 94a07ab2f7..da960f00f0 100644
--- a/packages/ui/src/views/font-family/MobileFontFamilyDropdown.tsx
+++ b/packages/ui/src/views/font-family/MobileFontFamilyDropdown.tsx
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import type { IFontFamilyDropdownProps } from './FontFamilyDropdown';
import { LocaleService } from '@univerjs/core';
import { clsx, MobileSelect } from '@univerjs/design';
+import type { IFontFamilyDropdownProps } from './FontFamilyDropdown';
import { useDependency, useObservable } from '../../utils/di';
import { useFontList } from './use-font-list';
@@ -27,11 +27,12 @@ export function MobileFontFamilyDropdown(props: IFontFamilyDropdownProps) {
return (
<MobileSelect
aria-label={props.ariaLabel}
- className={clsx('univer-h-12 univer-w-full univer-min-w-0 univer-text-base', props.className)}
+ className={clsx('univer-w-full univer-min-w-0', props.className)}
value={props.value}
disabled={!!(props.disabled || disabled)}
options={fonts.map((font) => ({ value: font.value, label: localeService.t(font.label) }))}
onChange={props.onChange}
+ size="small"
/>
);
}