Skip to content

Commit 4255d1e

Browse files
committed
null value
1 parent 73d4743 commit 4255d1e

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

packages/boxel-ui/addon/src/components/color-palette/index.gts

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import IconButton from '../icon-button/index.gts';
1010

1111
interface Signature {
1212
Args: {
13-
color: string;
14-
onChange: (color: string) => void;
13+
color: string | null;
14+
onChange: (color: string | null) => void;
1515
};
1616
Element: HTMLDivElement;
1717
}
@@ -62,7 +62,7 @@ export default class ColorPalette extends Component<Signature> {
6262
@width='16px'
6363
@height='16px'
6464
class='remove'
65-
{{on 'click' (fn @onChange '')}}
65+
{{on 'click' (fn @onChange null)}}
6666
aria-label='Unset color'
6767
/>
6868
</div>

packages/boxel-ui/addon/src/components/color-palette/usage.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import FreestyleUsage from 'ember-freestyle/components/freestyle/usage';
66
import ColorPalette from './index.gts';
77

88
export default class ColorPaletteUsage extends Component {
9-
@tracked color = '';
9+
@tracked color: string | null = null;
1010

11-
private handleColorChange = (newColor: string) => {
11+
private handleColorChange = (newColor: string | null) => {
1212
this.color = newColor;
1313
};
1414

packages/boxel-ui/addon/src/components/color-picker/index.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import Component from '@glimmer/component';
33

44
interface Signature {
55
Args: {
6-
color: string;
6+
color: string | null;
77
disabled?: boolean;
8-
onChange: (color: string) => void;
8+
onChange: (color: string | null) => void;
99
showHexString?: boolean;
1010
};
1111
Element: HTMLDivElement;

packages/boxel-ui/addon/src/components/color-picker/usage.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import FreestyleUsage from 'ember-freestyle/components/freestyle/usage';
66
import ColorPicker from './index.gts';
77

88
export default class ColorPickerUsage extends Component {
9-
@tracked color = '';
9+
@tracked color: string | null = null;
1010
@tracked disabled = false;
1111
@tracked showHexString = true;
1212

13-
private onChange = (newColor: string) => {
13+
private onChange = (newColor: string | null) => {
1414
this.color = newColor;
1515
};
1616

packages/experiments-realm/blog-post.gts

+16-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class EmbeddedTemplate extends Component<typeof BlogPost> {
110110
111111
.categories {
112112
margin-top: var(--boxel-sp);
113+
display: flex;
114+
flex-wrap: wrap;
115+
gap: var(--boxel-sp-xxxs);
113116
}
114117
115118
.category {
@@ -215,10 +218,10 @@ class FittedTemplate extends Component<typeof BlogPost> {
215218
height: 20px;
216219
margin-left: 7px;
217220
display: none;
221+
overflow: hidden;
218222
}
219223
220224
.category {
221-
font-size: 0.6rem;
222225
height: 20px;
223226
padding: 3px 4px;
224227
border-radius: var(--boxel-border-radius-sm);
@@ -710,7 +713,11 @@ export class BlogPost extends CardDef {
710713
{{/if}}
711714
{{#if @model.categories.length}}
712715
<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}}
714721
</div>
715722
{{/if}}
716723
<h1><@fields.title /></h1>
@@ -841,6 +848,13 @@ export class BlogPost extends CardDef {
841848
.featured-image + .categories {
842849
margin-top: var(--boxel-sp-xl);
843850
}
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+
}
844858
</style>
845859
</template>
846860
};

0 commit comments

Comments
 (0)