Skip to content

Commit

Permalink
[minor][v16.12.0] Update ToniqError to use ToniqAlert.Danger + ToniqC…
Browse files Browse the repository at this point in the history
…hip.Outline (#111)
  • Loading branch information
inescri authored May 10, 2024
1 parent d075f19 commit a234091
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 16 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.11.0",
"version": "16.12.0",
"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.11.0",
"version": "16.12.0",
"private": false,
"description": "Design system elements for Toniq Labs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export const toniqChipBookPage = defineBookPage({
title: 'danger style',
inputs: {variant: ToniqChipVariantEnum.Danger},
},
{
title: 'outline style',
inputs: {variant: ToniqChipVariantEnum.Outline},
},
];

styleVariations.forEach((styleVariation) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum ToniqChipVariantEnum {
Success = 'success',
Warning = 'warning',
Danger = 'danger',
Outline = 'outline',
}

export const ToniqChip = defineToniqElement<{
Expand All @@ -26,6 +27,7 @@ export const ToniqChip = defineToniqElement<{
'toniq-chip-success': ({inputs}) => inputs.variant === ToniqChipVariantEnum.Success,
'toniq-chip-warning': ({inputs}) => inputs.variant === ToniqChipVariantEnum.Warning,
'toniq-chip-danger': ({inputs}) => inputs.variant === ToniqChipVariantEnum.Danger,
'toniq-chip-outline': ({inputs}) => inputs.variant === ToniqChipVariantEnum.Outline,
},
options: {
ignoreUnsetInputs: true,
Expand Down Expand Up @@ -58,6 +60,12 @@ export const ToniqChip = defineToniqElement<{
${hostClasses['toniq-chip-success'].selector} {
${applyBackgroundAndForeground(toniqColors.colorSuccess)};
}
${hostClasses['toniq-chip-outline'].selector} {
box-sizing: border-box;
${applyBackgroundAndForeground(toniqColors.pagePrimary)};
border: 2px solid ${toniqColors.accentPrimary.backgroundColor};
}
`,
renderCallback({inputs}) {
const iconTemplate: TemplateResult | string = inputs.icon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import {css, html} from 'element-vir';
import {defineToniqElementNoInputs} from '../define-toniq-element';
import {ToniqAlert, ToniqAlertVariantEnum} from '../toniq-alert/toniq-alert.element';

export const ToniqErrorMessage = defineToniqElementNoInputs({
tagName: 'toniq-error-message',
styles: css`
:host {
display: block;
color: red;
}
p {
padding: 0;
margin: 0;
}
`,
renderCallback() {
return html`
<p><slot></slot></p>
<${ToniqAlert.assign({variant: ToniqAlertVariantEnum.Danger})}>
<slot></slot>
</${ToniqAlert}>
`;
},
});
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.11.0",
"version": "16.12.0",
"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.11.0",
"version": "16.12.0",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down

0 comments on commit a234091

Please sign in to comment.