Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/five-toes-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**dropdown**: change spinner circle background to white
5 changes: 5 additions & 0 deletions .changeset/popular-pants-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**segment**: add auto invalid option for angular
5 changes: 5 additions & 0 deletions .changeset/silent-ducks-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**dropdown**: remove hover & active styles for disabled state
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,10 @@ export namespace Components {
"verticalOnMobile": boolean;
}
interface BalSegment {
/**
* If `true`, in Angular reactive forms the control will not be set invalid
*/
"autoInvalidOff": boolean;
/**
* If `true`, the user cannot interact with the segment.
*/
Expand Down Expand Up @@ -7812,6 +7816,10 @@ declare namespace LocalJSX {
"verticalOnMobile"?: boolean;
}
interface BalSegment {
/**
* If `true`, in Angular reactive forms the control will not be set invalid
*/
"autoInvalidOff"?: boolean;
/**
* If `true`, the user cannot interact with the segment.
*/
Expand Down
11 changes: 8 additions & 3 deletions packages/core/src/components/bal-dropdown/bal-dropdown.sass
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@
min-height: 2rem

.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded)

border: none
background: var(--bal-color-background-grey-light)

.bal-dropdown__root--theme-purple:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled)
+hover
&:hover
background: var(--bal-color-purple-1)
Expand All @@ -197,6 +200,8 @@
.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded)
border: none
background: var(--bal-color-purple-2)

.bal-dropdown__root--theme-purple-filled:not(.bal-dropdown__root--theme-purple-expanded):not(.bal-dropdown__root--disabled)
+hover
&:hover
background: var(--bal-color-purple-3)
Expand All @@ -213,9 +218,9 @@
.bal-icon__inner
+fillSvg(var(--bal-color-text-primary))

.bal-dropdown__root--theme-purple-expanded,
.bal-dropdown__root--theme-purple-expanded:hover,
.bal-dropdown__root--theme-purple-expanded:active
.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled),
.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):hover,
.bal-dropdown__root--theme-purple-expanded:not(.bal-dropdown__root--disabled):active
border: none
background: var(--bal-color-purple-2)
.bal-dropdown__root__input,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,26 +206,50 @@ <h2 class="title text-large">Form Field</h2>
</bal-field>
</section>
<h2 class="title text-large">Small Purple Theme</h2>
<section data-testid="small-purple" class="bg-white p-large gap-normal flex">
<bal-dropdown placeholder="Leistung" clearable inline-label="Leistung" size="small" theme="purple">
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
<bal-dropdown
value="v140"
placeholder="Leistung"
clearable
inline-label="Leistung"
size="small"
theme="purple"
>
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
<section data-testid="small-purple" class="bg-white p-large gap-normal flex flex-direction-column">
<section class="bg-white gap-normal flex m-none">
<bal-dropdown placeholder="Leistung" clearable inline-label="Leistung" size="small" theme="purple">
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
<bal-dropdown
value="v140"
placeholder="Leistung"
clearable
inline-label="Leistung"
size="small"
theme="purple"
>
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
</section>
<section class="bg-white gap-normal flex m-none">
<bal-dropdown placeholder="Leistung" clearable disabled inline-label="Leistung" size="small" theme="purple">
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
<bal-dropdown
value="v140"
placeholder="Leistung"
clearable
loading
inline-label="Leistung"
size="small"
theme="purple"
>
<bal-option value="v100" label="100 PS">100 PS</bal-option>
<bal-option value="v140" label="140 PS">140 PS</bal-option>
<bal-option value="v165" label="165 PS">165 PS</bal-option>
<bal-option value="v210" label="210 PS">210 PS</bal-option>
</bal-dropdown>
</section>
</section>
</main>
</bal-doc-app>
Expand Down
45 changes: 25 additions & 20 deletions packages/core/src/components/bal-segment/bal-segment.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import {
Component,
h,
ComponentInterface,
Host,
Element,
Prop,
Event,
EventEmitter,
Watch,
State,
writeTask,
h,
Host,
Listen,
Method,
Prop,
State,
Watch,
writeTask,
} from '@stencil/core'
import { BalAnimationObserver, ListenToAnimation } from '../../utils/animation'
import { BEM } from '../../utils/bem'
import { SegmentValue } from './bal-segment.types'
import { Logger, LogInstance } from '../../utils/log'
import { BalBreakpointObserver, BalBreakpoints, ListenToBreakpoints } from '../../utils/breakpoints'
import { BalFocusObserver, ListenToFocus } from '../../utils/focus'
import { FOCUS_KEYS } from '../../utils/focus-visible'
import { BalAriaForm, defaultBalAriaForm } from '../../utils/form'
import { stopEventBubbling } from '../../utils/form-input'
import { raf } from '../../utils/helpers'
import {
isArrowDownKey,
isArrowUpKey,
isSpaceKey,
isHomeKey,
isEndKey,
isArrowLeftKey,
isArrowRightKey,
isArrowUpKey,
isEndKey,
isEnterKey,
isHomeKey,
isSpaceKey,
} from '../../utils/keyboard'
import { stopEventBubbling } from '../../utils/form-input'
import { FOCUS_KEYS } from '../../utils/focus-visible'
import { ListenToWindowResize, BalWindowResizeObserver } from '../../utils/resize'
import { isDescendant, raf } from '../../utils/helpers'
import { BalBreakpointObserver, BalBreakpoints, ListenToBreakpoints } from '../../utils/breakpoints'
import { BalFocusObserver, ListenToFocus } from '../../utils/focus'
import { defaultBalAriaForm, BalAriaForm } from '../../utils/form'
import { Logger, LogInstance } from '../../utils/log'
import { BalWindowResizeObserver, ListenToWindowResize } from '../../utils/resize'
import { BalVisibilityObserver, ListenToVisibility } from '../../utils/visibility'
import { BalAnimationObserver, ListenToAnimation } from '../../utils/animation'
import { SegmentValue } from './bal-segment.types'

@Component({
tag: 'bal-segment',
Expand Down Expand Up @@ -75,6 +75,11 @@ export class Segment
*/
@Prop() invalid = false

/**
* If `true`, in Angular reactive forms the control will not be set invalid
*/
@Prop({ reflect: true }) autoInvalidOff = false

/**
* If `true`, the user cannot interact with the segment.
*/
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/utils/dropdown/icon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionalComponent, h } from '@stencil/core'
import { BalLanguage } from '../config'
import { BEM } from '../bem'
import { BalLanguage } from '../config'
import { i18nBalDropdown } from './dropdown.i18n'

export interface DropdownIconProps {
Expand Down Expand Up @@ -31,7 +31,9 @@ export const DropdownIcon: FunctionalComponent<DropdownIconProps> = ({
const block = BEM.block('dropdown')

if (loading) {
return <bal-spinner class={{ ...block.element('rear').class() }} small variation="circle"></bal-spinner>
return (
<bal-spinner class={{ ...block.element('rear').class() }} small variation="circle" color="white"></bal-spinner>
)
} else if (clearable && filled && !disabled) {
return (
<button
Expand Down