Skip to content

Commit

Permalink
Restore CSS rules and update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfheij-sil committed Mar 29, 2023
1 parent 71bd5f4 commit 453d309
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
9 changes: 2 additions & 7 deletions src/renderer/components/papi-components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '@renderer/components/papi-components/button.css';
export type ButtonProps = PropsWithChildren<{
/**
* Enabled status of button
* @default false
*/
isDisabled?: boolean;
/**
Expand All @@ -24,13 +25,7 @@ export type ButtonProps = PropsWithChildren<{
/**
* Primary UI component for user interaction
*/
function Button({
isDisabled,
className,
onClick,
onContextMenu,
children,
}: ButtonProps) {
function Button({ isDisabled = false, className, onClick, onContextMenu, children }: ButtonProps) {
return (
<MuiButton
disabled={isDisabled}
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/components/papi-components/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
cursor: pointer;
display: inline-block;
line-height: 1;
}

.papi-button.primary {
color: white;
background-color: #1ea7fd;
}
.papi-button.secondary {
color: #333;
background-color: transparent;
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
}

.papi-button.paratext {
background-color: darkgreen;
color: greenyellow;
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/components/papi-components/switch.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
.papi-switch {
background-color: #1ea7fd;
background-color: transparent;
}

.papi-switch.primary {
background-color: #1ea7fd;
}
.papi-switch.secondary {
background-color: #6fc8ff;
}
.papi-switch.error {
background-color: #ff0000;
}
Expand Down
25 changes: 16 additions & 9 deletions src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,41 @@ type Story = StoryObj<typeof Button>;

export const Primary: Story = {
args: {
isDisabled: false,
className: 'primary',
children: 'Primary Button',
},
};

export const Secondary: Story = {
args: {
className: 'secondary',
children: 'Secondary Button',
},
};

export const Disabled: Story = {
args: {
isDisabled: true,
children: 'Disabled Button',
},
};

export const CustomJSXContents: Story = {
args: {
isDisabled: false,
className: 'video',
children: (
<a href="https://www.youtube.com/watch?v=z_lgjFAxP6c">
Funny Meeting Video
</a>
),
children: <a href="https://www.youtube.com/watch?v=z_lgjFAxP6c">Funny Meeting Video</a>,
},
};

export const Paratext: Story = {
args: {
isDisabled: false,
className: 'paratext',
children: 'Paratext Button',
},
};

export const ParatextBright: Story = {
args: {
isDisabled: false,
className: 'paratext bright',
children: 'Paratext Button',
},
Expand Down
8 changes: 8 additions & 0 deletions src/stories/Switch.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export const Default: Story = {
args: {},
};

export const Primary: Story = {
args: { className: 'primary' },
};

export const Secondary: Story = {
args: { className: 'secondary' },
};

export const Disabled: Story = {
args: { isDisabled: true },
};
Expand Down

0 comments on commit 453d309

Please sign in to comment.