File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
second-gen/packages/core/components/divider Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { property } from 'lit/decorators.js';
1515
1616import { SizedMixin , SpectrumElement } from '@swc/core/shared/base' ;
1717
18- import { DIVIDER_VALID_SIZES } from './Divider.consts' ;
18+ import { DIVIDER_STATIC_COLORS , DIVIDER_VALID_SIZES } from './Divider.consts' ;
1919import type { DividerStaticColor } from './Divider.types' ;
2020
2121/**
@@ -35,7 +35,23 @@ export abstract class DividerBase extends SizedMixin(SpectrumElement, {
3535 * The static color variant to use for the divider.
3636 */
3737 @property ( { reflect : true , attribute : 'static-color' } )
38- public staticColor ?: DividerStaticColor ;
38+ public get staticColor ( ) : DividerStaticColor | undefined {
39+ return this . _staticColor ;
40+ }
41+
42+ public set staticColor ( value : DividerStaticColor | undefined ) {
43+ if (
44+ value != null &&
45+ ! ( DIVIDER_STATIC_COLORS as readonly string [ ] ) . includes ( value )
46+ ) {
47+ // Silently ignore invalid values
48+ this . _staticColor = undefined ;
49+ return ;
50+ }
51+ this . _staticColor = value ;
52+ }
53+
54+ private _staticColor ?: DividerStaticColor ;
3955
4056 protected override firstUpdated ( changed : PropertyValues < this> ) : void {
4157 super . firstUpdated ( changed ) ;
You can’t perform that action at this time.
0 commit comments