Skip to content

Commit 10a8326

Browse files
authored
style: design updates - Input border-radius and remove Button large size (#4786)
Apply Figma design updates: change Input border-radius from None to Rounded, and remove the large size variant from Button. Closes #4784
1 parent d2f086e commit 10a8326

8 files changed

Lines changed: 38 additions & 73 deletions

File tree

packages/eds-core-react/src/components/next/Button/Button.docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { add, chevron_right } from '@equinor/eds-icons'
5555

5656
### Sizes
5757

58-
Three sizes are available: `small` (24px spacious / 20px comfortable), `default` (36px spacious / 24px comfortable), and `large` (44px spacious / 36px comfortable).
58+
Two sizes are available: `small` (24px spacious / 20px comfortable) and `default` (36px spacious / 24px comfortable).
5959

6060
<Canvas of={ComponentStories.Sizes} />
6161

packages/eds-core-react/src/components/next/Button/Button.figma.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ figma.connect(
2929
}),
3030
geometry: figma.nestedProps('.Geometry Options', {
3131
size: figma.enum('Size', {
32-
Large: 'large',
3332
Default: 'default',
3433
Small: 'small',
3534
}),
@@ -88,7 +87,6 @@ figma.connect(
8887
}),
8988
geometry: figma.nestedProps('.Geometry Options', {
9089
size: figma.enum('Size', {
91-
Large: 'large',
9290
Default: 'default',
9391
Small: 'small',
9492
}),

packages/eds-core-react/src/components/next/Button/Button.stories.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const meta: Meta<StoryArgs> = {
2626
},
2727
size: {
2828
control: 'select',
29-
options: ['small', 'default', 'large'],
29+
options: ['small', 'default'],
3030
description: 'Button size',
3131
},
3232
tone: {
@@ -106,7 +106,6 @@ export const Sizes: Story = {
106106
<Wrapper direction="row" align="center">
107107
<Button size="small">Small</Button>
108108
<Button size="default">Default</Button>
109-
<Button size="large">Large</Button>
110109
</Wrapper>
111110
),
112111
}
@@ -244,10 +243,6 @@ export const AllVariants: Story = {
244243
<Icon data={add} aria-hidden />
245244
Default
246245
</Button>
247-
<Button variant={variant} tone={color} size="large">
248-
<Icon data={add} aria-hidden />
249-
Large
250-
</Button>
251246
</Wrapper>
252247
))}
253248
</Wrapper>
@@ -299,9 +294,6 @@ export const IconOnly: Story = {
299294
<Button icon aria-label="Add" size="default">
300295
<Icon data={add} aria-hidden />
301296
</Button>
302-
<Button icon aria-label="Add" size="large">
303-
<Icon data={add} aria-hidden />
304-
</Button>
305297
</Wrapper>
306298
),
307299
parameters: {
@@ -362,9 +354,6 @@ export const CircularIconOnly: Story = {
362354
<Button icon round aria-label="Add" size="default">
363355
<Icon data={add} aria-hidden />
364356
</Button>
365-
<Button icon round aria-label="Add" size="large">
366-
<Icon data={add} aria-hidden />
367-
</Button>
368357
</Wrapper>
369358
<Wrapper direction="row" align="center">
370359
<Button variant="primary" icon round aria-label="Add">
@@ -398,33 +387,25 @@ export const DensityComparison: Story = {
398387
<Wrapper direction="row" align="center" gap={12}>
399388
<Button size="small">Small</Button>
400389
<Button size="default">Default</Button>
401-
<Button size="large">Large</Button>
402390
<Button size="small" icon aria-label="Add">
403391
<Icon data={add} aria-hidden />
404392
</Button>
405393
<Button size="default" icon aria-label="Add">
406394
<Icon data={add} aria-hidden />
407395
</Button>
408-
<Button size="large" icon aria-label="Add">
409-
<Icon data={add} aria-hidden />
410-
</Button>
411396
</Wrapper>
412397
</div>
413398
<div data-density="comfortable">
414399
<h3 style={{ marginBottom: '12px' }}>Comfortable</h3>
415400
<Wrapper direction="row" align="center" gap={12}>
416401
<Button size="small">Small</Button>
417402
<Button size="default">Default</Button>
418-
<Button size="large">Large</Button>
419403
<Button size="small" icon aria-label="Add">
420404
<Icon data={add} aria-hidden />
421405
</Button>
422406
<Button size="default" icon aria-label="Add">
423407
<Icon data={add} aria-hidden />
424408
</Button>
425-
<Button size="large" icon aria-label="Add">
426-
<Icon data={add} aria-hidden />
427-
</Button>
428409
</Wrapper>
429410
</div>
430411
</Wrapper>

packages/eds-core-react/src/components/next/Button/Button.test.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ describe('Button (next)', () => {
5757
)
5858
})
5959

60-
it('renders with large size', () => {
61-
render(<Button size="large">Large</Button>)
62-
expect(screen.getByRole('button')).toHaveAttribute(
63-
'data-selectable-space',
64-
'lg',
65-
)
66-
})
67-
6860
it('renders with accent tone', () => {
6961
render(<Button tone="accent">Accent</Button>)
7062
expect(screen.getByRole('button')).toHaveAttribute(
@@ -313,7 +305,6 @@ describe('Button (next)', () => {
313305
it.each([
314306
['small', 'sm'],
315307
['default', 'md'],
316-
['large', 'lg'],
317308
] as const)(
318309
'renders %s size with data-selectable-space=%s',
319310
(size, expected) => {
@@ -419,16 +410,6 @@ describe('Button (next)', () => {
419410
expect(button).toHaveAttribute('data-selectable-space', 'sm')
420411
})
421412

422-
it('uses selectable space tokens for icon-only (large size)', () => {
423-
render(
424-
<Button icon aria-label="Add" size="large">
425-
<MockIcon />
426-
</Button>,
427-
)
428-
const button = screen.getByRole('button')
429-
expect(button).toHaveAttribute('data-selectable-space', 'lg')
430-
})
431-
432413
it('uses selectable space tokens for regular button', () => {
433414
render(
434415
<Button>
@@ -449,7 +430,7 @@ describe('Button (next)', () => {
449430
expect(screen.getByTestId('mock-icon')).toBeInTheDocument()
450431
})
451432

452-
it.each(['small', 'default', 'large'] as const)(
433+
it.each(['small', 'default'] as const)(
453434
'renders icon-only with %s size',
454435
(size) => {
455436
render(

packages/eds-core-react/src/components/next/Button/Button.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { TypographyNext } from '../../Typography'
55
const SIZE_MAPPING = {
66
small: 'sm',
77
default: 'md',
8-
large: 'lg',
98
} as const
109

1110
const sizeToTypography = SIZE_MAPPING

packages/eds-core-react/src/components/next/Button/Button.types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ export type ButtonVariant = 'primary' | 'secondary' | 'ghost'
1212
* Button size options
1313
* - `small`: Compact size (24px height)
1414
* - `default`: Standard size (36px height)
15-
* - `large`: Generous size (44px height)
1615
*/
17-
export type ButtonSize = 'small' | 'default' | 'large'
16+
export type ButtonSize = 'small' | 'default'
1817

1918
/**
2019
* Color tone for theming

packages/eds-core-react/src/components/next/Button/button.css

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@
2929
* Button height is controlled by min-height.
3030
* The span keeps its natural line-height and is centered by flexbox.
3131
*
32-
* Spacious (default): sm=24px, md=36px, lg=44px
33-
* Comfortable: sm=20px, md=24px, lg=36px
32+
* Spacious (default): sm=24px, md=36px
33+
* Comfortable: sm=20px, md=24px
3434
*/
3535

36-
.eds-button[data-selectable-space='lg'] {
37-
gap: var(--eds-typography-gap-horizontal);
38-
min-height: 2.75rem; /* 44px */
39-
padding-inline: var(--eds-selectable-space-horizontal);
40-
}
41-
4236
.eds-button[data-selectable-space='md'] {
4337
gap: var(--eds-typography-gap-horizontal);
4438
min-height: 2.25rem; /* 36px */
@@ -53,10 +47,6 @@
5347

5448
/* Comfortable density */
5549

56-
[data-density='comfortable'] .eds-button[data-selectable-space='lg'] {
57-
min-height: 2.25rem; /* 36px */
58-
}
59-
6050
[data-density='comfortable'] .eds-button[data-selectable-space='md'] {
6151
min-height: 1.5rem; /* 24px */
6252
}

packages/eds-core-react/src/components/next/Input/input.css

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,45 @@
33
.eds-input-container {
44
/* Temporary alias until proper input background token is available */
55
--_bg-input: var(--eds-color-bg-canvas);
6+
67
/* Temporary alias until proper readonly text token is available */
78
--_readonly-text-color: var(--eds-color-border-strong);
89

910
isolation: isolate;
11+
1012
display: flex;
1113
flex-direction: row;
12-
align-items: center;
1314
gap: var(--eds-typography-gap-horizontal);
15+
align-items: center;
16+
1417
box-sizing: border-box;
1518
inline-size: 100%;
19+
padding-block: var(--eds-selectable-space-vertical);
20+
padding-inline: var(--eds-selectable-space-horizontal);
21+
border-radius: var(--eds-spacing-border-radius-rounded, 4px);
22+
1623
background: var(--_bg-input);
24+
1725
/* Outline instead of border to not affect height calculation */
1826
outline: var(--eds-sizing-stroke-thin) solid var(--eds-color-border-subtle);
1927
outline-offset: calc(-1 * var(--eds-sizing-stroke-thin));
20-
border-radius: var(--eds-spacing-border-radius-none);
21-
padding-inline: var(--eds-selectable-space-horizontal);
22-
padding-block: var(--eds-selectable-space-vertical);
28+
2329
transition:
2430
background-color 150ms,
2531
outline-color 150ms;
2632

27-
&:hover:not([data-disabled]):not([data-readonly]) {
33+
&:hover:not([data-disabled], [data-readonly]) {
2834
outline-color: var(--eds-color-border-strong);
2935

3036
& .eds-input {
3137
color: var(--eds-color-text-strong);
38+
3239
/* Safari autofill override */
3340
-webkit-text-fill-color: var(--eds-color-text-strong);
3441

3542
&::placeholder {
3643
color: var(--eds-color-text-strong);
44+
3745
/* Safari autofill override */
3846
-webkit-text-fill-color: var(--eds-color-text-strong);
3947
}
@@ -66,14 +74,16 @@
6674
outline-color: transparent;
6775

6876
& .eds-input {
69-
color: var(--eds-color-text-disabled);
7077
cursor: not-allowed;
78+
color: var(--eds-color-text-disabled);
7179
opacity: 1;
80+
7281
/* Safari autofill override */
7382
-webkit-text-fill-color: var(--eds-color-text-disabled);
7483

7584
&::placeholder {
7685
color: var(--eds-color-text-disabled);
86+
7787
/* Safari autofill override */
7888
-webkit-text-fill-color: var(--eds-color-text-disabled);
7989
}
@@ -92,6 +102,7 @@
92102

93103
& .eds-input {
94104
color: var(--_readonly-text-color);
105+
95106
/* Safari autofill override */
96107
-webkit-text-fill-color: var(--_readonly-text-color);
97108
}
@@ -112,37 +123,43 @@
112123
.eds-input {
113124
--_placeholder-text-color: var(--eds-color-text-subtle);
114125

126+
resize: none;
127+
128+
overflow: hidden;
115129
flex: 1;
130+
116131
min-inline-size: 0;
132+
padding: 0;
117133
border: var(--eds-sizing-stroke-none);
118-
background: transparent;
119-
outline: none;
134+
120135
color: var(--eds-color-text-strong);
121-
padding: 0;
122-
overflow: hidden;
123-
white-space: nowrap;
124136
text-overflow: ellipsis;
125-
resize: none;
137+
white-space: nowrap;
138+
139+
background: transparent;
140+
outline: none;
126141

127142
&::placeholder {
128143
color: var(--_placeholder-text-color);
144+
129145
/* Safari autofill override */
130146
-webkit-text-fill-color: var(--_placeholder-text-color);
131147
}
132148
}
133149

134150
/* Error icon */
135151
.eds-error-icon {
136-
color: var(--eds-color-text-subtle);
137152
flex-shrink: 0;
153+
color: var(--eds-color-text-subtle);
138154
}
139155

140156
/* Adornments container */
141157
.eds-adornment {
142158
display: flex;
143-
align-items: center;
144-
gap: var(--eds-typography-gap-horizontal);
145159
flex-shrink: 0;
160+
gap: var(--eds-typography-gap-horizontal);
161+
align-items: center;
162+
146163
color: var(--eds-color-text-subtle);
147164
}
148165

0 commit comments

Comments
 (0)