Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

4.6 KB
Raw Blame
import { createStaticStyles } from '@lobehub/ui';

import { densityVars } from '@/styles/densityVars';

export const styles = createStaticStyles(({ css, cssVar }) => ({
  // Footer hosting the approve / reject actions (portal target). Hidden until
  // the Intervention component fills it.
  actions: css`
    padding-block: 8px 12px;
    padding-inline: ${densityVars.contentGap};
    border-block-start: 1px solid ${cssVar.colorBorderSecondary};
    background: color-mix(in srgb, ${cssVar.colorBgElevated} 92%, ${cssVar.colorFillSecondary});

    &:empty {
      display: none;
    }
  `,
  // Goal cards' footer: the dismiss text button on the left, the form's own
  // actions (portal target) filling the rest.
  goalActions: css`
    display: flex;
    gap: 8px;
    align-items: center;

    padding-block: 8px 12px;
    padding-inline: ${densityVars.contentGap};
    border-block-start: 1px solid ${cssVar.colorBorderSecondary};

    background: color-mix(in srgb, ${cssVar.colorBgElevated} 92%, ${cssVar.colorFillSecondary});
  `,
  reviewSummary: css`
    padding-block: 4px 8px;
    font-size: ${densityVars.fontSize};
    line-height: 1.6;
    color: ${cssVar.colorTextSecondary};
  `,
  goalActionsSlot: css`
    flex: 1;
    min-width: 0;
  `,
  card: css`
    pointer-events: auto;

    overflow: hidden;
    display: flex;
    flex-direction: column;

    width: 100%;
    border: 1px solid ${cssVar.colorBorderSecondary};
    border-radius: ${cssVar.borderRadiusLG};

    background: ${cssVar.colorBgElevated};
    box-shadow: ${cssVar.boxShadowSecondary};
  `,
  content: css`
    overflow-y: auto;
    flex: 1;

    min-height: 0;
    max-height: 42vh;
    padding-block: 6px 8px;
    padding-inline: ${densityVars.contentGap};
  `,
  header: css`
    display: flex;
    gap: 8px;
    align-items: center;

    padding-block: 8px;
    padding-inline: ${densityVars.contentGap};
  `,
  headerMeta: css`
    overflow: hidden;
    flex: 1;
    min-width: 0;
  `,
  headerSubtitle: css`
    overflow: hidden;
    display: flex;
    gap: 8px;
    align-items: baseline;

    font-size: 12px;
    color: ${cssVar.colorTextTertiary};
    text-overflow: ellipsis;
    white-space: nowrap;

    span {
      font-size: ${densityVars.fontSize};
      font-weight: 500;
      color: ${cssVar.colorText};
    }
  `,
  headerTitle: css`
    font-size: ${densityVars.pageTitleFontSize};
    font-weight: 600;
    color: ${cssVar.colorText};
    overflow-wrap: anywhere;
  `,
  // "+N more pending" hint shown when several conversations are waiting; only
  // the top card is actionable at once.
  moreHint: css`
    pointer-events: auto;

    align-self: center;

    padding-block: 2px;

    font-size: 12px;
    color: ${cssVar.colorTextTertiary};
  `,
  // Collapsed "dynamic island" pill.
  pill: css`
    pointer-events: auto;
    cursor: pointer;

    display: flex;
    gap: 8px;
    align-items: center;

    height: 36px;
    padding-inline: 14px;
    border: 1px solid ${cssVar.colorBorderSecondary};
    border-radius: 999px;

    font-size: 13px;
    color: ${cssVar.colorText};

    background: ${cssVar.colorBgElevated};
    box-shadow: ${cssVar.boxShadowSecondary};
  `,
  pillDot: css`
    flex-shrink: 0;

    width: 7px;
    height: 7px;
    border-radius: 999px;

    background: ${cssVar.colorPrimary};
  `,
  stack: css`
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  `,
  // The user request that triggered the tool call — context for the approval.
  // Rendered with the same Markdown component as the User chat bubble, so
  // formatting / skill tags read consistently. A long request scrolls inside a
  // capped body rather than hard-truncating, so the full context stays reachable.
  requestContext: css`
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding-block: 4px 12px;
    padding-inline: ${densityVars.contentGap};
    border-block-end: 1px solid ${cssVar.colorBorderSecondary};
  `,
  userRequestBody: css`
    overflow-y: auto;
    max-height: 120px;

    /* Trim the Markdown block's outer margins so it sits flush in the strip. */
    p:first-child {
      margin-block-start: 0;
    }

    p:last-child {
      margin-block-end: 0;
    }
  `,
  // Top-center fixed wrapper. The wrapper ignores pointer events so it never
  // blocks the page; only the cards / pill re-enable them.
  wrapper: css`
    pointer-events: none;

    position: fixed;
    z-index: 1000;
    inset-block-start: var(--global-approval-top, 16px);
    inset-inline-start: 50%;
    transform: translateX(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(640px, 92vw);
  `,
}));