File tree 5 files changed +25
-11
lines changed
boxel-ui/addon/src/components
5 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import IconButton from '../icon-button/index.gts';
10
10
11
11
interface Signature {
12
12
Args: {
13
- color: string ;
14
- onChange: (color : string ) => void ;
13
+ color: string | null ;
14
+ onChange: (color : string | null ) => void ;
15
15
};
16
16
Element: HTMLDivElement ;
17
17
}
@@ -62,7 +62,7 @@ export default class ColorPalette extends Component<Signature> {
62
62
@ width =' 16px'
63
63
@ height =' 16px'
64
64
class =' remove'
65
- {{on ' click' ( fn @ onChange ' ' ) }}
65
+ {{on ' click' ( fn @ onChange null ) }}
66
66
aria-label =' Unset color'
67
67
/>
68
68
</div >
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import FreestyleUsage from 'ember-freestyle/components/freestyle/usage';
6
6
import ColorPalette from ' ./index.gts' ;
7
7
8
8
export default class ColorPaletteUsage extends Component {
9
- @tracked color = ' ' ;
9
+ @tracked color: string | null = null ;
10
10
11
- private handleColorChange = (newColor : string ) => {
11
+ private handleColorChange = (newColor : string | null ) => {
12
12
this .color = newColor ;
13
13
};
14
14
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ import Component from '@glimmer/component';
3
3
4
4
interface Signature {
5
5
Args: {
6
- color: string ;
6
+ color: string | null ;
7
7
disabled? : boolean ;
8
- onChange: (color : string ) => void ;
8
+ onChange: (color : string | null ) => void ;
9
9
showHexString? : boolean ;
10
10
};
11
11
Element: HTMLDivElement ;
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ import FreestyleUsage from 'ember-freestyle/components/freestyle/usage';
6
6
import ColorPicker from ' ./index.gts' ;
7
7
8
8
export default class ColorPickerUsage extends Component {
9
- @tracked color = ' ' ;
9
+ @tracked color: string | null = null ;
10
10
@tracked disabled = false ;
11
11
@tracked showHexString = true ;
12
12
13
- private onChange = (newColor : string ) => {
13
+ private onChange = (newColor : string | null ) => {
14
14
this .color = newColor ;
15
15
};
16
16
Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ class EmbeddedTemplate extends Component<typeof BlogPost> {
110
110
111
111
.categories {
112
112
margin-top : var (--boxel-sp );
113
+ display : flex ;
114
+ flex-wrap : wrap ;
115
+ gap : var (--boxel-sp-xxxs );
113
116
}
114
117
115
118
.category {
@@ -215,10 +218,10 @@ class FittedTemplate extends Component<typeof BlogPost> {
215
218
height : 20px ;
216
219
margin-left : 7px ;
217
220
display : none ;
221
+ overflow : hidden ;
218
222
}
219
223
220
224
.category {
221
- font-size : 0.6rem ;
222
225
height : 20px ;
223
226
padding : 3px 4px ;
224
227
border-radius : var (--boxel-border-radius-sm );
@@ -710,7 +713,11 @@ export class BlogPost extends CardDef {
710
713
{{/if }}
711
714
{{#if @ model.categories.length }}
712
715
<div class =' categories' >
713
- <@ fields.categories @ format =' atom' @ displayContainer ={{ false }} />
716
+ {{#each @ model.categories as | category | }}
717
+ <div class =' category' style ={{categoryStyle category }} >
718
+ {{category.shortName }}
719
+ </div >
720
+ {{/each }}
714
721
</div >
715
722
{{/if }}
716
723
<h1 ><@ fields.title /></h1 >
@@ -841,6 +848,13 @@ export class BlogPost extends CardDef {
841
848
.featured-image + .categories {
842
849
margin-top : var (--boxel-sp-xl );
843
850
}
851
+ .category {
852
+ display : inline-block ;
853
+ padding : 3px var (--boxel-sp-xxxs );
854
+ border-radius : var (--boxel-border-radius-sm );
855
+ font : 500 var (--boxel-font-xs );
856
+ letter-spacing : var (--boxel-lsp-sm );
857
+ }
844
858
< /style >
845
859
</template >
846
860
};
You can’t perform that action at this time.
0 commit comments