diff --git a/packages/experiments-realm/blog-app.gts b/packages/experiments-realm/blog-app.gts index c919ded2fe..5ed837c0fb 100644 --- a/packages/experiments-realm/blog-app.gts +++ b/packages/experiments-realm/blog-app.gts @@ -25,7 +25,8 @@ import { sortByCardTitleAsc, SortMenu, } from './components/sort'; -import { type ViewOption, CardsGrid } from './components/grid'; +import { CardList } from './components/card-list'; +import { CardsGrid } from './components/grid'; import { TitleGroup, Layout, type LayoutFilter } from './components/layout'; import { @@ -45,6 +46,8 @@ import AuthorIcon from '@cardstack/boxel-icons/square-user'; import type { BlogPost } from './blog-post'; +type ViewOption = 'card' | 'strip' | 'grid'; + export const toISOString = (datetime: Date) => datetime.toISOString(); export const formatDatetime = ( @@ -215,27 +218,32 @@ class BlogAppTemplate extends Component { <:grid> {{#if this.query}} - - <:meta as |card|> - {{#if this.showAdminData}} - - {{/if}} - - + {{#if (eq this.selectedView 'card')}} + + <:meta as |card|> + {{#if this.showAdminData}} + + {{/if}} + + + {{else}} + + {{/if}} {{/if}} diff --git a/packages/experiments-realm/components/card-list.gts b/packages/experiments-realm/components/card-list.gts new file mode 100644 index 0000000000..4bfa257174 --- /dev/null +++ b/packages/experiments-realm/components/card-list.gts @@ -0,0 +1,88 @@ +import GlimmerComponent from '@glimmer/component'; + +import { type CardContext } from 'https://cardstack.com/base/card-api'; + +import { type Query } from '@cardstack/runtime-common'; + +import { CardContainer } from '@cardstack/boxel-ui/components'; + +interface PrerenderedCard { + url: string; + component: any; +} + +interface CardListSignature { + Args: { + query: Query; + realms: URL[]; + context?: CardContext; + }; + Blocks: { + meta: [card: PrerenderedCard]; + }; + Element: HTMLElement; +} +export class CardList extends GlimmerComponent { + +} diff --git a/packages/experiments-realm/components/grid.gts b/packages/experiments-realm/components/grid.gts index 18319f3b9e..ce5bf80809 100644 --- a/packages/experiments-realm/components/grid.gts +++ b/packages/experiments-realm/components/grid.gts @@ -1,29 +1,17 @@ import GlimmerComponent from '@glimmer/component'; -import { Format, type CardContext } from 'https://cardstack.com/base/card-api'; +import { type CardContext } from 'https://cardstack.com/base/card-api'; import { type Query } from '@cardstack/runtime-common'; import { CardContainer } from '@cardstack/boxel-ui/components'; -import { eq } from '@cardstack/boxel-ui/helpers'; - -export type ViewOption = 'card' | 'strip' | 'grid'; - -interface PrerenderedCard { - url: string; - component: any; -} interface CardsGridSignature { Args: { query: Query; realms: URL[]; - selectedView: ViewOption; + selectedView: string; context?: CardContext; - format: Format; - }; - Blocks: { - meta: [card: PrerenderedCard]; }; Element: HTMLElement; } @@ -40,7 +28,7 @@ export class CardsGrid extends GlimmerComponent { }} <:loading> @@ -61,11 +49,6 @@ export class CardsGrid extends GlimmerComponent { > - {{#if (eq @selectedView 'card')}} - {{#if (has-block 'meta')}} - {{yield card to='meta'}} - {{/if}} - {{/if}} {{/each}} @@ -74,9 +57,6 @@ export class CardsGrid extends GlimmerComponent { } diff --git a/packages/experiments-realm/components/layout.gts b/packages/experiments-realm/components/layout.gts index b1be48b940..e4c4bdb236 100644 --- a/packages/experiments-realm/components/layout.gts +++ b/packages/experiments-realm/components/layout.gts @@ -207,7 +207,7 @@ export class Layout extends GlimmerComponent { gap: var(--boxel-sp-xs) var(--boxel-sp-lg); } .content-grid { - max-width: var(--content-max-width, 100%); + max-width: 100%; padding-left: var(--layout-padding); padding-bottom: var(--layout-padding); } diff --git a/packages/experiments-realm/crm-app.gts b/packages/experiments-realm/crm-app.gts index 006a2dead8..de0508f52f 100644 --- a/packages/experiments-realm/crm-app.gts +++ b/packages/experiments-realm/crm-app.gts @@ -1,4 +1,5 @@ import { CardsGrid } from './components/grid'; +import { CardList } from './components/card-list'; import { Layout, TitleGroup, type LayoutFilter } from './components/layout'; import { SortMenu, @@ -440,16 +441,23 @@ class CrmAppTemplate extends Component { @fieldName={{@fieldName}} /> {{else if this.query}} - + {{#if (eq this.selectedView 'card')}} + + {{else}} + + {{/if}} {{/if}} - diff --git a/packages/seed-realm/components/card-list.gts b/packages/seed-realm/components/card-list.gts new file mode 100644 index 0000000000..4bfa257174 --- /dev/null +++ b/packages/seed-realm/components/card-list.gts @@ -0,0 +1,88 @@ +import GlimmerComponent from '@glimmer/component'; + +import { type CardContext } from 'https://cardstack.com/base/card-api'; + +import { type Query } from '@cardstack/runtime-common'; + +import { CardContainer } from '@cardstack/boxel-ui/components'; + +interface PrerenderedCard { + url: string; + component: any; +} + +interface CardListSignature { + Args: { + query: Query; + realms: URL[]; + context?: CardContext; + }; + Blocks: { + meta: [card: PrerenderedCard]; + }; + Element: HTMLElement; +} +export class CardList extends GlimmerComponent { + +} diff --git a/packages/seed-realm/components/grid.gts b/packages/seed-realm/components/grid.gts index 18319f3b9e..ce5bf80809 100644 --- a/packages/seed-realm/components/grid.gts +++ b/packages/seed-realm/components/grid.gts @@ -1,29 +1,17 @@ import GlimmerComponent from '@glimmer/component'; -import { Format, type CardContext } from 'https://cardstack.com/base/card-api'; +import { type CardContext } from 'https://cardstack.com/base/card-api'; import { type Query } from '@cardstack/runtime-common'; import { CardContainer } from '@cardstack/boxel-ui/components'; -import { eq } from '@cardstack/boxel-ui/helpers'; - -export type ViewOption = 'card' | 'strip' | 'grid'; - -interface PrerenderedCard { - url: string; - component: any; -} interface CardsGridSignature { Args: { query: Query; realms: URL[]; - selectedView: ViewOption; + selectedView: string; context?: CardContext; - format: Format; - }; - Blocks: { - meta: [card: PrerenderedCard]; }; Element: HTMLElement; } @@ -40,7 +28,7 @@ export class CardsGrid extends GlimmerComponent { }} <:loading> @@ -61,11 +49,6 @@ export class CardsGrid extends GlimmerComponent { > - {{#if (eq @selectedView 'card')}} - {{#if (has-block 'meta')}} - {{yield card to='meta'}} - {{/if}} - {{/if}} {{/each}} @@ -74,9 +57,6 @@ export class CardsGrid extends GlimmerComponent { } diff --git a/packages/seed-realm/components/layout.gts b/packages/seed-realm/components/layout.gts index 835b3842fc..e4c4bdb236 100644 --- a/packages/seed-realm/components/layout.gts +++ b/packages/seed-realm/components/layout.gts @@ -146,7 +146,6 @@ export class Layout extends GlimmerComponent { .layout { --layout-padding: var(--boxel-sp-lg); --sidebar-width: 255px; - --content-max-width: 1040px; --layout-background-color: var(--boxel-light); display: flex; width: 100%; @@ -208,7 +207,7 @@ export class Layout extends GlimmerComponent { gap: var(--boxel-sp-xs) var(--boxel-sp-lg); } .content-grid { - max-width: var(--content-max-width); + max-width: 100%; padding-left: var(--layout-padding); padding-bottom: var(--layout-padding); }