Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .github/workflows/publish-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/prerelease-publish
with:
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
Expand Down
9 changes: 9 additions & 0 deletions .nx/version-plans/version-plan-1748553600000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
gamut: major
---

Remove deprecated `HiddenText` component

- **BREAKING:** `HiddenText` is no longer exported from `@codecademy/gamut`
- Migrate to `<Text screenreader>` for visually hidden, screen-reader-accessible text
- Removed Storybook docs for `HiddenText`; use the `Text` screenreader utility docs instead
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ exports[`Gamut Exported Keys 1`] = `
"GridBox",
"GridForm",
"GridFormContent",
"HiddenText",
"IconButton",
"iFrameWrapper",
"InfoTip",
Expand Down
2 changes: 1 addition & 1 deletion packages/gamut/agent-tools/DESIGN.Codecademy.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ Components are organized into three tiers:

### Atoms — foundational, single-purpose

Badge, Button (FillButton, StrokeButton, CTAButton, TextButton, IconButton), ButtonBase, Card, Checkbox, CodeBlock, ColorMode, Drawer, FlexBox, FormGroup, GridBox, HiddenText, Icon, Input, Label, Loader, Radio, Select, Spinner, Tag, TextArea, Toggle, Tooltip
Badge, Button (FillButton, StrokeButton, CTAButton, TextButton, IconButton), ButtonBase, Card, Checkbox, CodeBlock, ColorMode, Drawer, FlexBox, FormGroup, GridBox, Icon, Input, Label, Loader, Radio, Select, Spinner, Tag, TextArea, Toggle, Tooltip

### Molecules — composed of atoms, handle a discrete task

Expand Down
2 changes: 1 addition & 1 deletion packages/gamut/agent-tools/rules/accessibility.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Match `htmlFor` on `<FormGroupLabel>` with the `id` on the control. Base `<FormG

## Screen-reader-only text

Use `<Text screenreader>` for visually hidden but announced content. `<HiddenText>` is deprecated.
Use `<Text screenreader>` for visually hidden but announced content.

## Color and contrast

Expand Down
4 changes: 2 additions & 2 deletions packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as React from 'react';

import { FormError, FormGroup, FormGroupLabel, FormGroupProps } from '..';
import { Anchor } from '../Anchor';
import { HiddenText } from '../HiddenText';
import { Markdown } from '../Markdown';
import { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils';
import { Text } from '../Typography';
import { ConnectedField, FieldProps, SubmitContextProps } from './types';
import { getErrorMessage, useField } from './utils';

Expand Down Expand Up @@ -95,7 +95,7 @@ export function ConnectedFormGroup<T extends ConnectedField>({

return (
<FormGroup spacing={hideLabel ? 'tight' : spacing}>
{hideLabel ? <HiddenText>{renderedLabel}</HiddenText> : renderedLabel}
{hideLabel ? <Text screenreader>{renderedLabel}</Text> : renderedLabel}
<Component
{...(rest as any)}
aria-describedby={errorId}
Expand Down
6 changes: 4 additions & 2 deletions packages/gamut/src/ConnectedForm/SubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FieldValues, FormState } from 'react-hook-form';

import { Box, FlexBox } from '../Box';
import { ButtonProps, FillButton } from '../Button';
import { HiddenText } from '../HiddenText';
import { Spinner } from '../Loading/Spinner';
import { Text } from '../Typography';
import { useSubmitState } from './utils';

export interface SubmitContextProps {
Expand Down Expand Up @@ -50,7 +50,9 @@ export const SubmitButton: React.FC<SubmitButtonProps> = ({
{isLoading && (
<FlexBox center inset={0} position="absolute">
<Spinner size={16} />
<HiddenText aria-live="polite">Loading</HiddenText>
<Text aria-live="polite" screenreader>
Loading
</Text>
</FlexBox>
)}
</Button>
Expand Down
4 changes: 2 additions & 2 deletions packages/gamut/src/GridForm/GridFormInputGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { UseFormReturn } from 'react-hook-form';

import { Anchor } from '../../Anchor';
import { FormError, FormGroup, FormGroupLabel } from '../../Form';
import { HiddenText } from '../../HiddenText';
import { Column } from '../../Layout';
import { Markdown } from '../../Markdown';
import { Text } from '../../Typography';
import {
GridFormField,
GridFormHiddenField,
Expand Down Expand Up @@ -169,7 +169,7 @@ export const GridFormInputGroup: React.FC<GridFormInputGroupProps> = ({
return (
<Column rowspan={field?.rowspan ?? 1} size={field?.size}>
<FormGroup spacing={isTightCheckbox ? 'tight' : 'padded'}>
{field.hideLabel ? <HiddenText>{label}</HiddenText> : label}
{field.hideLabel ? <Text screenreader>{label}</Text> : label}
{getInput()}
{errorMessage && (
<FormError
Expand Down
12 changes: 0 additions & 12 deletions packages/gamut/src/HiddenText/__tests__/HiddenText.test.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions packages/gamut/src/HiddenText/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/gamut/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export type {
SelectDropdownGroup,
} from './Form/SelectDropdown';
export * from './GridForm';
export * from './HiddenText';
export * from './Layout/Column';
export * from './Layout/LayoutGrid';
export * from './List';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export const SubmitButtonInline: Story = {
name: 'simple-text',
type: 'text',
size: 6,
// WILL REMOVE BEFORE MERGING
hideLabel: true,
},
],
submit: {
Expand Down
7 changes: 1 addition & 6 deletions packages/styleguide/src/lib/Typography/About.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from '~styleguide/blocks';

import { parameters as anchorParameters } from './Anchor/Anchor.mdx';
import { parameters as hiddenTextParameters } from './HiddenText/HiddenText.mdx';
import { parameters as textParameters } from './Text/Text.mdx';

export const parameters = {
Expand All @@ -25,9 +24,5 @@ Foundations make up the smallest scale design values that comprise a design syst
Sometimes referred to elsewhere as "tokens", they are the abstract units that comprise and stitch together our atoms, molecules, and organisms.

<TableOfContents
links={addParentPath(parameters.title, [
anchorParameters,
hiddenTextParameters,
textParameters,
])}
links={addParentPath(parameters.title, [anchorParameters, textParameters])}
/>

This file was deleted.

This file was deleted.

Loading