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

Background behaviors POC #751

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
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
13 changes: 13 additions & 0 deletions packages/app-elements/src/styles/vendor.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ body {

:root {
--tw-shadow-color: rgb(230 231 231 / 1);
--cl-input-bg: theme(colors.white);
}

.overlay-container.bg-gray-50 {
--cl-input-bg: theme(colors.gray.200);
}

.boxed-container.bg-white {
--cl-input-bg: theme(colors.gray.50);
}

.cl-input-bg {
background-color: var(--cl-input-bg);
}

input,
Expand Down
1 change: 1 addition & 0 deletions packages/app-elements/src/ui/atoms/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const Card = withSkeletonTemplate<CardProps>(
<JsxTag
className={cn([
className,
'boxed-container',
'border border-solid rounded-md',
'text-left', // reset <button>
'text-inherit active:text-inherit hover:text-inherit font-inherit', // reset <a>
Expand Down
2 changes: 1 addition & 1 deletion packages/app-elements/src/ui/atoms/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const CodeBlock = withSkeletonTemplate<CodeBlockProps>(

return (
<InputWrapper {...rest} label={label} hint={hint}>
<div className='flex group w-full rounded bg-gray-50 [.overlay-container_&]:bg-gray-200'>
<div className='flex group w-full rounded cl-input-bg'>
<div
tabIndex={0}
aria-label={label}
Expand Down
18 changes: 18 additions & 0 deletions packages/docs/src/stories/atoms/CodeBlock.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useOverlay } from '#hooks/useOverlay'
import { Button } from '#ui/atoms/Button'
import { Card } from '#ui/atoms/Card'
import { CodeBlock } from '#ui/atoms/CodeBlock'
import { PageHeading } from '#ui/atoms/PageHeading'
import { Spacer } from '#ui/atoms/Spacer'
import { type Meta, type StoryFn } from '@storybook/react'

const setup: Meta<typeof CodeBlock> = {
Expand Down Expand Up @@ -123,6 +125,22 @@ export const UsageInsideOverlay: StoryFn = () => {
-o demo-store \\
-a admin`}
</CodeBlock>

<Spacer top='6'>
<Card gap='6' overflow='visible'>
<CodeBlock
label='Login with your admin credentials'
showCopyAction
showSecretAction
>
{`commercelayer app:login \\
-i asdGvqXsOSsdko6ueiX9 \\
-s elyFpGvqXsOSss2Ua4No1_HxaKH_0rUsFuYiX9 \\
-o demo-store \\
-a admin`}
</CodeBlock>
</Card>
</Spacer>
</Overlay>
</div>
)
Expand Down