Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(sidepanel, createsidepanel): adds ai label docs #6468

Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';

import * as stories from './SidePanel';

const DocsPage = () => (
<StoryDocsPage
blocks={[
{
story: stories.SlideOver,
},
{
story: stories.SlideIn,
},
{
story: stories.WithActionToolbar,
},
{
story: stories.PanelWithSecondStep,
},
{
story: stories.SpecifyElementToHaveInitialFocus,
},
{
story: stories.WithStaticTitle,
},
{
story: stories.FirstElementDisabled,
},
{
story: stories.WithStaticTitleAndActionToolbar,
},
{
story: stories.WithoutTitle,
},
{
title: 'With AI Label',
story: stories.WithAILabel,
description:
'An AI Label is intended for any scenario where something is being generated by AI to reinforce AI transparency, accountability, and explainability at the UI level. A Carbon AI Label can be provided to the Tearsheet component by including an `aiLabel` property on it and providing the carbon AILabel component as its own custom component.',
source: {
language: 'html',
code: `
<SidePanel
{...args}
aiLabel={
// carbon AILabel component
<AILabel
className="ai-label-container"
autoAlign={false}
align="bottom-right"
>
<AILabelContent>... ...</AILabelContent>
</AILabel>
}
>
...
</SidePanel>
`,
},
},
]}
/>
);

export default DocsPage;
34 changes: 0 additions & 34 deletions packages/ibm-products/src/components/SidePanel/SidePanel.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { Copy, TrashCan, Settings } from '@carbon/react/icons';
import { SidePanel } from './SidePanel';
import { sidePanelDecorator } from '../../global/decorators/sidePanelDecorator';
// import mdx from './SidePanel.mdx';
import DocsPage from './SidePanel.docs-page';

const prefix = 'side-panel-stories__';

Expand Down Expand Up @@ -393,11 +393,9 @@ export default {
parameters: {
layout: 'fullscreen',
styles,
/*
docs: {
page: mdx,
docs: {
page: DocsPage,
},
*/
},
argTypes: {
actions: {
Expand Down
Loading