Skip to content

Commit ff20656

Browse files
committed
Merge branch 'fix/form-control-max-width' into rc
2 parents 471349c + 73b9077 commit ff20656

14 files changed

Lines changed: 37 additions & 19 deletions

File tree

docs/INSTALLATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Install SGDS web components locally with the following command
88

99
```js
1010

11-
npm install @govtechsg/sgds-web-component@3.16.0
11+
npm install @govtechsg/sgds-web-component@3.16.1-rc.2
1212

1313
```
1414

@@ -53,14 +53,14 @@ This method registers all SGDS elements up front in the Custom Elements Registry
5353
5454
```js
5555
// Load global css file
56-
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.0/themes/day.css' rel='stylesheet' type='text/css' />
57-
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.0/css/sgds.css' rel='stylesheet' type='text/css' />
56+
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.1-rc.2/themes/day.css' rel='stylesheet' type='text/css' />
57+
<link href='https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.1-rc.2/css/sgds.css' rel='stylesheet' type='text/css' />
5858

5959
// it is recommended to load a particular version when using cdn e.g. https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@1.0.2
60-
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.0" async crossorigin="anonymous" integrity="sha384-F5LRLloHEK6tuoYtNQ9dlphntGhb0cHew2heUM9CUG9V9d+xqweQZCbSSfYPgkPu"></script>
60+
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.1-rc.2" async crossorigin="anonymous" integrity="sha384-Fac1dcR+ZUsXkpuxOsemc5Ld/Pu6/sHkOKu3fZg/ckl5nxa9o+CQ2gdETEadyjJs"></script>
6161

6262
//or load a single component e.g. Masthead
63-
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.0/components/Masthead/index.umd.min.js" async crossorigin="anonymous" integrity="sha384-ITgmRQ1eDoGTKD6ytTZVquH/6jBLIuZzFPDjUVaN525LjuJl3zngwzf/hYiDgJbn"></script>
63+
<script src="https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@3.16.1-rc.2/components/Masthead/index.umd.min.js" async crossorigin="anonymous" integrity="sha384-NTZt1tFTkbhjjHYUtbUDmLqrKG7WmyhNCm1QhFxafmpPq2e7ozALWTPLO2DhBTSP"></script>
6464

6565
```
6666

src/components/ComboBox/combo-box.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
.combobox .form-control-group {
3131
min-height: var(--sgds-dimension-48);
32-
min-width: var(--sgds-dimension-256);
3332
height: unset;
3433
}
3534

src/components/ComboBox/sgds-combo-box.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,12 @@ export class SgdsComboBox extends SelectElement {
525525
(this.isFocused || this.menuIsOpen) && this.value !== "" && this.clearable && !this.readonly;
526526
return html`
527527
<div
528-
class=${classMap({ "form-control-container": true, disabled: this.disabled, combobox: true })}
528+
class=${classMap({
529+
"form-control-container": true,
530+
"m-width-256": true,
531+
disabled: this.disabled,
532+
combobox: true
533+
})}
529534
@keydown=${this._handleMultiSelectKeyDown}
530535
>
531536
${this._renderLabel()}

src/components/Datepicker/datepicker.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ sgds-icon-button{
3535
--btn-border-radius: 0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0;
3636
}
3737

38+
.m-width-160 {
39+
min-width: var(--sgds-dimension-160);
40+
}
41+
3842
.datepicker-container {
3943
display: flex;
4044
}

src/components/Datepicker/sgds-datepicker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export class SgdsDatepicker extends SgdsFormValidatorMixin(DropdownElement) impl
421421

422422
render() {
423423
return html`
424-
<div class="datepicker-container">
424+
<div class="datepicker-container m-width-160">
425425
<sgds-datepicker-input
426426
.value=${live(this.value)}
427427
?required=${this.required}

src/components/Input/sgds-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class SgdsInput extends SgdsFormValidatorMixin(FormControlElement) implem
297297
render() {
298298
return html`
299299
<div
300-
class="form-control-container ${classMap({
300+
class="form-control-container m-width-160 ${classMap({
301301
disabled: this.disabled
302302
})}"
303303
>

src/components/QuantityToggle/sgds-quantity-toggle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class SgdsQuantityToggle extends SgdsFormValidatorMixin(FormControlElemen
230230

231231
render() {
232232
return html`
233-
<div class="form-control-container">
233+
<div class="form-control-container m-width-256">
234234
${this._renderLabel()}
235235
<div class="input-group">
236236
<sgds-icon-button

src/components/Select/sgds-select.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ export class SgdsSelect extends SelectElement {
209209
class=${classMap({
210210
disabled: this.disabled,
211211
select: true,
212-
"form-control-container": true
212+
"form-control-container": true,
213+
"m-width-160": true
213214
})}
214215
>
215216
${this._renderLabel()}

src/components/Textarea/sgds-textarea.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class SgdsTextarea extends SgdsFormValidatorMixin(FormControlElement) imp
202202
render() {
203203
return html`
204204
<div
205-
class="form-control-container ${classMap({
205+
class="form-control-container m-width-256 ${classMap({
206206
disabled: this.disabled
207207
})}"
208208
>

src/styles/form-text-control.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
gap: var(--sgds-form-gap-md);
1111
}
1212

13+
.m-width-160 {
14+
min-width: var(--sgds-dimension-160);
15+
}
16+
17+
.m-width-256 {
18+
min-width: var(--sgds-dimension-256);
19+
}
20+
1321
.form-control-group {
1422
display: flex;
1523
align-items: center;
@@ -36,6 +44,7 @@
3644
padding: 0;
3745
flex-grow: 1;
3846
min-width: 0;
47+
width: 100%;
3948
color: var(--sgds-form-color-default);
4049
font-size: var(--sgds-font-size-16);
4150
line-height: var(--sgds-line-height-24);

0 commit comments

Comments
 (0)