-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
655f931
commit 2faae01
Showing
8 changed files
with
134 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module '*.css?inline' { | ||
import { CSSResultGroup } from 'lit'; | ||
const content: CSSResultGroup; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './lib/button.js'; | ||
export * from './lib/button.component.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { html } from 'lit'; | ||
import { ifDefined } from 'lit/directives/if-defined.js'; | ||
|
||
import { CZButton } from './button.component.js'; | ||
import { CZButtonProps } from './button.types.js'; | ||
|
||
CZButton.define('cz-button'); | ||
|
||
export default { | ||
title: "Components/Button", | ||
component: "cz-button", | ||
tags: ["autodocs"], | ||
render: ({appearance, size, href, disabled}: CZButtonProps) => html`<cz-button | ||
appearance=${ifDefined(appearance)} | ||
size=${ifDefined(size)} | ||
href=${ifDefined(href)} | ||
?disabled=${disabled} | ||
> | ||
Craftzing button | ||
</cz-button>`, | ||
argTypes: { | ||
appearance: { | ||
control: { type: 'inline-radio' }, | ||
options: ['default', 'primary', 'secondary'], | ||
}, | ||
size: { | ||
control: { type: 'inline-radio' }, | ||
options: ['small', 'large'], | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' }, | ||
}, | ||
href: { | ||
control: { type: 'text' }, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Appearance = { | ||
args: { | ||
appearance: 'primary', | ||
size: undefined, | ||
}, | ||
}; | ||
|
||
export const Size = { | ||
args: { | ||
size: 'small', | ||
}, | ||
}; | ||
|
||
export const Link = { | ||
args: { | ||
href: 'https://craftzing.com', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type CZButtonAppearance = 'default' | 'primary' | 'secondary'; | ||
export type CZButtonSize = 'small' | 'large'; | ||
export type CZButtonProps = { | ||
appearance?: CZButtonAppearance; | ||
size?: CZButtonSize; | ||
href?: string; | ||
disabled?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters