Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5b345cd
feat(gamut): selected-row tint, raised table rows and a two-tone Prog…
dreamwasp Nov 4, 2026
b3f6b9b
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Nov 4, 2026
a10b5b2
Merge branch 'cass-gmt-1825-color-components' into cass-gmt-1825-colo…
dreamwasp Nov 5, 2026
1501ed6
Merge branch 'cass-gmt-1825-color-components' into cass-gmt-1825-colo…
dreamwasp Nov 5, 2026
001a5ff
refactor: use the singular --color- prefix for color variables
dreamwasp Nov 10, 2026
ada125d
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Nov 10, 2026
f4189db
fix(gamut-styles): preload each font file once
dreamwasp Nov 13, 2026
7a43810
docs(gamut-agent-tools): cover color-roles in the scope-swap skill
dreamwasp Nov 18, 2026
c0f9a08
docs(gamut-agent-tools): rename the scope-swap skill to gamut-migrati…
dreamwasp Nov 18, 2026
410ecf9
docs(gamut-agent-tools): point the README at the gamut-migration skill
dreamwasp Nov 18, 2026
57aec7d
docs(gamut-agent-tools): drop a duplicated sentence in the migration …
dreamwasp Nov 18, 2026
27561aa
docs(gamut-agent-tools): cover the migration gaps in the gamut-migrat…
dreamwasp Nov 18, 2026
8ca31c0
docs(gamut-agent-tools): explain the palette defaults in the gamut-mi…
dreamwasp Nov 19, 2026
1a2dd78
docs(gamut-agent-tools): add hyper and yellow guidance to the gamut-m…
dreamwasp Nov 19, 2026
42e4a0f
docs(gamut-agent-tools): add blue-500 guidance to the gamut-migration…
dreamwasp Nov 19, 2026
6262f71
docs(gamut-agent-tools): work through open color decisions with the u…
dreamwasp Nov 19, 2026
eada2c2
docs(gamut-agent-tools): stop adding stylis by hand; cover the duplic…
dreamwasp Nov 20, 2026
058d0c7
docs(gamut-agent-tools): add Video peers only for apps that import Video
dreamwasp Nov 20, 2026
b8ca4d1
merge: bring the components layer into the behavior branch
dreamwasp Nov 20, 2026
cebd9ce
Merge remote-tracking branch 'origin/main' into stack-behavior
dreamwasp Nov 20, 2026
87f553c
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
032e6ca
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
1295f5e
test(gamut): the two-tone ProgressBar label renders two decorative co…
dreamwasp Nov 20, 2026
89b87d0
Merge remote-tracking branch 'origin/main' into stack-behavior
dreamwasp Nov 20, 2026
3f610b1
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
15e9d1b
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
282eb5f
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
64e6a1a
Merge branch 'stack-components' into stack-behavior
dreamwasp Nov 20, 2026
8d30f82
Merge commit '32e726434' into stack-behavior
dreamwasp Nov 23, 2026
b3d57b3
Merge branch 'cass-gmt-1825-color-components' into cass-gmt-1825-colo…
dreamwasp Dec 1, 2026
6efdff5
Merge branch 'cass-gmt-1825-color-components' into cass-gmt-1825-colo…
dreamwasp Dec 1, 2026
9d01097
Merge branch 'cass-gmt-1825-color-components' into cass-gmt-1825-colo…
dreamwasp Dec 2, 2026
68e9d5a
merge: bring the updated components into behavior
dreamwasp Dec 2, 2026
dad8bae
merge: bring cass-gmt-1825-color-components into cass-gmt-1825-color-…
dreamwasp Dec 2, 2026
99c96db
merge: bring cass-gmt-1825-color-components into behavior
dreamwasp Dec 2, 2026
5929e2a
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Dec 3, 2026
e8f284f
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Dec 3, 2026
968643a
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Dec 3, 2026
67c4b72
test(gamut): drop per-file @emotion/jest matcher setup from DataGrid …
dreamwasp Dec 3, 2026
94e659f
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Dec 3, 2026
f2bd70e
merge: bring the brand override fixes from white-label (from cass-gmt…
dreamwasp Dec 4, 2026
5f71122
Merge remote-tracking branch 'origin/cass-gmt-1825-color-components' …
dreamwasp Dec 4, 2026
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
9 changes: 9 additions & 0 deletions .changeset/color-roles-component-behavior.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@skillsoft/gamut': minor
---

Component behavior from design's component map that the role swap didn't cover.

- A selected DataList or DataTable row takes the `state-selected` veil over its fill, with the hover veil on top when hovered. `ListRow` takes an `isSelected` prop for the same tint.
- Table rows are `surface-raised`, with `surface-sunken` stripes, instead of transparent.
- ProgressBar's label at `large` and `xl` sizes is two-tone: `text-inverse` on the bar and `text-default` where it runs onto the track, so a short bar's label stays readable.
1 change: 0 additions & 1 deletion .changeset/color-system-brands.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

Brands on the generated color system.

- Color CSS variables keep the `--color-*` names from `main`, in `@skillsoft/variance`'s `createTheme` and in `tokens.css`. Raw CSS that reads `var(--color-…)` needs no changes.
- **Breaking:** `tokens.css` puts its rules in `@layer tokens`, with `reset, base, tokens, recipes, utilities` declared first.
- Adds `originalCodecademyTheme`, today's core colors, fonts and hard-offset elevation rebuilt on the generated system. `tokens.css` carries a palette block per brand under `[data-brand]`.
- A brand can override a palette step with an exact hex, or point a role at a different step (and, optionally, a different alpha) in one mode. Overrides go through the same contrast checks as generated values.
Expand Down
64 changes: 64 additions & 0 deletions packages/gamut/src/DataList/DataGrid.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { setupRtl } from '@skillsoft/gamut-tests';
import type { RenderResult } from '@testing-library/react';
import { screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';

import type { DataGridProps } from './DataGrid';
import { DataGrid } from './DataGrid';
import type { ColumnConfig } from './types';

type Row = { id: string; name: string; sin: string };
type Columns = ColumnConfig<Row>[];

type Props = DataGridProps<Row, 'id', Columns>;

const onRowSelect = vi.fn();
const onRowExpand = vi.fn();
const onQueryChange = vi.fn();

const props = {
id: 'test',
idKey: 'id',
rows: [
{ id: '1', name: 'Hari Seldon', sin: 'Messiah Complex' },
{ id: '2', name: 'Bel Roise', sin: 'Competence' },
{ id: '3', name: 'Cleon II', sin: 'Hubris' },
],
columns: [{ key: 'name' }, { key: 'sin' }],
onRowSelect,
onRowExpand,
onQueryChange,
expandedContent: ({ row: { id } }) => <div>Expanded {id}</div>,
} as Props;

const renderView = setupRtl(DataGrid, props as any) as <
T extends Partial<Props>
>(
props?: T
) => { view: RenderResult };

describe('DataGrid', () => {
describe('Selecting Rows', () => {
it('tints a selected row with the state-selected veil', () => {
renderView({ selected: ['1'] });

const rows = screen.getAllByRole('row');
const selectedRow = screen
.getByRole('checkbox', { name: 'Select 1' })
.closest('tr')!;
const otherRow = screen
.getByRole('checkbox', { name: 'Select 2' })
.closest('tr')!;

expect(rows).toContain(selectedRow);
expect(selectedRow).toHaveStyleRule(
'background-image',
expect.stringContaining('var(--color-state-selected)')
);
expect(otherRow).not.toHaveStyleRule(
'background-image',
expect.stringContaining('var(--color-state-selected)')
);
});
});
});
2 changes: 1 addition & 1 deletion packages/gamut/src/DataList/Tables/Rows/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const TableRow: DataRow = ({
: {};

return (
<ListRow as="tr" {...listRowProps}>
<ListRow as="tr" isSelected={selectable && selected} {...listRowProps}>
{selectable && (
<ListCol
{...listColProps}
Expand Down
20 changes: 17 additions & 3 deletions packages/gamut/src/List/elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export const ListEl = styled('ul', styledOptions<'ul'>())<ListProps>(
space
);

/* A veil as a background layer, so it sits over the row's own fill. */
const veil = (role: 'state-hover' | 'state-selected') =>
`linear-gradient(${theme.colors[role]}, ${theme.colors[role]})`;

const rowStates = states({
isOl: {
'&::before': {
Expand All @@ -81,6 +85,16 @@ const rowStates = states({
transparentBg: {
bg: 'transparent',
},
/*
* A selected row takes the `state-selected` veil over its own fill
* (design's list map). Hovering it stacks the hover veil on top.
*/
isSelected: {
backgroundImage: veil('state-selected'),
'&:hover': {
backgroundImage: `${veil('state-hover')}, ${veil('state-selected')}`,
},
},
});

const interactiveState = states({
Expand All @@ -89,7 +103,7 @@ const interactiveState = states({

/* Hover is a veil over the row's own fill; focus is the ring alone. */
'&:hover': {
backgroundImage: `linear-gradient(${theme.colors['state-hover']}, ${theme.colors['state-hover']})`,
backgroundImage: veil('state-hover'),
},
'&:focus-visible, &:focus-within': {
outline: `1px solid ${theme.colors['action-primary']}`,
Expand Down Expand Up @@ -132,9 +146,9 @@ const rowVariants = variant({
borderColorTop: 'border-subtle',
},
},
/* Rows are `surface-raised`; a stripe is sunken, so it never reads as a selection. */
table: {
bg: 'transparent',
/* A stripe is a sunken surface, so it never reads as a selection. */
bg: 'surface-raised',
'&:nth-of-type(2n)': {
bg: 'surface-sunken',
},
Expand Down
11 changes: 7 additions & 4 deletions packages/gamut/src/ProgressBar/ProgressBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ export const Large: Story = {
},
play: async ({ canvas }) => {
canvas.getByText('Progress: 75%');
await expect(canvas.getByText('75%')).toHaveAttribute(
'aria-hidden',
'true'
);
// Two copies of the label (track and bar), both decorative: the screen
// reader value comes from the visually hidden "Progress" label.
const copies = canvas.getAllByText('75%');
await expect(copies).toHaveLength(2);
for (const copy of copies) {
await expect(copy.closest('[aria-hidden="true"]')).not.toBeNull();
}
},
};

Expand Down
32 changes: 32 additions & 0 deletions packages/gamut/src/ProgressBar/ProgressBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,35 @@ describe('ProgressBar', () => {
}
);
});

describe('ProgressBar label', () => {
const renderBar = (props: Partial<ProgressBarProps> = {}) =>
render(
<MockGamutProvider>
<ProgressBar percent={10} variant="default" {...props} />
</MockGamutProvider>
);

/* Design's two-tone label: text-inverse on the bar, text-default on the track. */
it('draws the label on the bar and on the track at large sizes', () => {
renderBar({ size: 'large' });

const labels = screen.getAllByText('10%');
expect(labels).toHaveLength(2);
expect(screen.getByTestId('progress-bar-bar')).toContainElement(labels[1]);
expect(labels[0].parentElement).toHaveStyleRule(
'color',
'var(--color-text-default)'
);
expect(screen.getByTestId('progress-bar-bar')).toHaveStyleRule(
'overflow',
'hidden'
);
});

it('draws no label at small sizes', () => {
renderBar({ size: 'small' });

expect(screen.queryByText('10%')).toBeNull();
});
});
34 changes: 31 additions & 3 deletions packages/gamut/src/ProgressBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
import type { PatternProps } from '@skillsoft/gamut-patterns';
import { variant } from '@skillsoft/gamut-styles';
import { css, variant } from '@skillsoft/gamut-styles';
import * as React from 'react';

import { Box } from '../Box';
Expand Down Expand Up @@ -116,6 +116,8 @@ const progressBarForegroundVariants = variant({
display: 'flex',
transition: 'width 0.5s',
position: 'relative',
/* Clips the bar's copy of the label to the bar. */
overflow: 'hidden',
},
/* Every bar is `text-default`, blue and yellow included. */
variants: {
Expand Down Expand Up @@ -156,9 +158,28 @@ const DisplayedPercent = styled.span`
font-weight: bold;
padding: 0.5rem;
text-align: right;
white-space: nowrap;
width: 100%;
`;

/*
* Design's two-tone label: `text-inverse` where it sits on the bar,
* `text-default` where it runs onto the track. The track's copy sits at the
* same place under the bar, so the bar covers it and the wrapper clips it.
*/
const TrackLabel = styled(Box)(
css({
alignItems: 'center',
color: 'text-default',
display: 'flex',
height: '100%',
left: 0,
position: 'absolute',
top: 0,
transition: 'width 0.5s',
})
);

export const ProgressBar: React.FC<ProgressBarProps> = ({
flat,
minimumPercent = 0,
Expand All @@ -168,6 +189,8 @@ export const ProgressBar: React.FC<ProgressBarProps> = ({
variant,
}) => {
const id = React.useId();
const width = `${Math.max(minimumPercent, percent)}%`;
const showLabel = ['large', 'xl'].includes(size);
return (
<ProgressBarWrapper
aria-labelledby={id}
Expand All @@ -180,14 +203,19 @@ export const ProgressBar: React.FC<ProgressBarProps> = ({
>
<Text as="label" id={id} screenreader>{`Progress: ${percent}%`}</Text>
{Pattern && <Pattern position="absolute" width="100%" zIndex={0} />}
{showLabel && (
<TrackLabel aria-hidden width={width}>
<DisplayedPercent>{percent}%</DisplayedPercent>
</TrackLabel>
)}
<Bar
borderRadiusBottomRight={flat ? 'none' : 'inherit'}
borderRadiusTopRight={flat ? 'none' : 'inherit'}
data-testid="progress-bar-bar"
variant={variant}
width={`${Math.max(minimumPercent, percent)}%`}
width={width}
>
{['large', 'xl'].includes(size) && (
{showLabel && (
<DisplayedPercent aria-hidden>{percent}%</DisplayedPercent>
)}
</Bar>
Expand Down
Loading