Skip to content

Commit

Permalink
Merge branch 'main' into remove-unnecesary-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
andresin87 authored Feb 5, 2024
2 parents f09efac + 9d2e6f0 commit 1481c79
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 285 deletions.
11 changes: 11 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@
color: #35376a !important;
font-weight: 700 !important;
}

#experimental-banner {
position: sticky;
top: 0;
padding: var(--spacing-sm) var(--spacing-xl);
z-index: var(--z-index-sticky);
font-size: 1rem !important;
font-weight: 600;
background-color: rgb(var(--colors-alert));
color: rgb(var(--colors-on-alert));
}
</style>

<link href="/normalize.css" rel="stylesheet" />
17 changes: 16 additions & 1 deletion .storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,24 @@ import './sb-theming.css'
import { ToC } from '@docs/helpers/ToC'

const ExampleContainer = ({ children, ...props }) => {
const shouldDisplayExperimentalBanner = (() => {
const docsPrepared = props.context.channel.data.docsPrepared
if (!docsPrepared) return false

return docsPrepared.some(doc => {
if (!doc.id) return false
return doc.id.includes('experimental-')
})
})()

return (
<DocsContainer {...props}>
<div id="spark-doc-container">{children}</div>
<div id="spark-doc-container">
{shouldDisplayExperimentalBanner && <p id="experimental-banner">
This component is still experimental. Avoid usage in production features
</p>}
{children}
</div>
<ToC />
</DocsContainer>
)
Expand Down
Loading

0 comments on commit 1481c79

Please sign in to comment.