Skip to content
Open
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
7 changes: 0 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# EditorConfig helps developers define and maintain consistent # top-most EditorConfig file
# coding styles between different editors and IDEs
# editorconfig.org
root = true

[*]
Expand All @@ -9,8 +6,4 @@ end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/ACCESSIBILITY_ISSUE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ body:
attributes:
value: |
> [!TIP]
>
> You do not need to apply labels. Labels are applied automatically and by the Carbon team when your issue is triaged.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ body:
attributes:
value: |
> [!TIP]
>
> You do not need to apply labels. Labels are applied automatically and by the Carbon team when your issue is triaged.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/DESIGN_DEFECT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@ body:
attributes:
value: |
> [!TIP]
>
> You do not need to apply labels. Labels are applied automatically and by the Carbon team when your issue is triaged.
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ body:
attributes:
value: |
> [!TIP]
>
> You do not need to apply labels. Labels are applied automatically and by the Carbon team when your issue is triaged.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/QUESTION.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ body:
attributes:
value: |
> [!TIP]
>
> You do not need to apply labels. Labels are applied automatically and by the Carbon team when your issue is triaged.
6 changes: 4 additions & 2 deletions docs/guides/reviewing-pull-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
- **Contributors**: use this as a guide for what to include in your PRs so
they'll sail through review ⛵

> [!IMPORTANT] This just serves as a starting point. It will not include every
> small nit and detail that might end up in a PR review.
> [!IMPORTANT]
>
> This just serves as a starting point. It will not include every small nit and
> detail that might end up in a PR review.
>
> This document should remain as small as possible! The longer this gets, the
> more difficult it will be to read and absorb.
Expand Down
6 changes: 4 additions & 2 deletions docs/guides/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
The `@carbon/styles` package ships all of the styles for the Carbon Design
System.

> [!IMPORTANT]
> [!IMPORTANT]
>
> You probably don't need to install this package. Framework variant packages
> such as `@carbon/react` re-export all of `@carbon/styles`. For the examples
> below `@carbon/styles` paths can be switched out for `@carbon/react` without
Expand Down Expand Up @@ -120,7 +121,8 @@ To use only a specific module, include the full path.
@use '@carbon/styles/scss/<path-to-file>';
```

> [!NOTE]
> [!NOTE]
>
> Sass modules can only ever be configured once. Bringing in this module and
> configuring it should be one of the first things you do in your project.
>
Expand Down
3 changes: 2 additions & 1 deletion docs/preview-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ Over time it becomes apparent a preview API has stabilized and suits the needs
of most users. If it isn't a breaking change, and there hasn't been much
movement, it can be moved from "preview" status to be "stable".

> [!IMPORTANT]
> [!IMPORTANT]
>
> To initiate a move to stable:
>
> 1. [Open a new issue](https://github.com/carbon-design-system/carbon/issues/new?template=Blank+issue)
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"ci-check": "carbon-cli ci-check",
"clean": "lerna run clean && lerna clean --yes && rimraf node_modules",
"doctoc": "doctoc --title '## Table of Contents'",
"format": "prettier --cache --write '**/*.{js,md,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd}/**'",
"format:diff": "prettier --list-different '**/*.{js,md,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'",
"format": "prettier --cache --write '**/*.{js,md,mdx,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd}/**'",
"format:diff": "prettier --list-different '**/*.{js,md,mdx,scss,ts,tsx}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'",
"lint": "eslint actions config packages www",
"lint:fix": "eslint --cache --fix --max-warnings 0 actions config packages www",
"lint:styles": "stylelint '**/*.scss' --report-needless-disables --report-invalid-scope-disables",
Expand Down Expand Up @@ -141,6 +141,9 @@
"!(*sass).md": [
"prettier --cache --write"
],
"!(*sass).mdx": [
"prettier --cache --write"
],
"{README.md,.all-contributorsrc}": [
"all-contributors generate"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/carbon-components-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

> React components for the Carbon Design System

> [!CAUTION]
> [!CAUTION]
>
> `carbon-components-react` is deprecated and will not receive any more updates.
>
> More information is available on our
Expand Down
3 changes: 2 additions & 1 deletion packages/carbon-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

> Styles for the Carbon Design System

> [!CAUTION]
> [!CAUTION]
>
> `carbon-components` is deprecated and will not receive any more updates.
>
> More information is available on our
Expand Down
3 changes: 2 additions & 1 deletion packages/react/code-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Figma Code Connect for @carbon/react

> [!WARNING]
> [!WARNING]
>
> Figma [Code Connect](https://github.com/figma/code-connect) for Carbon React
> is in an exploratory phase.
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/AILabel/AILabel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ AI instances in a way that is identifiable across any IBM product.
},
]}
/>

## Inline

<Canvas
Expand Down
17 changes: 10 additions & 7 deletions packages/react/src/components/AISkeleton/AISkeleton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as AISkeletonPlaceholderStories from './AISkeletonPlaceholder.stories';
import * as AISkeletonTextStories from './AISkeletonText.stories';
import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';


<Meta isTemplate />

# AI Skeleton
Expand All @@ -16,9 +15,9 @@ import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';
## Table of Contents

- [Overview](#overview)
- [AI Skeleton Icon](#ai-skeleton-icon)
- [AI Skeleton Placeholder](#ai-skeleton-placeholder)
- [AI Skeleton Text](#ai-skeleton-text)
- [AI Skeleton Icon](#ai-skeleton-icon)
- [AI Skeleton Placeholder](#ai-skeleton-placeholder)
- [AI Skeleton Text](#ai-skeleton-text)
- [Component API](#component-api)
- [Feedback](#feedback)

Expand All @@ -45,7 +44,10 @@ import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';
additionalActions={[
{
title: 'Open in Stackblitz',
onClick: () => stackblitzPrefillConfig(AISkeletonPlaceholderStories._AISkeletonPlaceholder),
onClick: () =>
stackblitzPrefillConfig(
AISkeletonPlaceholderStories._AISkeletonPlaceholder
),
},
]}
/>
Expand All @@ -57,7 +59,8 @@ import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';
additionalActions={[
{
title: 'Open in Stackblitz',
onClick: () => stackblitzPrefillConfig(AISkeletonTextStories._AISkeletonText),
onClick: () =>
stackblitzPrefillConfig(AISkeletonTextStories._AISkeletonText),
},
]}
/>
Expand All @@ -70,4 +73,4 @@ import { stackblitzPrefillConfig } from '../../../previewer/codePreviewer';

Help us improve this component by providing feedback, asking questions on Slack,
or updating this file on
[GitHub](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/AISkeleton.mdx).
[GitHub](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/AISkeleton.mdx).
4 changes: 2 additions & 2 deletions packages/react/src/components/Accordion/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
variants={[
{
label: 'Default',
variant: 'components-accordion--default'
}
variant: 'components-accordion--default',
},
]}
/>
4 changes: 2 additions & 2 deletions packages/react/src/components/AspectRatio/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
variants={[
{
label: 'Default',
variant: 'components-aspectratio--default'
}
variant: 'components-aspectratio--default',
},
]}
/>
6 changes: 3 additions & 3 deletions packages/react/src/components/Breadcrumb/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
variants={[
{
label: 'Default',
variant: 'components-breadcrumb--default'
variant: 'components-breadcrumb--default',
},
{
label: 'Breadcrumb with Overflow Menu',
variant: 'components-breadcrumb--breadcrumb-with-overflow-menu'
}
variant: 'components-breadcrumb--breadcrumb-with-overflow-menu',
},
]}
/>
21 changes: 17 additions & 4 deletions packages/react/src/components/Button/Button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@ to render an icon-only button, please refer to the section on the

<Unstyled>
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
<Button renderIcon={Add} iconDescription="Add">Add</Button>
<Button renderIcon={TrashCan} kind="danger" iconDescription="TrashCan">Delete</Button>
<Button renderIcon={Add} iconDescription="Add">
{'Add'}
</Button>
<Button renderIcon={TrashCan} kind="danger" iconDescription="TrashCan">
{'Delete'}
</Button>
</div>
</Unstyled>

Expand All @@ -255,8 +259,17 @@ the Icon to ensure the proper classes are applied:

<Unstyled>
<div style={{ display: 'flex', gap: '1rem', flexWrap: 'wrap' }}>
<Button renderIcon={(props) => <Add size={24} {...props} />} iconDescription="Add">Add</Button>
<Button renderIcon={(props) => <TrashCan size={24} {...props} />} kind="danger" iconDescription="TrashCan"> Delete </Button>
<Button
renderIcon={(props) => <Add size={24} {...props} />}
iconDescription="Add">
{'Add'}
</Button>
<Button
renderIcon={(props) => <TrashCan size={24} {...props} />}
kind="danger"
iconDescription="TrashCan">
{'Delete'}
</Button>
Comment on lines +262 to +272
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any idea why formatting this mdx file is messing up the buttons content placing them in p tag?

Screen.Recording.2026-04-13.at.4.01.34.PM.mov

I have observed this in an other pr and avoided formatting the mdx there.
#21390 (comment)
I am not sure if there are any more cases like this in other mdx files.

Will wrapping them in storybook unstyled fixes them? could be related to these efforts 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be an issue with storybook mdx parsing too. But need to verify.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a rendering issue with MDX parsing. Newline separated text within JSX can be interpreted as Markdown, causing it to render as p elements. I updated the code to use JavaScript expression children so the content is treated as plain text nodes.

https://mdxjs.com/docs/what-is-mdx/#interleaving
storybookjs/storybook#18921

I am not sure if there are any more cases like this in other mdx files.

There are. Would you like me to fix them here or in a separate pull request? Adding an MDX lint rule for multiline text children in JSX may help prevent similar issues in the future.

  • <Unstyled>
    <Button as="div" role="button">
    a11y Button
    </Button>
    </Unstyled>
  • <LinkTo title="Hooks/usePrefix" name="Overview">
    usePrefix
    </LinkTo>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    <CodeSnippet type="inline" hideCopyButton>
    Modal
    </CodeSnippet>
    and
    <CodeSnippet type="inline" hideCopyButton>
    ComposedModal
    </CodeSnippet>
    have to be put at the top level in a React tree. The easiest way to ensure
    that is using a React portal, as shown in the example above.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    As the instructions for the three buttons imply,
    <CodeSnippet type="inline" hideCopyButton>
    ModalFooter
    </CodeSnippet>
    is flexible with the buttons you render using
    <CodeSnippet type="inline" hideCopyButton>
    Button
    </CodeSnippet>
    components. In this case, your application code is responsible for handling
    button actions, such as closing the modal.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    <CodeSnippet type="inline" hideCopyButton>
    Modal
    </CodeSnippet>
    and
    <CodeSnippet type="inline" hideCopyButton>
    ComposedModal
    </CodeSnippet>
    have to be put at the top level in a React tree. The easiest way to ensure
    that is using a React portal, as shown in the example above.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    As the instructions for the three buttons imply,
    <CodeSnippet type="inline" hideCopyButton>
    ModalFooter
    </CodeSnippet>
    is flexible with the buttons you render using
    <CodeSnippet type="inline" hideCopyButton>
    Button
    </CodeSnippet>
    components. In this case, your application code is responsible for handling
    button actions, such as closing the modal.
    </InlineNotification>
    </Unstyled>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great findings!
thanks for looking into this.

fixing the lint rules in a seperate pr makes sense to me

</div>
</Unstyled>

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Checkbox/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
variants={[
{
label: 'Default',
variant: 'components-checkbox--default'
}
variant: 'components-checkbox--default',
},
]}
/>
4 changes: 2 additions & 2 deletions packages/react/src/components/ClassPrefix/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
variants={[
{
label: 'Default',
variant: 'components-classprefix--default'
}
variant: 'components-classprefix--default',
},
]}
/>
8 changes: 4 additions & 4 deletions packages/react/src/components/CodeSnippet/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
variants={[
{
label: 'Inline',
variant: 'components-codesnippet--inline'
variant: 'components-codesnippet--inline',
},
{
label: 'Multiline',
variant: 'components-codesnippet--multiline'
variant: 'components-codesnippet--multiline',
},
{
label: 'Singleline',
variant: 'components-codesnippet--singleline'
}
variant: 'components-codesnippet--singleline',
},
]}
/>
26 changes: 20 additions & 6 deletions packages/react/src/components/ComboBox/ComboBox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ custom values and typeahead suggestions.
additionalActions={[
{
title: 'Open in Stackblitz',
onClick: () => stackblitzPrefillConfig(ComboBoxStories.AutocompleteWithTypeahead),
onClick: () =>
stackblitzPrefillConfig(ComboBoxStories.AutocompleteWithTypeahead),
},
]}
/>
Expand Down Expand Up @@ -280,6 +281,17 @@ string. If you would like to hide items that do not match what the user is
typing, you can pass in your own filtering function to the `shouldFilterItem`
prop.

{/* prettier-ignore-start */}

{/*
TODO: Is the `ComboBox` below supposed to be here, or should there just be the
code snippet? If it is supposed to be here, it doesn't look right in
Storybook. The options are bulleted, and the background doesn't match the
theme.
*/}

{/* prettier-ignore-end */}

<ComboBox
id="carbon-combobox"
items={['Apple', 'Orange', 'Banana']}
Expand Down Expand Up @@ -317,6 +329,7 @@ callback.
```js
{selectedItem: undefined, inputValue: 'Apple'}
```

<Canvas
of={ComboBoxStories.AllowCustomValue}
additionalActions={[
Expand All @@ -330,15 +343,17 @@ callback.
## `inputProps`

Use `inputProps` to specify native input attributes to place on the `<input>`.
These are passed to [Downshift's `getInputProps()`](https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops)
These are passed to
[Downshift's `getInputProps()`](https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops)
and will override the internal input props.


### Using `maxLength`

The native `maxLength` attribute can be included in `inputProps` to define the maximum string length that the user can enter into the input.
The native `maxLength` attribute can be included in `inputProps` to define the
maximum string length that the user can enter into the input.

When using `maxLength`, ensure the limit is communicated to the user through both `helperText` and `invalidText`/`warnText`.
When using `maxLength`, ensure the limit is communicated to the user through
both `helperText` and `invalidText`/`warnText`.

```jsx
<ComboBox
Expand All @@ -350,7 +365,6 @@ When using `maxLength`, ensure the limit is communicated to the user through bot
/>
```


## With AI Label

<Canvas
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/components/ComboBox/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
variants={[
{
label: 'Default',
variant: 'components-combobox--default'
variant: 'components-combobox--default',
},
{
label: 'Fluid (unstable)',
variant: 'experimental-unstable-fluidcombobox--default'
variant: 'experimental-unstable-fluidcombobox--default',
},
{
label: 'Fluid Condensed (unstable)',
variant: 'experimental-unstable-fluidcombobox--condensed'
}
variant: 'experimental-unstable-fluidcombobox--condensed',
},
]}
/>
Loading
Loading