Skip to content

Resolved Bug 2014 : Design System > Layout > Need to add property for shadow. #2015

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

Merged
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
15 changes: 15 additions & 0 deletions raaghu-layouts/src/rds-comp-layout/rds-comp-layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.layout1 {
width: 100%;
height: 100%;
padding: 1rem;
transition: all 0.3s ease;
}

.layout-shadow {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
transition: box-shadow 0.3s ease;
}

.layout-shadow:hover {
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
23 changes: 22 additions & 1 deletion raaghu-layouts/src/rds-comp-layout/rds-comp-layout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ const meta: Meta = {
disableZoom: false
},
tags: ['autodocs'],

argTypes: {
hasShadow: {
control: 'boolean',
description: 'Adds a shadow effect to the layout'
},
}
} satisfies Meta<typeof RdsCompLayout>;

export default meta;
Expand All @@ -21,6 +26,7 @@ type Story = StoryObj<typeof RdsCompLayout>;
export const Basic: Story = {
args: {
displayType: "Basic",
hasShadow: true,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand All @@ -39,6 +45,7 @@ export const Basic: Story = {
export const Gridify: Story = {
args: {
displayType: "Gridify",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand All @@ -62,6 +69,7 @@ export const Gridify: Story = {
export const Spotlight: Story = {
args: {
displayType: "Spotlight",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand All @@ -88,6 +96,7 @@ export const Spotlight: Story = {
export const Matrix: Story = {
args: {
displayType: "Matrix",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -116,6 +125,7 @@ export const Matrix: Story = {
export const Splitz: Story = {
args: {
displayType: "Splitz",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand All @@ -135,6 +145,7 @@ export const Splitz: Story = {
export const Snapshots: Story = {
args: {
displayType: "Snapshots",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -187,6 +198,7 @@ export const Snapshots: Story = {
export const Sections: Story = {
args: {
displayType: "Sections",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -232,6 +244,7 @@ export const Sections: Story = {
export const Boxify: Story = {
args: {
displayType: "Boxify",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -264,6 +277,7 @@ export const Boxify: Story = {
export const Stacks: Story = {
args: {
displayType: "Stacks",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -292,6 +306,7 @@ export const Stacks: Story = {
export const Nexus: Story = {
args: {
displayType: "Nexus",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -324,6 +339,7 @@ export const Nexus: Story = {
export const Mosaic: Story = {
args: {
displayType: "Mosaic",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -370,6 +386,7 @@ export const Mosaic: Story = {
export const Collage: Story = {
args: {
displayType: "Collage",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -402,6 +419,7 @@ export const Collage: Story = {
export const Pinboard: Story = {
args: {
displayType: "Pinboard",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -431,6 +449,7 @@ export const Pinboard: Story = {
export const Cardify: Story = {
args: {
displayType: "Cardify",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -471,6 +490,7 @@ export const Cardify: Story = {
export const Board: Story = {
args: {
displayType: "Board",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down Expand Up @@ -499,6 +519,7 @@ export const Board: Story = {
export const Highlight: Story = {
args: {
displayType: "Highlight",
hasShadow: false,
children: (
<>
<RdsCompLayoutItem title={""}>
Expand Down
11 changes: 10 additions & 1 deletion raaghu-layouts/src/rds-comp-layout/rds-comp-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ import RdsCompLayoutItem from "./rds-comp-layout-item";
export interface RdsCompLayoutProps {
displayType?: string;
children?: ReactNode;
hasShadow?: boolean;
}

const RdsCompLayout = (props: RdsCompLayoutProps) => {
const getClasses = () => {
let classes = "layout1";
if (props.hasShadow) {
classes += " layout-shadow";
}
return classes;
};

return (
<div className="layout1">
<div className={getClasses()}>
<div className="">
<div className="">{props.children}</div>
</div>
Expand Down
Loading