+
{{ color }}
+
Disabled
+
+
+ {{ color }}
+
+
+
Sizes
+
+
+ {{ size.name }}
+
+
+
+
+# BuiButton
+
+## Props:
+
+### color
+
+Values: `primary` | `secondary` | `text`
+
+### size
+
+Values: `lg` | `md` | `sm`
+
diff --git a/src/components/BuiButton/BuiButton.vue b/src/components/BuiButton/BuiButton.vue
index b314733..e8cf7d1 100644
--- a/src/components/BuiButton/BuiButton.vue
+++ b/src/components/BuiButton/BuiButton.vue
@@ -1,32 +1,91 @@
-
diff --git a/src/components/BuiButton/test/default-disabled.output.html b/src/components/BuiButton/test/default-disabled.output.html
new file mode 100644
index 0000000..d4ac35b
--- /dev/null
+++ b/src/components/BuiButton/test/default-disabled.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/default.output.html b/src/components/BuiButton/test/default.output.html
new file mode 100644
index 0000000..0924082
--- /dev/null
+++ b/src/components/BuiButton/test/default.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/secondaey.output.html b/src/components/BuiButton/test/secondaey.output.html
new file mode 100644
index 0000000..23aa750
--- /dev/null
+++ b/src/components/BuiButton/test/secondaey.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/secondary-disabled.output.html b/src/components/BuiButton/test/secondary-disabled.output.html
new file mode 100644
index 0000000..b443ce6
--- /dev/null
+++ b/src/components/BuiButton/test/secondary-disabled.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/secondary.output.html b/src/components/BuiButton/test/secondary.output.html
new file mode 100644
index 0000000..23c33ba
--- /dev/null
+++ b/src/components/BuiButton/test/secondary.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/text-disabled.output.html b/src/components/BuiButton/test/text-disabled.output.html
new file mode 100644
index 0000000..aaf9e5a
--- /dev/null
+++ b/src/components/BuiButton/test/text-disabled.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/test/text.output.html b/src/components/BuiButton/test/text.output.html
new file mode 100644
index 0000000..aaf9e5a
--- /dev/null
+++ b/src/components/BuiButton/test/text.output.html
@@ -0,0 +1 @@
+
Primary
\ No newline at end of file
diff --git a/src/components/BuiButton/types.ts b/src/components/BuiButton/types.ts
index 8836811..8c1edd9 100644
--- a/src/components/BuiButton/types.ts
+++ b/src/components/BuiButton/types.ts
@@ -1 +1,2 @@
-export type ButtonColor = 'primary' | 'secondary' | 'link'
+export type ButtonColor = 'primary' | 'secondary' | 'text' | 'outline'
+export type ButtonSize = 'lg' | 'md' | 'sm'
diff --git a/src/components/BuiInput/BuiInput.spec.ts b/src/components/BuiInput/BuiInput.spec.ts
index 8c6a36b..574e603 100644
--- a/src/components/BuiInput/BuiInput.spec.ts
+++ b/src/components/BuiInput/BuiInput.spec.ts
@@ -4,17 +4,17 @@ import { describe, expect, test } from 'vitest'
import type { TestWrapper } from '../../types/globalTypes'
describe('BuiInput', () => {
- // @ts-ignore
+ // @ts-ignore-next-line
let wrapper: TestWrapper
- const createComponent = (props: any) => {
+ const createComponent = (props?: any) => {
wrapper = shallowMount(BuiInput, {
global: { stubs: { teleport: true } },
...props
})
}
test('input event fired', async () => {
- createComponent({ props: { color: 'primary' } })
+ createComponent()
const input = wrapper.find('input')
await input.setValue('some-text')
@@ -24,7 +24,7 @@ describe('BuiInput', () => {
})
test('focus event fired', async () => {
- createComponent({ props: { color: 'primary' } })
+ createComponent()
const input = wrapper.find('input')
await input.trigger('focus')
@@ -33,11 +33,55 @@ describe('BuiInput', () => {
})
test('blur event fired', async () => {
- createComponent({ props: { color: 'primary' } })
+ createComponent()
const input = wrapper.find('input')
await input.trigger('blur')
expect(wrapper.emitted()).toHaveProperty('blur')
})
+
+ test('default classes is correct', async () => {
+ createComponent()
+ const input = wrapper.find('input')
+ expect(input.classes().join(' ')).toEqual(
+ 'py-2 px-3 border border-slate-300 dark:border-gray-500 dark:focus:border-primary-500 focus:border-primary-500 bg-transparent rounded-lg focus:ring-4 focus:ring-primary-200 dark:focus:ring-primary-550 outline-none w-full dark:text-gray-100 text-clay-500 placeholder-gray-500'
+ )
+ })
+
+ test('error classes is correct', async () => {
+ createComponent({ props: { validationStatus: 'error' } })
+ const input = wrapper.find('input')
+ expect(input.classes().join(' ')).toEqual(
+ 'py-2 px-3 border dark:border-gray-500 dark:focus:border-primary-500 bg-transparent rounded-lg focus:ring-4 dark:focus:ring-primary-550 outline-none w-full dark:text-gray-100 text-clay-500 placeholder-gray-500 border-red-300 focus:border-red-300 focus:ring-red-200'
+ )
+ })
+
+ test('success classes is correct', async () => {
+ createComponent({ props: { validationStatus: 'success' } })
+ const input = wrapper.find('input')
+ expect(input.classes().join(' ')).toEqual(
+ 'py-2 px-3 border dark:border-gray-500 dark:focus:border-primary-500 bg-transparent rounded-lg focus:ring-4 dark:focus:ring-primary-550 outline-none w-full dark:text-gray-100 text-clay-500 placeholder-gray-500 border-green-300 focus:border-green-300 focus:ring-green-200'
+ )
+ })
+
+ test('hepler slot is rendered', async () => {
+ createComponent({
+ slots: {
+ helper: 'Helper text'
+ }
+ })
+
+ expect(wrapper.text()).toContain('Helper text')
+ })
+
+ test('validation message slot rendered', async () => {
+ createComponent({
+ slots: {
+ validationMessage: 'Validation message'
+ }
+ })
+
+ expect(wrapper.text()).toContain('Validation message')
+ })
})
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 7fdaf93..394cb88 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -7,12 +7,18 @@ module.exports = {
primary: {
100: '#f9f9ff',
150: '#f4f4ff',
+ 175: '#e8e8ff',
200: '#d2d2fd',
+ 225: '#babaf4',
+ 250: '#b1affd',
300: '#adabf9',
400: '#8989ff',
500: '#7371F9',
550: '#5957E8',
+ 575: '#4e4cca',
+ 590: '#5151a8',
600: '#413f7c',
+ 625: '#35345e',
650: '#2f2e51',
700: '#323149',
800: '#292841'
@@ -25,7 +31,9 @@ module.exports = {
},
gray: {
100: '#F5F6F8',
+ 150: '#F8F8FA',
200: '#F8F8FA',
+ 400: '#AAAFBD',
500: '#737680'
},
red: {