-
Notifications
You must be signed in to change notification settings - Fork 752
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
91650f4
commit b35274f
Showing
45 changed files
with
197 additions
and
21 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,34 @@ | ||
:root { | ||
/* ---------------------------------- *\ | ||
Badge sizes | ||
\* ---------------------------------- */ | ||
|
||
|
||
/* Small */ | ||
--cr-badge-small-font-size: #{rem(12)}; | ||
--cr-badge-small-height: #{rem(22)}; | ||
|
||
|
||
/* Medium */ | ||
--cr-badge-medium-font-size: #{rem(13)}; | ||
--cr-badge-medium-height: #{rem(26)}; | ||
|
||
/* ---------------------------------- *\ | ||
Badge styles | ||
\* ---------------------------------- */ | ||
|
||
/* Default */ | ||
--cr-badge-default-background: var(--color-gray-100); | ||
--cr-badge-default-border: var(--color-gray-200); | ||
--cr-badge-default-text: var(--color-gray-900); | ||
|
||
/* White */ | ||
--cr-badge-white-background: var(--color-white); | ||
--cr-badge-white-border: var(--color-gray-200); | ||
--cr-badge-white-text: var(--color-gray-900); | ||
|
||
/* Brand */ | ||
--cr-badge-brand-background: var(--color-brand-50); | ||
--cr-badge-brand-border: var(--color-brand-100); | ||
--cr-badge-brand-text: var(--color-brand-600); | ||
} |
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,3 +1,4 @@ | ||
@import "badge"; | ||
@import "button"; | ||
@import "card"; | ||
@import "checkbox"; | ||
|
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 |
---|---|---|
|
@@ -34,4 +34,4 @@ | |
@import 'form/switch'; | ||
|
||
@import '../../../config/styles'; | ||
@import '../../shared/ui-kit'; | ||
@import '../../ui-kit'; |
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 { badgeSize } from '@/ui-kit/badge/types/BadgeSize'; | ||
import { badgeType } from '@/ui-kit/badge/types/BadgeType'; | ||
import CrBadge from './Badge.vue'; | ||
|
||
export default { | ||
title: 'Crowd.dev/Badge', | ||
component: CrBadge, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
// Props | ||
size: { | ||
description: 'Specifies badge size', | ||
defaultValue: 'medium', | ||
control: 'select', | ||
options: badgeSize, | ||
}, | ||
type: { | ||
description: 'Specifies badge type', | ||
defaultValue: 'default', | ||
control: 'select', | ||
options: badgeType, | ||
}, | ||
|
||
// Slots | ||
default: { | ||
description: 'Text or html content of the radio', | ||
control: { | ||
type: null, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Regular = { | ||
args: { | ||
size: 'medium', | ||
type: 'default', | ||
default: 'Badge', | ||
}, | ||
}; | ||
|
||
export const White = { | ||
args: { | ||
size: 'medium', | ||
type: 'white', | ||
default: 'Badge', | ||
}, | ||
}; | ||
|
||
export const Brand = { | ||
args: { | ||
size: 'medium', | ||
type: 'brand', | ||
default: 'Badge', | ||
}, | ||
}; |
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,30 @@ | ||
<template> | ||
<div | ||
class="c-badge" | ||
:class="[ | ||
`c-badge--${props.size}`, | ||
`c-badge--${props.type}`, | ||
]" | ||
> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { BadgeSize } from '@/ui-kit/badge/types/BadgeSize'; | ||
import { BadgeType } from '@/ui-kit/badge/types/BadgeType'; | ||
const props = withDefaults(defineProps<{ | ||
size?: BadgeSize, | ||
type?: BadgeType, | ||
}>(), { | ||
size: 'medium', | ||
type: 'default', | ||
}); | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'CrBadge', | ||
}; | ||
</script> |
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,41 @@ | ||
.c-badge { | ||
background: var(--cr-badge-background); | ||
border: rem(1) solid var(--cr-badge-border); | ||
color: var(--cr-badge-text); | ||
|
||
font-size: var(--cr-badge-font-size); | ||
height: var(--cr-badge-height); | ||
line-height: calc(var(--cr-badge-height) - rem(2)); | ||
|
||
@apply px-2 rounded-md inline-block font-medium; | ||
|
||
/* Badge types */ | ||
&--default{ | ||
--cr-badge-background: var(--cr-badge-default-background); | ||
--cr-badge-border: var(--cr-badge-default-border); | ||
--cr-badge-text: var(--cr-badge-default-text); | ||
} | ||
|
||
&--white{ | ||
--cr-badge-background: var(--cr-badge-white-background); | ||
--cr-badge-border: var(--cr-badge-white-border); | ||
--cr-badge-text: var(--cr-badge-white-text); | ||
} | ||
|
||
&--brand{ | ||
--cr-badge-background: var(--cr-badge-brand-background); | ||
--cr-badge-border: var(--cr-badge-brand-border); | ||
--cr-badge-text: var(--cr-badge-brand-text); | ||
} | ||
|
||
/* Badge sizes */ | ||
&--small{ | ||
--cr-badge-font-size: var(--cr-badge-small-font-size); | ||
--cr-badge-height: var(--cr-badge-small-height); | ||
} | ||
|
||
&--medium{ | ||
--cr-badge-font-size: var(--cr-badge-medium-font-size); | ||
--cr-badge-height: var(--cr-badge-medium-height); | ||
} | ||
} |
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,6 @@ | ||
export const badgeSize = [ | ||
'small', | ||
'medium', | ||
] as const; | ||
|
||
export type BadgeSize = typeof badgeSize[number]; |
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,7 @@ | ||
export const badgeType = [ | ||
'default', | ||
'white', | ||
'brand', | ||
] as const; | ||
|
||
export type BadgeType = typeof badgeType[number]; |
6 changes: 3 additions & 3 deletions
6
...rc/shared/ui-kit/button/Button.stories.ts → frontend/src/ui-kit/button/Button.stories.ts
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...hared/ui-kit/checkbox/Checkbox.stories.ts → ...d/src/ui-kit/checkbox/Checkbox.stories.ts
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...kit/field-message/FieldMessage.stories.ts → ...kit/field-message/FieldMessage.stories.ts
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
2 changes: 1 addition & 1 deletion
2
...message/constants/fieldMessageTypeData.ts → ...message/constants/fieldMessageTypeData.ts
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
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...t/field-messages/FieldMessages.stories.ts → ...t/field-messages/FieldMessages.stories.ts
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
frontend/src/shared/ui-kit/index.scss → frontend/src/ui-kit/index.scss
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,3 +1,4 @@ | ||
@import 'badge/badge'; | ||
@import 'button/button'; | ||
@import 'card/card'; | ||
@import 'checkbox/checkbox'; | ||
|
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../src/shared/ui-kit/radio/Radio.stories.ts → frontend/src/ui-kit/radio/Radio.stories.ts
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...rc/shared/ui-kit/switch/Switch.stories.ts → frontend/src/ui-kit/switch/Switch.stories.ts
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
File renamed without changes.
File renamed without changes.