diff --git a/packages/experiments-realm/address.gts b/packages/experiments-realm/address.gts index 0cee00fa53..d640b9c18b 100644 --- a/packages/experiments-realm/address.gts +++ b/packages/experiments-realm/address.gts @@ -7,7 +7,7 @@ import { import StringField from 'https://cardstack.com/base/string'; import { CountryField } from './country'; import MapPinIcon from '@cardstack/boxel-icons/map-pin'; -import { EntityDisplay } from './components/entity-display'; +import EntityDisplayWithIcon from './components/entity-icon-display'; function getAddressRows( addressLine1: string | undefined, @@ -39,14 +39,11 @@ class Atom extends Component { ); } } diff --git a/packages/experiments-realm/components/activity-card.gts b/packages/experiments-realm/components/activity-card.gts index 76222830ea..b5277ff520 100644 --- a/packages/experiments-realm/components/activity-card.gts +++ b/packages/experiments-realm/components/activity-card.gts @@ -1,5 +1,5 @@ import GlimmerComponent from '@glimmer/component'; -import { EntityDisplay } from './entity-display'; +import EntityDisplayWithThumbnail from './entity-thumbnail-display'; interface ActivityCardArgs { Blocks: { @@ -17,7 +17,7 @@ export default class ActivityCard extends GlimmerComponent {
- + <:title> {{yield to='title'}} @@ -28,7 +28,7 @@ export default class ActivityCard extends GlimmerComponent { {{yield to='thumbnail'}} - + {{#if (has-block 'description')}}

diff --git a/packages/experiments-realm/components/contact-row.gts b/packages/experiments-realm/components/contact-row.gts index 92b8f3e4c2..db8545180b 100644 --- a/packages/experiments-realm/components/contact-row.gts +++ b/packages/experiments-realm/components/contact-row.gts @@ -1,5 +1,5 @@ import { Avatar, Pill } from '@cardstack/boxel-ui/components'; -import { EntityDisplay } from './entity-display'; +import EntityDisplayWithThumbnail from './entity-thumbnail-display'; import GlimmerComponent from '@glimmer/component'; interface ContactRowArgs { @@ -15,10 +15,7 @@ interface ContactRowArgs { export class ContactRow extends GlimmerComponent { -} diff --git a/packages/experiments-realm/components/entity-icon-display.gts b/packages/experiments-realm/components/entity-icon-display.gts new file mode 100644 index 0000000000..73cc4142d1 --- /dev/null +++ b/packages/experiments-realm/components/entity-icon-display.gts @@ -0,0 +1,126 @@ +import GlimmerComponent from '@glimmer/component'; +import { concat } from '@ember/helper'; + +interface EntityDisplayWithIconArgs { + Args: { + title?: string; //prefer using args.title if the title is just a string + center?: boolean; + underline?: boolean; + }; + Blocks: { + title?: []; //we can choose use this to pass instead of using args.title if the title block HTML is complex + icon?: []; + tag?: []; + content?: []; + }; + Element: HTMLElement; +} + +export default class EntityDisplayWithIcon extends GlimmerComponent { + get shouldAlignCenter() { + return this.args.center; + } + + get shouldUnderlineText() { + return this.args.underline; + } + + +} diff --git a/packages/experiments-realm/components/entity-thumbnail-display.gts b/packages/experiments-realm/components/entity-thumbnail-display.gts new file mode 100644 index 0000000000..26aac840e9 --- /dev/null +++ b/packages/experiments-realm/components/entity-thumbnail-display.gts @@ -0,0 +1,130 @@ +import GlimmerComponent from '@glimmer/component'; +import { concat } from '@ember/helper'; + +interface EntityDisplayWithThumbnailArgs { + Args: { + title?: string; //prefer using args.title if the title is just a string + center?: boolean; + underline?: boolean; + }; + Blocks: { + title?: []; //we can choose use this to pass instead of using args.title if the title block HTML is complex + thumbnail?: []; + tag?: []; + content?: []; + }; + Element: HTMLElement; +} + +export default class EntityDisplayWithThumbnail extends GlimmerComponent { + get shouldAlignCenter() { + return this.args.center; + } + + get shouldUnderlineText() { + return this.args.underline; + } + + +} diff --git a/packages/experiments-realm/crm/account.gts b/packages/experiments-realm/crm/account.gts index 446426fc90..c51f4489fe 100644 --- a/packages/experiments-realm/crm/account.gts +++ b/packages/experiments-realm/crm/account.gts @@ -26,7 +26,8 @@ import CalendarExclamation from '@cardstack/boxel-icons/calendar-exclamation'; import { LooseGooseyField } from '../loosey-goosey'; import { StatusPill } from '../components/status-pill'; import { Avatar, Pill, BoxelButton } from '@cardstack/boxel-ui/components'; -import { EntityDisplay } from '../components/entity-display'; +import EntityDisplayWithIcon from '../components/entity-icon-display'; +import EntityDisplayWithThumbnail from '../components/entity-thumbnail-display'; import ActivityCard from '../components/activity-card'; import PlusIcon from '@cardstack/boxel-icons/plus'; import PhoneIcon from '@cardstack/boxel-icons/phone'; @@ -204,41 +205,36 @@ class IsolatedTemplate extends Component { <:content>

- - <:thumbnail> + + <:icon> - - <:title> - Dmitri Petrov - + <:content> Technova - - + + <:thumbnail> - <:title> - Rep: Janus Dios - <:content> Sales Associate - - - <:thumbnail> + + + <:icon> - - <:title> - May 15, 2024 - + <:content> 3:15pm - +
@@ -328,6 +324,11 @@ class IsolatedTemplate extends Component { color: var(--boxel-color-gray); margin-left: auto; } + .avatar { + --profile-avatar-icon-size: 20px; + --profile-avatar-icon-border: 0px; + flex-shrink: 0; + } @container activities-summary-card (max-width: 447px) { .activity-button-mobile { diff --git a/packages/experiments-realm/crm/company.gts b/packages/experiments-realm/crm/company.gts index fe64a3a1c5..70af9f19ff 100644 --- a/packages/experiments-realm/crm/company.gts +++ b/packages/experiments-realm/crm/company.gts @@ -2,7 +2,7 @@ import StringField from 'https://cardstack.com/base/string'; import NumberField from 'https://cardstack.com/base/number'; import { WebsiteField } from '../website'; import { Address } from '../address'; -import { EntityDisplay } from '../components/entity-display'; +import EntityDisplayWithIcon from '../components/entity-icon-display'; import { Component, @@ -15,14 +15,11 @@ import BuildingIcon from '@cardstack/boxel-icons/building'; class ViewCompanyTemplate extends Component { } diff --git a/packages/experiments-realm/crm/contact.gts b/packages/experiments-realm/crm/contact.gts index e043c105f0..8d29b1c062 100644 --- a/packages/experiments-realm/crm/contact.gts +++ b/packages/experiments-realm/crm/contact.gts @@ -19,7 +19,7 @@ import Email from '@cardstack/boxel-icons/mail'; import Linkedin from '@cardstack/boxel-icons/linkedin'; import XIcon from '@cardstack/boxel-icons/brand-x'; import { LooseGooseyField } from '../loosey-goosey'; -import { EntityDisplay } from '../components/entity-display'; +import EntityDisplayWithThumbnail from '../components/entity-thumbnail-display'; export class SocialLinkField extends ContactLinkField { static displayName = 'social-link'; @@ -186,7 +186,7 @@ class FittedTemplate extends Component { grid-area: avatar-group-container; } .avatar-group-container - :where(.avatar-info .company-group .entity-name-tag) { + :where(.avatar-info .company-group .entity-title-tag-container) { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; @@ -610,10 +610,7 @@ class AtomTemplate extends Component { }