Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Build
run: npm run build

# The themes' contrast and shape (LOOP T-03, T-15): a failure fails the build.
# The themes' contrast and shape: a failure fails the build.
- name: Test
run: npm test

Expand All @@ -56,7 +56,7 @@ jobs:
path: dist-npm/*.tgz

# The gallery (examples/gallery) built from the package's source: a page
# that does not type-check or bundle fails CI (LOOP G-10). It installs its
# that does not type-check or bundle fails CI. It installs its
# own dependencies (its package.json, no lockfile) beside the package's.
gallery:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

# Changelog

Each version names the LOOP boxes it carries — the plan's ids, as its commits say them — and links the section of the README that documents them. The `loop` theme is documented in [The `loop` theme](https://github.com/datalayer/primer-addons/blob/main/README.md#the-loop-theme), and shown, with the accents, in the gallery's *Theme Accents* page when the gallery wears it.
Each version links the section of the README that documents it. The `agent` theme is documented in [The `agent` theme](https://github.com/datalayer/primer-addons/blob/main/README.md#the-agent-theme), and shown, with the accents, in the gallery's *Theme Accents* page when the gallery wears it.

## 1.0.54

- A stored theme the registry no longer has is dropped when a theme store hydrates, the store's default standing, and a stored `loop` is read as `agent` (`RENAMED_THEMES`), so a person's choice follows the renamed theme; the legacy upgrade's anonymous variant is `site-anonymous`.
- **Breaking.** The `loop` theme is the `agent` theme, with no alias: the theme id `'loop'` is `'agent'` (`ThemeVariant`, `themeConfigs.agent`, `themeTokens.agent`, the hue and palette tables, the logo's variant), and every name follows. `loopTheme` is `agentTheme`, `loopThemeStyles` is `agentThemeStyles`, `loopColors` is `agentColors` (its `loopBrand`, `loopAccent`, `loopOn`… are `agentBrand`, `agentAccent`, `agentOn`…), `loopEyes` is `agentEyes`, and the other `loop*` exports (`loopShapeVars`, `loopShadows`, `loopMotionVars`, `loopTypeVars`, `loopFontFamily`, `loopFontWeights`, `loopControlsCss`, `loopFocusRing`…) are `agent*`. The theme's custom properties are `--agent-*` (`--agent-radius-card`, `--agent-shadow-frame`, `--agent-hairline`, `--agent-motion-*`, `--agent-face-*`…). `style/loop-face.css` is `style/agent-face.css`. The tests, the stories, the gallery and the README follow; the comments no longer carry planning ids.

## 1.0.53

Expand Down
64 changes: 32 additions & 32 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/gallery/src/components/BoxDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* The gallery's Box: one example per family of props, each with a line
* saying what it shows and the code that draws it. No `sx` anywhere: every
* value is a prop, on the theme's tokens, so switching the theme (try
* `loop`) redraws them all — its hairline, its corners, its weights.
* `agent`) redraws them all — its hairline, its corners, its weights.
*/

import type { ReactNode } from 'react';
Expand Down Expand Up @@ -106,7 +106,7 @@ const EXAMPLES: Example[] = [
{
title: 'A card',
caption:
"The Studio Home's card: the theme's hairline, its large corner (20px in loop), padded so the corner does not crowd the words.",
"The Studio Home's card: the theme's hairline, its large corner (20px in agent), padded so the corner does not crowd the words.",
code: `<Box as="section" display="flex" flexDirection="column" gap={2} p={3}
bg="canvas.default" border="1px solid" borderColor="border.default" borderRadius="large">
<Box as="h3" m={0} fontSize={3}>Build</Box>
Expand Down Expand Up @@ -202,7 +202,7 @@ const EXAMPLES: Example[] = [
{
title: 'Type',
caption:
"Sizes on Primer's scale (0 is 12px, 1 is 14px, 3 is 20px), weights by name (the theme's: loop has two), alignment, and text that does not wrap.",
"Sizes on Primer's scale (0 is 12px, 1 is 14px, 3 is 20px), weights by name (the theme's: agent has two), alignment, and text that does not wrap.",
code: `<Box fontSize={3} fontWeight="semibold">fontSize={3} semibold</Box>
<Box fontSize={1} color="fg.muted" textAlign="center">centred, muted</Box>
<Box fontSize={0} whiteSpace="nowrap" overflow="hidden" textOverflow="ellipsis" maxWidth={200}>…</Box>`,
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/src/components/CardDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* The gallery's Card: one example per prop and flavour, each with a line
* saying what it shows and the code that draws it. Every colour, shadow and
* corner is the theme's, so switching the theme (try `loop`) or the colour
* corner is the theme's, so switching the theme (try `agent`) or the colour
* mode redraws them all.
*/

Expand Down Expand Up @@ -347,7 +347,7 @@ const EXAMPLES: Example[] = [
{
title: 'An attached panel',
caption:
"rounded=\"overlay\" is the theme's corner for a panel floating over the page — a menu, a header's mega-menu (Primer's overlay corner unless the theme sets --theme-radius-overlay; loop's is its card corner). With the top corners squared it reads as hanging from what opened it.",
"rounded=\"overlay\" is the theme's corner for a panel floating over the page — a menu, a header's mega-menu (Primer's overlay corner unless the theme sets --theme-radius-overlay; agent's is its card corner). With the top corners squared it reads as hanging from what opened it.",
code: `<Card border shadow="extraLarge" rounded="overlay"
borderTopLeftRadius={0} borderTopRightRadius={0} p={4}>…</Card>`,
render: () => (
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/components/EntityAvatarDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* EntityAvatar in each flavour, under the selected theme: an image, an emoji,
* an icon, initials; its sizes; a circle for a person and the theme's corner
* for the rest (rounder in `loop`); its grounds and an entity's own colour.
* for the rest (rounder in `agent`); its grounds and an entity's own colour.
*/

import type { ReactNode } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/components/HoverCardDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* The hover card in its three sizes: a shelf of small cards that grow on
* hover, the grown card on its own, and the large card its chevron opens.
* All of it is drawn by the theme — switch to `loop` for its rounder corner.
* All of it is drawn by the theme — switch to `agent` for its rounder corner.
*/

import { useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/components/PrimerDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Primer's own components, drawn by the selected theme. A theme's shape says
* how a control's corners and a data table's corners, header and hairline
* look (`primerComponentsCss`); its colours do the rest. Switch the theme
* (try `loop`: pills and a rounder table) and every one of them follows.
* (try `agent`: pills and a rounder table) and every one of them follows.
*/

import { useState, type ReactNode } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/src/gallery/GalleryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function GalleryPage() {
{activeDemo.description}
</Text>
</Box>
{/* The theme's card: its hairline and its corner (20px in loop), padded to match. */}
{/* The theme's card: its hairline and its corner (20px in agent), padded to match. */}
<Box p={3} border="1px solid" borderColor="border.default" borderRadius="card">
{activeDemo.render()}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datalayer/primer-addons",
"version": "1.0.53",
"version": "1.0.54",
"license": "BSD-3-Clause",
"scripts": {
"build": "npm run build:lib",
Expand Down
2 changes: 1 addition & 1 deletion src/components/appearance/AppearanceControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export function AppearanceControls({
size="small"
onClick={() => setIsPreviewOpen((open) => !open)}
aria-expanded={isPreviewOpen}
// The theme's control corner (Loop's pill), wherever the menu is drawn.
// The theme's control corner (Agent's pill), wherever the menu is drawn.
sx={{ borderRadius: "var(--theme-radius-control, 6px)" }}
>
{isPreviewOpen ? "Hide preview" : "Show preview"}
Expand Down
4 changes: 2 additions & 2 deletions src/components/appearance/AppearanceMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export const CircleWithoutPreviews: Story = {

/**
* The colour mode alone: light, dark and auto, no theme swatches — the menu
* of a site that wears one theme (the Datalayer landing, on loop).
* of a site that wears one theme (the Datalayer landing, on agent).
*/
export const ColorModeOnly: Story = {
args: {
themeVariant: "loop",
themeVariant: "agent",
colorMode: "dark",
showThemeChooser: false,
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/appearance/CollaboratorPalette.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export const ARoomOfFive: Story = {
};

/** One theme in one mode, whatever the page wears. */
export const LoopDark: Story = {
export const AgentDark: Story = {
args: {
variant: "loop",
variant: "agent",
colorMode: "dark",
people: ROOM,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/appearance/ColorModeCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function ColorModeCircle({
minWidth: size,
width: size,
height: size,
// A control like the theme's others: round on Loop, square on VS Code.
// A control like the theme's others: round on Agent, square on VS Code.
borderRadius: shape === 'circle' ? '50%' : 'var(--theme-radius-control, 6px)',
display: 'inline-flex',
alignItems: 'center',
Expand Down
2 changes: 1 addition & 1 deletion src/components/appearance/ThemeCircle.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const Default: Story = {
/** Cycling through a chosen few. */
export const AFewThemes: Story = {
args: {
themes: ["datalayer", "loop", "earth", "matrix"],
themes: ["datalayer", "agent", "earth", "matrix"],
size: 36,
},
render: (args) => <ThemedThemeCircle {...args} />,
Expand Down
2 changes: 1 addition & 1 deletion src/components/appearance/ThemePreviewCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const meta = {
},
},
args: {
variant: "loop",
variant: "agent",
colorMode: "light",
selected: false,
compact: false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/appearance/ThemePreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function ThemePreviewCard({
display: 'flex',
alignItems: 'center',
gap: 1,
// Clear of the card's corner, however round the theme draws it (Loop's).
// Clear of the card's corner, however round the theme draws it (Agent's).
px: `calc(var(--theme-radius-card, 6px) / 2 + ${compact ? 6 : 8}px)`,
py: compact ? '6px' : '8px',
bg: 'canvas.default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('the appearance controls without the theme chooser', () => {
withStore={false}
layout={layout}
colorMode="dark"
themeVariant="loop"
themeVariant="agent"
onColorModeChange={() => undefined}
showThemeChooser={false}
showThemePreviews
Expand All @@ -89,7 +89,7 @@ describe('the appearance controls without the theme chooser', () => {
<AppearanceControls
withStore={false}
colorMode="dark"
themeVariant="loop"
themeVariant="agent"
onColorModeChange={() => undefined}
onThemeChange={() => undefined}
/>,
Expand All @@ -104,7 +104,7 @@ describe('the appearance controls without the theme chooser', () => {
<AppearanceControls
withStore={false}
colorMode="dark"
themeVariant="loop"
themeVariant="agent"
onColorModeChange={() => undefined}
/>,
),
Expand Down
2 changes: 1 addition & 1 deletion src/components/box/Box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const Colours: Story = {
),
};

/** Corners by name: Primer's four, then the theme's shapes (rounder in `loop`). */
/** Corners by name: Primer's four, then the theme's shapes (rounder in `agent`). */
export const Corners: Story = {
render: () => (
<Box p={3} bg="canvas.default" display="flex" flexWrap="wrap" gap={3}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
* `boxShadow="shadow.medium"` is `var(--shadow-resting-medium)` — the table
* is generated from Primer's color schemes (`boxTokens.ts`). A radius by
* name is Primer's (`small`, `medium`, `large`, `full`) or the theme's shape
* (`control`, `card`, `bubble`, `frame`, LOOP T-03); a font weight by name
* (`control`, `card`, `bubble`, `frame`); a font weight by name
* is the theme's weight variable. Space, font sizes, radii by index and
* sizes are Primer's theme scales, written as pixels: they are the same in
* every theme and need no variable.
*
* No fallback: a page is drawn by its theme, and the theme provider sets
* every variable `Box` emits (`BOX_EMITTED_VARS`, proven by a test against
* every theme). A theme that wants a different hairline or corner sets it
* on Primer's variable — the `loop` theme's hairline *is* its
* on Primer's variable — the `agent` theme's hairline *is* its
* `--borderColor-default` — never a call site with a
* `var(--loop-…, var(--…))` chain.
* `var(--agent-…, var(--…))` chain.
*
* ## The implementation: one class per style, no styled-components
*
Expand Down
8 changes: 4 additions & 4 deletions src/components/box/__tests__/boxCss.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ describe('the variables Box emits', () => {
}
}

it('give the loop theme its hairline on Primer\'s default border', () => {
const light = themeConfigs.loop.themeStyles.light as Record<string, string>;
expect(light['--borderColor-default']).toBe(light['--loop-hairline']);
expect(light['--borderRadius-large']).toBe(light['--loop-radius-card']);
it('give the agent theme its hairline on Primer\'s default border', () => {
const light = themeConfigs.agent.themeStyles.light as Record<string, string>;
expect(light['--borderColor-default']).toBe(light['--agent-hairline']);
expect(light['--borderRadius-large']).toBe(light['--agent-radius-card']);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/box/boxTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const BOX_FONT_SIZES = ['12px', '14px', '16px', '20px', '24px', '32px', '
/** Primer's radii by index (`borderRadius={2}` is 6px). */
export const BOX_RADII = ['0', '3px', '6px', '100px'] as const;

/** Radii by name: Primer's, and the theme's shapes (LOOP T-03), an overlay's among them. */
/** Radii by name: Primer's, and the theme's shapes, an overlay's among them. */
export const BOX_RADIUS_VARS = {
small: '--borderRadius-small',
medium: '--borderRadius-medium',
Expand All @@ -118,7 +118,7 @@ export const BOX_SIZES = { small: '544px', medium: '768px', large: '1012px', xla
* names its weights 300, 400, 500, 600 — `light`, `normal`, `semibold`,
* `bold` — which are the primitives' `light`, `normal`, `medium` and
* `semibold`: so `semibold` is `--base-text-weight-medium` (500, and 600 in
* the `loop` theme, which has two weights), as it reads today.
* the `agent` theme, which has two weights), as it reads today.
*/
export const BOX_FONT_WEIGHT_VARS = {
light: '--base-text-weight-light',
Expand Down
2 changes: 1 addition & 1 deletion src/components/calendar-picker/CalendarPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export function CalendarPicker({
: isToday
? "var(--borderColor-default)"
: "transparent",
// The theme's control corner: a pill in loop, Primer's medium elsewhere.
// The theme's control corner: a pill in agent, Primer's medium elsewhere.
borderRadius: "var(--theme-radius-control)",
height: 30,
cursor: disabled ? "not-allowed" : "pointer",
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export type CardActionsProps = {
}

/**
* The corners, read from the theme: each theme sets Primer's radii (loop's
* The corners, read from the theme: each theme sets Primer's radii (agent's
* are rounder), and a card left unsaid takes the theme's card corner.
*/
const CARD_RADIUS = 'card';
Expand Down
2 changes: 1 addition & 1 deletion src/components/color/ColorSwatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function ColorSwatch({
gridTemplateRows: `${height}px auto`,
border: "1px solid",
borderColor: "var(--borderColor-default)",
// The theme's card corner: 20px in loop, Primer's medium elsewhere.
// The theme's card corner: 20px in agent, Primer's medium elsewhere.
borderRadius: "var(--theme-radius-card)",
overflow: "hidden",
minWidth: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/components/entity-avatar/EntityAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* profile's cards give one, with `fg.onEmphasis`.
*
* Its shape is the theme's too: a `circle` for a person, `rounded` for
* anything else — the theme's medium corner (rounder in `loop`), never more
* anything else — the theme's medium corner (rounder in `agent`), never more
* than a little over a quarter of the avatar, so a small one stays a square
* with soft corners rather than turning into a circle.
*
Expand Down
2 changes: 1 addition & 1 deletion src/components/hover-card/HoverCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* - its **chevron** opens the large one, `HoverCardDetails`, over the page.
*
* Drawn by the theme: it is a `Card`, so its corner is the theme's card
* corner (rounder in `loop`, with nothing said here), its ground the
* corner (rounder in `agent`, with nothing said here), its ground the
* overlay's, its hairline and shadow the theme's.
*
* @module components/hover-card/HoverCard
Expand Down
2 changes: 1 addition & 1 deletion src/components/logo/DatalayerLogo.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Logo: Story = {
export const Gradient: Story = {
args: {
gradient: true,
variant: "loop",
variant: "agent",
},
render: (args) => (
<Box p={3} bg="canvas.default">
Expand Down
24 changes: 12 additions & 12 deletions src/components/logo/DatalayerLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
sandColors,
ivoryColors,
sunColors,
loopColors,
agentColors,
metalColors,
vscodeColors,
type ThemeVariant,
Expand Down Expand Up @@ -169,21 +169,21 @@ export const THEME_LOGO_COLORS: Record<
secondaryGradient: [sunColors.sunHover, sunColors.sunAccent],
},
},
loop: {
agent: {
// Flat: the theme has no gradient on a surface.
light: {
primary: loopColors.loopAccent,
secondary: loopColors.ink,
textColor: loopColors.gray,
primaryGradient: [loopColors.loopAccent, loopColors.loopAccent],
secondaryGradient: [loopColors.ink, loopColors.ink],
primary: agentColors.agentAccent,
secondary: agentColors.ink,
textColor: agentColors.gray,
primaryGradient: [agentColors.agentAccent, agentColors.agentAccent],
secondaryGradient: [agentColors.ink, agentColors.ink],
},
dark: {
primary: loopColors.loopBrand,
secondary: loopColors.inkDark,
textColor: loopColors.grayDark,
primaryGradient: [loopColors.loopBrand, loopColors.loopBrand],
secondaryGradient: [loopColors.inkDark, loopColors.inkDark],
primary: agentColors.agentBrand,
secondary: agentColors.inkDark,
textColor: agentColors.grayDark,
primaryGradient: [agentColors.agentBrand, agentColors.agentBrand],
secondaryGradient: [agentColors.inkDark, agentColors.inkDark],
},
},
metal: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sheet/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* `Sheet`: a page on a canvas — the canvas colour, its hairline, the theme's
* card corner (20px in loop) and the shadow a sheet of paper has, lifted off
* card corner (20px in agent) and the shadow a sheet of paper has, lifted off
* what is under it. The page layout draws its page with it; anything that
* shows a page of its own (a document, a gallery entry, a preview) can too.
*
Expand Down
2 changes: 1 addition & 1 deletion src/components/toolbar/ToolbarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function ToolbarButton({
padding: printLabel ? "0 8px" : 0,
margin: 0,
border: "none",
// Follow the active theme: Loop makes controls pills, while every
// Follow the active theme: Agent makes controls pills, while every
// other theme supplies its own control radius through the same token.
borderRadius: "var(--theme-radius-control)",
cursor: disabled ? "not-allowed" : "pointer",
Expand Down
Loading
Loading