@codecademy/styleguide 79.0.1-alpha.b3f84e.0 → 79.0.1-alpha.c4250e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,10 +46,14 @@ const preview: Preview = {
46
46
  [
47
47
  'About',
48
48
  'Best Practices',
49
- 'ESLint rules',
50
49
  'Contributing',
50
+ 'ESLint rules',
51
51
  'FAQs',
52
52
  'Stories',
53
+ 'Brand',
54
+ 'Installation',
55
+ 'Usage Guide',
56
+ 'MCP',
53
57
  ],
54
58
  'Foundations',
55
59
  'Layouts',
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ### [79.0.1-alpha.b3f84e.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.0.0...@codecademy/styleguide@79.0.1-alpha.b3f84e.0) (2026-01-29)
6
+ ### [79.0.1-alpha.c4250e.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.0.0...@codecademy/styleguide@79.0.1-alpha.c4250e.0) (2026-02-06)
7
7
 
8
8
  **Note:** Version bump only for package @codecademy/styleguide
9
9
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@codecademy/styleguide",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "79.0.1-alpha.b3f84e.0",
4
+ "version": "79.0.1-alpha.c4250e.0",
5
5
  "author": "Codecademy Engineering",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
10
  "repository": "git@github.com:Codecademy/gamut.git",
11
- "gitHead": "3d98d84d938c1cc17ecb832b2ac9310c4b0e9188"
11
+ "gitHead": "3d72b42d9d95cfc33da7363e56e43c4be98f7a3e"
12
12
  }
@@ -124,7 +124,7 @@ Use `sm` when the `Badge` is inline with other components such as <LinkTo id='Ty
124
124
 
125
125
  ## Leading icon
126
126
 
127
- Include the `icon` property when the icon reinforces the badges message and improves scannability. Since badges are inherently small, it's recommended to use Gamut's mini icons. Below are examples of using icons with the different `Badge` sizes.
127
+ Include the `icon` property when the icon reinforces the badge's message and improves scannability. Since badges are inherently small, it's recommended to use Gamut's mini icons. Below are examples of using icons with the different `Badge` sizes.
128
128
 
129
129
  ### Default size with icon
130
130
 
@@ -21,7 +21,7 @@ When using custom properties or our standard <LinkTo id="Foundations/System/Prop
21
21
 
22
22
  Composing functions has several benefits:
23
23
 
24
- 1. Predictable CSS - Guard against possible bugs and unexpected behavior.
24
+ 1. Predictable CSS - Guard against possible bugs and unexpected behvior.
25
25
  1. Type Simplification - Less typescript boiler plate and better type inference
26
26
 
27
27
  ## Usage
@@ -13,6 +13,7 @@ import { parameters as deepControlsParameters } from './Deep Controls Add-On.mdx
13
13
  import { parameters as eslintRulesParameters } from './ESLint rules.mdx';
14
14
  import { parameters as faqsParameters } from './FAQs.mdx';
15
15
  import { parameters as installationParameters } from './Installation.mdx';
16
+ import { parameters as mcpAboutParameters } from './MCP/About.mdx';
16
17
  import { parameters as storiesParameters } from './Stories.mdx';
17
18
  import { parameters as usageGuideParameters } from './Usage Guide.mdx';
18
19
 
@@ -38,5 +39,6 @@ export const parameters = {
38
39
  brandParameters,
39
40
  installationParameters,
40
41
  usageGuideParameters,
42
+ mcpAboutParameters,
41
43
  ])}
42
44
  />
@@ -0,0 +1,28 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ import {
4
+ AboutHeader,
5
+ addParentPath,
6
+ TableOfContents,
7
+ } from '~styleguide/blocks';
8
+
9
+ import { parameters as codeConnectParameters } from './Code Connect.mdx';
10
+ import { parameters as figmaMcpParameters } from './Figma MCP.mdx';
11
+
12
+ export const parameters = {
13
+ id: 'Meta/MCP',
14
+ title: 'MCP',
15
+ subtitle: 'Documentation related to the Figma Model Context Protocol exclusive to Codecademy + Skillsoft employees.',
16
+ status: 'static',
17
+ };
18
+
19
+ <Meta title="Meta/MCP/About" />
20
+
21
+ <AboutHeader {...parameters} />
22
+
23
+ <TableOfContents
24
+ links={addParentPath(parameters.id, [
25
+ codeConnectParameters,
26
+ figmaMcpParameters,
27
+ ])}
28
+ />
@@ -0,0 +1,38 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ import { AboutHeader, Callout, ImageWrapper } from '~styleguide/blocks';
4
+
5
+ export const parameters = {
6
+ id: 'Code Connect',
7
+ title: 'Code Connect',
8
+ subtitle: 'Exploring Code Connect features in Figma.',
9
+ status: 'static',
10
+ };
11
+
12
+ <Meta title="Meta/MCP/Code Connect" />
13
+
14
+ <AboutHeader {...parameters} />
15
+
16
+ Code Connect provides Figma with the actual code for Figma components. In providing accurate code, this helps the Figma MCP generate accurate code snippets for designs that use these components.
17
+
18
+ More information can be found at [Figma Code Connect documentation](https://www.figma.com/code-connect-docs/)
19
+
20
+ <Callout text="Any changes to Code Connect files should be requested through the Gamut team and NOT done on an individual or a separate team." />
21
+
22
+ ## Code Connected components
23
+
24
+ When visiting the Figma file, you'll know if a component is set up with Code Connect if you select the component and see the sidebar includes a "Code Connect" section.
25
+
26
+ <ImageWrapper
27
+ src="./mcp/component_with_code_connect.png"
28
+ alt="A Figma component, Badge, with the Code Connect sidebar open."
29
+ />
30
+
31
+ ### Exploring behavior
32
+
33
+ For components with Code Connect, you can also click on the "Explore behavior" button to open a modal that allows you to edit the component's props. Editing these props will automatically update the code in the modal's Code Connect section to give you a sense of how to adapt your component accordingly.
34
+
35
+ <ImageWrapper
36
+ src="./mcp/component_playground.png"
37
+ alt="The 'Component playground' modal, with the Badge component's props editable."
38
+ />
@@ -0,0 +1,89 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ import { AboutHeader, Callout } from '~styleguide/blocks';
4
+
5
+ export const parameters = {
6
+ id: 'Figma MCP',
7
+ title: 'Figma MCP',
8
+ subtitle:
9
+ 'Set up the Figma MCP locally to enable design to code generation, exclusive to Codecademy + Skillsoft employees.',
10
+ status: 'static',
11
+ };
12
+
13
+ <Meta title="Meta/MCP/Figma MCP" />
14
+
15
+ <AboutHeader {...parameters} />
16
+
17
+ <Callout text="Any MCP generated code is EXPERIMENTAL! You should always validate the code generated and adapt it to your own needs — do NOT simply use the MCP to generate code and push it to production! Additionally, you must have a Dev or Full account to be able to be able to use the Figma MCP." />
18
+
19
+ The offical guidance and documentation comes from Figma. Please reference [Figma Dev Mode MCP documentation](https://help.figma.com/hc/en-us/articles/32132100833559-Guide-to-the-Dev-Mode-MCP-Server) for the most up to date information. This documentation below has been adapted to fit the context of the Gamut repository.
20
+
21
+ ## Figma (desktop client app)
22
+
23
+ Go to [Figma's download page](https://www.figma.com/downloads/) to download the appropriate version of the Figma desktop client for your OS.
24
+
25
+ ### Start up local Figma MCP server
26
+
27
+ 1. In the Figma desktop client, check that you have dev mode enabled.
28
+ 2. The right-hand sidebar should have a "MCP server" section
29
+ 3. Click on the "Open settings modal" button
30
+ 4. In the modal, toggle the status to "On", the the color of the toggle should be green.
31
+ OR
32
+ 5. Click on the Figma icon in the top left-hand corner and select "Actions"
33
+ 6. Type "Enable desktop MCP server"
34
+ 7. Click on the checkbox, if it's not already checked, to enable the MCP server.
35
+
36
+ ## Set up MCP Client for your text editor/IDE
37
+
38
+ We currently support Figma MCP for Cursor. Please let the Gamut team know if you'd like support for other editors.
39
+
40
+ ### Cursor
41
+
42
+ 1. Open **Cursor** → **Settings** → **Cursor Settings**.
43
+ 2. Go to the **MCP** tab (might be called **MCP & Integrations**) from the left-hand sidebar.
44
+ 3. Under **MCP Tools**, click **+ Add MCP server**.
45
+ 4. Enter the following configuration and save:
46
+
47
+ ```
48
+ {
49
+ "mcpServers": {
50
+ "Figma": {
51
+ "url": "http://127.0.0.1:3845/mcp"
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ ### Verify your MCP server is running
58
+
59
+ To check if your MCP server is running, you can visit the endpoint: `http://127.0.0.1:3845/mcp`. You should see a response, e.g.: `{"jsonrpc":"2.0","error":{"code":-32001,"message":"Invalid sessionId"},"id":null}`.
60
+ Yes, it's an odd response, but it indicates that the MCP server is running — otherwise if it's not running you'll see an error "This site can’t be reached" on the page.
61
+
62
+ Similarly you can test the end point using:
63
+
64
+ ```bash
65
+ curl http://127.0.0.1:3845/mcp
66
+ ```
67
+
68
+ ## Prompt your MCP client
69
+
70
+ You can prompt the MCP in two main ways:
71
+
72
+ 1. Provide a link to the node of the design you'd like to generate code for, e.g.:
73
+
74
+ > Generate the code for this node: https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=79202-13690&m=dev
75
+
76
+ 2. Selecting the node in the Figma interface, e.g.:
77
+ > Generate the code for the current selection
78
+
79
+ In the chat, you may be prompted to allow the Figma commands like `get_code()` to run. You can also add these commands to an allow list in your code editor's settings.
80
+
81
+ ## Feedback for the Gamut team
82
+
83
+ Please let the Gamut team of any feedback you have, things like:
84
+
85
+ - If you find that a new rule that you'd like implemented in this repo, please let the Gamut team know.
86
+ - Support for another text editor/IDE.
87
+ - Incorrect code generation
88
+
89
+ If you have any other feedback or suggestions, feel free to share those as well!
@@ -62,7 +62,7 @@ Use an alert to display an important, succinct message with actions for users to
62
62
  4. Dismiss button (optional)
63
63
 
64
64
  - Use to allow users to remove the alert after they've acknowledged it or when it's no longer needed
65
- - Only exclude when the information must remain visible until specific conditions are met to ensure users dont miss critical information
65
+ - Only exclude when the information must remain visible until specific conditions are met to ensure users don't miss critical information
66
66
 
67
67
  ## Variants
68
68
 
@@ -80,7 +80,6 @@ export const Above: Story = {
80
80
  export const Below: Story = {
81
81
  render: (args) => <PopoverExample {...args} beak="center" position="below" />,
82
82
  };
83
-
84
83
  export const CenterLeft: Story = {
85
84
  render: (args) => (
86
85
  <PopoverExample
@@ -114,7 +113,6 @@ export const PopoverCheckerDense: Story = {
114
113
  />
115
114
  ),
116
115
  };
117
-
118
116
  export const PopoverCheckerLoose: Story = {
119
117
  render: (args) => (
120
118
  <PopoverExample
@@ -124,7 +122,6 @@ export const PopoverCheckerLoose: Story = {
124
122
  />
125
123
  ),
126
124
  };
127
-
128
125
  export const PopoverCheckerRegular: Story = {
129
126
  render: (args) => (
130
127
  <PopoverExample
@@ -134,7 +131,6 @@ export const PopoverCheckerRegular: Story = {
134
131
  />
135
132
  ),
136
133
  };
137
-
138
134
  export const PopoverDiagonalADense: Story = {
139
135
  render: (args) => (
140
136
  <PopoverExample
@@ -144,7 +140,6 @@ export const PopoverDiagonalADense: Story = {
144
140
  />
145
141
  ),
146
142
  };
147
-
148
143
  export const PopoverDiagonalALoose: Story = {
149
144
  render: (args) => (
150
145
  <PopoverExample
@@ -154,7 +149,6 @@ export const PopoverDiagonalALoose: Story = {
154
149
  />
155
150
  ),
156
151
  };
157
-
158
152
  export const PopoverDiagonalARegular: Story = {
159
153
  render: (args) => (
160
154
  <PopoverExample