-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Button add button size and isBorder (#112)
* feat: Button add button size and isBorder * feat: Button add button size and isBorder * fix: change size enum * fix: change ui * fix: change ui --------- Co-authored-by: Jobs <[email protected]>
- Loading branch information
1 parent
01d57d3
commit 6ba748f
Showing
7 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
components/Button/__test__/__snapshots__/button.spec.ts.snap
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
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,33 @@ | ||
<script> | ||
import { KButton } from '@ikun-ui/button'; | ||
</script> | ||
|
||
<div class="flex items-center flex-wrap"> | ||
<KButton type="info" cls="mx-2" isBorder>large</KButton> | ||
<KButton type="error" cls="mx-2" isBorder>normal</KButton> | ||
<KButton type="success" cls="mx-2" isBorder>small</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" cls="mx-2" isBorder>settings</KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" cls="mx-2" isBorder>svelte</KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" cls="mx-2" isBorder>wechat</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" round="20" cls="mx-2" isBorder> | ||
settings | ||
</KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" round="20" cls="mx-2" isBorder> | ||
svelte | ||
</KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" round="20" cls="mx-2" isBorder> | ||
</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" circle cls="mx-2" isBorder></KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" circle cls="mx-2" isBorder></KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" circle cls="mx-2" isBorder></KButton> | ||
</div> |
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,33 @@ | ||
<script> | ||
import { KButton } from '@ikun-ui/button'; | ||
</script> | ||
|
||
<div class="flex items-center flex-wrap"> | ||
<KButton type="info" cls="mx-2" size="lg">lg</KButton> | ||
<KButton type="error" cls="mx-2" size="md">md</KButton> | ||
<KButton type="success" cls="mx-2" size="sm">sm</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" cls="mx-2" size="lg">settings</KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" cls="mx-2" size="md">svelte</KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" cls="mx-2" size="sm">wechat</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" round="20" cls="mx-2" size="lg"> | ||
settings | ||
</KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" round="20" cls="mx-2" size="md"> | ||
svelte | ||
</KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" round="20" cls="mx-2" size="sm"> | ||
</KButton> | ||
</div> | ||
|
||
<div class="flex items-center mt-3 flex-wrap"> | ||
<KButton icon="i-carbon-settings" type="info" circle cls="mx-2" size="lg"></KButton> | ||
<KButton icon="i-carbon-logo-svelte" type="error" circle cls="mx-2" size="md"></KButton> | ||
<KButton icon="i-carbon-logo-wechat" type="success" circle cls="mx-2" size="sm"></KButton> | ||
</div> |
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,40 +1,48 @@ | ||
export const buttonShortcuts: Record<string, string> = { | ||
// button | ||
// button | ||
'k-button--disabled': 'opacity-50', | ||
|
||
'k-button--base': 'rounded k-border cursor-pointer f-c px-2 py-1 text-base w-fit', | ||
'k-button--sm': 'text-sm px-1.5 py-0.8', | ||
'k-button--lg': 'text-lg px-3 py-2', | ||
'k-button--circle': '!rounded-full p-2', | ||
'k-button--circle--sm': '!rounded-full !p-1', | ||
'k-button--circle--lg': '!rounded-full !p-3', | ||
|
||
'k-button--primary': 'bg-ikun-primary-100 text-ikun-primary border-ikun-primary-100', | ||
'k-button--primary__active': 'active:border-ikun-primary active:k-btn-shadow--primary', | ||
'k-button--primary__focus': | ||
'focus-visible:border-ikun-primary focus-visible:k-btn-shadow--primary', | ||
'k-button--primary__hover': 'hover:border-ikun-primary', | ||
'k-button--primary__icon': 'text-ikun-primary', | ||
'k-button--primary__border': 'border-ikun-primary', | ||
|
||
'k-button--success': 'bg-ikun-success-100 text-ikun-success border-ikun-success-100', | ||
'k-button--success__active': 'active:border-ikun-success active:k-btn-shadow--success', | ||
'k-button--success__focus': | ||
'focus-visible:border-ikun-success focus-visible:k-btn-shadow--success', | ||
'k-button--success__hover': 'hover:border-ikun-success', | ||
'k-button--success__icon': 'text-ikun-success', | ||
'k-button--success__border': 'border-ikun-success', | ||
|
||
'k-button--error': 'bg-ikun-error-100 text-ikun-error border-ikun-error-100', | ||
'k-button--error__active': 'active:border-ikun-error active:k-btn-shadow--error', | ||
'k-button--error__focus': 'focus-visible:border-ikun-error focus-visible:k-btn-shadow--error', | ||
'k-button--error__hover': 'hover:border-ikun-error', | ||
'k-button--error__icon': 'text-ikun-error', | ||
'k-button--error__border': 'border-ikun-error', | ||
|
||
'k-button--warning': 'bg-ikun-warning-100 text-ikun-warning border-ikun-warning-100', | ||
'k-button--warning__active': 'active:border-ikun-warning active:k-btn-shadow--warning', | ||
'k-button--warning__focus': | ||
'focus-visible:border-ikun-warning focus-visible:k-btn-shadow--warning', | ||
'k-button--warning__hover': 'hover:border-ikun-warning', | ||
'k-button--warning__icon': 'text-ikun-warning', | ||
'k-button--warning__border': 'border-ikun-warning', | ||
|
||
'k-button--info': 'bg-ikun-info-100 text-ikun-info border-ikun-info-100', | ||
'k-button--info__active': 'active:border-ikun-info active:k-btn-shadow--info', | ||
'k-button--info__focus': 'focus-visible:border-ikun-info focus-visible:k-btn-shadow--info', | ||
'k-button--info__hover': 'hover:border-ikun-info', | ||
'k-button--info__icon': 'text-ikun-info' | ||
'k-button--info__icon': 'text-ikun-info', | ||
'k-button--info__border': 'border-ikun-info' | ||
}; |