Skip to content

Commit 1bbb742

Browse files
authored
Merge branch 'main' into cass-gm-833
2 parents 48d94e4 + 73d4cc4 commit 1bbb742

File tree

8 files changed

+383
-536
lines changed

8 files changed

+383
-536
lines changed

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,25 @@
2424
"@codecademy/tsconfig": "^0.3.0",
2525
"@emotion/babel-plugin": "11.11.0",
2626
"@emotion/jest": "^11.11.0",
27-
"@mdx-js/react": "^3.1.0",
2827
"@nx/jest": "21.4.0",
2928
"@nx/js": "21.4.0",
3029
"@nx/react": "21.4.0",
3130
"@nx/storybook": "21.4.0",
3231
"@nx/web": "21.4.0",
3332
"@nx/webpack": "21.4.0",
34-
"@storybook/addon-controls": "8.3.6",
33+
"@storybook/addon-controls": "8.6.15",
3534
"@storybook/addon-designs": "^8.0.3",
36-
"@storybook/addon-docs": "^8.3.6",
37-
"@storybook/addon-essentials": "^8.3.6",
38-
"@storybook/addon-links": "^8.3.6",
35+
"@storybook/addon-docs": "^8.6.15",
36+
"@storybook/addon-essentials": "^8.6.15",
37+
"@storybook/addon-links": "^8.6.15",
3938
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
40-
"@storybook/blocks": "^8.3.6",
41-
"@storybook/core-server": "8.3.6",
42-
"@storybook/docs-tools": "^8.3.6",
39+
"@storybook/blocks": "^8.6.15",
40+
"@storybook/core-server": "8.6.15",
41+
"@storybook/docs-tools": "^8.6.15",
4342
"@storybook/icons": "1.2.12",
44-
"@storybook/manager-api": "^8.3.6",
45-
"@storybook/react-webpack5": "^8.3.6",
46-
"@storybook/theming": "^8.3.6",
43+
"@storybook/manager-api": "^8.6.15",
44+
"@storybook/react-webpack5": "^8.6.15",
45+
"@storybook/theming": "^8.6.15",
4746
"@svgr/cli": "5.5.0",
4847
"@testing-library/dom": "^8.11.1",
4948
"@testing-library/jest-dom": "^5.16.1",
@@ -86,7 +85,7 @@
8685
"onchange": "^7.0.2",
8786
"prettier": "^2.8.7",
8887
"react-test-renderer": "18.3.1",
89-
"storybook": "^8.3.6",
88+
"storybook": "^8.6.15",
9089
"storybook-addon-deep-controls": "^0.9.5",
9190
"style-loader": "^4.0.0",
9291
"svgo": "^1.3.2",

packages/styleguide/.storybook/components/Elements/DocsContainer.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
AssetProvider,
33
coreTheme,
44
createEmotionCache,
5-
css,
65
GamutProvider,
76
platformPalette,
87
adminTheme,
@@ -12,18 +11,13 @@ import {
1211
platformTheme,
1312
ColorMode,
1413
} from '@codecademy/gamut-styles';
15-
import { MDXProvider } from '@mdx-js/react';
1614
import {
17-
CodeOrSourceMdx,
1815
DocsContainer as StorybookDocsContainer,
1916
DocsContextProps,
20-
HeadersMdx,
2117
SourceContainer,
2218
} from '@storybook/blocks';
23-
import { components as htmlComponents } from '@storybook/components';
24-
import { styled, ThemeProvider } from '@storybook/theming';
19+
import { ThemeProvider } from '@storybook/theming';
2520
import { useMemo } from 'react';
26-
import { Link } from './Markdown';
2721
import { HelmetProvider } from 'react-helmet-async';
2822
import theme from '../../theming/GamutTheme';
2923
import { createTheme } from '@codecademy/variance';
@@ -39,21 +33,6 @@ const themeMap = {
3933
platform: platformTheme,
4034
} as const;
4135

42-
const WrappedPre = styled(htmlComponents.pre)(
43-
// gives the source block a white background - pretty fragile but easy to change if needed
44-
css({
45-
'.docblock-source, .css-5owncf': { backgroundColor: 'background' },
46-
})
47-
);
48-
49-
const defaultComponents = {
50-
...htmlComponents,
51-
code: CodeOrSourceMdx,
52-
pre: WrappedPre,
53-
...HeadersMdx,
54-
a: Link as any,
55-
};
56-
5736
const themeSpecificStories = {
5837
'foundations-theme-lx-studio-theme--docs': 'lxStudio',
5938
'foundations-theme-percipio-theme--docs': 'percipio',
@@ -104,11 +83,7 @@ export const DocsContainer: React.FC<{
10483
<AssetProvider />
10584
</HelmetProvider>
10685
<SourceContainer channel={context.channel}>
107-
<ThemeProvider theme={currentTheme}>
108-
<MDXProvider components={defaultComponents}>
109-
{children}
110-
</MDXProvider>
111-
</ThemeProvider>
86+
<ThemeProvider theme={currentTheme}>{children}</ThemeProvider>
11287
</SourceContainer>
11388
</ColorMode>
11489
</GamutProvider>

packages/styleguide/.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const config: StorybookConfig = {
4545
config.resolve = {
4646
...config.resolve,
4747
alias: {
48+
...config.resolve?.alias,
4849
'~styleguide/blocks': resolve(__dirname, './components/'),
4950
'~styleguide/argTypes': resolve(__dirname, './argTypes/'),
5051
'@codecademy/gamut-styles$': resolve(

packages/styleguide/.storybook/preview.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,27 @@ import { Preview } from '@storybook/react';
22

33
import theme from './theming/GamutTheme';
44
import { withEmotion } from './theming/GamutThemeProvider';
5-
import { breakpoints } from '@codecademy/gamut-styles';
5+
import { breakpoints, css } from '@codecademy/gamut-styles';
66
import { DocsContainer } from './components/Elements/DocsContainer';
7+
import { CodeOrSourceMdx, HeadersMdx } from '@storybook/blocks';
8+
import { components as htmlComponents } from '@storybook/components';
9+
import { styled } from '@storybook/theming';
10+
import { Link } from './components/Elements/Markdown';
11+
12+
const WrappedPre = styled(htmlComponents.pre)(
13+
// gives the source block a white background - pretty fragile but easy to change if needed
14+
css({
15+
'.docblock-source, .css-5owncf': { backgroundColor: 'background' },
16+
})
17+
);
18+
19+
const mdxComponents = {
20+
...htmlComponents,
21+
code: CodeOrSourceMdx,
22+
pre: WrappedPre,
23+
...HeadersMdx,
24+
a: Link as any,
25+
};
726

827
const preview: Preview = {
928
parameters: {
@@ -15,6 +34,7 @@ const preview: Preview = {
1534
container: DocsContainer,
1635
theme: theme,
1736
toc: { headingSelector: 'h1, h2, h3' },
37+
mdxComponents,
1838
},
1939
options: {
2040
storySort: {

packages/styleguide/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
### [78.5.4](https://github.com/Codecademy/gamut/compare/@codecademy/[email protected]...@codecademy/[email protected]) (2025-12-18)
7+
8+
**Note:** Version bump only for package @codecademy/styleguide
9+
10+
### [78.5.3](https://github.com/Codecademy/gamut/compare/@codecademy/[email protected]...@codecademy/[email protected]) (2025-12-12)
11+
12+
**Note:** Version bump only for package @codecademy/styleguide
13+
614
### [78.5.2](https://github.com/Codecademy/gamut/compare/@codecademy/[email protected]...@codecademy/[email protected]) (2025-12-08)
715

816
**Note:** Version bump only for package @codecademy/styleguide

packages/styleguide/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@codecademy/styleguide",
33
"description": "Styleguide & Component library for codecademy.com",
4-
"version": "78.5.2",
4+
"version": "78.5.4",
55
"author": "Codecademy Engineering",
66
"license": "MIT",
77
"publishConfig": {

packages/styleguide/src/lib/Atoms/Icons/About.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const parameters = {
4242
3. You should be using the Icon from Streamline, NOT Figma.
4343
2. If it doesn't already have it add the streamline slug (IE: `delete-1`) as the SVG title if it does not already exist and ensure the viewBox is set to `viewBox="0 0 24 24"`. Preserve the source URL, add any relevent comments, and disregard the asset size.
4444
3. Add the SVG asset to the appropriate folder in `packages/gamut-icons/src/svg/` - either [regular](https://github.com/Codecademy/gamut/tree/main/packages/gamut-icons) or [mini](https://github.com/Codecademy/gamut/tree/main/packages/gamut-icons/mini).
45-
1. Regular Icons should follow the naming convention: `<ICON_NAME>Icon.svg`. (e.g. `AddIcon.svg`)
46-
2. Mini Icons should follow the naming convention: `Mini<ICON_NAME>Icon.svg` (e.g. `MiniStarIcon.svg`).
45+
1. Regular Icons should follow the naming convention: `<icon_name>-icon.svg` (e.g. `add-icon.svg` or `alarm-clock-icon.svg`)
46+
2. Mini Icons should follow the naming convention: `mini-<icon_name>-icon.svg` (e.g. `mini-star-icon.svg`)
4747
4. Run `yarn build-all && yarn start` to see the icon add to Storybook.
4848
1. Regular Icons will by default be added to the `Interface` section alphabetically, however, you may change this in the config. I.e. if you added an icon that should belong in the `Vendor` section, you can make this change in the `constants.tsx` file.
4949
5. Make a PR describing where you got the Icon, what its use is with a description of its naming choice.

0 commit comments

Comments
 (0)