Skip to content

Commit

Permalink
Added text only button variant
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnexcodev committed Mar 25, 2024
1 parent 22b210c commit 8da9d58
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-root",
"version": "16.5.1",
"version": "16.5.2",
"private": true,
"description": "Root design system mono-repo package.",
"homepage": "https://github.com/Toniq-Labs/toniq-labs-design-system",
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system",
"version": "16.5.1",
"version": "16.5.2",
"private": false,
"description": "Design system elements for Toniq Labs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export const toniqButtonPage = defineBookPage({
variant: ToniqButtonVariantEnum.Outline,
},
},
{
name: 'Text Only',
inputs: {
variant: ToniqButtonVariantEnum.TextOnly,
},
},
{
name: 'Disabled',
inputs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum ToniqButtonVariantEnum {
Default = 'default',
Outline = 'outline',
Secondary = 'secondary',
TextOnly = 'text-only',
}

export const ToniqButton = defineToniqElement<{
Expand All @@ -28,6 +29,7 @@ export const ToniqButton = defineToniqElement<{
hostClasses: {
'toniq-button-secondary': ({inputs}) => inputs.variant === ToniqButtonVariantEnum.Secondary,
'toniq-button-outline': ({inputs}) => inputs.variant === ToniqButtonVariantEnum.Outline,
'toniq-button-text-only': ({inputs}) => inputs.variant === ToniqButtonVariantEnum.TextOnly,
'toniq-button-disabled': ({inputs}) => !!inputs.disabled,
},
styles: ({hostClasses}) => css`
Expand Down Expand Up @@ -83,6 +85,16 @@ export const ToniqButton = defineToniqElement<{
border-color: ${toniqColors.accentPrimary.backgroundColor};
}
${hostClasses['toniq-button-text-only'].selector} button {
color: inherit;
background-color: transparent;
border-color: transparent;
}
:host(.${hostClasses['toniq-button-text-only'].name}:hover) button {
filter: brightness(85%);
}
${hostClasses['toniq-button-disabled'].selector} {
${toniqDisabledStyles};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/native-elements-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-native-elements-test",
"version": "16.5.1",
"version": "16.5.2",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-scripts",
"version": "16.5.1",
"version": "16.5.2",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down

0 comments on commit 8da9d58

Please sign in to comment.