@codecademy/styleguide 79.3.1-alpha.4ae770.0 → 79.3.1-alpha.b86be7.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.
Files changed (184) hide show
  1. package/.storybook/components/Elements/DocsContainer.tsx +2 -2
  2. package/.storybook/components/Elements/StorySource.tsx +2 -2
  3. package/.storybook/components/Headers/ComponentHeader.tsx +1 -1
  4. package/.storybook/main.ts +3 -20
  5. package/.storybook/manager.ts +1 -1
  6. package/.storybook/preview.ts +11 -9
  7. package/.storybook/theming/GamutTheme.ts +1 -1
  8. package/CHANGELOG.md +2 -5
  9. package/package.json +2 -2
  10. package/project.json +0 -9
  11. package/src/lib/About.mdx +1 -1
  12. package/src/lib/Atoms/About.mdx +1 -1
  13. package/src/lib/Atoms/Animations/About.mdx +1 -1
  14. package/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.mdx +1 -1
  15. package/src/lib/Atoms/Animations/FadeInSlideOut/FadeInSlideOut.mdx +1 -1
  16. package/src/lib/Atoms/Animations/Rotation/Rotation.mdx +1 -1
  17. package/src/lib/Atoms/Badge/Badge.mdx +1 -1
  18. package/src/lib/Atoms/Buttons/About.mdx +1 -1
  19. package/src/lib/Atoms/Buttons/Button/Button.mdx +1 -1
  20. package/src/lib/Atoms/Buttons/CTAButton/CTAButton.mdx +1 -1
  21. package/src/lib/Atoms/Buttons/FillButton/FillButton.mdx +1 -1
  22. package/src/lib/Atoms/Buttons/IconButton/IconButton.mdx +1 -1
  23. package/src/lib/Atoms/Buttons/StrokeButton/StrokeButton.mdx +1 -1
  24. package/src/lib/Atoms/Buttons/TextButton/TextButton.mdx +1 -1
  25. package/src/lib/Atoms/Card/Card.mdx +1 -1
  26. package/src/lib/Atoms/Drawer/Drawer.mdx +1 -1
  27. package/src/lib/Atoms/FeatureShimmer/FeatureShimmer.mdx +1 -1
  28. package/src/lib/Atoms/FormElements/About.mdx +1 -1
  29. package/src/lib/Atoms/FormElements/Form/Form.mdx +1 -1
  30. package/src/lib/Atoms/FormElements/FormGroup/FormGroup.mdx +1 -1
  31. package/src/lib/Atoms/FormElements/FormGroupDescription/FormGroupDescription.mdx +1 -1
  32. package/src/lib/Atoms/FormElements/FormGroupLabel/FormGroupLabel.mdx +1 -1
  33. package/src/lib/Atoms/FormElements/FormRequiredText/FormRequiredText.mdx +1 -1
  34. package/src/lib/Atoms/FormInputs/About.mdx +1 -1
  35. package/src/lib/Atoms/FormInputs/Checkbox/Checkbox.mdx +1 -1
  36. package/src/lib/Atoms/FormInputs/Input/Input.mdx +1 -1
  37. package/src/lib/Atoms/FormInputs/Radio/Radio.mdx +1 -1
  38. package/src/lib/Atoms/FormInputs/Select/Select.mdx +1 -1
  39. package/src/lib/Atoms/FormInputs/SelectDropdown/SelectDropdown.mdx +1 -1
  40. package/src/lib/Atoms/FormInputs/TextArea/TextArea.mdx +3 -2
  41. package/src/lib/Atoms/FormInputs/TextArea/TextArea.stories.tsx +74 -1
  42. package/src/lib/Atoms/Icons/About.mdx +1 -1
  43. package/src/lib/Atoms/Icons/Mini/Mini.mdx +1 -1
  44. package/src/lib/Atoms/Icons/Regular/Regular.mdx +1 -1
  45. package/src/lib/Atoms/Illustrations/Illustrations.mdx +1 -1
  46. package/src/lib/Atoms/InternalFloatingCard/InternalFloatingCard.mdx +1 -1
  47. package/src/lib/Atoms/Loaders/About.mdx +1 -1
  48. package/src/lib/Atoms/Loaders/Shimmer/Shimmer.mdx +1 -1
  49. package/src/lib/Atoms/Loaders/Spinner/Spinner.mdx +1 -1
  50. package/src/lib/Atoms/Patterns/Patterns.mdx +1 -1
  51. package/src/lib/Atoms/PopoverContainer/PopoverContainer.mdx +1 -1
  52. package/src/lib/Atoms/ProgressBar/ProgressBar.mdx +1 -1
  53. package/src/lib/Atoms/RadialProgress/RadialProgress.mdx +1 -1
  54. package/src/lib/Atoms/SkipToContent/SkipToContent.mdx +1 -1
  55. package/src/lib/Atoms/Tag/Tag.mdx +1 -1
  56. package/src/lib/Atoms/Toggle/Toggle.mdx +1 -1
  57. package/src/lib/Atoms/UtilityComponents/About.mdx +1 -1
  58. package/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.mdx +1 -1
  59. package/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.mdx +1 -1
  60. package/src/lib/Foundations/About.mdx +1 -1
  61. package/src/lib/Foundations/ColorMode/ColorMode.mdx +1 -1
  62. package/src/lib/Foundations/Layout.mdx +1 -1
  63. package/src/lib/Foundations/System/About.mdx +1 -1
  64. package/src/lib/Foundations/System/Compose.mdx +1 -1
  65. package/src/lib/Foundations/System/Props/About.mdx +1 -1
  66. package/src/lib/Foundations/System/Props/Background.mdx +1 -1
  67. package/src/lib/Foundations/System/Props/Border.mdx +1 -1
  68. package/src/lib/Foundations/System/Props/Color.mdx +1 -1
  69. package/src/lib/Foundations/System/Props/Flex.mdx +1 -1
  70. package/src/lib/Foundations/System/Props/Grid.mdx +1 -1
  71. package/src/lib/Foundations/System/Props/Layout.mdx +1 -1
  72. package/src/lib/Foundations/System/Props/List.mdx +1 -1
  73. package/src/lib/Foundations/System/Props/Positioning.mdx +1 -1
  74. package/src/lib/Foundations/System/Props/Shadow.mdx +1 -1
  75. package/src/lib/Foundations/System/Props/Space.mdx +1 -1
  76. package/src/lib/Foundations/System/Props/Typography.mdx +1 -1
  77. package/src/lib/Foundations/System/ResponsiveProperties/ResponsiveProperties.mdx +1 -1
  78. package/src/lib/Foundations/System/Variants.mdx +1 -1
  79. package/src/lib/Foundations/Theme/About.mdx +1 -1
  80. package/src/lib/Foundations/Theme/AdminTheme.mdx +1 -1
  81. package/src/lib/Foundations/Theme/CoreTheme.mdx +1 -1
  82. package/src/lib/Foundations/Theme/CreatingThemes.mdx +1 -1
  83. package/src/lib/Foundations/Theme/LXStudioTheme.mdx +1 -1
  84. package/src/lib/Foundations/Theme/PercipioTheme.mdx +1 -1
  85. package/src/lib/Foundations/Theme/PlatformTheme.mdx +1 -1
  86. package/src/lib/Foundations/Typography.mdx +1 -1
  87. package/src/lib/Foundations/Utilities/Utilities.mdx +1 -1
  88. package/src/lib/Layouts/About.mdx +1 -1
  89. package/src/lib/Layouts/Boxes/About.mdx +1 -1
  90. package/src/lib/Layouts/Boxes/Box/Box.mdx +1 -1
  91. package/src/lib/Layouts/Boxes/FlexBox/FlexBox.mdx +1 -1
  92. package/src/lib/Layouts/Boxes/GridBox/GridBox.mdx +1 -1
  93. package/src/lib/Layouts/ContentContainer/ContentContainer.mdx +1 -1
  94. package/src/lib/Layouts/LayoutGrid/LayoutGrid.mdx +1 -1
  95. package/src/lib/Meta/About.mdx +1 -1
  96. package/src/lib/Meta/Best practices.mdx +1 -1
  97. package/src/lib/Meta/Brand.mdx +1 -1
  98. package/src/lib/Meta/Contributing.mdx +1 -1
  99. package/src/lib/Meta/Deep Controls add-on.mdx +1 -1
  100. package/src/lib/Meta/ESLint rules.mdx +1 -1
  101. package/src/lib/Meta/FAQs.mdx +1 -1
  102. package/src/lib/Meta/Gamut writing guide/About.mdx +1 -1
  103. package/src/lib/Meta/Gamut writing guide/Documentation in code.mdx +1 -1
  104. package/src/lib/Meta/Gamut writing guide/Formatting.mdx +1 -1
  105. package/src/lib/Meta/Gamut writing guide/General principles.mdx +1 -1
  106. package/src/lib/Meta/Gamut writing guide/Language and grammar.mdx +1 -1
  107. package/src/lib/Meta/Gamut writing guide/Linking.mdx +1 -1
  108. package/src/lib/Meta/Gamut writing guide/Referencing code.mdx +1 -1
  109. package/src/lib/Meta/Gamut writing guide/Stories/About pages.mdx +1 -1
  110. package/src/lib/Meta/Gamut writing guide/Stories/About.mdx +1 -1
  111. package/src/lib/Meta/Gamut writing guide/Stories/Component code examples.mdx +1 -1
  112. package/src/lib/Meta/Gamut writing guide/Stories/Component story documentation.mdx +3 -3
  113. package/src/lib/Meta/Installation.mdx +1 -1
  114. package/src/lib/Meta/Logical and physical CSS properties.mdx +1 -1
  115. package/src/lib/Meta/MCP/About.mdx +1 -1
  116. package/src/lib/Meta/MCP/Code Connect.mdx +1 -1
  117. package/src/lib/Meta/MCP/Figma MCP.mdx +1 -1
  118. package/src/lib/Meta/Usage guide.mdx +1 -1
  119. package/src/lib/Molecules/About.mdx +1 -1
  120. package/src/lib/Molecules/AccordionButtonDeprecated/AccordionButtonDeprecated.mdx +1 -1
  121. package/src/lib/Molecules/AccordionDeprecated/AccordionDeprecated.mdx +1 -1
  122. package/src/lib/Molecules/Alert/Alert.mdx +1 -1
  123. package/src/lib/Molecules/Breadcrumbs/Breadcrumbs.mdx +1 -1
  124. package/src/lib/Molecules/Coachmark/Coachmark.mdx +1 -1
  125. package/src/lib/Molecules/Disclosure/Disclosure.mdx +1 -1
  126. package/src/lib/Molecules/Flyout/Flyout.mdx +1 -1
  127. package/src/lib/Molecules/Menu/Menu.mdx +1 -1
  128. package/src/lib/Molecules/Modals/About.mdx +1 -1
  129. package/src/lib/Molecules/Modals/Dialog/Dialog.mdx +1 -1
  130. package/src/lib/Molecules/Modals/Modal/Modal.mdx +1 -1
  131. package/src/lib/Molecules/Modals/Overlay/Overlay.mdx +1 -1
  132. package/src/lib/Molecules/Pagination/Pagination.mdx +1 -1
  133. package/src/lib/Molecules/Popover/Popover.mdx +1 -1
  134. package/src/lib/Molecules/Tabs/Tabs.mdx +1 -1
  135. package/src/lib/Molecules/Tips/About.mdx +1 -1
  136. package/src/lib/Molecules/Tips/InfoTip/InfoTip.mdx +1 -1
  137. package/src/lib/Molecules/Tips/PreviewTip/PreviewTip.mdx +1 -1
  138. package/src/lib/Molecules/Tips/ToolTip/ToolTip.mdx +1 -1
  139. package/src/lib/Molecules/Toasts/About.mdx +1 -1
  140. package/src/lib/Molecules/Toasts/Toast/Toast.mdx +1 -1
  141. package/src/lib/Molecules/Toasts/Toaster/Toaster.mdx +1 -1
  142. package/src/lib/Molecules/Video/Video.mdx +1 -1
  143. package/src/lib/Organisms/About.mdx +1 -1
  144. package/src/lib/Organisms/ConnectedForm/About.mdx +1 -1
  145. package/src/lib/Organisms/ConnectedForm/ConnectedForm/ConnectedForm.mdx +1 -1
  146. package/src/lib/Organisms/ConnectedForm/ConnectedForm/ConnectedForm.stories.tsx +1 -1
  147. package/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.mdx +1 -1
  148. package/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx +1 -1
  149. package/src/lib/Organisms/ConnectedForm/ConnectedFormInputs/ConnectedFormInputs.mdx +1 -1
  150. package/src/lib/Organisms/ConnectedForm/SubmitButton/SubmitButton.mdx +1 -1
  151. package/src/lib/Organisms/ConnectedForm/SubmitButton/SubmitButton.stories.tsx +1 -1
  152. package/src/lib/Organisms/GridForm/About.mdx +1 -1
  153. package/src/lib/Organisms/GridForm/Buttons.mdx +1 -1
  154. package/src/lib/Organisms/GridForm/Buttons.stories.tsx +1 -1
  155. package/src/lib/Organisms/GridForm/Fields.mdx +1 -1
  156. package/src/lib/Organisms/GridForm/Fields.stories.tsx +1 -1
  157. package/src/lib/Organisms/GridForm/Layout.mdx +1 -1
  158. package/src/lib/Organisms/GridForm/Layout.stories.tsx +1 -1
  159. package/src/lib/Organisms/GridForm/States.mdx +1 -1
  160. package/src/lib/Organisms/GridForm/States.stories.tsx +1 -1
  161. package/src/lib/Organisms/GridForm/Usage.mdx +1 -1
  162. package/src/lib/Organisms/GridForm/Usage.stories.tsx +1 -1
  163. package/src/lib/Organisms/GridForm/Validation.mdx +1 -1
  164. package/src/lib/Organisms/Lists & Tables/About.mdx +1 -1
  165. package/src/lib/Organisms/Lists & Tables/DataList/DataList.mdx +1 -1
  166. package/src/lib/Organisms/Lists & Tables/DataTable/DataTable.mdx +1 -1
  167. package/src/lib/Organisms/Lists & Tables/List/List.mdx +1 -1
  168. package/src/lib/Organisms/Markdown/Markdown.mdx +1 -1
  169. package/src/lib/Typography/About.mdx +1 -1
  170. package/src/lib/Typography/Anchor/Anchor.mdx +1 -1
  171. package/src/lib/Typography/HiddenText/HiddenText.mdx +1 -1
  172. package/src/lib/Typography/Text/Text.mdx +1 -1
  173. package/src/lib/UX Writing/About.mdx +1 -1
  174. package/src/lib/UX Writing/Accessibility guidelines.mdx +1 -1
  175. package/src/lib/UX Writing/Component guidelines/About.mdx +1 -1
  176. package/src/lib/UX Writing/Component guidelines/Alerts.mdx +1 -1
  177. package/src/lib/UX Writing/Component guidelines/Alternative text.mdx +1 -1
  178. package/src/lib/UX Writing/Component guidelines/Buttons.mdx +1 -1
  179. package/src/lib/UX Writing/Component guidelines/Confirmation dialogs.mdx +1 -1
  180. package/src/lib/UX Writing/Component guidelines/Error messages.mdx +1 -1
  181. package/src/lib/UX Writing/Component guidelines/Notifications.mdx +1 -1
  182. package/src/lib/UX Writing/Component guidelines/Toasts.mdx +1 -1
  183. package/src/lib/UX Writing/Component guidelines/Tooltips.mdx +1 -1
  184. package/src/lib/UX Writing/DIY UX writing in 8 steps.mdx +1 -1
@@ -15,8 +15,8 @@ import {
15
15
  DocsContainer as StorybookDocsContainer,
16
16
  DocsContextProps,
17
17
  SourceContainer,
18
- } from '@storybook/addon-docs/blocks';
19
- import { ThemeProvider } from 'storybook/theming';
18
+ } from '@storybook/blocks';
19
+ import { ThemeProvider } from '@storybook/theming';
20
20
  import { useMemo } from 'react';
21
21
  import { HelmetProvider } from 'react-helmet-async';
22
22
  import theme from '../../theming/GamutTheme';
@@ -1,5 +1,5 @@
1
- import { Source } from '@storybook/addon-docs/blocks';
2
- import { SourceType } from 'storybook/internal/docs-tools';
1
+ import { Source } from '@storybook/blocks';
2
+ import { SourceType } from '@storybook/docs-tools';
3
3
  import { ComponentProps } from 'react';
4
4
 
5
5
  export const StorySource = ({
@@ -6,7 +6,7 @@ import {
6
6
  Text,
7
7
  } from '@codecademy/gamut';
8
8
  import { Figma } from '@storybook/addon-designs/blocks';
9
- import { Title } from '@storybook/addon-docs/blocks';
9
+ import { Title } from '@storybook/blocks';
10
10
  import * as React from 'react';
11
11
 
12
12
  import { StatusIndicator } from '../Elements/StatusIndicator';
@@ -1,12 +1,5 @@
1
- // This file has been automatically migrated to valid ESM format by Storybook.
2
- import { fileURLToPath } from 'node:url';
3
- import { createRequire } from 'node:module';
4
1
  import type { StorybookConfig } from '@storybook/react-webpack5';
5
- import { resolve, dirname, join } from 'node:path';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
- const require = createRequire(import.meta.url);
2
+ import { resolve, dirname, join } from 'path';
10
3
 
11
4
  const config: StorybookConfig = {
12
5
  stories: [
@@ -15,14 +8,9 @@ const config: StorybookConfig = {
15
8
  ],
16
9
  staticDirs: ['../src/static'],
17
10
  addons: [
18
- getAbsolutePath('@storybook/addon-webpack5-compiler-babel'),
19
- // the @nx/react storybook plugin is just a subdirectory of the @nx/react package
20
- // so getting the absolute path of the package.json won't work. they do expose
21
- // a require export though, so we can just use that directly
22
- require.resolve('@nx/react/plugins/storybook'),
11
+ getAbsolutePath('@storybook/addon-essentials'),
12
+ getAbsolutePath('@nx/react/plugins/storybook', ''),
23
13
  getAbsolutePath('@storybook/addon-links'),
24
- getAbsolutePath('@storybook/addon-docs'),
25
- getAbsolutePath('@storybook/addon-a11y'),
26
14
  getAbsolutePath('@storybook/addon-designs'),
27
15
  getAbsolutePath('storybook-addon-deep-controls'),
28
16
  ],
@@ -69,11 +57,6 @@ const config: StorybookConfig = {
69
57
  __dirname,
70
58
  '../../gamut-illustrations/src'
71
59
  ),
72
- '@codecademy/gamut-icons$': resolve(__dirname, '../../gamut-icons/src'),
73
- '@codecademy/gamut-patterns$': resolve(
74
- __dirname,
75
- '../../gamut-patterns/src'
76
- ),
77
60
  '@codecademy/variance$': resolve(__dirname, '../../variance/src'),
78
61
  },
79
62
  };
@@ -1,4 +1,4 @@
1
- import { addons } from 'storybook/manager-api';
1
+ import { addons } from '@storybook/manager-api';
2
2
  import theme from './theming/GamutTheme';
3
3
 
4
4
  addons.setConfig({
@@ -4,9 +4,9 @@ import theme from './theming/GamutTheme';
4
4
  import { withEmotion } from './theming/GamutThemeProvider';
5
5
  import { breakpoints, css } from '@codecademy/gamut-styles';
6
6
  import { DocsContainer } from './components/Elements/DocsContainer';
7
- import { CodeOrSourceMdx, HeadersMdx } from '@storybook/addon-docs/blocks';
8
- import { components as htmlComponents } from 'storybook/internal/components';
9
- import { styled } from 'storybook/theming';
7
+ import { CodeOrSourceMdx, HeadersMdx } from '@storybook/blocks';
8
+ import { components as htmlComponents } from '@storybook/components';
9
+ import { styled } from '@storybook/theming';
10
10
  import { Link } from './components/Elements/Markdown';
11
11
 
12
12
  const WrappedPre = styled(htmlComponents.pre)(
@@ -26,9 +26,6 @@ const mdxComponents = {
26
26
 
27
27
  const preview: Preview = {
28
28
  parameters: {
29
- a11y: {
30
- test: 'todo',
31
- },
32
29
  backgrounds: {
33
30
  disable: true,
34
31
  },
@@ -108,7 +105,12 @@ const preview: Preview = {
108
105
  },
109
106
  },
110
107
  viewport: {
111
- options: {
108
+ defaultViewport: 'responsive',
109
+ viewports: {
110
+ responsive: {
111
+ name: 'Responsive',
112
+ type: 'desktop',
113
+ },
112
114
  xs: {
113
115
  name: `XS - ${breakpoints.xs}`,
114
116
  styles: {
@@ -163,8 +165,8 @@ export const globalTypes = {
163
165
  icon: 'circlehollow',
164
166
  // Array of plain string values or MenuItem shape (see below)
165
167
  items: [
166
- { value: 'light', icon: 'circlehollow', title: 'Light' },
167
- { value: 'dark', icon: 'circle', title: 'Dark' },
168
+ { value: 'light', icon: 'circlehollow', title: 'light' },
169
+ { value: 'dark', icon: 'circle', title: 'dark' },
168
170
  ],
169
171
  // Property that specifies if the name of the item will be displayed
170
172
  showName: true,
@@ -1,4 +1,4 @@
1
- import { create } from 'storybook/theming';
1
+ import { create } from '@storybook/theming';
2
2
  import {
3
3
  theme as gamutTheme,
4
4
  trueColors,
package/CHANGELOG.md CHANGED
@@ -3,12 +3,9 @@
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.3.1-alpha.4ae770.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.3.0...@codecademy/styleguide@79.3.1-alpha.4ae770.0) (2026-03-25)
6
+ ### [79.3.1-alpha.b86be7.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.3.0...@codecademy/styleguide@79.3.1-alpha.b86be7.0) (2026-03-26)
7
7
 
8
- ### Bug Fixes
9
-
10
- - consistent title casing ([de25bb3](https://github.com/Codecademy/gamut/commit/de25bb3700607314c18b7487e4dec39aafa8922b))
11
- - remove responsive viewport option ([27378f9](https://github.com/Codecademy/gamut/commit/27378f9105f184e3f79705b018c08d88ac26d9ac))
8
+ **Note:** Version bump only for package @codecademy/styleguide
12
9
 
13
10
  ## [79.3.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@79.2.4...@codecademy/styleguide@79.3.0) (2026-03-25)
14
11
 
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.3.1-alpha.4ae770.0",
4
+ "version": "79.3.1-alpha.b86be7.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": "1cb798004e17ff8ecc325db15e777fe6cd86c741"
11
+ "gitHead": "aa78e52978cd3015734650b0fca3848081cbd742"
12
12
  }
package/project.json CHANGED
@@ -32,15 +32,6 @@
32
32
  "quiet": true
33
33
  }
34
34
  }
35
- },
36
- "storybook-test": {
37
- "executor": "nx:run-commands",
38
- "dependsOn": ["build-storybook"],
39
- "options": {
40
- "cwd": "{workspaceRoot}",
41
- "forwardAllArgs": false,
42
- "command": "start-server-and-test \"http-server dist/storybook/styleguide -p 6007 --silent\" http://127.0.0.1:6007 \"test-storybook --url http://127.0.0.1:6007 --config-dir packages/styleguide/.storybook\""
43
- }
44
35
  }
45
36
  }
46
37
  }
package/src/lib/About.mdx CHANGED
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import { AboutHeader, TableOfContents } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import { AboutHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  Callout,
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { Callout, ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -23,6 +23,8 @@ export const parameters = {
23
23
 
24
24
  <ComponentHeader {...parameters} />
25
25
 
26
+ <Canvas sourceState="shown" of={TextAreaStories.AutoGrow} />
27
+
26
28
  ## Usage
27
29
 
28
30
  Use TextArea to handle long form text entry within forms.
@@ -31,7 +33,6 @@ Use TextArea to handle long form text entry within forms.
31
33
 
32
34
  ### Disabled
33
35
 
34
- <Canvas of={TextAreaStories.Disabled} />
35
36
 
36
37
  ### Error
37
38
 
@@ -1,5 +1,66 @@
1
- import { TextArea } from '@codecademy/gamut';
1
+ import { Box, TextArea } from '@codecademy/gamut';
2
+ import { css } from '@codecademy/gamut-styles';
3
+ import styled from '@emotion/styled';
2
4
  import type { Meta, StoryObj } from '@storybook/react';
5
+ import {
6
+ type ChangeEvent,
7
+ type ComponentProps,
8
+ useCallback,
9
+ useLayoutEffect,
10
+ useRef,
11
+ } from 'react';
12
+
13
+ /**
14
+ * `field-sizing: content` lets the textarea grow with its value in Chromium and Safari.
15
+ * Firefox does not support it yet; we mirror that behavior by syncing height to scrollHeight.
16
+ *
17
+ * Note: A single-line `<input>` cannot expand vertically—use `<textarea>` for multi-line text.
18
+ */
19
+ const fieldSizingContentSupported =
20
+ typeof CSS !== 'undefined' && CSS.supports('field-sizing', 'content');
21
+
22
+ const AutoGrowTextAreaBase = styled(TextArea)(
23
+ css({
24
+ resize: 'none',
25
+ overflow: 'hidden',
26
+ // Static CSS — not a Gamut system prop; merged by variance `css()` as passthrough.
27
+ fieldSizing: 'content',
28
+ })
29
+ );
30
+
31
+ const AutoGrowTextArea = (props: ComponentProps<typeof TextArea>) => {
32
+ const ref = useRef<HTMLTextAreaElement>(null);
33
+ const { onChange, value, ...rest } = props;
34
+
35
+ const syncHeight = useCallback(() => {
36
+ if (fieldSizingContentSupported) return;
37
+ const el = ref.current;
38
+ if (!el) return;
39
+ el.style.height = 'auto';
40
+ el.style.height = `${el.scrollHeight}px`;
41
+ }, []);
42
+
43
+ useLayoutEffect(() => {
44
+ syncHeight();
45
+ }, [syncHeight, value]);
46
+
47
+ const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {
48
+ onChange?.(event);
49
+ requestAnimationFrame(syncHeight);
50
+ };
51
+
52
+ return (
53
+ <Box height="1000px">
54
+ <AutoGrowTextAreaBase
55
+ {...rest}
56
+ ref={ref}
57
+ rows={rest.rows ?? 1}
58
+ {...(value !== undefined ? { value } : {})}
59
+ onChange={handleChange}
60
+ />
61
+ </Box>
62
+ );
63
+ };
3
64
 
4
65
  const meta: Meta<typeof TextArea> = {
5
66
  component: TextArea,
@@ -38,3 +99,15 @@ export const Placeholder: Story = {
38
99
  defaultValue: undefined,
39
100
  },
40
101
  };
102
+
103
+ export const AutoGrow: Story = {
104
+ args: {
105
+ htmlFor: 'example-autogrow',
106
+ name: 'example-autogrow',
107
+ placeholder: 'Type multiple lines — the field grows vertically',
108
+ defaultValue:
109
+ 'Line one\nLine two\nLine three\n\nFirefox uses scrollHeight; Chromium/Safari use field-sizing: content.',
110
+ rows: 1,
111
+ },
112
+ render: (args) => <AutoGrowTextArea {...args} />,
113
+ };
@@ -1,5 +1,5 @@
1
1
  import { Anchor } from '@codecademy/gamut';
2
- import { Meta } from '@storybook/addon-docs/blocks';
2
+ import { Meta } from '@storybook/blocks';
3
3
 
4
4
  import {
5
5
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { Callout, ComponentHeader, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, KeyboardKey } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader, ImageWrapper, LinkTo } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/addon-docs/blocks';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  import {
4
4
  AboutHeader,
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks';
2
2
 
3
3
  import { ComponentHeader } from '~styleguide/blocks';
4
4