Skip to content

Commit

Permalink
Update components
Browse files Browse the repository at this point in the history
Refs: #7178
  • Loading branch information
sdvg committed Jan 17, 2025
1 parent c6b438f commit 597451a
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 80 deletions.
2 changes: 2 additions & 0 deletions packages/components/src/components/a11y.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '@shared/mixins';

/*
* This file contains all rules for accessibility.
*/
Expand Down
9 changes: 2 additions & 7 deletions packages/components/src/components/input-date/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;

@layer kol-component {
.kol-input-number {
display: block;
}
}
@include kol-input;
4 changes: 3 additions & 1 deletion packages/components/src/components/input-email/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-input;
8 changes: 5 additions & 3 deletions packages/components/src/components/input-file/style.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-input;

@layer kol-component {
:host {
font-size: rem(16);
.kol-input {
padding: calc((var(--a11y-min-size) - rem(16)) / 10) 0.5em;
}
}
3 changes: 1 addition & 2 deletions packages/components/src/components/input-line.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@import './legacy-input';

@layer kol-component {
input:not([type='checkbox'], [type='radio']),
select:not([multiple], [size]) {
input:not([type='checkbox'], [type='radio']) {
height: 2.75em;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/components/input-number/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-input;
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class KolInputPassword implements InputPasswordAPI, FocusableElement {
return (
<KolIconButtonFc
componentName="button"
class="password-toggle-button"
class="kol-input-password__password-toggle-button"
label={this._passwordVisible ? translate('kol-hide-password') : translate('kol-show-password')}
variant="ghost"
onClick={(): void => {
Expand Down
11 changes: 4 additions & 7 deletions packages/components/src/components/input-password/style.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-input;

@layer kol-component {
.password-toggle-button {
position: absolute;
transform: translateX(-100%);
}

.kol-tooltip-wc {
.kol-input-password {
--kol-tooltip-width: #{rem(160)};
}
}
4 changes: 2 additions & 2 deletions packages/components/src/components/input-range/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ export class KolInputRange implements InputRangeAPI, FocusableElement {
<KolFormFieldStateWrapperFc {...this.getFormFieldProps()}>
<KolInputContainerFc state={this.state}>
<div class="kol-input-range__inputs-wrapper" style={inputsWrapperStyle}>
<KolInputStateWrapperFc {...this.getInputRangeProps()} />
<KolInputStateWrapperFc {...this.getInputNumberProps()} />
<KolInputStateWrapperFc class="kol-input-range__input kol-input-range__input--range" {...this.getInputRangeProps()} />
<KolInputStateWrapperFc class="kol-input-range__input kol-input-range__input--number" {...this.getInputNumberProps()} />
</div>
{this.hasSuggestions && <KolSuggestionsFc id={this.state._id} suggestions={this.state._suggestions} />}
</KolInputContainerFc>
Expand Down
83 changes: 40 additions & 43 deletions packages/components/src/components/input-range/style.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-input;

@layer kol-component {
.kol-input-range {
Expand All @@ -15,55 +17,50 @@
display: flex;
flex-direction: row;
flex-grow: 1;
}

.kol-input {
&[type='number'] {
min-height: var(--a11y-min-size);
min-width: var(--a11y-min-size);
width: var(--kolibri-input-range--input-number--width);
}
&__input {
&--number {
width: var(--kolibri-input-range--input-number--width);
}

&[type='range'] {
appearance: none;
background-color: #d3d3d3;
border: rem(1) solid #000;
display: inline-block;
flex-grow: 1;
height: rem(8);
line-height: 1.5;
padding: 0;
margin: 0;
/* Design-Hack - related with flex-grow */
width: 0;
&--range {
appearance: none;
background-color: #d3d3d3;
border: rem(1) solid #000;
display: inline-block;
flex-grow: 1;
height: rem(8);
line-height: 1.5;
padding: 0;
margin: 0;
/* Design-Hack - related with flex-grow */
width: 0;

&::-webkit-slider-thumb {
box-sizing: border-box;
background-color: #000;
height: rem(20);
width: rem(20);
border-radius: rem(20);
cursor: pointer;
-webkit-appearance: none;
}
&::-webkit-slider-thumb {
box-sizing: border-box;
background-color: #000;
height: rem(20);
width: rem(20);
border-radius: rem(20);
cursor: pointer;
-webkit-appearance: none;

&::-moz-range-thumb {
box-sizing: border-box;
background-color: #000;
height: rem(20);
width: rem(20);
border-radius: rem(20);
cursor: pointer;
-moz-appearance: none;
@media (prefers-contrast: more) or (forced-colors: active) {
outline: rem(1) solid currentColor;
}
}
}
}
}

/* Fix missing outline in Chromium-based browsers on Windows in high contrast mode. */
@media (prefers-contrast: more) {
::-webkit-slider-thumb {
outline: rem(1) solid currentColor;
&::-moz-range-thumb {
box-sizing: border-box;
background-color: #000;
height: rem(20);
width: rem(20);
border-radius: rem(20);
cursor: pointer;
-moz-appearance: none;
}
}
}
}
}
6 changes: 4 additions & 2 deletions packages/components/src/components/input-text/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
@include kol-input-container;
@include kol-alert;
@include kol-input;
10 changes: 0 additions & 10 deletions packages/components/src/components/legacy-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,4 @@
font-size: rem(16);
width: 100%;
}

/* needed hack for vertical alignment */
input[type='file'] {
padding: calc((var(--a11y-min-size) - rem(16)) / 10) 0.5em;
}

/* needed hack for vertical alignment */
select[multiple] option {
padding: calc((var(--a11y-min-size) - rem(16)) / 2) 0.5em;
}
}
14 changes: 13 additions & 1 deletion packages/components/src/components/select/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../../styles/kol-form-field-mixin';
@import '../../styles/kol-input-container-mixin';
@import '../../styles/kol-input-mixin';
@import '../@shared/mixins';
@import '../input-line';

@include kol-alert;
@include kol-form-field;
Expand All @@ -11,9 +12,20 @@
@layer kol-component {
.kol-select {
font-size: rem(16);
cursor: pointer;
width: 100%;

&:not([multiple], [size]) {
height: 2.75em;
}

&__option:checked::before {
content: '';
}

/* needed hack for vertical alignment */
&[multiple] option {
padding: calc((var(--a11y-min-size) - rem(16)) / 2) 0.5em;
}
}
}

0 comments on commit 597451a

Please sign in to comment.