Skip to content

Commit

Permalink
docs: add new prop to button
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefialho committed Nov 19, 2024
1 parent 33ca903 commit 5f1bb24
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
16 changes: 15 additions & 1 deletion packages/core/src/components/button/stories/button.args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ButtonStoryArgs = {
},
color: {
control: 'select',
options: ['primary', 'secondary', 'white'],
options: ['primary', 'secondary', 'white', 'custom'],
defaultValue: { summary: 'primary' },
description: "The color to use from your application's color palette.",
table: {
Expand Down Expand Up @@ -122,6 +122,20 @@ export const ButtonStoryArgs = {
category: Category.PROPERTIES,
},
},
'--atom-button-color': {
description:
'Custom color of the button. It just works with `color="custom"`.',
table: {
category: Category.CSS_CUSTOM_PROPERTIES,
},
},
'--atom-button-color-contrast': {
description:
'Custom color contrast of the button. It just works with `color="custom"`.',
table: {
category: Category.CSS_CUSTOM_PROPERTIES,
},
},
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { html } from 'lit'

import { ButtonComponentArgs, ButtonStoryArgs } from './button.args'

import './button.css'

export default {
title: 'Components/Button',
...ButtonStoryArgs,
Expand All @@ -12,6 +14,7 @@ const createButton = (args, themeColor = 'light') => {
return html`
<div class="theme-${themeColor}">
<atom-button
class="button"
color="${args.color}"
fill="${args.fill}"
expand="${args.expand}"
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/components/button/stories/button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.button {
--atom-button-color: #25d366;
--atom-button-color-contrast: #fff;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import React from 'react'

import { ButtonComponentArgs, ButtonStoryArgs } from './button.args'

import './button.css'

export default {
title: 'Components/Button',
component: AtomButton,
Expand All @@ -13,6 +15,7 @@ export default {
const createButton = (args, themeColor = 'light') => (
<div className={`theme-${themeColor}`}>
<AtomButton
className='button'
color={args.color}
fill={args.fill}
size={args.size}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { AtomButton, AtomIcon } from '@juntossomosmais/atomium/vue'
import { Meta, StoryObj } from '@storybook/vue3'


import { ButtonComponentArgs, ButtonStoryArgs } from './button.args'

import './button.css'

export default {
title: 'Components/Button',
...ButtonStoryArgs,
Expand All @@ -17,6 +18,7 @@ const createButton = (args, themeColor = 'light') => ({
template: `
<div :class="'theme-' + themeColor">
<AtomButton
class="button"
color="${args.color}"
fill="${args.fill}"
size="${args.size}"
Expand Down

0 comments on commit 5f1bb24

Please sign in to comment.